blob: c239f38d60865d53c69676d611ba39a0326f1392 [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)
Chetan Gaonker41d2e072016-03-15 16:41:31 -070014 self.onos_ctrl.deactivate()
15 time.sleep(2)
Chetan Gaonker1f7c3f82016-03-08 12:17:37 -080016 self.onos_aaa_config()
17
18 def onos_aaa_config(self):
19 aaa_dict = {'apps' : { 'org.onosproject.aaa' : { 'AAA' : { 'radiusSecret': 'radius_password',
20 'radiusIp': '172.17.0.2' } } } }
21 radius_ip = os.getenv('ONOS_AAA_IP') or '172.17.0.2'
22 aaa_dict['apps']['org.onosproject.aaa']['AAA']['radiusIp'] = radius_ip
Chetan Gaonker41d2e072016-03-15 16:41:31 -070023 self.onos_ctrl.activate()
24 time.sleep(2)
Chetan Gaonker1f7c3f82016-03-08 12:17:37 -080025 self.onos_load_config(aaa_dict)
26
27 def onos_load_config(self, config):
28 status, code = self.onos_ctrl.config(config)
29 if status is False:
30 log.info('Configure request for AAA returned status %d' %code)
31 assert_equal(status, True)
Chetan Gaonker41d2e072016-03-15 16:41:31 -070032 time.sleep(3)
Chetan Gaonker1f7c3f82016-03-08 12:17:37 -080033
A R Karthicka2e53d62016-02-19 17:38:30 -080034 def test_eap_tls(self):
35 tls = TLSAuthTest()
36 tls.runTest()
37
38if __name__ == '__main__':
39 t = TLSAuthTest()
40 t.runTest()
41