blob: bc764af6db544ac2c19f2cedc513c0856a1d238a [file] [log] [blame]
A R Karthicka2e53d62016-02-19 17:38:30 -08001import unittest
Chetan Gaonker1f7c3f82016-03-08 12:17:37 -08002import time
3import os
4from nose.tools import *
A R Karthicka2e53d62016-02-19 17:38:30 -08005from EapTLS import TLSAuthTest
Chetan Gaonker1f7c3f82016-03-08 12:17:37 -08006from OnosCtrl import OnosCtrl
A R Karthicka2e53d62016-02-19 17:38:30 -08007
8class eap_auth_exchange(unittest.TestCase):
Chetan Gaonker1f7c3f82016-03-08 12:17:37 -08009
10 app = 'org.onosproject.aaa'
11
12 def setUp(self):
13 self.onos_ctrl = OnosCtrl(self.app)
14 self.onos_aaa_config()
15
16 def onos_aaa_config(self):
17 aaa_dict = {'apps' : { 'org.onosproject.aaa' : { 'AAA' : { 'radiusSecret': 'radius_password',
18 'radiusIp': '172.17.0.2' } } } }
19 radius_ip = os.getenv('ONOS_AAA_IP') or '172.17.0.2'
20 aaa_dict['apps']['org.onosproject.aaa']['AAA']['radiusIp'] = radius_ip
Chetan Gaonkerf8f77182016-03-11 15:34:57 -080021 #self.onos_ctrl.activate()
22 #time.sleep(2)
Chetan Gaonker1f7c3f82016-03-08 12:17:37 -080023 self.onos_load_config(aaa_dict)
24
25 def onos_load_config(self, config):
26 status, code = self.onos_ctrl.config(config)
27 if status is False:
28 log.info('Configure request for AAA returned status %d' %code)
29 assert_equal(status, True)
Chetan Gaonkerf8f77182016-03-11 15:34:57 -080030 time.sleep(4)
Chetan Gaonker1f7c3f82016-03-08 12:17:37 -080031
A R Karthicka2e53d62016-02-19 17:38:30 -080032 def test_eap_tls(self):
33 tls = TLSAuthTest()
34 tls.runTest()
35
36if __name__ == '__main__':
37 t = TLSAuthTest()
38 t.runTest()
39