blob: 733ca18c9ae1d2115766c97584c1d7f9cdb54205 [file] [log] [blame]
Chetan Gaonkercb122cc2016-05-10 10:58:34 -07001#!/usr/bin/env python
Chetan Gaonkercfcce782016-05-10 10:10:42 -07002#
3# Copyright 2016-present Ciena Corporation
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16#
Chetan Gaonkercbe79642016-03-09 17:45:58 -080017import unittest
18from nose.tools import *
19from nose.twistedtools import reactor, deferred
20from twisted.internet import defer
21from scapy.all import *
22import time, monotonic
23import os, sys
24import tempfile
25import random
26import threading
27from Stats import Stats
28from OnosCtrl import OnosCtrl
29from DHCP import DHCPTest
30from EapTLS import TLSAuthTest
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -070031from Channels import Channels, IgmpChannel
Chetan Gaonker41d2e072016-03-15 16:41:31 -070032from subscriberDb import SubscriberDB
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -070033from threadPool import ThreadPool
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -070034from portmaps import g_subscriber_port_map
Chetan Gaonker7997bb42016-03-28 09:46:15 -070035from OltConfig import *
Chetan Gaonkercbe79642016-03-09 17:45:58 -080036log.setLevel('INFO')
37
38class Subscriber(Channels):
Chetan Gaonker7997bb42016-03-28 09:46:15 -070039 PORT_TX_DEFAULT = 2
40 PORT_RX_DEFAULT = 1
41 INTF_TX_DEFAULT = 'veth2'
42 INTF_RX_DEFAULT = 'veth0'
Chetan Gaonkercbe79642016-03-09 17:45:58 -080043 STATS_RX = 0
44 STATS_TX = 1
45 STATS_JOIN = 2
46 STATS_LEAVE = 3
Chetan Gaonker41d2e072016-03-15 16:41:31 -070047 SUBSCRIBER_SERVICES = 'DHCP IGMP TLS'
Chetan Gaonker7997bb42016-03-28 09:46:15 -070048 def __init__(self, name = 'sub', service = SUBSCRIBER_SERVICES, port_map = None,
49 num = 1, channel_start = 0,
50 tx_port = PORT_TX_DEFAULT, rx_port = PORT_RX_DEFAULT,
51 iface = INTF_RX_DEFAULT, iface_mcast = INTF_TX_DEFAULT,
Chetan Gaonkercbe79642016-03-09 17:45:58 -080052 mcast_cb = None, loginType = 'wireless'):
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -070053 self.tx_port = tx_port
54 self.rx_port = rx_port
Chetan Gaonker7997bb42016-03-28 09:46:15 -070055 self.port_map = port_map or g_subscriber_port_map
56 try:
57 self.tx_intf = self.port_map[tx_port]
58 self.rx_intf = self.port_map[rx_port]
59 except:
Chetan Gaonker3d163852016-03-28 12:20:25 -070060 self.tx_intf = self.port_map[self.PORT_TX_DEFAULT]
61 self.rx_intf = self.port_map[self.PORT_RX_DEFAULT]
Chetan Gaonker7997bb42016-03-28 09:46:15 -070062
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -070063 Channels.__init__(self, num, channel_start = channel_start,
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -070064 iface = self.rx_intf, iface_mcast = self.tx_intf, mcast_cb = mcast_cb)
Chetan Gaonker41d2e072016-03-15 16:41:31 -070065 self.name = name
66 self.service = service
67 self.service_map = {}
68 services = self.service.strip().split(' ')
69 for s in services:
70 self.service_map[s] = True
Chetan Gaonkercbe79642016-03-09 17:45:58 -080071 self.loginType = loginType
72 ##start streaming channels
73 self.join_map = {}
74 ##accumulated join recv stats
75 self.join_rx_stats = Stats()
76
Chetan Gaonker41d2e072016-03-15 16:41:31 -070077 def has_service(self, service):
78 if self.service_map.has_key(service):
79 return self.service_map[service]
80 if self.service_map.has_key(service.upper()):
81 return self.service_map[service.upper()]
82 return False
83
Chetan Gaonkercbe79642016-03-09 17:45:58 -080084 def channel_join_update(self, chan, join_time):
85 self.join_map[chan] = ( Stats(), Stats(), Stats(), Stats() )
86 self.channel_update(chan, self.STATS_JOIN, 1, t = join_time)
87
88 def channel_join(self, chan = 0, delay = 2):
89 '''Join a channel and create a send/recv stats map'''
90 if self.join_map.has_key(chan):
91 del self.join_map[chan]
92 self.delay = delay
93 chan, join_time = self.join(chan)
94 self.channel_join_update(chan, join_time)
95 return chan
96
97 def channel_join_next(self, delay = 2):
98 '''Joins the next channel leaving the last channel'''
99 if self.last_chan:
100 if self.join_map.has_key(self.last_chan):
101 del self.join_map[self.last_chan]
102 self.delay = delay
103 chan, join_time = self.join_next()
104 self.channel_join_update(chan, join_time)
105 return chan
106
107 def channel_jump(self, delay = 2):
108 '''Jumps randomly to the next channel leaving the last channel'''
109 if self.last_chan is not None:
110 if self.join_map.has_key(self.last_chan):
111 del self.join_map[self.last_chan]
112 self.delay = delay
113 chan, join_time = self.jump()
114 self.channel_join_update(chan, join_time)
115 return chan
116
117 def channel_leave(self, chan = 0):
118 if self.join_map.has_key(chan):
119 del self.join_map[chan]
120 self.leave(chan)
121
122 def channel_update(self, chan, stats_type, packets, t=0):
123 if type(chan) == type(0):
124 chan_list = (chan,)
125 else:
126 chan_list = chan
127 for c in chan_list:
128 if self.join_map.has_key(c):
129 self.join_map[c][stats_type].update(packets = packets, t = t)
130
131 def channel_receive(self, chan, cb = None, count = 1):
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700132 log.info('Subscriber %s receiving from group %s, channel %d' %(self.name, self.gaddr(chan), chan))
Chetan Gaonkercbe79642016-03-09 17:45:58 -0800133 self.recv(chan, cb = cb, count = count)
134
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700135 def recv_channel_cb(self, pkt):
136 ##First verify that we have received the packet for the joined instance
137 log.debug('Packet received for group %s, subscriber %s' %(pkt[IP].dst, self.name))
138 chan = self.caddr(pkt[IP].dst)
139 assert_equal(chan in self.join_map.keys(), True)
140 recv_time = monotonic.monotonic() * 1000000
141 join_time = self.join_map[chan][self.STATS_JOIN].start
142 delta = recv_time - join_time
143 self.join_rx_stats.update(packets=1, t = delta, usecs = True)
144 self.channel_update(chan, self.STATS_RX, 1, t = delta)
145 log.debug('Packet received in %.3f usecs for group %s after join' %(delta, pkt[IP].dst))
146
147class subscriber_pool:
148
149 def __init__(self, subscriber, test_cbs):
150 self.subscriber = subscriber
151 self.test_cbs = test_cbs
152
153 def pool_cb(self):
154 for cb in self.test_cbs:
155 if cb:
156 cb(self.subscriber)
157
Chetan Gaonkercbe79642016-03-09 17:45:58 -0800158class subscriber_exchange(unittest.TestCase):
159
160 apps = [ 'org.onosproject.aaa', 'org.onosproject.dhcp' ]
Chetan Gaonkera2b87df2016-03-31 15:41:31 -0700161 olt_apps = [ 'org.onosproject.igmp', 'org.onosproject.cordmcast' ]
Chetan Gaonkercbe79642016-03-09 17:45:58 -0800162 dhcp_server_config = {
163 "ip": "10.1.11.50",
164 "mac": "ca:fe:ca:fe:ca:fe",
165 "subnet": "255.255.252.0",
166 "broadcast": "10.1.11.255",
167 "router": "10.1.8.1",
168 "domain": "8.8.8.8",
169 "ttl": "63",
170 "delay": "2",
171 "startip": "10.1.11.51",
172 "endip": "10.1.11.100"
173 }
174
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700175 aaa_loaded = False
176
Chetan Gaonkercbe79642016-03-09 17:45:58 -0800177 def setUp(self):
Chetan Gaonker7997bb42016-03-28 09:46:15 -0700178 '''Load the OLT config and activate relevant apps'''
179 self.olt = OltConfig()
180 self.port_map = self.olt.olt_port_map()
181 ##if no olt config, fall back to ovs port map
182 if not self.port_map:
183 self.port_map = g_subscriber_port_map
184 else:
185 log.info('Using OLT Port configuration for test setup')
Chetan Gaonkera2b87df2016-03-31 15:41:31 -0700186 log.info('Configuring CORD OLT access device information')
187 OnosCtrl.cord_olt_config(self.olt.olt_device_data())
188 self.activate_apps(self.olt_apps)
189
190 self.activate_apps(self.apps)
Chetan Gaonkercbe79642016-03-09 17:45:58 -0800191
192 def teardown(self):
193 '''Deactivate the dhcp app'''
194 for app in self.apps:
195 onos_ctrl = OnosCtrl(app)
196 onos_ctrl.deactivate()
197
Chetan Gaonkera2b87df2016-03-31 15:41:31 -0700198 def activate_apps(self, apps):
199 for app in self.olt_apps:
200 onos_ctrl = OnosCtrl(app)
201 status, _ = onos_ctrl.activate()
202 assert_equal(status, True)
203 time.sleep(2)
204
Chetan Gaonkercbe79642016-03-09 17:45:58 -0800205 def onos_aaa_load(self):
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700206 if self.aaa_loaded:
207 return
Chetan Gaonkercbe79642016-03-09 17:45:58 -0800208 aaa_dict = {'apps' : { 'org.onosproject.aaa' : { 'AAA' : { 'radiusSecret': 'radius_password',
209 'radiusIp': '172.17.0.2' } } } }
210 radius_ip = os.getenv('ONOS_AAA_IP') or '172.17.0.2'
211 aaa_dict['apps']['org.onosproject.aaa']['AAA']['radiusIp'] = radius_ip
212 self.onos_load_config('org.onosproject.aaa', aaa_dict)
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700213 self.aaa_loaded = True
Chetan Gaonkercbe79642016-03-09 17:45:58 -0800214
215 def onos_dhcp_table_load(self, config = None):
216 dhcp_dict = {'apps' : { 'org.onosproject.dhcp' : { 'dhcp' : copy.copy(self.dhcp_server_config) } } }
217 dhcp_config = dhcp_dict['apps']['org.onosproject.dhcp']['dhcp']
218 if config:
219 for k in config.keys():
220 if dhcp_config.has_key(k):
221 dhcp_config[k] = config[k]
222 self.onos_load_config('org.onosproject.dhcp', dhcp_dict)
223
224 def onos_load_config(self, app, config):
Chetan Gaonkera2b87df2016-03-31 15:41:31 -0700225 status, code = OnosCtrl.config(config)
Chetan Gaonkercbe79642016-03-09 17:45:58 -0800226 if status is False:
227 log.info('JSON config request for app %s returned status %d' %(app, code))
228 assert_equal(status, True)
229 time.sleep(2)
230
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700231 def dhcp_sndrcv(self, dhcp, update_seed = False):
232 cip, sip = dhcp.discover(update_seed = update_seed)
Chetan Gaonkercbe79642016-03-09 17:45:58 -0800233 assert_not_equal(cip, None)
234 assert_not_equal(sip, None)
235 log.info('Got dhcp client IP %s from server %s for mac %s' %
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700236 (cip, sip, dhcp.get_mac(cip)[0]))
Chetan Gaonkercbe79642016-03-09 17:45:58 -0800237 return cip,sip
238
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700239 def dhcp_request(self, subscriber, seed_ip = '10.10.10.1', update_seed = False):
Chetan Gaonker00971202016-03-23 15:11:12 -0700240 config = {'startip':'10.10.10.20', 'endip':'10.10.10.200',
Chetan Gaonkercbe79642016-03-09 17:45:58 -0800241 'ip':'10.10.10.2', 'mac': "ca:fe:ca:fe:ca:fe",
242 'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'}
243 self.onos_dhcp_table_load(config)
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700244 dhcp = DHCPTest(seed_ip = seed_ip, iface = subscriber.iface)
245 cip, sip = self.dhcp_sndrcv(dhcp, update_seed = update_seed)
Chetan Gaonkercbe79642016-03-09 17:45:58 -0800246 return cip, sip
247
248 def recv_channel_cb(self, pkt):
249 ##First verify that we have received the packet for the joined instance
250 chan = self.subscriber.caddr(pkt[IP].dst)
251 assert_equal(chan in self.subscriber.join_map.keys(), True)
252 recv_time = monotonic.monotonic() * 1000000
253 join_time = self.subscriber.join_map[chan][self.subscriber.STATS_JOIN].start
254 delta = recv_time - join_time
255 self.subscriber.join_rx_stats.update(packets=1, t = delta, usecs = True)
256 self.subscriber.channel_update(chan, self.subscriber.STATS_RX, 1, t = delta)
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700257 log.debug('Packet received in %.3f usecs for group %s after join' %(delta, pkt[IP].dst))
Chetan Gaonkercbe79642016-03-09 17:45:58 -0800258 self.test_status = True
259
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700260 def tls_verify(self, subscriber):
261 if subscriber.has_service('TLS'):
262 time.sleep(2)
263 tls = TLSAuthTest()
264 log.info('Running subscriber %s tls auth test' %subscriber.name)
265 tls.runTest()
266 self.test_status = True
267
268 def dhcp_verify(self, subscriber):
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700269 cip, sip = self.dhcp_request(subscriber, update_seed = True)
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700270 log.info('Subscriber %s got client ip %s from server %s' %(subscriber.name, cip, sip))
271 subscriber.src_list = [cip]
272 self.test_status = True
273
274 def dhcp_jump_verify(self, subscriber):
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700275 cip, sip = self.dhcp_request(subscriber, seed_ip = '10.10.200.1')
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700276 log.info('Subscriber %s got client ip %s from server %s' %(subscriber.name, cip, sip))
277 subscriber.src_list = [cip]
278 self.test_status = True
279
280 def dhcp_next_verify(self, subscriber):
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700281 cip, sip = self.dhcp_request(subscriber, seed_ip = '10.10.150.1')
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700282 log.info('Subscriber %s got client ip %s from server %s' %(subscriber.name, cip, sip))
283 subscriber.src_list = [cip]
284 self.test_status = True
285
286 def igmp_verify(self, subscriber):
287 chan = 0
288 if subscriber.has_service('IGMP'):
289 for i in range(5):
290 log.info('Joining channel %d for subscriber %s' %(chan, subscriber.name))
291 subscriber.channel_join(chan, delay = 0)
292 subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 1)
293 log.info('Leaving channel %d for subscriber %s' %(chan, subscriber.name))
294 subscriber.channel_leave(chan)
295 time.sleep(3)
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700296 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 -0700297 self.test_status = True
298
299 def igmp_jump_verify(self, subscriber):
300 if subscriber.has_service('IGMP'):
301 for i in xrange(subscriber.num):
302 log.info('Subscriber %s jumping channel' %subscriber.name)
303 chan = subscriber.channel_jump(delay=0)
304 subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 1)
305 log.info('Verified receive for channel %d, subscriber %s' %(chan, subscriber.name))
306 time.sleep(3)
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700307 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 -0700308 self.test_status = True
309
310 def igmp_next_verify(self, subscriber):
311 if subscriber.has_service('IGMP'):
312 for i in xrange(subscriber.num):
313 if i:
314 chan = subscriber.channel_join_next(delay=0)
315 else:
316 chan = subscriber.channel_join(i, delay=0)
317 log.info('Joined next channel %d for subscriber %s' %(chan, subscriber.name))
318 subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count=1)
319 log.info('Verified receive for channel %d, subscriber %s' %(chan, subscriber.name))
320 time.sleep(3)
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700321 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 -0700322 self.test_status = True
323
Chetan Gaonker3d163852016-03-28 12:20:25 -0700324 def generate_port_list(self, subscribers, channels):
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700325 port_list = []
Chetan Gaonker3d163852016-03-28 12:20:25 -0700326 for i in xrange(subscribers):
327 if channels > 1:
328 rx_port = 2*i+1
329 tx_port = 2*i+2
330 else:
331 rx_port = Subscriber.PORT_RX_DEFAULT
332 tx_port = Subscriber.PORT_TX_DEFAULT
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700333 port_list.append((tx_port, rx_port))
334 return port_list
335
336 def subscriber_load(self, create = True, num = 10, num_channels = 1, channel_start = 0, port_list = []):
Chetan Gaonker41d2e072016-03-15 16:41:31 -0700337 '''Load the subscriber from the database'''
338 self.subscriber_db = SubscriberDB(create = create)
339 if create is True:
340 self.subscriber_db.generate(num)
341 self.subscriber_info = self.subscriber_db.read(num)
342 self.subscriber_list = []
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700343 if not port_list:
Chetan Gaonker3d163852016-03-28 12:20:25 -0700344 port_list = self.generate_port_list(num, num_channels)
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700345
346 index = 0
Chetan Gaonker41d2e072016-03-15 16:41:31 -0700347 for info in self.subscriber_info:
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700348 self.subscriber_list.append(Subscriber(name=info['Name'],
349 service=info['Service'],
Chetan Gaonker7997bb42016-03-28 09:46:15 -0700350 port_map = self.port_map,
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700351 num=num_channels,
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700352 channel_start = channel_start,
353 tx_port = port_list[index][0],
354 rx_port = port_list[index][1]))
Chetan Gaonker3d163852016-03-28 12:20:25 -0700355 if num_channels > 1:
356 channel_start += num_channels
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700357 index += 1
358
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700359 #load the ssm list for all subscriber channels
360 igmpChannel = IgmpChannel()
361 ssm_groups = map(lambda sub: sub.channels, self.subscriber_list)
362 ssm_list = reduce(lambda ssm1, ssm2: ssm1+ssm2, ssm_groups)
363 igmpChannel.igmp_load_ssm_config(ssm_list)
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700364 #load the subscriber to mcast port map for cord
365 cord_port_map = {}
366 for sub in self.subscriber_list:
367 for chan in sub.channels:
368 cord_port_map[chan] = (sub.tx_port, sub.rx_port)
369
370 igmpChannel.cord_port_table_load(cord_port_map)
Chetan Gaonker41d2e072016-03-15 16:41:31 -0700371
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700372 def subscriber_join_verify( self, num_subscribers = 10, num_channels = 1,
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700373 channel_start = 0, cbs = None, port_list = []):
Chetan Gaonkercbe79642016-03-09 17:45:58 -0800374 self.test_status = False
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700375 self.num_subscribers = num_subscribers
Chetan Gaonker7997bb42016-03-28 09:46:15 -0700376 self.subscriber_load(create = True, num = num_subscribers,
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700377 num_channels = num_channels, channel_start = channel_start, port_list = port_list)
Chetan Gaonker55fc7882016-03-15 17:46:47 -0700378 self.onos_aaa_load()
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700379 self.thread_pool = ThreadPool(min(100, self.num_subscribers), queue_size=1, wait_timeout=1)
380 if cbs is None:
381 cbs = (self.tls_verify, self.dhcp_verify, self.igmp_verify)
Chetan Gaonker41d2e072016-03-15 16:41:31 -0700382 for subscriber in self.subscriber_list:
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700383 subscriber.start()
384 pool_object = subscriber_pool(subscriber, cbs)
385 self.thread_pool.addTask(pool_object.pool_cb)
386 self.thread_pool.cleanUpThreads()
387 for subscriber in self.subscriber_list:
388 subscriber.stop()
389 return self.test_status
Chetan Gaonkercbe79642016-03-09 17:45:58 -0800390
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700391 def test_subscriber_join_recv(self):
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700392 """Test subscriber join and receive"""
393 num_subscribers = 50
Chetan Gaonker3d163852016-03-28 12:20:25 -0700394 num_channels = 1
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700395 test_status = self.subscriber_join_verify(num_subscribers = num_subscribers,
Chetan Gaonker3d163852016-03-28 12:20:25 -0700396 num_channels = num_channels,
397 port_list = self.generate_port_list(num_subscribers, num_channels))
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700398 assert_equal(test_status, True)
Chetan Gaonkercbe79642016-03-09 17:45:58 -0800399
400 def test_subscriber_join_jump(self):
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700401 """Test subscriber join and receive for channel surfing"""
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700402 num_subscribers = 5
Chetan Gaonker3d163852016-03-28 12:20:25 -0700403 num_channels = 50
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700404 test_status = self.subscriber_join_verify(num_subscribers = num_subscribers,
Chetan Gaonker3d163852016-03-28 12:20:25 -0700405 num_channels = num_channels,
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700406 cbs = (self.tls_verify, self.dhcp_jump_verify, self.igmp_jump_verify),
Chetan Gaonker3d163852016-03-28 12:20:25 -0700407 port_list = self.generate_port_list(num_subscribers, num_channels))
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700408 assert_equal(test_status, True)
Chetan Gaonker4b959fc2016-03-09 19:20:16 -0800409
410 def test_subscriber_join_next(self):
411 """Test subscriber join next for channels"""
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700412 num_subscribers = 5
Chetan Gaonker3d163852016-03-28 12:20:25 -0700413 num_channels = 50
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700414 test_status = self.subscriber_join_verify(num_subscribers = num_subscribers,
Chetan Gaonker3d163852016-03-28 12:20:25 -0700415 num_channels = num_channels,
Chetan Gaonkera58ab6e2016-03-23 15:04:20 -0700416 cbs = (self.tls_verify, self.dhcp_next_verify, self.igmp_next_verify),
Chetan Gaonker3d163852016-03-28 12:20:25 -0700417 port_list = self.generate_port_list(num_subscribers, num_channels))
Chetan Gaonkercd86bdd2016-03-17 00:08:12 -0700418 assert_equal(test_status, True)