blob: bf222a1a71e10c0928470ca41d9982d93aa33c63 [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
115 def setUpClass(cls):
A.R Karthickb9eab5a2017-06-07 16:03:51 -0700116 cls.update_apps_version()
A R Karthick35495c32017-05-11 14:58:32 -0700117 cls.voltha = VolthaCtrl(cls.VOLTHA_HOST, rest_port = cls.VOLTHA_REST_PORT)
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000118 cls.install_app_table()
119 cls.olt = OltConfig(olt_conf_file = cls.olt_conf_file)
120 cls.port_map, cls.port_list = cls.olt.olt_port_map()
121 cls.switches = cls.port_map['switches']
122 cls.num_ports = cls.port_map['num_ports']
123 if cls.num_ports > 1:
124 cls.num_ports -= 1 ##account for the tx port
125 cls.activate_apps(cls.apps + cls.olt_apps)
126
A.R Karthick3493a572017-06-07 18:28:10 -0700127 @classmethod
128 def tearDownClass(cls):
129 '''Deactivate the olt apps and restart OVS back'''
130 apps = cls.olt_apps + ( cls.table_app,)
131 for app in apps:
132 onos_ctrl = OnosCtrl(app)
133 onos_ctrl.deactivate()
134 cls.install_app_igmp()
A.R Karthickb9eab5a2017-06-07 16:03:51 -0700135
A.R Karthick3493a572017-06-07 18:28:10 -0700136 @classmethod
137 def install_app_igmp(cls):
138 ##Uninstall the table app on class exit
139 OnosCtrl.uninstall_app(cls.table_app)
140 time.sleep(2)
141 log_test.info('Installing back the cord igmp app %s for subscriber test on exit' %(cls.app_file))
142 OnosCtrl.install_app(cls.app_file)
A.R Karthickb9eab5a2017-06-07 16:03:51 -0700143
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000144 def remove_olt(self, switch_map):
145 controller = get_controller()
146 auth = ('karaf', 'karaf')
147 #remove subscriber for every port on all the voltha devices
148 for device, device_map in switch_map.iteritems():
149 uni_ports = device_map['ports']
150 uplink_vlan = device_map['uplink_vlan']
151 for port in uni_ports:
152 rest_url = 'http://{}:8181/onos/olt/oltapp/{}/{}'.format(controller,
153 device,
154 port)
155 resp = requests.delete(rest_url, auth = auth)
156 if resp.status_code not in [204, 202, 200]:
157 log_test.error('Error deleting subscriber for device %s on port %s' %(device, port))
158 else:
159 log_test.info('Deleted subscriber for device %s on port %s' %(device, port))
160 OnosCtrl.uninstall_app(self.olt_app_file)
161
162 def config_olt(self, switch_map):
163 controller = get_controller()
164 OnosCtrl.install_app(self.olt_app_file)
165 time.sleep(5)
166 auth = ('karaf', 'karaf')
167 #configure subscriber for every port on all the voltha devices
168 for device, device_map in switch_map.iteritems():
169 uni_ports = device_map['ports']
170 uplink_vlan = device_map['uplink_vlan']
171 for port in uni_ports:
172 vlan = port
173 rest_url = 'http://{}:8181/onos/olt/oltapp/{}/{}/{}'.format(controller,
174 device,
175 port,
176 vlan)
177 resp = requests.post(rest_url, auth = auth)
178 #assert_equal(resp.ok, True)
179
180 @classmethod
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000181 def install_app_table(cls):
182 ##Uninstall the existing app if any
183 OnosCtrl.uninstall_app(cls.table_app)
184 time.sleep(2)
185 log_test.info('Installing the multi table app %s for subscriber test' %(cls.table_app_file))
186 OnosCtrl.install_app(cls.table_app_file)
187 time.sleep(3)
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000188
189 @classmethod
190 def activate_apps(cls, apps):
191 for app in apps:
192 onos_ctrl = OnosCtrl(app)
193 status, _ = onos_ctrl.activate()
194 assert_equal(status, True)
195 time.sleep(2)
196
197 def tls_flow_check(self, olt_uni_port, cert_info = None):
198 def tls_fail_cb():
199 log_test.info('TLS verification failed')
200 if cert_info is None:
A.R Karthickb9eab5a2017-06-07 16:03:51 -0700201 tls = TLSAuthTest(fail_cb = tls_fail_cb, intf = olt_uni_port)
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000202 log_test.info('Running subscriber %s tls auth test with valid TLS certificate' %olt_uni_port)
203 tls.runTest()
204 assert_equal(tls.failTest, False)
205 if cert_info == "no_cert":
206 tls = TLSAuthTest(fail_cb = tls_fail_cb, intf = olt_uni_port, client_cert = '')
207 log_test.info('Running subscriber %s tls auth test with no TLS certificate' %olt_uni_port)
208 tls.runTest()
209 assert_equal(tls.failTest, True)
210 if cert_info == "invalid_cert":
211 tls = TLSAuthTest(fail_cb = tls_fail_cb, intf = olt_uni_port, client_cert = self.CLIENT_CERT_INVALID)
212 log_test.info('Running subscriber %s tls auth test with invalid TLS certificate' %olt_uni_port)
213 tls.runTest()
214 assert_equal(tls.failTest, True)
215 self.test_status = True
216 return self.test_status
A R Karthick35495c32017-05-11 14:58:32 -0700217
A.R Karthick8a507cf2017-06-02 18:44:49 -0700218 def test_olt_enable_disable(self):
A R Karthick35495c32017-05-11 14:58:32 -0700219 log_test.info('Enabling OLT type %s, MAC %s' %(self.OLT_TYPE, self.OLT_MAC))
A.R Karthick8a507cf2017-06-02 18:44:49 -0700220 device_id, status = self.voltha.enable_device(self.OLT_TYPE, self.OLT_MAC)
221 assert_not_equal(device_id, None)
222 try:
223 assert_equal(status, True)
224 time.sleep(10)
225 finally:
226 self.voltha.disable_device(device_id, delete = True)
Thangavelu K S008f38e2017-05-15 19:36:55 +0000227
A.R Karthick8a507cf2017-06-02 18:44:49 -0700228 def test_ponsim_enable_disable(self):
A.R Karthick8b9c5f12017-05-30 17:47:08 -0700229 log_test.info('Enabling ponsim_olt')
230 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
A.R Karthick8a507cf2017-06-02 18:44:49 -0700231 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
232 assert_not_equal(device_id, None)
233 try:
234 assert_equal(status, True)
235 time.sleep(10)
236 finally:
237 self.voltha.disable_device(device_id, delete = True)
A.R Karthick8b9c5f12017-05-30 17:47:08 -0700238
Thangavelu K S008f38e2017-05-15 19:36:55 +0000239 def test_subscriber_with_voltha_for_eap_tls_authentication(self):
240 """
241 Test Method:
242 0. Make sure that voltha is up and running on CORD-POD setup.
243 1. OLT and ONU is detected and validated.
244 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
245 3. Issue auth request packets from CORD TESTER voltha test module acting as a subscriber..
246 4. Validate that eap tls valid auth packets are being exchanged between subscriber, onos and freeradius.
247 5. Verify that subscriber is authenticated successfully.
248 """
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000249 log_test.info('Enabling ponsim_olt')
250 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
251 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
252 assert_not_equal(device_id, None)
A.R Karthickb9eab5a2017-06-07 16:03:51 -0700253 if status == False:
254 self.voltha.disable_device(device_id, delete = True)
255 assert_equal(status, True)
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000256 time.sleep(10)
257 switch_map = None
258 olt_configured = False
A.R Karthickb9eab5a2017-06-07 16:03:51 -0700259 voltha = VolthaCtrl(self.VOLTHA_HOST,
260 rest_port = self.VOLTHA_REST_PORT,
261 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000262 try:
A.R Karthickb9eab5a2017-06-07 16:03:51 -0700263 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
264 if not switch_map:
265 log_test.info('No voltha devices found')
266 return
267 log_test.info('Installing OLT app')
268 OnosCtrl.install_app(self.olt_app_file)
269 time.sleep(5)
270 log_test.info('Adding subscribers through OLT app')
271 self.config_olt(switch_map)
272 olt_configured = True
273 time.sleep(5)
274 auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT)
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000275 assert_equal(auth_status, True)
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000276 finally:
A.R Karthickb9eab5a2017-06-07 16:03:51 -0700277 if switch_map is not None:
278 if olt_configured is True:
279 self.remove_olt(switch_map)
280 self.voltha.disable_device(device_id, delete = True)
281 time.sleep(10)
282 OnosCtrl.uninstall_app(self.olt_app_name)
Thangavelu K S008f38e2017-05-15 19:36:55 +0000283
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000284 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S008f38e2017-05-15 19:36:55 +0000285 def test_subscriber_with_voltha_for_eap_tls_authentication_failure(self):
286 """
287 Test Method:
288 0. Make sure that voltha is up and running on CORD-POD setup.
289 1. OLT and ONU is detected and validated.
290 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
291 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
292 4. Validate that eap tls without cert auth packet is being exchanged between subscriber, onos and freeradius.
293 5. Verify that subscriber authentication is unsuccessful..
294 """
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000295 df = defer.Deferred()
296 def tls_flow_check_with_no_cert_scenario(df):
297 log_test.info('Enabling ponsim_olt')
298 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
299 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
300 assert_not_equal(device_id, None)
301 voltha = VolthaCtrl(self.VOLTHA_HOST,
A.R Karthickb9eab5a2017-06-07 16:03:51 -0700302 rest_port = self.VOLTHA_REST_PORT,
303 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000304 time.sleep(10)
305 switch_map = None
306 olt_configured = False
307 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
308 log_test.info('Installing OLT app')
309 OnosCtrl.install_app(self.olt_app_file)
310 time.sleep(5)
311 log_test.info('Adding subscribers through OLT app')
312 self.config_olt(switch_map)
313 olt_configured = True
314 time.sleep(5)
315 auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT, cert_info = "no_cert")
316 try:
317 assert_equal(auth_status, True)
318 assert_equal(status, True)
319 time.sleep(10)
320 finally:
A.R Karthickb9eab5a2017-06-07 16:03:51 -0700321 self.remove_olt(switch_map)
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000322 self.voltha.disable_device(device_id, delete = True)
323 df.callback(0)
A.R Karthickb9eab5a2017-06-07 16:03:51 -0700324
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000325 reactor.callLater(0, tls_flow_check_with_no_cert_scenario, df)
326 return df
Thangavelu K S008f38e2017-05-15 19:36:55 +0000327
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000328 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S008f38e2017-05-15 19:36:55 +0000329 def test_subscriber_with_voltha_for_eap_tls_authentication_using_invalid_cert(self):
330 """
331 Test Method:
332 0. Make sure that voltha is up and running on CORD-POD setup.
333 1. OLT and ONU is detected and validated.
334 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
335 3. Issue tls auth packets and exchange invalid cert from CORD TESTER voltha test module acting as a subscriber..
336 4. Validate that eap tls with invalid cert auth packet is being exchanged between subscriber, onos and freeradius.
337 5. Verify that subscriber authentication is unsuccessful..
338 """
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000339 df = defer.Deferred()
340 def tls_flow_check_with_invalid_cert_scenario(df):
341 log_test.info('Enabling ponsim_olt')
342 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
343 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
344 assert_not_equal(device_id, None)
345 voltha = VolthaCtrl(self.VOLTHA_HOST,
346 rest_port = self.VOLTHA_REST_PORT,
347 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
348 time.sleep(10)
349 switch_map = None
350 olt_configured = False
351 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
352 log_test.info('Installing OLT app')
353 OnosCtrl.install_app(self.olt_app_file)
354 time.sleep(5)
355 log_test.info('Adding subscribers through OLT app')
356 self.config_olt(switch_map)
357 olt_configured = True
358 time.sleep(5)
359 auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT, cert_info = "invalid_cert")
360 try:
361 assert_equal(auth_status, True)
362 assert_equal(status, True)
363 time.sleep(10)
364 finally:
A.R Karthickb9eab5a2017-06-07 16:03:51 -0700365 self.remove_olt(switch_map)
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000366 self.voltha.disable_device(device_id, delete = True)
367 df.callback(0)
368 reactor.callLater(0, tls_flow_check_with_invalid_cert_scenario, df)
369 return df
Thangavelu K S008f38e2017-05-15 19:36:55 +0000370
371 def test_subscriber_with_voltha_for_eap_tls_authentication_with_aaa_app_deactivation(self):
372 """
373 Test Method:
374 0. Make sure that voltha is up and running on CORD-POD setup.
375 1. OLT and ONU is detected and validated.
376 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
377 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
378 4. Validate that eap tls without sending client hello, it's not being exchanged between client, onos and freeradius.
379 5. Verify that subscriber authentication is unsuccessful..
380 """
381
382 def test_subscriber_with_voltha_for_eap_tls_authentication_restarting_radius_server(self):
383 """
384 Test Method:
385 0. Make sure that voltha is up and running on CORD-POD setup.
386 1. OLT and ONU is detected and validated.
387 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
388 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
389 4. Validate that eap tls with restart of radius server and packets are being exchanged between subscriber, onos and freeradius.
390 5. Verify that subscriber authentication is unsuccessful..
391 """
392
393 def test_subscriber_with_voltha_for_eap_tls_authentication_with_disabled_olt(self):
394 """
395 Test Method:
396 0. Make sure that voltha is up and running on CORD-POD setup.
397 1. OLT and ONU is detected and validated.
398 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
399 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
400 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius.
401 6. Verify that subscriber authenticated successfully.
402 7. Disable olt which is seen in voltha and issue tls auth packets from subscriber.
403 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius.
404 9. Verify that subscriber authentication is unsuccessful..
405 """
406
407 def test_subscriber_with_voltha_for_eap_tls_authentication_disabling_uni_port_in_voltha(self):
408 """
409 Test Method:
410 0. Make sure that voltha is up and running on CORD-POD setup.
411 1. OLT and ONU is detected and validated.
412 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
413 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
414 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius.
415 6. Verify that subscriber authenticated successfully.
416 7. Disable uni port which is seen in voltha and issue tls auth packets from subscriber.
417 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius.
418 9. Verify that subscriber authentication is unsuccessful..
419 """
420
421 def test_subscriber_with_voltha_for_eap_tls_authentication_restarting_olt(self):
422 """
423 Test Method:
424 0. Make sure that voltha is up and running on CORD-POD setup.
425 1. OLT and ONU is detected and validated.
426 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
427 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
428 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius.
429 6. Verify that subscriber authenticated successfully.
430 7. Restart olt which is seen in voltha and issue tls auth packets from subscriber.
431 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius.
432 9. Verify that subscriber authentication is unsuccessful..
433 """
434
435 def test_subscriber_with_voltha_for_eap_tls_authentication_restarting_onu(self):
436 """
437 Test Method:
438 0. Make sure that voltha is up and running on CORD-POD setup.
439 1. OLT and ONU is detected and validated.
440 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
441 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
442 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius.
443 6. Verify that subscriber authenticated successfully.
444 7. Restart onu which is seen in voltha and issue tls auth packets from subscriber.
445 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius.
446 9. Verify that subscriber authentication is unsuccessful..
447 """
448
449 def test_two_subscribers_with_voltha_for_eap_tls_authentication(self):
450 """
451 Test Method:
452 0. Make sure that voltha is up and running on CORD-POD setup.
453 1. OLT is detected and ONU ports(nni and 2 uni's) are being seen.
454 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
455 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
456 4. Validate that eap tls valid auth packets are being exchanged between two subscriber, onos and freeradius.
457 5. Verify that two subscribers are authenticated successfully.
458 """
459
460 def test_two_subscribers_with_voltha_for_eap_tls_authentication_using_same_certificates(self):
461 """
462 Test Method:
463 0. Make sure that voltha is up and running on CORD-POD setup.
464 1. OLT is detected and ONU ports(nni and 2 uni's) are being seen.
465 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
466 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
467 4. Validate that two valid certificates are being exchanged between two subscriber, onos and freeradius.
468 5. Verify that two subscribers are not authenticated.
469 """
470
471 def test_two_subscribers_with_voltha_for_eap_tls_authentication_initiating_invalid_tls_packets_for_one_subscriber(self):
472 """
473 Test Method:
474 0. Make sure that voltha is up and running on CORD-POD setup.
475 1. OLT is detected and ONU ports(nni and 2 uni's) are being seen.
476 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
477 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
478 4. Validate that eap tls valid auth packets are being exchanged between valid subscriber, onos and freeradius.
479 5. Validate that eap tls valid auth packets are being exchanged between invalid client, onos and freeradius.
480 6. Verify that valid subscriber authenticated successfully.
481 7. Verify that invalid subscriber are not authenticated successfully.
482 """
483
484 def test_two_subscribers_with_voltha_for_eap_tls_authentication_initiating_invalid_cert_for_one_subscriber(self):
485 """
486 Test Method:
487 0. Make sure that voltha is up and running on CORD-POD setup.
488 1. OLT is detected and ONU ports(nni and 2 uni's) are being seen.
489 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
490 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
491 4. Validate that eap tls valid auth packets are being exchanged between valid subscriber, onos and freeradius.
492 5. Validate that eap tls invalid cert auth packets are being exchanged between invalid subscriber, onos and freeradius.
493 6. Verify that valid subscriber authenticated successfully.
494 7. Verify that invalid subscriber are not authenticated successfully.
495 """
496
497 def test_two_subscribers_with_voltha_for_eap_tls_authentication_with_one_uni_port_disabled(self):
498 """
499 Test Method:
500 0. Make sure that voltha is up and running on CORD-POD setup.
501 1. OLT and ONU is detected and validated.
502 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
503 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
504 5. Validate that eap tls packets are being exchanged between two subscriber, onos and freeradius.
505 6. Verify that subscriber authenticated successfully.
506 7. Disable one of the uni port which is seen in voltha and issue tls auth packets from subscriber.
507 8. Validate that eap tls packets are not being exchanged between one subscriber, onos and freeradius.
508 9. Verify that subscriber authentication is unsuccessful..
509 10. Verify that other subscriber authenticated successfully.
510 """
511
512 def test_subscriber_with_voltha_for_dhcp_request(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. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
518 3. Send dhcp request from residential subscrber to dhcp server which is running as onos app.
519 4. Verify that subscriber get ip from dhcp server successfully.
520 """
521
522 def test_subscriber_with_voltha_for_dhcp_request_with_invalid_broadcast_source_mac(self):
523 """
524 Test Method:
525 0. Make sure that voltha is up and running on CORD-POD setup.
526 1. OLT and ONU is detected and validated.
527 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
528 3. Send dhcp request with invalid source mac broadcast from residential subscrber to dhcp server which is running as onos app.
529 4. Verify that subscriber should not get ip from dhcp server.
530 """
531
532 def test_subscriber_with_voltha_for_dhcp_request_with_invalid_multicast_source_mac(self):
533 """
534 Test Method:
535 0. Make sure that voltha is up and running on CORD-POD setup.
536 1. OLT and ONU is detected and validated.
537 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
538 3. Send dhcp request with invalid source mac multicast from residential subscrber to dhcp server which is running as onos app.
539 4. Verify that subscriber should not get ip from dhcp server.
540 """
541
542 def test_subscriber_with_voltha_for_dhcp_request_with_invalid_source_mac(self):
543 """
544 Test Method:
545 0. Make sure that voltha is up and running on CORD-POD setup.
546 1. OLT and ONU is detected and validated.
547 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
548 3. Send dhcp request with invalid source mac zero from residential subscrber to dhcp server which is running as onos app.
549 4. Verify that subscriber should not get ip from dhcp server.
550 """
551
552 def test_subscriber_with_voltha_for_dhcp_request_and_release(self):
553 """
554 Test Method:
555 0. Make sure that voltha is up and running on CORD-POD setup.
556 1. OLT and ONU is detected and validated.
557 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
558 3. Send dhcp request from residential subscrber to dhcp server which is running as onos app.
559 4. Verify that subscriber get ip from dhcp server successfully.
560 5. Send dhcp release from residential subscrber to dhcp server which is running as onos app.
561 6 Verify that subscriber should not get ip from dhcp server, ping to gateway.
562 """
563
A.R Karthick57fa9372017-05-24 12:47:03 -0700564 def test_subscriber_with_voltha_for_dhcp_starvation_positive_scenario(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +0000565 """
566 Test Method:
567 0. Make sure that voltha is up and running on CORD-POD setup.
568 1. OLT and ONU is detected and validated.
569 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
570 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
571 4. Verify that subscriber get ip from dhcp server successfully.
572 5. Repeat step 3 and 4 for 10 times.
573 6 Verify that subscriber should get ip from dhcp server.
574 """
575
576 def test_subscriber_with_voltha_for_dhcp_starvation_negative_scenario(self):
577 """
578 Test Method:
579 0. Make sure that voltha is up and running on CORD-POD setup.
580 1. OLT and ONU is detected and validated.
581 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
582 3. Send dhcp request from residential subscriber without of pool ip to dhcp server which is running as onos app.
583 4. Verify that subscriber should not get ip from dhcp server.
584 5. Repeat steps 3 and 4 for 10 times.
585 6 Verify that subscriber should not get ip from dhcp server.
586 """
587 def test_subscriber_with_voltha_for_dhcp_sending_multiple_discover(self):
588 """
589 Test Method:
590 0. Make sure that voltha is up and running on CORD-POD setup.
591 1. OLT and ONU is detected and validated.
592 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
593 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
594 4. Verify that subscriber get ip from dhcp server successfully.
595 5. Repeat step 3 for 50 times.
596 6 Verify that subscriber should get same ip which was received from 1st discover from dhcp server.
597 """
598 def test_subscriber_with_voltha_for_dhcp_sending_multiple_request(self):
599 """
600 Test Method:
601 0. Make sure that voltha is up and running on CORD-POD setup.
602 1. OLT and ONU is detected and validated.
603 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
604 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
605 4. Verify that subscriber get ip from dhcp server successfully.
606 5. Send DHCP request to dhcp server which is running as onos app.
607 6. Repeat step 5 for 50 times.
608 7. Verify that subscriber should get same ip which was received from 1st discover from dhcp server.
609 """
610
611 def test_subscriber_with_voltha_for_dhcp_requesting_desired_ip_address(self):
612 """
613 Test Method:
614 0. Make sure that voltha is up and running on CORD-POD setup.
615 1. OLT and ONU is detected and validated.
616 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
617 3. Send dhcp request with desired ip address from residential subscriber to dhcp server which is running as onos app.
618 4. Verify that subscriber get ip which was requested in step 3 from dhcp server successfully.
619 """
620
621 def test_subscriber_with_voltha_for_dhcp_requesting_desired_out_pool_ip_address(self):
622 """
623 Test Method:
624 0. Make sure that voltha is up and running on CORD-POD setup.
625 1. OLT and ONU is detected and validated.
626 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
627 3. Send dhcp request with desired out of pool ip address from residential subscriber to dhcp server which is running as onos app.
628 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.
629 """
630 def test_subscriber_with_voltha_for_dhcp_deactivate_dhcp_app_in_onos(self):
631 """
632 Test Method:
633 0. Make sure that voltha is up and running on CORD-POD setup.
634 1. OLT and ONU is detected and validated.
635 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
636 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
637 4. Verify that subscriber get ip from dhcp server successfully.
638 5. Deactivate dhcp server app in onos.
639 6. Repeat step 3.
640 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway.
641 """
642 def test_subscriber_with_voltha_for_dhcp_renew_time(self):
643 """
644 Test Method:
645 0. Make sure that voltha is up and running on CORD-POD setup.
646 1. OLT and ONU is detected and validated.
647 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
648 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
649 4. Verify that subscriber get ip from dhcp server successfully.
650 5. Send dhcp renew packet to dhcp server which is running as onos app.
651 6. Repeat step 4.
652 """
653 def test_subscriber_with_voltha_for_dhcp_rebind_time(self):
654 """
655 Test Method:
656 0. Make sure that voltha is up and running on CORD-POD setup.
657 1. OLT and ONU is detected and validated.
658 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
659 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
660 4. Verify that subscriber get ip from dhcp server successfully.
661 5. Send dhcp rebind packet to dhcp server which is running as onos app.
662 6. Repeat step 4.
663 """
664 def test_subscriber_with_voltha_for_dhcp_disable_olt_in_voltha(self):
665 """
666 Test Method:
667 0. Make sure that voltha is up and running on CORD-POD setup.
668 1. OLT and ONU is detected and validated.
669 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
670 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
671 4. Verify that subscriber get ip from dhcp server successfully.
672 5. Disable olt devices which is being detected in voltha CLI.
673 6. Repeat step 3.
674 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway.
675 """
676 def test_subscriber_with_voltha_for_dhcp_disable_enable_olt_in_voltha(self):
677 """
678 Test Method:
679 0. Make sure that voltha is up and running on CORD-POD setup.
680 1. OLT and ONU is detected and validated.
681 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
682 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
683 4. Verify that subscriber get ip from dhcp server successfully.
684 5. Disable olt devices which is being detected in voltha CLI.
685 6. Repeat step 3.
686 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway.
687 8. Enable olt devices which is being detected in voltha CLI.
688 9. Repeat steps 3 and 4.
689 """
690 def test_subscriber_with_voltha_for_dhcp_disable_onu_port_in_voltha(self):
691 """
692 Test Method:
693 0. Make sure that voltha is up and running on CORD-POD setup.
694 1. OLT and ONU is detected and validated.
695 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
696 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
697 4. Verify that subscriber get ip from dhcp server successfully.
698 5. Disable onu port which is being detected in voltha CLI.
699 6. Repeat step 3.
700 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway.
701 """
702 def test_subscriber_with_voltha_for_dhcp_disable_enable_onu_port_in_voltha(self):
703 """
704 Test Method:
705 0. Make sure that voltha is up and running on CORD-POD setup.
706 1. OLT and ONU is detected and validated.
707 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
708 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
709 4. Verify that subscriber get ip from dhcp server successfully.
710 5. Disable onu port which is being detected in voltha CLI.
711 6. Repeat step 3.
712 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway.
713 8. Enable onu port which is being detected in voltha CLI.
714 9. Repeat steps 3 and 4.
715 """
716
717 def test_two_subscriber_with_voltha_for_dhcp_discover(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 two residential subscribers to dhcp server which is running as onos app.
724 4. Verify that subscribers had got different ips from dhcp server successfully.
725 """
726
727 def test_two_subscriber_with_voltha_for_dhcp_multiple_discover(self):
728 """
729 Test Method:
730 0. Make sure that voltha is up and running on CORD-POD setup.
731 1. OLT and ONU is detected and validated.
732 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
733 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app.
734 4. Verify that subscribers had got ip from dhcp server successfully.
735 5. Repeat step 3 and 4 for 10 times for both subscribers.
736 6 Verify that subscribers should get same ips which are offered the first time from dhcp server.
737 """
738 def test_two_subscriber_with_voltha_for_dhcp_multiple_discover_for_one_subscriber(self):
739 """
740 Test Method:
741 0. Make sure that voltha is up and running on CORD-POD setup.
742 1. OLT and ONU is detected and validated.
743 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
744 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app.
745 4. Verify that subscribers had got ip from dhcp server successfully.
746 5. Repeat step 3 and 4 for 10 times for only one subscriber and ping to gateway from other subscriber.
747 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
748 """
749 def test_two_subscriber_with_voltha_for_dhcp_discover_desired_ip_address_for_one_subscriber(self):
750 """
751 Test Method:
752 0. Make sure that voltha is up and running on CORD-POD setup.
753 1. OLT and ONU is detected and validated.
754 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
755 3. Send dhcp request from one residential subscriber to dhcp server which is running as onos app.
756 3. Send dhcp request with desired ip from other residential subscriber to dhcp server which is running as onos app.
757 4. Verify that subscribers had got different ips (one subscriber desired ip and other subscriber random ip) from dhcp server successfully.
758 """
759 def test_two_subscriber_with_voltha_for_dhcp_discover_within_and_wothout_dhcp_pool_ip_addresses(self):
760 """
761 Test Method:
762 0. Make sure that voltha is up and running on CORD-POD setup.
763 1. OLT and ONU is detected and validated.
764 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
765 3. Send dhcp request with desired wihtin dhcp pool ip from one residential subscriber to dhcp server which is running as onos app.
766 3. Send dhcp request with desired without in dhcp pool ip from other residential subscriber to dhcp server which is running as onos app.
767 4. Verify that subscribers had got different ips (both subscriber got random ips within dhcp pool) from dhcp server successfully.
768 """
769 def test_two_subscriber_with_voltha_for_dhcp_disable_onu_port_for_one_subscriber(self):
770 """
771 Test Method:
772 0. Make sure that voltha is up and running on CORD-POD setup.
773 1. OLT and ONU is detected and validated.
774 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
775 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app.
776 4. Verify that subscribers had got ip from dhcp server successfully.
777 5. Disable onu port on which access one subscriber and ping to gateway from other subscriber.
778 6. Repeat step 3 and 4 for one subscriber where uni port is down.
779 7. Verify that subscriber should not get ip from dhcp server and other subscriber ping to gateway should not failed.
780 """
781 def test_two_subscriber_with_voltha_for_dhcp_disable_enable_onu_port_for_one_subscriber(self):
782 """
783 Test Method:
784 0. Make sure that voltha is up and running on CORD-POD setup.
785 1. OLT and ONU is detected and validated.
786 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
787 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app.
788 4. Verify that subscribers had got ip from dhcp server successfully.
789 5. Disable onu port on which access one subscriber and ping to gateway from other subscriber.
790 6. Repeat step 3 and 4 for one subscriber where uni port is down.
791 7. Verify that subscriber should not get ip from dhcp server and other subscriber ping to gateway should not failed.
792 8. Enable onu port on which was disable at step 5 and ping to gateway from other subscriber.
793 9. Repeat step 3 and 4 for one subscriber where uni port is up now.
794 10. Verify that subscriber should 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_olt_detected_in_voltha(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. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber.
805 6. Disable the olt device which is detected in voltha.
806 7. Verify that subscriber should not get ip from dhcp server and other subscriber ping to gateway should failed.
807 """
808 def test_two_subscriber_with_voltha_for_dhcp_disable_enable_olt_detected_in_voltha(self):
809 """
810 Test Method:
811 0. Make sure that voltha is up and running on CORD-POD setup.
812 1. OLT and ONU is detected and validated.
813 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
814 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app.
815 4. Verify that subscribers had got ip from dhcp server successfully.
816 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber.
817 6. Disable the olt device which is detected in voltha.
818 7. Verify that subscriber should not get ip from dhcp server and other subscriber ping to gateway should failed.
819 8. Enable the olt device which is detected in voltha.
820 9. Verify that subscriber should get ip from dhcp server and other subscriber ping to gateway should not failed.
821 """
822 def test_two_subscriber_with_voltha_for_dhcp_pause_olt_detected_in_voltha(self):
823 """
824 Test Method:
825 0. Make sure that voltha is up and running on CORD-POD setup.
826 1. OLT and ONU is detected and validated.
827 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
828 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app.
829 4. Verify that subscribers had got ip from dhcp server successfully.
830 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber.
831 6. Pause the olt device which is detected in voltha.
832 7. Verify that subscriber should not get ip from dhcp server and other subscriber ping to gateway should failed.
833 """
834 def test_subscriber_with_voltha_for_dhcpRelay_dhcp_request(self):
835 """
836 Test Method:
837 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
838 1. OLT and ONU is detected and validated.
839 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
840 3. Send dhcp request from residential subscrber to external dhcp server.
841 4. Verify that subscriber get ip from external dhcp server successfully.
842 """
843
844 def test_subscriber_with_voltha_for_dhcpRelay_dhcp_request_with_invalid_broadcast_source_mac(self):
845 """
846 Test Method:
847 0. Make sure that voltha and external dhcp server are is up and running on CORD-POD setup.
848 1. OLT and ONU is detected and validated.
849 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
850 3. Send dhcp request with invalid source mac broadcast from residential subscrber to external dhcp server.
851 4. Verify that subscriber should not get ip from external dhcp server.
852 """
853
854 def test_subscriber_with_voltha_for_dhcpRelay_dhcp_request_with_invalid_multicast_source_mac(self):
855 """
856 Test Method:
857 0. Make sure that voltha and external dhcp server are is up and running on CORD-POD setup.
858 1. OLT and ONU is detected and validated.
859 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
860 3. Send dhcp request with invalid source mac multicast from residential subscrber to external dhcp server.
861 4. Verify that subscriber should not get ip from external dhcp server.
862 """
863
864 def test_subscriber_with_voltha_for_dhcpRelay_dhcp_request_with_invalid_source_mac(self):
865 """
866 Test Method:
867 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
868 1. OLT and ONU is detected and validated.
869 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
870 3. Send dhcp request with invalid source mac zero from residential subscrber to external dhcp server.
871 4. Verify that subscriber should not get ip from external dhcp server.
872 """
873
874 def test_subscriber_with_voltha_for_dhcpRelay_dhcp_request_and_release(self):
875 """
876 Test Method:
877 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
878 1. OLT and ONU is detected and validated.
879 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
880 3. Send dhcp request from residential subscrber to external dhcp server.
881 4. Verify that subscriber get ip from external dhcp server successfully.
882 5. Send dhcp release from residential subscrber to external dhcp server.
883 6 Verify that subscriber should not get ip from external dhcp server, ping to gateway.
884 """
885
886 def test_subscriber_with_voltha_for_dhcpRelay_starvation(self):
887 """
888 Test Method:
889 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
890 1. OLT and ONU is detected and validated.
891 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
892 3. Send dhcp request from residential subscriber to external dhcp server.
893 4. Verify that subscriber get ip from external dhcp server. successfully.
894 5. Repeat step 3 and 4 for 10 times.
895 6 Verify that subscriber should get ip from external dhcp server..
896 """
897
898 def test_subscriber_with_voltha_for_dhcpRelay_starvation_negative_scenario(self):
899 """
900 Test Method:
901 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
902 1. OLT and ONU is detected and validated.
903 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
904 3. Send dhcp request from residential subscriber without of pool ip to external dhcp server.
905 4. Verify that subscriber should not get ip from external dhcp server..
906 5. Repeat steps 3 and 4 for 10 times.
907 6 Verify that subscriber should not get ip from external dhcp server..
908 """
909 def test_subscriber_with_voltha_for_dhcpRelay_sending_multiple_discover(self):
910 """
911 Test Method:
912 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
913 1. OLT and ONU is detected and validated.
914 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
915 3. Send dhcp request from residential subscriber to external dhcp server.
916 4. Verify that subscriber get ip from external dhcp server. successfully.
917 5. Repeat step 3 for 50 times.
918 6 Verify that subscriber should get same ip which was received from 1st discover from external dhcp server..
919 """
920 def test_subscriber_with_voltha_for_dhcpRelay_sending_multiple_request(self):
921 """
922 Test Method:
923 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
924 1. OLT and ONU is detected and validated.
925 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
926 3. Send dhcp request from residential subscriber to external dhcp server.
927 4. Verify that subscriber get ip from external dhcp server. successfully.
928 5. Send DHCP request to external dhcp server.
929 6. Repeat step 5 for 50 times.
930 7. Verify that subscriber should get same ip which was received from 1st discover from external dhcp server..
931 """
932
933 def test_subscriber_with_voltha_for_dhcpRelay_requesting_desired_ip_address(self):
934 """
935 Test Method:
936 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
937 1. OLT and ONU is detected and validated.
938 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
939 3. Send dhcp request with desired ip address from residential subscriber to external dhcp server.
940 4. Verify that subscriber get ip which was requested in step 3 from external dhcp server. successfully.
941 """
942
943 def test_subscriber_with_voltha_for_dhcpRelay_requesting_desired_out_of_pool_ip_address(self):
944 """
945 Test Method:
946 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
947 1. OLT and ONU is detected and validated.
948 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
949 3. Send dhcp request with desired out of pool ip address from residential subscriber to external dhcp server.
950 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.
951 """
952
953 def test_subscriber_with_voltha_for_dhcpRelay_deactivating_dhcpRelay_app_in_onos(self):
954 """
955 Test Method:
956 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
957 1. OLT and ONU is detected and validated.
958 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
959 3. Send dhcp request from residential subscriber to external dhcp server.
960 4. Verify that subscriber get ip from external dhcp server. successfully.
961 5. Deactivate dhcp server app in onos.
962 6. Repeat step 3.
963 7. Verify that subscriber should not get ip from external dhcp server., and ping to gateway.
964 """
965
966 def test_subscriber_with_voltha_for_dhcpRelay_renew_time(self):
967 """
968 Test Method:
969 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
970 1. OLT and ONU is detected and validated.
971 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
972 3. Send dhcp request from residential subscriber to external dhcp server.
973 4. Verify that subscriber get ip from external dhcp server. successfully.
974 5. Send dhcp renew packet to external dhcp server.
975 6. Repeat step 4.
976 """
977
978 def test_subscriber_with_voltha_for_dhcpRelay_rebind_time(self):
979 """
980 Test Method:
981 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
982 1. OLT and ONU is detected and validated.
983 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
984 3. Send dhcp request from residential subscriber to external dhcp server.
985 4. Verify that subscriber get ip from external dhcp server. successfully.
986 5. Send dhcp rebind packet to external dhcp server.
987 6. Repeat step 4.
988 """
989
990 def test_subscriber_with_voltha_for_dhcpRelay_disable_olt_in_voltha(self):
991 """
992 Test Method:
993 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
994 1. OLT and ONU is detected and validated.
995 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
996 3. Send dhcp request from residential subscriber to external dhcp server.
997 4. Verify that subscriber get ip from external dhcp server. successfully.
998 5. Disable olt devices which is being detected in voltha CLI.
999 6. Repeat step 3.
1000 7. Verify that subscriber should not get ip from external dhcp server., and ping to gateway.
1001 """
1002
1003 def test_subscriber_with_voltha_for_dhcpRelay_toggling_olt_in_voltha(self):
1004 """
1005 Test Method:
1006 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
1007 1. OLT and ONU is detected and validated.
1008 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1009 3. Send dhcp request from residential subscriber to external dhcp server.
1010 4. Verify that subscriber get ip from external dhcp server. successfully.
1011 5. Disable olt devices which is being detected in voltha CLI.
1012 6. Repeat step 3.
1013 7. Verify that subscriber should not get ip from external dhcp server., and ping to gateway.
1014 8. Enable olt devices which is being detected in voltha CLI.
1015 9. Repeat steps 3 and 4.
1016 """
1017
1018 def test_subscriber_with_voltha_for_dhcpRelay_disable_onu_port_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 onu port 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 """
1030
1031 def test_subscriber_with_voltha_for_dhcpRelay_disable_enable_onu_port_in_voltha(self):
1032 """
1033 Test Method:
1034 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
1035 1. OLT and ONU is detected and validated.
1036 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1037 3. Send dhcp request from residential subscriber to external dhcp server.
1038 4. Verify that subscriber get ip from external dhcp server. successfully.
1039 5. Disable onu port which is being detected in voltha CLI.
1040 6. Repeat step 3.
1041 7. Verify that subscriber should not get ip from external dhcp server., and ping to gateway.
1042 8. Enable onu port which is being detected in voltha CLI.
1043 9. Repeat steps 3 and 4.
1044 """
1045
1046 def test_two_subscriber_with_voltha_for_dhcpRelay_discover(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 two residential subscribers to external dhcp server.
1053 4. Verify that subscribers had got different ips from external dhcp server. successfully.
1054 """
1055
1056 def test_two_subscriber_with_voltha_for_dhcpRelay_multiple_discover(self):
1057 """
1058 Test Method:
1059 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
1060 1. OLT and ONU is detected and validated.
1061 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1062 3. Send dhcp request from two residential subscribers to external dhcp server.
1063 4. Verify that subscribers had got ip from external dhcp server. successfully.
1064 5. Repeat step 3 and 4 for 10 times for both subscribers.
1065 6 Verify that subscribers should get same ips which are offered the first time from external dhcp server..
1066 """
1067
1068 def test_two_subscriber_with_voltha_for_dhcpRelay_multiple_discover_for_one_subscriber(self):
1069 """
1070 Test Method:
1071 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
1072 1. OLT and ONU is detected and validated.
1073 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1074 3. Send dhcp request from two residential subscribers to external dhcp server.
1075 4. Verify that subscribers had got ip from external dhcp server. successfully.
1076 5. Repeat step 3 and 4 for 10 times for only one subscriber and ping to gateway from other subscriber.
1077 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
1078 """
1079
1080 def test_two_subscriber_with_voltha_for_dhcpRelay_discover_desired_ip_address_for_one_subscriber(self):
1081 """
1082 Test Method:
1083 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
1084 1. OLT and ONU is detected and validated.
1085 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1086 3. Send dhcp request from one residential subscriber to external dhcp server.
1087 3. Send dhcp request with desired ip from other residential subscriber to external dhcp server.
1088 4. Verify that subscribers had got different ips (one subscriber desired ip and other subscriber random ip) from external dhcp server. successfully.
1089 """
1090
1091 def test_two_subscriber_with_voltha_for_dhcpRelay_discover_in_range_and_out_of_range_from_dhcp_pool_ip_addresses(self):
1092 """
1093 Test Method:
1094 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
1095 1. OLT and ONU is detected and validated.
1096 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1097 3. Send dhcp request with desired wihtin dhcp pool ip from one residential subscriber to external dhcp server.
1098 3. Send dhcp request with desired without in dhcp pool ip from other residential subscriber to external dhcp server.
1099 4. Verify that subscribers had got different ips (both subscriber got random ips within dhcp pool) from external dhcp server. successfully.
1100 """
1101
1102 def test_two_subscriber_with_voltha_for_dhcpRelay_disable_onu_port_for_one_subscriber(self):
1103 """
1104 Test Method:
1105 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
1106 1. OLT and ONU is detected and validated.
1107 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1108 3. Send dhcp request from two residential subscribers to external dhcp server.
1109 4. Verify that subscribers had got ip from external dhcp server. successfully.
1110 5. Disable onu port on which access one subscriber and ping to gateway from other subscriber.
1111 6. Repeat step 3 and 4 for one subscriber where uni port is down.
1112 7. Verify that subscriber should not get ip from external dhcp server. and other subscriber ping to gateway should not failed.
1113 """
1114
1115 def test_two_subscriber_with_voltha_for_dhcpRelay_toggle_onu_port_for_one_subscriber(self):
1116 """
1117 Test Method:
1118 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
1119 1. OLT and ONU is detected and validated.
1120 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1121 3. Send dhcp request from two residential subscribers to external dhcp server.
1122 4. Verify that subscribers had got ip from external dhcp server. successfully.
1123 5. Disable onu port on which access one subscriber and ping to gateway from other subscriber.
1124 6. Repeat step 3 and 4 for one subscriber where uni port is down.
1125 7. Verify that subscriber should not get ip from external dhcp server. and other subscriber ping to gateway should not failed.
1126 8. Enable onu port on which was disable at step 5 and ping to gateway from other subscriber.
1127 9. Repeat step 3 and 4 for one subscriber where uni port is up now.
1128 10. Verify that subscriber should get ip from external dhcp server. and other subscriber ping to gateway should not failed.
1129 """
1130
1131 def test_two_subscriber_with_voltha_for_dhcpRelay_disable_olt_detected_in_voltha(self):
1132 """
1133 Test Method:
1134 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
1135 1. OLT and ONU is detected and validated.
1136 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1137 3. Send dhcp request from two residential subscribers to external dhcp server.
1138 4. Verify that subscribers had got ip from external dhcp server. successfully.
1139 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber.
1140 6. Disable the olt device which is detected in voltha.
1141 7. Verify that subscriber should not get ip from external dhcp server. and other subscriber ping to gateway should failed.
1142 """
1143
1144 def test_two_subscriber_with_voltha_for_dhcpRelay_toggle_olt_detected_in_voltha(self):
1145 """
1146 Test Method:
1147 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
1148 1. OLT and ONU is detected and validated.
1149 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1150 3. Send dhcp request from two residential subscribers to external dhcp server.
1151 4. Verify that subscribers had got ip from external dhcp server. successfully.
1152 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber.
1153 6. Disable the olt device which is detected in voltha.
1154 7. Verify that subscriber should not get ip from external dhcp server. and other subscriber ping to gateway should failed.
1155 8. Enable the olt device which is detected in voltha.
1156 9. Verify that subscriber should get ip from external dhcp server. and other subscriber ping to gateway should not failed.
1157 """
1158
1159 def test_two_subscriber_with_voltha_for_dhcpRelay_pause_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. Pause 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 """