blob: 45c86fc4b031e36e891e1e34b71ca27591885b72 [file] [log] [blame]
Chetan Gaonkercfcce782016-05-10 10:10:42 -07001#
2# Copyright 2016-present Ciena Corporation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
Chetan Gaonkercbe79642016-03-09 17:45:58 -080016import unittest
17from nose.tools import *
18from nose.twistedtools import reactor, deferred
19from twisted.internet import defer
20from scapy.all import *
21import time, monotonic
22import os, sys
23import tempfile
24import random
25import threading
26from Stats import Stats
27from OnosCtrl import OnosCtrl
28from DHCP import DHCPTest
29from EapTLS import TLSAuthTest
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -070030from Channels import Channels, IgmpChannel
Chetan Gaonker41d2e072016-03-15 16:41:31 -070031from subscriberDb import SubscriberDB
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -070032from threadPool import ThreadPool
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -070033from portmaps import g_subscriber_port_map
Chetan Gaonker7997bb42016-03-28 09:46:15 -070034from OltConfig import *
Chetan Gaonkercbe79642016-03-09 17:45:58 -080035log.setLevel('INFO')
36
37class Subscriber(Channels):
Chetan Gaonker7997bb42016-03-28 09:46:15 -070038 PORT_TX_DEFAULT = 2
39 PORT_RX_DEFAULT = 1
40 INTF_TX_DEFAULT = 'veth2'
41 INTF_RX_DEFAULT = 'veth0'
Chetan Gaonkercbe79642016-03-09 17:45:58 -080042 STATS_RX = 0
43 STATS_TX = 1
44 STATS_JOIN = 2
45 STATS_LEAVE = 3
Chetan Gaonker41d2e072016-03-15 16:41:31 -070046 SUBSCRIBER_SERVICES = 'DHCP IGMP TLS'
Chetan Gaonker7997bb42016-03-28 09:46:15 -070047 def __init__(self, name = 'sub', service = SUBSCRIBER_SERVICES, port_map = None,
48 num = 1, channel_start = 0,
49 tx_port = PORT_TX_DEFAULT, rx_port = PORT_RX_DEFAULT,
50 iface = INTF_RX_DEFAULT, iface_mcast = INTF_TX_DEFAULT,
Chetan Gaonkercbe79642016-03-09 17:45:58 -080051 mcast_cb = None, loginType = 'wireless'):
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -070052 self.tx_port = tx_port
53 self.rx_port = rx_port
Chetan Gaonker7997bb42016-03-28 09:46:15 -070054 self.port_map = port_map or g_subscriber_port_map
55 try:
56 self.tx_intf = self.port_map[tx_port]
57 self.rx_intf = self.port_map[rx_port]
58 except:
Chetan Gaonker3d163852016-03-28 12:20:25 -070059 self.tx_intf = self.port_map[self.PORT_TX_DEFAULT]
60 self.rx_intf = self.port_map[self.PORT_RX_DEFAULT]
Chetan Gaonker7997bb42016-03-28 09:46:15 -070061
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -070062 Channels.__init__(self, num, channel_start = channel_start,
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -070063 iface = self.rx_intf, iface_mcast = self.tx_intf, mcast_cb = mcast_cb)
Chetan Gaonker41d2e072016-03-15 16:41:31 -070064 self.name = name
65 self.service = service
66 self.service_map = {}
67 services = self.service.strip().split(' ')
68 for s in services:
69 self.service_map[s] = True
Chetan Gaonkercbe79642016-03-09 17:45:58 -080070 self.loginType = loginType
71 ##start streaming channels
72 self.join_map = {}
73 ##accumulated join recv stats
74 self.join_rx_stats = Stats()
75
Chetan Gaonker41d2e072016-03-15 16:41:31 -070076 def has_service(self, service):
77 if self.service_map.has_key(service):
78 return self.service_map[service]
79 if self.service_map.has_key(service.upper()):
80 return self.service_map[service.upper()]
81 return False
82
Chetan Gaonkercbe79642016-03-09 17:45:58 -080083 def channel_join_update(self, chan, join_time):
84 self.join_map[chan] = ( Stats(), Stats(), Stats(), Stats() )
85 self.channel_update(chan, self.STATS_JOIN, 1, t = join_time)
86
87 def channel_join(self, chan = 0, delay = 2):
88 '''Join a channel and create a send/recv stats map'''
89 if self.join_map.has_key(chan):
90 del self.join_map[chan]
91 self.delay = delay
92 chan, join_time = self.join(chan)
93 self.channel_join_update(chan, join_time)
94 return chan
95
96 def channel_join_next(self, delay = 2):
97 '''Joins the next channel leaving the last channel'''
98 if self.last_chan:
99 if self.join_map.has_key(self.last_chan):
100 del self.join_map[self.last_chan]
101 self.delay = delay
102 chan, join_time = self.join_next()
103 self.channel_join_update(chan, join_time)
104 return chan
105
106 def channel_jump(self, delay = 2):
107 '''Jumps randomly to the next channel leaving the last channel'''
108 if self.last_chan is not None:
109 if self.join_map.has_key(self.last_chan):
110 del self.join_map[self.last_chan]
111 self.delay = delay
112 chan, join_time = self.jump()
113 self.channel_join_update(chan, join_time)
114 return chan
115
116 def channel_leave(self, chan = 0):
117 if self.join_map.has_key(chan):
118 del self.join_map[chan]
119 self.leave(chan)
120
121 def channel_update(self, chan, stats_type, packets, t=0):
122 if type(chan) == type(0):
123 chan_list = (chan,)
124 else:
125 chan_list = chan
126 for c in chan_list:
127 if self.join_map.has_key(c):
128 self.join_map[c][stats_type].update(packets = packets, t = t)
129
130 def channel_receive(self, chan, cb = None, count = 1):
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700131 log.info('Subscriber %s receiving from group %s, channel %d' %(self.name, self.gaddr(chan), chan))
Chetan Gaonkercbe79642016-03-09 17:45:58 -0800132 self.recv(chan, cb = cb, count = count)
133
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700134 def recv_channel_cb(self, pkt):
135 ##First verify that we have received the packet for the joined instance
136 log.debug('Packet received for group %s, subscriber %s' %(pkt[IP].dst, self.name))
137 chan = self.caddr(pkt[IP].dst)
138 assert_equal(chan in self.join_map.keys(), True)
139 recv_time = monotonic.monotonic() * 1000000
140 join_time = self.join_map[chan][self.STATS_JOIN].start
141 delta = recv_time - join_time
142 self.join_rx_stats.update(packets=1, t = delta, usecs = True)
143 self.channel_update(chan, self.STATS_RX, 1, t = delta)
144 log.debug('Packet received in %.3f usecs for group %s after join' %(delta, pkt[IP].dst))
145
146class subscriber_pool:
147
148 def __init__(self, subscriber, test_cbs):
149 self.subscriber = subscriber
150 self.test_cbs = test_cbs
151
152 def pool_cb(self):
153 for cb in self.test_cbs:
154 if cb:
155 cb(self.subscriber)
156
Chetan Gaonkercbe79642016-03-09 17:45:58 -0800157class subscriber_exchange(unittest.TestCase):
158
159 apps = [ 'org.onosproject.aaa', 'org.onosproject.dhcp' ]
Chetan Gaonkera2b87df2016-03-31 15:41:31 -0700160 olt_apps = [ 'org.onosproject.igmp', 'org.onosproject.cordmcast' ]
Chetan Gaonkercbe79642016-03-09 17:45:58 -0800161 dhcp_server_config = {
162 "ip": "10.1.11.50",
163 "mac": "ca:fe:ca:fe:ca:fe",
164 "subnet": "255.255.252.0",
165 "broadcast": "10.1.11.255",
166 "router": "10.1.8.1",
167 "domain": "8.8.8.8",
168 "ttl": "63",
169 "delay": "2",
170 "startip": "10.1.11.51",
171 "endip": "10.1.11.100"
172 }
173
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700174 aaa_loaded = False
175
Chetan Gaonkercbe79642016-03-09 17:45:58 -0800176 def setUp(self):
Chetan Gaonker7997bb42016-03-28 09:46:15 -0700177 '''Load the OLT config and activate relevant apps'''
178 self.olt = OltConfig()
179 self.port_map = self.olt.olt_port_map()
180 ##if no olt config, fall back to ovs port map
181 if not self.port_map:
182 self.port_map = g_subscriber_port_map
183 else:
184 log.info('Using OLT Port configuration for test setup')
Chetan Gaonkera2b87df2016-03-31 15:41:31 -0700185 log.info('Configuring CORD OLT access device information')
186 OnosCtrl.cord_olt_config(self.olt.olt_device_data())
187 self.activate_apps(self.olt_apps)
188
189 self.activate_apps(self.apps)
Chetan Gaonkercbe79642016-03-09 17:45:58 -0800190
191 def teardown(self):
192 '''Deactivate the dhcp app'''
193 for app in self.apps:
194 onos_ctrl = OnosCtrl(app)
195 onos_ctrl.deactivate()
196
Chetan Gaonkera2b87df2016-03-31 15:41:31 -0700197 def activate_apps(self, apps):
Chetan Gaonker735495f2016-05-10 14:51:16 -0700198 for app in apps:
Chetan Gaonkera2b87df2016-03-31 15:41:31 -0700199 onos_ctrl = OnosCtrl(app)
200 status, _ = onos_ctrl.activate()
201 assert_equal(status, True)
202 time.sleep(2)
203
Chetan Gaonkercbe79642016-03-09 17:45:58 -0800204 def onos_aaa_load(self):
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700205 if self.aaa_loaded:
206 return
Chetan Gaonkercbe79642016-03-09 17:45:58 -0800207 aaa_dict = {'apps' : { 'org.onosproject.aaa' : { 'AAA' : { 'radiusSecret': 'radius_password',
208 'radiusIp': '172.17.0.2' } } } }
209 radius_ip = os.getenv('ONOS_AAA_IP') or '172.17.0.2'
210 aaa_dict['apps']['org.onosproject.aaa']['AAA']['radiusIp'] = radius_ip
211 self.onos_load_config('org.onosproject.aaa', aaa_dict)
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700212 self.aaa_loaded = True
Chetan Gaonkercbe79642016-03-09 17:45:58 -0800213
214 def onos_dhcp_table_load(self, config = None):
215 dhcp_dict = {'apps' : { 'org.onosproject.dhcp' : { 'dhcp' : copy.copy(self.dhcp_server_config) } } }
216 dhcp_config = dhcp_dict['apps']['org.onosproject.dhcp']['dhcp']
217 if config:
218 for k in config.keys():
219 if dhcp_config.has_key(k):
220 dhcp_config[k] = config[k]
221 self.onos_load_config('org.onosproject.dhcp', dhcp_dict)
222
223 def onos_load_config(self, app, config):
Chetan Gaonkera2b87df2016-03-31 15:41:31 -0700224 status, code = OnosCtrl.config(config)
Chetan Gaonkercbe79642016-03-09 17:45:58 -0800225 if status is False:
226 log.info('JSON config request for app %s returned status %d' %(app, code))
227 assert_equal(status, True)
228 time.sleep(2)
229
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700230 def dhcp_sndrcv(self, dhcp, update_seed = False):
231 cip, sip = dhcp.discover(update_seed = update_seed)
Chetan Gaonkercbe79642016-03-09 17:45:58 -0800232 assert_not_equal(cip, None)
233 assert_not_equal(sip, None)
234 log.info('Got dhcp client IP %s from server %s for mac %s' %
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700235 (cip, sip, dhcp.get_mac(cip)[0]))
Chetan Gaonkercbe79642016-03-09 17:45:58 -0800236 return cip,sip
237
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700238 def dhcp_request(self, subscriber, seed_ip = '10.10.10.1', update_seed = False):
Chetan Gaonker00971202016-03-23 15:11:12 -0700239 config = {'startip':'10.10.10.20', 'endip':'10.10.10.200',
Chetan Gaonkercbe79642016-03-09 17:45:58 -0800240 'ip':'10.10.10.2', 'mac': "ca:fe:ca:fe:ca:fe",
241 'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'}
242 self.onos_dhcp_table_load(config)
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700243 dhcp = DHCPTest(seed_ip = seed_ip, iface = subscriber.iface)
244 cip, sip = self.dhcp_sndrcv(dhcp, update_seed = update_seed)
Chetan Gaonkercbe79642016-03-09 17:45:58 -0800245 return cip, sip
246
247 def recv_channel_cb(self, pkt):
248 ##First verify that we have received the packet for the joined instance
249 chan = self.subscriber.caddr(pkt[IP].dst)
250 assert_equal(chan in self.subscriber.join_map.keys(), True)
251 recv_time = monotonic.monotonic() * 1000000
252 join_time = self.subscriber.join_map[chan][self.subscriber.STATS_JOIN].start
253 delta = recv_time - join_time
254 self.subscriber.join_rx_stats.update(packets=1, t = delta, usecs = True)
255 self.subscriber.channel_update(chan, self.subscriber.STATS_RX, 1, t = delta)
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700256 log.debug('Packet received in %.3f usecs for group %s after join' %(delta, pkt[IP].dst))
Chetan Gaonkercbe79642016-03-09 17:45:58 -0800257 self.test_status = True
258
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700259 def tls_verify(self, subscriber):
260 if subscriber.has_service('TLS'):
261 time.sleep(2)
262 tls = TLSAuthTest()
263 log.info('Running subscriber %s tls auth test' %subscriber.name)
264 tls.runTest()
265 self.test_status = True
266
267 def dhcp_verify(self, subscriber):
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700268 cip, sip = self.dhcp_request(subscriber, update_seed = True)
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700269 log.info('Subscriber %s got client ip %s from server %s' %(subscriber.name, cip, sip))
270 subscriber.src_list = [cip]
271 self.test_status = True
272
273 def dhcp_jump_verify(self, subscriber):
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700274 cip, sip = self.dhcp_request(subscriber, seed_ip = '10.10.200.1')
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700275 log.info('Subscriber %s got client ip %s from server %s' %(subscriber.name, cip, sip))
276 subscriber.src_list = [cip]
277 self.test_status = True
278
279 def dhcp_next_verify(self, subscriber):
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700280 cip, sip = self.dhcp_request(subscriber, seed_ip = '10.10.150.1')
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700281 log.info('Subscriber %s got client ip %s from server %s' %(subscriber.name, cip, sip))
282 subscriber.src_list = [cip]
283 self.test_status = True
284
285 def igmp_verify(self, subscriber):
286 chan = 0
287 if subscriber.has_service('IGMP'):
288 for i in range(5):
289 log.info('Joining channel %d for subscriber %s' %(chan, subscriber.name))
290 subscriber.channel_join(chan, delay = 0)
291 subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 1)
292 log.info('Leaving channel %d for subscriber %s' %(chan, subscriber.name))
293 subscriber.channel_leave(chan)
294 time.sleep(3)
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700295 log.info('Interface %s Join RX stats for subscriber %s, %s' %(subscriber.iface, subscriber.name,subscriber.join_rx_stats))
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700296 self.test_status = True
297
298 def igmp_jump_verify(self, subscriber):
299 if subscriber.has_service('IGMP'):
300 for i in xrange(subscriber.num):
301 log.info('Subscriber %s jumping channel' %subscriber.name)
302 chan = subscriber.channel_jump(delay=0)
303 subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 1)
304 log.info('Verified receive for channel %d, subscriber %s' %(chan, subscriber.name))
305 time.sleep(3)
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700306 log.info('Interface %s Jump RX stats for subscriber %s, %s' %(subscriber.iface, subscriber.name, subscriber.join_rx_stats))
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700307 self.test_status = True
308
309 def igmp_next_verify(self, subscriber):
310 if subscriber.has_service('IGMP'):
311 for i in xrange(subscriber.num):
312 if i:
313 chan = subscriber.channel_join_next(delay=0)
314 else:
315 chan = subscriber.channel_join(i, delay=0)
316 log.info('Joined next channel %d for subscriber %s' %(chan, subscriber.name))
317 subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count=1)
318 log.info('Verified receive for channel %d, subscriber %s' %(chan, subscriber.name))
319 time.sleep(3)
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700320 log.info('Interface %s Join Next RX stats for subscriber %s, %s' %(subscriber.iface, subscriber.name, subscriber.join_rx_stats))
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700321 self.test_status = True
322
Chetan Gaonker3d163852016-03-28 12:20:25 -0700323 def generate_port_list(self, subscribers, channels):
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700324 port_list = []
Chetan Gaonker3d163852016-03-28 12:20:25 -0700325 for i in xrange(subscribers):
326 if channels > 1:
327 rx_port = 2*i+1
328 tx_port = 2*i+2
329 else:
330 rx_port = Subscriber.PORT_RX_DEFAULT
331 tx_port = Subscriber.PORT_TX_DEFAULT
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700332 port_list.append((tx_port, rx_port))
333 return port_list
334
335 def subscriber_load(self, create = True, num = 10, num_channels = 1, channel_start = 0, port_list = []):
Chetan Gaonker41d2e072016-03-15 16:41:31 -0700336 '''Load the subscriber from the database'''
337 self.subscriber_db = SubscriberDB(create = create)
338 if create is True:
339 self.subscriber_db.generate(num)
340 self.subscriber_info = self.subscriber_db.read(num)
341 self.subscriber_list = []
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700342 if not port_list:
Chetan Gaonker3d163852016-03-28 12:20:25 -0700343 port_list = self.generate_port_list(num, num_channels)
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700344
345 index = 0
Chetan Gaonker41d2e072016-03-15 16:41:31 -0700346 for info in self.subscriber_info:
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700347 self.subscriber_list.append(Subscriber(name=info['Name'],
348 service=info['Service'],
Chetan Gaonker7997bb42016-03-28 09:46:15 -0700349 port_map = self.port_map,
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700350 num=num_channels,
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700351 channel_start = channel_start,
352 tx_port = port_list[index][0],
353 rx_port = port_list[index][1]))
Chetan Gaonker3d163852016-03-28 12:20:25 -0700354 if num_channels > 1:
355 channel_start += num_channels
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700356 index += 1
357
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700358 #load the ssm list for all subscriber channels
359 igmpChannel = IgmpChannel()
360 ssm_groups = map(lambda sub: sub.channels, self.subscriber_list)
361 ssm_list = reduce(lambda ssm1, ssm2: ssm1+ssm2, ssm_groups)
362 igmpChannel.igmp_load_ssm_config(ssm_list)
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700363 #load the subscriber to mcast port map for cord
364 cord_port_map = {}
365 for sub in self.subscriber_list:
366 for chan in sub.channels:
367 cord_port_map[chan] = (sub.tx_port, sub.rx_port)
368
369 igmpChannel.cord_port_table_load(cord_port_map)
Chetan Gaonker41d2e072016-03-15 16:41:31 -0700370
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700371 def subscriber_join_verify( self, num_subscribers = 10, num_channels = 1,
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700372 channel_start = 0, cbs = None, port_list = []):
Chetan Gaonkercbe79642016-03-09 17:45:58 -0800373 self.test_status = False
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700374 self.num_subscribers = num_subscribers
Chetan Gaonker7997bb42016-03-28 09:46:15 -0700375 self.subscriber_load(create = True, num = num_subscribers,
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700376 num_channels = num_channels, channel_start = channel_start, port_list = port_list)
Chetan Gaonker55fc7882016-03-15 17:46:47 -0700377 self.onos_aaa_load()
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700378 self.thread_pool = ThreadPool(min(100, self.num_subscribers), queue_size=1, wait_timeout=1)
379 if cbs is None:
380 cbs = (self.tls_verify, self.dhcp_verify, self.igmp_verify)
Chetan Gaonker41d2e072016-03-15 16:41:31 -0700381 for subscriber in self.subscriber_list:
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700382 subscriber.start()
383 pool_object = subscriber_pool(subscriber, cbs)
384 self.thread_pool.addTask(pool_object.pool_cb)
385 self.thread_pool.cleanUpThreads()
386 for subscriber in self.subscriber_list:
387 subscriber.stop()
388 return self.test_status
Chetan Gaonkercbe79642016-03-09 17:45:58 -0800389
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700390 def test_subscriber_join_recv(self):
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700391 """Test subscriber join and receive"""
392 num_subscribers = 50
Chetan Gaonker3d163852016-03-28 12:20:25 -0700393 num_channels = 1
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700394 test_status = self.subscriber_join_verify(num_subscribers = num_subscribers,
Chetan Gaonker3d163852016-03-28 12:20:25 -0700395 num_channels = num_channels,
396 port_list = self.generate_port_list(num_subscribers, num_channels))
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700397 assert_equal(test_status, True)
Chetan Gaonkercbe79642016-03-09 17:45:58 -0800398
399 def test_subscriber_join_jump(self):
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700400 """Test subscriber join and receive for channel surfing"""
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700401 num_subscribers = 5
Chetan Gaonker3d163852016-03-28 12:20:25 -0700402 num_channels = 50
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700403 test_status = self.subscriber_join_verify(num_subscribers = num_subscribers,
Chetan Gaonker3d163852016-03-28 12:20:25 -0700404 num_channels = num_channels,
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700405 cbs = (self.tls_verify, self.dhcp_jump_verify, self.igmp_jump_verify),
Chetan Gaonker3d163852016-03-28 12:20:25 -0700406 port_list = self.generate_port_list(num_subscribers, num_channels))
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700407 assert_equal(test_status, True)
Chetan Gaonker4b959fc2016-03-09 19:20:16 -0800408
409 def test_subscriber_join_next(self):
410 """Test subscriber join next for channels"""
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700411 num_subscribers = 5
Chetan Gaonker3d163852016-03-28 12:20:25 -0700412 num_channels = 50
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700413 test_status = self.subscriber_join_verify(num_subscribers = num_subscribers,
Chetan Gaonker3d163852016-03-28 12:20:25 -0700414 num_channels = num_channels,
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700415 cbs = (self.tls_verify, self.dhcp_next_verify, self.igmp_next_verify),
Chetan Gaonker3d163852016-03-28 12:20:25 -0700416 port_list = self.generate_port_list(num_subscribers, num_channels))
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700417 assert_equal(test_status, True)