blob: 191af712e0a14ef917453a691b4147e18b8265b0 [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
Thangavelu K S8e413082017-07-13 20:02:14 +00008from IGMP import *
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00009from random import randint
10from threading import Timer
Thangavelu K S36edb012017-07-05 18:24:12 +000011from threadPool import ThreadPool
A R Karthick35495c32017-05-11 14:58:32 -070012from nose.tools import *
Thangavelu K S77c8c0c2017-06-07 18:04:21 +000013from nose.twistedtools import reactor, deferred
14from twisted.internet import defer
A R Karthick9dc6e922017-07-12 14:40:16 -070015from CordTestConfig import setup_module, teardown_module
A R Karthick35495c32017-05-11 14:58:32 -070016from CordTestUtils import log_test
17from VolthaCtrl import VolthaCtrl
Thangavelu K S77c8c0c2017-06-07 18:04:21 +000018from CordTestUtils import log_test, get_controller
19from portmaps import g_subscriber_port_map
20from OltConfig import *
21from EapTLS import TLSAuthTest
Thangavelu K S8e413082017-07-13 20:02:14 +000022from Channels import Channels, IgmpChannel
23from Stats import Stats
Thangavelu K Sa1c71b42017-06-14 18:13:21 +000024from DHCP import DHCPTest
Thangavelu K S77c8c0c2017-06-07 18:04:21 +000025from OnosCtrl import OnosCtrl
26from CordLogger import CordLogger
27from scapy.all import *
28from scapy_ssl_tls.ssl_tls import *
29from scapy_ssl_tls.ssl_tls_crypto import *
30from CordTestServer import cord_test_onos_restart, cord_test_shell, cord_test_radius_restart
A.R Karthickb9eab5a2017-06-07 16:03:51 -070031from CordContainer import Onos
A R Karthick35495c32017-05-11 14:58:32 -070032
Thangavelu K S36edb012017-07-05 18:24:12 +000033
Thangavelu K S8e413082017-07-13 20:02:14 +000034class Voltha_olt_subscribers(Channels):
Thangavelu K S36edb012017-07-05 18:24:12 +000035
Thangavelu K S8e413082017-07-13 20:02:14 +000036 STATS_JOIN = 2
37 STATS_LEAVE = 3
38
39
40 def __init__(self, tx_port, rx_port, num_channels =1, channel_start = 0, src_list = None):
41 self.tx_port = tx_port
42 self.rx_port = rx_port
43 self.src_list = src_list
Thangavelu K S36edb012017-07-05 18:24:12 +000044 try:
Thangavelu K S8e413082017-07-13 20:02:14 +000045 self.tx_intf = tx_port
46 self.rx_intf = rx_port
Thangavelu K S36edb012017-07-05 18:24:12 +000047 except:
48 self.tx_intf = self.INTF_TX_DEFAULT
49 self.rx_intf = self.INTF_RX_DEFAULT
Thangavelu K S8e413082017-07-13 20:02:14 +000050# num = 1
51# channel_start = 0
Thangavelu K S36edb012017-07-05 18:24:12 +000052 mcast_cb = None
Thangavelu K S8e413082017-07-13 20:02:14 +000053 Channels.__init__(self, num_channels, channel_start = channel_start, src_list = src_list,
Thangavelu K S36edb012017-07-05 18:24:12 +000054 iface = self.rx_intf, iface_mcast = self.tx_intf, mcast_cb = mcast_cb)
55
Thangavelu K S8e413082017-07-13 20:02:14 +000056 self.loginType = 'wireless'
Thangavelu K S36edb012017-07-05 18:24:12 +000057 ##start streaming channels
58 self.join_map = {}
59 ##accumulated join recv stats
60 self.join_rx_stats = Stats()
61 self.recv_timeout = False
62
63
64 def channel_join_update(self, chan, join_time):
65 self.join_map[chan] = ( Stats(), Stats(), Stats(), Stats() )
66 self.channel_update(chan, self.STATS_JOIN, 1, t = join_time)
67
Thangavelu K S8e413082017-07-13 20:02:14 +000068 def channel_join(self, chan = 0, delay = 2, src_list = None, record_type = None):
Thangavelu K S36edb012017-07-05 18:24:12 +000069 '''Join a channel and create a send/recv stats map'''
70 if self.join_map.has_key(chan):
71 del self.join_map[chan]
72 self.delay = delay
Thangavelu K S8e413082017-07-13 20:02:14 +000073 chan, join_time = self.join(chan, src_list = src_list, record_type = record_type)
74 #chan, join_time = self.join(chan)
Thangavelu K S36edb012017-07-05 18:24:12 +000075 self.channel_join_update(chan, join_time)
76 return chan
77
78 def channel_join_next(self, delay = 2, leave_flag = True):
79 '''Joins the next channel leaving the last channel'''
80 if self.last_chan:
81 if self.join_map.has_key(self.last_chan):
82 del self.join_map[self.last_chan]
83 self.delay = delay
84 chan, join_time = self.join_next(leave_flag = leave_flag)
85 self.channel_join_update(chan, join_time)
86 return chan
87
88 def channel_jump(self, delay = 2):
89 '''Jumps randomly to the next channel leaving the last channel'''
90 if self.last_chan is not None:
91 if self.join_map.has_key(self.last_chan):
92 del self.join_map[self.last_chan]
93 self.delay = delay
94 chan, join_time = self.jump()
95 self.channel_join_update(chan, join_time)
96 return chan
97
Thangavelu K S8e413082017-07-13 20:02:14 +000098 def channel_leave(self, chan = 0, force = False, src_list = None):
Thangavelu K S36edb012017-07-05 18:24:12 +000099 if self.join_map.has_key(chan):
100 del self.join_map[chan]
Thangavelu K S8e413082017-07-13 20:02:14 +0000101 self.leave(chan, force = force, src_list = src_list)
Thangavelu K S36edb012017-07-05 18:24:12 +0000102
103 def channel_update(self, chan, stats_type, packets, t=0):
104 if type(chan) == type(0):
105 chan_list = (chan,)
106 else:
107 chan_list = chan
108 for c in chan_list:
109 if self.join_map.has_key(c):
110 self.join_map[c][stats_type].update(packets = packets, t = t)
111
Thangavelu K S8e413082017-07-13 20:02:14 +0000112 def channel_receive(self, chan, cb = None, count = 1, timeout = 5, src_list = None):
113 log_test.info('Subscriber on port %s receiving from group %s, channel %d' %
114 (self.rx_intf, self.gaddr(chan), chan))
115 r = self.recv(chan, cb = cb, count = count, timeout = timeout, src_list = src_list)
Thangavelu K S36edb012017-07-05 18:24:12 +0000116 if len(r) == 0:
Thangavelu K S8e413082017-07-13 20:02:14 +0000117 log_test.info('Subscriber on port %s timed out' %( self.rx_intf))
118 self.test_status = False
Thangavelu K S36edb012017-07-05 18:24:12 +0000119 else:
Thangavelu K S8e413082017-07-13 20:02:14 +0000120 log_test.info('Subscriber on port %s received %d packets' %(self.rx_intf, len(r)))
Thangavelu K S36edb012017-07-05 18:24:12 +0000121 if self.recv_timeout:
122 ##Negative test case is disabled for now
123 assert_equal(len(r), 0)
Thangavelu K S8e413082017-07-13 20:02:14 +0000124 return self.test_status
Thangavelu K S36edb012017-07-05 18:24:12 +0000125
Thangavelu K S8e413082017-07-13 20:02:14 +0000126 def recv_channel_cb(self, pkt, src_list = None):
127
Thangavelu K S36edb012017-07-05 18:24:12 +0000128 ##First verify that we have received the packet for the joined instance
Thangavelu K S8e413082017-07-13 20:02:14 +0000129 log_test.info('Packet received for group %s, subscriber, port %s' %
130 (pkt[IP].dst, self.rx_intf))
Thangavelu K S36edb012017-07-05 18:24:12 +0000131 if self.recv_timeout:
132 return
133 chan = self.caddr(pkt[IP].dst)
134 assert_equal(chan in self.join_map.keys(), True)
135 recv_time = monotonic.monotonic() * 1000000
136 join_time = self.join_map[chan][self.STATS_JOIN].start
137 delta = recv_time - join_time
138 self.join_rx_stats.update(packets=1, t = delta, usecs = True)
139 self.channel_update(chan, self.STATS_RX, 1, t = delta)
140 log_test.debug('Packet received in %.3f usecs for group %s after join' %(delta, pkt[IP].dst))
141
Thangavelu K S36edb012017-07-05 18:24:12 +0000142class voltha_subscriber_pool:
143
144 def __init__(self, subscriber, test_cbs):
145 self.subscriber = subscriber
146 self.test_cbs = test_cbs
147
148 def pool_cb(self):
149 for cb in self.test_cbs:
150 if cb:
Thangavelu K S8e413082017-07-13 20:02:14 +0000151 self.test_status = cb(self.subscriber, multiple_sub = True)
Thangavelu K S36edb012017-07-05 18:24:12 +0000152 if self.test_status is not True:
153 ## This is chaning for other sub status has to check again
154 self.test_status = True
155 log_test.info('This service is failed and other services will not run for this subscriber')
156 break
157 log_test.info('This Subscriber is tested for multiple service eligibility ')
158 self.test_status = True
159
A R Karthick35495c32017-05-11 14:58:32 -0700160class voltha_exchange(unittest.TestCase):
161
162 OLT_TYPE = 'tibit_olt'
163 OLT_MAC = '00:0c:e2:31:12:00'
164 VOLTHA_HOST = 'localhost'
165 VOLTHA_REST_PORT = 8881
Thangavelu K S36edb012017-07-05 18:24:12 +0000166 VOLTHA_OLT_TYPE = 'ponsim_olt'
167 VOLTHA_OLT_MAC = '00:0c:e2:31:12:00'
168 VOLTHA_IGMP_ITERATIONS = 100
A R Karthick35495c32017-05-11 14:58:32 -0700169 voltha = None
Thangavelu K S9648eed2017-06-13 20:15:25 +0000170 success = True
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000171 apps = ('org.opencord.aaa', 'org.onosproject.dhcp')
172 olt_apps = () #'org.opencord.cordmcast')
173 vtn_app = 'org.opencord.vtn'
174 table_app = 'org.ciena.cordigmp'
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000175 test_path = os.path.dirname(os.path.realpath(__file__))
176 table_app_file = os.path.join(test_path, '..', 'apps/ciena-cordigmp-multitable-2.0-SNAPSHOT.oar')
A.R Karthickb9eab5a2017-06-07 16:03:51 -0700177 app_file = os.path.join(test_path, '..', 'apps/ciena-cordigmp-2.0-SNAPSHOT.oar')
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000178 olt_app_file = os.path.join(test_path, '..', 'apps/olt-app-1.2-SNAPSHOT.oar')
A.R Karthick3493a572017-06-07 18:28:10 -0700179 olt_app_name = 'org.onosproject.olt'
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000180 #onos_config_path = os.path.join(test_path, '..', 'setup/onos-config')
181 olt_conf_file = os.getenv('OLT_CONFIG_FILE', os.path.join(test_path, '..', 'setup/olt_config.json'))
182 onos_restartable = bool(int(os.getenv('ONOS_RESTART', 0)))
A R Karthick9dc6e922017-07-12 14:40:16 -0700183 VOLTHA_AUTO_CONFIGURE = False
Thangavelu K S8e413082017-07-13 20:02:14 +0000184 num_joins = 0
185
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000186 VOLTHA_ENABLED = True
187 INTF_TX_DEFAULT = 'veth2'
188 INTF_RX_DEFAULT = 'veth0'
Thangavelu K S9648eed2017-06-13 20:15:25 +0000189 INTF_2_RX_DEFAULT = 'veth6'
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000190 TESTCASE_TIMEOUT = 300
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +0000191# VOLTHA_CONFIG_FAKE = True
192 VOLTHA_CONFIG_FAKE = False
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000193 VOLTHA_UPLINK_VLAN_MAP = { 'of:0000000000000001' : '222' }
194 VOLTHA_ONU_UNI_PORT = 'veth0'
195
Thangavelu K Sa1c71b42017-06-14 18:13:21 +0000196 dhcp_server_config = {
197 "ip": "10.1.11.50",
198 "mac": "ca:fe:ca:fe:ca:fe",
199 "subnet": "255.255.252.0",
200 "broadcast": "10.1.11.255",
201 "router": "10.1.8.1",
202 "domain": "8.8.8.8",
203 "ttl": "63",
204 "delay": "2",
205 "startip": "10.1.11.51",
206 "endip": "10.1.11.100"
207 }
208
209
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000210 CLIENT_CERT = """-----BEGIN CERTIFICATE-----
211MIICuDCCAiGgAwIBAgIBAjANBgkqhkiG9w0BAQUFADCBizELMAkGA1UEBhMCVVMx
212CzAJBgNVBAgTAkNBMRIwEAYDVQQHEwlTb21ld2hlcmUxEzARBgNVBAoTCkNpZW5h
213IEluYy4xHjAcBgkqhkiG9w0BCQEWD2FkbWluQGNpZW5hLmNvbTEmMCQGA1UEAxMd
214RXhhbXBsZSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMTYwNjA2MjExMjI3WhcN
215MTcwNjAxMjExMjI3WjBnMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExEzARBgNV
216BAoTCkNpZW5hIEluYy4xFzAVBgNVBAMUDnVzZXJAY2llbmEuY29tMR0wGwYJKoZI
217hvcNAQkBFg51c2VyQGNpZW5hLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkC
218gYEAwvXiSzb9LZ6c7uNziUfKvoHO7wu/uiFC5YUpXbmVGuGZizbVrny0xnR85Dfe
219+9R4diansfDhIhzOUl1XjN3YDeSS9OeF5YWNNE8XDhlz2d3rVzaN6hIhdotBkUjg
220rUewjTg5OFR31QEyG3v8xR3CLgiE9xQELjZbSA07pD79zuUCAwEAAaNPME0wEwYD
221VR0lBAwwCgYIKwYBBQUHAwIwNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL3d3dy5l
222eGFtcGxlLmNvbS9leGFtcGxlX2NhLmNybDANBgkqhkiG9w0BAQUFAAOBgQDAjkrY
2236tDChmKbvr8w6Du/t8vHjTCoCIocHTN0qzWOeb1YsAGX89+TrWIuO1dFyYd+Z0KC
224PDKB5j/ygml9Na+AklSYAVJIjvlzXKZrOaPmhZqDufi+rXWti/utVqY4VMW2+HKC
225nXp37qWeuFLGyR1519Y1d6F/5XzqmvbwURuEug==
226-----END CERTIFICATE-----"""
227
228 CLIENT_CERT_INVALID = '''-----BEGIN CERTIFICATE-----
229MIIDvTCCAqWgAwIBAgIBAjANBgkqhkiG9w0BAQUFADCBizELMAkGA1UEBhMCVVMx
230CzAJBgNVBAgTAkNBMRIwEAYDVQQHEwlTb21ld2hlcmUxEzARBgNVBAoTCkNpZW5h
231IEluYy4xHjAcBgkqhkiG9w0BCQEWD2FkbWluQGNpZW5hLmNvbTEmMCQGA1UEAxMd
232RXhhbXBsZSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMTYwMzExMTg1MzM2WhcN
233MTcwMzA2MTg1MzM2WjBnMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExEzARBgNV
234BAoTCkNpZW5hIEluYy4xFzAVBgNVBAMUDnVzZXJAY2llbmEuY29tMR0wGwYJKoZI
235hvcNAQkBFg51c2VyQGNpZW5hLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC
236AQoCggEBAOxemcBsPn9tZsCa5o2JA6sQDC7A6JgCNXXl2VFzKLNNvB9PS6D7ZBsQ
2375An0zEDMNzi51q7lnrYg1XyiE4S8FzMGAFr94RlGMQJUbRD9V/oqszMX4k++iAOK
238tIA1gr3x7Zi+0tkjVSVzXTmgNnhChAamdMsjYUG5+CY9WAicXyy+VEV3zTphZZDR
239OjcjEp4m/TSXVPYPgYDXI40YZKX5BdvqykWtT/tIgZb48RS1NPyN/XkCYzl3bv21
240qx7Mc0fcEbsJBIIRYTUkfxnsilcnmLxSYO+p+DZ9uBLBzcQt+4Rd5pLSfi21WM39
2412Z2oOi3vs/OYAPAqgmi2JWOv3mePa/8CAwEAAaNPME0wEwYDVR0lBAwwCgYIKwYB
242BQUHAwIwNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL3d3dy5leGFtcGxlLmNvbS9l
243eGFtcGxlX2NhLmNybDANBgkqhkiG9w0BAQUFAAOCAQEALBzMPDTIB6sLyPl0T6JV
244MjOkyldAVhXWiQsTjaGQGJUUe1cmUJyZbUZEc13MygXMPOM4x7z6VpXGuq1c/Vxn
245VzQ2fNnbJcIAHi/7G8W5/SQfPesIVDsHTEc4ZspPi5jlS/MVX3HOC+BDbOjdbwqP
246RX0JEr+uOyhjO+lRxG8ilMRACoBUbw1eDuVDoEBgErSUC44pq5ioDw2xelc+Y6hQ
247dmtYwfY0DbvwxHtA495frLyPcastDiT/zre7NL51MyUDPjjYjghNQEwvu66IKbQ3
248T1tJBrgI7/WI+dqhKBFolKGKTDWIHsZXQvZ1snGu/FRYzg1l+R/jT8cRB9BDwhUt
249yg==
250-----END CERTIFICATE-----'''
A R Karthick35495c32017-05-11 14:58:32 -0700251
A.R Karthick3493a572017-06-07 18:28:10 -0700252 @classmethod
253 def update_apps_version(cls):
254 version = Onos.getVersion()
255 major = int(version.split('.')[0])
256 minor = int(version.split('.')[1])
257 cordigmp_app_version = '2.0-SNAPSHOT'
258 olt_app_version = '1.2-SNAPSHOT'
259 if major > 1:
260 cordigmp_app_version = '3.0-SNAPSHOT'
261 olt_app_version = '2.0-SNAPSHOT'
262 elif major == 1:
263 if minor > 10:
264 cordigmp_app_version = '3.0-SNAPSHOT'
265 olt_app_version = '2.0-SNAPSHOT'
266 elif minor <= 8:
267 olt_app_version = '1.1-SNAPSHOT'
A.R Karthickb9eab5a2017-06-07 16:03:51 -0700268 cls.app_file = os.path.join(cls.test_path, '..', 'apps/ciena-cordigmp-{}.oar'.format(cordigmp_app_version))
269 cls.table_app_file = os.path.join(cls.test_path, '..', 'apps/ciena-cordigmp-multitable-{}.oar'.format(cordigmp_app_version))
270 cls.olt_app_file = os.path.join(cls.test_path, '..', 'apps/olt-app-{}.oar'.format(olt_app_version))
271
A R Karthick35495c32017-05-11 14:58:32 -0700272 @classmethod
A.R Karthickf874d032017-06-07 18:47:51 -0700273 def onos_load_config(cls, app, config):
274 status, code = OnosCtrl.config(config)
275 if status is False:
276 log_test.info('JSON config request for app %s returned status %d' %(app, code))
277 assert_equal(status, True)
278 time.sleep(2)
279
280 @classmethod
281 def onos_aaa_load(cls):
282 aaa_dict = {'apps' : { 'org.opencord.aaa' : { 'AAA' : { 'radiusSecret': 'radius_password',
283 'radiusIp': '172.17.0.2' } } } }
284 radius_ip = os.getenv('ONOS_AAA_IP') or '172.17.0.2'
285 aaa_dict['apps']['org.opencord.aaa']['AAA']['radiusIp'] = radius_ip
286 cls.onos_load_config('org.opencord.aaa', aaa_dict)
287
288 @classmethod
Thangavelu K Sa1c71b42017-06-14 18:13:21 +0000289 def onos_dhcp_table_load(self, config = None):
290 dhcp_dict = {'apps' : { 'org.onosproject.dhcp' : { 'dhcp' : copy.copy(self.dhcp_server_config) } } }
291 dhcp_config = dhcp_dict['apps']['org.onosproject.dhcp']['dhcp']
292 if config:
293 for k in config.keys():
294 if dhcp_config.has_key(k):
295 dhcp_config[k] = config[k]
296 self.onos_load_config('org.onosproject.dhcp', dhcp_dict)
297
Thangavelu K S36edb012017-07-05 18:24:12 +0000298 def dhcp_sndrcv(self, dhcp, update_seed = False, mac = None, validation = None):
Thangavelu K Se6c77c72017-06-23 21:28:48 +0000299 if validation:
Thangavelu K S735a6662017-06-15 18:08:23 +0000300 cip, sip = dhcp.discover(mac = mac, update_seed = update_seed)
301 assert_not_equal(cip, None)
302 assert_not_equal(sip, None)
303 log_test.info('Got dhcp client IP %s from server %s for mac %s' %
304 (cip, sip, dhcp.get_mac(cip)[0]))
305 if validation == False:
306 cip, sip = dhcp.discover(mac = mac, update_seed = update_seed)
307 assert_equal(cip, None)
308 assert_equal(sip, None)
Thangavelu K Se6c77c72017-06-23 21:28:48 +0000309 log_test.info('Dhcp client did not get IP from server')
Thangavelu K S735a6662017-06-15 18:08:23 +0000310
Thangavelu K S36edb012017-07-05 18:24:12 +0000311 if validation == 'skip':
312 cip, sip = dhcp.discover(mac = mac, update_seed = update_seed)
313
Thangavelu K Sa1c71b42017-06-14 18:13:21 +0000314 return cip,sip
315
Thangavelu K S36edb012017-07-05 18:24:12 +0000316 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):
317 config = {'startip':startip, 'endip':'10.10.10.200',
Thangavelu K Sa1c71b42017-06-14 18:13:21 +0000318 'ip':'10.10.10.2', 'mac': "ca:fe:ca:fe:ca:fe",
319 'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'}
320 self.onos_dhcp_table_load(config)
321 dhcp = DHCPTest(seed_ip = seed_ip, iface =onu_iface)
Thangavelu K S36edb012017-07-05 18:24:12 +0000322 cip, sip = self.dhcp_sndrcv(dhcp, update_seed = update_seed, validation = validation, mac = mac)
Thangavelu K Sa1c71b42017-06-14 18:13:21 +0000323 return cip, sip
324
325 @classmethod
A R Karthick35495c32017-05-11 14:58:32 -0700326 def setUpClass(cls):
A.R Karthickb9eab5a2017-06-07 16:03:51 -0700327 cls.update_apps_version()
A R Karthick35495c32017-05-11 14:58:32 -0700328 cls.voltha = VolthaCtrl(cls.VOLTHA_HOST, rest_port = cls.VOLTHA_REST_PORT)
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000329 cls.install_app_table()
330 cls.olt = OltConfig(olt_conf_file = cls.olt_conf_file)
331 cls.port_map, cls.port_list = cls.olt.olt_port_map()
332 cls.switches = cls.port_map['switches']
Thangavelu K S36edb012017-07-05 18:24:12 +0000333 cls.ponsim_ports = cls.port_map['ponsim']
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000334 cls.num_ports = cls.port_map['num_ports']
335 if cls.num_ports > 1:
336 cls.num_ports -= 1 ##account for the tx port
337 cls.activate_apps(cls.apps + cls.olt_apps)
A.R Karthickf874d032017-06-07 18:47:51 -0700338 cls.onos_aaa_load()
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000339
A.R Karthick3493a572017-06-07 18:28:10 -0700340 @classmethod
341 def tearDownClass(cls):
342 '''Deactivate the olt apps and restart OVS back'''
343 apps = cls.olt_apps + ( cls.table_app,)
344 for app in apps:
345 onos_ctrl = OnosCtrl(app)
346 onos_ctrl.deactivate()
347 cls.install_app_igmp()
A.R Karthick3493a572017-06-07 18:28:10 -0700348 @classmethod
349 def install_app_igmp(cls):
350 ##Uninstall the table app on class exit
351 OnosCtrl.uninstall_app(cls.table_app)
352 time.sleep(2)
353 log_test.info('Installing back the cord igmp app %s for subscriber test on exit' %(cls.app_file))
354 OnosCtrl.install_app(cls.app_file)
A.R Karthickb9eab5a2017-06-07 16:03:51 -0700355
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000356 def remove_olt(self, switch_map):
357 controller = get_controller()
358 auth = ('karaf', 'karaf')
359 #remove subscriber for every port on all the voltha devices
360 for device, device_map in switch_map.iteritems():
361 uni_ports = device_map['ports']
362 uplink_vlan = device_map['uplink_vlan']
363 for port in uni_ports:
364 rest_url = 'http://{}:8181/onos/olt/oltapp/{}/{}'.format(controller,
365 device,
366 port)
367 resp = requests.delete(rest_url, auth = auth)
368 if resp.status_code not in [204, 202, 200]:
369 log_test.error('Error deleting subscriber for device %s on port %s' %(device, port))
370 else:
371 log_test.info('Deleted subscriber for device %s on port %s' %(device, port))
372 OnosCtrl.uninstall_app(self.olt_app_file)
373
374 def config_olt(self, switch_map):
375 controller = get_controller()
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000376 auth = ('karaf', 'karaf')
377 #configure subscriber for every port on all the voltha devices
378 for device, device_map in switch_map.iteritems():
379 uni_ports = device_map['ports']
380 uplink_vlan = device_map['uplink_vlan']
381 for port in uni_ports:
382 vlan = port
383 rest_url = 'http://{}:8181/onos/olt/oltapp/{}/{}/{}'.format(controller,
384 device,
385 port,
386 vlan)
387 resp = requests.post(rest_url, auth = auth)
388 #assert_equal(resp.ok, True)
389
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +0000390 def voltha_uni_port_toggle(self, uni_port = None):
391 ## Admin state of port is down and up
392 if not uni_port:
393 uni_port = self.INTF_RX_DEFAULT
394 cmd = 'ifconfig {} down'.format(uni_port)
395 os.system(cmd)
396 log_test.info('Admin state of uni_port is down')
397 time.sleep(30)
398 cmd = 'ifconfig {} up'.format(uni_port)
399 os.system(cmd)
400 log_test.info('Admin state of uni_port is up now')
401 time.sleep(30)
402 return
403
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000404 @classmethod
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000405 def install_app_table(cls):
406 ##Uninstall the existing app if any
407 OnosCtrl.uninstall_app(cls.table_app)
408 time.sleep(2)
409 log_test.info('Installing the multi table app %s for subscriber test' %(cls.table_app_file))
410 OnosCtrl.install_app(cls.table_app_file)
411 time.sleep(3)
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000412
413 @classmethod
414 def activate_apps(cls, apps):
415 for app in apps:
416 onos_ctrl = OnosCtrl(app)
417 status, _ = onos_ctrl.activate()
418 assert_equal(status, True)
419 time.sleep(2)
420
Thangavelu K S735a6662017-06-15 18:08:23 +0000421 @classmethod
422 def deactivate_apps(cls, apps):
Thangavelu K Se6c77c72017-06-23 21:28:48 +0000423 cls.success = True
Thangavelu K S735a6662017-06-15 18:08:23 +0000424 for app in apps:
425 onos_ctrl = OnosCtrl(app)
426 status, _ = onos_ctrl.deactivate()
427 if status is False:
Thangavelu K Se6c77c72017-06-23 21:28:48 +0000428 cls.success = False
429 # assert_equal(status, True)
Thangavelu K S735a6662017-06-15 18:08:23 +0000430 time.sleep(2)
431
Thangavelu K S36edb012017-07-05 18:24:12 +0000432 def random_ip(self,start_ip = '10.10.10.20', end_ip = '10.10.10.65'):
433 start = list(map(int, start_ip.split(".")))
434 end = list(map(int, end_ip.split(".")))
435 temp = start
436 ip_range = []
437 ip_range.append(start_ip)
438 while temp != end:
439 start[3] += 1
440 for i in (3, 2, 1):
441 if temp[i] == 255:
442 temp[i] = 0
443 temp[i-1] += 1
444 ip_range.append(".".join(map(str, temp)))
445 return random.choice(ip_range)
446
Thangavelu K S8e413082017-07-13 20:02:14 +0000447 def random_mcast_ip(self,start_ip = '224.0.1.0', end_ip = '224.0.1.100'):
448 start = list(map(int, start_ip.split(".")))
449 end = list(map(int, end_ip.split(".")))
450 temp = start
451 ip_range = []
452 ip_range.append(start_ip)
453 while temp != end:
454 start[3] += 1
455 for i in (3, 2, 1):
456 if temp[i] == 255:
457 temp[i] = 0
458 temp[i-1] += 1
459 ip_range.append(".".join(map(str, temp)))
460 return random.choice(ip_range)
461
462 def tls_flow_check(self, olt_ports, cert_info = None, multiple_sub = False):
463 if multiple_sub is True:
464 olt_nni_port = olt_ports.tx_port
465 olt_uni_port = olt_ports.rx_port
466 else:
Thangavelu K S36edb012017-07-05 18:24:12 +0000467 olt_uni_port = olt_ports
468
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000469 def tls_fail_cb():
470 log_test.info('TLS verification failed')
471 if cert_info is None:
A.R Karthickb9eab5a2017-06-07 16:03:51 -0700472 tls = TLSAuthTest(fail_cb = tls_fail_cb, intf = olt_uni_port)
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000473 log_test.info('Running subscriber %s tls auth test with valid TLS certificate' %olt_uni_port)
474 tls.runTest()
Thangavelu K S9648eed2017-06-13 20:15:25 +0000475 if tls.failTest is True:
476 self.success = False
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000477 assert_equal(tls.failTest, False)
478 if cert_info == "no_cert":
479 tls = TLSAuthTest(fail_cb = tls_fail_cb, intf = olt_uni_port, client_cert = '')
480 log_test.info('Running subscriber %s tls auth test with no TLS certificate' %olt_uni_port)
481 tls.runTest()
Thangavelu K S9648eed2017-06-13 20:15:25 +0000482 if tls.failTest is False:
483 self.success = False
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000484 assert_equal(tls.failTest, True)
485 if cert_info == "invalid_cert":
486 tls = TLSAuthTest(fail_cb = tls_fail_cb, intf = olt_uni_port, client_cert = self.CLIENT_CERT_INVALID)
487 log_test.info('Running subscriber %s tls auth test with invalid TLS certificate' %olt_uni_port)
488 tls.runTest()
Thangavelu K S9648eed2017-06-13 20:15:25 +0000489 if tls.failTest is False:
490 self.success = False
491 assert_equal(tls.failTest, True)
492 if cert_info == "same_cert":
493 tls = TLSAuthTest(fail_cb = tls_fail_cb, intf = olt_uni_port)
494 log_test.info('Running subscriber %s tls auth test with invalid TLS certificate' %olt_uni_port)
495 tls.runTest()
496 if tls.failTest is False:
497 self.success = False
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000498 assert_equal(tls.failTest, True)
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +0000499 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 +0000500 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 +0000501 tls = TLSAuthTest(fail_cb = tls_fail_cb, intf = olt_uni_port, client_cert = self.CLIENT_CERT_INVALID)
502 log_test.info('Running subscriber %s tls auth test with %s' %(olt_uni_port,cert_info))
503 tls.runTest()
Thangavelu K S9648eed2017-06-13 20:15:25 +0000504 if tls.failTest is False:
505 self.success = False
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +0000506 assert_equal(tls.failTest, True)
Thangavelu K S77c8c0c2017-06-07 18:04:21 +0000507 self.test_status = True
508 return self.test_status
A R Karthick35495c32017-05-11 14:58:32 -0700509
Thangavelu K S8e413082017-07-13 20:02:14 +0000510 def dhcp_flow_check(self, olt_ports, negative_test = None, multiple_sub = False):
511 if multiple_sub is True:
512 olt_nni_port = olt_ports.tx_port
513 onu_iface = olt_ports.rx_port
Thangavelu K S36edb012017-07-05 18:24:12 +0000514 dhcp_server_startip = self.random_ip()
515 random_mac = '00:00:00:0a:0a:' + hex(random.randrange(50,254)).split('x')[1]
Thangavelu K S8e413082017-07-13 20:02:14 +0000516 else:
517 onu_iface = olt_ports
518 dhcp_server_startip = '10.10.10.20'
519 random_mac = None
Thangavelu K S735a6662017-06-15 18:08:23 +0000520 self.success = True
521
Thangavelu K Sa1c71b42017-06-14 18:13:21 +0000522 if negative_test is None:
Thangavelu K S36edb012017-07-05 18:24:12 +0000523 cip, sip = self.dhcp_request(onu_iface, update_seed = True, validation = 'skip', startip = dhcp_server_startip, mac = random_mac)
524 if cip == None or sip == None:
Thangavelu K S735a6662017-06-15 18:08:23 +0000525 self.success = False
Thangavelu K S0ffd5b82017-06-21 18:01:59 +0000526 self.test_status = False
527 assert_not_equal(cip,None)
528 assert_not_equal(sip,None)
529 else:
530 log_test.info('Subscriber %s client ip %s from server %s' %(onu_iface, cip, sip))
531 self.test_status = True
Thangavelu K S735a6662017-06-15 18:08:23 +0000532
Thangavelu K S0ffd5b82017-06-21 18:01:59 +0000533 if negative_test == "interrupting_dhcp_flows":
534 cip, sip = self.dhcp_request(onu_iface, update_seed = True, validation = False)
Thangavelu K S735a6662017-06-15 18:08:23 +0000535 if cip is not None:
536 self.success = False
537 assert_equal(cip,None)
Thangavelu K S0ffd5b82017-06-21 18:01:59 +0000538 log_test.info('Subscriber %s not got client ip %s from server' %(onu_iface, cip))
Thangavelu K Sa1c71b42017-06-14 18:13:21 +0000539 self.test_status = True
540
541 if negative_test == "invalid_src_mac_broadcast":
542 config = {'startip':'10.10.10.20', 'endip':'10.10.10.69',
543 'ip':'10.10.10.2', 'mac': "ca:fe:ca:fe:ca:fe",
544 'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'}
545 self.onos_dhcp_table_load(config)
546 self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = onu_iface)
547 cip, sip, mac, _ = self.dhcp.only_discover(mac='ff:ff:ff:ff:ff:ff')
Thangavelu K S735a6662017-06-15 18:08:23 +0000548
549 if cip is not None:
550 self.success = False
551 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 +0000552 assert_equal(cip,None)
553 log_test.info('ONOS dhcp server rejected client discover with invalid source mac as expected')
554 self.test_status = True
Thangavelu K S8e413082017-07-13 20:02:14 +0000555
Thangavelu K Sa1c71b42017-06-14 18:13:21 +0000556 if negative_test == "invalid_src_mac_multicast":
557 config = {'startip':'10.10.10.20', 'endip':'10.10.10.69',
558 'ip':'10.10.10.2', 'mac': "ca:fe:ca:fe:ca:fe",
559 'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'}
560 self.onos_dhcp_table_load(config)
561 self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = onu_iface)
562 cip, sip, mac, _ = self.dhcp.only_discover(mac='01:80:c2:91:02:e4')
Thangavelu K S735a6662017-06-15 18:08:23 +0000563 if cip is not None:
564 self.success = False
Thangavelu K Sa1c71b42017-06-14 18:13:21 +0000565 assert_equal(cip,None)
566 log_test.info('ONOS dhcp server rejected client discover with invalid source mac as expected')
567 self.test_status = True
568
569 if negative_test == "invalid_src_mac_junk":
570 config = {'startip':'10.10.10.20', 'endip':'10.10.10.69',
571 'ip':'10.10.10.2', 'mac': "ca:fe:ca:fe:ca:fe",
572 'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'}
573 self.onos_dhcp_table_load(config)
574 self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = onu_iface)
575 cip, sip, mac, _ = self.dhcp.only_discover(mac='00:00:00:00:00:00')
Thangavelu K S735a6662017-06-15 18:08:23 +0000576 if cip is not None:
577 self.success = False
Thangavelu K Sa1c71b42017-06-14 18:13:21 +0000578 assert_equal(cip,None)
579 log_test.info('ONOS dhcp server rejected client discover with invalid source mac as expected')
580 self.test_status = True
581
582 if negative_test == "request_release":
583 config = {'startip':'10.10.100.20', 'endip':'10.10.100.230',
584 'ip':'10.10.100.2', 'mac': "ca:fe:ca:fe:8a:fe",
585 'subnet': '255.255.255.0', 'broadcast':'10.10.100.255', 'router':'10.10.100.1'}
586 self.onos_dhcp_table_load(config)
587 self.dhcp = DHCPTest(seed_ip = '10.10.100.10', iface = onu_iface)
588 cip, sip = self.dhcp_sndrcv(self.dhcp)
589 log_test.info('Releasing ip %s to server %s' %(cip, sip))
Thangavelu K S0ffd5b82017-06-21 18:01:59 +0000590 if not self.dhcp.release(cip):
591 self.success = False
Thangavelu K Sa1c71b42017-06-14 18:13:21 +0000592 assert_equal(self.dhcp.release(cip), True)
593 log_test.info('Triggering DHCP discover again after release')
594 cip2, sip2 = self.dhcp_sndrcv(self.dhcp, update_seed = True)
595 log_test.info('Verifying released IP was given back on rediscover')
Thangavelu K S0ffd5b82017-06-21 18:01:59 +0000596 if not cip == cip2:
Thangavelu K S735a6662017-06-15 18:08:23 +0000597 self.success = False
Thangavelu K Sa1c71b42017-06-14 18:13:21 +0000598 assert_equal(cip, cip2)
599 log_test.info('Test done. Releasing ip %s to server %s' %(cip2, sip2))
600 assert_equal(self.dhcp.release(cip2), True)
601 self.test_status = True
Thangavelu K S8e413082017-07-13 20:02:14 +0000602
Thangavelu K S735a6662017-06-15 18:08:23 +0000603 if negative_test == "starvation_positive":
604 config = {'startip':'193.170.1.20', 'endip':'193.170.1.69',
605 'ip':'193.170.1.2', 'mac': "ca:fe:c2:fe:cc:fe",
606 'subnet': '255.255.255.0', 'broadcast':'192.168.1.255', 'router': '192.168.1.1'}
607 self.onos_dhcp_table_load(config)
608 self.dhcp = DHCPTest(seed_ip = '192.169.1.1', iface = onu_iface)
609 ip_map = {}
610 for i in range(10):
611 cip, sip = self.dhcp_sndrcv(self.dhcp, update_seed = True)
612 if ip_map.has_key(cip):
613 self.success = False
614 log_test.info('IP %s given out multiple times' %cip)
615 assert_equal(False, ip_map.has_key(cip))
616 ip_map[cip] = sip
617 self.test_status = True
Thangavelu K S8e413082017-07-13 20:02:14 +0000618
Thangavelu K S735a6662017-06-15 18:08:23 +0000619 if negative_test == "starvation_negative":
620 config = {'startip':'182.17.0.20', 'endip':'182.17.0.69',
621 'ip':'182.17.0.2', 'mac': "ca:fe:c3:fe:ca:fe",
622 'subnet': '255.255.255.0', 'broadcast':'182.17.0.255', 'router':'182.17.0.1'}
623 self.onos_dhcp_table_load(config)
624 self.dhcp = DHCPTest(seed_ip = '182.17.0.1', iface = onu_iface)
625 log_test.info('Verifying passitive case')
626 for x in xrange(50):
627 mac = RandMAC()._fix()
628 self.dhcp_sndrcv(self.dhcp,mac = mac)
629 log_test.info('Verifying negative case')
630 cip, sip = self.dhcp_sndrcv(self.dhcp,update_seed = True)
Thangavelu K S0ffd5b82017-06-21 18:01:59 +0000631 if cip or sip is not None:
632 self.success = False
Thangavelu K S735a6662017-06-15 18:08:23 +0000633 assert_equal(cip, None)
634 assert_equal(sip, None)
635 self.test_status = True
636 self.success = True
Thangavelu K S8e413082017-07-13 20:02:14 +0000637
Thangavelu K S735a6662017-06-15 18:08:23 +0000638 if negative_test == "multiple_discover":
639 config = {'startip':'10.10.10.20', 'endip':'10.10.10.69',
640 'ip':'10.10.10.2', 'mac': "ca:fe:ca:fe:ca:fe",
641 'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'}
642 self.onos_dhcp_table_load(config)
643 self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = onu_iface)
644 cip, sip, mac, _ = self.dhcp.only_discover()
645 log_test.info('Got dhcp client IP %s from server %s for mac %s . Not going to send DHCPREQUEST.' %
646 (cip, sip, mac) )
Thangavelu K S0ffd5b82017-06-21 18:01:59 +0000647 if cip is None:
648 self.success = False
Thangavelu K S735a6662017-06-15 18:08:23 +0000649 assert_not_equal(cip, None)
650 log_test.info('Triggering DHCP discover again.')
651 new_cip, new_sip, new_mac, _ = self.dhcp.only_discover()
Thangavelu K S0ffd5b82017-06-21 18:01:59 +0000652 if not new_cip == cip:
653 self.success = False
Thangavelu K S735a6662017-06-15 18:08:23 +0000654 assert_equal(new_cip, cip)
655 log_test.info('client got same IP as expected when sent 2nd discovery')
656 self.test_status = True
Thangavelu K Se6c77c72017-06-23 21:28:48 +0000657 # self.success = True
Thangavelu K S735a6662017-06-15 18:08:23 +0000658 if negative_test == "multiple_requests":
659 config = {'startip':'10.10.10.20', 'endip':'10.10.10.69',
660 'ip':'10.10.10.2', 'mac': "ca:fe:ca:fe:ca:fe",
661 'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'}
662 self.onos_dhcp_table_load(config)
663 self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = onu_iface)
664 log_test.info('Sending DHCP discover and DHCP request.')
665 cip, sip = self.dhcp_sndrcv(self.dhcp,update_seed = True)
666 mac = self.dhcp.get_mac(cip)[0]
667 log_test.info("Sending DHCP request again.")
668 new_cip, new_sip = self.dhcp.only_request(cip, mac)
669 assert_equal(new_cip,cip)
670 log_test.info('server offered same IP to clain for multiple requests, as expected')
671 self.test_status = True
Thangavelu K Se6c77c72017-06-23 21:28:48 +0000672# self.success = True
Thangavelu K S735a6662017-06-15 18:08:23 +0000673 if negative_test == "desired_ip_address":
674 config = {'startip':'20.20.20.30', 'endip':'20.20.20.69',
675 'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe",
676 'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'}
677 self.onos_dhcp_table_load(config)
678 self.dhcp = DHCPTest(seed_ip = '20.20.20.50', iface = onu_iface)
679 cip, sip, mac, _ = self.dhcp.only_discover(desired = True)
Thangavelu K S0ffd5b82017-06-21 18:01:59 +0000680 if cip or sip is None:
681 self.success = False
Thangavelu K S735a6662017-06-15 18:08:23 +0000682 assert_not_equal(cip, None)
683 log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
684 (cip, sip, mac))
Thangavelu K S0ffd5b82017-06-21 18:01:59 +0000685 if not self.dhcp.seed_ip == cip:
686 self.success = False
Thangavelu K S735a6662017-06-15 18:08:23 +0000687 assert_equal(cip,self.dhcp.seed_ip)
688 log_test.info('ONOS dhcp server offered client requested IP %s as expected'%self.dhcp.seed_ip)
689 self.test_status = True
Thangavelu K S0ffd5b82017-06-21 18:01:59 +0000690 # self.success = True
Thangavelu K S735a6662017-06-15 18:08:23 +0000691 if negative_test == "desired_out_of_pool_ip_address":
692 config = {'startip':'20.20.20.30', 'endip':'20.20.20.69',
693 'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe",
694 'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'}
695 self.onos_dhcp_table_load(config)
696 self.dhcp = DHCPTest(seed_ip = '20.20.20.75', iface = onu_iface)
697 cip, sip, mac, _ = self.dhcp.only_discover(desired = True)
Thangavelu K S0ffd5b82017-06-21 18:01:59 +0000698 if cip or sip is None:
699 self.success = False
Thangavelu K S735a6662017-06-15 18:08:23 +0000700 assert_not_equal(cip, None)
701 log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
702 (cip, sip, mac) )
Thangavelu K S0ffd5b82017-06-21 18:01:59 +0000703 if self.dhcp.seed_ip == cip:
704 self.success = False
Thangavelu K S735a6662017-06-15 18:08:23 +0000705 assert_not_equal(cip,self.dhcp.seed_ip)
706 log_test.info('server offered IP from its pool of IPs when requested out of pool IP, as expected')
707 self.test_status = True
Thangavelu K Se6c77c72017-06-23 21:28:48 +0000708 # self.success = True
Thangavelu K S0f2c5232017-06-19 19:11:43 +0000709 if negative_test == "dhcp_renew":
710 config = {'startip':'20.20.20.30', 'endip':'20.20.20.69',
711 'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe",
712 'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'}
713 self.onos_dhcp_table_load(config)
714 self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = onu_iface)
715 cip, sip, mac, _ = self.dhcp.only_discover()
716 log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
717 (cip, sip, mac) )
Thangavelu K S0ffd5b82017-06-21 18:01:59 +0000718 if cip or sip is None:
719 self.success = False
Thangavelu K S0f2c5232017-06-19 19:11:43 +0000720 assert_not_equal(cip, None)
721 new_cip, new_sip, lval = self.dhcp.only_request(cip, mac, renew_time = True)
722 log_test.info('waiting renew time %d seconds to send next request packet'%lval)
723 time.sleep(lval)
724 latest_cip, latest_sip, lval = self.dhcp.only_request(cip, mac, renew_time = True)
Thangavelu K S0ffd5b82017-06-21 18:01:59 +0000725 if not latest_cip == cip:
726 self.success = False
Thangavelu K S0f2c5232017-06-19 19:11:43 +0000727 assert_equal(latest_cip,cip)
728 log_test.info('client got same IP after renew time, as expected')
Thangavelu K S735a6662017-06-15 18:08:23 +0000729 self.test_status = True
Thangavelu K S0ffd5b82017-06-21 18:01:59 +0000730 # self.success = True
Thangavelu K S0f2c5232017-06-19 19:11:43 +0000731 if negative_test == "dhcp_rebind":
732 config = {'startip':'20.20.20.30', 'endip':'20.20.20.69',
733 'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe",
734 'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'}
735 self.onos_dhcp_table_load(config)
736 self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = onu_iface)
737 cip, sip, mac, _ = self.dhcp.only_discover()
738 log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
739 (cip, sip, mac) )
Thangavelu K S0ffd5b82017-06-21 18:01:59 +0000740 if cip or sip is None:
741 self.success = False
Thangavelu K S0f2c5232017-06-19 19:11:43 +0000742 assert_not_equal(cip, None)
743 new_cip, new_sip, lval = self.dhcp.only_request(cip, mac, rebind_time = True)
744 log_test.info('waiting rebind time %d seconds to send next request packet'%lval)
745 time.sleep(lval)
746 latest_cip, latest_sip = self.dhcp.only_request(new_cip, mac)
Thangavelu K S0ffd5b82017-06-21 18:01:59 +0000747 if not latest_cip == cip:
748 self.success = False
Thangavelu K S0f2c5232017-06-19 19:11:43 +0000749 assert_equal(latest_cip,cip)
750 log_test.info('client got same IP after rebind time, as expected')
Thangavelu K S735a6662017-06-15 18:08:23 +0000751 self.test_status = True
Thangavelu K S0ffd5b82017-06-21 18:01:59 +0000752 # self.success = True
Thangavelu K Sa1c71b42017-06-14 18:13:21 +0000753 return self.test_status
754
Thangavelu K S8e413082017-07-13 20:02:14 +0000755 def recv_channel_cb(self, pkt):
756 ##First verify that we have received the packet for the joined instance
757 chan = self.subscriber.caddr(pkt[IP].dst)
758 assert_equal(chan in self.subscriber.join_map.keys(), True)
759 recv_time = monotonic.monotonic() * 1000000
760 join_time = self.subscriber.join_map[chan][self.subscriber.STATS_JOIN].start
761 delta = recv_time - join_time
762 self.subscriber.join_rx_stats.update(packets=1, t = delta, usecs = True)
763 self.subscriber.channel_update(chan, self.subscriber.STATS_RX, 1, t = delta)
764 log_test.debug('Packet received in %.3f usecs for group %s after join' %(delta, pkt[IP].dst))
765 self.test_status = True
Thangavelu K S36edb012017-07-05 18:24:12 +0000766
Thangavelu K S8e413082017-07-13 20:02:14 +0000767 def traffic_verify(self, subscriber):
768 # if subscriber.has_service('TRAFFIC'):
769 url = 'http://www.google.com'
770 resp = requests.get(url)
771 self.test_status = resp.ok
772 if resp.ok == False:
773 log_test.info('Subscriber %s failed get from url %s with status code %d'
774 %(subscriber.name, url, resp.status_code))
775 else:
776 log_test.info('GET request from %s succeeded for subscriber %s'
777 %(url, subscriber.name))
778 return self.test_status
Thangavelu K S36edb012017-07-05 18:24:12 +0000779
Thangavelu K S8e413082017-07-13 20:02:14 +0000780 def igmp_flow_check(self, subscriber, multiple_sub = False):
781 chan = 0
782 subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list)
783 self.num_joins += 1
784 while self.num_joins < self.num_subscribers:
785 time.sleep(5)
786 log_test.info('All subscribers have joined the channel')
787 for i in range(10):
788 self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10, src_list = subscriber.src_list)
789 log_test.info('Leaving channel %d for subscriber on port %s' %(chan, subscriber.rx_port))
790 subscriber.channel_leave(chan, src_list = subscriber.src_list)
791 time.sleep(5)
792 log_test.info('Interface %s Join RX stats for subscriber, %s' %(subscriber.iface,subscriber.join_rx_stats))
793 #Should not receive packets for this subscriber
794 self.recv_timeout = True
795 subscriber.recv_timeout = True
796 subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10, src_list = subscriber.src_list)
797 subscriber.recv_timeout = False
798 self.recv_timeout = False
799 log_test.info('Joining channel %d for subscriber port %s' %(chan, subscriber.rx_port))
800 subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list)
801# self.test_status = True
802 return self.test_status
Thangavelu K S36edb012017-07-05 18:24:12 +0000803
Thangavelu K S8e413082017-07-13 20:02:14 +0000804 def igmp_flow_check_join_change_to_exclude(self, subscriber, multiple_sub = False):
805 chan = 0
806 subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list)
807 self.num_joins += 1
808 while self.num_joins < self.num_subscribers:
809 time.sleep(5)
810 log_test.info('All subscribers have joined the channel')
811 self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10, src_list = subscriber.src_list)
812 time.sleep(5)
813 log_test.info('Leaving channel %d for subscriber on port %s from specific source ip %s' %(chan, subscriber.rx_port,subscriber.src_list[0]))
814 subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list[0], record_type = IGMP_V3_GR_TYPE_CHANGE_TO_EXCLUDE)
815 time.sleep(5)
816 self.recv_timeout = True
817 subscriber.recv_timeout = True
818 self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10, src_list = subscriber.src_list[1])
819 if self.test_status is True:
820 self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10, src_list = subscriber.src_list[0])
821 if self.test_status is True:
822 log_test.info('Subscriber should not receive data from channel %s on specific source %s, test is failed' %(chan, subscriber.rx_port))
823 self.test_status = False
824 subscriber.recv_timeout = False
825 self.recv_timeout = False
826 subscriber.channel_leave(chan, src_list = subscriber.src_list)
827# self.test_status = True
828 return self.test_status
Thangavelu K S36edb012017-07-05 18:24:12 +0000829
Thangavelu K S8e413082017-07-13 20:02:14 +0000830 def igmp_flow_check_join_change_to_exclude_again_include_back(self, subscriber, multiple_sub = False):
831 chan = 0
832 subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list)
833 self.num_joins += 1
834 while self.num_joins < self.num_subscribers:
835 time.sleep(5)
836 log_test.info('All subscribers have joined the channel')
837 self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10, src_list = subscriber.src_list)
838 time.sleep(5)
839 log_test.info('Leaving channel %d for subscriber on port %s from specific source ip %s' %(chan, subscriber.rx_port,subscriber.src_list[0]))
840 subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list[0], record_type = IGMP_V3_GR_TYPE_CHANGE_TO_EXCLUDE)
841 time.sleep(5)
842 self.recv_timeout = True
843 subscriber.recv_timeout = True
844 self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10, src_list = subscriber.src_list[1])
845 if self.test_status is True:
846 self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10, src_list = subscriber.src_list[0])
847 if self.test_status is True:
848 log_test.info('Subscriber should not receive data from channel %s on specific source %s, test is failed' %(chan, subscriber.rx_port))
849 self.test_status = False
850 subscriber.recv_timeout = False
851 self.recv_timeout = False
852 log_test.info('Again include the source list in the group %s souce ip %s' %(chan, subscriber.rx_port,subscriber.src_list[0]))
853 subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list[0], record_type = IGMP_V3_GR_TYPE_CHANGE_TO_INCLUDE)
854 time.sleep(5)
855 self.recv_timeout = True
856 subscriber.recv_timeout = True
857 self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10, src_list = subscriber.src_list)
858 subscriber.recv_timeout = False
859 self.recv_timeout = False
860 subscriber.channel_leave(chan, src_list = subscriber.src_list)
861# self.test_status = True
862 return self.test_status
Thangavelu K S36edb012017-07-05 18:24:12 +0000863
Thangavelu K S8e413082017-07-13 20:02:14 +0000864 def igmp_flow_check_join_change_to_block(self, subscriber, multiple_sub = False):
865 chan = 0
866 subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list)
867 self.num_joins += 1
868 while self.num_joins < self.num_subscribers:
869 time.sleep(5)
870 log_test.info('All subscribers have joined the channel')
871 self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10, src_list = subscriber.src_list)
872 time.sleep(5)
873 log_test.info('Leaving channel %d for subscriber on port %s from specific source ip %s' %(chan, subscriber.rx_port,subscriber.src_list[0]))
874 subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list[0], record_type = IGMP_V3_GR_TYPE_BLOCK_OLD)
875 time.sleep(5)
876 self.recv_timeout = True
877 subscriber.recv_timeout = True
878 self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10, src_list = subscriber.src_list[1])
879 if self.test_status is True:
880 self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10, src_list = subscriber.src_list[0])
881 if self.test_status is True:
882 log_test.info('Subscriber should not receive data from channel %s on specific source %s, test is failed' %(chan, subscriber.rx_port))
883 self.test_status = False
884 subscriber.recv_timeout = False
885 self.recv_timeout = False
886 subscriber.channel_leave(chan, src_list = subscriber.src_list)
887 return self.test_status
Thangavelu K S36edb012017-07-05 18:24:12 +0000888
Thangavelu K S8e413082017-07-13 20:02:14 +0000889 def igmp_flow_check_join_change_to_block_again_allow_back(self, subscriber, multiple_sub = False):
890 chan = 0
891 subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list)
892 self.num_joins += 1
893 while self.num_joins < self.num_subscribers:
894 time.sleep(5)
895 log_test.info('All subscribers have joined the channel')
896 self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10, src_list = subscriber.src_list)
897 time.sleep(5)
898 log_test.info('Leaving channel %d for subscriber on port %s from specific source ip %s' %(chan, subscriber.rx_port,subscriber.src_list[0]))
899 subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list[0], record_type = IGMP_V3_GR_TYPE_CHANGE_TO_EXCLUDE)
900 time.sleep(5)
901 self.recv_timeout = True
902 subscriber.recv_timeout = True
903 self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10, src_list = subscriber.src_list[1])
904 if self.test_status is True:
905 self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10, src_list = subscriber.src_list[0])
906 if self.test_status is True:
907 log_test.info('Subscriber should not receive data from channel %s on specific source %s, test is failed' %(chan, subscriber.rx_port))
908 self.test_status = False
909 subscriber.recv_timeout = False
910 self.recv_timeout = False
911 log_test.info('Again include the source list in the group %s souce ip %s' %(chan, subscriber.rx_port,subscriber.src_list[0]))
912 subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list[0], record_type = IGMP_V3_GR_TYPE_ALLOW_NEW)
913 time.sleep(5)
914 self.recv_timeout = True
915 subscriber.recv_timeout = True
916 self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10, src_list = subscriber.src_list)
917 subscriber.recv_timeout = False
918 self.recv_timeout = False
919 subscriber.channel_leave(chan, src_list = subscriber.src_list)
920 return self.test_status
921
922 def voltha_igmp_jump_verify(self, subscriber):
923 if subscriber.has_service('IGMP'):
924 for i in xrange(subscriber.num):
925 log_test.info('Subscriber %s jumping channel' %subscriber.name)
926 chan = subscriber.channel_jump(delay=0)
927 subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 1)
928 log_test.info('Verified receive for channel %d, subscriber %s' %(chan, subscriber.name))
929 time.sleep(3)
930 log_test.info('Interface %s Jump RX stats for subscriber %s, %s' %(subscriber.iface, subscriber.name, subscriber.join_rx_stats))
931 self.test_status = True
932 return self.test_status
933
934 def voltha_igmp_next_verify(self, subscriber):
935 for c in xrange(self.VOLTHA_IGMP_ITERATIONS):
936 for i in xrange(subscriber.num):
937 if i:
938 chan = subscriber.channel_join_next(delay=0, leave_flag = self.leave_flag)
939 time.sleep(0.2)
940 else:
941 chan = subscriber.channel_join(i, delay=0)
942 time.sleep(0.2)
943 if subscriber.num == 1:
944 subscriber.channel_leave(chan)
945 log_test.info('Joined next channel %d for subscriber %s' %(chan, subscriber.name))
946 #subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count=1)
947 #log_test.info('Verified receive for channel %d, subscriber %s' %(chan, subscriber.name))
948 self.test_status = True
949 return self.test_status
950
951 def voltha_subscribers(self, services, cbs = None, num_subscribers = 1, num_channels = 1, src_list = None):
Thangavelu K S36edb012017-07-05 18:24:12 +0000952 """Test subscriber join next for channel surfing"""
953 voltha = VolthaCtrl(self.VOLTHA_HOST,
954 rest_port = self.VOLTHA_REST_PORT,
955 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
956 if self.VOLTHA_OLT_TYPE.startswith('ponsim'):
957 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
958 log_test.info('Enabling ponsim olt')
959 device_id, status = voltha.enable_device(self.VOLTHA_OLT_TYPE, address = ponsim_address)
960 else:
961 log_test.info('This setup test cases is developed on ponsim olt only, hence stop execution')
962 assert_equal(False, True)
963
964 assert_not_equal(device_id, None)
965 if status == False:
966 voltha.disable_device(device_id, delete = True)
967 assert_equal(status, True)
968 time.sleep(10)
969 switch_map = None
970 olt_configured = False
971 try:
972 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
973 if not switch_map:
974 log_test.info('No voltha devices found')
975 return
976 log_test.info('Installing OLT app')
977 OnosCtrl.install_app(self.olt_app_file)
978 time.sleep(5)
979 log_test.info('Adding subscribers through OLT app')
980 self.config_olt(switch_map)
981 olt_configured = True
982 time.sleep(5)
983 self.num_subscribers = num_subscribers
984 self.num_channels = num_channels
985 test_status = self.subscriber_flows_check(num_subscribers = self.num_subscribers,
986 num_channels = self.num_channels,
987 cbs = cbs,
988 port_list = self.generate_port_list(self.num_subscribers,
989 self.num_channels),
Thangavelu K S8e413082017-07-13 20:02:14 +0000990 src_list = src_list, services = services)
Thangavelu K S36edb012017-07-05 18:24:12 +0000991 assert_equal(test_status, True)
992 finally:
993 if switch_map is not None:
994 if olt_configured is True:
995 self.remove_olt(switch_map)
996 voltha.disable_device(device_id, delete = True)
997 time.sleep(10)
998 log_test.info('Uninstalling OLT app')
999 OnosCtrl.uninstall_app(self.olt_app_name)
1000
Thangavelu K S8e413082017-07-13 20:02:14 +00001001 def subscriber_flows_check( self, num_subscribers = 1, num_channels = 1,
1002 channel_start = 0, cbs = None, port_list = [], src_list = None,
Thangavelu K S36edb012017-07-05 18:24:12 +00001003 services = None, negative_subscriber_auth = None):
1004 self.test_status = False
1005 self.ovs_cleanup()
1006 subscribers_count = num_subscribers
1007 sub_loop_count = num_subscribers
1008 if not port_list:
1009 port_list = self.generate_port_list(num_subscribers, num_channels)
1010 subscriber_tx_rx_ports = []
1011 for i in range(num_subscribers):
Thangavelu K S8e413082017-07-13 20:02:14 +00001012 #subscriber_tx_rx_ports.append((self.port_map['ports'][port_list[i][0]], self.port_map['ports'][port_list[i][1]]))
1013 subscriber_tx_rx_ports.append(Voltha_olt_subscribers(tx_port = self.port_map['ports'][port_list[i][0]],
1014 rx_port = self.port_map['ports'][port_list[i][1]],
1015 num_channels = num_channels,src_list = src_list,))
Thangavelu K S36edb012017-07-05 18:24:12 +00001016 self.onos_aaa_load()
Thangavelu K S8e413082017-07-13 20:02:14 +00001017 #load the ssm list for all subscriber channels
1018 igmpChannel = IgmpChannel(src_list = src_list)
1019 ssm_groups = map(lambda sub: sub.channels, subscriber_tx_rx_ports)
1020 ssm_list = reduce(lambda ssm1, ssm2: ssm1+ssm2, ssm_groups)
1021 igmpChannel.igmp_load_ssm_config(ssm_list, src_list= src_list)
1022
Thangavelu K S36edb012017-07-05 18:24:12 +00001023 self.thread_pool = ThreadPool(min(100, subscribers_count), queue_size=1, wait_timeout=1)
1024
1025 chan_leave = False #for single channel, multiple subscribers
1026 if cbs is None:
1027 cbs = (self.tls_flow_check, self.dhcp_flow_check, self.igmp_flow_check)
1028 chan_leave = True
1029 for subscriber in subscriber_tx_rx_ports:
1030 sub_loop_count = sub_loop_count - 1
1031 pool_object = voltha_subscriber_pool(subscriber, cbs)
1032 self.thread_pool.addTask(pool_object.pool_cb)
1033 self.thread_pool.cleanUpThreads()
1034 subscribers_count = 0
1035 return self.test_status
1036
1037
1038 def generate_port_list(self, subscribers, channels):
1039 return self.port_list[:subscribers]
1040
Thangavelu K S36edb012017-07-05 18:24:12 +00001041 @classmethod
1042 def ovs_cleanup(cls):
1043 ##For every test case, delete all the OVS groups
1044 cmd = 'ovs-ofctl del-groups br-int -OOpenFlow11 >/dev/null 2>&1'
1045 try:
1046 cord_test_shell(cmd)
1047 ##Since olt config is used for this test, we just fire a careless local cmd as well
1048 os.system(cmd)
1049 finally:
1050 return
1051
A.R Karthick8a507cf2017-06-02 18:44:49 -07001052 def test_olt_enable_disable(self):
A R Karthick35495c32017-05-11 14:58:32 -07001053 log_test.info('Enabling OLT type %s, MAC %s' %(self.OLT_TYPE, self.OLT_MAC))
A.R Karthick8a507cf2017-06-02 18:44:49 -07001054 device_id, status = self.voltha.enable_device(self.OLT_TYPE, self.OLT_MAC)
1055 assert_not_equal(device_id, None)
1056 try:
1057 assert_equal(status, True)
1058 time.sleep(10)
1059 finally:
1060 self.voltha.disable_device(device_id, delete = True)
Thangavelu K S008f38e2017-05-15 19:36:55 +00001061
A.R Karthick8a507cf2017-06-02 18:44:49 -07001062 def test_ponsim_enable_disable(self):
A.R Karthick8b9c5f12017-05-30 17:47:08 -07001063 log_test.info('Enabling ponsim_olt')
1064 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
A.R Karthick8a507cf2017-06-02 18:44:49 -07001065 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
1066 assert_not_equal(device_id, None)
1067 try:
1068 assert_equal(status, True)
1069 time.sleep(10)
1070 finally:
1071 self.voltha.disable_device(device_id, delete = True)
A.R Karthick8b9c5f12017-05-30 17:47:08 -07001072
Thangavelu K S008f38e2017-05-15 19:36:55 +00001073 def test_subscriber_with_voltha_for_eap_tls_authentication(self):
1074 """
1075 Test Method:
1076 0. Make sure that voltha is up and running on CORD-POD setup.
1077 1. OLT and ONU is detected and validated.
1078 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
1079 3. Issue auth request packets from CORD TESTER voltha test module acting as a subscriber..
1080 4. Validate that eap tls valid auth packets are being exchanged between subscriber, onos and freeradius.
1081 5. Verify that subscriber is authenticated successfully.
1082 """
Thangavelu K S77c8c0c2017-06-07 18:04:21 +00001083 log_test.info('Enabling ponsim_olt')
1084 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
1085 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
1086 assert_not_equal(device_id, None)
A.R Karthickb9eab5a2017-06-07 16:03:51 -07001087 if status == False:
1088 self.voltha.disable_device(device_id, delete = True)
1089 assert_equal(status, True)
Thangavelu K S77c8c0c2017-06-07 18:04:21 +00001090 time.sleep(10)
1091 switch_map = None
1092 olt_configured = False
A.R Karthickb9eab5a2017-06-07 16:03:51 -07001093 voltha = VolthaCtrl(self.VOLTHA_HOST,
1094 rest_port = self.VOLTHA_REST_PORT,
1095 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
Thangavelu K S77c8c0c2017-06-07 18:04:21 +00001096 try:
A.R Karthickb9eab5a2017-06-07 16:03:51 -07001097 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
1098 if not switch_map:
1099 log_test.info('No voltha devices found')
1100 return
1101 log_test.info('Installing OLT app')
1102 OnosCtrl.install_app(self.olt_app_file)
1103 time.sleep(5)
1104 log_test.info('Adding subscribers through OLT app')
1105 self.config_olt(switch_map)
1106 olt_configured = True
1107 time.sleep(5)
1108 auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT)
Thangavelu K S77c8c0c2017-06-07 18:04:21 +00001109 assert_equal(auth_status, True)
Thangavelu K S77c8c0c2017-06-07 18:04:21 +00001110 finally:
A.R Karthickb9eab5a2017-06-07 16:03:51 -07001111 if switch_map is not None:
1112 if olt_configured is True:
1113 self.remove_olt(switch_map)
1114 self.voltha.disable_device(device_id, delete = True)
1115 time.sleep(10)
1116 OnosCtrl.uninstall_app(self.olt_app_name)
Thangavelu K S008f38e2017-05-15 19:36:55 +00001117
Thangavelu K S77c8c0c2017-06-07 18:04:21 +00001118 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S008f38e2017-05-15 19:36:55 +00001119 def test_subscriber_with_voltha_for_eap_tls_authentication_failure(self):
1120 """
1121 Test Method:
1122 0. Make sure that voltha is up and running on CORD-POD setup.
1123 1. OLT and ONU is detected and validated.
1124 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
1125 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1126 4. Validate that eap tls without cert auth packet is being exchanged between subscriber, onos and freeradius.
1127 5. Verify that subscriber authentication is unsuccessful..
1128 """
Thangavelu K S77c8c0c2017-06-07 18:04:21 +00001129 df = defer.Deferred()
1130 def tls_flow_check_with_no_cert_scenario(df):
1131 log_test.info('Enabling ponsim_olt')
1132 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
1133 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
1134 assert_not_equal(device_id, None)
1135 voltha = VolthaCtrl(self.VOLTHA_HOST,
A.R Karthickb9eab5a2017-06-07 16:03:51 -07001136 rest_port = self.VOLTHA_REST_PORT,
1137 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
Thangavelu K S77c8c0c2017-06-07 18:04:21 +00001138 time.sleep(10)
1139 switch_map = None
1140 olt_configured = False
1141 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
1142 log_test.info('Installing OLT app')
1143 OnosCtrl.install_app(self.olt_app_file)
1144 time.sleep(5)
1145 log_test.info('Adding subscribers through OLT app')
1146 self.config_olt(switch_map)
1147 olt_configured = True
1148 time.sleep(5)
1149 auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT, cert_info = "no_cert")
1150 try:
1151 assert_equal(auth_status, True)
1152 assert_equal(status, True)
1153 time.sleep(10)
1154 finally:
A.R Karthickb9eab5a2017-06-07 16:03:51 -07001155 self.remove_olt(switch_map)
Thangavelu K S77c8c0c2017-06-07 18:04:21 +00001156 self.voltha.disable_device(device_id, delete = True)
1157 df.callback(0)
A.R Karthickb9eab5a2017-06-07 16:03:51 -07001158
Thangavelu K S77c8c0c2017-06-07 18:04:21 +00001159 reactor.callLater(0, tls_flow_check_with_no_cert_scenario, df)
1160 return df
Thangavelu K S008f38e2017-05-15 19:36:55 +00001161
Thangavelu K S77c8c0c2017-06-07 18:04:21 +00001162 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S008f38e2017-05-15 19:36:55 +00001163 def test_subscriber_with_voltha_for_eap_tls_authentication_using_invalid_cert(self):
1164 """
1165 Test Method:
1166 0. Make sure that voltha is up and running on CORD-POD setup.
1167 1. OLT and ONU is detected and validated.
1168 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
1169 3. Issue tls auth packets and exchange invalid cert from CORD TESTER voltha test module acting as a subscriber..
1170 4. Validate that eap tls with invalid cert auth packet is being exchanged between subscriber, onos and freeradius.
1171 5. Verify that subscriber authentication is unsuccessful..
1172 """
Thangavelu K S77c8c0c2017-06-07 18:04:21 +00001173 df = defer.Deferred()
1174 def tls_flow_check_with_invalid_cert_scenario(df):
1175 log_test.info('Enabling ponsim_olt')
1176 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
1177 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
1178 assert_not_equal(device_id, None)
1179 voltha = VolthaCtrl(self.VOLTHA_HOST,
1180 rest_port = self.VOLTHA_REST_PORT,
1181 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
1182 time.sleep(10)
1183 switch_map = None
1184 olt_configured = False
1185 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
1186 log_test.info('Installing OLT app')
1187 OnosCtrl.install_app(self.olt_app_file)
1188 time.sleep(5)
1189 log_test.info('Adding subscribers through OLT app')
1190 self.config_olt(switch_map)
1191 olt_configured = True
1192 time.sleep(5)
1193 auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT, cert_info = "invalid_cert")
1194 try:
1195 assert_equal(auth_status, True)
1196 assert_equal(status, True)
1197 time.sleep(10)
1198 finally:
A.R Karthickb9eab5a2017-06-07 16:03:51 -07001199 self.remove_olt(switch_map)
Thangavelu K S77c8c0c2017-06-07 18:04:21 +00001200 self.voltha.disable_device(device_id, delete = True)
1201 df.callback(0)
1202 reactor.callLater(0, tls_flow_check_with_invalid_cert_scenario, df)
1203 return df
Thangavelu K S008f38e2017-05-15 19:36:55 +00001204
Thangavelu K S0d745c82017-06-09 21:56:08 +00001205 @deferred(TESTCASE_TIMEOUT)
1206 def test_subscriber_with_voltha_for_multiple_invalid_authentication_attempts(self):
1207 """
1208 Test Method:
1209 0. Make sure that voltha is up and running on CORD-POD setup.
1210 1. OLT and ONU is detected and validated.
1211 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
1212 3. Issue tls auth packets and exchange invalid cert from CORD TESTER voltha test module acting as a subscriber for multiple times.
1213 4. Validate that eap tls with invalid cert auth packet is being exchanged between subscriber, onos and freeradius.
1214 5. Verify that subscriber authentication is unsuccessful..
1215 """
1216 df = defer.Deferred()
1217 def tls_flow_check_with_no_cert_scenario(df):
1218 log_test.info('Enabling ponsim_olt')
1219 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
1220 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
1221 assert_not_equal(device_id, None)
1222 voltha = VolthaCtrl(self.VOLTHA_HOST,
1223 rest_port = self.VOLTHA_REST_PORT,
1224 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
1225 time.sleep(10)
1226 switch_map = None
1227 olt_configured = False
1228 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
1229 log_test.info('Installing OLT app')
1230 OnosCtrl.install_app(self.olt_app_file)
1231 time.sleep(5)
1232 log_test.info('Adding subscribers through OLT app')
1233 self.config_olt(switch_map)
1234 olt_configured = True
1235 time.sleep(5)
1236 auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT, cert_info = "invalid_cert")
1237 auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT, cert_info = "invalid_cert")
1238 auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT, cert_info = "no_cert")
1239 auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT, cert_info = "invalid_cert")
1240 try:
1241 assert_equal(auth_status, True)
1242 assert_equal(status, True)
1243 time.sleep(10)
1244 finally:
1245 self.voltha.disable_device(device_id, delete = True)
1246 df.callback(0)
1247 reactor.callLater(0, tls_flow_check_with_no_cert_scenario, df)
1248 return df
1249
1250 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S008f38e2017-05-15 19:36:55 +00001251 def test_subscriber_with_voltha_for_eap_tls_authentication_with_aaa_app_deactivation(self):
1252 """
1253 Test Method:
1254 0. Make sure that voltha is up and running on CORD-POD setup.
1255 1. OLT and ONU is detected and validated.
1256 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
1257 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1258 4. Validate that eap tls without sending client hello, it's not being exchanged between client, onos and freeradius.
1259 5. Verify that subscriber authentication is unsuccessful..
1260 """
Thangavelu K S0d745c82017-06-09 21:56:08 +00001261 df = defer.Deferred()
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00001262 def tls_flow_check_deactivating_app(df):
Thangavelu K S0d745c82017-06-09 21:56:08 +00001263 aaa_app = ["org.opencord.aaa"]
1264 log_test.info('Enabling ponsim_olt')
1265 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
1266 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
1267 assert_not_equal(device_id, None)
1268 voltha = VolthaCtrl(self.VOLTHA_HOST,
1269 rest_port = self.VOLTHA_REST_PORT,
1270 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
1271 time.sleep(10)
1272 switch_map = None
1273 olt_configured = False
1274 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
1275 log_test.info('Installing OLT app')
1276 OnosCtrl.install_app(self.olt_app_file)
1277 time.sleep(5)
1278 log_test.info('Adding subscribers through OLT app')
1279 self.config_olt(switch_map)
1280 olt_configured = True
1281 time.sleep(5)
Thangavelu K S008f38e2017-05-15 19:36:55 +00001282
Thangavelu K S0d745c82017-06-09 21:56:08 +00001283 thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT,"app_deactivate",))
1284 thread2 = threading.Thread(target = self.deactivate_apps, args = (aaa_app,))
1285 thread1.start()
1286 time.sleep(randint(1,2))
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00001287 log_test.info('Restart aaa app in onos during tls auth flow check on voltha')
Thangavelu K S0d745c82017-06-09 21:56:08 +00001288 thread2.start()
1289 time.sleep(10)
1290 thread1.join()
1291 thread2.join()
1292 try:
1293 # assert_equal(status, True)
Thangavelu K S9648eed2017-06-13 20:15:25 +00001294 assert_equal(self.success, True)
Thangavelu K S0d745c82017-06-09 21:56:08 +00001295 time.sleep(10)
1296 finally:
1297 self.voltha.disable_device(device_id, delete = True)
1298 df.callback(0)
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00001299 reactor.callLater(0, tls_flow_check_deactivating_app, df)
Thangavelu K S0d745c82017-06-09 21:56:08 +00001300 return df
1301
1302 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S008f38e2017-05-15 19:36:55 +00001303 def test_subscriber_with_voltha_for_eap_tls_authentication_restarting_radius_server(self):
1304 """
1305 Test Method:
1306 0. Make sure that voltha is up and running on CORD-POD setup.
1307 1. OLT and ONU is detected and validated.
1308 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
1309 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1310 4. Validate that eap tls with restart of radius server and packets are being exchanged between subscriber, onos and freeradius.
1311 5. Verify that subscriber authentication is unsuccessful..
1312 """
Thangavelu K S0d745c82017-06-09 21:56:08 +00001313 df = defer.Deferred()
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00001314 def tls_flow_check_restarting_radius(df):
Thangavelu K S0d745c82017-06-09 21:56:08 +00001315 aaa_app = ["org.opencord.aaa"]
1316 log_test.info('Enabling ponsim_olt')
1317 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
1318 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
1319 assert_not_equal(device_id, None)
1320 voltha = VolthaCtrl(self.VOLTHA_HOST,
1321 rest_port = self.VOLTHA_REST_PORT,
1322 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
1323 time.sleep(10)
1324 switch_map = None
1325 olt_configured = False
1326 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
1327 log_test.info('Installing OLT app')
1328 OnosCtrl.install_app(self.olt_app_file)
1329 time.sleep(5)
1330 log_test.info('Adding subscribers through OLT app')
1331 self.config_olt(switch_map)
1332 olt_configured = True
1333 time.sleep(5)
1334
1335 thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT,"restart_radius"))
1336 thread2 = threading.Thread(target = cord_test_radius_restart)
1337 thread1.start()
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00001338 time.sleep(randint(1,2))
1339 log_test.info('Restart radius server during tls auth flow check on voltha')
Thangavelu K S0d745c82017-06-09 21:56:08 +00001340 thread2.start()
1341 time.sleep(10)
1342 thread1.join()
1343 thread2.join()
1344 try:
1345 # assert_equal(status, True)
Thangavelu K S9648eed2017-06-13 20:15:25 +00001346 assert_equal(self.success, True)
Thangavelu K S0d745c82017-06-09 21:56:08 +00001347 time.sleep(10)
1348 finally:
1349 self.voltha.disable_device(device_id, delete = True)
1350 df.callback(0)
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00001351 reactor.callLater(0, tls_flow_check_restarting_radius, df)
Thangavelu K S0d745c82017-06-09 21:56:08 +00001352 return df
Thangavelu K S008f38e2017-05-15 19:36:55 +00001353
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00001354 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S008f38e2017-05-15 19:36:55 +00001355 def test_subscriber_with_voltha_for_eap_tls_authentication_with_disabled_olt(self):
1356 """
1357 Test Method:
1358 0. Make sure that voltha is up and running on CORD-POD setup.
1359 1. OLT and ONU is detected and validated.
1360 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
1361 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1362 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius.
1363 6. Verify that subscriber authenticated successfully.
1364 7. Disable olt which is seen in voltha and issue tls auth packets from subscriber.
1365 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius.
1366 9. Verify that subscriber authentication is unsuccessful..
1367 """
Thangavelu K S0d745c82017-06-09 21:56:08 +00001368 df = defer.Deferred()
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00001369 def tls_flow_check_operating_olt_state(df):
Thangavelu K S0d745c82017-06-09 21:56:08 +00001370 aaa_app = ["org.opencord.aaa"]
1371 log_test.info('Enabling ponsim_olt')
1372 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
1373 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
1374 assert_not_equal(device_id, None)
1375 voltha = VolthaCtrl(self.VOLTHA_HOST,
1376 rest_port = self.VOLTHA_REST_PORT,
1377 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
1378 time.sleep(10)
1379 switch_map = None
1380 olt_configured = False
1381 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
1382 log_test.info('Installing OLT app')
1383 OnosCtrl.install_app(self.olt_app_file)
1384 time.sleep(5)
1385 log_test.info('Adding subscribers through OLT app')
1386 self.config_olt(switch_map)
1387 olt_configured = True
1388 time.sleep(5)
Thangavelu K S008f38e2017-05-15 19:36:55 +00001389
Thangavelu K S0d745c82017-06-09 21:56:08 +00001390 thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT, "disable_olt_device",))
Thangavelu K Se6c77c72017-06-23 21:28:48 +00001391 thread2 = threading.Thread(target = self.voltha.disable_device, args = (device_id, False,))
Thangavelu K S0d745c82017-06-09 21:56:08 +00001392 thread1.start()
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00001393 time.sleep(randint(1,2))
1394 log_test.info('Disable the ponsim olt device during tls auth flow check on voltha')
Thangavelu K S0d745c82017-06-09 21:56:08 +00001395 thread2.start()
1396 time.sleep(10)
1397 thread1.join()
1398 thread2.join()
1399 try:
1400 # assert_equal(status, True)
Thangavelu K S9648eed2017-06-13 20:15:25 +00001401 assert_equal(self.success, True)
Thangavelu K S0d745c82017-06-09 21:56:08 +00001402 time.sleep(10)
1403 finally:
1404 self.voltha.disable_device(device_id, delete = True)
1405 df.callback(0)
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00001406 reactor.callLater(0, tls_flow_check_operating_olt_state, df)
Thangavelu K S0d745c82017-06-09 21:56:08 +00001407 return df
1408
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00001409 @deferred(TESTCASE_TIMEOUT)
1410 def test_subscriber_with_voltha_for_eap_tls_authentication_disabling_uni_port(self):
Thangavelu K S008f38e2017-05-15 19:36:55 +00001411 """
1412 Test Method:
1413 0. Make sure that voltha is up and running on CORD-POD setup.
1414 1. OLT and ONU is detected and validated.
1415 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
1416 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1417 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius.
1418 6. Verify that subscriber authenticated successfully.
1419 7. Disable uni port which is seen in voltha and issue tls auth packets from subscriber.
1420 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius.
1421 9. Verify that subscriber authentication is unsuccessful..
1422 """
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00001423 df = defer.Deferred()
1424 def tls_flow_check_operating_olt_state(df):
1425 aaa_app = ["org.opencord.aaa"]
1426 log_test.info('Enabling ponsim_olt')
1427 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
1428 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
1429 assert_not_equal(device_id, None)
1430 voltha = VolthaCtrl(self.VOLTHA_HOST,
1431 rest_port = self.VOLTHA_REST_PORT,
1432 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
1433 time.sleep(10)
1434 switch_map = None
1435 olt_configured = False
1436 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
1437 log_test.info('Installing OLT app')
1438 OnosCtrl.install_app(self.olt_app_file)
1439 time.sleep(5)
1440 log_test.info('Adding subscribers through OLT app')
1441 self.config_olt(switch_map)
1442 olt_configured = True
1443 time.sleep(5)
Thangavelu K S008f38e2017-05-15 19:36:55 +00001444
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00001445 thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT, "uni_port_admin_down",))
1446 thread2 = threading.Thread(target = self.voltha_uni_port_toggle)
1447 thread1.start()
1448 time.sleep(randint(1,2))
1449 log_test.info('Admin state of uni port is down and up after delay of 30 sec during tls auth flow check on voltha')
1450 thread2.start()
1451 time.sleep(10)
1452 thread1.join()
1453 thread2.join()
1454 try:
1455 # assert_equal(status, True)
Thangavelu K S9648eed2017-06-13 20:15:25 +00001456 assert_equal(self.success, True)
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00001457 time.sleep(10)
1458 finally:
1459 self.voltha.disable_device(device_id, delete = True)
1460 df.callback(0)
1461 reactor.callLater(0, tls_flow_check_operating_olt_state, df)
1462 return df
1463
1464 @deferred(TESTCASE_TIMEOUT)
Thangavelu K Se6c77c72017-06-23 21:28:48 +00001465 def test_subscriber_with_voltha_for_eap_tls_authentication_carrying_out_multiple_times_toggling_of_uni_port(self):
1466 """
1467 Test Method:
1468 0. Make sure that voltha is up and running on CORD-POD setup.
1469 1. OLT and ONU is detected and validated.
1470 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
1471 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1472 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius.
1473 6. Verify that subscriber authenticated successfully.
1474 7. Disable uni port which is seen in voltha and issue tls auth packets from subscriber.
1475 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius.
1476 9. Verify that subscriber authentication is unsuccessful..
1477 10. Repeat steps from 3 to 9 for 10 times and finally verify tls flow
1478
1479 """
1480 df = defer.Deferred()
1481 no_iterations = 10
1482 def tls_flow_check_with_disable_olt_device_scenario(df):
1483 aaa_app = ["org.opencord.aaa"]
1484 log_test.info('Enabling ponsim_olt')
1485 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
1486 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
1487 assert_not_equal(device_id, None)
1488 voltha = VolthaCtrl(self.VOLTHA_HOST,
1489 rest_port = self.VOLTHA_REST_PORT,
1490 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
1491 time.sleep(10)
1492 switch_map = None
1493 olt_configured = False
1494 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
1495 log_test.info('Installing OLT app')
1496 OnosCtrl.install_app(self.olt_app_file)
1497 time.sleep(5)
1498 log_test.info('Adding subscribers through OLT app')
1499 self.config_olt(switch_map)
1500 olt_configured = True
1501 time.sleep(5)
1502 for i in range(no_iterations):
1503 thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT, "uni_port_admin_down",))
1504 thread2 = threading.Thread(target = self.voltha_uni_port_down_up)
1505 thread1.start()
1506 time.sleep(randint(1,2))
1507 log_test.info('Admin state of uni port is down and up after delay of 30 sec during tls auth flow check on voltha')
1508 thread2.start()
1509 time.sleep(10)
1510 thread1.join()
1511 thread2.join()
1512 auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT)
1513 try:
1514 # assert_equal(status, True)
1515 assert_equal(auth_status, True)
1516 assert_equal(self.success, True)
1517 time.sleep(10)
1518 finally:
1519 self.voltha.disable_device(device_id, delete = True)
1520 df.callback(0)
1521 reactor.callLater(0, tls_flow_check_with_disable_olt_device_scenario, df)
1522 return df
1523
1524 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S008f38e2017-05-15 19:36:55 +00001525 def test_subscriber_with_voltha_for_eap_tls_authentication_restarting_olt(self):
1526 """
1527 Test Method:
1528 0. Make sure that voltha is up and running on CORD-POD setup.
1529 1. OLT and ONU is detected and validated.
1530 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
1531 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1532 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius.
1533 6. Verify that subscriber authenticated successfully.
1534 7. Restart olt which is seen in voltha and issue tls auth packets from subscriber.
1535 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius.
1536 9. Verify that subscriber authentication is unsuccessful..
1537 """
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00001538 df = defer.Deferred()
1539 def tls_flow_check_operating_olt_state(df):
1540 aaa_app = ["org.opencord.aaa"]
1541 log_test.info('Enabling ponsim_olt')
1542 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
1543 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
1544 assert_not_equal(device_id, None)
1545 voltha = VolthaCtrl(self.VOLTHA_HOST,
1546 rest_port = self.VOLTHA_REST_PORT,
1547 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
1548 time.sleep(10)
1549 switch_map = None
1550 olt_configured = False
1551 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
1552 log_test.info('Installing OLT app')
1553 OnosCtrl.install_app(self.olt_app_file)
1554 time.sleep(5)
1555 log_test.info('Adding subscribers through OLT app')
1556 self.config_olt(switch_map)
1557 olt_configured = True
1558 time.sleep(5)
Thangavelu K S008f38e2017-05-15 19:36:55 +00001559
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00001560 thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT, "restart_olt_device",))
1561 thread2 = threading.Thread(target = self.voltha.restart_device, args = (device_id,))
1562 thread1.start()
1563 time.sleep(randint(1,2))
1564 log_test.info('Restart the ponsim olt device during tls auth flow check on voltha')
1565 thread2.start()
1566 time.sleep(10)
1567 thread1.join()
1568 thread2.join()
1569 try:
1570 # assert_equal(status, True)
Thangavelu K S9648eed2017-06-13 20:15:25 +00001571 assert_equal(self.success, True)
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00001572 time.sleep(10)
1573 finally:
1574 self.voltha.disable_device(device_id, delete = True)
1575 df.callback(0)
1576 reactor.callLater(0, tls_flow_check_operating_olt_state, df)
1577 return df
1578
1579 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S36edb012017-07-05 18:24:12 +00001580 def test_subscriber_with_voltha_for_eap_tls_authentication_performing_multiple_times_restart_of_olt(self):
Thangavelu K Se6c77c72017-06-23 21:28:48 +00001581 """
1582 Test Method:
1583 0. Make sure that voltha is up and running on CORD-POD setup.
1584 1. OLT and ONU is detected and validated.
1585 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
1586 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1587 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius.
1588 6. Verify that subscriber authenticated successfully.
1589 7. Restart olt which is seen in voltha and issue tls auth packets from subscriber.
1590 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius.
1591 9. Verify that subscriber authentication is unsuccessful..
1592 10. Repeat steps from 3 to 9 for 10 times and finally verify tls flow
1593 """
1594 df = defer.Deferred()
1595 no_iterations = 10
1596 def tls_flow_check_with_disable_olt_device_scenario(df):
1597 aaa_app = ["org.opencord.aaa"]
1598 log_test.info('Enabling ponsim_olt')
1599 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
1600 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
1601 assert_not_equal(device_id, None)
1602 voltha = VolthaCtrl(self.VOLTHA_HOST,
1603 rest_port = self.VOLTHA_REST_PORT,
1604 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
1605 time.sleep(10)
1606 switch_map = None
1607 olt_configured = False
1608 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
1609 log_test.info('Installing OLT app')
1610 OnosCtrl.install_app(self.olt_app_file)
1611 time.sleep(5)
1612 log_test.info('Adding subscribers through OLT app')
1613 self.config_olt(switch_map)
1614 olt_configured = True
1615 time.sleep(5)
1616 for i in range(no_iterations):
1617 thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT, "restart_olt_device",))
1618 thread2 = threading.Thread(target = self.voltha.restart_device, args = (device_id,))
1619 thread1.start()
1620 time.sleep(randint(1,2))
1621 log_test.info('Restart the ponsim olt device during tls auth flow check on voltha')
1622 thread2.start()
1623 time.sleep(10)
1624 thread1.join()
1625 thread2.join()
1626 auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT)
1627 try:
1628 # assert_equal(status, True)
1629 assert_equal(auth_status, True)
1630 assert_equal(self.success, True)
1631 time.sleep(10)
1632 finally:
1633 self.voltha.disable_device(device_id, delete = True)
1634 df.callback(0)
1635 reactor.callLater(0, tls_flow_check_with_disable_olt_device_scenario, df)
1636 return df
1637
Thangavelu K Se6c77c72017-06-23 21:28:48 +00001638 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S008f38e2017-05-15 19:36:55 +00001639 def test_subscriber_with_voltha_for_eap_tls_authentication_restarting_onu(self):
1640 """
1641 Test Method:
1642 0. Make sure that voltha is up and running on CORD-POD setup.
1643 1. OLT and ONU is detected and validated.
1644 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
1645 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1646 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius.
1647 6. Verify that subscriber authenticated successfully.
1648 7. Restart onu which is seen in voltha and issue tls auth packets from subscriber.
1649 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius.
1650 9. Verify that subscriber authentication is unsuccessful..
1651 """
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00001652 df = defer.Deferred()
1653 def tls_flow_check_operating_olt_state(df):
1654 aaa_app = ["org.opencord.aaa"]
1655 log_test.info('Enabling ponsim_olt')
1656 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
1657 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
1658 devices_list = self.voltha.get_devices()
Thangavelu K S9648eed2017-06-13 20:15:25 +00001659 log_test.info('All available devices on voltha = %s'%devices_list['items'])
1660
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00001661 onu_device_id = devices_list['items'][1]['id']
1662 assert_not_equal(device_id, None)
1663 voltha = VolthaCtrl(self.VOLTHA_HOST,
1664 rest_port = self.VOLTHA_REST_PORT,
1665 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
1666 time.sleep(10)
1667 switch_map = None
1668 olt_configured = False
1669 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
1670 log_test.info('Installing OLT app')
1671 OnosCtrl.install_app(self.olt_app_file)
1672 time.sleep(5)
1673 log_test.info('Adding subscribers through OLT app')
1674 self.config_olt(switch_map)
1675 olt_configured = True
1676 time.sleep(5)
1677 devices_list = self.voltha.get_devices()
1678 thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT, "restart_onu_device",))
1679 thread2 = threading.Thread(target = self.voltha.restart_device, args = (onu_device_id,))
1680 thread1.start()
1681 time.sleep(randint(1,2))
1682 log_test.info('Restart the ponsim oon device during tls auth flow check on voltha')
1683 thread2.start()
1684 time.sleep(10)
1685 thread1.join()
1686 thread2.join()
1687 try:
1688 # assert_equal(status, True)
Thangavelu K S9648eed2017-06-13 20:15:25 +00001689 assert_equal(self.success, True)
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00001690 time.sleep(10)
1691 finally:
1692 self.voltha.disable_device(device_id, delete = True)
1693 df.callback(0)
Thangavelu K Se6c77c72017-06-23 21:28:48 +00001694 reactor.callLater(0, tls_flow_check_with_disable_olt_device_scenario, df)
Thangavelu K Sb6fc1b52017-06-12 17:46:10 +00001695 return df
Thangavelu K S008f38e2017-05-15 19:36:55 +00001696
Thangavelu K S9648eed2017-06-13 20:15:25 +00001697 @deferred(TESTCASE_TIMEOUT)
Thangavelu K Se6c77c72017-06-23 21:28:48 +00001698 def test_subscriber_with_voltha_for_eap_tls_authentication_performing_multiple_times_restart_of_onu(self):
1699 """
1700 Test Method:
1701 0. Make sure that voltha is up and running on CORD-POD setup.
1702 1. OLT and ONU is detected and validated.
1703 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
1704 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1705 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius.
1706 6. Verify that subscriber authenticated successfully.
1707 7. Restart onu which is seen in voltha and issue tls auth packets from subscriber.
1708 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius.
1709 9. Verify that subscriber authentication is unsuccessful..
1710 10. Repeat steps from 3 to 9 for 10 times and finally verify tls flow
1711 """
1712 df = defer.Deferred()
1713 no_iterations = 10
1714 def tls_flow_check_operating_olt_state(df):
1715 aaa_app = ["org.opencord.aaa"]
1716 log_test.info('Enabling ponsim_olt')
1717 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
1718 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
1719 devices_list = self.voltha.get_devices()
1720 log_test.info('All available devices on voltha = %s'%devices_list['items'])
1721
1722 onu_device_id = devices_list['items'][1]['id']
1723 assert_not_equal(device_id, None)
1724 voltha = VolthaCtrl(self.VOLTHA_HOST,
1725 rest_port = self.VOLTHA_REST_PORT,
1726 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
1727 time.sleep(10)
1728 switch_map = None
1729 olt_configured = False
1730 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
1731 log_test.info('Installing OLT app')
1732 OnosCtrl.install_app(self.olt_app_file)
1733 time.sleep(5)
1734 log_test.info('Adding subscribers through OLT app')
1735 self.config_olt(switch_map)
1736 olt_configured = True
1737 time.sleep(5)
1738 devices_list = self.voltha.get_devices()
1739 for i in range(no_iterations):
1740 thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT, "restart_onu_device",))
1741 thread2 = threading.Thread(target = self.voltha.restart_device, args = (onu_device_id,))
1742 thread1.start()
1743 time.sleep(randint(1,2))
1744 log_test.info('Restart the ponsim oon device during tls auth flow check on voltha')
1745 thread2.start()
1746 time.sleep(10)
1747 thread1.join()
1748 thread2.join()
1749 auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT)
1750 try:
1751 # assert_equal(status, True)
1752 assert_equal(auth_status, True)
1753 assert_equal(self.success, True)
1754 time.sleep(10)
1755 finally:
1756 self.voltha.disable_device(device_id, delete = True)
1757 df.callback(0)
1758 reactor.callLater(0, tls_flow_check_operating_olt_state, df)
1759 return df
1760
1761
1762 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S36edb012017-07-05 18:24:12 +00001763 def test_two_subscribers_with_voltha_for_eap_tls_authentication(self):
Thangavelu K S008f38e2017-05-15 19:36:55 +00001764 """
1765 Test Method:
1766 0. Make sure that voltha is up and running on CORD-POD setup.
1767 1. OLT is detected and ONU ports(nni and 2 uni's) are being seen.
1768 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
1769 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1770 4. Validate that eap tls valid auth packets are being exchanged between two subscriber, onos and freeradius.
1771 5. Verify that two subscribers are authenticated successfully.
1772 """
1773
Thangavelu K S9648eed2017-06-13 20:15:25 +00001774 df = defer.Deferred()
Thangavelu K Se6c77c72017-06-23 21:28:48 +00001775 def tls_flow_check_on_two_subscribers_same_olt_device(df):
Thangavelu K S9648eed2017-06-13 20:15:25 +00001776 aaa_app = ["org.opencord.aaa"]
1777 log_test.info('Enabling ponsim_olt')
1778 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
1779 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
1780 devices_list = self.voltha.get_devices()
1781 log_test.info('All available devices on voltha = %s'%devices_list['items'])
1782
1783 onu_device_id = devices_list['items'][1]['id']
1784 assert_not_equal(device_id, None)
1785 voltha = VolthaCtrl(self.VOLTHA_HOST,
1786 rest_port = self.VOLTHA_REST_PORT,
1787 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
1788 time.sleep(10)
1789 switch_map = None
1790 olt_configured = False
1791 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
1792 log_test.info('Installing OLT app')
1793 OnosCtrl.install_app(self.olt_app_file)
1794 time.sleep(5)
1795 log_test.info('Adding subscribers through OLT app')
1796 self.config_olt(switch_map)
1797 olt_configured = True
1798 time.sleep(5)
1799 devices_list = self.voltha.get_devices()
1800 thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT,))
1801 thread2 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_2_RX_DEFAULT,))
1802 thread1.start()
1803 time.sleep(randint(1,2))
1804 log_test.info('Initiating tls auth packets from one more subscriber on same olt device which is deteced on voltha')
1805 thread2.start()
1806 time.sleep(10)
1807 thread1.join()
1808 thread2.join()
1809 try:
1810 # assert_equal(status, True)
1811 assert_equal(self.success, True)
1812 time.sleep(10)
1813 finally:
1814 self.voltha.disable_device(device_id, delete = True)
1815 df.callback(0)
Thangavelu K Se6c77c72017-06-23 21:28:48 +00001816 reactor.callLater(0, tls_flow_check_on_two_subscribers_same_olt_device, df)
Thangavelu K S9648eed2017-06-13 20:15:25 +00001817 return df
1818
1819 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S36edb012017-07-05 18:24:12 +00001820 def test_two_subscribers_with_voltha_for_eap_tls_authentication_using_same_certificates(self):
Thangavelu K S008f38e2017-05-15 19:36:55 +00001821 """
1822 Test Method:
1823 0. Make sure that voltha is up and running on CORD-POD setup.
1824 1. OLT is detected and ONU ports(nni and 2 uni's) are being seen.
1825 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
1826 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1827 4. Validate that two valid certificates are being exchanged between two subscriber, onos and freeradius.
1828 5. Verify that two subscribers are not authenticated.
1829 """
1830
Thangavelu K S9648eed2017-06-13 20:15:25 +00001831 df = defer.Deferred()
Thangavelu K Se6c77c72017-06-23 21:28:48 +00001832 def tls_flow_check_on_two_subscribers_same_olt_device(df):
Thangavelu K S9648eed2017-06-13 20:15:25 +00001833 aaa_app = ["org.opencord.aaa"]
1834 log_test.info('Enabling ponsim_olt')
1835 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
1836 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
1837 devices_list = self.voltha.get_devices()
1838 log_test.info('All available devices on voltha = %s'%devices_list['items'])
1839
1840 onu_device_id = devices_list['items'][1]['id']
1841 assert_not_equal(device_id, None)
1842 voltha = VolthaCtrl(self.VOLTHA_HOST,
1843 rest_port = self.VOLTHA_REST_PORT,
1844 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
1845 time.sleep(10)
1846 switch_map = None
1847 olt_configured = False
1848 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
1849 log_test.info('Installing OLT app')
1850 OnosCtrl.install_app(self.olt_app_file)
1851 time.sleep(5)
1852 log_test.info('Adding subscribers through OLT app')
1853 self.config_olt(switch_map)
1854 olt_configured = True
1855 time.sleep(5)
1856 devices_list = self.voltha.get_devices()
1857 thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT,))
1858 thread2 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_2_RX_DEFAULT, "same_cert",))
1859 thread1.start()
1860 time.sleep(randint(1,2))
1861 log_test.info('Initiating tls auth packets from one more subscriber on same olt device which is deteced on voltha')
1862 thread2.start()
1863 time.sleep(10)
1864 thread1.join()
1865 thread2.join()
1866 try:
1867 # assert_equal(status, True)
1868 assert_equal(self.success, True)
1869 time.sleep(10)
1870 finally:
1871 self.voltha.disable_device(device_id, delete = True)
1872 df.callback(0)
Thangavelu K Se6c77c72017-06-23 21:28:48 +00001873 reactor.callLater(0, tls_flow_check_on_two_subscribers_same_olt_device, df)
Thangavelu K S9648eed2017-06-13 20:15:25 +00001874 return df
1875
Chetan Gaonkerfe1048f2017-06-13 20:16:25 +00001876 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S36edb012017-07-05 18:24:12 +00001877 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 +00001878 """
1879 Test Method:
1880 0. Make sure that voltha is up and running on CORD-POD setup.
1881 1. OLT is detected and ONU ports(nni and 2 uni's) are being seen.
1882 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
1883 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1884 4. Validate that eap tls valid auth packets are being exchanged between valid subscriber, onos and freeradius.
1885 5. Validate that eap tls valid auth packets are being exchanged between invalid client, onos and freeradius.
1886 6. Verify that valid subscriber authenticated successfully.
1887 7. Verify that invalid subscriber are not authenticated successfully.
1888 """
1889
Chetan Gaonkerfe1048f2017-06-13 20:16:25 +00001890 df = defer.Deferred()
Thangavelu K Se6c77c72017-06-23 21:28:48 +00001891 def tls_flow_check_on_two_subscribers_same_olt_device(df):
Chetan Gaonkerfe1048f2017-06-13 20:16:25 +00001892 aaa_app = ["org.opencord.aaa"]
1893 log_test.info('Enabling ponsim_olt')
1894 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
1895 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
1896 devices_list = self.voltha.get_devices()
1897 log_test.info('All available devices on voltha = %s'%devices_list['items'])
1898
1899 onu_device_id = devices_list['items'][1]['id']
1900 assert_not_equal(device_id, None)
1901 voltha = VolthaCtrl(self.VOLTHA_HOST,
1902 rest_port = self.VOLTHA_REST_PORT,
1903 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
1904 time.sleep(10)
1905 switch_map = None
1906 olt_configured = False
1907 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
1908 log_test.info('Installing OLT app')
1909 OnosCtrl.install_app(self.olt_app_file)
1910 time.sleep(5)
1911 log_test.info('Adding subscribers through OLT app')
1912 self.config_olt(switch_map)
1913 olt_configured = True
1914 time.sleep(5)
1915 devices_list = self.voltha.get_devices()
1916 thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT,))
1917 thread2 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_2_RX_DEFAULT, "no_cert",))
1918 thread1.start()
1919 time.sleep(randint(1,2))
1920 log_test.info('Initiating tls auth packets from one more subscriber on same olt device which is deteced on voltha')
1921 thread2.start()
1922 time.sleep(10)
1923 thread1.join()
1924 thread2.join()
1925 try:
1926 # assert_equal(status, True)
1927 assert_equal(self.success, True)
1928 time.sleep(10)
1929 finally:
1930 self.voltha.disable_device(device_id, delete = True)
1931 df.callback(0)
Thangavelu K Se6c77c72017-06-23 21:28:48 +00001932 reactor.callLater(0, tls_flow_check_on_two_subscribers_same_olt_device, df)
Chetan Gaonkerfe1048f2017-06-13 20:16:25 +00001933 return df
1934
1935 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S36edb012017-07-05 18:24:12 +00001936 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 +00001937 """
1938 Test Method:
1939 0. Make sure that voltha is up and running on CORD-POD setup.
1940 1. OLT is detected and ONU ports(nni and 2 uni's) are being seen.
1941 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
1942 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
1943 4. Validate that eap tls valid auth packets are being exchanged between valid subscriber, onos and freeradius.
1944 5. Validate that eap tls invalid cert auth packets are being exchanged between invalid subscriber, onos and freeradius.
1945 6. Verify that valid subscriber authenticated successfully.
1946 7. Verify that invalid subscriber are not authenticated successfully.
1947 """
1948
Chetan Gaonkerfe1048f2017-06-13 20:16:25 +00001949 df = defer.Deferred()
Thangavelu K Se6c77c72017-06-23 21:28:48 +00001950 def tls_flow_check_on_two_subscribers_same_olt_device(df):
Chetan Gaonkerfe1048f2017-06-13 20:16:25 +00001951 aaa_app = ["org.opencord.aaa"]
1952 log_test.info('Enabling ponsim_olt')
1953 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
1954 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
1955 devices_list = self.voltha.get_devices()
1956 log_test.info('All available devices on voltha = %s'%devices_list['items'])
1957
1958 onu_device_id = devices_list['items'][1]['id']
1959 assert_not_equal(device_id, None)
1960 voltha = VolthaCtrl(self.VOLTHA_HOST,
1961 rest_port = self.VOLTHA_REST_PORT,
1962 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
1963 time.sleep(10)
1964 switch_map = None
1965 olt_configured = False
1966 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
1967 log_test.info('Installing OLT app')
1968 OnosCtrl.install_app(self.olt_app_file)
1969 time.sleep(5)
1970 log_test.info('Adding subscribers through OLT app')
1971 self.config_olt(switch_map)
1972 olt_configured = True
1973 time.sleep(5)
1974 devices_list = self.voltha.get_devices()
1975 thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT,))
1976 thread2 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_2_RX_DEFAULT, "invalid_cert",))
1977 thread1.start()
1978 time.sleep(randint(1,2))
1979 log_test.info('Initiating tls auth packets from one more subscriber on same olt device which is deteced on voltha')
1980 thread2.start()
1981 time.sleep(10)
1982 thread1.join()
1983 thread2.join()
1984 try:
1985 # assert_equal(status, True)
1986 assert_equal(self.success, True)
1987 time.sleep(10)
1988 finally:
1989 self.voltha.disable_device(device_id, delete = True)
1990 df.callback(0)
Thangavelu K Se6c77c72017-06-23 21:28:48 +00001991 reactor.callLater(0, tls_flow_check_on_two_subscribers_same_olt_device, df)
Chetan Gaonkerfe1048f2017-06-13 20:16:25 +00001992 return df
1993
1994 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S36edb012017-07-05 18:24:12 +00001995 def test_two_subscribers_with_voltha_for_eap_tls_authentication_with_one_uni_port_disabled(self):
Thangavelu K S008f38e2017-05-15 19:36:55 +00001996 """
1997 Test Method:
1998 0. Make sure that voltha is up and running on CORD-POD setup.
1999 1. OLT and ONU is detected and validated.
2000 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
2001 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
2002 5. Validate that eap tls packets are being exchanged between two subscriber, onos and freeradius.
2003 6. Verify that subscriber authenticated successfully.
2004 7. Disable one of the uni port which is seen in voltha and issue tls auth packets from subscriber.
2005 8. Validate that eap tls packets are not being exchanged between one subscriber, onos and freeradius.
2006 9. Verify that subscriber authentication is unsuccessful..
2007 10. Verify that other subscriber authenticated successfully.
2008 """
2009
Chetan Gaonkerfe1048f2017-06-13 20:16:25 +00002010 df = defer.Deferred()
Thangavelu K Se6c77c72017-06-23 21:28:48 +00002011 def tls_flow_check_on_two_subscribers_same_olt_device(df):
Chetan Gaonkerfe1048f2017-06-13 20:16:25 +00002012 aaa_app = ["org.opencord.aaa"]
2013 log_test.info('Enabling ponsim_olt')
2014 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
2015 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
2016 devices_list = self.voltha.get_devices()
2017 log_test.info('All available devices on voltha = %s'%devices_list['items'])
2018
2019 onu_device_id = devices_list['items'][1]['id']
2020 assert_not_equal(device_id, None)
2021 voltha = VolthaCtrl(self.VOLTHA_HOST,
2022 rest_port = self.VOLTHA_REST_PORT,
2023 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
2024 time.sleep(10)
2025 switch_map = None
2026 olt_configured = False
2027 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
2028 log_test.info('Installing OLT app')
2029 OnosCtrl.install_app(self.olt_app_file)
2030 time.sleep(5)
2031 log_test.info('Adding subscribers through OLT app')
2032 self.config_olt(switch_map)
2033 olt_configured = True
2034 time.sleep(5)
2035 devices_list = self.voltha.get_devices()
2036 thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT,))
2037 thread2 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_2_RX_DEFAULT, "uni_port_admin_down",))
2038 thread1.start()
2039 time.sleep(randint(1,2))
2040 log_test.info('Initiating tls auth packets from one more subscriber on same olt device which is deteced on voltha')
2041 thread2.start()
2042 time.sleep(10)
2043 thread1.join()
2044 thread2.join()
2045 try:
2046 # assert_equal(status, True)
2047 assert_equal(self.success, True)
2048 time.sleep(10)
2049 finally:
2050 self.voltha.disable_device(device_id, delete = True)
2051 df.callback(0)
Thangavelu K Se6c77c72017-06-23 21:28:48 +00002052 reactor.callLater(0, tls_flow_check_on_two_subscribers_same_olt_device, df)
Chetan Gaonkerfe1048f2017-06-13 20:16:25 +00002053 return df
2054
Thangavelu K S36edb012017-07-05 18:24:12 +00002055 def test_3_subscribers_with_voltha_for_eap_tls_authentication(self):
2056 """
2057 Test Method:
2058 0. Make sure that voltha is up and running on CORD-POD setup.
2059 1. OLT and ONU is detected and validated.
2060 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
2061 3. Issue auth request packets from CORD TESTER voltha test module acting as multipe subscribers (3 subscribers)
2062 4. Validate that eap tls valid auth packets are being exchanged between subscriber, onos and freeradius.
2063 5. Verify that subscriber is authenticated successfully.
2064 """
2065 """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each"""
2066 num_subscribers = 3
2067 num_channels = 1
2068 services = ('TLS')
2069 cbs = (self.tls_flow_check, None, None)
2070 self.voltha_subscribers(services, cbs = cbs,
2071 num_subscribers = num_subscribers,
2072 num_channels = num_channels)
2073
2074 def test_5_subscribers_with_voltha_for_eap_tls_authentication(self):
2075 """
2076 Test Method:
2077 0. Make sure that voltha is up and running on CORD-POD setup.
2078 1. OLT and ONU is detected and validated.
2079 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
2080 3. Issue auth request packets from CORD TESTER voltha test module acting as multipe subscribers (5 subscriber)
2081 4. Validate that eap tls valid auth packets are being exchanged between subscriber, onos and freeradius.
2082 5. Verify that subscriber is authenticated successfully.
2083 """
2084 """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each"""
2085 num_subscribers = 5
2086 num_channels = 1
2087 services = ('TLS')
2088 cbs = (self.tls_flow_check, None, None)
2089 self.voltha_subscribers(services, cbs = cbs,
2090 num_subscribers = num_subscribers,
2091 num_channels = num_channels)
2092
2093 def test_9_subscribers_with_voltha_for_eap_tls_authentication(self):
2094 """
2095 Test Method:
2096 0. Make sure that voltha is up and running on CORD-POD setup.
2097 1. OLT and ONU is detected and validated.
2098 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server.
2099 3. Issue auth request packets from CORD TESTER voltha test module acting as multipe subscribers (9 subscriber)
2100 4. Validate that eap tls valid auth packets are being exchanged between subscriber, onos and freeradius.
2101 5. Verify that subscriber is authenticated successfully.
2102 """
2103 """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each"""
2104 num_subscribers = 9
2105 num_channels = 1
2106 services = ('TLS')
2107 cbs = (self.tls_flow_check, None, None)
2108 self.voltha_subscribers(services, cbs = cbs,
2109 num_subscribers = num_subscribers,
2110 num_channels = num_channels)
2111
Chetan Gaonkerfe1048f2017-06-13 20:16:25 +00002112 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S008f38e2017-05-15 19:36:55 +00002113 def test_subscriber_with_voltha_for_dhcp_request(self):
2114 """
2115 Test Method:
2116 0. Make sure that voltha is up and running on CORD-POD setup.
2117 1. OLT and ONU is detected and validated.
2118 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
2119 3. Send dhcp request from residential subscrber to dhcp server which is running as onos app.
2120 4. Verify that subscriber get ip from dhcp server successfully.
2121 """
2122
Thangavelu K Sa1c71b42017-06-14 18:13:21 +00002123 df = defer.Deferred()
2124 def dhcp_flow_check_scenario(df):
2125 log_test.info('Enabling ponsim_olt')
2126 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
2127 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
2128 assert_not_equal(device_id, None)
2129 voltha = VolthaCtrl(self.VOLTHA_HOST,
2130 rest_port = self.VOLTHA_REST_PORT,
2131 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
2132 time.sleep(10)
2133 switch_map = None
2134 olt_configured = False
2135 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
2136 log_test.info('Installing OLT app')
2137 OnosCtrl.install_app(self.olt_app_file)
2138 time.sleep(5)
2139 log_test.info('Adding subscribers through OLT app')
2140 self.config_olt(switch_map)
2141 olt_configured = True
2142 time.sleep(5)
2143 dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT)
2144 try:
2145 assert_equal(dhcp_status, True)
2146 #assert_equal(status, True)
2147 time.sleep(10)
2148 finally:
2149 self.remove_olt(switch_map)
2150 self.voltha.disable_device(device_id, delete = True)
2151 df.callback(0)
2152
2153 reactor.callLater(0, dhcp_flow_check_scenario, df)
2154 return df
2155
2156 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S008f38e2017-05-15 19:36:55 +00002157 def test_subscriber_with_voltha_for_dhcp_request_with_invalid_broadcast_source_mac(self):
2158 """
2159 Test Method:
2160 0. Make sure that voltha is up and running on CORD-POD setup.
2161 1. OLT and ONU is detected and validated.
2162 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
2163 3. Send dhcp request with invalid source mac broadcast from residential subscrber to dhcp server which is running as onos app.
2164 4. Verify that subscriber should not get ip from dhcp server.
2165 """
2166
Thangavelu K Sa1c71b42017-06-14 18:13:21 +00002167 df = defer.Deferred()
2168 def dhcp_flow_check_scenario(df):
2169 log_test.info('Enabling ponsim_olt')
2170 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
2171 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
2172 assert_not_equal(device_id, None)
2173 voltha = VolthaCtrl(self.VOLTHA_HOST,
2174 rest_port = self.VOLTHA_REST_PORT,
2175 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
2176 time.sleep(10)
2177 switch_map = None
2178 olt_configured = False
2179 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
2180 log_test.info('Installing OLT app')
2181 OnosCtrl.install_app(self.olt_app_file)
2182 time.sleep(5)
2183 log_test.info('Adding subscribers through OLT app')
2184 self.config_olt(switch_map)
2185 olt_configured = True
2186 time.sleep(5)
2187 dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "invalid_src_mac_broadcast")
2188 try:
2189 assert_equal(dhcp_status, True)
Thangavelu K Se6c77c72017-06-23 21:28:48 +00002190 assert_equal(self.success, True)
Thangavelu K Sa1c71b42017-06-14 18:13:21 +00002191 #assert_equal(status, True)
2192 time.sleep(10)
2193 finally:
2194 self.voltha.disable_device(device_id, delete = True)
2195 self.remove_olt(switch_map)
2196 df.callback(0)
2197
2198 reactor.callLater(0, dhcp_flow_check_scenario, df)
2199 return df
2200
2201
2202 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S008f38e2017-05-15 19:36:55 +00002203 def test_subscriber_with_voltha_for_dhcp_request_with_invalid_multicast_source_mac(self):
2204 """
2205 Test Method:
2206 0. Make sure that voltha is up and running on CORD-POD setup.
2207 1. OLT and ONU is detected and validated.
2208 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
2209 3. Send dhcp request with invalid source mac multicast from residential subscrber to dhcp server which is running as onos app.
2210 4. Verify that subscriber should not get ip from dhcp server.
2211 """
2212
Thangavelu K Sa1c71b42017-06-14 18:13:21 +00002213 df = defer.Deferred()
2214 def dhcp_flow_check_scenario(df):
2215 log_test.info('Enabling ponsim_olt')
2216 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
2217 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
2218 assert_not_equal(device_id, None)
2219 voltha = VolthaCtrl(self.VOLTHA_HOST,
2220 rest_port = self.VOLTHA_REST_PORT,
2221 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
2222 time.sleep(10)
2223 switch_map = None
2224 olt_configured = False
2225 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
2226 log_test.info('Installing OLT app')
2227 OnosCtrl.install_app(self.olt_app_file)
2228 time.sleep(5)
2229 log_test.info('Adding subscribers through OLT app')
2230 self.config_olt(switch_map)
2231 olt_configured = True
2232 time.sleep(5)
2233 dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "invalid_src_mac_multicast")
2234 try:
2235 assert_equal(dhcp_status, True)
2236 #assert_equal(status, True)
2237 time.sleep(10)
2238 finally:
2239 self.voltha.disable_device(device_id, delete = True)
2240 self.remove_olt(switch_map)
2241 df.callback(0)
2242
2243 reactor.callLater(0, dhcp_flow_check_scenario, df)
2244 return df
2245
2246 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S008f38e2017-05-15 19:36:55 +00002247 def test_subscriber_with_voltha_for_dhcp_request_with_invalid_source_mac(self):
2248 """
2249 Test Method:
2250 0. Make sure that voltha is up and running on CORD-POD setup.
2251 1. OLT and ONU is detected and validated.
2252 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
2253 3. Send dhcp request with invalid source mac zero from residential subscrber to dhcp server which is running as onos app.
2254 4. Verify that subscriber should not get ip from dhcp server.
2255 """
Thangavelu K Sa1c71b42017-06-14 18:13:21 +00002256 df = defer.Deferred()
2257 def dhcp_flow_check_scenario(df):
2258 log_test.info('Enabling ponsim_olt')
2259 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
2260 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
2261 assert_not_equal(device_id, None)
2262 voltha = VolthaCtrl(self.VOLTHA_HOST,
2263 rest_port = self.VOLTHA_REST_PORT,
2264 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
2265 time.sleep(10)
2266 switch_map = None
2267 olt_configured = False
2268 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
2269 log_test.info('Installing OLT app')
2270 OnosCtrl.install_app(self.olt_app_file)
2271 time.sleep(5)
2272 log_test.info('Adding subscribers through OLT app')
2273 self.config_olt(switch_map)
2274 olt_configured = True
2275 time.sleep(5)
2276 dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "invalid_src_mac_junk")
2277 try:
2278 assert_equal(dhcp_status, True)
2279 #assert_equal(status, True)
2280 time.sleep(10)
2281 finally:
2282 self.voltha.disable_device(device_id, delete = True)
2283 self.remove_olt(switch_map)
2284 df.callback(0)
Thangavelu K S008f38e2017-05-15 19:36:55 +00002285
Thangavelu K Sa1c71b42017-06-14 18:13:21 +00002286 reactor.callLater(0, dhcp_flow_check_scenario, df)
2287 return df
2288
2289 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S008f38e2017-05-15 19:36:55 +00002290 def test_subscriber_with_voltha_for_dhcp_request_and_release(self):
2291 """
2292 Test Method:
2293 0. Make sure that voltha is up and running on CORD-POD setup.
2294 1. OLT and ONU is detected and validated.
2295 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
2296 3. Send dhcp request from residential subscrber to dhcp server which is running as onos app.
2297 4. Verify that subscriber get ip from dhcp server successfully.
2298 5. Send dhcp release from residential subscrber to dhcp server which is running as onos app.
2299 6 Verify that subscriber should not get ip from dhcp server, ping to gateway.
2300 """
Thangavelu K Sa1c71b42017-06-14 18:13:21 +00002301 df = defer.Deferred()
2302 def dhcp_flow_check_scenario(df):
2303 log_test.info('Enabling ponsim_olt')
2304 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
2305 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
2306 assert_not_equal(device_id, None)
2307 voltha = VolthaCtrl(self.VOLTHA_HOST,
2308 rest_port = self.VOLTHA_REST_PORT,
2309 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
2310 time.sleep(10)
2311 switch_map = None
2312 olt_configured = False
2313 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
2314 log_test.info('Installing OLT app')
2315 OnosCtrl.install_app(self.olt_app_file)
2316 time.sleep(5)
2317 log_test.info('Adding subscribers through OLT app')
2318 self.config_olt(switch_map)
2319 olt_configured = True
2320 time.sleep(5)
2321 dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "request_release")
2322 try:
2323 assert_equal(dhcp_status, True)
2324 #assert_equal(status, True)
2325 time.sleep(10)
2326 finally:
2327 self.voltha.disable_device(device_id, delete = True)
2328 self.remove_olt(switch_map)
2329 df.callback(0)
2330
2331 reactor.callLater(0, dhcp_flow_check_scenario, df)
2332 return df
Thangavelu K S008f38e2017-05-15 19:36:55 +00002333
Thangavelu K S735a6662017-06-15 18:08:23 +00002334
2335 @deferred(TESTCASE_TIMEOUT)
A.R Karthick57fa9372017-05-24 12:47:03 -07002336 def test_subscriber_with_voltha_for_dhcp_starvation_positive_scenario(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00002337 """
2338 Test Method:
2339 0. Make sure that voltha is up and running on CORD-POD setup.
2340 1. OLT and ONU is detected and validated.
2341 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
2342 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
2343 4. Verify that subscriber get ip from dhcp server successfully.
2344 5. Repeat step 3 and 4 for 10 times.
2345 6 Verify that subscriber should get ip from dhcp server.
2346 """
Thangavelu K S735a6662017-06-15 18:08:23 +00002347 df = defer.Deferred()
2348 def dhcp_flow_check_scenario(df):
2349 log_test.info('Enabling ponsim_olt')
2350 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
2351 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
2352 assert_not_equal(device_id, None)
2353 voltha = VolthaCtrl(self.VOLTHA_HOST,
2354 rest_port = self.VOLTHA_REST_PORT,
2355 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
2356 time.sleep(10)
2357 switch_map = None
2358 olt_configured = False
2359 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
2360 log_test.info('Installing OLT app')
2361 OnosCtrl.install_app(self.olt_app_file)
2362 time.sleep(5)
2363 log_test.info('Adding subscribers through OLT app')
2364 self.config_olt(switch_map)
2365 olt_configured = True
2366 time.sleep(5)
2367 dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "starvation_positive")
2368 try:
2369 assert_equal(dhcp_status, True)
2370 #assert_equal(status, True)
2371 time.sleep(10)
2372 finally:
2373 self.voltha.disable_device(device_id, delete = True)
2374 self.remove_olt(switch_map)
2375 df.callback(0)
Thangavelu K S057b7d22017-05-16 22:03:22 +00002376
Thangavelu K S735a6662017-06-15 18:08:23 +00002377 reactor.callLater(0, dhcp_flow_check_scenario, df)
2378 return df
2379
2380
2381
2382 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S057b7d22017-05-16 22:03:22 +00002383 def test_subscriber_with_voltha_for_dhcp_starvation_negative_scenario(self):
2384 """
2385 Test Method:
2386 0. Make sure that voltha is up and running on CORD-POD setup.
2387 1. OLT and ONU is detected and validated.
2388 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
2389 3. Send dhcp request from residential subscriber without of pool ip to dhcp server which is running as onos app.
2390 4. Verify that subscriber should not get ip from dhcp server.
2391 5. Repeat steps 3 and 4 for 10 times.
2392 6 Verify that subscriber should not get ip from dhcp server.
2393 """
Thangavelu K S735a6662017-06-15 18:08:23 +00002394 df = defer.Deferred()
2395 def dhcp_flow_check_scenario(df):
2396 log_test.info('Enabling ponsim_olt')
2397 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
2398 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
2399 assert_not_equal(device_id, None)
2400 voltha = VolthaCtrl(self.VOLTHA_HOST,
2401 rest_port = self.VOLTHA_REST_PORT,
2402 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
2403 time.sleep(10)
2404 switch_map = None
2405 olt_configured = False
2406 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
2407 log_test.info('Installing OLT app')
2408 OnosCtrl.install_app(self.olt_app_file)
2409 time.sleep(5)
2410 log_test.info('Adding subscribers through OLT app')
2411 self.config_olt(switch_map)
2412 olt_configured = True
2413 time.sleep(5)
2414 dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "starvation_negative")
2415 try:
2416 assert_equal(dhcp_status, True)
2417 #assert_equal(status, True)
2418 time.sleep(10)
2419 finally:
2420 self.voltha.disable_device(device_id, delete = True)
2421 self.remove_olt(switch_map)
2422 df.callback(0)
2423
2424 reactor.callLater(0, dhcp_flow_check_scenario, df)
2425 return df
2426
2427
2428 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S057b7d22017-05-16 22:03:22 +00002429 def test_subscriber_with_voltha_for_dhcp_sending_multiple_discover(self):
2430 """
2431 Test Method:
2432 0. Make sure that voltha is up and running on CORD-POD setup.
2433 1. OLT and ONU is detected and validated.
2434 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
2435 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
2436 4. Verify that subscriber get ip from dhcp server successfully.
2437 5. Repeat step 3 for 50 times.
2438 6 Verify that subscriber should get same ip which was received from 1st discover from dhcp server.
2439 """
Thangavelu K S735a6662017-06-15 18:08:23 +00002440 df = defer.Deferred()
2441 def dhcp_flow_check_scenario(df):
2442 log_test.info('Enabling ponsim_olt')
2443 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
2444 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
2445 assert_not_equal(device_id, None)
2446 voltha = VolthaCtrl(self.VOLTHA_HOST,
2447 rest_port = self.VOLTHA_REST_PORT,
2448 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
2449 time.sleep(10)
2450 switch_map = None
2451 olt_configured = False
2452 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
2453 log_test.info('Installing OLT app')
2454 OnosCtrl.install_app(self.olt_app_file)
2455 time.sleep(5)
2456 log_test.info('Adding subscribers through OLT app')
2457 self.config_olt(switch_map)
2458 olt_configured = True
2459 time.sleep(5)
2460 dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "multiple_discover")
2461 try:
2462 assert_equal(dhcp_status, True)
2463 #assert_equal(status, True)
2464 time.sleep(10)
2465 finally:
2466 self.voltha.disable_device(device_id, delete = True)
2467 self.remove_olt(switch_map)
2468 df.callback(0)
2469
2470 reactor.callLater(0, dhcp_flow_check_scenario, df)
2471 return df
2472
Thangavelu K S735a6662017-06-15 18:08:23 +00002473 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S057b7d22017-05-16 22:03:22 +00002474 def test_subscriber_with_voltha_for_dhcp_sending_multiple_request(self):
2475 """
2476 Test Method:
2477 0. Make sure that voltha is up and running on CORD-POD setup.
2478 1. OLT and ONU is detected and validated.
2479 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
2480 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
2481 4. Verify that subscriber get ip from dhcp server successfully.
2482 5. Send DHCP request to dhcp server which is running as onos app.
2483 6. Repeat step 5 for 50 times.
2484 7. Verify that subscriber should get same ip which was received from 1st discover from dhcp server.
2485 """
Thangavelu K S735a6662017-06-15 18:08:23 +00002486 df = defer.Deferred()
2487 def dhcp_flow_check_scenario(df):
2488 log_test.info('Enabling ponsim_olt')
2489 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
2490 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
2491 assert_not_equal(device_id, None)
2492 voltha = VolthaCtrl(self.VOLTHA_HOST,
2493 rest_port = self.VOLTHA_REST_PORT,
2494 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
2495 time.sleep(10)
2496 switch_map = None
2497 olt_configured = False
2498 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
2499 log_test.info('Installing OLT app')
2500 OnosCtrl.install_app(self.olt_app_file)
2501 time.sleep(5)
2502 log_test.info('Adding subscribers through OLT app')
2503 self.config_olt(switch_map)
2504 olt_configured = True
2505 time.sleep(5)
2506 dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "multiple_requests")
2507 try:
2508 assert_equal(dhcp_status, True)
2509 #assert_equal(status, True)
2510 time.sleep(10)
2511 finally:
2512 self.voltha.disable_device(device_id, delete = True)
2513 self.remove_olt(switch_map)
2514 df.callback(0)
Thangavelu K S057b7d22017-05-16 22:03:22 +00002515
Thangavelu K S735a6662017-06-15 18:08:23 +00002516 reactor.callLater(0, dhcp_flow_check_scenario, df)
2517 return df
2518
Thangavelu K S735a6662017-06-15 18:08:23 +00002519 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S057b7d22017-05-16 22:03:22 +00002520 def test_subscriber_with_voltha_for_dhcp_requesting_desired_ip_address(self):
2521 """
2522 Test Method:
2523 0. Make sure that voltha is up and running on CORD-POD setup.
2524 1. OLT and ONU is detected and validated.
2525 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
2526 3. Send dhcp request with desired ip address from residential subscriber to dhcp server which is running as onos app.
2527 4. Verify that subscriber get ip which was requested in step 3 from dhcp server successfully.
2528 """
Thangavelu K S735a6662017-06-15 18:08:23 +00002529 df = defer.Deferred()
2530 def dhcp_flow_check_scenario(df):
2531 log_test.info('Enabling ponsim_olt')
2532 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
2533 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
2534 assert_not_equal(device_id, None)
2535 voltha = VolthaCtrl(self.VOLTHA_HOST,
2536 rest_port = self.VOLTHA_REST_PORT,
2537 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
2538 time.sleep(10)
2539 switch_map = None
2540 olt_configured = False
2541 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
2542 log_test.info('Installing OLT app')
2543 OnosCtrl.install_app(self.olt_app_file)
2544 time.sleep(5)
2545 log_test.info('Adding subscribers through OLT app')
2546 self.config_olt(switch_map)
2547 olt_configured = True
2548 time.sleep(5)
2549 dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "desired_ip_address")
2550 try:
2551 assert_equal(dhcp_status, True)
2552 #assert_equal(status, True)
2553 time.sleep(10)
2554 finally:
2555 self.voltha.disable_device(device_id, delete = True)
2556 self.remove_olt(switch_map)
2557 df.callback(0)
Thangavelu K S057b7d22017-05-16 22:03:22 +00002558
Thangavelu K S735a6662017-06-15 18:08:23 +00002559 reactor.callLater(0, dhcp_flow_check_scenario, df)
2560 return df
2561
2562 @deferred(TESTCASE_TIMEOUT)
2563 def test_subscriber_with_voltha_for_dhcp_requesting_desired_out_of_pool_ip_address(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00002564 """
2565 Test Method:
2566 0. Make sure that voltha is up and running on CORD-POD setup.
2567 1. OLT and ONU is detected and validated.
2568 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
2569 3. Send dhcp request with desired out of pool ip address from residential subscriber to dhcp server which is running as onos app.
2570 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.
2571 """
Thangavelu K S735a6662017-06-15 18:08:23 +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, "desired_out_of_pool_ip_address")
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
Thangavelu K S735a6662017-06-15 18:08:23 +00002605 @deferred(TESTCASE_TIMEOUT)
2606 def test_subscriber_with_voltha_deactivating_dhcp_app_in_onos(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00002607 """
2608 Test Method:
2609 0. Make sure that voltha is up and running on CORD-POD setup.
2610 1. OLT and ONU is detected and validated.
2611 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
2612 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
2613 4. Verify that subscriber get ip from dhcp server successfully.
2614 5. Deactivate dhcp server app in onos.
2615 6. Repeat step 3.
2616 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway.
2617 """
Thangavelu K S735a6662017-06-15 18:08:23 +00002618 df = defer.Deferred()
2619 dhcp_app = 'org.onosproject.dhcp'
2620 def dhcp_flow_check_scenario(df):
2621 log_test.info('Enabling ponsim_olt')
2622 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
2623 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
2624 assert_not_equal(device_id, None)
2625 voltha = VolthaCtrl(self.VOLTHA_HOST,
2626 rest_port = self.VOLTHA_REST_PORT,
2627 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
2628 time.sleep(10)
2629 switch_map = None
2630 olt_configured = False
2631 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
2632 log_test.info('Installing OLT app')
2633 OnosCtrl.install_app(self.olt_app_file)
2634 time.sleep(5)
2635 log_test.info('Adding subscribers through OLT app')
2636 self.config_olt(switch_map)
2637 olt_configured = True
2638 time.sleep(5)
Thangavelu K Se6c77c72017-06-23 21:28:48 +00002639 thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT, "interrupting_dhcp_flows",))
Thangavelu K S735a6662017-06-15 18:08:23 +00002640 thread2 = threading.Thread(target = self.deactivate_apps, args = (dhcp_app,))
2641 log_test.info('Restart dhcp app in onos during client send discover to voltha')
2642 thread2.start()
Thangavelu K S735a6662017-06-15 18:08:23 +00002643 thread1.start()
2644 time.sleep(10)
2645 thread1.join()
2646 thread2.join()
2647 try:
2648 assert_equal(self.success, True)
2649 #assert_equal(status, True)
2650 time.sleep(10)
2651 finally:
2652 self.voltha.disable_device(device_id, delete = True)
2653 self.remove_olt(switch_map)
2654 df.callback(0)
2655
2656 reactor.callLater(0, dhcp_flow_check_scenario, df)
2657 return df
2658
2659 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S057b7d22017-05-16 22:03:22 +00002660 def test_subscriber_with_voltha_for_dhcp_renew_time(self):
2661 """
2662 Test Method:
2663 0. Make sure that voltha is up and running on CORD-POD setup.
2664 1. OLT and ONU is detected and validated.
2665 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
2666 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
2667 4. Verify that subscriber get ip from dhcp server successfully.
2668 5. Send dhcp renew packet to dhcp server which is running as onos app.
2669 6. Repeat step 4.
2670 """
Thangavelu K Se6c77c72017-06-23 21:28:48 +00002671
Thangavelu K S0f2c5232017-06-19 19:11:43 +00002672 df = defer.Deferred()
2673 def dhcp_flow_check_scenario(df):
2674 log_test.info('Enabling ponsim_olt')
2675 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
2676 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
2677 assert_not_equal(device_id, None)
2678 voltha = VolthaCtrl(self.VOLTHA_HOST,
2679 rest_port = self.VOLTHA_REST_PORT,
2680 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
2681 time.sleep(10)
2682 switch_map = None
2683 olt_configured = False
2684 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
2685 log_test.info('Installing OLT app')
2686 OnosCtrl.install_app(self.olt_app_file)
2687 time.sleep(5)
2688 log_test.info('Adding subscribers through OLT app')
2689 self.config_olt(switch_map)
2690 olt_configured = True
2691 time.sleep(5)
2692 dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "dhcp_renew")
2693 try:
2694 assert_equal(dhcp_status, True)
2695 #assert_equal(status, True)
2696 time.sleep(10)
2697 finally:
2698 self.voltha.disable_device(device_id, delete = True)
2699 self.remove_olt(switch_map)
2700 df.callback(0)
2701
2702 reactor.callLater(0, dhcp_flow_check_scenario, df)
2703 return df
2704
2705 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S057b7d22017-05-16 22:03:22 +00002706 def test_subscriber_with_voltha_for_dhcp_rebind_time(self):
2707 """
2708 Test Method:
2709 0. Make sure that voltha is up and running on CORD-POD setup.
2710 1. OLT and ONU is detected and validated.
2711 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
2712 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
2713 4. Verify that subscriber get ip from dhcp server successfully.
2714 5. Send dhcp rebind packet to dhcp server which is running as onos app.
2715 6. Repeat step 4.
2716 """
Thangavelu K S0f2c5232017-06-19 19:11:43 +00002717 df = defer.Deferred()
2718 def dhcp_flow_check_scenario(df):
2719 log_test.info('Enabling ponsim_olt')
2720 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
2721 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
2722 assert_not_equal(device_id, None)
2723 voltha = VolthaCtrl(self.VOLTHA_HOST,
2724 rest_port = self.VOLTHA_REST_PORT,
2725 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
2726 time.sleep(10)
2727 switch_map = None
2728 olt_configured = False
2729 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
2730 log_test.info('Installing OLT app')
2731 OnosCtrl.install_app(self.olt_app_file)
2732 time.sleep(5)
2733 log_test.info('Adding subscribers through OLT app')
2734 self.config_olt(switch_map)
2735 olt_configured = True
2736 time.sleep(5)
2737 dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "dhcp_rebind")
2738 try:
2739 assert_equal(dhcp_status, True)
2740 #assert_equal(status, True)
2741 time.sleep(10)
2742 finally:
2743 self.voltha.disable_device(device_id, delete = True)
2744 self.remove_olt(switch_map)
2745 df.callback(0)
2746
2747 reactor.callLater(0, dhcp_flow_check_scenario, df)
2748 return df
2749
2750
Thangavelu K S0f2c5232017-06-19 19:11:43 +00002751 @deferred(TESTCASE_TIMEOUT)
Thangavelu K Se6c77c72017-06-23 21:28:48 +00002752 def test_subscriber_with_voltha_for_dhcp_toggling_olt(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00002753 """
2754 Test Method:
2755 0. Make sure that voltha is up and running on CORD-POD setup.
2756 1. OLT and ONU is detected and validated.
2757 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
2758 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
2759 4. Verify that subscriber get ip from dhcp server successfully.
2760 5. Disable olt devices which is being detected in voltha CLI.
2761 6. Repeat step 3.
2762 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway.
2763 """
Thangavelu K S0f2c5232017-06-19 19:11:43 +00002764 df = defer.Deferred()
2765 dhcp_app = 'org.onosproject.dhcp'
2766 def dhcp_flow_check_scenario(df):
2767 log_test.info('Enabling ponsim_olt')
2768 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
2769 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
2770 assert_not_equal(device_id, None)
2771 voltha = VolthaCtrl(self.VOLTHA_HOST,
2772 rest_port = self.VOLTHA_REST_PORT,
2773 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
2774 time.sleep(10)
2775 switch_map = None
2776 olt_configured = False
2777 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
2778 log_test.info('Installing OLT app')
2779 OnosCtrl.install_app(self.olt_app_file)
2780 time.sleep(5)
2781 log_test.info('Adding subscribers through OLT app')
2782 self.config_olt(switch_map)
2783 olt_configured = True
2784 time.sleep(5)
2785 thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT, "interrupting_dhcp_flows",))
2786 thread2 = threading.Thread(target = self.voltha.disable_device, args = (device_id,False,))
2787 log_test.info('Disable the olt device in during client send discover to voltha')
2788 thread2.start()
2789# time.sleep(randint(0,1))
2790 thread1.start()
2791 time.sleep(10)
2792 thread1.join()
2793 thread2.join()
2794 try:
Chetan Gaonkercf37f262017-06-19 19:11:11 +00002795 assert_equal(self.success, True)
Thangavelu K S0f2c5232017-06-19 19:11:43 +00002796 #assert_equal(status, True)
2797 time.sleep(10)
2798 finally:
2799 self.voltha.disable_device(device_id, delete = True)
2800 self.remove_olt(switch_map)
2801 df.callback(0)
2802
2803 reactor.callLater(0, dhcp_flow_check_scenario, df)
2804 return df
2805
Thangavelu K Se6c77c72017-06-23 21:28:48 +00002806 @deferred(TESTCASE_TIMEOUT)
2807 def test_subscriber_with_voltha_for_dhcp_with_multiple_times_disabling_of_olt(self):
2808 """
2809 Test Method:
2810 0. Make sure that voltha is up and running on CORD-POD setup.
2811 1. OLT and ONU is detected and validated.
2812 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
2813 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
2814 4. Verify that subscriber get ip from dhcp server successfully.
2815 5. Disable olt devices which is being detected in voltha CLI.
2816 6. Repeat step 3.
2817 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway.
2818 8. Repeat steps from 3 to 7 for 10 times and finally verify dhcp flow
2819 """
2820 df = defer.Deferred()
2821 no_iterations = 10
2822 dhcp_app = 'org.onosproject.dhcp'
2823 def dhcp_flow_check_scenario(df):
2824 log_test.info('Enabling ponsim_olt')
2825 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
2826 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
2827 assert_not_equal(device_id, None)
2828 voltha = VolthaCtrl(self.VOLTHA_HOST,
2829 rest_port = self.VOLTHA_REST_PORT,
2830 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
2831 time.sleep(10)
2832 switch_map = None
2833 olt_configured = False
2834 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
2835 log_test.info('Installing OLT app')
2836 OnosCtrl.install_app(self.olt_app_file)
2837 time.sleep(5)
2838 log_test.info('Adding subscribers through OLT app')
2839 self.config_olt(switch_map)
2840 olt_configured = True
2841 time.sleep(5)
2842 for i in range(no_iterations):
2843 thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT, "interrupting_dhcp_flows",))
2844 thread2 = threading.Thread(target = self.voltha.disable_device, args = (device_id,False,))
2845 log_test.info('Disable the olt device in during client send discover to voltha')
2846 thread2.start()
2847# time.sleep(randint(0,1))
2848 thread1.start()
2849 time.sleep(10)
2850 thread1.join()
2851 thread2.join()
2852 dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT)
2853 try:
2854 assert_equal(self.success, True)
2855 assert_equal(dhcp_status, True)
2856 #assert_equal(status, True)
2857 time.sleep(10)
2858 finally:
2859 self.voltha.disable_device(device_id, delete = True)
2860 self.remove_olt(switch_map)
2861 df.callback(0)
2862
2863 reactor.callLater(0, dhcp_flow_check_scenario, df)
2864 return df
2865
Thangavelu K S0f2c5232017-06-19 19:11:43 +00002866 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00002867 def test_subscriber_with_voltha_for_dhcp_toggling_olt(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00002868 """
2869 Test Method:
2870 0. Make sure that voltha is up and running on CORD-POD setup.
2871 1. OLT and ONU is detected and validated.
2872 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
2873 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
2874 4. Verify that subscriber get ip from dhcp server successfully.
2875 5. Disable olt devices which is being detected in voltha CLI.
2876 6. Repeat step 3.
2877 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway.
2878 8. Enable olt devices which is being detected in voltha CLI.
2879 9. Repeat steps 3 and 4.
2880 """
Thangavelu K S0f2c5232017-06-19 19:11:43 +00002881 df = defer.Deferred()
2882 dhcp_app = 'org.onosproject.dhcp'
2883 def dhcp_flow_check_scenario(df):
2884 log_test.info('Enabling ponsim_olt')
2885 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
2886 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
2887 assert_not_equal(device_id, None)
2888 voltha = VolthaCtrl(self.VOLTHA_HOST,
2889 rest_port = self.VOLTHA_REST_PORT,
2890 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
2891 time.sleep(10)
2892 switch_map = None
2893 olt_configured = False
2894 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
2895 log_test.info('Installing OLT app')
2896 OnosCtrl.install_app(self.olt_app_file)
2897 time.sleep(5)
2898 log_test.info('Adding subscribers through OLT app')
2899 self.config_olt(switch_map)
2900 olt_configured = True
2901 time.sleep(5)
2902 thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT, "interrupting_dhcp_flows",))
2903 thread2 = threading.Thread(target = self.voltha.restart_device, args = (device_id,))
2904 thread2.start()
2905 thread1.start()
2906 time.sleep(10)
2907 thread1.join()
2908 thread2.join()
2909 try:
Chetan Gaonkercf37f262017-06-19 19:11:11 +00002910 assert_equal(self.success, True)
Thangavelu K S0f2c5232017-06-19 19:11:43 +00002911 #assert_equal(status, True)
2912 time.sleep(10)
2913 finally:
2914 self.voltha.disable_device(device_id, delete = True)
2915 self.remove_olt(switch_map)
2916 df.callback(0)
2917
2918 reactor.callLater(0, dhcp_flow_check_scenario, df)
2919 return df
2920
Thangavelu K Se6c77c72017-06-23 21:28:48 +00002921 @deferred(TESTCASE_TIMEOUT)
2922 def test_subscriber_with_voltha_for_dhcp_toggling_olt_multiple_times(self):
2923 """
2924 Test Method:
2925 0. Make sure that voltha is up and running on CORD-POD setup.
2926 1. OLT and ONU is detected and validated.
2927 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
2928 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
2929 4. Verify that subscriber get ip from dhcp server successfully.
2930 5. Disable olt devices which is being detected in voltha CLI.
2931 6. Repeat step 3.
2932 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway.
2933 8. Enable olt devices which is being detected in voltha CLI.
2934 9. Repeat steps 3 and 4.
2935 """
2936
2937 df = defer.Deferred()
2938 no_iterations = 10
2939 dhcp_app = 'org.onosproject.dhcp'
2940 def dhcp_flow_check_scenario(df):
2941 log_test.info('Enabling ponsim_olt')
2942 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
2943 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
2944 assert_not_equal(device_id, None)
2945 voltha = VolthaCtrl(self.VOLTHA_HOST,
2946 rest_port = self.VOLTHA_REST_PORT,
2947 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
2948 time.sleep(10)
2949 switch_map = None
2950 olt_configured = False
2951 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
2952 log_test.info('Installing OLT app')
2953 OnosCtrl.install_app(self.olt_app_file)
2954 time.sleep(5)
2955 log_test.info('Adding subscribers through OLT app')
2956 self.config_olt(switch_map)
2957 olt_configured = True
2958 time.sleep(5)
2959 for i in range(no_iterations):
2960 thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT, "interrupting_dhcp_flows",))
2961 thread2 = threading.Thread(target = self.voltha.restart_device, args = (device_id,))
2962 thread2.start()
2963 thread1.start()
2964 time.sleep(10)
2965 thread1.join()
2966 thread2.join()
2967 dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT)
2968 try:
2969 assert_equal(dhcp_status, True)
2970 #assert_equal(status, True)
2971 assert_equal(self.success, True)
2972 time.sleep(10)
2973 finally:
2974 self.voltha.disable_device(device_id, delete = True)
2975 self.remove_olt(switch_map)
2976 df.callback(0)
2977
2978 reactor.callLater(0, dhcp_flow_check_scenario, df)
2979 return df
2980
Thangavelu K S0f2c5232017-06-19 19:11:43 +00002981 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00002982 def test_subscriber_with_voltha_for_dhcp_disabling_onu_port(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00002983 """
2984 Test Method:
2985 0. Make sure that voltha is up and running on CORD-POD setup.
2986 1. OLT and ONU is detected and validated.
2987 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
2988 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
2989 4. Verify that subscriber get ip from dhcp server successfully.
2990 5. Disable onu port which is being detected in voltha CLI.
2991 6. Repeat step 3.
2992 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway.
2993 """
Thangavelu K S0f2c5232017-06-19 19:11:43 +00002994 df = defer.Deferred()
2995 dhcp_app = 'org.onosproject.dhcp'
2996 def dhcp_flow_check_scenario(df):
2997 log_test.info('Enabling ponsim_olt')
2998 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
2999 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
3000 assert_not_equal(device_id, None)
3001 voltha = VolthaCtrl(self.VOLTHA_HOST,
3002 rest_port = self.VOLTHA_REST_PORT,
3003 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
3004 time.sleep(10)
3005 switch_map = None
3006 olt_configured = False
3007 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
3008 log_test.info('Installing OLT app')
3009 OnosCtrl.install_app(self.olt_app_file)
3010 time.sleep(5)
3011 log_test.info('Adding subscribers through OLT app')
3012 self.config_olt(switch_map)
3013 olt_configured = True
3014 time.sleep(5)
3015 thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT, "interrupting_dhcp_flows",))
3016 thread2 = threading.Thread(target = self.voltha_uni_port_down_up)
3017 thread1.start()
3018 thread2.start()
3019 time.sleep(10)
3020 thread1.join()
3021 thread2.join()
3022 try:
Chetan Gaonkercf37f262017-06-19 19:11:11 +00003023 assert_equal(self.success, True)
Thangavelu K S0f2c5232017-06-19 19:11:43 +00003024 #assert_equal(status, True)
3025 time.sleep(10)
3026 finally:
3027 self.voltha.disable_device(device_id, delete = True)
3028 self.remove_olt(switch_map)
3029 df.callback(0)
3030
3031 reactor.callLater(0, dhcp_flow_check_scenario, df)
3032 return df
3033
Thangavelu K Se6c77c72017-06-23 21:28:48 +00003034 @deferred(TESTCASE_TIMEOUT)
3035 def test_subscriber_with_voltha_for_dhcp_disabling_onu_port_multiple_times(self):
3036 """
3037 Test Method:
3038 0. Make sure that voltha is up and running on CORD-POD setup.
3039 1. OLT and ONU is detected and validated.
3040 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3041 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
3042 4. Verify that subscriber get ip from dhcp server successfully.
3043 5. Disable onu port which is being detected in voltha CLI.
3044 6. Repeat step 3.
3045 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway.
3046 """
3047 df = defer.Deferred()
3048 no_iterations = 10
3049 dhcp_app = 'org.onosproject.dhcp'
3050 def dhcp_flow_check_scenario(df):
3051 log_test.info('Enabling ponsim_olt')
3052 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
3053 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
3054 assert_not_equal(device_id, None)
3055 voltha = VolthaCtrl(self.VOLTHA_HOST,
3056 rest_port = self.VOLTHA_REST_PORT,
3057 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
3058 time.sleep(10)
3059 switch_map = None
3060 olt_configured = False
3061 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
3062 log_test.info('Installing OLT app')
3063 OnosCtrl.install_app(self.olt_app_file)
3064 time.sleep(5)
3065 log_test.info('Adding subscribers through OLT app')
3066 self.config_olt(switch_map)
3067 olt_configured = True
3068 time.sleep(5)
3069 for i in range(no_iterations):
3070 thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT, "interrupting_dhcp_flows",))
3071 thread2 = threading.Thread(target = self.voltha_uni_port_down_up)
3072 thread1.start()
3073 thread2.start()
3074 time.sleep(10)
3075 thread1.join()
3076 thread2.join()
3077 dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT)
3078 try:
3079 #assert_equal(status, True)
3080 assert_equal(dhcp_status, True)
3081 assert_equal(self.success, True)
3082 time.sleep(10)
3083 finally:
3084 self.voltha.disable_device(device_id, delete = True)
3085 self.remove_olt(switch_map)
3086 df.callback(0)
3087
3088 reactor.callLater(0, dhcp_flow_check_scenario, df)
3089 return df
Thangavelu K S0f2c5232017-06-19 19:11:43 +00003090
3091 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00003092 def test_subscriber_with_voltha_for_dhcp_toggling_onu_port(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00003093 """
3094 Test Method:
3095 0. Make sure that voltha is up and running on CORD-POD setup.
3096 1. OLT and ONU is detected and validated.
3097 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3098 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
3099 4. Verify that subscriber get ip from dhcp server successfully.
3100 5. Disable onu port which is being detected in voltha CLI.
3101 6. Repeat step 3.
3102 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway.
3103 8. Enable onu port which is being detected in voltha CLI.
3104 9. Repeat steps 3 and 4.
3105 """
3106
Thangavelu K S0f2c5232017-06-19 19:11:43 +00003107 df = defer.Deferred()
3108 dhcp_app = 'org.onosproject.dhcp'
3109 def dhcp_flow_check_scenario(df):
3110 log_test.info('Enabling ponsim_olt')
3111 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
3112 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
3113 assert_not_equal(device_id, None)
3114 voltha = VolthaCtrl(self.VOLTHA_HOST,
3115 rest_port = self.VOLTHA_REST_PORT,
3116 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
3117 time.sleep(10)
3118 switch_map = None
3119 olt_configured = False
3120 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
3121 log_test.info('Installing OLT app')
3122 OnosCtrl.install_app(self.olt_app_file)
3123 time.sleep(5)
3124 log_test.info('Adding subscribers through OLT app')
3125 self.config_olt(switch_map)
3126 olt_configured = True
3127 time.sleep(5)
3128 thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT, "interrupting_dhcp_flows",))
3129 thread2 = threading.Thread(target = self.voltha_uni_port_down_up)
3130 log_test.info('Restart dhcp app in onos during client send discover to voltha')
3131 thread2.start()
3132 time.sleep(randint(0,1))
3133 thread1.start()
3134 time.sleep(10)
3135 thread1.join()
3136 thread2.join()
3137 dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT)
3138 assert_equal(dhcp_status, True)
3139 try:
Chetan Gaonkercf37f262017-06-19 19:11:11 +00003140 assert_equal(self.success, True)
Thangavelu K S0f2c5232017-06-19 19:11:43 +00003141 #assert_equal(status, True)
3142 time.sleep(10)
3143 finally:
3144 self.voltha.disable_device(device_id, delete = True)
3145 self.remove_olt(switch_map)
3146 df.callback(0)
3147
3148 reactor.callLater(0, dhcp_flow_check_scenario, df)
3149 return df
3150
Thangavelu K Se6c77c72017-06-23 21:28:48 +00003151 @deferred(TESTCASE_TIMEOUT)
3152 def test_subscriber_with_voltha_for_dhcp_toggling_onu_port_multiple_times(self):
3153 """
3154 Test Method:
3155 0. Make sure that voltha is up and running on CORD-POD setup.
3156 1. OLT and ONU is detected and validated.
3157 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3158 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app.
3159 4. Verify that subscriber get ip from dhcp server successfully.
3160 5. Disable onu port which is being detected in voltha CLI.
3161 6. Repeat step 3.
3162 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway.
3163 8. Enable onu port which is being detected in voltha CLI.
3164 9. Repeat steps 3 and 4.
3165 """
3166
3167 df = defer.Deferred()
3168 no_iterations = 10
3169 dhcp_app = 'org.onosproject.dhcp'
3170 def dhcp_flow_check_scenario(df):
3171 log_test.info('Enabling ponsim_olt')
3172 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
3173 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
3174 assert_not_equal(device_id, None)
3175 voltha = VolthaCtrl(self.VOLTHA_HOST,
3176 rest_port = self.VOLTHA_REST_PORT,
3177 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
3178 time.sleep(10)
3179 switch_map = None
3180 olt_configured = False
3181 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
3182 log_test.info('Installing OLT app')
3183 OnosCtrl.install_app(self.olt_app_file)
3184 time.sleep(5)
3185 log_test.info('Adding subscribers through OLT app')
3186 self.config_olt(switch_map)
3187 olt_configured = True
3188 time.sleep(5)
3189 for i in range(no_iterations):
3190 thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT, "interrupting_dhcp_flows",))
3191 thread2 = threading.Thread(target = self.voltha_uni_port_down_up)
3192 log_test.info('Restart dhcp app in onos during client send discover to voltha')
3193 thread2.start()
3194 time.sleep(randint(0,1))
3195 thread1.start()
3196 time.sleep(10)
3197 thread1.join()
3198 thread2.join()
3199 dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT)
3200 assert_equal(dhcp_status, True)
3201 try:
3202 assert_equal(self.success, True)
3203 #assert_equal(status, True)
3204 time.sleep(10)
3205 finally:
3206 self.voltha.disable_device(device_id, delete = True)
3207 self.remove_olt(switch_map)
3208 df.callback(0)
3209
3210 reactor.callLater(0, dhcp_flow_check_scenario, df)
3211 return df
3212
Thangavelu K S0f2c5232017-06-19 19:11:43 +00003213 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00003214 def test_two_subscribers_with_voltha_for_dhcp_discover(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00003215 """
3216 Test Method:
3217 0. Make sure that voltha is up and running on CORD-POD setup.
3218 1. OLT and ONU is detected and validated.
3219 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3220 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app.
3221 4. Verify that subscribers had got different ips from dhcp server successfully.
3222 """
3223
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00003224 df = defer.Deferred()
3225 self.success = True
3226 dhcp_app = 'org.onosproject.dhcp'
3227 def dhcp_flow_check_scenario(df):
3228 log_test.info('Enabling ponsim_olt')
3229 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
3230 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
3231 assert_not_equal(device_id, None)
3232 voltha = VolthaCtrl(self.VOLTHA_HOST,
3233 rest_port = self.VOLTHA_REST_PORT,
3234 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
3235 time.sleep(10)
3236 switch_map = None
3237 olt_configured = False
3238 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
3239 log_test.info('Installing OLT app')
3240 OnosCtrl.install_app(self.olt_app_file)
3241 time.sleep(5)
3242 log_test.info('Adding subscribers through OLT app')
3243 self.config_olt(switch_map)
3244 olt_configured = True
3245 time.sleep(5)
3246 thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT,))
3247 thread2 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_2_RX_DEFAULT,))
3248 thread1.start()
3249 thread2.start()
3250 time.sleep(10)
3251 thread1.join()
3252 thread2.join()
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00003253 dhcp_flow_status = self.success
3254 try:
3255# if self.success is not True:
3256 assert_equal(dhcp_flow_status, True)
3257 #assert_equal(status, True)
3258 time.sleep(10)
3259 finally:
3260 self.voltha.disable_device(device_id, delete = True)
3261 self.remove_olt(switch_map)
3262 df.callback(0)
3263
3264 reactor.callLater(0, dhcp_flow_check_scenario, df)
3265 return df
3266
3267 @deferred(TESTCASE_TIMEOUT)
Thangavelu K Se6c77c72017-06-23 21:28:48 +00003268 def test_two_subscribers_with_voltha_for_dhcp_multiple_discover(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00003269 """
3270 Test Method:
3271 0. Make sure that voltha is up and running on CORD-POD setup.
3272 1. OLT and ONU is detected and validated.
3273 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3274 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app.
3275 4. Verify that subscribers had got ip from dhcp server successfully.
3276 5. Repeat step 3 and 4 for 10 times for both subscribers.
3277 6 Verify that subscribers should get same ips which are offered the first time from dhcp server.
3278 """
Thangavelu K Se6c77c72017-06-23 21:28:48 +00003279
3280
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00003281 df = defer.Deferred()
3282 self.success = True
3283 dhcp_app = 'org.onosproject.dhcp'
3284 def dhcp_flow_check_scenario(df):
3285 log_test.info('Enabling ponsim_olt')
3286 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
3287 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
3288 assert_not_equal(device_id, None)
3289 voltha = VolthaCtrl(self.VOLTHA_HOST,
3290 rest_port = self.VOLTHA_REST_PORT,
3291 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
3292 time.sleep(10)
3293 switch_map = None
3294 olt_configured = False
3295 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
3296 log_test.info('Installing OLT app')
3297 OnosCtrl.install_app(self.olt_app_file)
3298 time.sleep(5)
3299 log_test.info('Adding subscribers through OLT app')
3300 self.config_olt(switch_map)
3301 olt_configured = True
3302 time.sleep(5)
3303 thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT,"multiple_discover",))
3304 thread2 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_2_RX_DEFAULT,"multiple_discover",))
3305 thread1.start()
3306 thread2.start()
3307 time.sleep(10)
3308 thread1.join()
3309 thread2.join()
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00003310 dhcp_flow_status = self.success
3311 try:
3312# if self.success is not True:
3313 assert_equal(dhcp_flow_status, True)
3314 #assert_equal(status, True)
3315 time.sleep(10)
3316 finally:
3317 self.voltha.disable_device(device_id, delete = True)
3318 self.remove_olt(switch_map)
3319 df.callback(0)
3320
3321 reactor.callLater(0, dhcp_flow_check_scenario, df)
3322 return df
3323
3324 @deferred(TESTCASE_TIMEOUT)
Thangavelu K Se6c77c72017-06-23 21:28:48 +00003325 def test_two_subscribers_with_voltha_for_dhcp_and_with_multiple_discover_for_one_subscriber(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00003326 """
3327 Test Method:
3328 0. Make sure that voltha is up and running on CORD-POD setup.
3329 1. OLT and ONU is detected and validated.
3330 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3331 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app.
3332 4. Verify that subscribers had got ip from dhcp server successfully.
3333 5. Repeat step 3 and 4 for 10 times for only one subscriber and ping to gateway from other subscriber.
3334 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
3335 """
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00003336
3337 df = defer.Deferred()
3338 self.success = True
3339 dhcp_app = 'org.onosproject.dhcp'
3340 def dhcp_flow_check_scenario(df):
3341 log_test.info('Enabling ponsim_olt')
3342 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
3343 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
3344 assert_not_equal(device_id, None)
3345 voltha = VolthaCtrl(self.VOLTHA_HOST,
3346 rest_port = self.VOLTHA_REST_PORT,
3347 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
3348 time.sleep(10)
3349 switch_map = None
3350 olt_configured = False
3351 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
3352 log_test.info('Installing OLT app')
3353 OnosCtrl.install_app(self.olt_app_file)
3354 time.sleep(5)
3355 log_test.info('Adding subscribers through OLT app')
3356 self.config_olt(switch_map)
3357 olt_configured = True
3358 time.sleep(5)
3359 thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT,"multiple_discover",))
3360 thread2 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_2_RX_DEFAULT,))
3361 thread1.start()
3362 thread2.start()
3363 time.sleep(10)
3364 thread1.join()
3365 thread2.join()
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00003366 dhcp_flow_status = self.success
3367 try:
3368# if self.success is not True:
3369 assert_equal(dhcp_flow_status, True)
3370 #assert_equal(status, True)
3371 time.sleep(10)
3372 finally:
3373 self.voltha.disable_device(device_id, delete = True)
3374 self.remove_olt(switch_map)
3375 df.callback(0)
3376
3377 reactor.callLater(0, dhcp_flow_check_scenario, df)
3378 return df
3379
3380 @deferred(TESTCASE_TIMEOUT)
Thangavelu K Se6c77c72017-06-23 21:28:48 +00003381 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 +00003382 """
3383 Test Method:
3384 0. Make sure that voltha is up and running on CORD-POD setup.
3385 1. OLT and ONU is detected and validated.
3386 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3387 3. Send dhcp request from one residential subscriber to dhcp server which is running as onos app.
3388 3. Send dhcp request with desired ip from other residential subscriber to dhcp server which is running as onos app.
3389 4. Verify that subscribers had got different ips (one subscriber desired ip and other subscriber random ip) from dhcp server successfully.
3390 """
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00003391
3392 df = defer.Deferred()
3393 self.success = True
3394 dhcp_app = 'org.onosproject.dhcp'
3395 def dhcp_flow_check_scenario(df):
3396 log_test.info('Enabling ponsim_olt')
3397 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
3398 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
3399 assert_not_equal(device_id, None)
3400 voltha = VolthaCtrl(self.VOLTHA_HOST,
3401 rest_port = self.VOLTHA_REST_PORT,
3402 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
3403 time.sleep(10)
3404 switch_map = None
3405 olt_configured = False
3406 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
3407 log_test.info('Installing OLT app')
3408 OnosCtrl.install_app(self.olt_app_file)
3409 time.sleep(5)
3410 log_test.info('Adding subscribers through OLT app')
3411 self.config_olt(switch_map)
3412 olt_configured = True
3413 time.sleep(5)
3414 thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT,))
3415 thread2 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_2_RX_DEFAULT,"desired_ip_address",))
3416 thread1.start()
3417 thread2.start()
3418 time.sleep(10)
3419 thread1.join()
3420 thread2.join()
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00003421 dhcp_flow_status = self.success
3422 try:
3423# if self.success is not True:
3424 assert_equal(dhcp_flow_status, True)
3425 #assert_equal(status, True)
3426 time.sleep(10)
3427 finally:
3428 self.voltha.disable_device(device_id, delete = True)
3429 self.remove_olt(switch_map)
3430 df.callback(0)
3431
3432 reactor.callLater(0, dhcp_flow_check_scenario, df)
3433 return df
3434
3435 @deferred(TESTCASE_TIMEOUT)
Thangavelu K Se6c77c72017-06-23 21:28:48 +00003436 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 +00003437 """
3438 Test Method:
3439 0. Make sure that voltha is up and running on CORD-POD setup.
3440 1. OLT and ONU is detected and validated.
3441 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3442 3. Send dhcp request with desired wihtin dhcp pool ip from one residential subscriber to dhcp server which is running as onos app.
3443 3. Send dhcp request with desired without in dhcp pool ip from other residential subscriber to dhcp server which is running as onos app.
3444 4. Verify that subscribers had got different ips (both subscriber got random ips within dhcp pool) from dhcp server successfully.
3445 """
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00003446 df = defer.Deferred()
3447 self.success = True
3448 dhcp_app = 'org.onosproject.dhcp'
3449 def dhcp_flow_check_scenario(df):
3450 log_test.info('Enabling ponsim_olt')
3451 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
3452 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
3453 assert_not_equal(device_id, None)
3454 voltha = VolthaCtrl(self.VOLTHA_HOST,
3455 rest_port = self.VOLTHA_REST_PORT,
3456 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
3457 time.sleep(10)
3458 switch_map = None
3459 olt_configured = False
3460 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
3461 log_test.info('Installing OLT app')
3462 OnosCtrl.install_app(self.olt_app_file)
3463 time.sleep(5)
3464 log_test.info('Adding subscribers through OLT app')
3465 self.config_olt(switch_map)
3466 olt_configured = True
3467 time.sleep(5)
3468 thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT,"desired_ip_address",))
3469 thread2 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_2_RX_DEFAULT,"desired_out_of_pool_ip_address",))
3470 thread1.start()
3471 thread2.start()
3472 time.sleep(10)
3473 thread1.join()
3474 thread2.join()
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00003475 dhcp_flow_status = self.success
3476 try:
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00003477 assert_equal(dhcp_flow_status, True)
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00003478 time.sleep(10)
3479 finally:
3480 self.voltha.disable_device(device_id, delete = True)
3481 self.remove_olt(switch_map)
3482 df.callback(0)
3483
3484 reactor.callLater(0, dhcp_flow_check_scenario, df)
3485 return df
3486
3487 @deferred(TESTCASE_TIMEOUT)
3488 def test_two_subscribers_with_voltha_for_dhcp_disabling_onu_port_for_one_subscriber(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00003489 """
3490 Test Method:
3491 0. Make sure that voltha is up and running on CORD-POD setup.
3492 1. OLT and ONU is detected and validated.
3493 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3494 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app.
3495 4. Verify that subscribers had got ip from dhcp server successfully.
3496 5. Disable onu port on which access one subscriber and ping to gateway from other subscriber.
3497 6. Repeat step 3 and 4 for one subscriber where uni port is down.
3498 7. Verify that subscriber should not get ip from dhcp server and other subscriber ping to gateway should not failed.
3499 """
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00003500 df = defer.Deferred()
3501 self.success = True
3502 dhcp_app = 'org.onosproject.dhcp'
3503 def dhcp_flow_check_scenario(df):
3504 log_test.info('Enabling ponsim_olt')
3505 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
3506 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
3507 assert_not_equal(device_id, None)
3508 voltha = VolthaCtrl(self.VOLTHA_HOST,
3509 rest_port = self.VOLTHA_REST_PORT,
3510 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
3511 time.sleep(10)
3512 switch_map = None
3513 olt_configured = False
3514 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
3515 log_test.info('Installing OLT app')
3516 OnosCtrl.install_app(self.olt_app_file)
3517 time.sleep(5)
3518 log_test.info('Adding subscribers through OLT app')
3519 self.config_olt(switch_map)
3520 olt_configured = True
3521 time.sleep(5)
3522 thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT,"desired_ip_address",))
3523 thread2 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_2_RX_DEFAULT,"desired_out_of_pool_ip_address",))
3524 thread1.start()
3525 thread2.start()
3526 time.sleep(10)
3527 thread1.join()
3528 thread2.join()
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00003529 dhcp_flow_status = self.success
3530 try:
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00003531 assert_equal(dhcp_flow_status, True)
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00003532 time.sleep(10)
3533 finally:
3534 self.voltha.disable_device(device_id, delete = True)
3535 self.remove_olt(switch_map)
3536 df.callback(0)
3537
3538 reactor.callLater(0, dhcp_flow_check_scenario, df)
3539 return df
3540
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00003541 @deferred(TESTCASE_TIMEOUT)
3542 def test_two_subscribers_with_voltha_for_dhcp_toggling_onu_port_for_one_subscriber(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00003543 """
3544 Test Method:
3545 0. Make sure that voltha is up and running on CORD-POD setup.
3546 1. OLT and ONU is detected and validated.
3547 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3548 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app.
3549 4. Verify that subscribers had got ip from dhcp server successfully.
3550 5. Disable onu port on which access one subscriber and ping to gateway from other subscriber.
3551 6. Repeat step 3 and 4 for one subscriber where uni port is down.
3552 7. Verify that subscriber should not get ip from dhcp server and other subscriber ping to gateway should not failed.
3553 8. Enable onu port on which was disable at step 5 and ping to gateway from other subscriber.
3554 9. Repeat step 3 and 4 for one subscriber where uni port is up now.
3555 10. Verify that subscriber should get ip from dhcp server and other subscriber ping to gateway should not failed.
3556 """
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00003557 df = defer.Deferred()
3558 self.success = True
3559 dhcp_app = 'org.onosproject.dhcp'
3560 def dhcp_flow_check_scenario(df):
3561 log_test.info('Enabling ponsim_olt')
3562 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
3563 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
3564 assert_not_equal(device_id, None)
3565 voltha = VolthaCtrl(self.VOLTHA_HOST,
3566 rest_port = self.VOLTHA_REST_PORT,
3567 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
3568 time.sleep(10)
3569 switch_map = None
3570 olt_configured = False
3571 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
3572 log_test.info('Installing OLT app')
3573 OnosCtrl.install_app(self.olt_app_file)
3574 time.sleep(5)
3575 log_test.info('Adding subscribers through OLT app')
3576 self.config_olt(switch_map)
3577 olt_configured = True
3578 time.sleep(5)
3579 thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT,))
3580 thread2 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_2_RX_DEFAULT,))
3581 thread3 = threading.Thread(target = self.voltha_uni_port_down_up, args = (self.INTF_2_RX_DEFAULT,))
3582 thread1.start()
3583 thread2.start()
3584 thread3.start()
3585 time.sleep(10)
3586 thread1.join()
3587 thread2.join()
3588 thread3.join()
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00003589 dhcp_flow_status = self.success
3590 try:
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00003591 assert_equal(dhcp_flow_status, True)
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00003592 time.sleep(10)
3593 finally:
3594 self.voltha.disable_device(device_id, delete = True)
3595 self.remove_olt(switch_map)
3596 df.callback(0)
3597
3598 reactor.callLater(0, dhcp_flow_check_scenario, df)
3599 return df
3600
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00003601 @deferred(TESTCASE_TIMEOUT)
Thangavelu K Se6c77c72017-06-23 21:28:48 +00003602 def test_two_subscribers_with_voltha_for_dhcp_disabling_olt(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00003603 """
Thangavelu K Se6c77c72017-06-23 21:28:48 +00003604 Test Method: uni_port
Thangavelu K S057b7d22017-05-16 22:03:22 +00003605 0. Make sure that voltha is up and running on CORD-POD setup.
3606 1. OLT and ONU is detected and validated.
3607 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3608 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app.
3609 4. Verify that subscribers had got ip from dhcp server successfully.
3610 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber.
3611 6. Disable the olt device which is detected in voltha.
3612 7. Verify that subscriber should not get ip from dhcp server and other subscriber ping to gateway should failed.
3613 """
Thangavelu K Se6c77c72017-06-23 21:28:48 +00003614 df = defer.Deferred()
3615 self.success = True
3616 dhcp_app = 'org.onosproject.dhcp'
3617 def dhcp_flow_check_scenario(df):
3618 log_test.info('Enabling ponsim_olt')
3619 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
3620 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
3621 assert_not_equal(device_id, None)
3622 voltha = VolthaCtrl(self.VOLTHA_HOST,
3623 rest_port = self.VOLTHA_REST_PORT,
3624 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
3625 time.sleep(10)
3626 switch_map = None
3627 olt_configured = False
3628 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
3629 log_test.info('Installing OLT app')
3630 OnosCtrl.install_app(self.olt_app_file)
3631 time.sleep(5)
3632 log_test.info('Adding subscribers through OLT app')
3633 self.config_olt(switch_map)
3634 olt_configured = True
3635 time.sleep(5)
3636 thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT,))
3637 thread2 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_2_RX_DEFAULT,))
3638 thread3 = threading.Thread(target = self.voltha.disable_device, args = (device_id,False,))
3639
3640 thread1.start()
3641 thread2.start()
3642 thread3.start()
3643 time.sleep(10)
3644 thread1.join()
3645 thread2.join()
3646 thread3.join()
3647 dhcp_flow_status = self.success
3648 try:
Thangavelu K Se6c77c72017-06-23 21:28:48 +00003649 assert_equal(dhcp_flow_status, True)
Thangavelu K Se6c77c72017-06-23 21:28:48 +00003650 time.sleep(10)
3651 finally:
3652 self.voltha.disable_device(device_id, delete = True)
3653 self.remove_olt(switch_map)
3654 df.callback(0)
3655
3656 reactor.callLater(0, dhcp_flow_check_scenario, df)
3657 return df
3658
3659 @deferred(TESTCASE_TIMEOUT)
3660 def test_two_subscribers_with_voltha_for_dhcp_toggling_olt(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00003661 """
3662 Test Method:
3663 0. Make sure that voltha is up and running on CORD-POD setup.
3664 1. OLT and ONU is detected and validated.
3665 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3666 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app.
3667 4. Verify that subscribers had got ip from dhcp server successfully.
3668 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber.
3669 6. Disable the olt device which is detected in voltha.
3670 7. Verify that subscriber should not get ip from dhcp server and other subscriber ping to gateway should failed.
3671 8. Enable the olt device which is detected in voltha.
3672 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 +00003673
Thangavelu K S057b7d22017-05-16 22:03:22 +00003674 """
Thangavelu K Se6c77c72017-06-23 21:28:48 +00003675 df = defer.Deferred()
3676 self.success = True
3677 dhcp_app = 'org.onosproject.dhcp'
3678 def dhcp_flow_check_scenario(df):
3679 log_test.info('Enabling ponsim_olt')
3680 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
3681 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
3682 assert_not_equal(device_id, None)
3683 voltha = VolthaCtrl(self.VOLTHA_HOST,
3684 rest_port = self.VOLTHA_REST_PORT,
3685 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
3686 time.sleep(10)
3687 switch_map = None
3688 olt_configured = False
3689 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
3690 log_test.info('Installing OLT app')
3691 OnosCtrl.install_app(self.olt_app_file)
3692 time.sleep(5)
3693 log_test.info('Adding subscribers through OLT app')
3694 self.config_olt(switch_map)
3695 olt_configured = True
3696 time.sleep(5)
3697 thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT,))
3698 thread2 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_2_RX_DEFAULT,))
3699 thread3 = threading.Thread(target = self.voltha.restart_device, args = (device_id,))
3700 thread1.start()
3701 thread2.start()
3702 thread3.start()
3703 time.sleep(10)
3704 thread1.join()
3705 thread2.join()
3706 thread3.join()
3707 dhcp_flow_status = self.success
3708 try:
Thangavelu K Se6c77c72017-06-23 21:28:48 +00003709 assert_equal(dhcp_flow_status, True)
Thangavelu K Se6c77c72017-06-23 21:28:48 +00003710 time.sleep(10)
3711 finally:
3712 self.voltha.disable_device(device_id, delete = True)
3713 self.remove_olt(switch_map)
3714 df.callback(0)
3715
3716 reactor.callLater(0, dhcp_flow_check_scenario, df)
3717 return df
3718
3719 @deferred(TESTCASE_TIMEOUT)
3720 def test_two_subscribers_with_voltha_for_dhcp_with_paused_olt(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00003721 """
3722 Test Method:
3723 0. Make sure that voltha is up and running on CORD-POD setup.
3724 1. OLT and ONU is detected and validated.
3725 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3726 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app.
3727 4. Verify that subscribers had got ip from dhcp server successfully.
3728 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber.
3729 6. Pause the olt device which is detected in voltha.
3730 7. Verify that subscriber should not get ip from dhcp server and other subscriber ping to gateway should failed.
3731 """
Thangavelu K Se6c77c72017-06-23 21:28:48 +00003732 df = defer.Deferred()
3733 self.success = True
3734 dhcp_app = 'org.onosproject.dhcp'
3735 def dhcp_flow_check_scenario(df):
3736 log_test.info('Enabling ponsim_olt')
3737 ponsim_address = '{}:50060'.format(self.VOLTHA_HOST)
3738 device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address)
3739 assert_not_equal(device_id, None)
3740 voltha = VolthaCtrl(self.VOLTHA_HOST,
3741 rest_port = self.VOLTHA_REST_PORT,
3742 uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP)
3743 time.sleep(10)
3744 switch_map = None
3745 olt_configured = False
3746 switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE)
3747 log_test.info('Installing OLT app')
3748 OnosCtrl.install_app(self.olt_app_file)
3749 time.sleep(5)
3750 log_test.info('Adding subscribers through OLT app')
3751 self.config_olt(switch_map)
3752 olt_configured = True
3753 time.sleep(5)
3754 thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT,))
3755 thread2 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_2_RX_DEFAULT,))
3756 thread3 = threading.Thread(target = self.voltha.pause_device, args = (device_id,))
3757 thread1.start()
3758 thread2.start()
3759 thread3.start()
3760 time.sleep(10)
3761 thread1.join()
3762 thread2.join()
3763 thread3.join()
3764 dhcp_flow_status = self.success
3765 try:
Thangavelu K Se6c77c72017-06-23 21:28:48 +00003766 assert_equal(dhcp_flow_status, True)
Thangavelu K Se6c77c72017-06-23 21:28:48 +00003767 time.sleep(10)
3768 finally:
3769 self.voltha.disable_device(device_id, delete = True)
3770 self.remove_olt(switch_map)
3771 df.callback(0)
3772
3773 reactor.callLater(0, dhcp_flow_check_scenario, df)
3774 return df
3775
Thangavelu K S36edb012017-07-05 18:24:12 +00003776 def test_3_subscribers_with_voltha_for_dhcp_discover_requests(self):
3777 """
3778 Test Method:
3779 0. Make sure that voltha is up and running on CORD-POD setup.
3780 1. OLT and ONU is detected and validated.
3781 2. Issue tls auth packets from CORD TESTER voltha test module acting as multiple subscribers (3 subscribers)
3782 3. Send dhcp request from residential subscrber to dhcp server which is running as onos app.
3783 4. Verify that subscriber get ip from dhcp server successfully.
3784 """
3785 """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each"""
3786 num_subscribers = 3
3787 num_channels = 1
3788 services = ('DHCP')
3789 cbs = (self.dhcp_flow_check, None, None)
3790 self.voltha_subscribers(services, cbs = cbs,
3791 num_subscribers = num_subscribers,
3792 num_channels = num_channels)
3793
3794 def test_5_subscribers_with_voltha_for_dhcp_discover_requests(self):
3795 """
3796 Test Method:
3797 0. Make sure that voltha is up and running on CORD-POD setup.
3798 1. OLT and ONU is detected and validated.
3799 2. Issue tls auth packets from CORD TESTER voltha test module acting as multiple subscribers (5 subscribers)
3800 3. Send dhcp request from residential subscrber to dhcp server which is running as onos app.
3801 4. Verify that subscriber get ip from dhcp server successfully.
3802 """
3803 """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each"""
3804 num_subscribers = 5
3805 num_channels = 1
3806 services = ('DHCP')
3807 cbs = (self.dhcp_flow_check, None, None)
3808 self.voltha_subscribers(services, cbs = cbs,
3809 num_subscribers = num_subscribers,
3810 num_channels = num_channels)
3811
3812 def test_9_subscribers_with_voltha_for_dhcp_discover_requests(self):
3813 """
3814 Test Method:
3815 0. Make sure that voltha is up and running on CORD-POD setup.
3816 1. OLT and ONU is detected and validated.
3817 2. Issue tls auth packets from CORD TESTER voltha test module acting as multiple subscribers (9 subscribers)
3818 3. Send dhcp request from residential subscrber to dhcp server which is running as onos app.
3819 4. Verify that subscriber get ip from dhcp server successfully.
3820 """
3821 """Test subscriber join next for channel surfing with 9 subscribers browsing 1 channels each"""
3822 num_subscribers = 9
3823 num_channels = 1
3824 services = ('DHCP')
3825 cbs = (self.dhcp_flow_check, None, None)
3826 self.voltha_subscribers(services, cbs = cbs,
3827 num_subscribers = num_subscribers,
3828 num_channels = num_channels)
3829
3830 def test_3_subscribers_with_voltha_for_tls_auth_and_dhcp_discover_flows(self):
3831 """
3832 Test Method:
3833 0. Make sure that voltha is up and running on CORD-POD setup.
3834 1. OLT and ONU is detected and validated.
3835 2. Issue tls auth packets from CORD TESTER voltha test module acting as multiple subscribers (3 subscribers)
3836 3. Send dhcp request from residential subscrber to dhcp server which is running as onos app.
3837 4. Verify that subscriber get ip from dhcp server successfully.
3838 """
3839 """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each"""
3840 num_subscribers = 3
3841 num_channels = 1
3842 services = ('TLS','DHCP')
3843 cbs = (self.tls_flow_check, self.dhcp_flow_check, None)
3844 self.voltha_subscribers(services, cbs = cbs,
3845 num_subscribers = num_subscribers,
3846 num_channels = num_channels)
3847
3848 def test_5_subscribers_with_voltha_for_tls_auth_and_dhcp_discover_flows(self):
3849 """
3850 Test Method:
3851 0. Make sure that voltha is up and running on CORD-POD setup.
3852 1. OLT and ONU is detected and validated.
3853 2. Issue tls auth packets from CORD TESTER voltha test module acting as multiple subscribers (5 subscribers)
3854 3. Send dhcp request from residential subscrber to dhcp server which is running as onos app.
3855 4. Verify that subscriber get ip from dhcp server successfully.
3856 """
3857 """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each"""
3858 num_subscribers = 5
3859 num_channels = 1
3860 services = ('TLS','DHCP')
3861 cbs = (self.tls_flow_check, self.dhcp_flow_check, None)
3862 self.voltha_subscribers(services, cbs = cbs,
3863 num_subscribers = num_subscribers,
3864 num_channels = num_channels)
3865
3866 def test_9_subscribers_with_voltha_for_tls_auth_and_dhcp_discover_flows(self):
3867 """
3868 Test Method:
3869 0. Make sure that voltha is up and running on CORD-POD setup.
3870 1. OLT and ONU is detected and validated.
3871 2. Issue tls auth packets from CORD TESTER voltha test module acting as multiple subscribers (9 subscribers)
3872 3. Send dhcp request from residential subscrber to dhcp server which is running as onos app.
3873 4. Verify that subscriber get ip from dhcp server successfully.
3874 """
3875 """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each"""
3876 num_subscribers = 9
3877 num_channels = 1
3878 services = ('TLS','DHCP')
3879 cbs = (self.tls_flow_check, self.dhcp_flow_check, None)
3880 self.voltha_subscribers(services, cbs = cbs,
3881 num_subscribers = num_subscribers,
3882 num_channels = num_channels)
Thangavelu K Se6c77c72017-06-23 21:28:48 +00003883
3884 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S36edb012017-07-05 18:24:12 +00003885 def test_subscriber_with_voltha_for_dhcpRelay_request(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00003886 """
3887 Test Method:
3888 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
3889 1. OLT and ONU is detected and validated.
3890 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3891 3. Send dhcp request from residential subscrber to external dhcp server.
3892 4. Verify that subscriber get ip from external dhcp server successfully.
3893 """
3894
Thangavelu K Se6c77c72017-06-23 21:28:48 +00003895 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S057b7d22017-05-16 22:03:22 +00003896 def test_subscriber_with_voltha_for_dhcpRelay_dhcp_request_with_invalid_broadcast_source_mac(self):
3897 """
3898 Test Method:
3899 0. Make sure that voltha and external dhcp server are is up and running on CORD-POD setup.
3900 1. OLT and ONU is detected and validated.
3901 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3902 3. Send dhcp request with invalid source mac broadcast from residential subscrber to external dhcp server.
3903 4. Verify that subscriber should not get ip from external dhcp server.
3904 """
3905
Thangavelu K Se6c77c72017-06-23 21:28:48 +00003906 @deferred(TESTCASE_TIMEOUT)
Thangavelu K S057b7d22017-05-16 22:03:22 +00003907 def test_subscriber_with_voltha_for_dhcpRelay_dhcp_request_with_invalid_multicast_source_mac(self):
3908 """
3909 Test Method:
3910 0. Make sure that voltha and external dhcp server are is up and running on CORD-POD setup.
3911 1. OLT and ONU is detected and validated.
3912 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3913 3. Send dhcp request with invalid source mac multicast from residential subscrber to external dhcp server.
3914 4. Verify that subscriber should not get ip from external dhcp server.
3915 """
3916
3917 def test_subscriber_with_voltha_for_dhcpRelay_dhcp_request_with_invalid_source_mac(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 with invalid source mac zero from residential subscrber to external dhcp server.
3924 4. Verify that subscriber should not get ip from external dhcp server.
3925 """
3926
3927 def test_subscriber_with_voltha_for_dhcpRelay_dhcp_request_and_release(self):
3928 """
3929 Test Method:
3930 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
3931 1. OLT and ONU is detected and validated.
3932 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3933 3. Send dhcp request from residential subscrber to external dhcp server.
3934 4. Verify that subscriber get ip from external dhcp server successfully.
3935 5. Send dhcp release from residential subscrber to external dhcp server.
3936 6 Verify that subscriber should not get ip from external dhcp server, ping to gateway.
3937 """
3938
3939 def test_subscriber_with_voltha_for_dhcpRelay_starvation(self):
3940 """
3941 Test Method:
3942 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
3943 1. OLT and ONU is detected and validated.
3944 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3945 3. Send dhcp request from residential subscriber to external dhcp server.
3946 4. Verify that subscriber get ip from external dhcp server. successfully.
3947 5. Repeat step 3 and 4 for 10 times.
3948 6 Verify that subscriber should get ip from external dhcp server..
3949 """
3950
3951 def test_subscriber_with_voltha_for_dhcpRelay_starvation_negative_scenario(self):
3952 """
3953 Test Method:
3954 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
3955 1. OLT and ONU is detected and validated.
3956 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3957 3. Send dhcp request from residential subscriber without of pool ip to external dhcp server.
3958 4. Verify that subscriber should not get ip from external dhcp server..
3959 5. Repeat steps 3 and 4 for 10 times.
3960 6 Verify that subscriber should not get ip from external dhcp server..
3961 """
3962 def test_subscriber_with_voltha_for_dhcpRelay_sending_multiple_discover(self):
3963 """
3964 Test Method:
3965 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
3966 1. OLT and ONU is detected and validated.
3967 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3968 3. Send dhcp request from residential subscriber to external dhcp server.
3969 4. Verify that subscriber get ip from external dhcp server. successfully.
3970 5. Repeat step 3 for 50 times.
3971 6 Verify that subscriber should get same ip which was received from 1st discover from external dhcp server..
3972 """
3973 def test_subscriber_with_voltha_for_dhcpRelay_sending_multiple_request(self):
3974 """
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 residential subscriber to external dhcp server.
3980 4. Verify that subscriber get ip from external dhcp server. successfully.
3981 5. Send DHCP request to external dhcp server.
3982 6. Repeat step 5 for 50 times.
3983 7. Verify that subscriber should get same ip which was received from 1st discover from external dhcp server..
3984 """
3985
3986 def test_subscriber_with_voltha_for_dhcpRelay_requesting_desired_ip_address(self):
3987 """
3988 Test Method:
3989 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
3990 1. OLT and ONU is detected and validated.
3991 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
3992 3. Send dhcp request with desired ip address from residential subscriber to external dhcp server.
3993 4. Verify that subscriber get ip which was requested in step 3 from external dhcp server. successfully.
3994 """
3995
3996 def test_subscriber_with_voltha_for_dhcpRelay_requesting_desired_out_of_pool_ip_address(self):
3997 """
3998 Test Method:
3999 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
4000 1. OLT and ONU is detected and validated.
4001 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4002 3. Send dhcp request with desired out of pool ip address from residential subscriber to external dhcp server.
4003 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.
4004 """
4005
4006 def test_subscriber_with_voltha_for_dhcpRelay_deactivating_dhcpRelay_app_in_onos(self):
4007 """
4008 Test Method:
4009 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
4010 1. OLT and ONU is detected and validated.
4011 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4012 3. Send dhcp request from residential subscriber to external dhcp server.
4013 4. Verify that subscriber get ip from external dhcp server. successfully.
4014 5. Deactivate dhcp server app in onos.
4015 6. Repeat step 3.
4016 7. Verify that subscriber should not get ip from external dhcp server., and ping to gateway.
4017 """
4018
4019 def test_subscriber_with_voltha_for_dhcpRelay_renew_time(self):
4020 """
4021 Test Method:
4022 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
4023 1. OLT and ONU is detected and validated.
4024 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4025 3. Send dhcp request from residential subscriber to external dhcp server.
4026 4. Verify that subscriber get ip from external dhcp server. successfully.
4027 5. Send dhcp renew packet to external dhcp server.
4028 6. Repeat step 4.
4029 """
4030
4031 def test_subscriber_with_voltha_for_dhcpRelay_rebind_time(self):
4032 """
4033 Test Method:
4034 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
4035 1. OLT and ONU is detected and validated.
4036 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4037 3. Send dhcp request from residential subscriber to external dhcp server.
4038 4. Verify that subscriber get ip from external dhcp server. successfully.
4039 5. Send dhcp rebind packet to external dhcp server.
4040 6. Repeat step 4.
4041 """
4042
4043 def test_subscriber_with_voltha_for_dhcpRelay_disable_olt_in_voltha(self):
4044 """
4045 Test Method:
4046 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
4047 1. OLT and ONU is detected and validated.
4048 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4049 3. Send dhcp request from residential subscriber to external dhcp server.
4050 4. Verify that subscriber get ip from external dhcp server. successfully.
4051 5. Disable olt devices which is being detected in voltha CLI.
4052 6. Repeat step 3.
4053 7. Verify that subscriber should not get ip from external dhcp server., and ping to gateway.
4054 """
4055
4056 def test_subscriber_with_voltha_for_dhcpRelay_toggling_olt_in_voltha(self):
4057 """
4058 Test Method:
4059 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
4060 1. OLT and ONU is detected and validated.
4061 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4062 3. Send dhcp request from residential subscriber to external dhcp server.
4063 4. Verify that subscriber get ip from external dhcp server. successfully.
4064 5. Disable olt devices which is being detected in voltha CLI.
4065 6. Repeat step 3.
4066 7. Verify that subscriber should not get ip from external dhcp server., and ping to gateway.
4067 8. Enable olt devices which is being detected in voltha CLI.
4068 9. Repeat steps 3 and 4.
4069 """
4070
4071 def test_subscriber_with_voltha_for_dhcpRelay_disable_onu_port_in_voltha(self):
4072 """
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 residential subscriber to external dhcp server.
4078 4. Verify that subscriber get ip from external dhcp server. successfully.
4079 5. Disable onu port which is being detected in voltha CLI.
4080 6. Repeat step 3.
4081 7. Verify that subscriber should not get ip from external dhcp server., and ping to gateway.
4082 """
4083
Thangavelu K Se6c77c72017-06-23 21:28:48 +00004084 def test_subscriber_with_voltha_for_dhcpRelay_disable_enable_onu_port_in_voltha(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00004085 """
4086 Test Method:
4087 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
4088 1. OLT and ONU is detected and validated.
4089 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4090 3. Send dhcp request from residential subscriber to external dhcp server.
4091 4. Verify that subscriber get ip from external dhcp server. successfully.
4092 5. Disable onu port which is being detected in voltha CLI.
4093 6. Repeat step 3.
4094 7. Verify that subscriber should not get ip from external dhcp server., and ping to gateway.
4095 8. Enable onu port which is being detected in voltha CLI.
4096 9. Repeat steps 3 and 4.
4097 """
4098
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00004099 def test_two_subscribers_with_voltha_for_dhcpRelay_discover(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00004100 """
4101 Test Method:
4102 0. Make sure that voltha and external dhcp server are 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. Send dhcp request from two residential subscribers to external dhcp server.
4106 4. Verify that subscribers had got different ips from external dhcp server. successfully.
4107 """
4108
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00004109 def test_two_subscribers_with_voltha_for_dhcpRelay_multiple_discover(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00004110 """
4111 Test Method:
4112 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
4113 1. OLT and ONU is detected and validated.
4114 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4115 3. Send dhcp request from two residential subscribers to external dhcp server.
4116 4. Verify that subscribers had got ip from external dhcp server. successfully.
4117 5. Repeat step 3 and 4 for 10 times for both subscribers.
4118 6 Verify that subscribers should get same ips which are offered the first time from external dhcp server..
4119 """
4120
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00004121 def test_two_subscribers_with_voltha_for_dhcpRelay_multiple_discover_for_one_subscriber(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00004122 """
4123 Test Method:
4124 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
4125 1. OLT and ONU is detected and validated.
4126 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4127 3. Send dhcp request from two residential subscribers to external dhcp server.
4128 4. Verify that subscribers had got ip from external dhcp server. successfully.
4129 5. Repeat step 3 and 4 for 10 times for only one subscriber and ping to gateway from other subscriber.
4130 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
4131 """
4132
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00004133 def test_two_subscribers_with_voltha_for_dhcpRelay_discover_desired_ip_address_for_one_subscriber(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00004134 """
4135 Test Method:
4136 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
4137 1. OLT and ONU is detected and validated.
4138 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4139 3. Send dhcp request from one residential subscriber to external dhcp server.
4140 3. Send dhcp request with desired ip from other residential subscriber to external dhcp server.
4141 4. Verify that subscribers had got different ips (one subscriber desired ip and other subscriber random ip) from external dhcp server. successfully.
4142 """
4143
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00004144 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 +00004145 """
4146 Test Method:
4147 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
4148 1. OLT and ONU is detected and validated.
4149 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4150 3. Send dhcp request with desired wihtin dhcp pool ip from one residential subscriber to external dhcp server.
4151 3. Send dhcp request with desired without in dhcp pool ip from other residential subscriber to external dhcp server.
4152 4. Verify that subscribers had got different ips (both subscriber got random ips within dhcp pool) from external dhcp server. successfully.
4153 """
4154
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00004155 def test_two_subscribers_with_voltha_for_dhcpRelay_disable_onu_port_for_one_subscriber(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00004156 """
4157 Test Method:
4158 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
4159 1. OLT and ONU is detected and validated.
4160 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4161 3. Send dhcp request from two residential subscribers to external dhcp server.
4162 4. Verify that subscribers had got ip from external dhcp server. successfully.
4163 5. Disable onu port on which access one subscriber and ping to gateway from other subscriber.
4164 6. Repeat step 3 and 4 for one subscriber where uni port is down.
4165 7. Verify that subscriber should not get ip from external dhcp server. and other subscriber ping to gateway should not failed.
4166 """
4167
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00004168 def test_two_subscribers_with_voltha_for_dhcpRelay_toggle_onu_port_for_one_subscriber(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00004169 """
4170 Test Method:
4171 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
4172 1. OLT and ONU is detected and validated.
4173 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4174 3. Send dhcp request from two residential subscribers to external dhcp server.
4175 4. Verify that subscribers had got ip from external dhcp server. successfully.
4176 5. Disable onu port on which access one subscriber and ping to gateway from other subscriber.
4177 6. Repeat step 3 and 4 for one subscriber where uni port is down.
4178 7. Verify that subscriber should not get ip from external dhcp server. and other subscriber ping to gateway should not failed.
4179 8. Enable onu port on which was disable at step 5 and ping to gateway from other subscriber.
4180 9. Repeat step 3 and 4 for one subscriber where uni port is up now.
4181 10. Verify that subscriber should get ip from external dhcp server. and other subscriber ping to gateway should not failed.
4182 """
4183
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00004184 def test_two_subscribers_with_voltha_for_dhcpRelay_disable_olt_detected_in_voltha(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00004185 """
4186 Test Method:
4187 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
4188 1. OLT and ONU is detected and validated.
4189 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4190 3. Send dhcp request from two residential subscribers to external dhcp server.
4191 4. Verify that subscribers had got ip from external dhcp server. successfully.
4192 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber.
4193 6. Disable the olt device which is detected in voltha.
4194 7. Verify that subscriber should not get ip from external dhcp server. and other subscriber ping to gateway should failed.
4195 """
4196
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00004197 def test_two_subscribers_with_voltha_for_dhcpRelay_toggle_olt_detected_in_voltha(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00004198 """
4199 Test Method:
4200 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
4201 1. OLT and ONU is detected and validated.
4202 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4203 3. Send dhcp request from two residential subscribers to external dhcp server.
4204 4. Verify that subscribers had got ip from external dhcp server. successfully.
4205 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber.
4206 6. Disable the olt device which is detected in voltha.
4207 7. Verify that subscriber should not get ip from external dhcp server. and other subscriber ping to gateway should failed.
4208 8. Enable the olt device which is detected in voltha.
4209 9. Verify that subscriber should get ip from external dhcp server. and other subscriber ping to gateway should not failed.
4210 """
4211
Thangavelu K S0ffd5b82017-06-21 18:01:59 +00004212 def test_two_subscribers_with_voltha_for_dhcpRelay_pause_olt_detected_in_voltha(self):
Thangavelu K S057b7d22017-05-16 22:03:22 +00004213 """
4214 Test Method:
4215 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup.
4216 1. OLT and ONU is detected and validated.
4217 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4218 3. Send dhcp request from two residential subscribers to external dhcp server.
4219 4. Verify that subscribers had got ip from external dhcp server. successfully.
4220 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber.
4221 6. Pause the olt device which is detected in voltha.
4222 7. Verify that subscriber should not get ip from external dhcp server. and other subscriber ping to gateway should failed.
4223 """
Thangavelu K S36edb012017-07-05 18:24:12 +00004224
4225 def test_subscriber_with_voltha_for_igmp_join_verify_traffic(self):
4226 """
4227 Test Method:
4228 0. Make sure that voltha is up and running on CORD-POD setup.
4229 1. OLT and ONU is detected and validated.
4230 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4231 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity.
4232 4. Send igmp joins for a multicast group address multi-group-addressA.
4233 5. Send multicast data traffic for a group (multi-group-addressA) from other uni port on ONU.
4234 6. Verify that multicast data packets are being recieved on join sent uni port on ONU to cord-tester.
4235 """
4236
Thangavelu K S8e413082017-07-13 20:02:14 +00004237 """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each"""
4238 num_subscribers = 1
4239 num_channels = 1
4240 services = ('IGMP')
4241 cbs = (self.igmp_flow_check, None, None)
4242 self.voltha_subscribers(services, cbs = cbs,
4243 num_subscribers = num_subscribers,
4244 num_channels = num_channels)
4245
Thangavelu K S36edb012017-07-05 18:24:12 +00004246 def test_subscriber_with_voltha_for_igmp_leave_verify_traffic(self):
4247 """
4248 Test Method:
4249 0. Make sure that voltha is up and running on CORD-POD setup.
4250 1. OLT and ONU is detected and validated.
4251 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4252 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity.
4253 4. Send igmp joins for a multicast group address multi-group-addressA.
4254 5. Send multicast data traffic for a group (multi-group-addressA) from other uni port on ONU.
4255 6. Verify that multicast data packets are being recieved on join received uni port on ONU to cord-tester.
4256 7. Send igmp leave for a multicast group address multi-group-addressA.
4257 8. Verify that multicast data packets are not being recieved on leave sent uni port on ONU to cord-tester.
4258 """
Thangavelu K S8e413082017-07-13 20:02:14 +00004259 """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each"""
4260 num_subscribers = 1
4261 num_channels = 1
4262 services = ('IGMP')
4263 cbs = (self.igmp_flow_check, None, None)
4264 self.voltha_subscribers(services, cbs = cbs,
4265 num_subscribers = num_subscribers,
4266 num_channels = num_channels)
4267
4268
Thangavelu K S36edb012017-07-05 18:24:12 +00004269 def test_subscriber_with_voltha_for_igmp_leave_and_again_join_verify_traffic(self):
4270 """
4271 Test Method:
4272 0. Make sure that voltha is up and running on CORD-POD setup.
4273 1. OLT and ONU is detected and validated.
4274 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4275 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity.
4276 4. Send igmp joins for a multicast group address multi-group-addressA.
4277 5. Send multicast data traffic for a group (multi-group-addressA) from other uni port on ONU.
4278 6. Verify that multicast data packets are being recieved on join received uni port on ONU to cord-tester.
4279 7. Send igmp leave for a multicast group address multi-group-addressA.
4280 8. Verify that multicast data packets are not being recieved on leave sent uni port on ONU to cord-tester.
4281 9. Repeat steps 4 to 6.
4282 """
Thangavelu K S8e413082017-07-13 20:02:14 +00004283 """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each"""
4284 num_subscribers = 1
4285 num_channels = 1
4286 services = ('IGMP')
4287 cbs = (self.igmp_flow_check, None, None)
4288 self.voltha_subscribers(services, cbs = cbs,
4289 num_subscribers = num_subscribers,
4290 num_channels = num_channels)
4291
Thangavelu K S36edb012017-07-05 18:24:12 +00004292
4293 def test_subscriber_with_voltha_for_igmp_2_groups_joins_verify_traffic(self):
4294 """
4295 Test Method:
4296 0. Make sure that voltha is up and running on CORD-POD setup.
4297 1. OLT and ONU is detected and validated.
4298 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4299 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity.
4300 4. Send igmp joins for multicast group addresses multi-group-addressA,multi-group-addressB
4301 5. Send multicast data traffic for two groups (multi-group-addressA and multi-group-addressB) from other uni port on ONU.
4302 6. Verify that 2 groups multicast data packets are being recieved on join sent uni port on ONU to cord-tester.
4303 """
4304
Thangavelu K S8e413082017-07-13 20:02:14 +00004305 """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each"""
4306 num_subscribers = 1
4307 num_channels = 2
4308 services = ('IGMP')
4309 cbs = (self.igmp_flow_check, None, None)
4310 self.voltha_subscribers(services, cbs = cbs,
4311 num_subscribers = num_subscribers,
4312 num_channels = num_channels)
4313
4314
Thangavelu K S36edb012017-07-05 18:24:12 +00004315 def test_subscriber_with_voltha_for_igmp_2_groups_joins_and_leave_for_one_group_verify_traffic(self):
4316 """
4317 Test Method:
4318 0. Make sure that voltha is up and running on CORD-POD setup.
4319 1. OLT and ONU is detected and validated.
4320 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4321 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity.
4322 4. Send igmp joins for multicast group addresses multi-group-addressA,multi-group-addressB
4323 5. Send multicast data traffic for two groups (multi-group-addressA and multi-group-addressB) from other uni port on ONU.
4324 6. Verify that 2 groups multicast data packets are being recieved on join sent uni port on ONU to cord-tester.
4325 7. Send igmp leave for a multicast group address multi-group-addressA.
4326 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.
4327 9. Verify that multicast data packets of group (multi-group-addressB) are being recieved on join sent uni port on ONU to cord-tester.
4328 """
Thangavelu K S8e413082017-07-13 20:02:14 +00004329 """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each"""
4330 num_subscribers = 1
4331 num_channels = 2
4332 services = ('IGMP')
4333 cbs = (self.igmp_flow_check, None, None)
4334 self.voltha_subscribers(services, cbs = cbs,
4335 num_subscribers = num_subscribers,
4336 num_channels = num_channels)
4337
Thangavelu K S36edb012017-07-05 18:24:12 +00004338
4339 def test_subscriber_with_voltha_for_igmp_join_different_group_src_list_verify_traffic(self):
4340 """
4341 Test Method:
4342 0. Make sure that voltha is up and running on CORD-POD setup.
4343 1. OLT and ONU is detected and validated.
4344 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4345 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity.
4346 4. Send igmp joins for a multicast group address multi-group-addressA with source list src_listA
4347 5. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listA on ONU.
4348 6. Verify that multicast data packets are being recieved on join sent uni port on ONU to cord-tester.
4349 7. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listB on ONU.
4350 8. Verify that multicast data packets are not being recieved on join sent uni port on ONU from other source list to cord-tester.
4351 """
Thangavelu K S8e413082017-07-13 20:02:14 +00004352 num_subscribers = 1
4353 num_channels = 1
4354 services = ('IGMP')
4355 cbs = (self.igmp_flow_check, None, None)
4356 self.voltha_subscribers(services, cbs = cbs, src_list = ['2.3.4.5','3.4.5.6'],
4357 num_subscribers = num_subscribers,
4358 num_channels = num_channels)
Thangavelu K S36edb012017-07-05 18:24:12 +00004359
Thangavelu K S8e413082017-07-13 20:02:14 +00004360
4361 def test_subscriber_with_voltha_for_igmp_change_to_exclude_mcast_group_verify_traffic(self):
Thangavelu K S36edb012017-07-05 18:24:12 +00004362 """
4363 Test Method:
4364 0. Make sure that voltha is up and running on CORD-POD setup.
4365 1. OLT and ONU is detected and validated.
4366 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4367 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity.
4368 4. Send igmp joins for a multicast group address multi-group-addressA with source list src_listA
4369 5. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listA on ONU.
4370 6. Verify that multicast data packets are being recieved on join sent uni port on ONU to cord-tester.
4371 7. Send igmp joins for a multicast group address multi-group-addressA with exclude source list src_listA
4372 8. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listA on ONU.
4373 9. Verify that multicast data packets are not being recieved on join sent uni port on ONU from other source list to cord-tester.
4374 """
4375
Thangavelu K S8e413082017-07-13 20:02:14 +00004376 num_subscribers = 1
4377 num_channels = 2
4378 services = ('IGMP')
4379 cbs = (self.igmp_flow_check_join_change_to_exclude, None, None)
4380 self.voltha_subscribers(services, cbs = cbs, src_list = ['2.3.4.5','3.4.5.6'],
4381 num_subscribers = num_subscribers,
4382 num_channels = num_channels)
4383
4384
4385
4386 def test_subscriber_with_voltha_for_igmp_change_to_include_back_from_exclude_mcast_group_verify_traffic(self):
Thangavelu K S36edb012017-07-05 18:24:12 +00004387 """
4388 Test Method:
4389 0. Make sure that voltha is up and running on CORD-POD setup.
4390 1. OLT and ONU is detected and validated.
4391 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4392 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity.
4393 4. Send igmp joins for a multicast group address multi-group-addressA with source exclude list src_listA
4394 5. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listA on ONU.
4395 6. Verify that multicast data packets are not being recieved on join sent uni port on ONU to cord-tester.
4396 7. Send igmp joins for a multicast group address multi-group-addressA with allow source list src_listA
4397 8. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listA on ONU.
4398 9. Verify that multicast data packets are being recieved on join sent uni port on ONU from other source list to cord-tester.
4399 """
Thangavelu K S8e413082017-07-13 20:02:14 +00004400 num_subscribers = 1
4401 num_channels = 1
4402 services = ('IGMP')
4403 cbs = (self.igmp_flow_check_join_change_to_exclude_again_include_back, None, None)
4404 self.voltha_subscribers(services, cbs = cbs, src_list = ['2.3.4.5','3.4.5.6'],
4405 num_subscribers = num_subscribers,
4406 num_channels = num_channels)
4407
Thangavelu K S36edb012017-07-05 18:24:12 +00004408
4409 def test_subscriber_with_voltha_for_igmp_change_to_block_src_list_verify_traffic(self):
4410 """
4411 Test Method:
4412 0. Make sure that voltha is up and running on CORD-POD setup.
4413 1. OLT and ONU is detected and validated.
4414 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4415 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity.
4416 4. Send igmp joins for a multicast group address multi-group-addressA with source list src_listA
4417 5. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listA on ONU.
4418 6. Verify that multicast data packets are being recieved on join sent uni port on ONU to cord-tester.
4419 7. Send igmp joins for a multicast group address multi-group-addressA with block source list src_listA
4420 8. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listA on ONU.
4421 9. Verify that multicast data packets are not being recieved on join sent uni port on ONU from other source list to cord-tester.
4422 """
Thangavelu K S8e413082017-07-13 20:02:14 +00004423
4424 num_subscribers = 1
4425 num_channels = 1
4426 services = ('IGMP')
4427 cbs = (self.igmp_flow_check_join_change_to_block, None, None)
4428 self.voltha_subscribers(services, cbs = cbs, src_list = ['2.3.4.5','3.4.5.6'],
4429 num_subscribers = num_subscribers,
4430 num_channels = num_channels)
4431
4432
4433
4434
Thangavelu K S36edb012017-07-05 18:24:12 +00004435 def test_subscriber_with_voltha_for_igmp_allow_new_src_list_verify_traffic(self):
4436 """
4437 Test Method:
4438 0. Make sure that voltha is up and running on CORD-POD setup.
4439 1. OLT and ONU is detected and validated.
4440 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4441 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity.
4442 4. Send igmp joins for a multicast group address multi-group-addressA with source exclude list src_listA
4443 5. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listA on ONU.
4444 6. Verify that multicast data packets are being recieved on join sent uni port on ONU to cord-tester.
4445 7. Send igmp joins for a multicast group address multi-group-addressA with allow new source list src_listB
4446 8. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listB on ONU.
4447 9. Verify that multicast data packets are being recieved on join sent uni port on ONU from other source list to cord-tester.
4448 """
Thangavelu K S8e413082017-07-13 20:02:14 +00004449
4450 num_subscribers = 1
4451 num_channels = 1
4452 services = ('IGMP')
4453 cbs = (self.igmp_flow_check_join_change_to_block_again_allow_back, None, None)
4454 self.voltha_subscribers(services, cbs = cbs, src_list = ['2.3.4.5','3.4.5.6'],
4455 num_subscribers = num_subscribers,
4456 num_channels = num_channels)
4457
4458
Thangavelu K S36edb012017-07-05 18:24:12 +00004459 def test_subscriber_with_voltha_for_igmp_include_empty_src_list_verify_traffic(self):
4460 """
4461 Test Method:
4462 0. Make sure that voltha is up and running on CORD-POD setup.
4463 1. OLT and ONU is detected and validated.
4464 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4465 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity.
4466 4. Send igmp joins for a multicast group address multi-group-addressA with source exclude list src_listA
4467 5. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listA on ONU.
4468 6. Verify that multicast data packets are not being recieved on join sent uni port on ONU to cord-tester.
4469 7. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listB on ONU.
4470 8. Verify that multicast data packets are not being recieved on join sent uni port on ONU from other source list to cord-tester.
4471 """
4472 def test_subscribers_with_voltha_for_igmp_exclude_empty_src_list_and_verify_traffic(self):
4473 """
4474 Test Method:
4475 0. Make sure that voltha is up and running on CORD-POD setup.
4476 1. OLT and ONU is detected and validated.
4477 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4478 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity.
4479 4. Send igmp joins for a multicast group address multi-group-addressA with source exclude list src_listA
4480 5. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listA on ONU.
4481 6. Verify that multicast data packets are being recieved on join sent uni port on ONU to cord-tester.
4482 7. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listB on ONU.
4483 8. Verify that multicast data packets are being recieved on join sent uni port on ONU from other source list to cord-tester.
4484 """
4485
4486 def test_two_subscribers_with_voltha_for_igmp_join_and_verifying_traffic(self):
4487 """
4488 Test Method:
4489 0. Make sure that voltha is up and running on CORD-POD setup.
4490 1. OLT and ONU is detected and validated.
4491 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4492 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity.
4493 4. Send igmp joins for a multicast group address multi-group-addressA from one subscribers (uni_1 port)
4494 5. Send igmp joins for a multicast group address multi-group-addressB from other subscribers ( uni_2 port)
4495 6. Send multicast data traffic for a group (multi-group-addressA) from other uni_3 port on ONU.
4496 7. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester.
4497 8. Verify that multicast data packets are not being recieved on join sent uni (uni_2) port on ONU to cord-tester.
4498 """
4499
4500 def test_two_subscribers_with_voltha_for_igmp_join_leave_for_one_subscriber_verifying_traffic(self):
4501 """
4502 Test Method:
4503 0. Make sure that voltha is up and running on CORD-POD setup.
4504 1. OLT and ONU is detected and validated.
4505 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4506 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity.
4507 4. Send igmp joins for a multicast group address multi-group-addressA from one subscribers (uni_1 port)
4508 5. Send igmp joins for a multicast group address multi-group-addressA from other subscribers ( uni_2 port)
4509 6. Send multicast data traffic for a group (multi-group-addressA) from other uni_3 port on ONU.
4510 7. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester.
4511 8. Verify that multicast data packets are being recieved on join sent uni (uni_2) port on ONU to cord-tester.
4512 9. Send igmp leave for a multicast group address multi-group-addressA from other subscribers ( uni_2 port)
4513 10. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester.
4514 11. Verify that multicast data packets are not being recieved on join sent uni (uni_2) port on ONU to cord-tester.
4515 """
4516
4517 def test_two_subscribers_with_voltha_for_igmp_leave_join_for_one_subscriber_and_verifying_traffic(self):
4518 """
4519 Test Method:
4520 0. Make sure that voltha is up and running on CORD-POD setup.
4521 1. OLT and ONU is detected and validated.
4522 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4523 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity.
4524 4. Send igmp joins for a multicast group address multi-group-addressA from one subscribers (uni_1 port)
4525 5. Send igmp leave for a multicast group address multi-group-addressB from other subscribers ( uni_2 port)
4526 6. Send multicast data traffic for a group (multi-group-addressA) from other uni_3 port on ONU.
4527 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.
4528 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.
4529 9. Send igmp join for a multicast group address multi-group-addressA from other subscribers ( uni_2 port)
4530 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.
4531 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.
4532 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.
4533 """
4534
4535 def test_two_subscribers_with_voltha_for_igmp_with_uni_port_down_for_one_subscriber_and_verifying_traffic(self):
4536 """
4537 Test Method:
4538 0. Make sure that voltha is up and running on CORD-POD setup.
4539 1. OLT and ONU is detected and validated.
4540 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4541 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity.
4542 4. Send igmp joins for a multicast group address multi-group-addressA from one subscribers (uni_1 port)
4543 5. Send igmp joins for a multicast group address multi-group-addressA from other subscribers ( uni_2 port)
4544 6. Send multicast data traffic for a group (multi-group-addressA) from other uni_3 port on ONU.
4545 7. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester.
4546 8. Verify that multicast data packets are being recieved on join sent uni (uni_2) port on ONU to cord-tester.
4547 9. Disable uni_2 port which is being shown on voltha CLI.
4548 10. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester.
4549 11. Verify that multicast data packets are not being recieved on join sent uni (uni_2) port on ONU to cord-tester.
4550 """
4551 def test_two_subscribers_with_voltha_for_igmp_toggling_uni_port_for_one_subscriber_and_verifying_traffic(self):
4552 """
4553 Test Method:
4554 0. Make sure that voltha is up and running on CORD-POD setup.
4555 1. OLT and ONU is detected and validated.
4556 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4557 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity.
4558 4. Send igmp joins for a multicast group address multi-group-addressA from one subscribers (uni_1 port)
4559 5. Send igmp joins for a multicast group address multi-group-addressA from other subscribers ( uni_2 port)
4560 6. Send multicast data traffic for a group (multi-group-addressA) from other uni_3 port on ONU.
4561 7. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester.
4562 8. Verify that multicast data packets are being recieved on join sent uni (uni_2) port on ONU to cord-tester.
4563 9. Disable uni_2 port which is being shown on voltha CLI.
4564 10. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester.
4565 11. Verify that multicast data packets are not being recieved on join sent uni (uni_2) port on ONU to cord-tester.
4566 12. Enable uni_2 port which we disable at step 9.
4567 13. Repeat step 5,6 and 8.
4568 """
4569 def test_two_subscribers_with_voltha_for_igmp_disabling_olt_and_verifying_traffic(self):
4570 """
4571 Test Method:
4572 0. Make sure that voltha is up and running on CORD-POD setup.
4573 1. OLT and ONU is detected and validated.
4574 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4575 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity.
4576 4. Send igmp joins for a multicast group address multi-group-addressA from one subscribers (uni_1 port)
4577 5. Send igmp joins for a multicast group address multi-group-addressA from other subscribers ( uni_2 port)
4578 6. Send multicast data traffic for a group (multi-group-addressA) from other uni_3 port on ONU.
4579 7. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester.
4580 8. Verify that multicast data packets are being recieved on join sent uni (uni_2) port on ONU to cord-tester.
4581 9. Disable olt device which is being shown on voltha CLI.
4582 10. Verify that multicast data packets are not being recieved on join sent uni (uni_1) port on ONU to cord-tester.
4583 11. Verify that multicast data packets are not being recieved on join sent uni (uni_2) port on ONU to cord-tester.
4584 """
4585 def test_two_subscribers_with_voltha_for_igmp_pausing_olt_and_verifying_traffic(self):
4586 """
4587 Test Method:
4588 0. Make sure that voltha is up and running on CORD-POD setup.
4589 1. OLT and ONU is detected and validated.
4590 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4591 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity.
4592 4. Send igmp joins for a multicast group address multi-group-addressA from one subscribers (uni_1 port)
4593 5. Send igmp joins for a multicast group address multi-group-addressA from other subscribers ( uni_2 port)
4594 6. Send multicast data traffic for a group (multi-group-addressA) from other uni_3 port on ONU.
4595 7. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester.
4596 8. Verify that multicast data packets are being recieved on join sent uni (uni_2) port on ONU to cord-tester.
4597 9. Pause olt device which is being shown on voltha CLI.
4598 10. Verify that multicast data packets are not being recieved on join sent uni (uni_1) port on ONU to cord-tester.
4599 11. Verify that multicast data packets are not being recieved on join sent uni (uni_2) port on ONU to cord-tester.
4600 """
4601 def test_two_subscribers_with_voltha_for_igmp_toggling_olt_and_verify_traffic(self):
4602 """
4603 Test Method:
4604 0. Make sure that voltha is up and running on CORD-POD setup.
4605 1. OLT and ONU is detected and validated.
4606 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber..
4607 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity.
4608 4. Send igmp joins for a multicast group address multi-group-addressA from one subscribers (uni_1 port)
4609 5. Send igmp joins for a multicast group address multi-group-addressA from other subscribers ( uni_2 port)
4610 6. Send multicast data traffic for a group (multi-group-addressA) from other uni_3 port on ONU.
4611 7. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester.
4612 8. Verify that multicast data packets are being recieved on join sent uni (uni_2) port on ONU to cord-tester.
4613 9. Disable olt device which is being shown on voltha CLI.
4614 10. Verify that multicast data packets are not being recieved on join sent uni (uni_1) port on ONU to cord-tester.
4615 11. Verify that multicast data packets are not being recieved on join sent uni (uni_2) port on ONU to cord-tester.
4616 12. Enable olt device which is disable at step 9.
4617 13. Repeat steps 4,5, 7 and 8.
4618 """