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