A R Karthick | a2e53d6 | 2016-02-19 17:38:30 -0800 | [diff] [blame] | 1 | import unittest |
Chetan Gaonker | 1f7c3f8 | 2016-03-08 12:17:37 -0800 | [diff] [blame] | 2 | import time |
| 3 | import os |
| 4 | from nose.tools import * |
A R Karthick | a2e53d6 | 2016-02-19 17:38:30 -0800 | [diff] [blame] | 5 | from EapTLS import TLSAuthTest |
Chetan Gaonker | 1f7c3f8 | 2016-03-08 12:17:37 -0800 | [diff] [blame] | 6 | from OnosCtrl import OnosCtrl |
A R Karthick | a2e53d6 | 2016-02-19 17:38:30 -0800 | [diff] [blame] | 7 | |
| 8 | class eap_auth_exchange(unittest.TestCase): |
Chetan Gaonker | 1f7c3f8 | 2016-03-08 12:17:37 -0800 | [diff] [blame] | 9 | |
| 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 Gaonker | f8f7718 | 2016-03-11 15:34:57 -0800 | [diff] [blame^] | 21 | #self.onos_ctrl.activate() |
| 22 | #time.sleep(2) |
Chetan Gaonker | 1f7c3f8 | 2016-03-08 12:17:37 -0800 | [diff] [blame] | 23 | 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 Gaonker | f8f7718 | 2016-03-11 15:34:57 -0800 | [diff] [blame^] | 30 | time.sleep(4) |
Chetan Gaonker | 1f7c3f8 | 2016-03-08 12:17:37 -0800 | [diff] [blame] | 31 | |
A R Karthick | a2e53d6 | 2016-02-19 17:38:30 -0800 | [diff] [blame] | 32 | def test_eap_tls(self): |
| 33 | tls = TLSAuthTest() |
| 34 | tls.runTest() |
| 35 | |
| 36 | if __name__ == '__main__': |
| 37 | t = TLSAuthTest() |
| 38 | t.runTest() |
| 39 | |