blob: be2ad7dee8c0be5d591e19097ec8762e21613d09 [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
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00007import threading
8from random import randint
9from threading import Timer
Thangavelu K S36edb012017-07-05 18:24:12 +000010from threadPool import ThreadPool
A R Karthick35495c32017-05-11 14:58:32 -070011from nose.tools import *
Thangavelu K S77c8c0c2017-06-07 18:04:21 +000012from nose.twistedtools import reactor, deferred
13from twisted.internet import defer
A R Karthick35495c32017-05-11 14:58:32 -070014from CordTestConfig import setup_module
15from CordTestUtils import log_test
16from VolthaCtrl import VolthaCtrl
Thangavelu K S77c8c0c2017-06-07 18:04:21 +000017from CordTestUtils import log_test, get_controller
18from portmaps import g_subscriber_port_map
19from OltConfig import *
20from EapTLS import TLSAuthTest
Thangavelu K Sa1c71b42017-06-14 18:13:21 +000021from DHCP import DHCPTest
Thangavelu K S77c8c0c2017-06-07 18:04:21 +000022from OnosCtrl import OnosCtrl
23from CordLogger import CordLogger
24from scapy.all import *
25from scapy_ssl_tls.ssl_tls import *
26from scapy_ssl_tls.ssl_tls_crypto import *
27from CordTestServer import cord_test_onos_restart, cord_test_shell, cord_test_radius_restart
A.R Karthickb9eab5a2017-06-07 16:03:51 -070028from CordContainer import Onos
A R Karthick35495c32017-05-11 14:58:32 -070029
Thangavelu K S36edb012017-07-05 18:24:12 +000030
31class multicast_channels:
32
33 def __init__(self, port_list):
34 try:
35 self.tx_intf = self.port_map['ports'][port_list[0][0]]
36 self.rx_intf = self.port_map['ports'][port_list[0][1]]
37 except:
38 self.tx_intf = self.INTF_TX_DEFAULT
39 self.rx_intf = self.INTF_RX_DEFAULT
40 channel_start = 0
41 mcast_cb = None
42 Channels.__init__(self, num, channel_start = channel_start,
43 iface = self.rx_intf, iface_mcast = self.tx_intf, mcast_cb = mcast_cb)
44
45 self.loginType = loginType
46 ##start streaming channels
47 self.join_map = {}
48 ##accumulated join recv stats
49 self.join_rx_stats = Stats()
50 self.recv_timeout = False
51
52
53 def channel_join_update(self, chan, join_time):
54 self.join_map[chan] = ( Stats(), Stats(), Stats(), Stats() )
55 self.channel_update(chan, self.STATS_JOIN, 1, t = join_time)
56
57 def channel_join(self, chan = 0, delay = 2):
58 '''Join a channel and create a send/recv stats map'''
59 if self.join_map.has_key(chan):
60 del self.join_map[chan]
61 self.delay = delay
62 chan, join_time = self.join(chan)
63 self.channel_join_update(chan, join_time)
64 return chan
65
66 def channel_join_next(self, delay = 2, leave_flag = True):
67 '''Joins the next channel leaving the last channel'''
68 if self.last_chan:
69 if self.join_map.has_key(self.last_chan):
70 del self.join_map[self.last_chan]
71 self.delay = delay
72 chan, join_time = self.join_next(leave_flag = leave_flag)
73 self.channel_join_update(chan, join_time)
74 return chan
75
76 def channel_jump(self, delay = 2):
77 '''Jumps randomly to the next channel leaving the last channel'''
78 if self.last_chan is not None:
79 if self.join_map.has_key(self.last_chan):
80 del self.join_map[self.last_chan]
81 self.delay = delay
82 chan, join_time = self.jump()
83 self.channel_join_update(chan, join_time)
84 return chan
85
86 def channel_leave(self, chan = 0, force = False):
87 if self.join_map.has_key(chan):
88 del self.join_map[chan]
89 self.leave(chan, force = force)
90
91 def channel_update(self, chan, stats_type, packets, t=0):
92 if type(chan) == type(0):
93 chan_list = (chan,)
94 else:
95 chan_list = chan
96 for c in chan_list:
97 if self.join_map.has_key(c):
98 self.join_map[c][stats_type].update(packets = packets, t = t)
99
100 def channel_receive(self, chan, cb = None, count = 1, timeout = 5):
101 log_test.info('Subscriber %s on port %s receiving from group %s, channel %d' %
102 (self.name, self.rx_intf, self.gaddr(chan), chan))
103 r = self.recv(chan, cb = cb, count = count, timeout = timeout)
104 if len(r) == 0:
105 log_test.info('Subscriber %s on port %s timed out' %(self.name, self.rx_intf))
106 else:
107 log_test.info('Subscriber %s on port %s received %d packets' %(self.name, self.rx_intf, len(r)))
108 if self.recv_timeout:
109 ##Negative test case is disabled for now
110 assert_equal(len(r), 0)
111
112 def recv_channel_cb(self, pkt):
113 ##First verify that we have received the packet for the joined instance
114 log_test.info('Packet received for group %s, subscriber %s, port %s' %
115 (pkt[IP].dst, self.name, self.rx_intf))
116 if self.recv_timeout:
117 return
118 chan = self.caddr(pkt[IP].dst)
119 assert_equal(chan in self.join_map.keys(), True)
120 recv_time = monotonic.monotonic() * 1000000
121 join_time = self.join_map[chan][self.STATS_JOIN].start
122 delta = recv_time - join_time
123 self.join_rx_stats.update(packets=1, t = delta, usecs = True)
124 self.channel_update(chan, self.STATS_RX, 1, t = delta)
125 log_test.debug('Packet received in %.3f usecs for group %s after join' %(delta, pkt[IP].dst))
126
127
128class voltha_subscriber_pool:
129
130 def __init__(self, subscriber, test_cbs):
131 self.subscriber = subscriber
132 self.test_cbs = test_cbs
133
134 def pool_cb(self):
135 for cb in self.test_cbs:
136 if cb:
137 self.test_status = cb(self.subscriber)
138 if self.test_status is not True:
139 ## This is chaning for other sub status has to check again
140 self.test_status = True
141 log_test.info('This service is failed and other services will not run for this subscriber')
142 break
143 log_test.info('This Subscriber is tested for multiple service eligibility ')
144 self.test_status = True
145
146
A R Karthick35495c32017-05-11 14:58:32 -0700147class voltha_exchange(unittest.TestCase):
148
149 OLT_TYPE = 'tibit_olt'
150 OLT_MAC = '00:0c:e2:31:12:00'
151 VOLTHA_HOST = 'localhost'
152 VOLTHA_REST_PORT = 8881
Thangavelu K S36edb012017-07-05 18:24:12 +0000153 VOLTHA_OLT_TYPE = 'ponsim_olt'
154 VOLTHA_OLT_MAC = '00:0c:e2:31:12:00'
155 VOLTHA_IGMP_ITERATIONS = 100
A R Karthick35495c32017-05-11 14:58:32 -0700156 voltha = None
Thangavelu K S9648eed2017-06-13 20:15:25 +0000157 success = True
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000158 apps = ('org.opencord.aaa', 'org.onosproject.dhcp')
159 olt_apps = () #'org.opencord.cordmcast')
160 vtn_app = 'org.opencord.vtn'
161 table_app = 'org.ciena.cordigmp'
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000162 test_path = os.path.dirname(os.path.realpath(__file__))
163 table_app_file = os.path.join(test_path, '..', 'apps/ciena-cordigmp-multitable-2.0-SNAPSHOT.oar')
A.R Karthickb9eab5a2017-06-07 16:03:51 -0700164 app_file = os.path.join(test_path, '..', 'apps/ciena-cordigmp-2.0-SNAPSHOT.oar')
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000165 olt_app_file = os.path.join(test_path, '..', 'apps/olt-app-1.2-SNAPSHOT.oar')
A.R Karthick3493a572017-06-07 18:28:10 -0700166 olt_app_name = 'org.onosproject.olt'
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000167 #onos_config_path = os.path.join(test_path, '..', 'setup/onos-config')
168 olt_conf_file = os.getenv('OLT_CONFIG_FILE', os.path.join(test_path, '..', 'setup/olt_config.json'))
169 onos_restartable = bool(int(os.getenv('ONOS_RESTART', 0)))
170 VOLTHA_ENABLED = True
171 INTF_TX_DEFAULT = 'veth2'
172 INTF_RX_DEFAULT = 'veth0'
Thangavelu K S9648eed2017-06-13 20:15:25 +0000173 INTF_2_RX_DEFAULT = 'veth6'
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000174 TESTCASE_TIMEOUT = 300
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +0000175# VOLTHA_CONFIG_FAKE = True
176 VOLTHA_CONFIG_FAKE = False
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000177 VOLTHA_UPLINK_VLAN_MAP = { 'of:0000000000000001' : '222' }
178 VOLTHA_ONU_UNI_PORT = 'veth0'
179
Thangavelu K Sa1c71b42017-06-14 18:13:21 +0000180 dhcp_server_config = {
181 "ip": "10.1.11.50",
182 "mac": "ca:fe:ca:fe:ca:fe",
183 "subnet": "255.255.252.0",
184 "broadcast": "10.1.11.255",
185 "router": "10.1.8.1",
186 "domain": "8.8.8.8",
187 "ttl": "63",
188 "delay": "2",
189 "startip": "10.1.11.51",
190 "endip": "10.1.11.100"
191 }
192
193
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000194 CLIENT_CERT = """-----BEGIN CERTIFICATE-----
195MIICuDCCAiGgAwIBAgIBAjANBgkqhkiG9w0BAQUFADCBizELMAkGA1UEBhMCVVMx
196CzAJBgNVBAgTAkNBMRIwEAYDVQQHEwlTb21ld2hlcmUxEzARBgNVBAoTCkNpZW5h
197IEluYy4xHjAcBgkqhkiG9w0BCQEWD2FkbWluQGNpZW5hLmNvbTEmMCQGA1UEAxMd
198RXhhbXBsZSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMTYwNjA2MjExMjI3WhcN
199MTcwNjAxMjExMjI3WjBnMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExEzARBgNV
200BAoTCkNpZW5hIEluYy4xFzAVBgNVBAMUDnVzZXJAY2llbmEuY29tMR0wGwYJKoZI
201hvcNAQkBFg51c2VyQGNpZW5hLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkC
202gYEAwvXiSzb9LZ6c7uNziUfKvoHO7wu/uiFC5YUpXbmVGuGZizbVrny0xnR85Dfe
203+9R4diansfDhIhzOUl1XjN3YDeSS9OeF5YWNNE8XDhlz2d3rVzaN6hIhdotBkUjg
204rUewjTg5OFR31QEyG3v8xR3CLgiE9xQELjZbSA07pD79zuUCAwEAAaNPME0wEwYD
205VR0lBAwwCgYIKwYBBQUHAwIwNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL3d3dy5l
206eGFtcGxlLmNvbS9leGFtcGxlX2NhLmNybDANBgkqhkiG9w0BAQUFAAOBgQDAjkrY
2076tDChmKbvr8w6Du/t8vHjTCoCIocHTN0qzWOeb1YsAGX89+TrWIuO1dFyYd+Z0KC
208PDKB5j/ygml9Na+AklSYAVJIjvlzXKZrOaPmhZqDufi+rXWti/utVqY4VMW2+HKC
209nXp37qWeuFLGyR1519Y1d6F/5XzqmvbwURuEug==
210-----END CERTIFICATE-----"""
211
212 CLIENT_CERT_INVALID = '''-----BEGIN CERTIFICATE-----
213MIIDvTCCAqWgAwIBAgIBAjANBgkqhkiG9w0BAQUFADCBizELMAkGA1UEBhMCVVMx
214CzAJBgNVBAgTAkNBMRIwEAYDVQQHEwlTb21ld2hlcmUxEzARBgNVBAoTCkNpZW5h
215IEluYy4xHjAcBgkqhkiG9w0BCQEWD2FkbWluQGNpZW5hLmNvbTEmMCQGA1UEAxMd
216RXhhbXBsZSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMTYwMzExMTg1MzM2WhcN
217MTcwMzA2MTg1MzM2WjBnMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExEzARBgNV
218BAoTCkNpZW5hIEluYy4xFzAVBgNVBAMUDnVzZXJAY2llbmEuY29tMR0wGwYJKoZI
219hvcNAQkBFg51c2VyQGNpZW5hLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC
220AQoCggEBAOxemcBsPn9tZsCa5o2JA6sQDC7A6JgCNXXl2VFzKLNNvB9PS6D7ZBsQ
2215An0zEDMNzi51q7lnrYg1XyiE4S8FzMGAFr94RlGMQJUbRD9V/oqszMX4k++iAOK
222tIA1gr3x7Zi+0tkjVSVzXTmgNnhChAamdMsjYUG5+CY9WAicXyy+VEV3zTphZZDR
223OjcjEp4m/TSXVPYPgYDXI40YZKX5BdvqykWtT/tIgZb48RS1NPyN/XkCYzl3bv21
224qx7Mc0fcEbsJBIIRYTUkfxnsilcnmLxSYO+p+DZ9uBLBzcQt+4Rd5pLSfi21WM39
2252Z2oOi3vs/OYAPAqgmi2JWOv3mePa/8CAwEAAaNPME0wEwYDVR0lBAwwCgYIKwYB
226BQUHAwIwNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL3d3dy5leGFtcGxlLmNvbS9l
227eGFtcGxlX2NhLmNybDANBgkqhkiG9w0BAQUFAAOCAQEALBzMPDTIB6sLyPl0T6JV
228MjOkyldAVhXWiQsTjaGQGJUUe1cmUJyZbUZEc13MygXMPOM4x7z6VpXGuq1c/Vxn
229VzQ2fNnbJcIAHi/7G8W5/SQfPesIVDsHTEc4ZspPi5jlS/MVX3HOC+BDbOjdbwqP
230RX0JEr+uOyhjO+lRxG8ilMRACoBUbw1eDuVDoEBgErSUC44pq5ioDw2xelc+Y6hQ
231dmtYwfY0DbvwxHtA495frLyPcastDiT/zre7NL51MyUDPjjYjghNQEwvu66IKbQ3
232T1tJBrgI7/WI+dqhKBFolKGKTDWIHsZXQvZ1snGu/FRYzg1l+R/jT8cRB9BDwhUt
233yg==
234-----END CERTIFICATE-----'''
A R Karthick35495c32017-05-11 14:58:32 -0700235
A.R Karthick3493a572017-06-07 18:28:10 -0700236 @classmethod
237 def update_apps_version(cls):
238 version = Onos.getVersion()
239 major = int(version.split('.')[0])
240 minor = int(version.split('.')[1])
241 cordigmp_app_version = '2.0-SNAPSHOT'
242 olt_app_version = '1.2-SNAPSHOT'
243 if major > 1:
244 cordigmp_app_version = '3.0-SNAPSHOT'
245 olt_app_version = '2.0-SNAPSHOT'
246 elif major == 1:
247 if minor > 10:
248 cordigmp_app_version = '3.0-SNAPSHOT'
249 olt_app_version = '2.0-SNAPSHOT'
250 elif minor <= 8:
251 olt_app_version = '1.1-SNAPSHOT'
A.R Karthickb9eab5a2017-06-07 16:03:51 -0700252 cls.app_file = os.path.join(cls.test_path, '..', 'apps/ciena-cordigmp-{}.oar'.format(cordigmp_app_version))
253 cls.table_app_file = os.path.join(cls.test_path, '..', 'apps/ciena-cordigmp-multitable-{}.oar'.format(cordigmp_app_version))
254 cls.olt_app_file = os.path.join(cls.test_path, '..', 'apps/olt-app-{}.oar'.format(olt_app_version))
255
A R Karthick35495c32017-05-11 14:58:32 -0700256 @classmethod
A.R Karthickf874d032017-06-07 18:47:51 -0700257 def onos_load_config(cls, app, config):
258 status, code = OnosCtrl.config(config)
259 if status is False:
260 log_test.info('JSON config request for app %s returned status %d' %(app, code))
261 assert_equal(status, True)
262 time.sleep(2)
263
264 @classmethod
265 def onos_aaa_load(cls):
266 aaa_dict = {'apps' : { 'org.opencord.aaa' : { 'AAA' : { 'radiusSecret': 'radius_password',
267 'radiusIp': '172.17.0.2' } } } }
268 radius_ip = os.getenv('ONOS_AAA_IP') or '172.17.0.2'
269 aaa_dict['apps']['org.opencord.aaa']['AAA']['radiusIp'] = radius_ip
270 cls.onos_load_config('org.opencord.aaa', aaa_dict)
271
272 @classmethod
Thangavelu K Sa1c71b42017-06-14 18:13:21 +0000273 def onos_dhcp_table_load(self, config = None):
274 dhcp_dict = {'apps' : { 'org.onosproject.dhcp' : { 'dhcp' : copy.copy(self.dhcp_server_config) } } }
275 dhcp_config = dhcp_dict['apps']['org.onosproject.dhcp']['dhcp']
276 if config:
277 for k in config.keys():
278 if dhcp_config.has_key(k):
279 dhcp_config[k] = config[k]
280 self.onos_load_config('org.onosproject.dhcp', dhcp_dict)
281
Thangavelu K S36edb012017-07-05 18:24:12 +0000282 def dhcp_sndrcv(self, dhcp, update_seed = False, mac = None, validation = None):
Thangavelu K Se6c77c72017-06-23 21:28:48 +0000283 if validation:
Thangavelu K S735a6662017-06-15 18:08:23 +0000284 cip, sip = dhcp.discover(mac = mac, update_seed = update_seed)
285 assert_not_equal(cip, None)
286 assert_not_equal(sip, None)
287 log_test.info('Got dhcp client IP %s from server %s for mac %s' %
288 (cip, sip, dhcp.get_mac(cip)[0]))
289 if validation == False:
290 cip, sip = dhcp.discover(mac = mac, update_seed = update_seed)
291 assert_equal(cip, None)
292 assert_equal(sip, None)
Thangavelu K Se6c77c72017-06-23 21:28:48 +0000293 log_test.info('Dhcp client did not get IP from server')
Thangavelu K S735a6662017-06-15 18:08:23 +0000294
Thangavelu K S36edb012017-07-05 18:24:12 +0000295 if validation == 'skip':
296 cip, sip = dhcp.discover(mac = mac, update_seed = update_seed)
297
Thangavelu K Sa1c71b42017-06-14 18:13:21 +0000298 return cip,sip
299
Thangavelu K S36edb012017-07-05 18:24:12 +0000300 def dhcp_request(self, onu_iface = None, seed_ip = '10.10.10.1', update_seed = False, validation = None, startip = '10.10.10.20', mac = None):
301 config = {'startip':startip, 'endip':'10.10.10.200',
Thangavelu K Sa1c71b42017-06-14 18:13:21 +0000302 'ip':'10.10.10.2', 'mac': "ca:fe:ca:fe:ca:fe",
303 'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'}
304 self.onos_dhcp_table_load(config)
305 dhcp = DHCPTest(seed_ip = seed_ip, iface =onu_iface)
Thangavelu K S36edb012017-07-05 18:24:12 +0000306 cip, sip = self.dhcp_sndrcv(dhcp, update_seed = update_seed, validation = validation, mac = mac)
Thangavelu K Sa1c71b42017-06-14 18:13:21 +0000307 return cip, sip
308
309 @classmethod
A R Karthick35495c32017-05-11 14:58:32 -0700310 def setUpClass(cls):
A.R Karthickb9eab5a2017-06-07 16:03:51 -0700311 cls.update_apps_version()
A R Karthick35495c32017-05-11 14:58:32 -0700312 cls.voltha = VolthaCtrl(cls.VOLTHA_HOST, rest_port = cls.VOLTHA_REST_PORT)
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000313 cls.install_app_table()
314 cls.olt = OltConfig(olt_conf_file = cls.olt_conf_file)
315 cls.port_map, cls.port_list = cls.olt.olt_port_map()
316 cls.switches = cls.port_map['switches']
Thangavelu K S36edb012017-07-05 18:24:12 +0000317 cls.ponsim_ports = cls.port_map['ponsim']
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000318 cls.num_ports = cls.port_map['num_ports']
319 if cls.num_ports > 1:
320 cls.num_ports -= 1 ##account for the tx port
321 cls.activate_apps(cls.apps + cls.olt_apps)
A.R Karthickf874d032017-06-07 18:47:51 -0700322 cls.onos_aaa_load()
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000323
A.R Karthick3493a572017-06-07 18:28:10 -0700324 @classmethod
325 def tearDownClass(cls):
326 '''Deactivate the olt apps and restart OVS back'''
327 apps = cls.olt_apps + ( cls.table_app,)
328 for app in apps:
329 onos_ctrl = OnosCtrl(app)
330 onos_ctrl.deactivate()
331 cls.install_app_igmp()
A.R Karthick3493a572017-06-07 18:28:10 -0700332 @classmethod
333 def install_app_igmp(cls):
334 ##Uninstall the table app on class exit
335 OnosCtrl.uninstall_app(cls.table_app)
336 time.sleep(2)
337 log_test.info('Installing back the cord igmp app %s for subscriber test on exit' %(cls.app_file))
338 OnosCtrl.install_app(cls.app_file)
A.R Karthickb9eab5a2017-06-07 16:03:51 -0700339
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000340 def remove_olt(self, switch_map):
341 controller = get_controller()
342 auth = ('karaf', 'karaf')
343 #remove subscriber for every port on all the voltha devices
344 for device, device_map in switch_map.iteritems():
345 uni_ports = device_map['ports']
346 uplink_vlan = device_map['uplink_vlan']
347 for port in uni_ports:
348 rest_url = 'http://{}:8181/onos/olt/oltapp/{}/{}'.format(controller,
349 device,
350 port)
351 resp = requests.delete(rest_url, auth = auth)
352 if resp.status_code not in [204, 202, 200]:
353 log_test.error('Error deleting subscriber for device %s on port %s' %(device, port))
354 else:
355 log_test.info('Deleted subscriber for device %s on port %s' %(device, port))
356 OnosCtrl.uninstall_app(self.olt_app_file)
357
358 def config_olt(self, switch_map):
359 controller = get_controller()
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000360 auth = ('karaf', 'karaf')
361 #configure subscriber for every port on all the voltha devices
362 for device, device_map in switch_map.iteritems():
363 uni_ports = device_map['ports']
364 uplink_vlan = device_map['uplink_vlan']
365 for port in uni_ports:
366 vlan = port
367 rest_url = 'http://{}:8181/onos/olt/oltapp/{}/{}/{}'.format(controller,
368 device,
369 port,
370 vlan)
371 resp = requests.post(rest_url, auth = auth)
372 #assert_equal(resp.ok, True)
373
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +0000374 def voltha_uni_port_toggle(self, uni_port = None):
375 ## Admin state of port is down and up
376 if not uni_port:
377 uni_port = self.INTF_RX_DEFAULT
378 cmd = 'ifconfig {} down'.format(uni_port)
379 os.system(cmd)
380 log_test.info('Admin state of uni_port is down')
381 time.sleep(30)
382 cmd = 'ifconfig {} up'.format(uni_port)
383 os.system(cmd)
384 log_test.info('Admin state of uni_port is up now')
385 time.sleep(30)
386 return
387
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000388 @classmethod
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000389 def install_app_table(cls):
390 ##Uninstall the existing app if any
391 OnosCtrl.uninstall_app(cls.table_app)
392 time.sleep(2)
393 log_test.info('Installing the multi table app %s for subscriber test' %(cls.table_app_file))
394 OnosCtrl.install_app(cls.table_app_file)
395 time.sleep(3)
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000396
397 @classmethod
398 def activate_apps(cls, apps):
399 for app in apps:
400 onos_ctrl = OnosCtrl(app)
401 status, _ = onos_ctrl.activate()
402 assert_equal(status, True)
403 time.sleep(2)
404
Thangavelu K S735a6662017-06-15 18:08:23 +0000405 @classmethod
406 def deactivate_apps(cls, apps):
Thangavelu K Se6c77c72017-06-23 21:28:48 +0000407 cls.success = True
Thangavelu K S735a6662017-06-15 18:08:23 +0000408 for app in apps:
409 onos_ctrl = OnosCtrl(app)
410 status, _ = onos_ctrl.deactivate()
411 if status is False:
Thangavelu K Se6c77c72017-06-23 21:28:48 +0000412 cls.success = False
413 # assert_equal(status, True)
Thangavelu K S735a6662017-06-15 18:08:23 +0000414 time.sleep(2)
415
Thangavelu K S36edb012017-07-05 18:24:12 +0000416 def random_ip(self,start_ip = '10.10.10.20', end_ip = '10.10.10.65'):
417 start = list(map(int, start_ip.split(".")))
418 end = list(map(int, end_ip.split(".")))
419 temp = start
420 ip_range = []
421 ip_range.append(start_ip)
422 while temp != end:
423 start[3] += 1
424 for i in (3, 2, 1):
425 if temp[i] == 255:
426 temp[i] = 0
427 temp[i-1] += 1
428 ip_range.append(".".join(map(str, temp)))
429 return random.choice(ip_range)
430
431 def tls_flow_check(self, olt_ports, cert_info = None):
432 if len(olt_ports[0]) >= 2:
433 olt_nni_port = olt_ports[0]
434 olt_uni_port = olt_ports[1]
435 elif len(olt_ports[0]) == 1:
436 olt_uni_port = olt_ports
437
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000438 def tls_fail_cb():
439 log_test.info('TLS verification failed')
440 if cert_info is None:
A.R Karthickb9eab5a2017-06-07 16:03:51 -0700441 tls = TLSAuthTest(fail_cb = tls_fail_cb, intf = olt_uni_port)
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000442 log_test.info('Running subscriber %s tls auth test with valid TLS certificate' %olt_uni_port)
443 tls.runTest()
Thangavelu K S9648eed2017-06-13 20:15:25 +0000444 if tls.failTest is True:
445 self.success = False
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000446 assert_equal(tls.failTest, False)
447 if cert_info == "no_cert":
448 tls = TLSAuthTest(fail_cb = tls_fail_cb, intf = olt_uni_port, client_cert = '')
449 log_test.info('Running subscriber %s tls auth test with no TLS certificate' %olt_uni_port)
450 tls.runTest()
Thangavelu K S9648eed2017-06-13 20:15:25 +0000451 if tls.failTest is False:
452 self.success = False
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000453 assert_equal(tls.failTest, True)
454 if cert_info == "invalid_cert":
455 tls = TLSAuthTest(fail_cb = tls_fail_cb, intf = olt_uni_port, client_cert = self.CLIENT_CERT_INVALID)
456 log_test.info('Running subscriber %s tls auth test with invalid TLS certificate' %olt_uni_port)
457 tls.runTest()
Thangavelu K S9648eed2017-06-13 20:15:25 +0000458 if tls.failTest is False:
459 self.success = False
460 assert_equal(tls.failTest, True)
461 if cert_info == "same_cert":
462 tls = TLSAuthTest(fail_cb = tls_fail_cb, intf = olt_uni_port)
463 log_test.info('Running subscriber %s tls auth test with invalid TLS certificate' %olt_uni_port)
464 tls.runTest()
465 if tls.failTest is False:
466 self.success = False
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000467 assert_equal(tls.failTest, True)
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +0000468 if cert_info == "app_deactivate" or cert_info == "restart_radius" or cert_info == "disable_olt_device" or \
Thangavelu K S9648eed2017-06-13 20:15:25 +0000469 cert_info == "uni_port_admin_down" or cert_info == "restart_olt_device" or cert_info == "restart_onu_device":
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +0000470 tls = TLSAuthTest(fail_cb = tls_fail_cb, intf = olt_uni_port, client_cert = self.CLIENT_CERT_INVALID)
471 log_test.info('Running subscriber %s tls auth test with %s' %(olt_uni_port,cert_info))
472 tls.runTest()
Thangavelu K S9648eed2017-06-13 20:15:25 +0000473 if tls.failTest is False:
474 self.success = False
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +0000475 assert_equal(tls.failTest, True)
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000476 self.test_status = True
477 return self.test_status
A R Karthick35495c32017-05-11 14:58:32 -0700478
Thangavelu K S36edb012017-07-05 18:24:12 +0000479 def dhcp_flow_check(self, olt_ports =None, negative_test = None):
480 if len(olt_ports[0]) >= 2:
481 olt_nni_port = olt_ports[0]
482 onu_iface = olt_ports[1]
483 dhcp_server_startip = self.random_ip()
484 random_mac = '00:00:00:0a:0a:' + hex(random.randrange(50,254)).split('x')[1]
485 elif len(olt_ports[0]) == 1:
486 onu_iface = olt_ports
487 dhcp_server_startip = '10.10.10.20'
488 random_mac = None
Thangavelu K S735a6662017-06-15 18:08:23 +0000489 self.success = True
490
Thangavelu K Sa1c71b42017-06-14 18:13:21 +0000491 if negative_test is None:
Thangavelu K S36edb012017-07-05 18:24:12 +0000492 cip, sip = self.dhcp_request(onu_iface, update_seed = True, validation = 'skip', startip = dhcp_server_startip, mac = random_mac)
493 if cip == None or sip == None:
Thangavelu K S735a6662017-06-15 18:08:23 +0000494 self.success = False
Thangavelu K S0ffd5b82017-06-21 18:01:59 +0000495 self.test_status = False
496 assert_not_equal(cip,None)
497 assert_not_equal(sip,None)
498 else:
499 log_test.info('Subscriber %s client ip %s from server %s' %(onu_iface, cip, sip))
500 self.test_status = True
Thangavelu K S735a6662017-06-15 18:08:23 +0000501
Thangavelu K S0ffd5b82017-06-21 18:01:59 +0000502 if negative_test == "interrupting_dhcp_flows":
503 cip, sip = self.dhcp_request(onu_iface, update_seed = True, validation = False)
Thangavelu K S735a6662017-06-15 18:08:23 +0000504 if cip is not None:
505 self.success = False
506 assert_equal(cip,None)
Thangavelu K S0ffd5b82017-06-21 18:01:59 +0000507 log_test.info('Subscriber %s not got client ip %s from server' %(onu_iface, cip))
Thangavelu K Sa1c71b42017-06-14 18:13:21 +0000508 self.test_status = True
509
510 if negative_test == "invalid_src_mac_broadcast":
511 config = {'startip':'10.10.10.20', 'endip':'10.10.10.69',
512 'ip':'10.10.10.2', 'mac': "ca:fe:ca:fe:ca:fe",
513 'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'}
514 self.onos_dhcp_table_load(config)
515 self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = onu_iface)
516 cip, sip, mac, _ = self.dhcp.only_discover(mac='ff:ff:ff:ff:ff:ff')
Thangavelu K S735a6662017-06-15 18:08:23 +0000517
518 if cip is not None:
519 self.success = False
520 log_test.info('ONOS dhcp server rejected client discover with invalid source mac as expected self.success = %s '%self.success)
Thangavelu K Sa1c71b42017-06-14 18:13:21 +0000521 assert_equal(cip,None)
522 log_test.info('ONOS dhcp server rejected client discover with invalid source mac as expected')
523 self.test_status = True
524 if negative_test == "invalid_src_mac_multicast":
525 config = {'startip':'10.10.10.20', 'endip':'10.10.10.69',
526 'ip':'10.10.10.2', 'mac': "ca:fe:ca:fe:ca:fe",
527 'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'}
528 self.onos_dhcp_table_load(config)
529 self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = onu_iface)
530 cip, sip, mac, _ = self.dhcp.only_discover(mac='01:80:c2:91:02:e4')
Thangavelu K S735a6662017-06-15 18:08:23 +0000531 if cip is not None:
532 self.success = False
Thangavelu K Sa1c71b42017-06-14 18:13:21 +0000533 assert_equal(cip,None)
534 log_test.info('ONOS dhcp server rejected client discover with invalid source mac as expected')
535 self.test_status = True
536
537 if negative_test == "invalid_src_mac_junk":
538 config = {'startip':'10.10.10.20', 'endip':'10.10.10.69',
539 'ip':'10.10.10.2', 'mac': "ca:fe:ca:fe:ca:fe",
540 'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'}
541 self.onos_dhcp_table_load(config)
542 self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = onu_iface)
543 cip, sip, mac, _ = self.dhcp.only_discover(mac='00:00:00:00:00:00')
Thangavelu K S735a6662017-06-15 18:08:23 +0000544 if cip is not None:
545 self.success = False
Thangavelu K Sa1c71b42017-06-14 18:13:21 +0000546 assert_equal(cip,None)
547 log_test.info('ONOS dhcp server rejected client discover with invalid source mac as expected')
548 self.test_status = True
549
550 if negative_test == "request_release":
551 config = {'startip':'10.10.100.20', 'endip':'10.10.100.230',
552 'ip':'10.10.100.2', 'mac': "ca:fe:ca:fe:8a:fe",
553 'subnet': '255.255.255.0', 'broadcast':'10.10.100.255', 'router':'10.10.100.1'}
554 self.onos_dhcp_table_load(config)
555 self.dhcp = DHCPTest(seed_ip = '10.10.100.10', iface = onu_iface)
556 cip, sip = self.dhcp_sndrcv(self.dhcp)
557 log_test.info('Releasing ip %s to server %s' %(cip, sip))
Thangavelu K S0ffd5b82017-06-21 18:01:59 +0000558 if not self.dhcp.release(cip):
559 self.success = False
Thangavelu K Sa1c71b42017-06-14 18:13:21 +0000560 assert_equal(self.dhcp.release(cip), True)
561 log_test.info('Triggering DHCP discover again after release')
562 cip2, sip2 = self.dhcp_sndrcv(self.dhcp, update_seed = True)
563 log_test.info('Verifying released IP was given back on rediscover')
Thangavelu K S0ffd5b82017-06-21 18:01:59 +0000564 if not cip == cip2:
Thangavelu K S735a6662017-06-15 18:08:23 +0000565 self.success = False
Thangavelu K Sa1c71b42017-06-14 18:13:21 +0000566 assert_equal(cip, cip2)
567 log_test.info('Test done. Releasing ip %s to server %s' %(cip2, sip2))
568 assert_equal(self.dhcp.release(cip2), True)
569 self.test_status = True
Thangavelu K S735a6662017-06-15 18:08:23 +0000570 if negative_test == "starvation_positive":
571 config = {'startip':'193.170.1.20', 'endip':'193.170.1.69',
572 'ip':'193.170.1.2', 'mac': "ca:fe:c2:fe:cc:fe",
573 'subnet': '255.255.255.0', 'broadcast':'192.168.1.255', 'router': '192.168.1.1'}
574 self.onos_dhcp_table_load(config)
575 self.dhcp = DHCPTest(seed_ip = '192.169.1.1', iface = onu_iface)
576 ip_map = {}
577 for i in range(10):
578 cip, sip = self.dhcp_sndrcv(self.dhcp, update_seed = True)
579 if ip_map.has_key(cip):
580 self.success = False
581 log_test.info('IP %s given out multiple times' %cip)
582 assert_equal(False, ip_map.has_key(cip))
583 ip_map[cip] = sip
584 self.test_status = True
585 if negative_test == "starvation_negative":
586 config = {'startip':'182.17.0.20', 'endip':'182.17.0.69',
587 'ip':'182.17.0.2', 'mac': "ca:fe:c3:fe:ca:fe",
588 'subnet': '255.255.255.0', 'broadcast':'182.17.0.255', 'router':'182.17.0.1'}
589 self.onos_dhcp_table_load(config)
590 self.dhcp = DHCPTest(seed_ip = '182.17.0.1', iface = onu_iface)
591 log_test.info('Verifying passitive case')
592 for x in xrange(50):
593 mac = RandMAC()._fix()
594 self.dhcp_sndrcv(self.dhcp,mac = mac)
595 log_test.info('Verifying negative case')
596 cip, sip = self.dhcp_sndrcv(self.dhcp,update_seed = True)
Thangavelu K S0ffd5b82017-06-21 18:01:59 +0000597 if cip or sip is not None:
598 self.success = False
Thangavelu K S735a6662017-06-15 18:08:23 +0000599 assert_equal(cip, None)
600 assert_equal(sip, None)
601 self.test_status = True
602 self.success = True
603 if negative_test == "multiple_discover":
604 config = {'startip':'10.10.10.20', 'endip':'10.10.10.69',
605 'ip':'10.10.10.2', 'mac': "ca:fe:ca:fe:ca:fe",
606 'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'}
607 self.onos_dhcp_table_load(config)
608 self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = onu_iface)
609 cip, sip, mac, _ = self.dhcp.only_discover()
610 log_test.info('Got dhcp client IP %s from server %s for mac %s . Not going to send DHCPREQUEST.' %
611 (cip, sip, mac) )
Thangavelu K S0ffd5b82017-06-21 18:01:59 +0000612 if cip is None:
613 self.success = False
Thangavelu K S735a6662017-06-15 18:08:23 +0000614 assert_not_equal(cip, None)
615 log_test.info('Triggering DHCP discover again.')
616 new_cip, new_sip, new_mac, _ = self.dhcp.only_discover()
Thangavelu K S0ffd5b82017-06-21 18:01:59 +0000617 if not new_cip == cip:
618 self.success = False
Thangavelu K S735a6662017-06-15 18:08:23 +0000619 assert_equal(new_cip, cip)
620 log_test.info('client got same IP as expected when sent 2nd discovery')
621 self.test_status = True
Thangavelu K Se6c77c72017-06-23 21:28:48 +0000622 # self.success = True
Thangavelu K S735a6662017-06-15 18:08:23 +0000623 if negative_test == "multiple_requests":
624 config = {'startip':'10.10.10.20', 'endip':'10.10.10.69',
625 'ip':'10.10.10.2', 'mac': "ca:fe:ca:fe:ca:fe",
626 'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'}
627 self.onos_dhcp_table_load(config)
628 self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = onu_iface)
629 log_test.info('Sending DHCP discover and DHCP request.')
630 cip, sip = self.dhcp_sndrcv(self.dhcp,update_seed = True)
631 mac = self.dhcp.get_mac(cip)[0]
632 log_test.info("Sending DHCP request again.")
633 new_cip, new_sip = self.dhcp.only_request(cip, mac)
634 assert_equal(new_cip,cip)
635 log_test.info('server offered same IP to clain for multiple requests, as expected')
636 self.test_status = True
Thangavelu K Se6c77c72017-06-23 21:28:48 +0000637# self.success = True
Thangavelu K S735a6662017-06-15 18:08:23 +0000638 if negative_test == "desired_ip_address":
639 config = {'startip':'20.20.20.30', 'endip':'20.20.20.69',
640 'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe",
641 'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'}
642 self.onos_dhcp_table_load(config)
643 self.dhcp = DHCPTest(seed_ip = '20.20.20.50', iface = onu_iface)
644 cip, sip, mac, _ = self.dhcp.only_discover(desired = True)
Thangavelu K S0ffd5b82017-06-21 18:01:59 +0000645 if cip or sip is None:
646 self.success = False
Thangavelu K S735a6662017-06-15 18:08:23 +0000647 assert_not_equal(cip, None)
648 log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
649 (cip, sip, mac))
Thangavelu K S0ffd5b82017-06-21 18:01:59 +0000650 if not self.dhcp.seed_ip == cip:
651 self.success = False
Thangavelu K S735a6662017-06-15 18:08:23 +0000652 assert_equal(cip,self.dhcp.seed_ip)
653 log_test.info('ONOS dhcp server offered client requested IP %s as expected'%self.dhcp.seed_ip)
654 self.test_status = True
Thangavelu K S0ffd5b82017-06-21 18:01:59 +0000655 # self.success = True
Thangavelu K S735a6662017-06-15 18:08:23 +0000656 if negative_test == "desired_out_of_pool_ip_address":
657 config = {'startip':'20.20.20.30', 'endip':'20.20.20.69',
658 'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe",
659 'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'}
660 self.onos_dhcp_table_load(config)
661 self.dhcp = DHCPTest(seed_ip = '20.20.20.75', iface = onu_iface)
662 cip, sip, mac, _ = self.dhcp.only_discover(desired = True)
Thangavelu K S0ffd5b82017-06-21 18:01:59 +0000663 if cip or sip is None:
664 self.success = False
Thangavelu K S735a6662017-06-15 18:08:23 +0000665 assert_not_equal(cip, None)
666 log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
667 (cip, sip, mac) )
Thangavelu K S0ffd5b82017-06-21 18:01:59 +0000668 if self.dhcp.seed_ip == cip:
669 self.success = False
Thangavelu K S735a6662017-06-15 18:08:23 +0000670 assert_not_equal(cip,self.dhcp.seed_ip)
671 log_test.info('server offered IP from its pool of IPs when requested out of pool IP, as expected')
672 self.test_status = True
Thangavelu K Se6c77c72017-06-23 21:28:48 +0000673 # self.success = True
Thangavelu K S0f2c5232017-06-19 19:11:43 +0000674 if negative_test == "dhcp_renew":
675 config = {'startip':'20.20.20.30', 'endip':'20.20.20.69',
676 'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe",
677 'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'}
678 self.onos_dhcp_table_load(config)
679 self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = onu_iface)
680 cip, sip, mac, _ = self.dhcp.only_discover()
681 log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
682 (cip, sip, mac) )
Thangavelu K S0ffd5b82017-06-21 18:01:59 +0000683 if cip or sip is None:
684 self.success = False
Thangavelu K S0f2c5232017-06-19 19:11:43 +0000685 assert_not_equal(cip, None)
686 new_cip, new_sip, lval = self.dhcp.only_request(cip, mac, renew_time = True)
687 log_test.info('waiting renew time %d seconds to send next request packet'%lval)
688 time.sleep(lval)
689 latest_cip, latest_sip, lval = self.dhcp.only_request(cip, mac, renew_time = True)
Thangavelu K S0ffd5b82017-06-21 18:01:59 +0000690 if not latest_cip == cip:
691 self.success = False
Thangavelu K S0f2c5232017-06-19 19:11:43 +0000692 assert_equal(latest_cip,cip)
693 log_test.info('client got same IP after renew time, as expected')
Thangavelu K S735a6662017-06-15 18:08:23 +0000694 self.test_status = True
Thangavelu K S0ffd5b82017-06-21 18:01:59 +0000695 # self.success = True
Thangavelu K S0f2c5232017-06-19 19:11:43 +0000696 if negative_test == "dhcp_rebind":
697 config = {'startip':'20.20.20.30', 'endip':'20.20.20.69',
698 'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe",
699 'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'}
700 self.onos_dhcp_table_load(config)
701 self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = onu_iface)
702 cip, sip, mac, _ = self.dhcp.only_discover()
703 log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
704 (cip, sip, mac) )
Thangavelu K S0ffd5b82017-06-21 18:01:59 +0000705 if cip or sip is None:
706 self.success = False
Thangavelu K S0f2c5232017-06-19 19:11:43 +0000707 assert_not_equal(cip, None)
708 new_cip, new_sip, lval = self.dhcp.only_request(cip, mac, rebind_time = True)
709 log_test.info('waiting rebind time %d seconds to send next request packet'%lval)
710 time.sleep(lval)
711 latest_cip, latest_sip = self.dhcp.only_request(new_cip, mac)
Thangavelu K S0ffd5b82017-06-21 18:01:59 +0000712 if not latest_cip == cip:
713 self.success = False
Thangavelu K S0f2c5232017-06-19 19:11:43 +0000714 assert_equal(latest_cip,cip)
715 log_test.info('client got same IP after rebind time, as expected')
Thangavelu K S735a6662017-06-15 18:08:23 +0000716 self.test_status = True
Thangavelu K S0ffd5b82017-06-21 18:01:59 +0000717 # self.success = True
Thangavelu K Sa1c71b42017-06-14 18:13:21 +0000718 return self.test_status
719
Thangavelu K S36edb012017-07-05 18:24:12 +0000720 def recv_channel_cb(self, pkt):
721 ##First verify that we have received the packet for the joined instance
722 chan = self.subscriber.caddr(pkt[IP].dst)
723 assert_equal(chan in self.subscriber.join_map.keys(), True)
724 recv_time = monotonic.monotonic() * 1000000
725 join_time = self.subscriber.join_map[chan][self.subscriber.STATS_JOIN].start
726 delta = recv_time - join_time
727 self.subscriber.join_rx_stats.update(packets=1, t = delta, usecs = True)
728 self.subscriber.channel_update(chan, self.subscriber.STATS_RX, 1, t = delta)
729 log_test.debug('Packet received in %.3f usecs for group %s after join' %(delta, pkt[IP].dst))
730 self.test_status = True
731
732 def traffic_verify(self, subscriber):
733 # if subscriber.has_service('TRAFFIC'):
734 url = 'http://www.google.com'
735 resp = requests.get(url)
736 self.test_status = resp.ok
737 if resp.ok == False:
738 log_test.info('Subscriber %s failed get from url %s with status code %d'
739 %(subscriber.name, url, resp.status_code))
740 else:
741 log_test.info('GET request from %s succeeded for subscriber %s'
742 %(url, subscriber.name))
743 return self.test_status
744
745 def voltha_igmp_verify(self, subscriber):
746 chan = 0
747 #if subscriber.has_service('IGMP'):
748 ##We wait for all the subscribers to join before triggering leaves
749 if subscriber.rx_port > 1:
750 time.sleep(5)
751 subscriber.channel_join(chan, delay = 0)
752 self.num_joins += 1
753 while self.num_joins < self.num_subscribers:
754 time.sleep(5)
755 log_test.info('All subscribers have joined the channel')
756 for i in range(10):
757 subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10)
758 log_test.info('Leaving channel %d for subscriber %s' %(chan, subscriber.name))
759 subscriber.channel_leave(chan)
760 time.sleep(5)
761 log_test.info('Interface %s Join RX stats for subscriber %s, %s' %(subscriber.iface, subscriber.name,subscriber.join_rx_stats))
762 #Should not receive packets for this subscriber
763 self.recv_timeout = True
764 subscriber.recv_timeout = True
765 subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10)
766 subscriber.recv_timeout = False
767 self.recv_timeout = False
768 log_test.info('Joining channel %d for subscriber %s' %(chan, subscriber.name))
769 subscriber.channel_join(chan, delay = 0)
770 self.test_status = True
771 return self.test_status
772
773 def voltha_igmp_jump_verify(self, subscriber):
774 if subscriber.has_service('IGMP'):
775 for i in xrange(subscriber.num):
776 log_test.info('Subscriber %s jumping channel' %subscriber.name)
777 chan = subscriber.channel_jump(delay=0)
778 subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 1)
779 log_test.info('Verified receive for channel %d, subscriber %s' %(chan, subscriber.name))
780 time.sleep(3)
781 log_test.info('Interface %s Jump RX stats for subscriber %s, %s' %(subscriber.iface, subscriber.name, subscriber.join_rx_stats))
782 self.test_status = True
783 return self.test_status
784
785
786 def voltha_igmp_next_verify(self, subscriber):
787 #if subscriber.has_service('IGMP'):
788 for c in xrange(self.VOLTHA_IGMP_ITERATIONS):
789 for i in xrange(subscriber.num):
790 if i:
791 chan = subscriber.channel_join_next(delay=0, leave_flag = self.leave_flag)
792 time.sleep(0.2)
793 else:
794 chan = subscriber.channel_join(i, delay=0)
795 time.sleep(0.2)
796 if subscriber.num == 1:
797 subscriber.channel_leave(chan)
798 log_test.info('Joined next channel %d for subscriber %s' %(chan, subscriber.name))
799 #subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count=1)
800 #log_test.info('Verified receive for channel %d, subscriber %s' %(chan, subscriber.name))
801 self.test_status = True
802 return self.test_status
803
804 def voltha_subscribers(self, services, cbs = None, num_subscribers = 1, num_channels = 1):
805 """Test subscriber join next for channel surfing"""
806 voltha = VolthaCtrl(self.VOLTHA_HOST,
807 rest_port = self.VOLTHA_REST_PORT,
808 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
809 if self.VOLTHA_OLT_TYPE.startswith('ponsim'):
810 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
811 log_test.info('Enabling ponsim olt')
812 device_id, status = voltha.enable_device(self.VOLTHA_OLT_TYPE, address = ponsim_address)
813 else:
814 log_test.info('This setup test cases is developed on ponsim olt only, hence stop execution')
815 assert_equal(False, True)
816
817 assert_not_equal(device_id, None)
818 if status == False:
819 voltha.disable_device(device_id, delete = True)
820 assert_equal(status, True)
821 time.sleep(10)
822 switch_map = None
823 olt_configured = False
824 try:
825 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
826 if not switch_map:
827 log_test.info('No voltha devices found')
828 return
829 log_test.info('Installing OLT app')
830 OnosCtrl.install_app(self.olt_app_file)
831 time.sleep(5)
832 log_test.info('Adding subscribers through OLT app')
833 self.config_olt(switch_map)
834 olt_configured = True
835 time.sleep(5)
836 self.num_subscribers = num_subscribers
837 self.num_channels = num_channels
838 test_status = self.subscriber_flows_check(num_subscribers = self.num_subscribers,
839 num_channels = self.num_channels,
840 cbs = cbs,
841 port_list = self.generate_port_list(self.num_subscribers,
842 self.num_channels),
843 services = services)
844 assert_equal(test_status, True)
845 finally:
846 if switch_map is not None:
847 if olt_configured is True:
848 self.remove_olt(switch_map)
849 voltha.disable_device(device_id, delete = True)
850 time.sleep(10)
851 log_test.info('Uninstalling OLT app')
852 OnosCtrl.uninstall_app(self.olt_app_name)
853
854
855
856 def subscriber_flows_check( self, num_subscribers = 10, num_channels = 1,
857 channel_start = 0, cbs = None, port_list = [],
858 services = None, negative_subscriber_auth = None):
859 self.test_status = False
860 self.ovs_cleanup()
861 subscribers_count = num_subscribers
862 sub_loop_count = num_subscribers
863 if not port_list:
864 port_list = self.generate_port_list(num_subscribers, num_channels)
865 subscriber_tx_rx_ports = []
866 for i in range(num_subscribers):
867 subscriber_tx_rx_ports.append((self.port_map['ports'][port_list[i][0]], self.port_map['ports'][port_list[i][1]]))
868 self.onos_aaa_load()
869 self.thread_pool = ThreadPool(min(100, subscribers_count), queue_size=1, wait_timeout=1)
870
871 chan_leave = False #for single channel, multiple subscribers
872 if cbs is None:
873 cbs = (self.tls_flow_check, self.dhcp_flow_check, self.igmp_flow_check)
874 chan_leave = True
875 for subscriber in subscriber_tx_rx_ports:
876 sub_loop_count = sub_loop_count - 1
877 pool_object = voltha_subscriber_pool(subscriber, cbs)
878 self.thread_pool.addTask(pool_object.pool_cb)
879 self.thread_pool.cleanUpThreads()
880 subscribers_count = 0
881 return self.test_status
882
883
884 def generate_port_list(self, subscribers, channels):
885 return self.port_list[:subscribers]
886
887
888 @classmethod
889 def ovs_cleanup(cls):
890 ##For every test case, delete all the OVS groups
891 cmd = 'ovs-ofctl del-groups br-int -OOpenFlow11 >/dev/null 2>&1'
892 try:
893 cord_test_shell(cmd)
894 ##Since olt config is used for this test, we just fire a careless local cmd as well
895 os.system(cmd)
896 finally:
897 return
898
899
A.R Karthick8a507cf2017-06-02 18:44:49 -0700900 def test_olt_enable_disable(self):
A R Karthick35495c32017-05-11 14:58:32 -0700901 log_test.info('Enabling OLT type %s, MAC %s' %(self.OLT_TYPE, self.OLT_MAC))
A.R Karthick8a507cf2017-06-02 18:44:49 -0700902 device_id, status = self.voltha.enable_device(self.OLT_TYPE, self.OLT_MAC)
903 assert_not_equal(device_id, None)
904 try:
905 assert_equal(status, True)
906 time.sleep(10)
907 finally:
908 self.voltha.disable_device(device_id, delete = True)
Thangavelu K S008f38e2017-05-15 19:36:55 +0000909
A.R Karthick8a507cf2017-06-02 18:44:49 -0700910 def test_ponsim_enable_disable(self):
A.R Karthick8b9c5f12017-05-30 17:47:08 -0700911 log_test.info('Enabling ponsim_olt')
912 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
A.R Karthick8a507cf2017-06-02 18:44:49 -0700913 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
914 assert_not_equal(device_id, None)
915 try:
916 assert_equal(status, True)
917 time.sleep(10)
918 finally:
919 self.voltha.disable_device(device_id, delete = True)
A.R Karthick8b9c5f12017-05-30 17:47:08 -0700920
Thangavelu K S008f38e2017-05-15 19:36:55 +0000921 def test_subscriber_with_voltha_for_eap_tls_authentication(self):
922 """
923 Test Method:
924 0. Make sure that voltha is up and running on CORD-POD setup.
925 1. OLT and ONU is detected and validated.
926 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
927 3. Issue auth request packets from CORD TESTER voltha test module acting as a subscriber..
928 4. Validate that eap tls valid auth packets are being exchanged between subscriber, onos and freeradius.
929 5. Verify that subscriber is authenticated successfully.
930 """
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000931 log_test.info('Enabling ponsim_olt')
932 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
933 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
934 assert_not_equal(device_id, None)
A.R Karthickb9eab5a2017-06-07 16:03:51 -0700935 if status == False:
936 self.voltha.disable_device(device_id, delete = True)
937 assert_equal(status, True)
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000938 time.sleep(10)
939 switch_map = None
940 olt_configured = False
A.R Karthickb9eab5a2017-06-07 16:03:51 -0700941 voltha = VolthaCtrl(self.VOLTHA_HOST,
942 rest_port = self.VOLTHA_REST_PORT,
943 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000944 try:
A.R Karthickb9eab5a2017-06-07 16:03:51 -0700945 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
946 if not switch_map:
947 log_test.info('No voltha devices found')
948 return
949 log_test.info('Installing OLT app')
950 OnosCtrl.install_app(self.olt_app_file)
951 time.sleep(5)
952 log_test.info('Adding subscribers through OLT app')
953 self.config_olt(switch_map)
954 olt_configured = True
955 time.sleep(5)
956 auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT)
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000957 assert_equal(auth_status, True)
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000958 finally:
A.R Karthickb9eab5a2017-06-07 16:03:51 -0700959 if switch_map is not None:
960 if olt_configured is True:
961 self.remove_olt(switch_map)
962 self.voltha.disable_device(device_id, delete = True)
963 time.sleep(10)
964 OnosCtrl.uninstall_app(self.olt_app_name)
Thangavelu K S008f38e2017-05-15 19:36:55 +0000965
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000966 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S008f38e2017-05-15 19:36:55 +0000967 def test_subscriber_with_voltha_for_eap_tls_authentication_failure(self):
968 """
969 Test Method:
970 0. Make sure that voltha is up and running on CORD-POD setup.
971 1. OLT and ONU is detected and validated.
972 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
973 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
974 4. Validate that eap tls without cert auth packet is being exchanged between subscriber, onos and freeradius.
975 5. Verify that subscriber authentication is unsuccessful..
976 """
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000977 df = defer.Deferred()
978 def tls_flow_check_with_no_cert_scenario(df):
979 log_test.info('Enabling ponsim_olt')
980 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
981 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
982 assert_not_equal(device_id, None)
983 voltha = VolthaCtrl(self.VOLTHA_HOST,
A.R Karthickb9eab5a2017-06-07 16:03:51 -0700984 rest_port = self.VOLTHA_REST_PORT,
985 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000986 time.sleep(10)
987 switch_map = None
988 olt_configured = False
989 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
990 log_test.info('Installing OLT app')
991 OnosCtrl.install_app(self.olt_app_file)
992 time.sleep(5)
993 log_test.info('Adding subscribers through OLT app')
994 self.config_olt(switch_map)
995 olt_configured = True
996 time.sleep(5)
997 auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT, cert_info = "no_cert")
998 try:
999 assert_equal(auth_status, True)
1000 assert_equal(status, True)
1001 time.sleep(10)
1002 finally:
A.R Karthickb9eab5a2017-06-07 16:03:51 -07001003 self.remove_olt(switch_map)
Thangavelu K S77c8c0c2017-06-07 18:04:21 +00001004 self.voltha.disable_device(device_id, delete = True)
1005 df.callback(0)
A.R Karthickb9eab5a2017-06-07 16:03:51 -07001006
Thangavelu K S77c8c0c2017-06-07 18:04:21 +00001007 reactor.callLater(0, tls_flow_check_with_no_cert_scenario, df)
1008 return df
Thangavelu K S008f38e2017-05-15 19:36:55 +00001009
Thangavelu K S77c8c0c2017-06-07 18:04:21 +00001010 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S008f38e2017-05-15 19:36:55 +00001011 def test_subscriber_with_voltha_for_eap_tls_authentication_using_invalid_cert(self):
1012 """
1013 Test Method:
1014 0. Make sure that voltha is up and running on CORD-POD setup.
1015 1. OLT and ONU is detected and validated.
1016 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
1017 3. Issue tls auth packets and exchange invalid cert from CORD TESTER voltha test module acting as a subscriber..
1018 4. Validate that eap tls with invalid cert auth packet is being exchanged between subscriber, onos and freeradius.
1019 5. Verify that subscriber authentication is unsuccessful..
1020 """
Thangavelu K S77c8c0c2017-06-07 18:04:21 +00001021 df = defer.Deferred()
1022 def tls_flow_check_with_invalid_cert_scenario(df):
1023 log_test.info('Enabling ponsim_olt')
1024 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
1025 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
1026 assert_not_equal(device_id, None)
1027 voltha = VolthaCtrl(self.VOLTHA_HOST,
1028 rest_port = self.VOLTHA_REST_PORT,
1029 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
1030 time.sleep(10)
1031 switch_map = None
1032 olt_configured = False
1033 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
1034 log_test.info('Installing OLT app')
1035 OnosCtrl.install_app(self.olt_app_file)
1036 time.sleep(5)
1037 log_test.info('Adding subscribers through OLT app')
1038 self.config_olt(switch_map)
1039 olt_configured = True
1040 time.sleep(5)
1041 auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT, cert_info = "invalid_cert")
1042 try:
1043 assert_equal(auth_status, True)
1044 assert_equal(status, True)
1045 time.sleep(10)
1046 finally:
A.R Karthickb9eab5a2017-06-07 16:03:51 -07001047 self.remove_olt(switch_map)
Thangavelu K S77c8c0c2017-06-07 18:04:21 +00001048 self.voltha.disable_device(device_id, delete = True)
1049 df.callback(0)
1050 reactor.callLater(0, tls_flow_check_with_invalid_cert_scenario, df)
1051 return df
Thangavelu K S008f38e2017-05-15 19:36:55 +00001052
Thangavelu K S0d745c82017-06-09 21:56:08 +00001053 @deferred(TESTCASE_TIMEOUT)
1054 def test_subscriber_with_voltha_for_multiple_invalid_authentication_attempts(self):
1055 """
1056 Test Method:
1057 0. Make sure that voltha is up and running on CORD-POD setup.
1058 1. OLT and ONU is detected and validated.
1059 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
1060 3. Issue tls auth packets and exchange invalid cert from CORD TESTER voltha test module acting as a subscriber for multiple times.
1061 4. Validate that eap tls with invalid cert auth packet is being exchanged between subscriber, onos and freeradius.
1062 5. Verify that subscriber authentication is unsuccessful..
1063 """
1064 df = defer.Deferred()
1065 def tls_flow_check_with_no_cert_scenario(df):
1066 log_test.info('Enabling ponsim_olt')
1067 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
1068 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
1069 assert_not_equal(device_id, None)
1070 voltha = VolthaCtrl(self.VOLTHA_HOST,
1071 rest_port = self.VOLTHA_REST_PORT,
1072 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
1073 time.sleep(10)
1074 switch_map = None
1075 olt_configured = False
1076 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
1077 log_test.info('Installing OLT app')
1078 OnosCtrl.install_app(self.olt_app_file)
1079 time.sleep(5)
1080 log_test.info('Adding subscribers through OLT app')
1081 self.config_olt(switch_map)
1082 olt_configured = True
1083 time.sleep(5)
1084 auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT, cert_info = "invalid_cert")
1085 auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT, cert_info = "invalid_cert")
1086 auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT, cert_info = "no_cert")
1087 auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT, cert_info = "invalid_cert")
1088 try:
1089 assert_equal(auth_status, True)
1090 assert_equal(status, True)
1091 time.sleep(10)
1092 finally:
1093 self.voltha.disable_device(device_id, delete = True)
1094 df.callback(0)
1095 reactor.callLater(0, tls_flow_check_with_no_cert_scenario, df)
1096 return df
1097
1098 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S008f38e2017-05-15 19:36:55 +00001099 def test_subscriber_with_voltha_for_eap_tls_authentication_with_aaa_app_deactivation(self):
1100 """
1101 Test Method:
1102 0. Make sure that voltha is up and running on CORD-POD setup.
1103 1. OLT and ONU is detected and validated.
1104 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
1105 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1106 4. Validate that eap tls without sending client hello, it's not being exchanged between client, onos and freeradius.
1107 5. Verify that subscriber authentication is unsuccessful..
1108 """
Thangavelu K S0d745c82017-06-09 21:56:08 +00001109 df = defer.Deferred()
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00001110 def tls_flow_check_deactivating_app(df):
Thangavelu K S0d745c82017-06-09 21:56:08 +00001111 aaa_app = ["org.opencord.aaa"]
1112 log_test.info('Enabling ponsim_olt')
1113 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
1114 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
1115 assert_not_equal(device_id, None)
1116 voltha = VolthaCtrl(self.VOLTHA_HOST,
1117 rest_port = self.VOLTHA_REST_PORT,
1118 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
1119 time.sleep(10)
1120 switch_map = None
1121 olt_configured = False
1122 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
1123 log_test.info('Installing OLT app')
1124 OnosCtrl.install_app(self.olt_app_file)
1125 time.sleep(5)
1126 log_test.info('Adding subscribers through OLT app')
1127 self.config_olt(switch_map)
1128 olt_configured = True
1129 time.sleep(5)
Thangavelu K S008f38e2017-05-15 19:36:55 +00001130
Thangavelu K S0d745c82017-06-09 21:56:08 +00001131 thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT,"app_deactivate",))
1132 thread2 = threading.Thread(target = self.deactivate_apps, args = (aaa_app,))
1133 thread1.start()
1134 time.sleep(randint(1,2))
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00001135 log_test.info('Restart aaa app in onos during tls auth flow check on voltha')
Thangavelu K S0d745c82017-06-09 21:56:08 +00001136 thread2.start()
1137 time.sleep(10)
1138 thread1.join()
1139 thread2.join()
1140 try:
1141 # assert_equal(status, True)
Thangavelu K S9648eed2017-06-13 20:15:25 +00001142 assert_equal(self.success, True)
Thangavelu K S0d745c82017-06-09 21:56:08 +00001143 time.sleep(10)
1144 finally:
1145 self.voltha.disable_device(device_id, delete = True)
1146 df.callback(0)
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00001147 reactor.callLater(0, tls_flow_check_deactivating_app, df)
Thangavelu K S0d745c82017-06-09 21:56:08 +00001148 return df
1149
1150 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S008f38e2017-05-15 19:36:55 +00001151 def test_subscriber_with_voltha_for_eap_tls_authentication_restarting_radius_server(self):
1152 """
1153 Test Method:
1154 0. Make sure that voltha is up and running on CORD-POD setup.
1155 1. OLT and ONU is detected and validated.
1156 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
1157 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1158 4. Validate that eap tls with restart of radius server and packets are being exchanged between subscriber, onos and freeradius.
1159 5. Verify that subscriber authentication is unsuccessful..
1160 """
Thangavelu K S0d745c82017-06-09 21:56:08 +00001161 df = defer.Deferred()
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00001162 def tls_flow_check_restarting_radius(df):
Thangavelu K S0d745c82017-06-09 21:56:08 +00001163 aaa_app = ["org.opencord.aaa"]
1164 log_test.info('Enabling ponsim_olt')
1165 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
1166 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
1167 assert_not_equal(device_id, None)
1168 voltha = VolthaCtrl(self.VOLTHA_HOST,
1169 rest_port = self.VOLTHA_REST_PORT,
1170 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
1171 time.sleep(10)
1172 switch_map = None
1173 olt_configured = False
1174 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
1175 log_test.info('Installing OLT app')
1176 OnosCtrl.install_app(self.olt_app_file)
1177 time.sleep(5)
1178 log_test.info('Adding subscribers through OLT app')
1179 self.config_olt(switch_map)
1180 olt_configured = True
1181 time.sleep(5)
1182
1183 thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT,"restart_radius"))
1184 thread2 = threading.Thread(target = cord_test_radius_restart)
1185 thread1.start()
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00001186 time.sleep(randint(1,2))
1187 log_test.info('Restart radius server during tls auth flow check on voltha')
Thangavelu K S0d745c82017-06-09 21:56:08 +00001188 thread2.start()
1189 time.sleep(10)
1190 thread1.join()
1191 thread2.join()
1192 try:
1193 # assert_equal(status, True)
Thangavelu K S9648eed2017-06-13 20:15:25 +00001194 assert_equal(self.success, True)
Thangavelu K S0d745c82017-06-09 21:56:08 +00001195 time.sleep(10)
1196 finally:
1197 self.voltha.disable_device(device_id, delete = True)
1198 df.callback(0)
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00001199 reactor.callLater(0, tls_flow_check_restarting_radius, df)
Thangavelu K S0d745c82017-06-09 21:56:08 +00001200 return df
Thangavelu K S008f38e2017-05-15 19:36:55 +00001201
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00001202 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S008f38e2017-05-15 19:36:55 +00001203 def test_subscriber_with_voltha_for_eap_tls_authentication_with_disabled_olt(self):
1204 """
1205 Test Method:
1206 0. Make sure that voltha is up and running on CORD-POD setup.
1207 1. OLT and ONU is detected and validated.
1208 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
1209 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1210 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius.
1211 6. Verify that subscriber authenticated successfully.
1212 7. Disable olt which is seen in voltha and issue tls auth packets from subscriber.
1213 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius.
1214 9. Verify that subscriber authentication is unsuccessful..
1215 """
Thangavelu K S0d745c82017-06-09 21:56:08 +00001216 df = defer.Deferred()
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00001217 def tls_flow_check_operating_olt_state(df):
Thangavelu K S0d745c82017-06-09 21:56:08 +00001218 aaa_app = ["org.opencord.aaa"]
1219 log_test.info('Enabling ponsim_olt')
1220 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
1221 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
1222 assert_not_equal(device_id, None)
1223 voltha = VolthaCtrl(self.VOLTHA_HOST,
1224 rest_port = self.VOLTHA_REST_PORT,
1225 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
1226 time.sleep(10)
1227 switch_map = None
1228 olt_configured = False
1229 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
1230 log_test.info('Installing OLT app')
1231 OnosCtrl.install_app(self.olt_app_file)
1232 time.sleep(5)
1233 log_test.info('Adding subscribers through OLT app')
1234 self.config_olt(switch_map)
1235 olt_configured = True
1236 time.sleep(5)
Thangavelu K S008f38e2017-05-15 19:36:55 +00001237
Thangavelu K S0d745c82017-06-09 21:56:08 +00001238 thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT, "disable_olt_device",))
Thangavelu K Se6c77c72017-06-23 21:28:48 +00001239 thread2 = threading.Thread(target = self.voltha.disable_device, args = (device_id, False,))
Thangavelu K S0d745c82017-06-09 21:56:08 +00001240 thread1.start()
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00001241 time.sleep(randint(1,2))
1242 log_test.info('Disable the ponsim olt device during tls auth flow check on voltha')
Thangavelu K S0d745c82017-06-09 21:56:08 +00001243 thread2.start()
1244 time.sleep(10)
1245 thread1.join()
1246 thread2.join()
1247 try:
1248 # assert_equal(status, True)
Thangavelu K S9648eed2017-06-13 20:15:25 +00001249 assert_equal(self.success, True)
Thangavelu K S0d745c82017-06-09 21:56:08 +00001250 time.sleep(10)
1251 finally:
1252 self.voltha.disable_device(device_id, delete = True)
1253 df.callback(0)
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00001254 reactor.callLater(0, tls_flow_check_operating_olt_state, df)
Thangavelu K S0d745c82017-06-09 21:56:08 +00001255 return df
1256
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00001257 @deferred(TESTCASE_TIMEOUT)
1258 def test_subscriber_with_voltha_for_eap_tls_authentication_disabling_uni_port(self):
Thangavelu K S008f38e2017-05-15 19:36:55 +00001259 """
1260 Test Method:
1261 0. Make sure that voltha is up and running on CORD-POD setup.
1262 1. OLT and ONU is detected and validated.
1263 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
1264 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1265 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius.
1266 6. Verify that subscriber authenticated successfully.
1267 7. Disable uni port which is seen in voltha and issue tls auth packets from subscriber.
1268 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius.
1269 9. Verify that subscriber authentication is unsuccessful..
1270 """
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00001271 df = defer.Deferred()
1272 def tls_flow_check_operating_olt_state(df):
1273 aaa_app = ["org.opencord.aaa"]
1274 log_test.info('Enabling ponsim_olt')
1275 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
1276 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
1277 assert_not_equal(device_id, None)
1278 voltha = VolthaCtrl(self.VOLTHA_HOST,
1279 rest_port = self.VOLTHA_REST_PORT,
1280 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
1281 time.sleep(10)
1282 switch_map = None
1283 olt_configured = False
1284 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
1285 log_test.info('Installing OLT app')
1286 OnosCtrl.install_app(self.olt_app_file)
1287 time.sleep(5)
1288 log_test.info('Adding subscribers through OLT app')
1289 self.config_olt(switch_map)
1290 olt_configured = True
1291 time.sleep(5)
Thangavelu K S008f38e2017-05-15 19:36:55 +00001292
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00001293 thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT, "uni_port_admin_down",))
1294 thread2 = threading.Thread(target = self.voltha_uni_port_toggle)
1295 thread1.start()
1296 time.sleep(randint(1,2))
1297 log_test.info('Admin state of uni port is down and up after delay of 30 sec during tls auth flow check on voltha')
1298 thread2.start()
1299 time.sleep(10)
1300 thread1.join()
1301 thread2.join()
1302 try:
1303 # assert_equal(status, True)
Thangavelu K S9648eed2017-06-13 20:15:25 +00001304 assert_equal(self.success, True)
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00001305 time.sleep(10)
1306 finally:
1307 self.voltha.disable_device(device_id, delete = True)
1308 df.callback(0)
1309 reactor.callLater(0, tls_flow_check_operating_olt_state, df)
1310 return df
1311
1312 @deferred(TESTCASE_TIMEOUT)
Thangavelu K Se6c77c72017-06-23 21:28:48 +00001313 def test_subscriber_with_voltha_for_eap_tls_authentication_carrying_out_multiple_times_toggling_of_uni_port(self):
1314 """
1315 Test Method:
1316 0. Make sure that voltha is up and running on CORD-POD setup.
1317 1. OLT and ONU is detected and validated.
1318 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
1319 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1320 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius.
1321 6. Verify that subscriber authenticated successfully.
1322 7. Disable uni port which is seen in voltha and issue tls auth packets from subscriber.
1323 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius.
1324 9. Verify that subscriber authentication is unsuccessful..
1325 10. Repeat steps from 3 to 9 for 10 times and finally verify tls flow
1326
1327 """
1328 df = defer.Deferred()
1329 no_iterations = 10
1330 def tls_flow_check_with_disable_olt_device_scenario(df):
1331 aaa_app = ["org.opencord.aaa"]
1332 log_test.info('Enabling ponsim_olt')
1333 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
1334 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
1335 assert_not_equal(device_id, None)
1336 voltha = VolthaCtrl(self.VOLTHA_HOST,
1337 rest_port = self.VOLTHA_REST_PORT,
1338 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
1339 time.sleep(10)
1340 switch_map = None
1341 olt_configured = False
1342 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
1343 log_test.info('Installing OLT app')
1344 OnosCtrl.install_app(self.olt_app_file)
1345 time.sleep(5)
1346 log_test.info('Adding subscribers through OLT app')
1347 self.config_olt(switch_map)
1348 olt_configured = True
1349 time.sleep(5)
1350 for i in range(no_iterations):
1351 thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT, "uni_port_admin_down",))
1352 thread2 = threading.Thread(target = self.voltha_uni_port_down_up)
1353 thread1.start()
1354 time.sleep(randint(1,2))
1355 log_test.info('Admin state of uni port is down and up after delay of 30 sec during tls auth flow check on voltha')
1356 thread2.start()
1357 time.sleep(10)
1358 thread1.join()
1359 thread2.join()
1360 auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT)
1361 try:
1362 # assert_equal(status, True)
1363 assert_equal(auth_status, True)
1364 assert_equal(self.success, True)
1365 time.sleep(10)
1366 finally:
1367 self.voltha.disable_device(device_id, delete = True)
1368 df.callback(0)
1369 reactor.callLater(0, tls_flow_check_with_disable_olt_device_scenario, df)
1370 return df
1371
1372 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S008f38e2017-05-15 19:36:55 +00001373 def test_subscriber_with_voltha_for_eap_tls_authentication_restarting_olt(self):
1374 """
1375 Test Method:
1376 0. Make sure that voltha is up and running on CORD-POD setup.
1377 1. OLT and ONU is detected and validated.
1378 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
1379 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1380 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius.
1381 6. Verify that subscriber authenticated successfully.
1382 7. Restart olt which is seen in voltha and issue tls auth packets from subscriber.
1383 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius.
1384 9. Verify that subscriber authentication is unsuccessful..
1385 """
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00001386 df = defer.Deferred()
1387 def tls_flow_check_operating_olt_state(df):
1388 aaa_app = ["org.opencord.aaa"]
1389 log_test.info('Enabling ponsim_olt')
1390 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
1391 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
1392 assert_not_equal(device_id, None)
1393 voltha = VolthaCtrl(self.VOLTHA_HOST,
1394 rest_port = self.VOLTHA_REST_PORT,
1395 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
1396 time.sleep(10)
1397 switch_map = None
1398 olt_configured = False
1399 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
1400 log_test.info('Installing OLT app')
1401 OnosCtrl.install_app(self.olt_app_file)
1402 time.sleep(5)
1403 log_test.info('Adding subscribers through OLT app')
1404 self.config_olt(switch_map)
1405 olt_configured = True
1406 time.sleep(5)
Thangavelu K S008f38e2017-05-15 19:36:55 +00001407
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00001408 thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT, "restart_olt_device",))
1409 thread2 = threading.Thread(target = self.voltha.restart_device, args = (device_id,))
1410 thread1.start()
1411 time.sleep(randint(1,2))
1412 log_test.info('Restart the ponsim olt device during tls auth flow check on voltha')
1413 thread2.start()
1414 time.sleep(10)
1415 thread1.join()
1416 thread2.join()
1417 try:
1418 # assert_equal(status, True)
Thangavelu K S9648eed2017-06-13 20:15:25 +00001419 assert_equal(self.success, True)
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00001420 time.sleep(10)
1421 finally:
1422 self.voltha.disable_device(device_id, delete = True)
1423 df.callback(0)
1424 reactor.callLater(0, tls_flow_check_operating_olt_state, df)
1425 return df
1426
1427 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S36edb012017-07-05 18:24:12 +00001428 def test_subscriber_with_voltha_for_eap_tls_authentication_performing_multiple_times_restart_of_olt(self):
Thangavelu K Se6c77c72017-06-23 21:28:48 +00001429 """
1430 Test Method:
1431 0. Make sure that voltha is up and running on CORD-POD setup.
1432 1. OLT and ONU is detected and validated.
1433 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
1434 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1435 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius.
1436 6. Verify that subscriber authenticated successfully.
1437 7. Restart olt which is seen in voltha and issue tls auth packets from subscriber.
1438 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius.
1439 9. Verify that subscriber authentication is unsuccessful..
1440 10. Repeat steps from 3 to 9 for 10 times and finally verify tls flow
1441 """
1442 df = defer.Deferred()
1443 no_iterations = 10
1444 def tls_flow_check_with_disable_olt_device_scenario(df):
1445 aaa_app = ["org.opencord.aaa"]
1446 log_test.info('Enabling ponsim_olt')
1447 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
1448 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
1449 assert_not_equal(device_id, None)
1450 voltha = VolthaCtrl(self.VOLTHA_HOST,
1451 rest_port = self.VOLTHA_REST_PORT,
1452 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
1453 time.sleep(10)
1454 switch_map = None
1455 olt_configured = False
1456 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
1457 log_test.info('Installing OLT app')
1458 OnosCtrl.install_app(self.olt_app_file)
1459 time.sleep(5)
1460 log_test.info('Adding subscribers through OLT app')
1461 self.config_olt(switch_map)
1462 olt_configured = True
1463 time.sleep(5)
1464 for i in range(no_iterations):
1465 thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT, "restart_olt_device",))
1466 thread2 = threading.Thread(target = self.voltha.restart_device, args = (device_id,))
1467 thread1.start()
1468 time.sleep(randint(1,2))
1469 log_test.info('Restart the ponsim olt device during tls auth flow check on voltha')
1470 thread2.start()
1471 time.sleep(10)
1472 thread1.join()
1473 thread2.join()
1474 auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT)
1475 try:
1476 # assert_equal(status, True)
1477 assert_equal(auth_status, True)
1478 assert_equal(self.success, True)
1479 time.sleep(10)
1480 finally:
1481 self.voltha.disable_device(device_id, delete = True)
1482 df.callback(0)
1483 reactor.callLater(0, tls_flow_check_with_disable_olt_device_scenario, df)
1484 return df
1485
1486
1487 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S008f38e2017-05-15 19:36:55 +00001488 def test_subscriber_with_voltha_for_eap_tls_authentication_restarting_onu(self):
1489 """
1490 Test Method:
1491 0. Make sure that voltha is up and running on CORD-POD setup.
1492 1. OLT and ONU is detected and validated.
1493 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
1494 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1495 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius.
1496 6. Verify that subscriber authenticated successfully.
1497 7. Restart onu which is seen in voltha and issue tls auth packets from subscriber.
1498 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius.
1499 9. Verify that subscriber authentication is unsuccessful..
1500 """
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00001501 df = defer.Deferred()
1502 def tls_flow_check_operating_olt_state(df):
1503 aaa_app = ["org.opencord.aaa"]
1504 log_test.info('Enabling ponsim_olt')
1505 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
1506 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
1507 devices_list = self.voltha.get_devices()
Thangavelu K S9648eed2017-06-13 20:15:25 +00001508 log_test.info('All available devices on voltha = %s'%devices_list['items'])
1509
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00001510 onu_device_id = devices_list['items'][1]['id']
1511 assert_not_equal(device_id, None)
1512 voltha = VolthaCtrl(self.VOLTHA_HOST,
1513 rest_port = self.VOLTHA_REST_PORT,
1514 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
1515 time.sleep(10)
1516 switch_map = None
1517 olt_configured = False
1518 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
1519 log_test.info('Installing OLT app')
1520 OnosCtrl.install_app(self.olt_app_file)
1521 time.sleep(5)
1522 log_test.info('Adding subscribers through OLT app')
1523 self.config_olt(switch_map)
1524 olt_configured = True
1525 time.sleep(5)
1526 devices_list = self.voltha.get_devices()
1527 thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT, "restart_onu_device",))
1528 thread2 = threading.Thread(target = self.voltha.restart_device, args = (onu_device_id,))
1529 thread1.start()
1530 time.sleep(randint(1,2))
1531 log_test.info('Restart the ponsim oon device during tls auth flow check on voltha')
1532 thread2.start()
1533 time.sleep(10)
1534 thread1.join()
1535 thread2.join()
1536 try:
1537 # assert_equal(status, True)
Thangavelu K S9648eed2017-06-13 20:15:25 +00001538 assert_equal(self.success, True)
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00001539 time.sleep(10)
1540 finally:
1541 self.voltha.disable_device(device_id, delete = True)
1542 df.callback(0)
Thangavelu K Se6c77c72017-06-23 21:28:48 +00001543 reactor.callLater(0, tls_flow_check_with_disable_olt_device_scenario, df)
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00001544 return df
Thangavelu K S008f38e2017-05-15 19:36:55 +00001545
Thangavelu K S9648eed2017-06-13 20:15:25 +00001546 @deferred(TESTCASE_TIMEOUT)
Thangavelu K Se6c77c72017-06-23 21:28:48 +00001547 def test_subscriber_with_voltha_for_eap_tls_authentication_performing_multiple_times_restart_of_onu(self):
1548 """
1549 Test Method:
1550 0. Make sure that voltha is up and running on CORD-POD setup.
1551 1. OLT and ONU is detected and validated.
1552 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
1553 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1554 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius.
1555 6. Verify that subscriber authenticated successfully.
1556 7. Restart onu which is seen in voltha and issue tls auth packets from subscriber.
1557 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius.
1558 9. Verify that subscriber authentication is unsuccessful..
1559 10. Repeat steps from 3 to 9 for 10 times and finally verify tls flow
1560 """
1561 df = defer.Deferred()
1562 no_iterations = 10
1563 def tls_flow_check_operating_olt_state(df):
1564 aaa_app = ["org.opencord.aaa"]
1565 log_test.info('Enabling ponsim_olt')
1566 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
1567 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
1568 devices_list = self.voltha.get_devices()
1569 log_test.info('All available devices on voltha = %s'%devices_list['items'])
1570
1571 onu_device_id = devices_list['items'][1]['id']
1572 assert_not_equal(device_id, None)
1573 voltha = VolthaCtrl(self.VOLTHA_HOST,
1574 rest_port = self.VOLTHA_REST_PORT,
1575 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
1576 time.sleep(10)
1577 switch_map = None
1578 olt_configured = False
1579 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
1580 log_test.info('Installing OLT app')
1581 OnosCtrl.install_app(self.olt_app_file)
1582 time.sleep(5)
1583 log_test.info('Adding subscribers through OLT app')
1584 self.config_olt(switch_map)
1585 olt_configured = True
1586 time.sleep(5)
1587 devices_list = self.voltha.get_devices()
1588 for i in range(no_iterations):
1589 thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT, "restart_onu_device",))
1590 thread2 = threading.Thread(target = self.voltha.restart_device, args = (onu_device_id,))
1591 thread1.start()
1592 time.sleep(randint(1,2))
1593 log_test.info('Restart the ponsim oon device during tls auth flow check on voltha')
1594 thread2.start()
1595 time.sleep(10)
1596 thread1.join()
1597 thread2.join()
1598 auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT)
1599 try:
1600 # assert_equal(status, True)
1601 assert_equal(auth_status, True)
1602 assert_equal(self.success, True)
1603 time.sleep(10)
1604 finally:
1605 self.voltha.disable_device(device_id, delete = True)
1606 df.callback(0)
1607 reactor.callLater(0, tls_flow_check_operating_olt_state, df)
1608 return df
1609
1610
1611 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S36edb012017-07-05 18:24:12 +00001612 def test_two_subscribers_with_voltha_for_eap_tls_authentication(self):
Thangavelu K S008f38e2017-05-15 19:36:55 +00001613 """
1614 Test Method:
1615 0. Make sure that voltha is up and running on CORD-POD setup.
1616 1. OLT is detected and ONU ports(nni and 2 uni's) are being seen.
1617 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
1618 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1619 4. Validate that eap tls valid auth packets are being exchanged between two subscriber, onos and freeradius.
1620 5. Verify that two subscribers are authenticated successfully.
1621 """
1622
Thangavelu K S9648eed2017-06-13 20:15:25 +00001623 df = defer.Deferred()
Thangavelu K Se6c77c72017-06-23 21:28:48 +00001624 def tls_flow_check_on_two_subscribers_same_olt_device(df):
Thangavelu K S9648eed2017-06-13 20:15:25 +00001625 aaa_app = ["org.opencord.aaa"]
1626 log_test.info('Enabling ponsim_olt')
1627 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
1628 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
1629 devices_list = self.voltha.get_devices()
1630 log_test.info('All available devices on voltha = %s'%devices_list['items'])
1631
1632 onu_device_id = devices_list['items'][1]['id']
1633 assert_not_equal(device_id, None)
1634 voltha = VolthaCtrl(self.VOLTHA_HOST,
1635 rest_port = self.VOLTHA_REST_PORT,
1636 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
1637 time.sleep(10)
1638 switch_map = None
1639 olt_configured = False
1640 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
1641 log_test.info('Installing OLT app')
1642 OnosCtrl.install_app(self.olt_app_file)
1643 time.sleep(5)
1644 log_test.info('Adding subscribers through OLT app')
1645 self.config_olt(switch_map)
1646 olt_configured = True
1647 time.sleep(5)
1648 devices_list = self.voltha.get_devices()
1649 thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT,))
1650 thread2 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_2_RX_DEFAULT,))
1651 thread1.start()
1652 time.sleep(randint(1,2))
1653 log_test.info('Initiating tls auth packets from one more subscriber on same olt device which is deteced on voltha')
1654 thread2.start()
1655 time.sleep(10)
1656 thread1.join()
1657 thread2.join()
1658 try:
1659 # assert_equal(status, True)
1660 assert_equal(self.success, True)
1661 time.sleep(10)
1662 finally:
1663 self.voltha.disable_device(device_id, delete = True)
1664 df.callback(0)
Thangavelu K Se6c77c72017-06-23 21:28:48 +00001665 reactor.callLater(0, tls_flow_check_on_two_subscribers_same_olt_device, df)
Thangavelu K S9648eed2017-06-13 20:15:25 +00001666 return df
1667
Thangavelu K Se6c77c72017-06-23 21:28:48 +00001668
Thangavelu K S9648eed2017-06-13 20:15:25 +00001669 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S36edb012017-07-05 18:24:12 +00001670 def test_two_subscribers_with_voltha_for_eap_tls_authentication_using_same_certificates(self):
Thangavelu K S008f38e2017-05-15 19:36:55 +00001671 """
1672 Test Method:
1673 0. Make sure that voltha is up and running on CORD-POD setup.
1674 1. OLT is detected and ONU ports(nni and 2 uni's) are being seen.
1675 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
1676 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1677 4. Validate that two valid certificates are being exchanged between two subscriber, onos and freeradius.
1678 5. Verify that two subscribers are not authenticated.
1679 """
1680
Thangavelu K S9648eed2017-06-13 20:15:25 +00001681 df = defer.Deferred()
Thangavelu K Se6c77c72017-06-23 21:28:48 +00001682 def tls_flow_check_on_two_subscribers_same_olt_device(df):
Thangavelu K S9648eed2017-06-13 20:15:25 +00001683 aaa_app = ["org.opencord.aaa"]
1684 log_test.info('Enabling ponsim_olt')
1685 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
1686 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
1687 devices_list = self.voltha.get_devices()
1688 log_test.info('All available devices on voltha = %s'%devices_list['items'])
1689
1690 onu_device_id = devices_list['items'][1]['id']
1691 assert_not_equal(device_id, None)
1692 voltha = VolthaCtrl(self.VOLTHA_HOST,
1693 rest_port = self.VOLTHA_REST_PORT,
1694 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
1695 time.sleep(10)
1696 switch_map = None
1697 olt_configured = False
1698 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
1699 log_test.info('Installing OLT app')
1700 OnosCtrl.install_app(self.olt_app_file)
1701 time.sleep(5)
1702 log_test.info('Adding subscribers through OLT app')
1703 self.config_olt(switch_map)
1704 olt_configured = True
1705 time.sleep(5)
1706 devices_list = self.voltha.get_devices()
1707 thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT,))
1708 thread2 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_2_RX_DEFAULT, "same_cert",))
1709 thread1.start()
1710 time.sleep(randint(1,2))
1711 log_test.info('Initiating tls auth packets from one more subscriber on same olt device which is deteced on voltha')
1712 thread2.start()
1713 time.sleep(10)
1714 thread1.join()
1715 thread2.join()
1716 try:
1717 # assert_equal(status, True)
1718 assert_equal(self.success, True)
1719 time.sleep(10)
1720 finally:
1721 self.voltha.disable_device(device_id, delete = True)
1722 df.callback(0)
Thangavelu K Se6c77c72017-06-23 21:28:48 +00001723 reactor.callLater(0, tls_flow_check_on_two_subscribers_same_olt_device, df)
Thangavelu K S9648eed2017-06-13 20:15:25 +00001724 return df
1725
Chetan Gaonkerfe1048f2017-06-13 20:16:25 +00001726 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S36edb012017-07-05 18:24:12 +00001727 def test_two_subscribers_with_voltha_for_eap_tls_authentication_initiating_invalid_tls_packets_for_one_subscriber(self):
Thangavelu K S008f38e2017-05-15 19:36:55 +00001728 """
1729 Test Method:
1730 0. Make sure that voltha is up and running on CORD-POD setup.
1731 1. OLT is detected and ONU ports(nni and 2 uni's) are being seen.
1732 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
1733 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1734 4. Validate that eap tls valid auth packets are being exchanged between valid subscriber, onos and freeradius.
1735 5. Validate that eap tls valid auth packets are being exchanged between invalid client, onos and freeradius.
1736 6. Verify that valid subscriber authenticated successfully.
1737 7. Verify that invalid subscriber are not authenticated successfully.
1738 """
1739
Chetan Gaonkerfe1048f2017-06-13 20:16:25 +00001740 df = defer.Deferred()
Thangavelu K Se6c77c72017-06-23 21:28:48 +00001741 def tls_flow_check_on_two_subscribers_same_olt_device(df):
Chetan Gaonkerfe1048f2017-06-13 20:16:25 +00001742 aaa_app = ["org.opencord.aaa"]
1743 log_test.info('Enabling ponsim_olt')
1744 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
1745 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
1746 devices_list = self.voltha.get_devices()
1747 log_test.info('All available devices on voltha = %s'%devices_list['items'])
1748
1749 onu_device_id = devices_list['items'][1]['id']
1750 assert_not_equal(device_id, None)
1751 voltha = VolthaCtrl(self.VOLTHA_HOST,
1752 rest_port = self.VOLTHA_REST_PORT,
1753 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
1754 time.sleep(10)
1755 switch_map = None
1756 olt_configured = False
1757 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
1758 log_test.info('Installing OLT app')
1759 OnosCtrl.install_app(self.olt_app_file)
1760 time.sleep(5)
1761 log_test.info('Adding subscribers through OLT app')
1762 self.config_olt(switch_map)
1763 olt_configured = True
1764 time.sleep(5)
1765 devices_list = self.voltha.get_devices()
1766 thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT,))
1767 thread2 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_2_RX_DEFAULT, "no_cert",))
1768 thread1.start()
1769 time.sleep(randint(1,2))
1770 log_test.info('Initiating tls auth packets from one more subscriber on same olt device which is deteced on voltha')
1771 thread2.start()
1772 time.sleep(10)
1773 thread1.join()
1774 thread2.join()
1775 try:
1776 # assert_equal(status, True)
1777 assert_equal(self.success, True)
1778 time.sleep(10)
1779 finally:
1780 self.voltha.disable_device(device_id, delete = True)
1781 df.callback(0)
Thangavelu K Se6c77c72017-06-23 21:28:48 +00001782 reactor.callLater(0, tls_flow_check_on_two_subscribers_same_olt_device, df)
Chetan Gaonkerfe1048f2017-06-13 20:16:25 +00001783 return df
1784
1785 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S36edb012017-07-05 18:24:12 +00001786 def test_two_subscribers_with_voltha_for_eap_tls_authentication_initiating_invalid_cert_for_one_subscriber(self):
Thangavelu K S008f38e2017-05-15 19:36:55 +00001787 """
1788 Test Method:
1789 0. Make sure that voltha is up and running on CORD-POD setup.
1790 1. OLT is detected and ONU ports(nni and 2 uni's) are being seen.
1791 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
1792 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1793 4. Validate that eap tls valid auth packets are being exchanged between valid subscriber, onos and freeradius.
1794 5. Validate that eap tls invalid cert auth packets are being exchanged between invalid subscriber, onos and freeradius.
1795 6. Verify that valid subscriber authenticated successfully.
1796 7. Verify that invalid subscriber are not authenticated successfully.
1797 """
1798
Chetan Gaonkerfe1048f2017-06-13 20:16:25 +00001799 df = defer.Deferred()
Thangavelu K Se6c77c72017-06-23 21:28:48 +00001800 def tls_flow_check_on_two_subscribers_same_olt_device(df):
Chetan Gaonkerfe1048f2017-06-13 20:16:25 +00001801 aaa_app = ["org.opencord.aaa"]
1802 log_test.info('Enabling ponsim_olt')
1803 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
1804 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
1805 devices_list = self.voltha.get_devices()
1806 log_test.info('All available devices on voltha = %s'%devices_list['items'])
1807
1808 onu_device_id = devices_list['items'][1]['id']
1809 assert_not_equal(device_id, None)
1810 voltha = VolthaCtrl(self.VOLTHA_HOST,
1811 rest_port = self.VOLTHA_REST_PORT,
1812 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
1813 time.sleep(10)
1814 switch_map = None
1815 olt_configured = False
1816 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
1817 log_test.info('Installing OLT app')
1818 OnosCtrl.install_app(self.olt_app_file)
1819 time.sleep(5)
1820 log_test.info('Adding subscribers through OLT app')
1821 self.config_olt(switch_map)
1822 olt_configured = True
1823 time.sleep(5)
1824 devices_list = self.voltha.get_devices()
1825 thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT,))
1826 thread2 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_2_RX_DEFAULT, "invalid_cert",))
1827 thread1.start()
1828 time.sleep(randint(1,2))
1829 log_test.info('Initiating tls auth packets from one more subscriber on same olt device which is deteced on voltha')
1830 thread2.start()
1831 time.sleep(10)
1832 thread1.join()
1833 thread2.join()
1834 try:
1835 # assert_equal(status, True)
1836 assert_equal(self.success, True)
1837 time.sleep(10)
1838 finally:
1839 self.voltha.disable_device(device_id, delete = True)
1840 df.callback(0)
Thangavelu K Se6c77c72017-06-23 21:28:48 +00001841 reactor.callLater(0, tls_flow_check_on_two_subscribers_same_olt_device, df)
Chetan Gaonkerfe1048f2017-06-13 20:16:25 +00001842 return df
1843
1844 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S36edb012017-07-05 18:24:12 +00001845 def test_two_subscribers_with_voltha_for_eap_tls_authentication_with_one_uni_port_disabled(self):
Thangavelu K S008f38e2017-05-15 19:36:55 +00001846 """
1847 Test Method:
1848 0. Make sure that voltha is up and running on CORD-POD setup.
1849 1. OLT and ONU is detected and validated.
1850 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
1851 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1852 5. Validate that eap tls packets are being exchanged between two subscriber, onos and freeradius.
1853 6. Verify that subscriber authenticated successfully.
1854 7. Disable one of the uni port which is seen in voltha and issue tls auth packets from subscriber.
1855 8. Validate that eap tls packets are not being exchanged between one subscriber, onos and freeradius.
1856 9. Verify that subscriber authentication is unsuccessful..
1857 10. Verify that other subscriber authenticated successfully.
1858 """
1859
Chetan Gaonkerfe1048f2017-06-13 20:16:25 +00001860 df = defer.Deferred()
Thangavelu K Se6c77c72017-06-23 21:28:48 +00001861 def tls_flow_check_on_two_subscribers_same_olt_device(df):
Chetan Gaonkerfe1048f2017-06-13 20:16:25 +00001862 aaa_app = ["org.opencord.aaa"]
1863 log_test.info('Enabling ponsim_olt')
1864 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
1865 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
1866 devices_list = self.voltha.get_devices()
1867 log_test.info('All available devices on voltha = %s'%devices_list['items'])
1868
1869 onu_device_id = devices_list['items'][1]['id']
1870 assert_not_equal(device_id, None)
1871 voltha = VolthaCtrl(self.VOLTHA_HOST,
1872 rest_port = self.VOLTHA_REST_PORT,
1873 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
1874 time.sleep(10)
1875 switch_map = None
1876 olt_configured = False
1877 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
1878 log_test.info('Installing OLT app')
1879 OnosCtrl.install_app(self.olt_app_file)
1880 time.sleep(5)
1881 log_test.info('Adding subscribers through OLT app')
1882 self.config_olt(switch_map)
1883 olt_configured = True
1884 time.sleep(5)
1885 devices_list = self.voltha.get_devices()
1886 thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT,))
1887 thread2 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_2_RX_DEFAULT, "uni_port_admin_down",))
1888 thread1.start()
1889 time.sleep(randint(1,2))
1890 log_test.info('Initiating tls auth packets from one more subscriber on same olt device which is deteced on voltha')
1891 thread2.start()
1892 time.sleep(10)
1893 thread1.join()
1894 thread2.join()
1895 try:
1896 # assert_equal(status, True)
1897 assert_equal(self.success, True)
1898 time.sleep(10)
1899 finally:
1900 self.voltha.disable_device(device_id, delete = True)
1901 df.callback(0)
Thangavelu K Se6c77c72017-06-23 21:28:48 +00001902 reactor.callLater(0, tls_flow_check_on_two_subscribers_same_olt_device, df)
Chetan Gaonkerfe1048f2017-06-13 20:16:25 +00001903 return df
1904
Thangavelu K S36edb012017-07-05 18:24:12 +00001905 def test_3_subscribers_with_voltha_for_eap_tls_authentication(self):
1906 """
1907 Test Method:
1908 0. Make sure that voltha is up and running on CORD-POD setup.
1909 1. OLT and ONU is detected and validated.
1910 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
1911 3. Issue auth request packets from CORD TESTER voltha test module acting as multipe subscribers (3 subscribers)
1912 4. Validate that eap tls valid auth packets are being exchanged between subscriber, onos and freeradius.
1913 5. Verify that subscriber is authenticated successfully.
1914 """
1915 """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each"""
1916 num_subscribers = 3
1917 num_channels = 1
1918 services = ('TLS')
1919 cbs = (self.tls_flow_check, None, None)
1920 self.voltha_subscribers(services, cbs = cbs,
1921 num_subscribers = num_subscribers,
1922 num_channels = num_channels)
1923
1924 def test_5_subscribers_with_voltha_for_eap_tls_authentication(self):
1925 """
1926 Test Method:
1927 0. Make sure that voltha is up and running on CORD-POD setup.
1928 1. OLT and ONU is detected and validated.
1929 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
1930 3. Issue auth request packets from CORD TESTER voltha test module acting as multipe subscribers (5 subscriber)
1931 4. Validate that eap tls valid auth packets are being exchanged between subscriber, onos and freeradius.
1932 5. Verify that subscriber is authenticated successfully.
1933 """
1934 """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each"""
1935 num_subscribers = 5
1936 num_channels = 1
1937 services = ('TLS')
1938 cbs = (self.tls_flow_check, None, None)
1939 self.voltha_subscribers(services, cbs = cbs,
1940 num_subscribers = num_subscribers,
1941 num_channels = num_channels)
1942
1943 def test_9_subscribers_with_voltha_for_eap_tls_authentication(self):
1944 """
1945 Test Method:
1946 0. Make sure that voltha is up and running on CORD-POD setup.
1947 1. OLT and ONU is detected and validated.
1948 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
1949 3. Issue auth request packets from CORD TESTER voltha test module acting as multipe subscribers (9 subscriber)
1950 4. Validate that eap tls valid auth packets are being exchanged between subscriber, onos and freeradius.
1951 5. Verify that subscriber is authenticated successfully.
1952 """
1953 """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each"""
1954 num_subscribers = 9
1955 num_channels = 1
1956 services = ('TLS')
1957 cbs = (self.tls_flow_check, None, None)
1958 self.voltha_subscribers(services, cbs = cbs,
1959 num_subscribers = num_subscribers,
1960 num_channels = num_channels)
1961
1962
Chetan Gaonkerfe1048f2017-06-13 20:16:25 +00001963 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S008f38e2017-05-15 19:36:55 +00001964 def test_subscriber_with_voltha_for_dhcp_request(self):
1965 """
1966 Test Method:
1967 0. Make sure that voltha is up and running on CORD-POD setup.
1968 1. OLT and ONU is detected and validated.
1969 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1970 3. Send dhcp request from residential subscrber to dhcp server which is running as onos app.
1971 4. Verify that subscriber get ip from dhcp server successfully.
1972 """
1973
Thangavelu K Sa1c71b42017-06-14 18:13:21 +00001974 df = defer.Deferred()
1975 def dhcp_flow_check_scenario(df):
1976 log_test.info('Enabling ponsim_olt')
1977 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
1978 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
1979 assert_not_equal(device_id, None)
1980 voltha = VolthaCtrl(self.VOLTHA_HOST,
1981 rest_port = self.VOLTHA_REST_PORT,
1982 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
1983 time.sleep(10)
1984 switch_map = None
1985 olt_configured = False
1986 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
1987 log_test.info('Installing OLT app')
1988 OnosCtrl.install_app(self.olt_app_file)
1989 time.sleep(5)
1990 log_test.info('Adding subscribers through OLT app')
1991 self.config_olt(switch_map)
1992 olt_configured = True
1993 time.sleep(5)
1994 dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT)
1995 try:
1996 assert_equal(dhcp_status, True)
1997 #assert_equal(status, True)
1998 time.sleep(10)
1999 finally:
2000 self.remove_olt(switch_map)
2001 self.voltha.disable_device(device_id, delete = True)
2002 df.callback(0)
2003
2004 reactor.callLater(0, dhcp_flow_check_scenario, df)
2005 return df
2006
2007 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S008f38e2017-05-15 19:36:55 +00002008 def test_subscriber_with_voltha_for_dhcp_request_with_invalid_broadcast_source_mac(self):
2009 """
2010 Test Method:
2011 0. Make sure that voltha is up and running on CORD-POD setup.
2012 1. OLT and ONU is detected and validated.
2013 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
2014 3. Send dhcp request with invalid source mac broadcast from residential subscrber to dhcp server which is running as onos app.
2015 4. Verify that subscriber should not get ip from dhcp server.
2016 """
2017
Thangavelu K Sa1c71b42017-06-14 18:13:21 +00002018 df = defer.Deferred()
2019 def dhcp_flow_check_scenario(df):
2020 log_test.info('Enabling ponsim_olt')
2021 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
2022 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
2023 assert_not_equal(device_id, None)
2024 voltha = VolthaCtrl(self.VOLTHA_HOST,
2025 rest_port = self.VOLTHA_REST_PORT,
2026 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
2027 time.sleep(10)
2028 switch_map = None
2029 olt_configured = False
2030 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
2031 log_test.info('Installing OLT app')
2032 OnosCtrl.install_app(self.olt_app_file)
2033 time.sleep(5)
2034 log_test.info('Adding subscribers through OLT app')
2035 self.config_olt(switch_map)
2036 olt_configured = True
2037 time.sleep(5)
2038 dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "invalid_src_mac_broadcast")
2039 try:
2040 assert_equal(dhcp_status, True)
Thangavelu K Se6c77c72017-06-23 21:28:48 +00002041 assert_equal(self.success, True)
Thangavelu K Sa1c71b42017-06-14 18:13:21 +00002042 #assert_equal(status, True)
2043 time.sleep(10)
2044 finally:
2045 self.voltha.disable_device(device_id, delete = True)
2046 self.remove_olt(switch_map)
2047 df.callback(0)
2048
2049 reactor.callLater(0, dhcp_flow_check_scenario, df)
2050 return df
2051
2052
2053 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S008f38e2017-05-15 19:36:55 +00002054 def test_subscriber_with_voltha_for_dhcp_request_with_invalid_multicast_source_mac(self):
2055 """
2056 Test Method:
2057 0. Make sure that voltha is up and running on CORD-POD setup.
2058 1. OLT and ONU is detected and validated.
2059 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
2060 3. Send dhcp request with invalid source mac multicast from residential subscrber to dhcp server which is running as onos app.
2061 4. Verify that subscriber should not get ip from dhcp server.
2062 """
2063
Thangavelu K Sa1c71b42017-06-14 18:13:21 +00002064 df = defer.Deferred()
2065 def dhcp_flow_check_scenario(df):
2066 log_test.info('Enabling ponsim_olt')
2067 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
2068 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
2069 assert_not_equal(device_id, None)
2070 voltha = VolthaCtrl(self.VOLTHA_HOST,
2071 rest_port = self.VOLTHA_REST_PORT,
2072 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
2073 time.sleep(10)
2074 switch_map = None
2075 olt_configured = False
2076 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
2077 log_test.info('Installing OLT app')
2078 OnosCtrl.install_app(self.olt_app_file)
2079 time.sleep(5)
2080 log_test.info('Adding subscribers through OLT app')
2081 self.config_olt(switch_map)
2082 olt_configured = True
2083 time.sleep(5)
2084 dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "invalid_src_mac_multicast")
2085 try:
2086 assert_equal(dhcp_status, True)
2087 #assert_equal(status, True)
2088 time.sleep(10)
2089 finally:
2090 self.voltha.disable_device(device_id, delete = True)
2091 self.remove_olt(switch_map)
2092 df.callback(0)
2093
2094 reactor.callLater(0, dhcp_flow_check_scenario, df)
2095 return df
2096
2097 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S008f38e2017-05-15 19:36:55 +00002098 def test_subscriber_with_voltha_for_dhcp_request_with_invalid_source_mac(self):
2099 """
2100 Test Method:
2101 0. Make sure that voltha is up and running on CORD-POD setup.
2102 1. OLT and ONU is detected and validated.
2103 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
2104 3. Send dhcp request with invalid source mac zero from residential subscrber to dhcp server which is running as onos app.
2105 4. Verify that subscriber should not get ip from dhcp server.
2106 """
Thangavelu K Sa1c71b42017-06-14 18:13:21 +00002107 df = defer.Deferred()
2108 def dhcp_flow_check_scenario(df):
2109 log_test.info('Enabling ponsim_olt')
2110 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
2111 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
2112 assert_not_equal(device_id, None)
2113 voltha = VolthaCtrl(self.VOLTHA_HOST,
2114 rest_port = self.VOLTHA_REST_PORT,
2115 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
2116 time.sleep(10)
2117 switch_map = None
2118 olt_configured = False
2119 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
2120 log_test.info('Installing OLT app')
2121 OnosCtrl.install_app(self.olt_app_file)
2122 time.sleep(5)
2123 log_test.info('Adding subscribers through OLT app')
2124 self.config_olt(switch_map)
2125 olt_configured = True
2126 time.sleep(5)
2127 dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "invalid_src_mac_junk")
2128 try:
2129 assert_equal(dhcp_status, True)
2130 #assert_equal(status, True)
2131 time.sleep(10)
2132 finally:
2133 self.voltha.disable_device(device_id, delete = True)
2134 self.remove_olt(switch_map)
2135 df.callback(0)
Thangavelu K S008f38e2017-05-15 19:36:55 +00002136
Thangavelu K Sa1c71b42017-06-14 18:13:21 +00002137 reactor.callLater(0, dhcp_flow_check_scenario, df)
2138 return df
2139
2140 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S008f38e2017-05-15 19:36:55 +00002141 def test_subscriber_with_voltha_for_dhcp_request_and_release(self):
2142 """
2143 Test Method:
2144 0. Make sure that voltha is up and running on CORD-POD setup.
2145 1. OLT and ONU is detected and validated.
2146 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
2147 3. Send dhcp request from residential subscrber to dhcp server which is running as onos app.
2148 4. Verify that subscriber get ip from dhcp server successfully.
2149 5. Send dhcp release from residential subscrber to dhcp server which is running as onos app.
2150 6 Verify that subscriber should not get ip from dhcp server, ping to gateway.
2151 """
Thangavelu K Sa1c71b42017-06-14 18:13:21 +00002152 df = defer.Deferred()
2153 def dhcp_flow_check_scenario(df):
2154 log_test.info('Enabling ponsim_olt')
2155 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
2156 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
2157 assert_not_equal(device_id, None)
2158 voltha = VolthaCtrl(self.VOLTHA_HOST,
2159 rest_port = self.VOLTHA_REST_PORT,
2160 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
2161 time.sleep(10)
2162 switch_map = None
2163 olt_configured = False
2164 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
2165 log_test.info('Installing OLT app')
2166 OnosCtrl.install_app(self.olt_app_file)
2167 time.sleep(5)
2168 log_test.info('Adding subscribers through OLT app')
2169 self.config_olt(switch_map)
2170 olt_configured = True
2171 time.sleep(5)
2172 dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "request_release")
2173 try:
2174 assert_equal(dhcp_status, True)
2175 #assert_equal(status, True)
2176 time.sleep(10)
2177 finally:
2178 self.voltha.disable_device(device_id, delete = True)
2179 self.remove_olt(switch_map)
2180 df.callback(0)
2181
2182 reactor.callLater(0, dhcp_flow_check_scenario, df)
2183 return df
Thangavelu K S008f38e2017-05-15 19:36:55 +00002184
Thangavelu K S735a6662017-06-15 18:08:23 +00002185
2186 @deferred(TESTCASE_TIMEOUT)
A.R Karthick57fa9372017-05-24 12:47:03 -07002187 def test_subscriber_with_voltha_for_dhcp_starvation_positive_scenario(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00002188 """
2189 Test Method:
2190 0. Make sure that voltha is up and running on CORD-POD setup.
2191 1. OLT and ONU is detected and validated.
2192 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
2193 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
2194 4. Verify that subscriber get ip from dhcp server successfully.
2195 5. Repeat step 3 and 4 for 10 times.
2196 6 Verify that subscriber should get ip from dhcp server.
2197 """
Thangavelu K S735a6662017-06-15 18:08:23 +00002198 df = defer.Deferred()
2199 def dhcp_flow_check_scenario(df):
2200 log_test.info('Enabling ponsim_olt')
2201 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
2202 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
2203 assert_not_equal(device_id, None)
2204 voltha = VolthaCtrl(self.VOLTHA_HOST,
2205 rest_port = self.VOLTHA_REST_PORT,
2206 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
2207 time.sleep(10)
2208 switch_map = None
2209 olt_configured = False
2210 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
2211 log_test.info('Installing OLT app')
2212 OnosCtrl.install_app(self.olt_app_file)
2213 time.sleep(5)
2214 log_test.info('Adding subscribers through OLT app')
2215 self.config_olt(switch_map)
2216 olt_configured = True
2217 time.sleep(5)
2218 dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "starvation_positive")
2219 try:
2220 assert_equal(dhcp_status, True)
2221 #assert_equal(status, True)
2222 time.sleep(10)
2223 finally:
2224 self.voltha.disable_device(device_id, delete = True)
2225 self.remove_olt(switch_map)
2226 df.callback(0)
Thangavelu K S057b7d22017-05-16 22:03:22 +00002227
Thangavelu K S735a6662017-06-15 18:08:23 +00002228 reactor.callLater(0, dhcp_flow_check_scenario, df)
2229 return df
2230
2231
2232
2233 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S057b7d22017-05-16 22:03:22 +00002234 def test_subscriber_with_voltha_for_dhcp_starvation_negative_scenario(self):
2235 """
2236 Test Method:
2237 0. Make sure that voltha is up and running on CORD-POD setup.
2238 1. OLT and ONU is detected and validated.
2239 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
2240 3. Send dhcp request from residential subscriber without of pool ip to dhcp server which is running as onos app.
2241 4. Verify that subscriber should not get ip from dhcp server.
2242 5. Repeat steps 3 and 4 for 10 times.
2243 6 Verify that subscriber should not get ip from dhcp server.
2244 """
Thangavelu K S735a6662017-06-15 18:08:23 +00002245 df = defer.Deferred()
2246 def dhcp_flow_check_scenario(df):
2247 log_test.info('Enabling ponsim_olt')
2248 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
2249 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
2250 assert_not_equal(device_id, None)
2251 voltha = VolthaCtrl(self.VOLTHA_HOST,
2252 rest_port = self.VOLTHA_REST_PORT,
2253 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
2254 time.sleep(10)
2255 switch_map = None
2256 olt_configured = False
2257 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
2258 log_test.info('Installing OLT app')
2259 OnosCtrl.install_app(self.olt_app_file)
2260 time.sleep(5)
2261 log_test.info('Adding subscribers through OLT app')
2262 self.config_olt(switch_map)
2263 olt_configured = True
2264 time.sleep(5)
2265 dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "starvation_negative")
2266 try:
2267 assert_equal(dhcp_status, True)
2268 #assert_equal(status, True)
2269 time.sleep(10)
2270 finally:
2271 self.voltha.disable_device(device_id, delete = True)
2272 self.remove_olt(switch_map)
2273 df.callback(0)
2274
2275 reactor.callLater(0, dhcp_flow_check_scenario, df)
2276 return df
2277
2278
2279 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S057b7d22017-05-16 22:03:22 +00002280 def test_subscriber_with_voltha_for_dhcp_sending_multiple_discover(self):
2281 """
2282 Test Method:
2283 0. Make sure that voltha is up and running on CORD-POD setup.
2284 1. OLT and ONU is detected and validated.
2285 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
2286 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
2287 4. Verify that subscriber get ip from dhcp server successfully.
2288 5. Repeat step 3 for 50 times.
2289 6 Verify that subscriber should get same ip which was received from 1st discover from dhcp server.
2290 """
Thangavelu K S735a6662017-06-15 18:08:23 +00002291 df = defer.Deferred()
2292 def dhcp_flow_check_scenario(df):
2293 log_test.info('Enabling ponsim_olt')
2294 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
2295 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
2296 assert_not_equal(device_id, None)
2297 voltha = VolthaCtrl(self.VOLTHA_HOST,
2298 rest_port = self.VOLTHA_REST_PORT,
2299 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
2300 time.sleep(10)
2301 switch_map = None
2302 olt_configured = False
2303 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
2304 log_test.info('Installing OLT app')
2305 OnosCtrl.install_app(self.olt_app_file)
2306 time.sleep(5)
2307 log_test.info('Adding subscribers through OLT app')
2308 self.config_olt(switch_map)
2309 olt_configured = True
2310 time.sleep(5)
2311 dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "multiple_discover")
2312 try:
2313 assert_equal(dhcp_status, True)
2314 #assert_equal(status, True)
2315 time.sleep(10)
2316 finally:
2317 self.voltha.disable_device(device_id, delete = True)
2318 self.remove_olt(switch_map)
2319 df.callback(0)
2320
2321 reactor.callLater(0, dhcp_flow_check_scenario, df)
2322 return df
2323
2324
2325
2326 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S057b7d22017-05-16 22:03:22 +00002327 def test_subscriber_with_voltha_for_dhcp_sending_multiple_request(self):
2328 """
2329 Test Method:
2330 0. Make sure that voltha is up and running on CORD-POD setup.
2331 1. OLT and ONU is detected and validated.
2332 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
2333 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
2334 4. Verify that subscriber get ip from dhcp server successfully.
2335 5. Send DHCP request to dhcp server which is running as onos app.
2336 6. Repeat step 5 for 50 times.
2337 7. Verify that subscriber should get same ip which was received from 1st discover from dhcp server.
2338 """
Thangavelu K S735a6662017-06-15 18:08:23 +00002339 df = defer.Deferred()
2340 def dhcp_flow_check_scenario(df):
2341 log_test.info('Enabling ponsim_olt')
2342 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
2343 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
2344 assert_not_equal(device_id, None)
2345 voltha = VolthaCtrl(self.VOLTHA_HOST,
2346 rest_port = self.VOLTHA_REST_PORT,
2347 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
2348 time.sleep(10)
2349 switch_map = None
2350 olt_configured = False
2351 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
2352 log_test.info('Installing OLT app')
2353 OnosCtrl.install_app(self.olt_app_file)
2354 time.sleep(5)
2355 log_test.info('Adding subscribers through OLT app')
2356 self.config_olt(switch_map)
2357 olt_configured = True
2358 time.sleep(5)
2359 dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "multiple_requests")
2360 try:
2361 assert_equal(dhcp_status, True)
2362 #assert_equal(status, True)
2363 time.sleep(10)
2364 finally:
2365 self.voltha.disable_device(device_id, delete = True)
2366 self.remove_olt(switch_map)
2367 df.callback(0)
Thangavelu K S057b7d22017-05-16 22:03:22 +00002368
Thangavelu K S735a6662017-06-15 18:08:23 +00002369 reactor.callLater(0, dhcp_flow_check_scenario, df)
2370 return df
2371
2372
2373 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S057b7d22017-05-16 22:03:22 +00002374 def test_subscriber_with_voltha_for_dhcp_requesting_desired_ip_address(self):
2375 """
2376 Test Method:
2377 0. Make sure that voltha is up and running on CORD-POD setup.
2378 1. OLT and ONU is detected and validated.
2379 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
2380 3. Send dhcp request with desired ip address from residential subscriber to dhcp server which is running as onos app.
2381 4. Verify that subscriber get ip which was requested in step 3 from dhcp server successfully.
2382 """
Thangavelu K S735a6662017-06-15 18:08:23 +00002383 df = defer.Deferred()
2384 def dhcp_flow_check_scenario(df):
2385 log_test.info('Enabling ponsim_olt')
2386 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
2387 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
2388 assert_not_equal(device_id, None)
2389 voltha = VolthaCtrl(self.VOLTHA_HOST,
2390 rest_port = self.VOLTHA_REST_PORT,
2391 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
2392 time.sleep(10)
2393 switch_map = None
2394 olt_configured = False
2395 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
2396 log_test.info('Installing OLT app')
2397 OnosCtrl.install_app(self.olt_app_file)
2398 time.sleep(5)
2399 log_test.info('Adding subscribers through OLT app')
2400 self.config_olt(switch_map)
2401 olt_configured = True
2402 time.sleep(5)
2403 dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "desired_ip_address")
2404 try:
2405 assert_equal(dhcp_status, True)
2406 #assert_equal(status, True)
2407 time.sleep(10)
2408 finally:
2409 self.voltha.disable_device(device_id, delete = True)
2410 self.remove_olt(switch_map)
2411 df.callback(0)
Thangavelu K S057b7d22017-05-16 22:03:22 +00002412
Thangavelu K S735a6662017-06-15 18:08:23 +00002413 reactor.callLater(0, dhcp_flow_check_scenario, df)
2414 return df
2415
2416 @deferred(TESTCASE_TIMEOUT)
2417 def test_subscriber_with_voltha_for_dhcp_requesting_desired_out_of_pool_ip_address(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00002418 """
2419 Test Method:
2420 0. Make sure that voltha is up and running on CORD-POD setup.
2421 1. OLT and ONU is detected and validated.
2422 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
2423 3. Send dhcp request with desired out of pool ip address from residential subscriber to dhcp server which is running as onos app.
2424 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.
2425 """
Thangavelu K S735a6662017-06-15 18:08:23 +00002426 df = defer.Deferred()
2427 def dhcp_flow_check_scenario(df):
2428 log_test.info('Enabling ponsim_olt')
2429 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
2430 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
2431 assert_not_equal(device_id, None)
2432 voltha = VolthaCtrl(self.VOLTHA_HOST,
2433 rest_port = self.VOLTHA_REST_PORT,
2434 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
2435 time.sleep(10)
2436 switch_map = None
2437 olt_configured = False
2438 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
2439 log_test.info('Installing OLT app')
2440 OnosCtrl.install_app(self.olt_app_file)
2441 time.sleep(5)
2442 log_test.info('Adding subscribers through OLT app')
2443 self.config_olt(switch_map)
2444 olt_configured = True
2445 time.sleep(5)
2446 dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "desired_out_of_pool_ip_address")
2447 try:
2448 assert_equal(dhcp_status, True)
2449 #assert_equal(status, True)
2450 time.sleep(10)
2451 finally:
2452 self.voltha.disable_device(device_id, delete = True)
2453 self.remove_olt(switch_map)
2454 df.callback(0)
2455
2456 reactor.callLater(0, dhcp_flow_check_scenario, df)
2457 return df
2458
2459
2460 @deferred(TESTCASE_TIMEOUT)
2461 def test_subscriber_with_voltha_deactivating_dhcp_app_in_onos(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00002462 """
2463 Test Method:
2464 0. Make sure that voltha is up and running on CORD-POD setup.
2465 1. OLT and ONU is detected and validated.
2466 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
2467 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
2468 4. Verify that subscriber get ip from dhcp server successfully.
2469 5. Deactivate dhcp server app in onos.
2470 6. Repeat step 3.
2471 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway.
2472 """
Thangavelu K S735a6662017-06-15 18:08:23 +00002473 df = defer.Deferred()
2474 dhcp_app = 'org.onosproject.dhcp'
2475 def dhcp_flow_check_scenario(df):
2476 log_test.info('Enabling ponsim_olt')
2477 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
2478 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
2479 assert_not_equal(device_id, None)
2480 voltha = VolthaCtrl(self.VOLTHA_HOST,
2481 rest_port = self.VOLTHA_REST_PORT,
2482 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
2483 time.sleep(10)
2484 switch_map = None
2485 olt_configured = False
2486 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
2487 log_test.info('Installing OLT app')
2488 OnosCtrl.install_app(self.olt_app_file)
2489 time.sleep(5)
2490 log_test.info('Adding subscribers through OLT app')
2491 self.config_olt(switch_map)
2492 olt_configured = True
2493 time.sleep(5)
Thangavelu K Se6c77c72017-06-23 21:28:48 +00002494 thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT, "interrupting_dhcp_flows",))
Thangavelu K S735a6662017-06-15 18:08:23 +00002495 thread2 = threading.Thread(target = self.deactivate_apps, args = (dhcp_app,))
2496 log_test.info('Restart dhcp app in onos during client send discover to voltha')
2497 thread2.start()
Thangavelu K S735a6662017-06-15 18:08:23 +00002498 thread1.start()
2499 time.sleep(10)
2500 thread1.join()
2501 thread2.join()
2502 try:
2503 assert_equal(self.success, True)
2504 #assert_equal(status, True)
2505 time.sleep(10)
2506 finally:
2507 self.voltha.disable_device(device_id, delete = True)
2508 self.remove_olt(switch_map)
2509 df.callback(0)
2510
2511 reactor.callLater(0, dhcp_flow_check_scenario, df)
2512 return df
2513
2514 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S057b7d22017-05-16 22:03:22 +00002515 def test_subscriber_with_voltha_for_dhcp_renew_time(self):
2516 """
2517 Test Method:
2518 0. Make sure that voltha is up and running on CORD-POD setup.
2519 1. OLT and ONU is detected and validated.
2520 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
2521 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
2522 4. Verify that subscriber get ip from dhcp server successfully.
2523 5. Send dhcp renew packet to dhcp server which is running as onos app.
2524 6. Repeat step 4.
2525 """
Thangavelu K Se6c77c72017-06-23 21:28:48 +00002526
Thangavelu K S0f2c5232017-06-19 19:11:43 +00002527 df = defer.Deferred()
2528 def dhcp_flow_check_scenario(df):
2529 log_test.info('Enabling ponsim_olt')
2530 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
2531 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
2532 assert_not_equal(device_id, None)
2533 voltha = VolthaCtrl(self.VOLTHA_HOST,
2534 rest_port = self.VOLTHA_REST_PORT,
2535 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
2536 time.sleep(10)
2537 switch_map = None
2538 olt_configured = False
2539 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
2540 log_test.info('Installing OLT app')
2541 OnosCtrl.install_app(self.olt_app_file)
2542 time.sleep(5)
2543 log_test.info('Adding subscribers through OLT app')
2544 self.config_olt(switch_map)
2545 olt_configured = True
2546 time.sleep(5)
2547 dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "dhcp_renew")
2548 try:
2549 assert_equal(dhcp_status, True)
2550 #assert_equal(status, True)
2551 time.sleep(10)
2552 finally:
2553 self.voltha.disable_device(device_id, delete = True)
2554 self.remove_olt(switch_map)
2555 df.callback(0)
2556
2557 reactor.callLater(0, dhcp_flow_check_scenario, df)
2558 return df
2559
2560 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S057b7d22017-05-16 22:03:22 +00002561 def test_subscriber_with_voltha_for_dhcp_rebind_time(self):
2562 """
2563 Test Method:
2564 0. Make sure that voltha is up and running on CORD-POD setup.
2565 1. OLT and ONU is detected and validated.
2566 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
2567 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
2568 4. Verify that subscriber get ip from dhcp server successfully.
2569 5. Send dhcp rebind packet to dhcp server which is running as onos app.
2570 6. Repeat step 4.
2571 """
Thangavelu K S0f2c5232017-06-19 19:11:43 +00002572 df = defer.Deferred()
2573 def dhcp_flow_check_scenario(df):
2574 log_test.info('Enabling ponsim_olt')
2575 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
2576 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
2577 assert_not_equal(device_id, None)
2578 voltha = VolthaCtrl(self.VOLTHA_HOST,
2579 rest_port = self.VOLTHA_REST_PORT,
2580 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
2581 time.sleep(10)
2582 switch_map = None
2583 olt_configured = False
2584 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
2585 log_test.info('Installing OLT app')
2586 OnosCtrl.install_app(self.olt_app_file)
2587 time.sleep(5)
2588 log_test.info('Adding subscribers through OLT app')
2589 self.config_olt(switch_map)
2590 olt_configured = True
2591 time.sleep(5)
2592 dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "dhcp_rebind")
2593 try:
2594 assert_equal(dhcp_status, True)
2595 #assert_equal(status, True)
2596 time.sleep(10)
2597 finally:
2598 self.voltha.disable_device(device_id, delete = True)
2599 self.remove_olt(switch_map)
2600 df.callback(0)
2601
2602 reactor.callLater(0, dhcp_flow_check_scenario, df)
2603 return df
2604
2605
Thangavelu K S0f2c5232017-06-19 19:11:43 +00002606 @deferred(TESTCASE_TIMEOUT)
Thangavelu K Se6c77c72017-06-23 21:28:48 +00002607 def test_subscriber_with_voltha_for_dhcp_toggling_olt(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00002608 """
2609 Test Method:
2610 0. Make sure that voltha is up and running on CORD-POD setup.
2611 1. OLT and ONU is detected and validated.
2612 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
2613 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
2614 4. Verify that subscriber get ip from dhcp server successfully.
2615 5. Disable olt devices which is being detected in voltha CLI.
2616 6. Repeat step 3.
2617 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway.
2618 """
Thangavelu K S0f2c5232017-06-19 19:11:43 +00002619 df = defer.Deferred()
2620 dhcp_app = 'org.onosproject.dhcp'
2621 def dhcp_flow_check_scenario(df):
2622 log_test.info('Enabling ponsim_olt')
2623 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
2624 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
2625 assert_not_equal(device_id, None)
2626 voltha = VolthaCtrl(self.VOLTHA_HOST,
2627 rest_port = self.VOLTHA_REST_PORT,
2628 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
2629 time.sleep(10)
2630 switch_map = None
2631 olt_configured = False
2632 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
2633 log_test.info('Installing OLT app')
2634 OnosCtrl.install_app(self.olt_app_file)
2635 time.sleep(5)
2636 log_test.info('Adding subscribers through OLT app')
2637 self.config_olt(switch_map)
2638 olt_configured = True
2639 time.sleep(5)
2640 thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT, "interrupting_dhcp_flows",))
2641 thread2 = threading.Thread(target = self.voltha.disable_device, args = (device_id,False,))
2642 log_test.info('Disable the olt device in during client send discover to voltha')
2643 thread2.start()
2644# time.sleep(randint(0,1))
2645 thread1.start()
2646 time.sleep(10)
2647 thread1.join()
2648 thread2.join()
2649 try:
Chetan Gaonkercf37f262017-06-19 19:11:11 +00002650 assert_equal(self.success, True)
Thangavelu K S0f2c5232017-06-19 19:11:43 +00002651 #assert_equal(status, True)
2652 time.sleep(10)
2653 finally:
2654 self.voltha.disable_device(device_id, delete = True)
2655 self.remove_olt(switch_map)
2656 df.callback(0)
2657
2658 reactor.callLater(0, dhcp_flow_check_scenario, df)
2659 return df
2660
2661
Thangavelu K Se6c77c72017-06-23 21:28:48 +00002662
2663 @deferred(TESTCASE_TIMEOUT)
2664 def test_subscriber_with_voltha_for_dhcp_with_multiple_times_disabling_of_olt(self):
2665 """
2666 Test Method:
2667 0. Make sure that voltha is up and running on CORD-POD setup.
2668 1. OLT and ONU is detected and validated.
2669 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
2670 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
2671 4. Verify that subscriber get ip from dhcp server successfully.
2672 5. Disable olt devices which is being detected in voltha CLI.
2673 6. Repeat step 3.
2674 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway.
2675 8. Repeat steps from 3 to 7 for 10 times and finally verify dhcp flow
2676 """
2677 df = defer.Deferred()
2678 no_iterations = 10
2679 dhcp_app = 'org.onosproject.dhcp'
2680 def dhcp_flow_check_scenario(df):
2681 log_test.info('Enabling ponsim_olt')
2682 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
2683 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
2684 assert_not_equal(device_id, None)
2685 voltha = VolthaCtrl(self.VOLTHA_HOST,
2686 rest_port = self.VOLTHA_REST_PORT,
2687 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
2688 time.sleep(10)
2689 switch_map = None
2690 olt_configured = False
2691 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
2692 log_test.info('Installing OLT app')
2693 OnosCtrl.install_app(self.olt_app_file)
2694 time.sleep(5)
2695 log_test.info('Adding subscribers through OLT app')
2696 self.config_olt(switch_map)
2697 olt_configured = True
2698 time.sleep(5)
2699 for i in range(no_iterations):
2700 thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT, "interrupting_dhcp_flows",))
2701 thread2 = threading.Thread(target = self.voltha.disable_device, args = (device_id,False,))
2702 log_test.info('Disable the olt device in during client send discover to voltha')
2703 thread2.start()
2704# time.sleep(randint(0,1))
2705 thread1.start()
2706 time.sleep(10)
2707 thread1.join()
2708 thread2.join()
2709 dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT)
2710 try:
2711 assert_equal(self.success, True)
2712 assert_equal(dhcp_status, True)
2713 #assert_equal(status, True)
2714 time.sleep(10)
2715 finally:
2716 self.voltha.disable_device(device_id, delete = True)
2717 self.remove_olt(switch_map)
2718 df.callback(0)
2719
2720 reactor.callLater(0, dhcp_flow_check_scenario, df)
2721 return df
2722
2723
Thangavelu K S0f2c5232017-06-19 19:11:43 +00002724 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00002725 def test_subscriber_with_voltha_for_dhcp_toggling_olt(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00002726 """
2727 Test Method:
2728 0. Make sure that voltha is up and running on CORD-POD setup.
2729 1. OLT and ONU is detected and validated.
2730 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
2731 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
2732 4. Verify that subscriber get ip from dhcp server successfully.
2733 5. Disable olt devices which is being detected in voltha CLI.
2734 6. Repeat step 3.
2735 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway.
2736 8. Enable olt devices which is being detected in voltha CLI.
2737 9. Repeat steps 3 and 4.
2738 """
Thangavelu K S0f2c5232017-06-19 19:11:43 +00002739 df = defer.Deferred()
2740 dhcp_app = 'org.onosproject.dhcp'
2741 def dhcp_flow_check_scenario(df):
2742 log_test.info('Enabling ponsim_olt')
2743 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
2744 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
2745 assert_not_equal(device_id, None)
2746 voltha = VolthaCtrl(self.VOLTHA_HOST,
2747 rest_port = self.VOLTHA_REST_PORT,
2748 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
2749 time.sleep(10)
2750 switch_map = None
2751 olt_configured = False
2752 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
2753 log_test.info('Installing OLT app')
2754 OnosCtrl.install_app(self.olt_app_file)
2755 time.sleep(5)
2756 log_test.info('Adding subscribers through OLT app')
2757 self.config_olt(switch_map)
2758 olt_configured = True
2759 time.sleep(5)
2760 thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT, "interrupting_dhcp_flows",))
2761 thread2 = threading.Thread(target = self.voltha.restart_device, args = (device_id,))
2762 thread2.start()
2763 thread1.start()
2764 time.sleep(10)
2765 thread1.join()
2766 thread2.join()
2767 try:
Chetan Gaonkercf37f262017-06-19 19:11:11 +00002768 assert_equal(self.success, True)
Thangavelu K S0f2c5232017-06-19 19:11:43 +00002769 #assert_equal(status, True)
2770 time.sleep(10)
2771 finally:
2772 self.voltha.disable_device(device_id, delete = True)
2773 self.remove_olt(switch_map)
2774 df.callback(0)
2775
2776 reactor.callLater(0, dhcp_flow_check_scenario, df)
2777 return df
2778
Thangavelu K Se6c77c72017-06-23 21:28:48 +00002779 @deferred(TESTCASE_TIMEOUT)
2780 def test_subscriber_with_voltha_for_dhcp_toggling_olt_multiple_times(self):
2781 """
2782 Test Method:
2783 0. Make sure that voltha is up and running on CORD-POD setup.
2784 1. OLT and ONU is detected and validated.
2785 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
2786 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
2787 4. Verify that subscriber get ip from dhcp server successfully.
2788 5. Disable olt devices which is being detected in voltha CLI.
2789 6. Repeat step 3.
2790 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway.
2791 8. Enable olt devices which is being detected in voltha CLI.
2792 9. Repeat steps 3 and 4.
2793 """
2794
2795 df = defer.Deferred()
2796 no_iterations = 10
2797 dhcp_app = 'org.onosproject.dhcp'
2798 def dhcp_flow_check_scenario(df):
2799 log_test.info('Enabling ponsim_olt')
2800 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
2801 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
2802 assert_not_equal(device_id, None)
2803 voltha = VolthaCtrl(self.VOLTHA_HOST,
2804 rest_port = self.VOLTHA_REST_PORT,
2805 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
2806 time.sleep(10)
2807 switch_map = None
2808 olt_configured = False
2809 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
2810 log_test.info('Installing OLT app')
2811 OnosCtrl.install_app(self.olt_app_file)
2812 time.sleep(5)
2813 log_test.info('Adding subscribers through OLT app')
2814 self.config_olt(switch_map)
2815 olt_configured = True
2816 time.sleep(5)
2817 for i in range(no_iterations):
2818 thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT, "interrupting_dhcp_flows",))
2819 thread2 = threading.Thread(target = self.voltha.restart_device, args = (device_id,))
2820 thread2.start()
2821 thread1.start()
2822 time.sleep(10)
2823 thread1.join()
2824 thread2.join()
2825 dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT)
2826 try:
2827 assert_equal(dhcp_status, True)
2828 #assert_equal(status, True)
2829 assert_equal(self.success, True)
2830 time.sleep(10)
2831 finally:
2832 self.voltha.disable_device(device_id, delete = True)
2833 self.remove_olt(switch_map)
2834 df.callback(0)
2835
2836 reactor.callLater(0, dhcp_flow_check_scenario, df)
2837 return df
2838
2839
Thangavelu K S0f2c5232017-06-19 19:11:43 +00002840
2841 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00002842 def test_subscriber_with_voltha_for_dhcp_disabling_onu_port(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00002843 """
2844 Test Method:
2845 0. Make sure that voltha is up and running on CORD-POD setup.
2846 1. OLT and ONU is detected and validated.
2847 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
2848 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
2849 4. Verify that subscriber get ip from dhcp server successfully.
2850 5. Disable onu port which is being detected in voltha CLI.
2851 6. Repeat step 3.
2852 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway.
2853 """
Thangavelu K S0f2c5232017-06-19 19:11:43 +00002854 df = defer.Deferred()
2855 dhcp_app = 'org.onosproject.dhcp'
2856 def dhcp_flow_check_scenario(df):
2857 log_test.info('Enabling ponsim_olt')
2858 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
2859 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
2860 assert_not_equal(device_id, None)
2861 voltha = VolthaCtrl(self.VOLTHA_HOST,
2862 rest_port = self.VOLTHA_REST_PORT,
2863 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
2864 time.sleep(10)
2865 switch_map = None
2866 olt_configured = False
2867 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
2868 log_test.info('Installing OLT app')
2869 OnosCtrl.install_app(self.olt_app_file)
2870 time.sleep(5)
2871 log_test.info('Adding subscribers through OLT app')
2872 self.config_olt(switch_map)
2873 olt_configured = True
2874 time.sleep(5)
2875 thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT, "interrupting_dhcp_flows",))
2876 thread2 = threading.Thread(target = self.voltha_uni_port_down_up)
2877 thread1.start()
2878 thread2.start()
2879 time.sleep(10)
2880 thread1.join()
2881 thread2.join()
2882 try:
Chetan Gaonkercf37f262017-06-19 19:11:11 +00002883 assert_equal(self.success, True)
Thangavelu K S0f2c5232017-06-19 19:11:43 +00002884 #assert_equal(status, True)
2885 time.sleep(10)
2886 finally:
2887 self.voltha.disable_device(device_id, delete = True)
2888 self.remove_olt(switch_map)
2889 df.callback(0)
2890
2891 reactor.callLater(0, dhcp_flow_check_scenario, df)
2892 return df
2893
Thangavelu K Se6c77c72017-06-23 21:28:48 +00002894 @deferred(TESTCASE_TIMEOUT)
2895 def test_subscriber_with_voltha_for_dhcp_disabling_onu_port_multiple_times(self):
2896 """
2897 Test Method:
2898 0. Make sure that voltha is up and running on CORD-POD setup.
2899 1. OLT and ONU is detected and validated.
2900 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
2901 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
2902 4. Verify that subscriber get ip from dhcp server successfully.
2903 5. Disable onu port which is being detected in voltha CLI.
2904 6. Repeat step 3.
2905 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway.
2906 """
2907 df = defer.Deferred()
2908 no_iterations = 10
2909 dhcp_app = 'org.onosproject.dhcp'
2910 def dhcp_flow_check_scenario(df):
2911 log_test.info('Enabling ponsim_olt')
2912 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
2913 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
2914 assert_not_equal(device_id, None)
2915 voltha = VolthaCtrl(self.VOLTHA_HOST,
2916 rest_port = self.VOLTHA_REST_PORT,
2917 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
2918 time.sleep(10)
2919 switch_map = None
2920 olt_configured = False
2921 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
2922 log_test.info('Installing OLT app')
2923 OnosCtrl.install_app(self.olt_app_file)
2924 time.sleep(5)
2925 log_test.info('Adding subscribers through OLT app')
2926 self.config_olt(switch_map)
2927 olt_configured = True
2928 time.sleep(5)
2929 for i in range(no_iterations):
2930 thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT, "interrupting_dhcp_flows",))
2931 thread2 = threading.Thread(target = self.voltha_uni_port_down_up)
2932 thread1.start()
2933 thread2.start()
2934 time.sleep(10)
2935 thread1.join()
2936 thread2.join()
2937 dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT)
2938 try:
2939 #assert_equal(status, True)
2940 assert_equal(dhcp_status, True)
2941 assert_equal(self.success, True)
2942 time.sleep(10)
2943 finally:
2944 self.voltha.disable_device(device_id, delete = True)
2945 self.remove_olt(switch_map)
2946 df.callback(0)
2947
2948 reactor.callLater(0, dhcp_flow_check_scenario, df)
2949 return df
Thangavelu K S0f2c5232017-06-19 19:11:43 +00002950
2951 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00002952 def test_subscriber_with_voltha_for_dhcp_toggling_onu_port(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00002953 """
2954 Test Method:
2955 0. Make sure that voltha is up and running on CORD-POD setup.
2956 1. OLT and ONU is detected and validated.
2957 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
2958 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
2959 4. Verify that subscriber get ip from dhcp server successfully.
2960 5. Disable onu port which is being detected in voltha CLI.
2961 6. Repeat step 3.
2962 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway.
2963 8. Enable onu port which is being detected in voltha CLI.
2964 9. Repeat steps 3 and 4.
2965 """
2966
Thangavelu K S0f2c5232017-06-19 19:11:43 +00002967 df = defer.Deferred()
2968 dhcp_app = 'org.onosproject.dhcp'
2969 def dhcp_flow_check_scenario(df):
2970 log_test.info('Enabling ponsim_olt')
2971 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
2972 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
2973 assert_not_equal(device_id, None)
2974 voltha = VolthaCtrl(self.VOLTHA_HOST,
2975 rest_port = self.VOLTHA_REST_PORT,
2976 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
2977 time.sleep(10)
2978 switch_map = None
2979 olt_configured = False
2980 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
2981 log_test.info('Installing OLT app')
2982 OnosCtrl.install_app(self.olt_app_file)
2983 time.sleep(5)
2984 log_test.info('Adding subscribers through OLT app')
2985 self.config_olt(switch_map)
2986 olt_configured = True
2987 time.sleep(5)
2988 thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT, "interrupting_dhcp_flows",))
2989 thread2 = threading.Thread(target = self.voltha_uni_port_down_up)
2990 log_test.info('Restart dhcp app in onos during client send discover to voltha')
2991 thread2.start()
2992 time.sleep(randint(0,1))
2993 thread1.start()
2994 time.sleep(10)
2995 thread1.join()
2996 thread2.join()
2997 dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT)
2998 assert_equal(dhcp_status, True)
2999 try:
Chetan Gaonkercf37f262017-06-19 19:11:11 +00003000 assert_equal(self.success, True)
Thangavelu K S0f2c5232017-06-19 19:11:43 +00003001 #assert_equal(status, True)
3002 time.sleep(10)
3003 finally:
3004 self.voltha.disable_device(device_id, delete = True)
3005 self.remove_olt(switch_map)
3006 df.callback(0)
3007
3008 reactor.callLater(0, dhcp_flow_check_scenario, df)
3009 return df
3010
Thangavelu K Se6c77c72017-06-23 21:28:48 +00003011 @deferred(TESTCASE_TIMEOUT)
3012 def test_subscriber_with_voltha_for_dhcp_toggling_onu_port_multiple_times(self):
3013 """
3014 Test Method:
3015 0. Make sure that voltha is up and running on CORD-POD setup.
3016 1. OLT and ONU is detected and validated.
3017 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3018 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
3019 4. Verify that subscriber get ip from dhcp server successfully.
3020 5. Disable onu port which is being detected in voltha CLI.
3021 6. Repeat step 3.
3022 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway.
3023 8. Enable onu port which is being detected in voltha CLI.
3024 9. Repeat steps 3 and 4.
3025 """
3026
3027 df = defer.Deferred()
3028 no_iterations = 10
3029 dhcp_app = 'org.onosproject.dhcp'
3030 def dhcp_flow_check_scenario(df):
3031 log_test.info('Enabling ponsim_olt')
3032 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
3033 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
3034 assert_not_equal(device_id, None)
3035 voltha = VolthaCtrl(self.VOLTHA_HOST,
3036 rest_port = self.VOLTHA_REST_PORT,
3037 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
3038 time.sleep(10)
3039 switch_map = None
3040 olt_configured = False
3041 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
3042 log_test.info('Installing OLT app')
3043 OnosCtrl.install_app(self.olt_app_file)
3044 time.sleep(5)
3045 log_test.info('Adding subscribers through OLT app')
3046 self.config_olt(switch_map)
3047 olt_configured = True
3048 time.sleep(5)
3049 for i in range(no_iterations):
3050 thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT, "interrupting_dhcp_flows",))
3051 thread2 = threading.Thread(target = self.voltha_uni_port_down_up)
3052 log_test.info('Restart dhcp app in onos during client send discover to voltha')
3053 thread2.start()
3054 time.sleep(randint(0,1))
3055 thread1.start()
3056 time.sleep(10)
3057 thread1.join()
3058 thread2.join()
3059 dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT)
3060 assert_equal(dhcp_status, True)
3061 try:
3062 assert_equal(self.success, True)
3063 #assert_equal(status, True)
3064 time.sleep(10)
3065 finally:
3066 self.voltha.disable_device(device_id, delete = True)
3067 self.remove_olt(switch_map)
3068 df.callback(0)
3069
3070 reactor.callLater(0, dhcp_flow_check_scenario, df)
3071 return df
3072
Thangavelu K S0f2c5232017-06-19 19:11:43 +00003073
3074 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00003075 def test_two_subscribers_with_voltha_for_dhcp_discover(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00003076 """
3077 Test Method:
3078 0. Make sure that voltha is up and running on CORD-POD setup.
3079 1. OLT and ONU is detected and validated.
3080 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3081 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app.
3082 4. Verify that subscribers had got different ips from dhcp server successfully.
3083 """
3084
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00003085 df = defer.Deferred()
3086 self.success = True
3087 dhcp_app = 'org.onosproject.dhcp'
3088 def dhcp_flow_check_scenario(df):
3089 log_test.info('Enabling ponsim_olt')
3090 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
3091 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
3092 assert_not_equal(device_id, None)
3093 voltha = VolthaCtrl(self.VOLTHA_HOST,
3094 rest_port = self.VOLTHA_REST_PORT,
3095 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
3096 time.sleep(10)
3097 switch_map = None
3098 olt_configured = False
3099 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
3100 log_test.info('Installing OLT app')
3101 OnosCtrl.install_app(self.olt_app_file)
3102 time.sleep(5)
3103 log_test.info('Adding subscribers through OLT app')
3104 self.config_olt(switch_map)
3105 olt_configured = True
3106 time.sleep(5)
3107 thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT,))
3108 thread2 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_2_RX_DEFAULT,))
3109 thread1.start()
3110 thread2.start()
3111 time.sleep(10)
3112 thread1.join()
3113 thread2.join()
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00003114 dhcp_flow_status = self.success
3115 try:
3116# if self.success is not True:
3117 assert_equal(dhcp_flow_status, True)
3118 #assert_equal(status, True)
3119 time.sleep(10)
3120 finally:
3121 self.voltha.disable_device(device_id, delete = True)
3122 self.remove_olt(switch_map)
3123 df.callback(0)
3124
3125 reactor.callLater(0, dhcp_flow_check_scenario, df)
3126 return df
3127
3128 @deferred(TESTCASE_TIMEOUT)
Thangavelu K Se6c77c72017-06-23 21:28:48 +00003129 def test_two_subscribers_with_voltha_for_dhcp_multiple_discover(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00003130 """
3131 Test Method:
3132 0. Make sure that voltha is up and running on CORD-POD setup.
3133 1. OLT and ONU is detected and validated.
3134 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3135 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app.
3136 4. Verify that subscribers had got ip from dhcp server successfully.
3137 5. Repeat step 3 and 4 for 10 times for both subscribers.
3138 6 Verify that subscribers should get same ips which are offered the first time from dhcp server.
3139 """
Thangavelu K Se6c77c72017-06-23 21:28:48 +00003140
3141
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00003142 df = defer.Deferred()
3143 self.success = True
3144 dhcp_app = 'org.onosproject.dhcp'
3145 def dhcp_flow_check_scenario(df):
3146 log_test.info('Enabling ponsim_olt')
3147 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
3148 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
3149 assert_not_equal(device_id, None)
3150 voltha = VolthaCtrl(self.VOLTHA_HOST,
3151 rest_port = self.VOLTHA_REST_PORT,
3152 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
3153 time.sleep(10)
3154 switch_map = None
3155 olt_configured = False
3156 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
3157 log_test.info('Installing OLT app')
3158 OnosCtrl.install_app(self.olt_app_file)
3159 time.sleep(5)
3160 log_test.info('Adding subscribers through OLT app')
3161 self.config_olt(switch_map)
3162 olt_configured = True
3163 time.sleep(5)
3164 thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT,"multiple_discover",))
3165 thread2 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_2_RX_DEFAULT,"multiple_discover",))
3166 thread1.start()
3167 thread2.start()
3168 time.sleep(10)
3169 thread1.join()
3170 thread2.join()
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00003171 dhcp_flow_status = self.success
3172 try:
3173# if self.success is not True:
3174 assert_equal(dhcp_flow_status, True)
3175 #assert_equal(status, True)
3176 time.sleep(10)
3177 finally:
3178 self.voltha.disable_device(device_id, delete = True)
3179 self.remove_olt(switch_map)
3180 df.callback(0)
3181
3182 reactor.callLater(0, dhcp_flow_check_scenario, df)
3183 return df
3184
3185 @deferred(TESTCASE_TIMEOUT)
Thangavelu K Se6c77c72017-06-23 21:28:48 +00003186 def test_two_subscribers_with_voltha_for_dhcp_and_with_multiple_discover_for_one_subscriber(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00003187 """
3188 Test Method:
3189 0. Make sure that voltha is up and running on CORD-POD setup.
3190 1. OLT and ONU is detected and validated.
3191 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3192 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app.
3193 4. Verify that subscribers had got ip from dhcp server successfully.
3194 5. Repeat step 3 and 4 for 10 times for only one subscriber and ping to gateway from other subscriber.
3195 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
3196 """
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00003197
3198 df = defer.Deferred()
3199 self.success = True
3200 dhcp_app = 'org.onosproject.dhcp'
3201 def dhcp_flow_check_scenario(df):
3202 log_test.info('Enabling ponsim_olt')
3203 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
3204 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
3205 assert_not_equal(device_id, None)
3206 voltha = VolthaCtrl(self.VOLTHA_HOST,
3207 rest_port = self.VOLTHA_REST_PORT,
3208 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
3209 time.sleep(10)
3210 switch_map = None
3211 olt_configured = False
3212 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
3213 log_test.info('Installing OLT app')
3214 OnosCtrl.install_app(self.olt_app_file)
3215 time.sleep(5)
3216 log_test.info('Adding subscribers through OLT app')
3217 self.config_olt(switch_map)
3218 olt_configured = True
3219 time.sleep(5)
3220 thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT,"multiple_discover",))
3221 thread2 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_2_RX_DEFAULT,))
3222 thread1.start()
3223 thread2.start()
3224 time.sleep(10)
3225 thread1.join()
3226 thread2.join()
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00003227 dhcp_flow_status = self.success
3228 try:
3229# if self.success is not True:
3230 assert_equal(dhcp_flow_status, True)
3231 #assert_equal(status, True)
3232 time.sleep(10)
3233 finally:
3234 self.voltha.disable_device(device_id, delete = True)
3235 self.remove_olt(switch_map)
3236 df.callback(0)
3237
3238 reactor.callLater(0, dhcp_flow_check_scenario, df)
3239 return df
3240
3241 @deferred(TESTCASE_TIMEOUT)
Thangavelu K Se6c77c72017-06-23 21:28:48 +00003242 def test_two_subscribers_with_voltha_for_dhcp_discover_and_desired_ip_address_for_one_subscriber(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00003243 """
3244 Test Method:
3245 0. Make sure that voltha is up and running on CORD-POD setup.
3246 1. OLT and ONU is detected and validated.
3247 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3248 3. Send dhcp request from one residential subscriber to dhcp server which is running as onos app.
3249 3. Send dhcp request with desired ip from other residential subscriber to dhcp server which is running as onos app.
3250 4. Verify that subscribers had got different ips (one subscriber desired ip and other subscriber random ip) from dhcp server successfully.
3251 """
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00003252
3253 df = defer.Deferred()
3254 self.success = True
3255 dhcp_app = 'org.onosproject.dhcp'
3256 def dhcp_flow_check_scenario(df):
3257 log_test.info('Enabling ponsim_olt')
3258 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
3259 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
3260 assert_not_equal(device_id, None)
3261 voltha = VolthaCtrl(self.VOLTHA_HOST,
3262 rest_port = self.VOLTHA_REST_PORT,
3263 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
3264 time.sleep(10)
3265 switch_map = None
3266 olt_configured = False
3267 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
3268 log_test.info('Installing OLT app')
3269 OnosCtrl.install_app(self.olt_app_file)
3270 time.sleep(5)
3271 log_test.info('Adding subscribers through OLT app')
3272 self.config_olt(switch_map)
3273 olt_configured = True
3274 time.sleep(5)
3275 thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT,))
3276 thread2 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_2_RX_DEFAULT,"desired_ip_address",))
3277 thread1.start()
3278 thread2.start()
3279 time.sleep(10)
3280 thread1.join()
3281 thread2.join()
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00003282 dhcp_flow_status = self.success
3283 try:
3284# if self.success is not True:
3285 assert_equal(dhcp_flow_status, True)
3286 #assert_equal(status, True)
3287 time.sleep(10)
3288 finally:
3289 self.voltha.disable_device(device_id, delete = True)
3290 self.remove_olt(switch_map)
3291 df.callback(0)
3292
3293 reactor.callLater(0, dhcp_flow_check_scenario, df)
3294 return df
3295
3296 @deferred(TESTCASE_TIMEOUT)
Thangavelu K Se6c77c72017-06-23 21:28:48 +00003297 def test_two_subscribers_with_voltha_for_dhcp_discover_within_and_without_dhcp_pool_ip_addresses(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00003298 """
3299 Test Method:
3300 0. Make sure that voltha is up and running on CORD-POD setup.
3301 1. OLT and ONU is detected and validated.
3302 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3303 3. Send dhcp request with desired wihtin dhcp pool ip from one residential subscriber to dhcp server which is running as onos app.
3304 3. Send dhcp request with desired without in dhcp pool ip from other residential subscriber to dhcp server which is running as onos app.
3305 4. Verify that subscribers had got different ips (both subscriber got random ips within dhcp pool) from dhcp server successfully.
3306 """
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00003307 df = defer.Deferred()
3308 self.success = True
3309 dhcp_app = 'org.onosproject.dhcp'
3310 def dhcp_flow_check_scenario(df):
3311 log_test.info('Enabling ponsim_olt')
3312 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
3313 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
3314 assert_not_equal(device_id, None)
3315 voltha = VolthaCtrl(self.VOLTHA_HOST,
3316 rest_port = self.VOLTHA_REST_PORT,
3317 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
3318 time.sleep(10)
3319 switch_map = None
3320 olt_configured = False
3321 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
3322 log_test.info('Installing OLT app')
3323 OnosCtrl.install_app(self.olt_app_file)
3324 time.sleep(5)
3325 log_test.info('Adding subscribers through OLT app')
3326 self.config_olt(switch_map)
3327 olt_configured = True
3328 time.sleep(5)
3329 thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT,"desired_ip_address",))
3330 thread2 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_2_RX_DEFAULT,"desired_out_of_pool_ip_address",))
3331 thread1.start()
3332 thread2.start()
3333 time.sleep(10)
3334 thread1.join()
3335 thread2.join()
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00003336 dhcp_flow_status = self.success
3337 try:
3338# if self.success is not True:
3339 assert_equal(dhcp_flow_status, True)
3340 #assert_equal(status, True)
3341 time.sleep(10)
3342 finally:
3343 self.voltha.disable_device(device_id, delete = True)
3344 self.remove_olt(switch_map)
3345 df.callback(0)
3346
3347 reactor.callLater(0, dhcp_flow_check_scenario, df)
3348 return df
3349
3350 @deferred(TESTCASE_TIMEOUT)
3351 def test_two_subscribers_with_voltha_for_dhcp_disabling_onu_port_for_one_subscriber(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00003352 """
3353 Test Method:
3354 0. Make sure that voltha is up and running on CORD-POD setup.
3355 1. OLT and ONU is detected and validated.
3356 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3357 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app.
3358 4. Verify that subscribers had got ip from dhcp server successfully.
3359 5. Disable onu port on which access one subscriber and ping to gateway from other subscriber.
3360 6. Repeat step 3 and 4 for one subscriber where uni port is down.
3361 7. Verify that subscriber should not get ip from dhcp server and other subscriber ping to gateway should not failed.
3362 """
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00003363 df = defer.Deferred()
3364 self.success = True
3365 dhcp_app = 'org.onosproject.dhcp'
3366 def dhcp_flow_check_scenario(df):
3367 log_test.info('Enabling ponsim_olt')
3368 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
3369 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
3370 assert_not_equal(device_id, None)
3371 voltha = VolthaCtrl(self.VOLTHA_HOST,
3372 rest_port = self.VOLTHA_REST_PORT,
3373 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
3374 time.sleep(10)
3375 switch_map = None
3376 olt_configured = False
3377 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
3378 log_test.info('Installing OLT app')
3379 OnosCtrl.install_app(self.olt_app_file)
3380 time.sleep(5)
3381 log_test.info('Adding subscribers through OLT app')
3382 self.config_olt(switch_map)
3383 olt_configured = True
3384 time.sleep(5)
3385 thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT,"desired_ip_address",))
3386 thread2 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_2_RX_DEFAULT,"desired_out_of_pool_ip_address",))
3387 thread1.start()
3388 thread2.start()
3389 time.sleep(10)
3390 thread1.join()
3391 thread2.join()
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00003392 dhcp_flow_status = self.success
3393 try:
3394# if self.success is not True:
3395 assert_equal(dhcp_flow_status, True)
3396 #assert_equal(status, True)
3397 time.sleep(10)
3398 finally:
3399 self.voltha.disable_device(device_id, delete = True)
3400 self.remove_olt(switch_map)
3401 df.callback(0)
3402
3403 reactor.callLater(0, dhcp_flow_check_scenario, df)
3404 return df
3405
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00003406 @deferred(TESTCASE_TIMEOUT)
3407 def test_two_subscribers_with_voltha_for_dhcp_toggling_onu_port_for_one_subscriber(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00003408 """
3409 Test Method:
3410 0. Make sure that voltha is up and running on CORD-POD setup.
3411 1. OLT and ONU is detected and validated.
3412 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3413 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app.
3414 4. Verify that subscribers had got ip from dhcp server successfully.
3415 5. Disable onu port on which access one subscriber and ping to gateway from other subscriber.
3416 6. Repeat step 3 and 4 for one subscriber where uni port is down.
3417 7. Verify that subscriber should not get ip from dhcp server and other subscriber ping to gateway should not failed.
3418 8. Enable onu port on which was disable at step 5 and ping to gateway from other subscriber.
3419 9. Repeat step 3 and 4 for one subscriber where uni port is up now.
3420 10. Verify that subscriber should get ip from dhcp server and other subscriber ping to gateway should not failed.
3421 """
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00003422 df = defer.Deferred()
3423 self.success = True
3424 dhcp_app = 'org.onosproject.dhcp'
3425 def dhcp_flow_check_scenario(df):
3426 log_test.info('Enabling ponsim_olt')
3427 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
3428 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
3429 assert_not_equal(device_id, None)
3430 voltha = VolthaCtrl(self.VOLTHA_HOST,
3431 rest_port = self.VOLTHA_REST_PORT,
3432 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
3433 time.sleep(10)
3434 switch_map = None
3435 olt_configured = False
3436 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
3437 log_test.info('Installing OLT app')
3438 OnosCtrl.install_app(self.olt_app_file)
3439 time.sleep(5)
3440 log_test.info('Adding subscribers through OLT app')
3441 self.config_olt(switch_map)
3442 olt_configured = True
3443 time.sleep(5)
3444 thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT,))
3445 thread2 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_2_RX_DEFAULT,))
3446 thread3 = threading.Thread(target = self.voltha_uni_port_down_up, args = (self.INTF_2_RX_DEFAULT,))
3447 thread1.start()
3448 thread2.start()
3449 thread3.start()
3450 time.sleep(10)
3451 thread1.join()
3452 thread2.join()
3453 thread3.join()
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00003454 dhcp_flow_status = self.success
3455 try:
3456# if self.success is not True:
3457 assert_equal(dhcp_flow_status, True)
3458 #assert_equal(status, True)
3459 time.sleep(10)
3460 finally:
3461 self.voltha.disable_device(device_id, delete = True)
3462 self.remove_olt(switch_map)
3463 df.callback(0)
3464
3465 reactor.callLater(0, dhcp_flow_check_scenario, df)
3466 return df
3467
3468
3469 @deferred(TESTCASE_TIMEOUT)
Thangavelu K Se6c77c72017-06-23 21:28:48 +00003470 def test_two_subscribers_with_voltha_for_dhcp_disabling_olt(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00003471 """
Thangavelu K Se6c77c72017-06-23 21:28:48 +00003472 Test Method: uni_port
Thangavelu K S057b7d22017-05-16 22:03:22 +00003473 0. Make sure that voltha is up and running on CORD-POD setup.
3474 1. OLT and ONU is detected and validated.
3475 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3476 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app.
3477 4. Verify that subscribers had got ip from dhcp server successfully.
3478 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber.
3479 6. Disable the olt device which is detected in voltha.
3480 7. Verify that subscriber should not get ip from dhcp server and other subscriber ping to gateway should failed.
3481 """
Thangavelu K Se6c77c72017-06-23 21:28:48 +00003482 df = defer.Deferred()
3483 self.success = True
3484 dhcp_app = 'org.onosproject.dhcp'
3485 def dhcp_flow_check_scenario(df):
3486 log_test.info('Enabling ponsim_olt')
3487 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
3488 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
3489 assert_not_equal(device_id, None)
3490 voltha = VolthaCtrl(self.VOLTHA_HOST,
3491 rest_port = self.VOLTHA_REST_PORT,
3492 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
3493 time.sleep(10)
3494 switch_map = None
3495 olt_configured = False
3496 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
3497 log_test.info('Installing OLT app')
3498 OnosCtrl.install_app(self.olt_app_file)
3499 time.sleep(5)
3500 log_test.info('Adding subscribers through OLT app')
3501 self.config_olt(switch_map)
3502 olt_configured = True
3503 time.sleep(5)
3504 thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT,))
3505 thread2 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_2_RX_DEFAULT,))
3506 thread3 = threading.Thread(target = self.voltha.disable_device, args = (device_id,False,))
3507
3508 thread1.start()
3509 thread2.start()
3510 thread3.start()
3511 time.sleep(10)
3512 thread1.join()
3513 thread2.join()
3514 thread3.join()
3515 dhcp_flow_status = self.success
3516 try:
3517# if self.success is not True:
3518 assert_equal(dhcp_flow_status, True)
3519 #assert_equal(status, True)
3520 time.sleep(10)
3521 finally:
3522 self.voltha.disable_device(device_id, delete = True)
3523 self.remove_olt(switch_map)
3524 df.callback(0)
3525
3526 reactor.callLater(0, dhcp_flow_check_scenario, df)
3527 return df
3528
3529 @deferred(TESTCASE_TIMEOUT)
3530 def test_two_subscribers_with_voltha_for_dhcp_toggling_olt(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00003531 """
3532 Test Method:
3533 0. Make sure that voltha is up and running on CORD-POD setup.
3534 1. OLT and ONU is detected and validated.
3535 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3536 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app.
3537 4. Verify that subscribers had got ip from dhcp server successfully.
3538 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber.
3539 6. Disable the olt device which is detected in voltha.
3540 7. Verify that subscriber should not get ip from dhcp server and other subscriber ping to gateway should failed.
3541 8. Enable the olt device which is detected in voltha.
3542 9. Verify that subscriber should get ip from dhcp server and other subscriber ping to gateway should not failed.
Thangavelu K Se6c77c72017-06-23 21:28:48 +00003543
Thangavelu K S057b7d22017-05-16 22:03:22 +00003544 """
Thangavelu K Se6c77c72017-06-23 21:28:48 +00003545 df = defer.Deferred()
3546 self.success = True
3547 dhcp_app = 'org.onosproject.dhcp'
3548 def dhcp_flow_check_scenario(df):
3549 log_test.info('Enabling ponsim_olt')
3550 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
3551 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
3552 assert_not_equal(device_id, None)
3553 voltha = VolthaCtrl(self.VOLTHA_HOST,
3554 rest_port = self.VOLTHA_REST_PORT,
3555 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
3556 time.sleep(10)
3557 switch_map = None
3558 olt_configured = False
3559 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
3560 log_test.info('Installing OLT app')
3561 OnosCtrl.install_app(self.olt_app_file)
3562 time.sleep(5)
3563 log_test.info('Adding subscribers through OLT app')
3564 self.config_olt(switch_map)
3565 olt_configured = True
3566 time.sleep(5)
3567 thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT,))
3568 thread2 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_2_RX_DEFAULT,))
3569 thread3 = threading.Thread(target = self.voltha.restart_device, args = (device_id,))
3570 thread1.start()
3571 thread2.start()
3572 thread3.start()
3573 time.sleep(10)
3574 thread1.join()
3575 thread2.join()
3576 thread3.join()
3577 dhcp_flow_status = self.success
3578 try:
3579# if self.success is not True:
3580 assert_equal(dhcp_flow_status, True)
3581 #assert_equal(status, True)
3582 time.sleep(10)
3583 finally:
3584 self.voltha.disable_device(device_id, delete = True)
3585 self.remove_olt(switch_map)
3586 df.callback(0)
3587
3588 reactor.callLater(0, dhcp_flow_check_scenario, df)
3589 return df
3590
3591 @deferred(TESTCASE_TIMEOUT)
3592 def test_two_subscribers_with_voltha_for_dhcp_with_paused_olt(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00003593 """
3594 Test Method:
3595 0. Make sure that voltha is up and running on CORD-POD setup.
3596 1. OLT and ONU is detected and validated.
3597 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3598 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app.
3599 4. Verify that subscribers had got ip from dhcp server successfully.
3600 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber.
3601 6. Pause the olt device which is detected in voltha.
3602 7. Verify that subscriber should not get ip from dhcp server and other subscriber ping to gateway should failed.
3603 """
Thangavelu K Se6c77c72017-06-23 21:28:48 +00003604 df = defer.Deferred()
3605 self.success = True
3606 dhcp_app = 'org.onosproject.dhcp'
3607 def dhcp_flow_check_scenario(df):
3608 log_test.info('Enabling ponsim_olt')
3609 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
3610 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
3611 assert_not_equal(device_id, None)
3612 voltha = VolthaCtrl(self.VOLTHA_HOST,
3613 rest_port = self.VOLTHA_REST_PORT,
3614 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
3615 time.sleep(10)
3616 switch_map = None
3617 olt_configured = False
3618 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
3619 log_test.info('Installing OLT app')
3620 OnosCtrl.install_app(self.olt_app_file)
3621 time.sleep(5)
3622 log_test.info('Adding subscribers through OLT app')
3623 self.config_olt(switch_map)
3624 olt_configured = True
3625 time.sleep(5)
3626 thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT,))
3627 thread2 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_2_RX_DEFAULT,))
3628 thread3 = threading.Thread(target = self.voltha.pause_device, args = (device_id,))
3629 thread1.start()
3630 thread2.start()
3631 thread3.start()
3632 time.sleep(10)
3633 thread1.join()
3634 thread2.join()
3635 thread3.join()
3636 dhcp_flow_status = self.success
3637 try:
3638# if self.success is not True:
3639 assert_equal(dhcp_flow_status, True)
3640 #assert_equal(status, True)
3641 time.sleep(10)
3642 finally:
3643 self.voltha.disable_device(device_id, delete = True)
3644 self.remove_olt(switch_map)
3645 df.callback(0)
3646
3647 reactor.callLater(0, dhcp_flow_check_scenario, df)
3648 return df
3649
Thangavelu K S36edb012017-07-05 18:24:12 +00003650 def test_3_subscribers_with_voltha_for_dhcp_discover_requests(self):
3651 """
3652 Test Method:
3653 0. Make sure that voltha is up and running on CORD-POD setup.
3654 1. OLT and ONU is detected and validated.
3655 2. Issue tls auth packets from CORD TESTER voltha test module acting as multiple subscribers (3 subscribers)
3656 3. Send dhcp request from residential subscrber to dhcp server which is running as onos app.
3657 4. Verify that subscriber get ip from dhcp server successfully.
3658 """
3659 """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each"""
3660 num_subscribers = 3
3661 num_channels = 1
3662 services = ('DHCP')
3663 cbs = (self.dhcp_flow_check, None, None)
3664 self.voltha_subscribers(services, cbs = cbs,
3665 num_subscribers = num_subscribers,
3666 num_channels = num_channels)
3667
3668 def test_5_subscribers_with_voltha_for_dhcp_discover_requests(self):
3669 """
3670 Test Method:
3671 0. Make sure that voltha is up and running on CORD-POD setup.
3672 1. OLT and ONU is detected and validated.
3673 2. Issue tls auth packets from CORD TESTER voltha test module acting as multiple subscribers (5 subscribers)
3674 3. Send dhcp request from residential subscrber to dhcp server which is running as onos app.
3675 4. Verify that subscriber get ip from dhcp server successfully.
3676 """
3677 """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each"""
3678 num_subscribers = 5
3679 num_channels = 1
3680 services = ('DHCP')
3681 cbs = (self.dhcp_flow_check, None, None)
3682 self.voltha_subscribers(services, cbs = cbs,
3683 num_subscribers = num_subscribers,
3684 num_channels = num_channels)
3685
3686 def test_9_subscribers_with_voltha_for_dhcp_discover_requests(self):
3687 """
3688 Test Method:
3689 0. Make sure that voltha is up and running on CORD-POD setup.
3690 1. OLT and ONU is detected and validated.
3691 2. Issue tls auth packets from CORD TESTER voltha test module acting as multiple subscribers (9 subscribers)
3692 3. Send dhcp request from residential subscrber to dhcp server which is running as onos app.
3693 4. Verify that subscriber get ip from dhcp server successfully.
3694 """
3695 """Test subscriber join next for channel surfing with 9 subscribers browsing 1 channels each"""
3696 num_subscribers = 9
3697 num_channels = 1
3698 services = ('DHCP')
3699 cbs = (self.dhcp_flow_check, None, None)
3700 self.voltha_subscribers(services, cbs = cbs,
3701 num_subscribers = num_subscribers,
3702 num_channels = num_channels)
3703
3704 def test_3_subscribers_with_voltha_for_tls_auth_and_dhcp_discover_flows(self):
3705 """
3706 Test Method:
3707 0. Make sure that voltha is up and running on CORD-POD setup.
3708 1. OLT and ONU is detected and validated.
3709 2. Issue tls auth packets from CORD TESTER voltha test module acting as multiple subscribers (3 subscribers)
3710 3. Send dhcp request from residential subscrber to dhcp server which is running as onos app.
3711 4. Verify that subscriber get ip from dhcp server successfully.
3712 """
3713 """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each"""
3714 num_subscribers = 3
3715 num_channels = 1
3716 services = ('TLS','DHCP')
3717 cbs = (self.tls_flow_check, self.dhcp_flow_check, None)
3718 self.voltha_subscribers(services, cbs = cbs,
3719 num_subscribers = num_subscribers,
3720 num_channels = num_channels)
3721
3722 def test_5_subscribers_with_voltha_for_tls_auth_and_dhcp_discover_flows(self):
3723 """
3724 Test Method:
3725 0. Make sure that voltha is up and running on CORD-POD setup.
3726 1. OLT and ONU is detected and validated.
3727 2. Issue tls auth packets from CORD TESTER voltha test module acting as multiple subscribers (5 subscribers)
3728 3. Send dhcp request from residential subscrber to dhcp server which is running as onos app.
3729 4. Verify that subscriber get ip from dhcp server successfully.
3730 """
3731 """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each"""
3732 num_subscribers = 5
3733 num_channels = 1
3734 services = ('TLS','DHCP')
3735 cbs = (self.tls_flow_check, self.dhcp_flow_check, None)
3736 self.voltha_subscribers(services, cbs = cbs,
3737 num_subscribers = num_subscribers,
3738 num_channels = num_channels)
3739
3740 def test_9_subscribers_with_voltha_for_tls_auth_and_dhcp_discover_flows(self):
3741 """
3742 Test Method:
3743 0. Make sure that voltha is up and running on CORD-POD setup.
3744 1. OLT and ONU is detected and validated.
3745 2. Issue tls auth packets from CORD TESTER voltha test module acting as multiple subscribers (9 subscribers)
3746 3. Send dhcp request from residential subscrber to dhcp server which is running as onos app.
3747 4. Verify that subscriber get ip from dhcp server successfully.
3748 """
3749 """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each"""
3750 num_subscribers = 9
3751 num_channels = 1
3752 services = ('TLS','DHCP')
3753 cbs = (self.tls_flow_check, self.dhcp_flow_check, None)
3754 self.voltha_subscribers(services, cbs = cbs,
3755 num_subscribers = num_subscribers,
3756 num_channels = num_channels)
Thangavelu K Se6c77c72017-06-23 21:28:48 +00003757
3758 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S36edb012017-07-05 18:24:12 +00003759 def test_subscriber_with_voltha_for_dhcpRelay_request(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00003760 """
3761 Test Method:
3762 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
3763 1. OLT and ONU is detected and validated.
3764 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3765 3. Send dhcp request from residential subscrber to external dhcp server.
3766 4. Verify that subscriber get ip from external dhcp server successfully.
3767 """
3768
Thangavelu K Se6c77c72017-06-23 21:28:48 +00003769 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S057b7d22017-05-16 22:03:22 +00003770 def test_subscriber_with_voltha_for_dhcpRelay_dhcp_request_with_invalid_broadcast_source_mac(self):
3771 """
3772 Test Method:
3773 0. Make sure that voltha and external dhcp server are is up and running on CORD-POD setup.
3774 1. OLT and ONU is detected and validated.
3775 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3776 3. Send dhcp request with invalid source mac broadcast from residential subscrber to external dhcp server.
3777 4. Verify that subscriber should not get ip from external dhcp server.
3778 """
3779
Thangavelu K Se6c77c72017-06-23 21:28:48 +00003780 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S057b7d22017-05-16 22:03:22 +00003781 def test_subscriber_with_voltha_for_dhcpRelay_dhcp_request_with_invalid_multicast_source_mac(self):
3782 """
3783 Test Method:
3784 0. Make sure that voltha and external dhcp server are is up and running on CORD-POD setup.
3785 1. OLT and ONU is detected and validated.
3786 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3787 3. Send dhcp request with invalid source mac multicast from residential subscrber to external dhcp server.
3788 4. Verify that subscriber should not get ip from external dhcp server.
3789 """
3790
3791 def test_subscriber_with_voltha_for_dhcpRelay_dhcp_request_with_invalid_source_mac(self):
3792 """
3793 Test Method:
3794 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
3795 1. OLT and ONU is detected and validated.
3796 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3797 3. Send dhcp request with invalid source mac zero from residential subscrber to external dhcp server.
3798 4. Verify that subscriber should not get ip from external dhcp server.
3799 """
3800
3801 def test_subscriber_with_voltha_for_dhcpRelay_dhcp_request_and_release(self):
3802 """
3803 Test Method:
3804 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
3805 1. OLT and ONU is detected and validated.
3806 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3807 3. Send dhcp request from residential subscrber to external dhcp server.
3808 4. Verify that subscriber get ip from external dhcp server successfully.
3809 5. Send dhcp release from residential subscrber to external dhcp server.
3810 6 Verify that subscriber should not get ip from external dhcp server, ping to gateway.
3811 """
3812
3813 def test_subscriber_with_voltha_for_dhcpRelay_starvation(self):
3814 """
3815 Test Method:
3816 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
3817 1. OLT and ONU is detected and validated.
3818 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3819 3. Send dhcp request from residential subscriber to external dhcp server.
3820 4. Verify that subscriber get ip from external dhcp server. successfully.
3821 5. Repeat step 3 and 4 for 10 times.
3822 6 Verify that subscriber should get ip from external dhcp server..
3823 """
3824
3825 def test_subscriber_with_voltha_for_dhcpRelay_starvation_negative_scenario(self):
3826 """
3827 Test Method:
3828 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
3829 1. OLT and ONU is detected and validated.
3830 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3831 3. Send dhcp request from residential subscriber without of pool ip to external dhcp server.
3832 4. Verify that subscriber should not get ip from external dhcp server..
3833 5. Repeat steps 3 and 4 for 10 times.
3834 6 Verify that subscriber should not get ip from external dhcp server..
3835 """
3836 def test_subscriber_with_voltha_for_dhcpRelay_sending_multiple_discover(self):
3837 """
3838 Test Method:
3839 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
3840 1. OLT and ONU is detected and validated.
3841 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3842 3. Send dhcp request from residential subscriber to external dhcp server.
3843 4. Verify that subscriber get ip from external dhcp server. successfully.
3844 5. Repeat step 3 for 50 times.
3845 6 Verify that subscriber should get same ip which was received from 1st discover from external dhcp server..
3846 """
3847 def test_subscriber_with_voltha_for_dhcpRelay_sending_multiple_request(self):
3848 """
3849 Test Method:
3850 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
3851 1. OLT and ONU is detected and validated.
3852 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3853 3. Send dhcp request from residential subscriber to external dhcp server.
3854 4. Verify that subscriber get ip from external dhcp server. successfully.
3855 5. Send DHCP request to external dhcp server.
3856 6. Repeat step 5 for 50 times.
3857 7. Verify that subscriber should get same ip which was received from 1st discover from external dhcp server..
3858 """
3859
3860 def test_subscriber_with_voltha_for_dhcpRelay_requesting_desired_ip_address(self):
3861 """
3862 Test Method:
3863 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
3864 1. OLT and ONU is detected and validated.
3865 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3866 3. Send dhcp request with desired ip address from residential subscriber to external dhcp server.
3867 4. Verify that subscriber get ip which was requested in step 3 from external dhcp server. successfully.
3868 """
3869
3870 def test_subscriber_with_voltha_for_dhcpRelay_requesting_desired_out_of_pool_ip_address(self):
3871 """
3872 Test Method:
3873 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
3874 1. OLT and ONU is detected and validated.
3875 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3876 3. Send dhcp request with desired out of pool ip address from residential subscriber to external dhcp server.
3877 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.
3878 """
3879
3880 def test_subscriber_with_voltha_for_dhcpRelay_deactivating_dhcpRelay_app_in_onos(self):
3881 """
3882 Test Method:
3883 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
3884 1. OLT and ONU is detected and validated.
3885 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3886 3. Send dhcp request from residential subscriber to external dhcp server.
3887 4. Verify that subscriber get ip from external dhcp server. successfully.
3888 5. Deactivate dhcp server app in onos.
3889 6. Repeat step 3.
3890 7. Verify that subscriber should not get ip from external dhcp server., and ping to gateway.
3891 """
3892
3893 def test_subscriber_with_voltha_for_dhcpRelay_renew_time(self):
3894 """
3895 Test Method:
3896 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
3897 1. OLT and ONU is detected and validated.
3898 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3899 3. Send dhcp request from residential subscriber to external dhcp server.
3900 4. Verify that subscriber get ip from external dhcp server. successfully.
3901 5. Send dhcp renew packet to external dhcp server.
3902 6. Repeat step 4.
3903 """
3904
3905 def test_subscriber_with_voltha_for_dhcpRelay_rebind_time(self):
3906 """
3907 Test Method:
3908 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
3909 1. OLT and ONU is detected and validated.
3910 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3911 3. Send dhcp request from residential subscriber to external dhcp server.
3912 4. Verify that subscriber get ip from external dhcp server. successfully.
3913 5. Send dhcp rebind packet to external dhcp server.
3914 6. Repeat step 4.
3915 """
3916
3917 def test_subscriber_with_voltha_for_dhcpRelay_disable_olt_in_voltha(self):
3918 """
3919 Test Method:
3920 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
3921 1. OLT and ONU is detected and validated.
3922 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3923 3. Send dhcp request from residential subscriber to external dhcp server.
3924 4. Verify that subscriber get ip from external dhcp server. successfully.
3925 5. Disable olt devices which is being detected in voltha CLI.
3926 6. Repeat step 3.
3927 7. Verify that subscriber should not get ip from external dhcp server., and ping to gateway.
3928 """
3929
3930 def test_subscriber_with_voltha_for_dhcpRelay_toggling_olt_in_voltha(self):
3931 """
3932 Test Method:
3933 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
3934 1. OLT and ONU is detected and validated.
3935 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3936 3. Send dhcp request from residential subscriber to external dhcp server.
3937 4. Verify that subscriber get ip from external dhcp server. successfully.
3938 5. Disable olt devices which is being detected in voltha CLI.
3939 6. Repeat step 3.
3940 7. Verify that subscriber should not get ip from external dhcp server., and ping to gateway.
3941 8. Enable olt devices which is being detected in voltha CLI.
3942 9. Repeat steps 3 and 4.
3943 """
3944
3945 def test_subscriber_with_voltha_for_dhcpRelay_disable_onu_port_in_voltha(self):
3946 """
3947 Test Method:
3948 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
3949 1. OLT and ONU is detected and validated.
3950 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3951 3. Send dhcp request from residential subscriber to external dhcp server.
3952 4. Verify that subscriber get ip from external dhcp server. successfully.
3953 5. Disable onu port which is being detected in voltha CLI.
3954 6. Repeat step 3.
3955 7. Verify that subscriber should not get ip from external dhcp server., and ping to gateway.
3956 """
3957
Thangavelu K Se6c77c72017-06-23 21:28:48 +00003958 def test_subscriber_with_voltha_for_dhcpRelay_disable_enable_onu_port_in_voltha(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00003959 """
3960 Test Method:
3961 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
3962 1. OLT and ONU is detected and validated.
3963 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3964 3. Send dhcp request from residential subscriber to external dhcp server.
3965 4. Verify that subscriber get ip from external dhcp server. successfully.
3966 5. Disable onu port which is being detected in voltha CLI.
3967 6. Repeat step 3.
3968 7. Verify that subscriber should not get ip from external dhcp server., and ping to gateway.
3969 8. Enable onu port which is being detected in voltha CLI.
3970 9. Repeat steps 3 and 4.
3971 """
3972
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00003973 def test_two_subscribers_with_voltha_for_dhcpRelay_discover(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00003974 """
3975 Test Method:
3976 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
3977 1. OLT and ONU is detected and validated.
3978 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3979 3. Send dhcp request from two residential subscribers to external dhcp server.
3980 4. Verify that subscribers had got different ips from external dhcp server. successfully.
3981 """
3982
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00003983 def test_two_subscribers_with_voltha_for_dhcpRelay_multiple_discover(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00003984 """
3985 Test Method:
3986 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
3987 1. OLT and ONU is detected and validated.
3988 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3989 3. Send dhcp request from two residential subscribers to external dhcp server.
3990 4. Verify that subscribers had got ip from external dhcp server. successfully.
3991 5. Repeat step 3 and 4 for 10 times for both subscribers.
3992 6 Verify that subscribers should get same ips which are offered the first time from external dhcp server..
3993 """
3994
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00003995 def test_two_subscribers_with_voltha_for_dhcpRelay_multiple_discover_for_one_subscriber(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00003996 """
3997 Test Method:
3998 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
3999 1. OLT and ONU is detected and validated.
4000 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4001 3. Send dhcp request from two residential subscribers to external dhcp server.
4002 4. Verify that subscribers had got ip from external dhcp server. successfully.
4003 5. Repeat step 3 and 4 for 10 times for only one subscriber and ping to gateway from other subscriber.
4004 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
4005 """
4006
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00004007 def test_two_subscribers_with_voltha_for_dhcpRelay_discover_desired_ip_address_for_one_subscriber(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00004008 """
4009 Test Method:
4010 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
4011 1. OLT and ONU is detected and validated.
4012 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4013 3. Send dhcp request from one residential subscriber to external dhcp server.
4014 3. Send dhcp request with desired ip from other residential subscriber to external dhcp server.
4015 4. Verify that subscribers had got different ips (one subscriber desired ip and other subscriber random ip) from external dhcp server. successfully.
4016 """
4017
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00004018 def test_two_subscribers_with_voltha_for_dhcpRelay_discover_in_range_and_out_of_range_from_dhcp_pool_ip_addresses(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00004019 """
4020 Test Method:
4021 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
4022 1. OLT and ONU is detected and validated.
4023 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4024 3. Send dhcp request with desired wihtin dhcp pool ip from one residential subscriber to external dhcp server.
4025 3. Send dhcp request with desired without in dhcp pool ip from other residential subscriber to external dhcp server.
4026 4. Verify that subscribers had got different ips (both subscriber got random ips within dhcp pool) from external dhcp server. successfully.
4027 """
4028
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00004029 def test_two_subscribers_with_voltha_for_dhcpRelay_disable_onu_port_for_one_subscriber(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00004030 """
4031 Test Method:
4032 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
4033 1. OLT and ONU is detected and validated.
4034 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4035 3. Send dhcp request from two residential subscribers to external dhcp server.
4036 4. Verify that subscribers had got ip from external dhcp server. successfully.
4037 5. Disable onu port on which access one subscriber and ping to gateway from other subscriber.
4038 6. Repeat step 3 and 4 for one subscriber where uni port is down.
4039 7. Verify that subscriber should not get ip from external dhcp server. and other subscriber ping to gateway should not failed.
4040 """
4041
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00004042 def test_two_subscribers_with_voltha_for_dhcpRelay_toggle_onu_port_for_one_subscriber(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00004043 """
4044 Test Method:
4045 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
4046 1. OLT and ONU is detected and validated.
4047 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4048 3. Send dhcp request from two residential subscribers to external dhcp server.
4049 4. Verify that subscribers had got ip from external dhcp server. successfully.
4050 5. Disable onu port on which access one subscriber and ping to gateway from other subscriber.
4051 6. Repeat step 3 and 4 for one subscriber where uni port is down.
4052 7. Verify that subscriber should not get ip from external dhcp server. and other subscriber ping to gateway should not failed.
4053 8. Enable onu port on which was disable at step 5 and ping to gateway from other subscriber.
4054 9. Repeat step 3 and 4 for one subscriber where uni port is up now.
4055 10. Verify that subscriber should get ip from external dhcp server. and other subscriber ping to gateway should not failed.
4056 """
4057
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00004058 def test_two_subscribers_with_voltha_for_dhcpRelay_disable_olt_detected_in_voltha(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00004059 """
4060 Test Method:
4061 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
4062 1. OLT and ONU is detected and validated.
4063 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4064 3. Send dhcp request from two residential subscribers to external dhcp server.
4065 4. Verify that subscribers had got ip from external dhcp server. successfully.
4066 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber.
4067 6. Disable the olt device which is detected in voltha.
4068 7. Verify that subscriber should not get ip from external dhcp server. and other subscriber ping to gateway should failed.
4069 """
4070
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00004071 def test_two_subscribers_with_voltha_for_dhcpRelay_toggle_olt_detected_in_voltha(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00004072 """
4073 Test Method:
4074 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
4075 1. OLT and ONU is detected and validated.
4076 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4077 3. Send dhcp request from two residential subscribers to external dhcp server.
4078 4. Verify that subscribers had got ip from external dhcp server. successfully.
4079 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber.
4080 6. Disable the olt device which is detected in voltha.
4081 7. Verify that subscriber should not get ip from external dhcp server. and other subscriber ping to gateway should failed.
4082 8. Enable the olt device which is detected in voltha.
4083 9. Verify that subscriber should get ip from external dhcp server. and other subscriber ping to gateway should not failed.
4084 """
4085
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00004086 def test_two_subscribers_with_voltha_for_dhcpRelay_pause_olt_detected_in_voltha(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00004087 """
4088 Test Method:
4089 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
4090 1. OLT and ONU is detected and validated.
4091 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4092 3. Send dhcp request from two residential subscribers to external dhcp server.
4093 4. Verify that subscribers had got ip from external dhcp server. successfully.
4094 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber.
4095 6. Pause the olt device which is detected in voltha.
4096 7. Verify that subscriber should not get ip from external dhcp server. and other subscriber ping to gateway should failed.
4097 """
Thangavelu K S36edb012017-07-05 18:24:12 +00004098
4099 def test_subscriber_with_voltha_for_igmp_join_verify_traffic(self):
4100 """
4101 Test Method:
4102 0. Make sure that voltha is up and running on CORD-POD setup.
4103 1. OLT and ONU is detected and validated.
4104 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4105 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity.
4106 4. Send igmp joins for a multicast group address multi-group-addressA.
4107 5. Send multicast data traffic for a group (multi-group-addressA) from other uni port on ONU.
4108 6. Verify that multicast data packets are being recieved on join sent uni port on ONU to cord-tester.
4109 """
4110
4111 def test_subscriber_with_voltha_for_igmp_leave_verify_traffic(self):
4112 """
4113 Test Method:
4114 0. Make sure that voltha is up and running on CORD-POD setup.
4115 1. OLT and ONU is detected and validated.
4116 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4117 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity.
4118 4. Send igmp joins for a multicast group address multi-group-addressA.
4119 5. Send multicast data traffic for a group (multi-group-addressA) from other uni port on ONU.
4120 6. Verify that multicast data packets are being recieved on join received uni port on ONU to cord-tester.
4121 7. Send igmp leave for a multicast group address multi-group-addressA.
4122 8. Verify that multicast data packets are not being recieved on leave sent uni port on ONU to cord-tester.
4123 """
4124 def test_subscriber_with_voltha_for_igmp_leave_and_again_join_verify_traffic(self):
4125 """
4126 Test Method:
4127 0. Make sure that voltha is up and running on CORD-POD setup.
4128 1. OLT and ONU is detected and validated.
4129 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4130 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity.
4131 4. Send igmp joins for a multicast group address multi-group-addressA.
4132 5. Send multicast data traffic for a group (multi-group-addressA) from other uni port on ONU.
4133 6. Verify that multicast data packets are being recieved on join received uni port on ONU to cord-tester.
4134 7. Send igmp leave for a multicast group address multi-group-addressA.
4135 8. Verify that multicast data packets are not being recieved on leave sent uni port on ONU to cord-tester.
4136 9. Repeat steps 4 to 6.
4137 """
4138
4139 def test_subscriber_with_voltha_for_igmp_2_groups_joins_verify_traffic(self):
4140 """
4141 Test Method:
4142 0. Make sure that voltha is up and running on CORD-POD setup.
4143 1. OLT and ONU is detected and validated.
4144 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4145 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity.
4146 4. Send igmp joins for multicast group addresses multi-group-addressA,multi-group-addressB
4147 5. Send multicast data traffic for two groups (multi-group-addressA and multi-group-addressB) from other uni port on ONU.
4148 6. Verify that 2 groups multicast data packets are being recieved on join sent uni port on ONU to cord-tester.
4149 """
4150
4151 def test_subscriber_with_voltha_for_igmp_2_groups_joins_and_leave_for_one_group_verify_traffic(self):
4152 """
4153 Test Method:
4154 0. Make sure that voltha is up and running on CORD-POD setup.
4155 1. OLT and ONU is detected and validated.
4156 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4157 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity.
4158 4. Send igmp joins for multicast group addresses multi-group-addressA,multi-group-addressB
4159 5. Send multicast data traffic for two groups (multi-group-addressA and multi-group-addressB) from other uni port on ONU.
4160 6. Verify that 2 groups multicast data packets are being recieved on join sent uni port on ONU to cord-tester.
4161 7. Send igmp leave for a multicast group address multi-group-addressA.
4162 8. Verify that multicast data packets of group(multi-group-addressA) are not being recieved on leave sent uni port on ONU to cord-tester.
4163 9. Verify that multicast data packets of group (multi-group-addressB) are being recieved on join sent uni port on ONU to cord-tester.
4164 """
4165
4166 def test_subscriber_with_voltha_for_igmp_join_different_group_src_list_verify_traffic(self):
4167 """
4168 Test Method:
4169 0. Make sure that voltha is up and running on CORD-POD setup.
4170 1. OLT and ONU is detected and validated.
4171 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4172 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity.
4173 4. Send igmp joins for a multicast group address multi-group-addressA with source list src_listA
4174 5. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listA on ONU.
4175 6. Verify that multicast data packets are being recieved on join sent uni port on ONU to cord-tester.
4176 7. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listB on ONU.
4177 8. Verify that multicast data packets are not being recieved on join sent uni port on ONU from other source list to cord-tester.
4178 """
4179
4180 def test_subscriber_with_voltha_for_igmp_change_to_exclude_src_list_verify_traffic(self):
4181 """
4182 Test Method:
4183 0. Make sure that voltha is up and running on CORD-POD setup.
4184 1. OLT and ONU is detected and validated.
4185 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4186 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity.
4187 4. Send igmp joins for a multicast group address multi-group-addressA with source list src_listA
4188 5. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listA on ONU.
4189 6. Verify that multicast data packets are being recieved on join sent uni port on ONU to cord-tester.
4190 7. Send igmp joins for a multicast group address multi-group-addressA with exclude source list src_listA
4191 8. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listA on ONU.
4192 9. Verify that multicast data packets are not being recieved on join sent uni port on ONU from other source list to cord-tester.
4193 """
4194
4195 def test_subscriber_with_voltha_for_igmp_change_to_allow_src_list_verify_traffic(self):
4196 """
4197 Test Method:
4198 0. Make sure that voltha is up and running on CORD-POD setup.
4199 1. OLT and ONU is detected and validated.
4200 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4201 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity.
4202 4. Send igmp joins for a multicast group address multi-group-addressA with source exclude list src_listA
4203 5. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listA on ONU.
4204 6. Verify that multicast data packets are not being recieved on join sent uni port on ONU to cord-tester.
4205 7. Send igmp joins for a multicast group address multi-group-addressA with allow source list src_listA
4206 8. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listA on ONU.
4207 9. Verify that multicast data packets are being recieved on join sent uni port on ONU from other source list to cord-tester.
4208 """
4209
4210 def test_subscriber_with_voltha_for_igmp_change_to_block_src_list_verify_traffic(self):
4211 """
4212 Test Method:
4213 0. Make sure that voltha is up and running on CORD-POD setup.
4214 1. OLT and ONU is detected and validated.
4215 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4216 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity.
4217 4. Send igmp joins for a multicast group address multi-group-addressA with source list src_listA
4218 5. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listA on ONU.
4219 6. Verify that multicast data packets are being recieved on join sent uni port on ONU to cord-tester.
4220 7. Send igmp joins for a multicast group address multi-group-addressA with block source list src_listA
4221 8. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listA on ONU.
4222 9. Verify that multicast data packets are not being recieved on join sent uni port on ONU from other source list to cord-tester.
4223 """
4224 def test_subscriber_with_voltha_for_igmp_allow_new_src_list_verify_traffic(self):
4225 """
4226 Test Method:
4227 0. Make sure that voltha is up and running on CORD-POD setup.
4228 1. OLT and ONU is detected and validated.
4229 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4230 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity.
4231 4. Send igmp joins for a multicast group address multi-group-addressA with source exclude list src_listA
4232 5. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listA on ONU.
4233 6. Verify that multicast data packets are being recieved on join sent uni port on ONU to cord-tester.
4234 7. Send igmp joins for a multicast group address multi-group-addressA with allow new source list src_listB
4235 8. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listB on ONU.
4236 9. Verify that multicast data packets are being recieved on join sent uni port on ONU from other source list to cord-tester.
4237 """
4238 def test_subscriber_with_voltha_for_igmp_include_empty_src_list_verify_traffic(self):
4239 """
4240 Test Method:
4241 0. Make sure that voltha is up and running on CORD-POD setup.
4242 1. OLT and ONU is detected and validated.
4243 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4244 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity.
4245 4. Send igmp joins for a multicast group address multi-group-addressA with source exclude list src_listA
4246 5. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listA on ONU.
4247 6. Verify that multicast data packets are not being recieved on join sent uni port on ONU to cord-tester.
4248 7. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listB on ONU.
4249 8. Verify that multicast data packets are not being recieved on join sent uni port on ONU from other source list to cord-tester.
4250 """
4251 def test_subscribers_with_voltha_for_igmp_exclude_empty_src_list_and_verify_traffic(self):
4252 """
4253 Test Method:
4254 0. Make sure that voltha is up and running on CORD-POD setup.
4255 1. OLT and ONU is detected and validated.
4256 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4257 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity.
4258 4. Send igmp joins for a multicast group address multi-group-addressA with source exclude list src_listA
4259 5. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listA on ONU.
4260 6. Verify that multicast data packets are being recieved on join sent uni port on ONU to cord-tester.
4261 7. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listB on ONU.
4262 8. Verify that multicast data packets are being recieved on join sent uni port on ONU from other source list to cord-tester.
4263 """
4264
4265 def test_two_subscribers_with_voltha_for_igmp_join_and_verifying_traffic(self):
4266 """
4267 Test Method:
4268 0. Make sure that voltha is up and running on CORD-POD setup.
4269 1. OLT and ONU is detected and validated.
4270 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4271 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity.
4272 4. Send igmp joins for a multicast group address multi-group-addressA from one subscribers (uni_1 port)
4273 5. Send igmp joins for a multicast group address multi-group-addressB from other subscribers ( uni_2 port)
4274 6. Send multicast data traffic for a group (multi-group-addressA) from other uni_3 port on ONU.
4275 7. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester.
4276 8. Verify that multicast data packets are not being recieved on join sent uni (uni_2) port on ONU to cord-tester.
4277 """
4278
4279 def test_two_subscribers_with_voltha_for_igmp_join_leave_for_one_subscriber_verifying_traffic(self):
4280 """
4281 Test Method:
4282 0. Make sure that voltha is up and running on CORD-POD setup.
4283 1. OLT and ONU is detected and validated.
4284 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4285 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity.
4286 4. Send igmp joins for a multicast group address multi-group-addressA from one subscribers (uni_1 port)
4287 5. Send igmp joins for a multicast group address multi-group-addressA from other subscribers ( uni_2 port)
4288 6. Send multicast data traffic for a group (multi-group-addressA) from other uni_3 port on ONU.
4289 7. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester.
4290 8. Verify that multicast data packets are being recieved on join sent uni (uni_2) port on ONU to cord-tester.
4291 9. Send igmp leave for a multicast group address multi-group-addressA from other subscribers ( uni_2 port)
4292 10. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester.
4293 11. Verify that multicast data packets are not being recieved on join sent uni (uni_2) port on ONU to cord-tester.
4294 """
4295
4296 def test_two_subscribers_with_voltha_for_igmp_leave_join_for_one_subscriber_and_verifying_traffic(self):
4297 """
4298 Test Method:
4299 0. Make sure that voltha is up and running on CORD-POD setup.
4300 1. OLT and ONU is detected and validated.
4301 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4302 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity.
4303 4. Send igmp joins for a multicast group address multi-group-addressA from one subscribers (uni_1 port)
4304 5. Send igmp leave for a multicast group address multi-group-addressB from other subscribers ( uni_2 port)
4305 6. Send multicast data traffic for a group (multi-group-addressA) from other uni_3 port on ONU.
4306 7. Verify that multicast group adress (multi-group-addressA) data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester.
4307 8. Verify that multicast group adress (multi-group-addressB) data packets are not being recieved on join sent uni (uni_2) port on ONU to cord-tester.
4308 9. Send igmp join for a multicast group address multi-group-addressA from other subscribers ( uni_2 port)
4309 10. Verify that multicast of group (multi-group-addressA) data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester.
4310 11. Verify that multicast of group (multi-group-addressA) data packets are being recieved on join sent uni (uni_2) port on ONU to cord-tester.
4311 12. Verify that multicast of group (multi-group-addressB) data packets are not being recieved on join sent uni (uni_2) port on ONU to cord-tester.
4312 """
4313
4314 def test_two_subscribers_with_voltha_for_igmp_with_uni_port_down_for_one_subscriber_and_verifying_traffic(self):
4315 """
4316 Test Method:
4317 0. Make sure that voltha is up and running on CORD-POD setup.
4318 1. OLT and ONU is detected and validated.
4319 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4320 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity.
4321 4. Send igmp joins for a multicast group address multi-group-addressA from one subscribers (uni_1 port)
4322 5. Send igmp joins for a multicast group address multi-group-addressA from other subscribers ( uni_2 port)
4323 6. Send multicast data traffic for a group (multi-group-addressA) from other uni_3 port on ONU.
4324 7. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester.
4325 8. Verify that multicast data packets are being recieved on join sent uni (uni_2) port on ONU to cord-tester.
4326 9. Disable uni_2 port which is being shown on voltha CLI.
4327 10. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester.
4328 11. Verify that multicast data packets are not being recieved on join sent uni (uni_2) port on ONU to cord-tester.
4329 """
4330 def test_two_subscribers_with_voltha_for_igmp_toggling_uni_port_for_one_subscriber_and_verifying_traffic(self):
4331 """
4332 Test Method:
4333 0. Make sure that voltha is up and running on CORD-POD setup.
4334 1. OLT and ONU is detected and validated.
4335 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4336 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity.
4337 4. Send igmp joins for a multicast group address multi-group-addressA from one subscribers (uni_1 port)
4338 5. Send igmp joins for a multicast group address multi-group-addressA from other subscribers ( uni_2 port)
4339 6. Send multicast data traffic for a group (multi-group-addressA) from other uni_3 port on ONU.
4340 7. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester.
4341 8. Verify that multicast data packets are being recieved on join sent uni (uni_2) port on ONU to cord-tester.
4342 9. Disable uni_2 port which is being shown on voltha CLI.
4343 10. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester.
4344 11. Verify that multicast data packets are not being recieved on join sent uni (uni_2) port on ONU to cord-tester.
4345 12. Enable uni_2 port which we disable at step 9.
4346 13. Repeat step 5,6 and 8.
4347 """
4348 def test_two_subscribers_with_voltha_for_igmp_disabling_olt_and_verifying_traffic(self):
4349 """
4350 Test Method:
4351 0. Make sure that voltha is up and running on CORD-POD setup.
4352 1. OLT and ONU is detected and validated.
4353 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4354 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity.
4355 4. Send igmp joins for a multicast group address multi-group-addressA from one subscribers (uni_1 port)
4356 5. Send igmp joins for a multicast group address multi-group-addressA from other subscribers ( uni_2 port)
4357 6. Send multicast data traffic for a group (multi-group-addressA) from other uni_3 port on ONU.
4358 7. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester.
4359 8. Verify that multicast data packets are being recieved on join sent uni (uni_2) port on ONU to cord-tester.
4360 9. Disable olt device which is being shown on voltha CLI.
4361 10. Verify that multicast data packets are not being recieved on join sent uni (uni_1) port on ONU to cord-tester.
4362 11. Verify that multicast data packets are not being recieved on join sent uni (uni_2) port on ONU to cord-tester.
4363 """
4364 def test_two_subscribers_with_voltha_for_igmp_pausing_olt_and_verifying_traffic(self):
4365 """
4366 Test Method:
4367 0. Make sure that voltha is up and running on CORD-POD setup.
4368 1. OLT and ONU is detected and validated.
4369 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4370 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity.
4371 4. Send igmp joins for a multicast group address multi-group-addressA from one subscribers (uni_1 port)
4372 5. Send igmp joins for a multicast group address multi-group-addressA from other subscribers ( uni_2 port)
4373 6. Send multicast data traffic for a group (multi-group-addressA) from other uni_3 port on ONU.
4374 7. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester.
4375 8. Verify that multicast data packets are being recieved on join sent uni (uni_2) port on ONU to cord-tester.
4376 9. Pause olt device which is being shown on voltha CLI.
4377 10. Verify that multicast data packets are not being recieved on join sent uni (uni_1) port on ONU to cord-tester.
4378 11. Verify that multicast data packets are not being recieved on join sent uni (uni_2) port on ONU to cord-tester.
4379 """
4380 def test_two_subscribers_with_voltha_for_igmp_toggling_olt_and_verify_traffic(self):
4381 """
4382 Test Method:
4383 0. Make sure that voltha is up and running on CORD-POD setup.
4384 1. OLT and ONU is detected and validated.
4385 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4386 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity.
4387 4. Send igmp joins for a multicast group address multi-group-addressA from one subscribers (uni_1 port)
4388 5. Send igmp joins for a multicast group address multi-group-addressA from other subscribers ( uni_2 port)
4389 6. Send multicast data traffic for a group (multi-group-addressA) from other uni_3 port on ONU.
4390 7. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester.
4391 8. Verify that multicast data packets are being recieved on join sent uni (uni_2) port on ONU to cord-tester.
4392 9. Disable olt device which is being shown on voltha CLI.
4393 10. Verify that multicast data packets are not being recieved on join sent uni (uni_1) port on ONU to cord-tester.
4394 11. Verify that multicast data packets are not being recieved on join sent uni (uni_2) port on ONU to cord-tester.
4395 12. Enable olt device which is disable at step 9.
4396 13. Repeat steps 4,5, 7 and 8.
4397 """
4398