blob: ffbe5a5c3bfb78ab2d64c8529982ef23b6c80cba [file] [log] [blame]
A R Karthick35495c32017-05-11 14:58:32 -07001import os
2import sys
3import unittest
A.R Karthick8a507cf2017-06-02 18:44:49 -07004import time
Thangavelu K S77c8c0c2017-06-07 18:04:21 +00005import json
6import requests
A R Karthick35495c32017-05-11 14:58:32 -07007from nose.tools import *
Thangavelu K S77c8c0c2017-06-07 18:04:21 +00008from nose.twistedtools import reactor, deferred
9from twisted.internet import defer
A R Karthick35495c32017-05-11 14:58:32 -070010from CordTestConfig import setup_module
11from CordTestUtils import log_test
12from VolthaCtrl import VolthaCtrl
Thangavelu K S77c8c0c2017-06-07 18:04:21 +000013from CordTestUtils import log_test, get_controller
14from portmaps import g_subscriber_port_map
15from OltConfig import *
16from EapTLS import TLSAuthTest
17from OnosCtrl import OnosCtrl
18from CordLogger import CordLogger
19from scapy.all import *
20from scapy_ssl_tls.ssl_tls import *
21from scapy_ssl_tls.ssl_tls_crypto import *
22from CordTestServer import cord_test_onos_restart, cord_test_shell, cord_test_radius_restart
A.R Karthickb9eab5a2017-06-07 16:03:51 -070023from CordContainer import Onos
A R Karthick35495c32017-05-11 14:58:32 -070024
25class voltha_exchange(unittest.TestCase):
26
27 OLT_TYPE = 'tibit_olt'
28 OLT_MAC = '00:0c:e2:31:12:00'
29 VOLTHA_HOST = 'localhost'
30 VOLTHA_REST_PORT = 8881
31 voltha = None
Thangavelu K S77c8c0c2017-06-07 18:04:21 +000032 apps = ('org.opencord.aaa', 'org.onosproject.dhcp')
33 olt_apps = () #'org.opencord.cordmcast')
34 vtn_app = 'org.opencord.vtn'
35 table_app = 'org.ciena.cordigmp'
Thangavelu K S77c8c0c2017-06-07 18:04:21 +000036 test_path = os.path.dirname(os.path.realpath(__file__))
37 table_app_file = os.path.join(test_path, '..', 'apps/ciena-cordigmp-multitable-2.0-SNAPSHOT.oar')
A.R Karthickb9eab5a2017-06-07 16:03:51 -070038 app_file = os.path.join(test_path, '..', 'apps/ciena-cordigmp-2.0-SNAPSHOT.oar')
Thangavelu K S77c8c0c2017-06-07 18:04:21 +000039 olt_app_file = os.path.join(test_path, '..', 'apps/olt-app-1.2-SNAPSHOT.oar')
A.R Karthick3493a572017-06-07 18:28:10 -070040 olt_app_name = 'org.onosproject.olt'
Thangavelu K S77c8c0c2017-06-07 18:04:21 +000041 #onos_config_path = os.path.join(test_path, '..', 'setup/onos-config')
42 olt_conf_file = os.getenv('OLT_CONFIG_FILE', os.path.join(test_path, '..', 'setup/olt_config.json'))
43 onos_restartable = bool(int(os.getenv('ONOS_RESTART', 0)))
44 VOLTHA_ENABLED = True
45 INTF_TX_DEFAULT = 'veth2'
46 INTF_RX_DEFAULT = 'veth0'
47 TESTCASE_TIMEOUT = 300
48 VOLTHA_CONFIG_FAKE = True
49 VOLTHA_UPLINK_VLAN_MAP = { 'of:0000000000000001' : '222' }
50 VOLTHA_ONU_UNI_PORT = 'veth0'
51
52 CLIENT_CERT = """-----BEGIN CERTIFICATE-----
53MIICuDCCAiGgAwIBAgIBAjANBgkqhkiG9w0BAQUFADCBizELMAkGA1UEBhMCVVMx
54CzAJBgNVBAgTAkNBMRIwEAYDVQQHEwlTb21ld2hlcmUxEzARBgNVBAoTCkNpZW5h
55IEluYy4xHjAcBgkqhkiG9w0BCQEWD2FkbWluQGNpZW5hLmNvbTEmMCQGA1UEAxMd
56RXhhbXBsZSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMTYwNjA2MjExMjI3WhcN
57MTcwNjAxMjExMjI3WjBnMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExEzARBgNV
58BAoTCkNpZW5hIEluYy4xFzAVBgNVBAMUDnVzZXJAY2llbmEuY29tMR0wGwYJKoZI
59hvcNAQkBFg51c2VyQGNpZW5hLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkC
60gYEAwvXiSzb9LZ6c7uNziUfKvoHO7wu/uiFC5YUpXbmVGuGZizbVrny0xnR85Dfe
61+9R4diansfDhIhzOUl1XjN3YDeSS9OeF5YWNNE8XDhlz2d3rVzaN6hIhdotBkUjg
62rUewjTg5OFR31QEyG3v8xR3CLgiE9xQELjZbSA07pD79zuUCAwEAAaNPME0wEwYD
63VR0lBAwwCgYIKwYBBQUHAwIwNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL3d3dy5l
64eGFtcGxlLmNvbS9leGFtcGxlX2NhLmNybDANBgkqhkiG9w0BAQUFAAOBgQDAjkrY
656tDChmKbvr8w6Du/t8vHjTCoCIocHTN0qzWOeb1YsAGX89+TrWIuO1dFyYd+Z0KC
66PDKB5j/ygml9Na+AklSYAVJIjvlzXKZrOaPmhZqDufi+rXWti/utVqY4VMW2+HKC
67nXp37qWeuFLGyR1519Y1d6F/5XzqmvbwURuEug==
68-----END CERTIFICATE-----"""
69
70 CLIENT_CERT_INVALID = '''-----BEGIN CERTIFICATE-----
71MIIDvTCCAqWgAwIBAgIBAjANBgkqhkiG9w0BAQUFADCBizELMAkGA1UEBhMCVVMx
72CzAJBgNVBAgTAkNBMRIwEAYDVQQHEwlTb21ld2hlcmUxEzARBgNVBAoTCkNpZW5h
73IEluYy4xHjAcBgkqhkiG9w0BCQEWD2FkbWluQGNpZW5hLmNvbTEmMCQGA1UEAxMd
74RXhhbXBsZSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMTYwMzExMTg1MzM2WhcN
75MTcwMzA2MTg1MzM2WjBnMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExEzARBgNV
76BAoTCkNpZW5hIEluYy4xFzAVBgNVBAMUDnVzZXJAY2llbmEuY29tMR0wGwYJKoZI
77hvcNAQkBFg51c2VyQGNpZW5hLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC
78AQoCggEBAOxemcBsPn9tZsCa5o2JA6sQDC7A6JgCNXXl2VFzKLNNvB9PS6D7ZBsQ
795An0zEDMNzi51q7lnrYg1XyiE4S8FzMGAFr94RlGMQJUbRD9V/oqszMX4k++iAOK
80tIA1gr3x7Zi+0tkjVSVzXTmgNnhChAamdMsjYUG5+CY9WAicXyy+VEV3zTphZZDR
81OjcjEp4m/TSXVPYPgYDXI40YZKX5BdvqykWtT/tIgZb48RS1NPyN/XkCYzl3bv21
82qx7Mc0fcEbsJBIIRYTUkfxnsilcnmLxSYO+p+DZ9uBLBzcQt+4Rd5pLSfi21WM39
832Z2oOi3vs/OYAPAqgmi2JWOv3mePa/8CAwEAAaNPME0wEwYDVR0lBAwwCgYIKwYB
84BQUHAwIwNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL3d3dy5leGFtcGxlLmNvbS9l
85eGFtcGxlX2NhLmNybDANBgkqhkiG9w0BAQUFAAOCAQEALBzMPDTIB6sLyPl0T6JV
86MjOkyldAVhXWiQsTjaGQGJUUe1cmUJyZbUZEc13MygXMPOM4x7z6VpXGuq1c/Vxn
87VzQ2fNnbJcIAHi/7G8W5/SQfPesIVDsHTEc4ZspPi5jlS/MVX3HOC+BDbOjdbwqP
88RX0JEr+uOyhjO+lRxG8ilMRACoBUbw1eDuVDoEBgErSUC44pq5ioDw2xelc+Y6hQ
89dmtYwfY0DbvwxHtA495frLyPcastDiT/zre7NL51MyUDPjjYjghNQEwvu66IKbQ3
90T1tJBrgI7/WI+dqhKBFolKGKTDWIHsZXQvZ1snGu/FRYzg1l+R/jT8cRB9BDwhUt
91yg==
92-----END CERTIFICATE-----'''
A R Karthick35495c32017-05-11 14:58:32 -070093
A.R Karthick3493a572017-06-07 18:28:10 -070094 @classmethod
95 def update_apps_version(cls):
96 version = Onos.getVersion()
97 major = int(version.split('.')[0])
98 minor = int(version.split('.')[1])
99 cordigmp_app_version = '2.0-SNAPSHOT'
100 olt_app_version = '1.2-SNAPSHOT'
101 if major > 1:
102 cordigmp_app_version = '3.0-SNAPSHOT'
103 olt_app_version = '2.0-SNAPSHOT'
104 elif major == 1:
105 if minor > 10:
106 cordigmp_app_version = '3.0-SNAPSHOT'
107 olt_app_version = '2.0-SNAPSHOT'
108 elif minor <= 8:
109 olt_app_version = '1.1-SNAPSHOT'
A.R Karthickb9eab5a2017-06-07 16:03:51 -0700110 cls.app_file = os.path.join(cls.test_path, '..', 'apps/ciena-cordigmp-{}.oar'.format(cordigmp_app_version))
111 cls.table_app_file = os.path.join(cls.test_path, '..', 'apps/ciena-cordigmp-multitable-{}.oar'.format(cordigmp_app_version))
112 cls.olt_app_file = os.path.join(cls.test_path, '..', 'apps/olt-app-{}.oar'.format(olt_app_version))
113
A R Karthick35495c32017-05-11 14:58:32 -0700114 @classmethod
A.R Karthickf874d032017-06-07 18:47:51 -0700115 def onos_load_config(cls, app, config):
116 status, code = OnosCtrl.config(config)
117 if status is False:
118 log_test.info('JSON config request for app %s returned status %d' %(app, code))
119 assert_equal(status, True)
120 time.sleep(2)
121
122 @classmethod
123 def onos_aaa_load(cls):
124 aaa_dict = {'apps' : { 'org.opencord.aaa' : { 'AAA' : { 'radiusSecret': 'radius_password',
125 'radiusIp': '172.17.0.2' } } } }
126 radius_ip = os.getenv('ONOS_AAA_IP') or '172.17.0.2'
127 aaa_dict['apps']['org.opencord.aaa']['AAA']['radiusIp'] = radius_ip
128 cls.onos_load_config('org.opencord.aaa', aaa_dict)
129
130 @classmethod
A R Karthick35495c32017-05-11 14:58:32 -0700131 def setUpClass(cls):
A.R Karthickb9eab5a2017-06-07 16:03:51 -0700132 cls.update_apps_version()
A R Karthick35495c32017-05-11 14:58:32 -0700133 cls.voltha = VolthaCtrl(cls.VOLTHA_HOST, rest_port = cls.VOLTHA_REST_PORT)
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000134 cls.install_app_table()
135 cls.olt = OltConfig(olt_conf_file = cls.olt_conf_file)
136 cls.port_map, cls.port_list = cls.olt.olt_port_map()
137 cls.switches = cls.port_map['switches']
138 cls.num_ports = cls.port_map['num_ports']
139 if cls.num_ports > 1:
140 cls.num_ports -= 1 ##account for the tx port
141 cls.activate_apps(cls.apps + cls.olt_apps)
A.R Karthickf874d032017-06-07 18:47:51 -0700142 cls.onos_aaa_load()
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000143
A.R Karthick3493a572017-06-07 18:28:10 -0700144 @classmethod
145 def tearDownClass(cls):
146 '''Deactivate the olt apps and restart OVS back'''
147 apps = cls.olt_apps + ( cls.table_app,)
148 for app in apps:
149 onos_ctrl = OnosCtrl(app)
150 onos_ctrl.deactivate()
151 cls.install_app_igmp()
A.R Karthickb9eab5a2017-06-07 16:03:51 -0700152
A.R Karthick3493a572017-06-07 18:28:10 -0700153 @classmethod
154 def install_app_igmp(cls):
155 ##Uninstall the table app on class exit
156 OnosCtrl.uninstall_app(cls.table_app)
157 time.sleep(2)
158 log_test.info('Installing back the cord igmp app %s for subscriber test on exit' %(cls.app_file))
159 OnosCtrl.install_app(cls.app_file)
A.R Karthickb9eab5a2017-06-07 16:03:51 -0700160
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000161 def remove_olt(self, switch_map):
162 controller = get_controller()
163 auth = ('karaf', 'karaf')
164 #remove subscriber for every port on all the voltha devices
165 for device, device_map in switch_map.iteritems():
166 uni_ports = device_map['ports']
167 uplink_vlan = device_map['uplink_vlan']
168 for port in uni_ports:
169 rest_url = 'http://{}:8181/onos/olt/oltapp/{}/{}'.format(controller,
170 device,
171 port)
172 resp = requests.delete(rest_url, auth = auth)
173 if resp.status_code not in [204, 202, 200]:
174 log_test.error('Error deleting subscriber for device %s on port %s' %(device, port))
175 else:
176 log_test.info('Deleted subscriber for device %s on port %s' %(device, port))
177 OnosCtrl.uninstall_app(self.olt_app_file)
178
179 def config_olt(self, switch_map):
180 controller = get_controller()
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000181 auth = ('karaf', 'karaf')
182 #configure subscriber for every port on all the voltha devices
183 for device, device_map in switch_map.iteritems():
184 uni_ports = device_map['ports']
185 uplink_vlan = device_map['uplink_vlan']
186 for port in uni_ports:
187 vlan = port
188 rest_url = 'http://{}:8181/onos/olt/oltapp/{}/{}/{}'.format(controller,
189 device,
190 port,
191 vlan)
192 resp = requests.post(rest_url, auth = auth)
193 #assert_equal(resp.ok, True)
194
195 @classmethod
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000196 def install_app_table(cls):
197 ##Uninstall the existing app if any
198 OnosCtrl.uninstall_app(cls.table_app)
199 time.sleep(2)
200 log_test.info('Installing the multi table app %s for subscriber test' %(cls.table_app_file))
201 OnosCtrl.install_app(cls.table_app_file)
202 time.sleep(3)
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000203
204 @classmethod
205 def activate_apps(cls, apps):
206 for app in apps:
207 onos_ctrl = OnosCtrl(app)
208 status, _ = onos_ctrl.activate()
209 assert_equal(status, True)
210 time.sleep(2)
211
212 def tls_flow_check(self, olt_uni_port, cert_info = None):
213 def tls_fail_cb():
214 log_test.info('TLS verification failed')
215 if cert_info is None:
A.R Karthickb9eab5a2017-06-07 16:03:51 -0700216 tls = TLSAuthTest(fail_cb = tls_fail_cb, intf = olt_uni_port)
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000217 log_test.info('Running subscriber %s tls auth test with valid TLS certificate' %olt_uni_port)
218 tls.runTest()
219 assert_equal(tls.failTest, False)
220 if cert_info == "no_cert":
221 tls = TLSAuthTest(fail_cb = tls_fail_cb, intf = olt_uni_port, client_cert = '')
222 log_test.info('Running subscriber %s tls auth test with no TLS certificate' %olt_uni_port)
223 tls.runTest()
224 assert_equal(tls.failTest, True)
225 if cert_info == "invalid_cert":
226 tls = TLSAuthTest(fail_cb = tls_fail_cb, intf = olt_uni_port, client_cert = self.CLIENT_CERT_INVALID)
227 log_test.info('Running subscriber %s tls auth test with invalid TLS certificate' %olt_uni_port)
228 tls.runTest()
229 assert_equal(tls.failTest, True)
230 self.test_status = True
231 return self.test_status
A R Karthick35495c32017-05-11 14:58:32 -0700232
A.R Karthick8a507cf2017-06-02 18:44:49 -0700233 def test_olt_enable_disable(self):
A R Karthick35495c32017-05-11 14:58:32 -0700234 log_test.info('Enabling OLT type %s, MAC %s' %(self.OLT_TYPE, self.OLT_MAC))
A.R Karthick8a507cf2017-06-02 18:44:49 -0700235 device_id, status = self.voltha.enable_device(self.OLT_TYPE, self.OLT_MAC)
236 assert_not_equal(device_id, None)
237 try:
238 assert_equal(status, True)
239 time.sleep(10)
240 finally:
241 self.voltha.disable_device(device_id, delete = True)
Thangavelu K S008f38e2017-05-15 19:36:55 +0000242
A.R Karthick8a507cf2017-06-02 18:44:49 -0700243 def test_ponsim_enable_disable(self):
A.R Karthick8b9c5f12017-05-30 17:47:08 -0700244 log_test.info('Enabling ponsim_olt')
245 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
A.R Karthick8a507cf2017-06-02 18:44:49 -0700246 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
247 assert_not_equal(device_id, None)
248 try:
249 assert_equal(status, True)
250 time.sleep(10)
251 finally:
252 self.voltha.disable_device(device_id, delete = True)
A.R Karthick8b9c5f12017-05-30 17:47:08 -0700253
Thangavelu K S008f38e2017-05-15 19:36:55 +0000254 def test_subscriber_with_voltha_for_eap_tls_authentication(self):
255 """
256 Test Method:
257 0. Make sure that voltha is up and running on CORD-POD setup.
258 1. OLT and ONU is detected and validated.
259 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
260 3. Issue auth request packets from CORD TESTER voltha test module acting as a subscriber..
261 4. Validate that eap tls valid auth packets are being exchanged between subscriber, onos and freeradius.
262 5. Verify that subscriber is authenticated successfully.
263 """
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000264 log_test.info('Enabling ponsim_olt')
265 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
266 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
267 assert_not_equal(device_id, None)
A.R Karthickb9eab5a2017-06-07 16:03:51 -0700268 if status == False:
269 self.voltha.disable_device(device_id, delete = True)
270 assert_equal(status, True)
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000271 time.sleep(10)
272 switch_map = None
273 olt_configured = False
A.R Karthickb9eab5a2017-06-07 16:03:51 -0700274 voltha = VolthaCtrl(self.VOLTHA_HOST,
275 rest_port = self.VOLTHA_REST_PORT,
276 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000277 try:
A.R Karthickb9eab5a2017-06-07 16:03:51 -0700278 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
279 if not switch_map:
280 log_test.info('No voltha devices found')
281 return
282 log_test.info('Installing OLT app')
283 OnosCtrl.install_app(self.olt_app_file)
284 time.sleep(5)
285 log_test.info('Adding subscribers through OLT app')
286 self.config_olt(switch_map)
287 olt_configured = True
288 time.sleep(5)
289 auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT)
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000290 assert_equal(auth_status, True)
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000291 finally:
A.R Karthickb9eab5a2017-06-07 16:03:51 -0700292 if switch_map is not None:
293 if olt_configured is True:
294 self.remove_olt(switch_map)
295 self.voltha.disable_device(device_id, delete = True)
296 time.sleep(10)
297 OnosCtrl.uninstall_app(self.olt_app_name)
Thangavelu K S008f38e2017-05-15 19:36:55 +0000298
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000299 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S008f38e2017-05-15 19:36:55 +0000300 def test_subscriber_with_voltha_for_eap_tls_authentication_failure(self):
301 """
302 Test Method:
303 0. Make sure that voltha is up and running on CORD-POD setup.
304 1. OLT and ONU is detected and validated.
305 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
306 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
307 4. Validate that eap tls without cert auth packet is being exchanged between subscriber, onos and freeradius.
308 5. Verify that subscriber authentication is unsuccessful..
309 """
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000310 df = defer.Deferred()
311 def tls_flow_check_with_no_cert_scenario(df):
312 log_test.info('Enabling ponsim_olt')
313 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
314 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
315 assert_not_equal(device_id, None)
316 voltha = VolthaCtrl(self.VOLTHA_HOST,
A.R Karthickb9eab5a2017-06-07 16:03:51 -0700317 rest_port = self.VOLTHA_REST_PORT,
318 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000319 time.sleep(10)
320 switch_map = None
321 olt_configured = False
322 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
323 log_test.info('Installing OLT app')
324 OnosCtrl.install_app(self.olt_app_file)
325 time.sleep(5)
326 log_test.info('Adding subscribers through OLT app')
327 self.config_olt(switch_map)
328 olt_configured = True
329 time.sleep(5)
330 auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT, cert_info = "no_cert")
331 try:
332 assert_equal(auth_status, True)
333 assert_equal(status, True)
334 time.sleep(10)
335 finally:
A.R Karthickb9eab5a2017-06-07 16:03:51 -0700336 self.remove_olt(switch_map)
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000337 self.voltha.disable_device(device_id, delete = True)
338 df.callback(0)
A.R Karthickb9eab5a2017-06-07 16:03:51 -0700339
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000340 reactor.callLater(0, tls_flow_check_with_no_cert_scenario, df)
341 return df
Thangavelu K S008f38e2017-05-15 19:36:55 +0000342
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000343 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S008f38e2017-05-15 19:36:55 +0000344 def test_subscriber_with_voltha_for_eap_tls_authentication_using_invalid_cert(self):
345 """
346 Test Method:
347 0. Make sure that voltha is up and running on CORD-POD setup.
348 1. OLT and ONU is detected and validated.
349 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
350 3. Issue tls auth packets and exchange invalid cert from CORD TESTER voltha test module acting as a subscriber..
351 4. Validate that eap tls with invalid cert auth packet is being exchanged between subscriber, onos and freeradius.
352 5. Verify that subscriber authentication is unsuccessful..
353 """
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000354 df = defer.Deferred()
355 def tls_flow_check_with_invalid_cert_scenario(df):
356 log_test.info('Enabling ponsim_olt')
357 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
358 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
359 assert_not_equal(device_id, None)
360 voltha = VolthaCtrl(self.VOLTHA_HOST,
361 rest_port = self.VOLTHA_REST_PORT,
362 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
363 time.sleep(10)
364 switch_map = None
365 olt_configured = False
366 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
367 log_test.info('Installing OLT app')
368 OnosCtrl.install_app(self.olt_app_file)
369 time.sleep(5)
370 log_test.info('Adding subscribers through OLT app')
371 self.config_olt(switch_map)
372 olt_configured = True
373 time.sleep(5)
374 auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT, cert_info = "invalid_cert")
375 try:
376 assert_equal(auth_status, True)
377 assert_equal(status, True)
378 time.sleep(10)
379 finally:
A.R Karthickb9eab5a2017-06-07 16:03:51 -0700380 self.remove_olt(switch_map)
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000381 self.voltha.disable_device(device_id, delete = True)
382 df.callback(0)
383 reactor.callLater(0, tls_flow_check_with_invalid_cert_scenario, df)
384 return df
Thangavelu K S008f38e2017-05-15 19:36:55 +0000385
386 def test_subscriber_with_voltha_for_eap_tls_authentication_with_aaa_app_deactivation(self):
387 """
388 Test Method:
389 0. Make sure that voltha is up and running on CORD-POD setup.
390 1. OLT and ONU is detected and validated.
391 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
392 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
393 4. Validate that eap tls without sending client hello, it's not being exchanged between client, onos and freeradius.
394 5. Verify that subscriber authentication is unsuccessful..
395 """
396
397 def test_subscriber_with_voltha_for_eap_tls_authentication_restarting_radius_server(self):
398 """
399 Test Method:
400 0. Make sure that voltha is up and running on CORD-POD setup.
401 1. OLT and ONU is detected and validated.
402 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
403 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
404 4. Validate that eap tls with restart of radius server and packets are being exchanged between subscriber, onos and freeradius.
405 5. Verify that subscriber authentication is unsuccessful..
406 """
407
408 def test_subscriber_with_voltha_for_eap_tls_authentication_with_disabled_olt(self):
409 """
410 Test Method:
411 0. Make sure that voltha is up and running on CORD-POD setup.
412 1. OLT and ONU is detected and validated.
413 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
414 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
415 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius.
416 6. Verify that subscriber authenticated successfully.
417 7. Disable olt which is seen in voltha and issue tls auth packets from subscriber.
418 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius.
419 9. Verify that subscriber authentication is unsuccessful..
420 """
421
422 def test_subscriber_with_voltha_for_eap_tls_authentication_disabling_uni_port_in_voltha(self):
423 """
424 Test Method:
425 0. Make sure that voltha is up and running on CORD-POD setup.
426 1. OLT and ONU is detected and validated.
427 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
428 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
429 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius.
430 6. Verify that subscriber authenticated successfully.
431 7. Disable uni port which is seen in voltha and issue tls auth packets from subscriber.
432 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius.
433 9. Verify that subscriber authentication is unsuccessful..
434 """
435
436 def test_subscriber_with_voltha_for_eap_tls_authentication_restarting_olt(self):
437 """
438 Test Method:
439 0. Make sure that voltha is up and running on CORD-POD setup.
440 1. OLT and ONU is detected and validated.
441 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
442 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
443 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius.
444 6. Verify that subscriber authenticated successfully.
445 7. Restart olt which is seen in voltha and issue tls auth packets from subscriber.
446 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius.
447 9. Verify that subscriber authentication is unsuccessful..
448 """
449
450 def test_subscriber_with_voltha_for_eap_tls_authentication_restarting_onu(self):
451 """
452 Test Method:
453 0. Make sure that voltha is up and running on CORD-POD setup.
454 1. OLT and ONU is detected and validated.
455 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
456 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
457 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius.
458 6. Verify that subscriber authenticated successfully.
459 7. Restart onu which is seen in voltha and issue tls auth packets from subscriber.
460 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius.
461 9. Verify that subscriber authentication is unsuccessful..
462 """
463
464 def test_two_subscribers_with_voltha_for_eap_tls_authentication(self):
465 """
466 Test Method:
467 0. Make sure that voltha is up and running on CORD-POD setup.
468 1. OLT is detected and ONU ports(nni and 2 uni's) are being seen.
469 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
470 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
471 4. Validate that eap tls valid auth packets are being exchanged between two subscriber, onos and freeradius.
472 5. Verify that two subscribers are authenticated successfully.
473 """
474
475 def test_two_subscribers_with_voltha_for_eap_tls_authentication_using_same_certificates(self):
476 """
477 Test Method:
478 0. Make sure that voltha is up and running on CORD-POD setup.
479 1. OLT is detected and ONU ports(nni and 2 uni's) are being seen.
480 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
481 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
482 4. Validate that two valid certificates are being exchanged between two subscriber, onos and freeradius.
483 5. Verify that two subscribers are not authenticated.
484 """
485
486 def test_two_subscribers_with_voltha_for_eap_tls_authentication_initiating_invalid_tls_packets_for_one_subscriber(self):
487 """
488 Test Method:
489 0. Make sure that voltha is up and running on CORD-POD setup.
490 1. OLT is detected and ONU ports(nni and 2 uni's) are being seen.
491 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
492 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
493 4. Validate that eap tls valid auth packets are being exchanged between valid subscriber, onos and freeradius.
494 5. Validate that eap tls valid auth packets are being exchanged between invalid client, onos and freeradius.
495 6. Verify that valid subscriber authenticated successfully.
496 7. Verify that invalid subscriber are not authenticated successfully.
497 """
498
499 def test_two_subscribers_with_voltha_for_eap_tls_authentication_initiating_invalid_cert_for_one_subscriber(self):
500 """
501 Test Method:
502 0. Make sure that voltha is up and running on CORD-POD setup.
503 1. OLT is detected and ONU ports(nni and 2 uni's) are being seen.
504 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
505 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
506 4. Validate that eap tls valid auth packets are being exchanged between valid subscriber, onos and freeradius.
507 5. Validate that eap tls invalid cert auth packets are being exchanged between invalid subscriber, onos and freeradius.
508 6. Verify that valid subscriber authenticated successfully.
509 7. Verify that invalid subscriber are not authenticated successfully.
510 """
511
512 def test_two_subscribers_with_voltha_for_eap_tls_authentication_with_one_uni_port_disabled(self):
513 """
514 Test Method:
515 0. Make sure that voltha is up and running on CORD-POD setup.
516 1. OLT and ONU is detected and validated.
517 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
518 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
519 5. Validate that eap tls packets are being exchanged between two subscriber, onos and freeradius.
520 6. Verify that subscriber authenticated successfully.
521 7. Disable one of the uni port which is seen in voltha and issue tls auth packets from subscriber.
522 8. Validate that eap tls packets are not being exchanged between one subscriber, onos and freeradius.
523 9. Verify that subscriber authentication is unsuccessful..
524 10. Verify that other subscriber authenticated successfully.
525 """
526
527 def test_subscriber_with_voltha_for_dhcp_request(self):
528 """
529 Test Method:
530 0. Make sure that voltha is up and running on CORD-POD setup.
531 1. OLT and ONU is detected and validated.
532 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
533 3. Send dhcp request from residential subscrber to dhcp server which is running as onos app.
534 4. Verify that subscriber get ip from dhcp server successfully.
535 """
536
537 def test_subscriber_with_voltha_for_dhcp_request_with_invalid_broadcast_source_mac(self):
538 """
539 Test Method:
540 0. Make sure that voltha is up and running on CORD-POD setup.
541 1. OLT and ONU is detected and validated.
542 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
543 3. Send dhcp request with invalid source mac broadcast from residential subscrber to dhcp server which is running as onos app.
544 4. Verify that subscriber should not get ip from dhcp server.
545 """
546
547 def test_subscriber_with_voltha_for_dhcp_request_with_invalid_multicast_source_mac(self):
548 """
549 Test Method:
550 0. Make sure that voltha is up and running on CORD-POD setup.
551 1. OLT and ONU is detected and validated.
552 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
553 3. Send dhcp request with invalid source mac multicast from residential subscrber to dhcp server which is running as onos app.
554 4. Verify that subscriber should not get ip from dhcp server.
555 """
556
557 def test_subscriber_with_voltha_for_dhcp_request_with_invalid_source_mac(self):
558 """
559 Test Method:
560 0. Make sure that voltha is up and running on CORD-POD setup.
561 1. OLT and ONU is detected and validated.
562 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
563 3. Send dhcp request with invalid source mac zero from residential subscrber to dhcp server which is running as onos app.
564 4. Verify that subscriber should not get ip from dhcp server.
565 """
566
567 def test_subscriber_with_voltha_for_dhcp_request_and_release(self):
568 """
569 Test Method:
570 0. Make sure that voltha is up and running on CORD-POD setup.
571 1. OLT and ONU is detected and validated.
572 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
573 3. Send dhcp request from residential subscrber to dhcp server which is running as onos app.
574 4. Verify that subscriber get ip from dhcp server successfully.
575 5. Send dhcp release from residential subscrber to dhcp server which is running as onos app.
576 6 Verify that subscriber should not get ip from dhcp server, ping to gateway.
577 """
578
A.R Karthick57fa9372017-05-24 12:47:03 -0700579 def test_subscriber_with_voltha_for_dhcp_starvation_positive_scenario(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +0000580 """
581 Test Method:
582 0. Make sure that voltha is up and running on CORD-POD setup.
583 1. OLT and ONU is detected and validated.
584 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
585 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
586 4. Verify that subscriber get ip from dhcp server successfully.
587 5. Repeat step 3 and 4 for 10 times.
588 6 Verify that subscriber should get ip from dhcp server.
589 """
590
591 def test_subscriber_with_voltha_for_dhcp_starvation_negative_scenario(self):
592 """
593 Test Method:
594 0. Make sure that voltha is up and running on CORD-POD setup.
595 1. OLT and ONU is detected and validated.
596 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
597 3. Send dhcp request from residential subscriber without of pool ip to dhcp server which is running as onos app.
598 4. Verify that subscriber should not get ip from dhcp server.
599 5. Repeat steps 3 and 4 for 10 times.
600 6 Verify that subscriber should not get ip from dhcp server.
601 """
602 def test_subscriber_with_voltha_for_dhcp_sending_multiple_discover(self):
603 """
604 Test Method:
605 0. Make sure that voltha is up and running on CORD-POD setup.
606 1. OLT and ONU is detected and validated.
607 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
608 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
609 4. Verify that subscriber get ip from dhcp server successfully.
610 5. Repeat step 3 for 50 times.
611 6 Verify that subscriber should get same ip which was received from 1st discover from dhcp server.
612 """
613 def test_subscriber_with_voltha_for_dhcp_sending_multiple_request(self):
614 """
615 Test Method:
616 0. Make sure that voltha is up and running on CORD-POD setup.
617 1. OLT and ONU is detected and validated.
618 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
619 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
620 4. Verify that subscriber get ip from dhcp server successfully.
621 5. Send DHCP request to dhcp server which is running as onos app.
622 6. Repeat step 5 for 50 times.
623 7. Verify that subscriber should get same ip which was received from 1st discover from dhcp server.
624 """
625
626 def test_subscriber_with_voltha_for_dhcp_requesting_desired_ip_address(self):
627 """
628 Test Method:
629 0. Make sure that voltha is up and running on CORD-POD setup.
630 1. OLT and ONU is detected and validated.
631 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
632 3. Send dhcp request with desired ip address from residential subscriber to dhcp server which is running as onos app.
633 4. Verify that subscriber get ip which was requested in step 3 from dhcp server successfully.
634 """
635
636 def test_subscriber_with_voltha_for_dhcp_requesting_desired_out_pool_ip_address(self):
637 """
638 Test Method:
639 0. Make sure that voltha is up and running on CORD-POD setup.
640 1. OLT and ONU is detected and validated.
641 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
642 3. Send dhcp request with desired out of pool ip address from residential subscriber to dhcp server which is running as onos app.
643 4. Verify that subscriber should not get ip which was requested in step 3 from dhcp server, and its offered only within dhcp pool of ip.
644 """
645 def test_subscriber_with_voltha_for_dhcp_deactivate_dhcp_app_in_onos(self):
646 """
647 Test Method:
648 0. Make sure that voltha is up and running on CORD-POD setup.
649 1. OLT and ONU is detected and validated.
650 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
651 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
652 4. Verify that subscriber get ip from dhcp server successfully.
653 5. Deactivate dhcp server app in onos.
654 6. Repeat step 3.
655 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway.
656 """
657 def test_subscriber_with_voltha_for_dhcp_renew_time(self):
658 """
659 Test Method:
660 0. Make sure that voltha is up and running on CORD-POD setup.
661 1. OLT and ONU is detected and validated.
662 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
663 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
664 4. Verify that subscriber get ip from dhcp server successfully.
665 5. Send dhcp renew packet to dhcp server which is running as onos app.
666 6. Repeat step 4.
667 """
668 def test_subscriber_with_voltha_for_dhcp_rebind_time(self):
669 """
670 Test Method:
671 0. Make sure that voltha is up and running on CORD-POD setup.
672 1. OLT and ONU is detected and validated.
673 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
674 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
675 4. Verify that subscriber get ip from dhcp server successfully.
676 5. Send dhcp rebind packet to dhcp server which is running as onos app.
677 6. Repeat step 4.
678 """
679 def test_subscriber_with_voltha_for_dhcp_disable_olt_in_voltha(self):
680 """
681 Test Method:
682 0. Make sure that voltha is up and running on CORD-POD setup.
683 1. OLT and ONU is detected and validated.
684 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
685 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
686 4. Verify that subscriber get ip from dhcp server successfully.
687 5. Disable olt devices which is being detected in voltha CLI.
688 6. Repeat step 3.
689 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway.
690 """
691 def test_subscriber_with_voltha_for_dhcp_disable_enable_olt_in_voltha(self):
692 """
693 Test Method:
694 0. Make sure that voltha is up and running on CORD-POD setup.
695 1. OLT and ONU is detected and validated.
696 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
697 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
698 4. Verify that subscriber get ip from dhcp server successfully.
699 5. Disable olt devices which is being detected in voltha CLI.
700 6. Repeat step 3.
701 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway.
702 8. Enable olt devices which is being detected in voltha CLI.
703 9. Repeat steps 3 and 4.
704 """
705 def test_subscriber_with_voltha_for_dhcp_disable_onu_port_in_voltha(self):
706 """
707 Test Method:
708 0. Make sure that voltha is up and running on CORD-POD setup.
709 1. OLT and ONU is detected and validated.
710 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
711 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
712 4. Verify that subscriber get ip from dhcp server successfully.
713 5. Disable onu port which is being detected in voltha CLI.
714 6. Repeat step 3.
715 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway.
716 """
717 def test_subscriber_with_voltha_for_dhcp_disable_enable_onu_port_in_voltha(self):
718 """
719 Test Method:
720 0. Make sure that voltha is up and running on CORD-POD setup.
721 1. OLT and ONU is detected and validated.
722 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
723 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
724 4. Verify that subscriber get ip from dhcp server successfully.
725 5. Disable onu port which is being detected in voltha CLI.
726 6. Repeat step 3.
727 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway.
728 8. Enable onu port which is being detected in voltha CLI.
729 9. Repeat steps 3 and 4.
730 """
731
732 def test_two_subscriber_with_voltha_for_dhcp_discover(self):
733 """
734 Test Method:
735 0. Make sure that voltha is up and running on CORD-POD setup.
736 1. OLT and ONU is detected and validated.
737 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
738 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app.
739 4. Verify that subscribers had got different ips from dhcp server successfully.
740 """
741
742 def test_two_subscriber_with_voltha_for_dhcp_multiple_discover(self):
743 """
744 Test Method:
745 0. Make sure that voltha is up and running on CORD-POD setup.
746 1. OLT and ONU is detected and validated.
747 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
748 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app.
749 4. Verify that subscribers had got ip from dhcp server successfully.
750 5. Repeat step 3 and 4 for 10 times for both subscribers.
751 6 Verify that subscribers should get same ips which are offered the first time from dhcp server.
752 """
753 def test_two_subscriber_with_voltha_for_dhcp_multiple_discover_for_one_subscriber(self):
754 """
755 Test Method:
756 0. Make sure that voltha is up and running on CORD-POD setup.
757 1. OLT and ONU is detected and validated.
758 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
759 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app.
760 4. Verify that subscribers had got ip from dhcp server successfully.
761 5. Repeat step 3 and 4 for 10 times for only one subscriber and ping to gateway from other subscriber.
762 6 Verify that subscriber should get same ip which is offered the first time from dhcp server and other subscriber ping to gateway should not failed
763 """
764 def test_two_subscriber_with_voltha_for_dhcp_discover_desired_ip_address_for_one_subscriber(self):
765 """
766 Test Method:
767 0. Make sure that voltha is up and running on CORD-POD setup.
768 1. OLT and ONU is detected and validated.
769 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
770 3. Send dhcp request from one residential subscriber to dhcp server which is running as onos app.
771 3. Send dhcp request with desired ip from other residential subscriber to dhcp server which is running as onos app.
772 4. Verify that subscribers had got different ips (one subscriber desired ip and other subscriber random ip) from dhcp server successfully.
773 """
774 def test_two_subscriber_with_voltha_for_dhcp_discover_within_and_wothout_dhcp_pool_ip_addresses(self):
775 """
776 Test Method:
777 0. Make sure that voltha is up and running on CORD-POD setup.
778 1. OLT and ONU is detected and validated.
779 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
780 3. Send dhcp request with desired wihtin dhcp pool ip from one residential subscriber to dhcp server which is running as onos app.
781 3. Send dhcp request with desired without in dhcp pool ip from other residential subscriber to dhcp server which is running as onos app.
782 4. Verify that subscribers had got different ips (both subscriber got random ips within dhcp pool) from dhcp server successfully.
783 """
784 def test_two_subscriber_with_voltha_for_dhcp_disable_onu_port_for_one_subscriber(self):
785 """
786 Test Method:
787 0. Make sure that voltha is up and running on CORD-POD setup.
788 1. OLT and ONU is detected and validated.
789 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
790 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app.
791 4. Verify that subscribers had got ip from dhcp server successfully.
792 5. Disable onu port on which access one subscriber and ping to gateway from other subscriber.
793 6. Repeat step 3 and 4 for one subscriber where uni port is down.
794 7. Verify that subscriber should not get ip from dhcp server and other subscriber ping to gateway should not failed.
795 """
796 def test_two_subscriber_with_voltha_for_dhcp_disable_enable_onu_port_for_one_subscriber(self):
797 """
798 Test Method:
799 0. Make sure that voltha is up and running on CORD-POD setup.
800 1. OLT and ONU is detected and validated.
801 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
802 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app.
803 4. Verify that subscribers had got ip from dhcp server successfully.
804 5. Disable onu port on which access one subscriber and ping to gateway from other subscriber.
805 6. Repeat step 3 and 4 for one subscriber where uni port is down.
806 7. Verify that subscriber should not get ip from dhcp server and other subscriber ping to gateway should not failed.
807 8. Enable onu port on which was disable at step 5 and ping to gateway from other subscriber.
808 9. Repeat step 3 and 4 for one subscriber where uni port is up now.
809 10. Verify that subscriber should get ip from dhcp server and other subscriber ping to gateway should not failed.
810 """
811 def test_two_subscriber_with_voltha_for_dhcp_disable_olt_detected_in_voltha(self):
812 """
813 Test Method:
814 0. Make sure that voltha is up and running on CORD-POD setup.
815 1. OLT and ONU is detected and validated.
816 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
817 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app.
818 4. Verify that subscribers had got ip from dhcp server successfully.
819 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber.
820 6. Disable the olt device which is detected in voltha.
821 7. Verify that subscriber should not get ip from dhcp server and other subscriber ping to gateway should failed.
822 """
823 def test_two_subscriber_with_voltha_for_dhcp_disable_enable_olt_detected_in_voltha(self):
824 """
825 Test Method:
826 0. Make sure that voltha is up and running on CORD-POD setup.
827 1. OLT and ONU is detected and validated.
828 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
829 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app.
830 4. Verify that subscribers had got ip from dhcp server successfully.
831 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber.
832 6. Disable the olt device which is detected in voltha.
833 7. Verify that subscriber should not get ip from dhcp server and other subscriber ping to gateway should failed.
834 8. Enable the olt device which is detected in voltha.
835 9. Verify that subscriber should get ip from dhcp server and other subscriber ping to gateway should not failed.
836 """
837 def test_two_subscriber_with_voltha_for_dhcp_pause_olt_detected_in_voltha(self):
838 """
839 Test Method:
840 0. Make sure that voltha is up and running on CORD-POD setup.
841 1. OLT and ONU is detected and validated.
842 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
843 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app.
844 4. Verify that subscribers had got ip from dhcp server successfully.
845 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber.
846 6. Pause the olt device which is detected in voltha.
847 7. Verify that subscriber should not get ip from dhcp server and other subscriber ping to gateway should failed.
848 """
849 def test_subscriber_with_voltha_for_dhcpRelay_dhcp_request(self):
850 """
851 Test Method:
852 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
853 1. OLT and ONU is detected and validated.
854 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
855 3. Send dhcp request from residential subscrber to external dhcp server.
856 4. Verify that subscriber get ip from external dhcp server successfully.
857 """
858
859 def test_subscriber_with_voltha_for_dhcpRelay_dhcp_request_with_invalid_broadcast_source_mac(self):
860 """
861 Test Method:
862 0. Make sure that voltha and external dhcp server are is up and running on CORD-POD setup.
863 1. OLT and ONU is detected and validated.
864 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
865 3. Send dhcp request with invalid source mac broadcast from residential subscrber to external dhcp server.
866 4. Verify that subscriber should not get ip from external dhcp server.
867 """
868
869 def test_subscriber_with_voltha_for_dhcpRelay_dhcp_request_with_invalid_multicast_source_mac(self):
870 """
871 Test Method:
872 0. Make sure that voltha and external dhcp server are is up and running on CORD-POD setup.
873 1. OLT and ONU is detected and validated.
874 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
875 3. Send dhcp request with invalid source mac multicast from residential subscrber to external dhcp server.
876 4. Verify that subscriber should not get ip from external dhcp server.
877 """
878
879 def test_subscriber_with_voltha_for_dhcpRelay_dhcp_request_with_invalid_source_mac(self):
880 """
881 Test Method:
882 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
883 1. OLT and ONU is detected and validated.
884 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
885 3. Send dhcp request with invalid source mac zero from residential subscrber to external dhcp server.
886 4. Verify that subscriber should not get ip from external dhcp server.
887 """
888
889 def test_subscriber_with_voltha_for_dhcpRelay_dhcp_request_and_release(self):
890 """
891 Test Method:
892 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
893 1. OLT and ONU is detected and validated.
894 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
895 3. Send dhcp request from residential subscrber to external dhcp server.
896 4. Verify that subscriber get ip from external dhcp server successfully.
897 5. Send dhcp release from residential subscrber to external dhcp server.
898 6 Verify that subscriber should not get ip from external dhcp server, ping to gateway.
899 """
900
901 def test_subscriber_with_voltha_for_dhcpRelay_starvation(self):
902 """
903 Test Method:
904 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
905 1. OLT and ONU is detected and validated.
906 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
907 3. Send dhcp request from residential subscriber to external dhcp server.
908 4. Verify that subscriber get ip from external dhcp server. successfully.
909 5. Repeat step 3 and 4 for 10 times.
910 6 Verify that subscriber should get ip from external dhcp server..
911 """
912
913 def test_subscriber_with_voltha_for_dhcpRelay_starvation_negative_scenario(self):
914 """
915 Test Method:
916 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
917 1. OLT and ONU is detected and validated.
918 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
919 3. Send dhcp request from residential subscriber without of pool ip to external dhcp server.
920 4. Verify that subscriber should not get ip from external dhcp server..
921 5. Repeat steps 3 and 4 for 10 times.
922 6 Verify that subscriber should not get ip from external dhcp server..
923 """
924 def test_subscriber_with_voltha_for_dhcpRelay_sending_multiple_discover(self):
925 """
926 Test Method:
927 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
928 1. OLT and ONU is detected and validated.
929 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
930 3. Send dhcp request from residential subscriber to external dhcp server.
931 4. Verify that subscriber get ip from external dhcp server. successfully.
932 5. Repeat step 3 for 50 times.
933 6 Verify that subscriber should get same ip which was received from 1st discover from external dhcp server..
934 """
935 def test_subscriber_with_voltha_for_dhcpRelay_sending_multiple_request(self):
936 """
937 Test Method:
938 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
939 1. OLT and ONU is detected and validated.
940 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
941 3. Send dhcp request from residential subscriber to external dhcp server.
942 4. Verify that subscriber get ip from external dhcp server. successfully.
943 5. Send DHCP request to external dhcp server.
944 6. Repeat step 5 for 50 times.
945 7. Verify that subscriber should get same ip which was received from 1st discover from external dhcp server..
946 """
947
948 def test_subscriber_with_voltha_for_dhcpRelay_requesting_desired_ip_address(self):
949 """
950 Test Method:
951 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
952 1. OLT and ONU is detected and validated.
953 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
954 3. Send dhcp request with desired ip address from residential subscriber to external dhcp server.
955 4. Verify that subscriber get ip which was requested in step 3 from external dhcp server. successfully.
956 """
957
958 def test_subscriber_with_voltha_for_dhcpRelay_requesting_desired_out_of_pool_ip_address(self):
959 """
960 Test Method:
961 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
962 1. OLT and ONU is detected and validated.
963 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
964 3. Send dhcp request with desired out of pool ip address from residential subscriber to external dhcp server.
965 4. Verify that subscriber should not get ip which was requested in step 3 from external dhcp server., and its offered only within dhcp pool of ip.
966 """
967
968 def test_subscriber_with_voltha_for_dhcpRelay_deactivating_dhcpRelay_app_in_onos(self):
969 """
970 Test Method:
971 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
972 1. OLT and ONU is detected and validated.
973 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
974 3. Send dhcp request from residential subscriber to external dhcp server.
975 4. Verify that subscriber get ip from external dhcp server. successfully.
976 5. Deactivate dhcp server app in onos.
977 6. Repeat step 3.
978 7. Verify that subscriber should not get ip from external dhcp server., and ping to gateway.
979 """
980
981 def test_subscriber_with_voltha_for_dhcpRelay_renew_time(self):
982 """
983 Test Method:
984 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
985 1. OLT and ONU is detected and validated.
986 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
987 3. Send dhcp request from residential subscriber to external dhcp server.
988 4. Verify that subscriber get ip from external dhcp server. successfully.
989 5. Send dhcp renew packet to external dhcp server.
990 6. Repeat step 4.
991 """
992
993 def test_subscriber_with_voltha_for_dhcpRelay_rebind_time(self):
994 """
995 Test Method:
996 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
997 1. OLT and ONU is detected and validated.
998 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
999 3. Send dhcp request from residential subscriber to external dhcp server.
1000 4. Verify that subscriber get ip from external dhcp server. successfully.
1001 5. Send dhcp rebind packet to external dhcp server.
1002 6. Repeat step 4.
1003 """
1004
1005 def test_subscriber_with_voltha_for_dhcpRelay_disable_olt_in_voltha(self):
1006 """
1007 Test Method:
1008 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
1009 1. OLT and ONU is detected and validated.
1010 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1011 3. Send dhcp request from residential subscriber to external dhcp server.
1012 4. Verify that subscriber get ip from external dhcp server. successfully.
1013 5. Disable olt devices which is being detected in voltha CLI.
1014 6. Repeat step 3.
1015 7. Verify that subscriber should not get ip from external dhcp server., and ping to gateway.
1016 """
1017
1018 def test_subscriber_with_voltha_for_dhcpRelay_toggling_olt_in_voltha(self):
1019 """
1020 Test Method:
1021 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
1022 1. OLT and ONU is detected and validated.
1023 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1024 3. Send dhcp request from residential subscriber to external dhcp server.
1025 4. Verify that subscriber get ip from external dhcp server. successfully.
1026 5. Disable olt devices which is being detected in voltha CLI.
1027 6. Repeat step 3.
1028 7. Verify that subscriber should not get ip from external dhcp server., and ping to gateway.
1029 8. Enable olt devices which is being detected in voltha CLI.
1030 9. Repeat steps 3 and 4.
1031 """
1032
1033 def test_subscriber_with_voltha_for_dhcpRelay_disable_onu_port_in_voltha(self):
1034 """
1035 Test Method:
1036 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
1037 1. OLT and ONU is detected and validated.
1038 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1039 3. Send dhcp request from residential subscriber to external dhcp server.
1040 4. Verify that subscriber get ip from external dhcp server. successfully.
1041 5. Disable onu port which is being detected in voltha CLI.
1042 6. Repeat step 3.
1043 7. Verify that subscriber should not get ip from external dhcp server., and ping to gateway.
1044 """
1045
1046 def test_subscriber_with_voltha_for_dhcpRelay_disable_enable_onu_port_in_voltha(self):
1047 """
1048 Test Method:
1049 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
1050 1. OLT and ONU is detected and validated.
1051 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1052 3. Send dhcp request from residential subscriber to external dhcp server.
1053 4. Verify that subscriber get ip from external dhcp server. successfully.
1054 5. Disable onu port which is being detected in voltha CLI.
1055 6. Repeat step 3.
1056 7. Verify that subscriber should not get ip from external dhcp server., and ping to gateway.
1057 8. Enable onu port which is being detected in voltha CLI.
1058 9. Repeat steps 3 and 4.
1059 """
1060
1061 def test_two_subscriber_with_voltha_for_dhcpRelay_discover(self):
1062 """
1063 Test Method:
1064 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
1065 1. OLT and ONU is detected and validated.
1066 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1067 3. Send dhcp request from two residential subscribers to external dhcp server.
1068 4. Verify that subscribers had got different ips from external dhcp server. successfully.
1069 """
1070
1071 def test_two_subscriber_with_voltha_for_dhcpRelay_multiple_discover(self):
1072 """
1073 Test Method:
1074 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
1075 1. OLT and ONU is detected and validated.
1076 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1077 3. Send dhcp request from two residential subscribers to external dhcp server.
1078 4. Verify that subscribers had got ip from external dhcp server. successfully.
1079 5. Repeat step 3 and 4 for 10 times for both subscribers.
1080 6 Verify that subscribers should get same ips which are offered the first time from external dhcp server..
1081 """
1082
1083 def test_two_subscriber_with_voltha_for_dhcpRelay_multiple_discover_for_one_subscriber(self):
1084 """
1085 Test Method:
1086 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
1087 1. OLT and ONU is detected and validated.
1088 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1089 3. Send dhcp request from two residential subscribers to external dhcp server.
1090 4. Verify that subscribers had got ip from external dhcp server. successfully.
1091 5. Repeat step 3 and 4 for 10 times for only one subscriber and ping to gateway from other subscriber.
1092 6 Verify that subscriber should get same ip which is offered the first time from external dhcp server. and other subscriber ping to gateway should not failed
1093 """
1094
1095 def test_two_subscriber_with_voltha_for_dhcpRelay_discover_desired_ip_address_for_one_subscriber(self):
1096 """
1097 Test Method:
1098 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
1099 1. OLT and ONU is detected and validated.
1100 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1101 3. Send dhcp request from one residential subscriber to external dhcp server.
1102 3. Send dhcp request with desired ip from other residential subscriber to external dhcp server.
1103 4. Verify that subscribers had got different ips (one subscriber desired ip and other subscriber random ip) from external dhcp server. successfully.
1104 """
1105
1106 def test_two_subscriber_with_voltha_for_dhcpRelay_discover_in_range_and_out_of_range_from_dhcp_pool_ip_addresses(self):
1107 """
1108 Test Method:
1109 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
1110 1. OLT and ONU is detected and validated.
1111 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1112 3. Send dhcp request with desired wihtin dhcp pool ip from one residential subscriber to external dhcp server.
1113 3. Send dhcp request with desired without in dhcp pool ip from other residential subscriber to external dhcp server.
1114 4. Verify that subscribers had got different ips (both subscriber got random ips within dhcp pool) from external dhcp server. successfully.
1115 """
1116
1117 def test_two_subscriber_with_voltha_for_dhcpRelay_disable_onu_port_for_one_subscriber(self):
1118 """
1119 Test Method:
1120 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
1121 1. OLT and ONU is detected and validated.
1122 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1123 3. Send dhcp request from two residential subscribers to external dhcp server.
1124 4. Verify that subscribers had got ip from external dhcp server. successfully.
1125 5. Disable onu port on which access one subscriber and ping to gateway from other subscriber.
1126 6. Repeat step 3 and 4 for one subscriber where uni port is down.
1127 7. Verify that subscriber should not get ip from external dhcp server. and other subscriber ping to gateway should not failed.
1128 """
1129
1130 def test_two_subscriber_with_voltha_for_dhcpRelay_toggle_onu_port_for_one_subscriber(self):
1131 """
1132 Test Method:
1133 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
1134 1. OLT and ONU is detected and validated.
1135 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1136 3. Send dhcp request from two residential subscribers to external dhcp server.
1137 4. Verify that subscribers had got ip from external dhcp server. successfully.
1138 5. Disable onu port on which access one subscriber and ping to gateway from other subscriber.
1139 6. Repeat step 3 and 4 for one subscriber where uni port is down.
1140 7. Verify that subscriber should not get ip from external dhcp server. and other subscriber ping to gateway should not failed.
1141 8. Enable onu port on which was disable at step 5 and ping to gateway from other subscriber.
1142 9. Repeat step 3 and 4 for one subscriber where uni port is up now.
1143 10. Verify that subscriber should get ip from external dhcp server. and other subscriber ping to gateway should not failed.
1144 """
1145
1146 def test_two_subscriber_with_voltha_for_dhcpRelay_disable_olt_detected_in_voltha(self):
1147 """
1148 Test Method:
1149 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
1150 1. OLT and ONU is detected and validated.
1151 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1152 3. Send dhcp request from two residential subscribers to external dhcp server.
1153 4. Verify that subscribers had got ip from external dhcp server. successfully.
1154 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber.
1155 6. Disable the olt device which is detected in voltha.
1156 7. Verify that subscriber should not get ip from external dhcp server. and other subscriber ping to gateway should failed.
1157 """
1158
1159 def test_two_subscriber_with_voltha_for_dhcpRelay_toggle_olt_detected_in_voltha(self):
1160 """
1161 Test Method:
1162 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
1163 1. OLT and ONU is detected and validated.
1164 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1165 3. Send dhcp request from two residential subscribers to external dhcp server.
1166 4. Verify that subscribers had got ip from external dhcp server. successfully.
1167 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber.
1168 6. Disable the olt device which is detected in voltha.
1169 7. Verify that subscriber should not get ip from external dhcp server. and other subscriber ping to gateway should failed.
1170 8. Enable the olt device which is detected in voltha.
1171 9. Verify that subscriber should get ip from external dhcp server. and other subscriber ping to gateway should not failed.
1172 """
1173
1174 def test_two_subscriber_with_voltha_for_dhcpRelay_pause_olt_detected_in_voltha(self):
1175 """
1176 Test Method:
1177 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
1178 1. OLT and ONU is detected and validated.
1179 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1180 3. Send dhcp request from two residential subscribers to external dhcp server.
1181 4. Verify that subscribers had got ip from external dhcp server. successfully.
1182 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber.
1183 6. Pause the olt device which is detected in voltha.
1184 7. Verify that subscriber should not get ip from external dhcp server. and other subscriber ping to gateway should failed.
1185 """