blob: 5a30c49b49f7bcef460e8bd6fac03d0573ff58f7 [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 Gaonker41d2e072016-03-15 16:41:31 -070021 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 Gaonker41d2e072016-03-15 16:41:31 -070030 time.sleep(3)
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