Matteo Scandolo | 48d3d2d | 2017-08-08 13:05:27 -0700 | [diff] [blame] | 1 | |
| 2 | # Copyright 2017-present Open Networking Foundation |
| 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 | |
| 16 | |
A R Karthick | e237aee | 2016-12-01 17:46:43 -0800 | [diff] [blame] | 17 | # |
A R Karthick | 07608ef | 2016-08-23 16:51:19 -0700 | [diff] [blame] | 18 | # Copyright 2016-present Ciena Corporation |
| 19 | # |
| 20 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 21 | # you may not use this file except in compliance with the License. |
| 22 | # You may obtain a copy of the License at |
A R Karthick | e237aee | 2016-12-01 17:46:43 -0800 | [diff] [blame] | 23 | # |
A R Karthick | 07608ef | 2016-08-23 16:51:19 -0700 | [diff] [blame] | 24 | # http://www.apache.org/licenses/LICENSE-2.0 |
A R Karthick | e237aee | 2016-12-01 17:46:43 -0800 | [diff] [blame] | 25 | # |
A R Karthick | 07608ef | 2016-08-23 16:51:19 -0700 | [diff] [blame] | 26 | # Unless required by applicable law or agreed to in writing, software |
| 27 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 28 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 29 | # See the License for the specific language governing permissions and |
| 30 | # limitations under the License. |
| 31 | # |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 32 | import unittest |
| 33 | from nose.tools import * |
| 34 | from nose.twistedtools import reactor, deferred |
| 35 | from twisted.internet import defer |
A.R Karthick | 401a1ed | 2017-05-18 11:08:27 -0700 | [diff] [blame] | 36 | from scapy.all import IP |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 37 | import time, monotonic |
| 38 | import os, sys |
| 39 | import tempfile |
| 40 | import random |
| 41 | import threading |
| 42 | import json |
A R Karthick | 65c4d72 | 2016-07-18 14:20:17 -0700 | [diff] [blame] | 43 | import requests |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 44 | from Stats import Stats |
| 45 | from OnosCtrl import OnosCtrl |
| 46 | from DHCP import DHCPTest |
| 47 | from EapTLS import TLSAuthTest |
| 48 | from Channels import Channels, IgmpChannel |
| 49 | from subscriberDb import SubscriberDB |
| 50 | from threadPool import ThreadPool |
A.R Karthick | 95d044e | 2016-06-10 18:44:36 -0700 | [diff] [blame] | 51 | from portmaps import g_subscriber_port_map |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 52 | from OltConfig import * |
A.R Karthick | 8a507cf | 2017-06-02 18:44:49 -0700 | [diff] [blame] | 53 | from CordTestServer import cord_test_onos_restart, cord_test_shell, cord_test_radius_restart |
A.R Karthick | 4c4d049 | 2017-05-26 19:23:05 -0700 | [diff] [blame] | 54 | from CordTestUtils import log_test, get_controller |
A R Karthick | 9313b76 | 2016-11-07 13:14:35 -0800 | [diff] [blame] | 55 | from CordLogger import CordLogger |
A R Karthick | 9dc6e92 | 2017-07-12 14:40:16 -0700 | [diff] [blame] | 56 | from CordTestConfig import setup_module, teardown_module |
A R Karthick | b608d40 | 2017-06-02 11:48:41 -0700 | [diff] [blame] | 57 | from CordContainer import Onos |
A R Karthick | e723209 | 2017-09-07 18:01:33 -0700 | [diff] [blame] | 58 | from VolthaCtrl import VolthaCtrl |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 59 | |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 60 | log_test.setLevel('INFO') |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 61 | |
| 62 | class Subscriber(Channels): |
| 63 | PORT_TX_DEFAULT = 2 |
| 64 | PORT_RX_DEFAULT = 1 |
| 65 | INTF_TX_DEFAULT = 'veth2' |
| 66 | INTF_RX_DEFAULT = 'veth0' |
| 67 | STATS_RX = 0 |
| 68 | STATS_TX = 1 |
| 69 | STATS_JOIN = 2 |
| 70 | STATS_LEAVE = 3 |
| 71 | SUBSCRIBER_SERVICES = 'DHCP IGMP TLS' |
A.R Karthick | 4c4d049 | 2017-05-26 19:23:05 -0700 | [diff] [blame] | 72 | |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 73 | def __init__(self, name = 'sub', service = SUBSCRIBER_SERVICES, port_map = None, |
| 74 | num = 1, channel_start = 0, |
| 75 | tx_port = PORT_TX_DEFAULT, rx_port = PORT_RX_DEFAULT, |
| 76 | iface = INTF_RX_DEFAULT, iface_mcast = INTF_TX_DEFAULT, |
| 77 | mcast_cb = None, loginType = 'wireless'): |
| 78 | self.tx_port = tx_port |
| 79 | self.rx_port = rx_port |
| 80 | self.port_map = port_map or g_subscriber_port_map |
| 81 | try: |
| 82 | self.tx_intf = self.port_map[tx_port] |
| 83 | self.rx_intf = self.port_map[rx_port] |
| 84 | except: |
| 85 | self.tx_intf = self.port_map[self.PORT_TX_DEFAULT] |
| 86 | self.rx_intf = self.port_map[self.PORT_RX_DEFAULT] |
| 87 | |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 88 | log_test.info('Subscriber %s, rx interface %s, uplink interface %s' %(name, self.rx_intf, self.tx_intf)) |
A.R Karthick | 95d044e | 2016-06-10 18:44:36 -0700 | [diff] [blame] | 89 | Channels.__init__(self, num, channel_start = channel_start, |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 90 | iface = self.rx_intf, iface_mcast = self.tx_intf, mcast_cb = mcast_cb) |
| 91 | self.name = name |
| 92 | self.service = service |
| 93 | self.service_map = {} |
| 94 | services = self.service.strip().split(' ') |
| 95 | for s in services: |
| 96 | self.service_map[s] = True |
| 97 | self.loginType = loginType |
| 98 | ##start streaming channels |
| 99 | self.join_map = {} |
| 100 | ##accumulated join recv stats |
| 101 | self.join_rx_stats = Stats() |
A R Karthick | 338268f | 2016-06-21 17:12:13 -0700 | [diff] [blame] | 102 | self.recv_timeout = False |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 103 | |
| 104 | def has_service(self, service): |
| 105 | if self.service_map.has_key(service): |
| 106 | return self.service_map[service] |
| 107 | if self.service_map.has_key(service.upper()): |
| 108 | return self.service_map[service.upper()] |
| 109 | return False |
| 110 | |
| 111 | def channel_join_update(self, chan, join_time): |
| 112 | self.join_map[chan] = ( Stats(), Stats(), Stats(), Stats() ) |
| 113 | self.channel_update(chan, self.STATS_JOIN, 1, t = join_time) |
| 114 | |
| 115 | def channel_join(self, chan = 0, delay = 2): |
| 116 | '''Join a channel and create a send/recv stats map''' |
| 117 | if self.join_map.has_key(chan): |
| 118 | del self.join_map[chan] |
| 119 | self.delay = delay |
| 120 | chan, join_time = self.join(chan) |
| 121 | self.channel_join_update(chan, join_time) |
| 122 | return chan |
| 123 | |
A.R Karthick | 517f781 | 2017-05-18 11:22:46 -0700 | [diff] [blame] | 124 | def channel_join_next(self, delay = 2, leave_flag = True): |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 125 | '''Joins the next channel leaving the last channel''' |
| 126 | if self.last_chan: |
| 127 | if self.join_map.has_key(self.last_chan): |
| 128 | del self.join_map[self.last_chan] |
| 129 | self.delay = delay |
A.R Karthick | 517f781 | 2017-05-18 11:22:46 -0700 | [diff] [blame] | 130 | chan, join_time = self.join_next(leave_flag = leave_flag) |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 131 | self.channel_join_update(chan, join_time) |
| 132 | return chan |
| 133 | |
| 134 | def channel_jump(self, delay = 2): |
| 135 | '''Jumps randomly to the next channel leaving the last channel''' |
| 136 | if self.last_chan is not None: |
| 137 | if self.join_map.has_key(self.last_chan): |
| 138 | del self.join_map[self.last_chan] |
| 139 | self.delay = delay |
| 140 | chan, join_time = self.jump() |
| 141 | self.channel_join_update(chan, join_time) |
| 142 | return chan |
| 143 | |
A R Karthick | 78d1f49 | 2017-05-19 14:24:17 -0700 | [diff] [blame] | 144 | def channel_leave(self, chan = 0, force = False): |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 145 | if self.join_map.has_key(chan): |
| 146 | del self.join_map[chan] |
A R Karthick | 78d1f49 | 2017-05-19 14:24:17 -0700 | [diff] [blame] | 147 | self.leave(chan, force = force) |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 148 | |
| 149 | def channel_update(self, chan, stats_type, packets, t=0): |
| 150 | if type(chan) == type(0): |
| 151 | chan_list = (chan,) |
| 152 | else: |
| 153 | chan_list = chan |
A.R Karthick | 95d044e | 2016-06-10 18:44:36 -0700 | [diff] [blame] | 154 | for c in chan_list: |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 155 | if self.join_map.has_key(c): |
| 156 | self.join_map[c][stats_type].update(packets = packets, t = t) |
| 157 | |
A R Karthick | 338268f | 2016-06-21 17:12:13 -0700 | [diff] [blame] | 158 | def channel_receive(self, chan, cb = None, count = 1, timeout = 5): |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 159 | log_test.info('Subscriber %s on port %s receiving from group %s, channel %d' % |
A R Karthick | 338268f | 2016-06-21 17:12:13 -0700 | [diff] [blame] | 160 | (self.name, self.rx_intf, self.gaddr(chan), chan)) |
| 161 | r = self.recv(chan, cb = cb, count = count, timeout = timeout) |
A R Karthick | a013a27 | 2016-08-16 16:40:19 -0700 | [diff] [blame] | 162 | if len(r) == 0: |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 163 | log_test.info('Subscriber %s on port %s timed out' %(self.name, self.rx_intf)) |
A R Karthick | a013a27 | 2016-08-16 16:40:19 -0700 | [diff] [blame] | 164 | else: |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 165 | log_test.info('Subscriber %s on port %s received %d packets' %(self.name, self.rx_intf, len(r))) |
A R Karthick | 338268f | 2016-06-21 17:12:13 -0700 | [diff] [blame] | 166 | if self.recv_timeout: |
| 167 | ##Negative test case is disabled for now |
| 168 | assert_equal(len(r), 0) |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 169 | |
| 170 | def recv_channel_cb(self, pkt): |
| 171 | ##First verify that we have received the packet for the joined instance |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 172 | log_test.info('Packet received for group %s, subscriber %s, port %s' % |
A R Karthick | 338268f | 2016-06-21 17:12:13 -0700 | [diff] [blame] | 173 | (pkt[IP].dst, self.name, self.rx_intf)) |
| 174 | if self.recv_timeout: |
| 175 | return |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 176 | chan = self.caddr(pkt[IP].dst) |
| 177 | assert_equal(chan in self.join_map.keys(), True) |
| 178 | recv_time = monotonic.monotonic() * 1000000 |
| 179 | join_time = self.join_map[chan][self.STATS_JOIN].start |
| 180 | delta = recv_time - join_time |
| 181 | self.join_rx_stats.update(packets=1, t = delta, usecs = True) |
| 182 | self.channel_update(chan, self.STATS_RX, 1, t = delta) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 183 | log_test.debug('Packet received in %.3f usecs for group %s after join' %(delta, pkt[IP].dst)) |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 184 | |
| 185 | class subscriber_pool: |
| 186 | |
| 187 | def __init__(self, subscriber, test_cbs): |
| 188 | self.subscriber = subscriber |
| 189 | self.test_cbs = test_cbs |
| 190 | |
| 191 | def pool_cb(self): |
| 192 | for cb in self.test_cbs: |
| 193 | if cb: |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 194 | self.test_status = cb(self.subscriber) |
| 195 | if self.test_status is not True: |
| 196 | ## This is chaning for other sub status has to check again |
| 197 | self.test_status = True |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 198 | log_test.info('This service is failed and other services will not run for this subscriber') |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 199 | break |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 200 | log_test.info('This Subscriber is tested for multiple service eligibility ') |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 201 | self.test_status = True |
| 202 | |
A.R Karthick | 95d044e | 2016-06-10 18:44:36 -0700 | [diff] [blame] | 203 | |
A R Karthick | 9313b76 | 2016-11-07 13:14:35 -0800 | [diff] [blame] | 204 | class subscriber_exchange(CordLogger): |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 205 | |
A.R Karthick | 95d044e | 2016-06-10 18:44:36 -0700 | [diff] [blame] | 206 | apps = ('org.opencord.aaa', 'org.onosproject.dhcp') |
| 207 | olt_apps = () #'org.opencord.cordmcast') |
A R Karthick | a013a27 | 2016-08-16 16:40:19 -0700 | [diff] [blame] | 208 | vtn_app = 'org.opencord.vtn' |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 209 | table_app = 'org.ciena.cordigmp' |
| 210 | dhcp_server_config = { |
| 211 | "ip": "10.1.11.50", |
| 212 | "mac": "ca:fe:ca:fe:ca:fe", |
| 213 | "subnet": "255.255.252.0", |
| 214 | "broadcast": "10.1.11.255", |
| 215 | "router": "10.1.8.1", |
| 216 | "domain": "8.8.8.8", |
| 217 | "ttl": "63", |
| 218 | "delay": "2", |
| 219 | "startip": "10.1.11.51", |
| 220 | "endip": "10.1.11.100" |
| 221 | } |
| 222 | |
| 223 | aaa_loaded = False |
| 224 | test_path = os.path.dirname(os.path.realpath(__file__)) |
A R Karthick | 4b72d4b | 2016-06-15 11:09:17 -0700 | [diff] [blame] | 225 | table_app_file = os.path.join(test_path, '..', 'apps/ciena-cordigmp-multitable-2.0-SNAPSHOT.oar') |
| 226 | app_file = os.path.join(test_path, '..', 'apps/ciena-cordigmp-2.0-SNAPSHOT.oar') |
A.R Karthick | 4c4d049 | 2017-05-26 19:23:05 -0700 | [diff] [blame] | 227 | olt_app_file = os.path.join(test_path, '..', 'apps/olt-app-1.2-SNAPSHOT.oar') |
A.R Karthick | 8a507cf | 2017-06-02 18:44:49 -0700 | [diff] [blame] | 228 | olt_app_name = 'org.onosproject.olt' |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 229 | onos_config_path = os.path.join(test_path, '..', 'setup/onos-config') |
A.R Karthick | 5968e0d | 2017-05-16 14:50:46 -0700 | [diff] [blame] | 230 | olt_conf_file = os.getenv('OLT_CONFIG_FILE', os.path.join(test_path, '..', 'setup/olt_config.json')) |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 231 | cpqd_path = os.path.join(test_path, '..', 'setup') |
| 232 | ovs_path = cpqd_path |
A R Karthick | 65c4d72 | 2016-07-18 14:20:17 -0700 | [diff] [blame] | 233 | test_services = ('IGMP', 'TRAFFIC') |
A R Karthick | 338268f | 2016-06-21 17:12:13 -0700 | [diff] [blame] | 234 | num_joins = 0 |
| 235 | num_subscribers = 0 |
A.R Karthick | 517f781 | 2017-05-18 11:22:46 -0700 | [diff] [blame] | 236 | leave_flag = True |
A R Karthick | 338268f | 2016-06-21 17:12:13 -0700 | [diff] [blame] | 237 | num_channels = 0 |
| 238 | recv_timeout = False |
A R Karthick | 4e0c091 | 2016-08-17 16:57:42 -0700 | [diff] [blame] | 239 | onos_restartable = bool(int(os.getenv('ONOS_RESTART', 0))) |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 240 | INTF_TX_DEFAULT = 'veth2' |
| 241 | INTF_RX_DEFAULT = 'veth0' |
| 242 | SUBSCRIBER_TIMEOUT = 300 |
| 243 | |
| 244 | CLIENT_CERT = """-----BEGIN CERTIFICATE----- |
| 245 | MIICuDCCAiGgAwIBAgIBAjANBgkqhkiG9w0BAQUFADCBizELMAkGA1UEBhMCVVMx |
| 246 | CzAJBgNVBAgTAkNBMRIwEAYDVQQHEwlTb21ld2hlcmUxEzARBgNVBAoTCkNpZW5h |
| 247 | IEluYy4xHjAcBgkqhkiG9w0BCQEWD2FkbWluQGNpZW5hLmNvbTEmMCQGA1UEAxMd |
| 248 | RXhhbXBsZSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMTYwNjA2MjExMjI3WhcN |
| 249 | MTcwNjAxMjExMjI3WjBnMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExEzARBgNV |
| 250 | BAoTCkNpZW5hIEluYy4xFzAVBgNVBAMUDnVzZXJAY2llbmEuY29tMR0wGwYJKoZI |
| 251 | hvcNAQkBFg51c2VyQGNpZW5hLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkC |
| 252 | gYEAwvXiSzb9LZ6c7uNziUfKvoHO7wu/uiFC5YUpXbmVGuGZizbVrny0xnR85Dfe |
| 253 | +9R4diansfDhIhzOUl1XjN3YDeSS9OeF5YWNNE8XDhlz2d3rVzaN6hIhdotBkUjg |
| 254 | rUewjTg5OFR31QEyG3v8xR3CLgiE9xQELjZbSA07pD79zuUCAwEAAaNPME0wEwYD |
| 255 | VR0lBAwwCgYIKwYBBQUHAwIwNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL3d3dy5l |
| 256 | eGFtcGxlLmNvbS9leGFtcGxlX2NhLmNybDANBgkqhkiG9w0BAQUFAAOBgQDAjkrY |
| 257 | 6tDChmKbvr8w6Du/t8vHjTCoCIocHTN0qzWOeb1YsAGX89+TrWIuO1dFyYd+Z0KC |
| 258 | PDKB5j/ygml9Na+AklSYAVJIjvlzXKZrOaPmhZqDufi+rXWti/utVqY4VMW2+HKC |
| 259 | nXp37qWeuFLGyR1519Y1d6F/5XzqmvbwURuEug== |
| 260 | -----END CERTIFICATE-----""" |
| 261 | |
| 262 | CLIENT_CERT_INVALID = '''-----BEGIN CERTIFICATE----- |
| 263 | MIIDvTCCAqWgAwIBAgIBAjANBgkqhkiG9w0BAQUFADCBizELMAkGA1UEBhMCVVMx |
| 264 | CzAJBgNVBAgTAkNBMRIwEAYDVQQHEwlTb21ld2hlcmUxEzARBgNVBAoTCkNpZW5h |
| 265 | IEluYy4xHjAcBgkqhkiG9w0BCQEWD2FkbWluQGNpZW5hLmNvbTEmMCQGA1UEAxMd |
| 266 | RXhhbXBsZSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMTYwMzExMTg1MzM2WhcN |
| 267 | MTcwMzA2MTg1MzM2WjBnMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExEzARBgNV |
| 268 | BAoTCkNpZW5hIEluYy4xFzAVBgNVBAMUDnVzZXJAY2llbmEuY29tMR0wGwYJKoZI |
| 269 | hvcNAQkBFg51c2VyQGNpZW5hLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC |
| 270 | AQoCggEBAOxemcBsPn9tZsCa5o2JA6sQDC7A6JgCNXXl2VFzKLNNvB9PS6D7ZBsQ |
| 271 | 5An0zEDMNzi51q7lnrYg1XyiE4S8FzMGAFr94RlGMQJUbRD9V/oqszMX4k++iAOK |
| 272 | tIA1gr3x7Zi+0tkjVSVzXTmgNnhChAamdMsjYUG5+CY9WAicXyy+VEV3zTphZZDR |
| 273 | OjcjEp4m/TSXVPYPgYDXI40YZKX5BdvqykWtT/tIgZb48RS1NPyN/XkCYzl3bv21 |
| 274 | qx7Mc0fcEbsJBIIRYTUkfxnsilcnmLxSYO+p+DZ9uBLBzcQt+4Rd5pLSfi21WM39 |
| 275 | 2Z2oOi3vs/OYAPAqgmi2JWOv3mePa/8CAwEAAaNPME0wEwYDVR0lBAwwCgYIKwYB |
| 276 | BQUHAwIwNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL3d3dy5leGFtcGxlLmNvbS9l |
| 277 | eGFtcGxlX2NhLmNybDANBgkqhkiG9w0BAQUFAAOCAQEALBzMPDTIB6sLyPl0T6JV |
| 278 | MjOkyldAVhXWiQsTjaGQGJUUe1cmUJyZbUZEc13MygXMPOM4x7z6VpXGuq1c/Vxn |
| 279 | VzQ2fNnbJcIAHi/7G8W5/SQfPesIVDsHTEc4ZspPi5jlS/MVX3HOC+BDbOjdbwqP |
| 280 | RX0JEr+uOyhjO+lRxG8ilMRACoBUbw1eDuVDoEBgErSUC44pq5ioDw2xelc+Y6hQ |
| 281 | dmtYwfY0DbvwxHtA495frLyPcastDiT/zre7NL51MyUDPjjYjghNQEwvu66IKbQ3 |
| 282 | T1tJBrgI7/WI+dqhKBFolKGKTDWIHsZXQvZ1snGu/FRYzg1l+R/jT8cRB9BDwhUt |
| 283 | yg== |
| 284 | -----END CERTIFICATE-----''' |
| 285 | |
A.R Karthick | 4c4d049 | 2017-05-26 19:23:05 -0700 | [diff] [blame] | 286 | VOLTHA_HOST = None |
A R Karthick | 18d0fb6 | 2017-09-01 18:49:07 -0700 | [diff] [blame] | 287 | VOLTHA_TEARDOWN = True |
A R Karthick | e723209 | 2017-09-07 18:01:33 -0700 | [diff] [blame] | 288 | VOLTHA_REST_PORT = VolthaCtrl.REST_PORT |
A R Karthick | d52ca8a | 2017-07-24 17:38:55 -0700 | [diff] [blame] | 289 | VOLTHA_UPLINK_VLAN_MAP = { 'of:0001000000000001' : '222' } |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 290 | VOLTHA_UPLINK_VLAN_START = 333 |
A.R Karthick | 4c4d049 | 2017-05-26 19:23:05 -0700 | [diff] [blame] | 291 | VOLTHA_IGMP_ITERATIONS = 100 |
| 292 | VOLTHA_CONFIG_FAKE = True |
| 293 | VOLTHA_OLT_TYPE = 'simulated_olt' |
| 294 | VOLTHA_OLT_MAC = '00:0c:e2:31:12:00' |
| 295 | VOLTHA_ENABLED = bool(int(os.getenv('VOLTHA_ENABLED', 0))) |
A R Karthick | 9dc6e92 | 2017-07-12 14:40:16 -0700 | [diff] [blame] | 296 | voltha_ctrl = None |
| 297 | voltha_device = None |
| 298 | voltha_switch_map = None |
A R Karthick | 18d0fb6 | 2017-09-01 18:49:07 -0700 | [diff] [blame] | 299 | voltha_preconfigured = False |
A.R Karthick | 4c4d049 | 2017-05-26 19:23:05 -0700 | [diff] [blame] | 300 | |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 301 | @classmethod |
A R Karthick | b608d40 | 2017-06-02 11:48:41 -0700 | [diff] [blame] | 302 | def update_apps_version(cls): |
| 303 | version = Onos.getVersion() |
| 304 | major = int(version.split('.')[0]) |
| 305 | minor = int(version.split('.')[1]) |
| 306 | cordigmp_app_version = '2.0-SNAPSHOT' |
| 307 | olt_app_version = '1.2-SNAPSHOT' |
| 308 | if major > 1: |
| 309 | cordigmp_app_version = '3.0-SNAPSHOT' |
A R Karthick | 1555c7c | 2017-09-07 14:59:41 -0700 | [diff] [blame] | 310 | olt_app_version = '3.0-SNAPSHOT' |
A R Karthick | b608d40 | 2017-06-02 11:48:41 -0700 | [diff] [blame] | 311 | elif major == 1: |
A R Karthick | 1555c7c | 2017-09-07 14:59:41 -0700 | [diff] [blame] | 312 | if minor >= 10: |
A R Karthick | b608d40 | 2017-06-02 11:48:41 -0700 | [diff] [blame] | 313 | cordigmp_app_version = '3.0-SNAPSHOT' |
A R Karthick | 1555c7c | 2017-09-07 14:59:41 -0700 | [diff] [blame] | 314 | olt_app_version = '3.0-SNAPSHOT' |
A R Karthick | b608d40 | 2017-06-02 11:48:41 -0700 | [diff] [blame] | 315 | elif minor <= 8: |
| 316 | olt_app_version = '1.1-SNAPSHOT' |
| 317 | cls.app_file = os.path.join(cls.test_path, '..', 'apps/ciena-cordigmp-{}.oar'.format(cordigmp_app_version)) |
| 318 | cls.table_app_file = os.path.join(cls.test_path, '..', 'apps/ciena-cordigmp-multitable-{}.oar'.format(cordigmp_app_version)) |
| 319 | cls.olt_app_file = os.path.join(cls.test_path, '..', 'apps/olt-app-{}.oar'.format(olt_app_version)) |
| 320 | |
| 321 | @classmethod |
A R Karthick | d44cea1 | 2016-07-20 12:16:41 -0700 | [diff] [blame] | 322 | def load_device_id(cls): |
A R Karthick | b03cecd | 2016-07-27 10:27:55 -0700 | [diff] [blame] | 323 | '''Configure the device id''' |
| 324 | did = OnosCtrl.get_device_id() |
A R Karthick | d44cea1 | 2016-07-20 12:16:41 -0700 | [diff] [blame] | 325 | #Set the default config |
| 326 | cls.device_id = did |
| 327 | cls.device_dict = { "devices" : { |
| 328 | "{}".format(did) : { |
| 329 | "basic" : { |
| 330 | "driver" : "pmc-olt" |
| 331 | } |
| 332 | } |
| 333 | }, |
| 334 | } |
| 335 | return did |
| 336 | |
| 337 | @classmethod |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 338 | def setUpClass(cls): |
| 339 | '''Load the OLT config and activate relevant apps''' |
A R Karthick | b608d40 | 2017-06-02 11:48:41 -0700 | [diff] [blame] | 340 | cls.update_apps_version() |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 341 | cls.olt = OltConfig(olt_conf_file = cls.olt_conf_file) |
A.R Karthick | 4c4d049 | 2017-05-26 19:23:05 -0700 | [diff] [blame] | 342 | if cls.VOLTHA_ENABLED is False: |
A R Karthick | 38d5df4 | 2017-07-10 13:33:26 -0700 | [diff] [blame] | 343 | OnosCtrl.config_device_driver() |
A.R Karthick | 4c4d049 | 2017-05-26 19:23:05 -0700 | [diff] [blame] | 344 | OnosCtrl.cord_olt_config(cls.olt) |
A R Karthick | b03cecd | 2016-07-27 10:27:55 -0700 | [diff] [blame] | 345 | cls.port_map, cls.port_list = cls.olt.olt_port_map() |
A R Karthick | 0f6b684 | 2016-12-06 17:17:44 -0800 | [diff] [blame] | 346 | cls.switches = cls.port_map['switches'] |
| 347 | cls.num_ports = cls.port_map['num_ports'] |
| 348 | if cls.num_ports > 1: |
| 349 | cls.num_ports -= 1 ##account for the tx port |
A R Karthick | efcf1ab | 2017-09-08 18:24:16 -0700 | [diff] [blame] | 350 | cls.activate_apps(cls.apps + cls.olt_apps) |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 351 | |
| 352 | @classmethod |
| 353 | def tearDownClass(cls): |
| 354 | '''Deactivate the olt apps and restart OVS back''' |
A R Karthick | 38d5df4 | 2017-07-10 13:33:26 -0700 | [diff] [blame] | 355 | apps = cls.olt_apps |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 356 | for app in apps: |
| 357 | onos_ctrl = OnosCtrl(app) |
| 358 | onos_ctrl.deactivate() |
A R Karthick | 38d5df4 | 2017-07-10 13:33:26 -0700 | [diff] [blame] | 359 | if cls.VOLTHA_ENABLED is False: |
| 360 | OnosCtrl.config_device_driver(driver = 'ovs') |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 361 | |
| 362 | @classmethod |
A.R Karthick | aa859b2 | 2017-06-12 14:50:35 -0700 | [diff] [blame] | 363 | def activate_apps(cls, apps, deactivate = False): |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 364 | for app in apps: |
| 365 | onos_ctrl = OnosCtrl(app) |
A.R Karthick | aa859b2 | 2017-06-12 14:50:35 -0700 | [diff] [blame] | 366 | if deactivate is True: |
| 367 | onos_ctrl.deactivate() |
| 368 | time.sleep(2) |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 369 | status, _ = onos_ctrl.activate() |
| 370 | assert_equal(status, True) |
| 371 | time.sleep(2) |
| 372 | |
| 373 | @classmethod |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 374 | def start_onos(cls, network_cfg = None): |
A R Karthick | a478df4 | 2016-07-27 16:51:08 -0700 | [diff] [blame] | 375 | if cls.onos_restartable is False: |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 376 | log_test.info('ONOS restart is disabled. Skipping ONOS restart') |
A R Karthick | 65c4d72 | 2016-07-18 14:20:17 -0700 | [diff] [blame] | 377 | return |
A.R Karthick | 4c4d049 | 2017-05-26 19:23:05 -0700 | [diff] [blame] | 378 | if cls.VOLTHA_ENABLED is True: |
| 379 | log_test.info('ONOS restart skipped as VOLTHA is running') |
| 380 | return |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 381 | if network_cfg is None: |
A R Karthick | 4b72d4b | 2016-06-15 11:09:17 -0700 | [diff] [blame] | 382 | network_cfg = cls.device_dict |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 383 | |
| 384 | if type(network_cfg) is tuple: |
| 385 | res = [] |
| 386 | for v in network_cfg: |
| 387 | res += v.items() |
| 388 | config = dict(res) |
| 389 | else: |
| 390 | config = network_cfg |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 391 | log_test.info('Restarting ONOS with new network configuration') |
A R Karthick | 338268f | 2016-06-21 17:12:13 -0700 | [diff] [blame] | 392 | return cord_test_onos_restart(config = config) |
A R Karthick | 4b72d4b | 2016-06-15 11:09:17 -0700 | [diff] [blame] | 393 | |
| 394 | @classmethod |
| 395 | def remove_onos_config(cls): |
| 396 | try: |
| 397 | os.unlink('{}/network-cfg.json'.format(cls.onos_config_path)) |
| 398 | except: pass |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 399 | |
| 400 | @classmethod |
| 401 | def start_cpqd(cls, mac = '00:11:22:33:44:55'): |
| 402 | dpid = mac.replace(':', '') |
| 403 | cpqd_file = os.sep.join( (cls.cpqd_path, 'cpqd.sh') ) |
| 404 | cpqd_cmd = '{} {}'.format(cpqd_file, dpid) |
| 405 | ret = os.system(cpqd_cmd) |
| 406 | assert_equal(ret, 0) |
| 407 | time.sleep(10) |
A R Karthick | 4b72d4b | 2016-06-15 11:09:17 -0700 | [diff] [blame] | 408 | device_id = 'of:{}{}'.format('0'*4, dpid) |
| 409 | return device_id |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 410 | |
| 411 | @classmethod |
| 412 | def start_ovs(cls): |
A R Karthick | 4b72d4b | 2016-06-15 11:09:17 -0700 | [diff] [blame] | 413 | ovs_file = os.sep.join( (cls.ovs_path, 'of-bridge.sh') ) |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 414 | ret = os.system(ovs_file) |
| 415 | assert_equal(ret, 0) |
A R Karthick | 4b72d4b | 2016-06-15 11:09:17 -0700 | [diff] [blame] | 416 | time.sleep(30) |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 417 | |
A R Karthick | a013a27 | 2016-08-16 16:40:19 -0700 | [diff] [blame] | 418 | @classmethod |
| 419 | def ovs_cleanup(cls): |
| 420 | ##For every test case, delete all the OVS groups |
| 421 | cmd = 'ovs-ofctl del-groups br-int -OOpenFlow11 >/dev/null 2>&1' |
A R Karthick | a013a27 | 2016-08-16 16:40:19 -0700 | [diff] [blame] | 422 | try: |
A.R Karthick | 98fc7cf | 2017-05-17 14:39:46 -0700 | [diff] [blame] | 423 | cord_test_shell(cmd) |
| 424 | ##Since olt config is used for this test, we just fire a careless local cmd as well |
A R Karthick | a013a27 | 2016-08-16 16:40:19 -0700 | [diff] [blame] | 425 | os.system(cmd) |
A.R Karthick | 98fc7cf | 2017-05-17 14:39:46 -0700 | [diff] [blame] | 426 | finally: |
| 427 | return |
A R Karthick | a013a27 | 2016-08-16 16:40:19 -0700 | [diff] [blame] | 428 | |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 429 | def onos_aaa_load(self): |
| 430 | if self.aaa_loaded: |
| 431 | return |
A R Karthick | 1555c7c | 2017-09-07 14:59:41 -0700 | [diff] [blame] | 432 | OnosCtrl.aaa_load_config() |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 433 | self.aaa_loaded = True |
| 434 | |
| 435 | def onos_dhcp_table_load(self, config = None): |
| 436 | dhcp_dict = {'apps' : { 'org.onosproject.dhcp' : { 'dhcp' : copy.copy(self.dhcp_server_config) } } } |
| 437 | dhcp_config = dhcp_dict['apps']['org.onosproject.dhcp']['dhcp'] |
| 438 | if config: |
| 439 | for k in config.keys(): |
| 440 | if dhcp_config.has_key(k): |
| 441 | dhcp_config[k] = config[k] |
| 442 | self.onos_load_config('org.onosproject.dhcp', dhcp_dict) |
| 443 | |
| 444 | def onos_load_config(self, app, config): |
| 445 | status, code = OnosCtrl.config(config) |
| 446 | if status is False: |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 447 | log_test.info('JSON config request for app %s returned status %d' %(app, code)) |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 448 | assert_equal(status, True) |
| 449 | time.sleep(2) |
| 450 | |
| 451 | def dhcp_sndrcv(self, dhcp, update_seed = False): |
| 452 | cip, sip = dhcp.discover(update_seed = update_seed) |
| 453 | assert_not_equal(cip, None) |
| 454 | assert_not_equal(sip, None) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 455 | log_test.info('Got dhcp client IP %s from server %s for mac %s' % |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 456 | (cip, sip, dhcp.get_mac(cip)[0])) |
| 457 | return cip,sip |
| 458 | |
| 459 | def dhcp_request(self, subscriber, seed_ip = '10.10.10.1', update_seed = False): |
| 460 | config = {'startip':'10.10.10.20', 'endip':'10.10.10.200', |
| 461 | 'ip':'10.10.10.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 462 | 'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'} |
| 463 | self.onos_dhcp_table_load(config) |
| 464 | dhcp = DHCPTest(seed_ip = seed_ip, iface = subscriber.iface) |
| 465 | cip, sip = self.dhcp_sndrcv(dhcp, update_seed = update_seed) |
| 466 | return cip, sip |
| 467 | |
| 468 | def recv_channel_cb(self, pkt): |
| 469 | ##First verify that we have received the packet for the joined instance |
| 470 | chan = self.subscriber.caddr(pkt[IP].dst) |
| 471 | assert_equal(chan in self.subscriber.join_map.keys(), True) |
| 472 | recv_time = monotonic.monotonic() * 1000000 |
| 473 | join_time = self.subscriber.join_map[chan][self.subscriber.STATS_JOIN].start |
| 474 | delta = recv_time - join_time |
| 475 | self.subscriber.join_rx_stats.update(packets=1, t = delta, usecs = True) |
| 476 | self.subscriber.channel_update(chan, self.subscriber.STATS_RX, 1, t = delta) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 477 | log_test.debug('Packet received in %.3f usecs for group %s after join' %(delta, pkt[IP].dst)) |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 478 | self.test_status = True |
| 479 | |
A R Karthick | 65c4d72 | 2016-07-18 14:20:17 -0700 | [diff] [blame] | 480 | def traffic_verify(self, subscriber): |
| 481 | if subscriber.has_service('TRAFFIC'): |
| 482 | url = 'http://www.google.com' |
| 483 | resp = requests.get(url) |
| 484 | self.test_status = resp.ok |
| 485 | if resp.ok == False: |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 486 | log_test.info('Subscriber %s failed get from url %s with status code %d' |
A R Karthick | 65c4d72 | 2016-07-18 14:20:17 -0700 | [diff] [blame] | 487 | %(subscriber.name, url, resp.status_code)) |
| 488 | else: |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 489 | log_test.info('GET request from %s succeeded for subscriber %s' |
A R Karthick | 65c4d72 | 2016-07-18 14:20:17 -0700 | [diff] [blame] | 490 | %(url, subscriber.name)) |
A R Karthick | a013a27 | 2016-08-16 16:40:19 -0700 | [diff] [blame] | 491 | return self.test_status |
A R Karthick | 65c4d72 | 2016-07-18 14:20:17 -0700 | [diff] [blame] | 492 | |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 493 | def tls_verify(self, subscriber): |
A.R Karthick | 8a507cf | 2017-06-02 18:44:49 -0700 | [diff] [blame] | 494 | def tls_fail_cb(): |
| 495 | log_test.info('TLS verification failed') |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 496 | if subscriber.has_service('TLS'): |
A.R Karthick | aa859b2 | 2017-06-12 14:50:35 -0700 | [diff] [blame] | 497 | #OnosCtrl('org.opencord.aaa').deactivate() |
| 498 | #time.sleep(2) |
| 499 | #OnosCtrl('org.opencord.aaa').activate() |
| 500 | #time.sleep(5) |
A.R Karthick | 8a507cf | 2017-06-02 18:44:49 -0700 | [diff] [blame] | 501 | tls = TLSAuthTest(fail_cb = tls_fail_cb, intf = subscriber.rx_intf) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 502 | log_test.info('Running subscriber %s tls auth test' %subscriber.name) |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 503 | tls.runTest() |
A.R Karthick | 8a507cf | 2017-06-02 18:44:49 -0700 | [diff] [blame] | 504 | assert_equal(tls.failTest, False) |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 505 | self.test_status = True |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 506 | return self.test_status |
| 507 | else: |
| 508 | self.test_status = True |
| 509 | return self.test_status |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 510 | |
| 511 | def dhcp_verify(self, subscriber): |
A R Karthick | 4b72d4b | 2016-06-15 11:09:17 -0700 | [diff] [blame] | 512 | if subscriber.has_service('DHCP'): |
| 513 | cip, sip = self.dhcp_request(subscriber, update_seed = True) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 514 | log_test.info('Subscriber %s got client ip %s from server %s' %(subscriber.name, cip, sip)) |
A R Karthick | 4b72d4b | 2016-06-15 11:09:17 -0700 | [diff] [blame] | 515 | subscriber.src_list = [cip] |
| 516 | self.test_status = True |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 517 | return self.test_status |
A R Karthick | 4b72d4b | 2016-06-15 11:09:17 -0700 | [diff] [blame] | 518 | else: |
| 519 | subscriber.src_list = ['10.10.10.{}'.format(subscriber.rx_port)] |
| 520 | self.test_status = True |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 521 | return self.test_status |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 522 | |
| 523 | def dhcp_jump_verify(self, subscriber): |
A R Karthick | 4b72d4b | 2016-06-15 11:09:17 -0700 | [diff] [blame] | 524 | if subscriber.has_service('DHCP'): |
| 525 | cip, sip = self.dhcp_request(subscriber, seed_ip = '10.10.200.1') |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 526 | log_test.info('Subscriber %s got client ip %s from server %s' %(subscriber.name, cip, sip)) |
A R Karthick | 4b72d4b | 2016-06-15 11:09:17 -0700 | [diff] [blame] | 527 | subscriber.src_list = [cip] |
| 528 | self.test_status = True |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 529 | return self.test_status |
A R Karthick | 4b72d4b | 2016-06-15 11:09:17 -0700 | [diff] [blame] | 530 | else: |
| 531 | subscriber.src_list = ['10.10.10.{}'.format(subscriber.rx_port)] |
| 532 | self.test_status = True |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 533 | return self.test_status |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 534 | |
| 535 | def dhcp_next_verify(self, subscriber): |
A R Karthick | 4b72d4b | 2016-06-15 11:09:17 -0700 | [diff] [blame] | 536 | if subscriber.has_service('DHCP'): |
| 537 | cip, sip = self.dhcp_request(subscriber, seed_ip = '10.10.150.1') |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 538 | log_test.info('Subscriber %s got client ip %s from server %s' %(subscriber.name, cip, sip)) |
A R Karthick | 4b72d4b | 2016-06-15 11:09:17 -0700 | [diff] [blame] | 539 | subscriber.src_list = [cip] |
| 540 | self.test_status = True |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 541 | return self.test_status |
A R Karthick | 4b72d4b | 2016-06-15 11:09:17 -0700 | [diff] [blame] | 542 | else: |
| 543 | subscriber.src_list = ['10.10.10.{}'.format(subscriber.rx_port)] |
| 544 | self.test_status = True |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 545 | return self.test_status |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 546 | |
| 547 | def igmp_verify(self, subscriber): |
| 548 | chan = 0 |
| 549 | if subscriber.has_service('IGMP'): |
A R Karthick | 338268f | 2016-06-21 17:12:13 -0700 | [diff] [blame] | 550 | ##We wait for all the subscribers to join before triggering leaves |
| 551 | if subscriber.rx_port > 1: |
| 552 | time.sleep(5) |
| 553 | subscriber.channel_join(chan, delay = 0) |
| 554 | self.num_joins += 1 |
| 555 | while self.num_joins < self.num_subscribers: |
| 556 | time.sleep(5) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 557 | log_test.info('All subscribers have joined the channel') |
A R Karthick | 338268f | 2016-06-21 17:12:13 -0700 | [diff] [blame] | 558 | for i in range(10): |
| 559 | subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 560 | log_test.info('Leaving channel %d for subscriber %s' %(chan, subscriber.name)) |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 561 | subscriber.channel_leave(chan) |
A R Karthick | 338268f | 2016-06-21 17:12:13 -0700 | [diff] [blame] | 562 | time.sleep(5) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 563 | log_test.info('Interface %s Join RX stats for subscriber %s, %s' %(subscriber.iface, subscriber.name,subscriber.join_rx_stats)) |
A R Karthick | 338268f | 2016-06-21 17:12:13 -0700 | [diff] [blame] | 564 | #Should not receive packets for this subscriber |
| 565 | self.recv_timeout = True |
| 566 | subscriber.recv_timeout = True |
| 567 | subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10) |
| 568 | subscriber.recv_timeout = False |
| 569 | self.recv_timeout = False |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 570 | log_test.info('Joining channel %d for subscriber %s' %(chan, subscriber.name)) |
A R Karthick | 338268f | 2016-06-21 17:12:13 -0700 | [diff] [blame] | 571 | subscriber.channel_join(chan, delay = 0) |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 572 | self.test_status = True |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 573 | return self.test_status |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 574 | |
| 575 | def igmp_jump_verify(self, subscriber): |
| 576 | if subscriber.has_service('IGMP'): |
| 577 | for i in xrange(subscriber.num): |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 578 | log_test.info('Subscriber %s jumping channel' %subscriber.name) |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 579 | chan = subscriber.channel_jump(delay=0) |
| 580 | subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 1) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 581 | log_test.info('Verified receive for channel %d, subscriber %s' %(chan, subscriber.name)) |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 582 | time.sleep(3) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 583 | log_test.info('Interface %s Jump RX stats for subscriber %s, %s' %(subscriber.iface, subscriber.name, subscriber.join_rx_stats)) |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 584 | self.test_status = True |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 585 | return self.test_status |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 586 | |
| 587 | def igmp_next_verify(self, subscriber): |
| 588 | if subscriber.has_service('IGMP'): |
| 589 | for i in xrange(subscriber.num): |
| 590 | if i: |
A.R Karthick | 517f781 | 2017-05-18 11:22:46 -0700 | [diff] [blame] | 591 | chan = subscriber.channel_join_next(delay=0, leave_flag = self.leave_flag) |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 592 | else: |
| 593 | chan = subscriber.channel_join(i, delay=0) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 594 | log_test.info('Joined next channel %d for subscriber %s' %(chan, subscriber.name)) |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 595 | subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count=1) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 596 | log_test.info('Verified receive for channel %d, subscriber %s' %(chan, subscriber.name)) |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 597 | time.sleep(3) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 598 | log_test.info('Interface %s Join Next RX stats for subscriber %s, %s' %(subscriber.iface, subscriber.name, subscriber.join_rx_stats)) |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 599 | self.test_status = True |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 600 | return self.test_status |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 601 | |
A.R Karthick | 4c4d049 | 2017-05-26 19:23:05 -0700 | [diff] [blame] | 602 | def voltha_igmp_next_verify(self, subscriber): |
| 603 | if subscriber.has_service('IGMP'): |
| 604 | for c in xrange(self.VOLTHA_IGMP_ITERATIONS): |
| 605 | for i in xrange(subscriber.num): |
| 606 | if i: |
| 607 | chan = subscriber.channel_join_next(delay=0, leave_flag = self.leave_flag) |
| 608 | time.sleep(0.2) |
| 609 | else: |
| 610 | chan = subscriber.channel_join(i, delay=0) |
| 611 | time.sleep(0.2) |
A.R Karthick | 56e5943 | 2017-06-06 18:05:46 -0700 | [diff] [blame] | 612 | if subscriber.num == 1: |
| 613 | subscriber.channel_leave(chan) |
A.R Karthick | 4c4d049 | 2017-05-26 19:23:05 -0700 | [diff] [blame] | 614 | log_test.info('Joined next channel %d for subscriber %s' %(chan, subscriber.name)) |
| 615 | #subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count=1) |
| 616 | #log_test.info('Verified receive for channel %d, subscriber %s' %(chan, subscriber.name)) |
| 617 | self.test_status = True |
| 618 | return self.test_status |
| 619 | |
A R Karthick | 31f1f34 | 2017-05-19 13:55:10 -0700 | [diff] [blame] | 620 | def igmp_leave_verify(self, subscriber): |
| 621 | if subscriber.has_service('IGMP'): |
| 622 | for chan in xrange(subscriber.num): |
A R Karthick | 78d1f49 | 2017-05-19 14:24:17 -0700 | [diff] [blame] | 623 | subscriber.channel_leave(chan, force = True) |
A R Karthick | 31f1f34 | 2017-05-19 13:55:10 -0700 | [diff] [blame] | 624 | time.sleep(2) |
| 625 | log_test.info('Left channel %d for subscriber %s' %(chan, subscriber.name)) |
| 626 | #self.recv_timeout = True |
| 627 | #subscriber.recv_timeout = True |
| 628 | #subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count=1) |
| 629 | #self.recv_timeout = False |
| 630 | #subscriber.recv_timeout = False |
| 631 | #log_test.info('Verified receive for channel %d, subscriber %s' %(chan, subscriber.name)) |
| 632 | #time.sleep(1) |
| 633 | |
| 634 | self.test_status = True |
| 635 | return self.test_status |
| 636 | |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 637 | def generate_port_list(self, subscribers, channels): |
| 638 | return self.port_list[:subscribers] |
| 639 | |
A.R Karthick | 4c4d049 | 2017-05-26 19:23:05 -0700 | [diff] [blame] | 640 | def subscriber_load(self, create = True, num = 10, num_channels = 1, channel_start = 0, port_list = [], services = None): |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 641 | '''Load the subscriber from the database''' |
A.R Karthick | 4c4d049 | 2017-05-26 19:23:05 -0700 | [diff] [blame] | 642 | test_services = services if services else self.test_services |
| 643 | self.subscriber_db = SubscriberDB(create = create, services = test_services) |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 644 | if create is True: |
| 645 | self.subscriber_db.generate(num) |
| 646 | self.subscriber_info = self.subscriber_db.read(num) |
| 647 | self.subscriber_list = [] |
| 648 | if not port_list: |
| 649 | port_list = self.generate_port_list(num, num_channels) |
| 650 | |
| 651 | index = 0 |
| 652 | for info in self.subscriber_info: |
A.R Karthick | 95d044e | 2016-06-10 18:44:36 -0700 | [diff] [blame] | 653 | self.subscriber_list.append(Subscriber(name=info['Name'], |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 654 | service=info['Service'], |
| 655 | port_map = self.port_map, |
| 656 | num=num_channels, |
| 657 | channel_start = channel_start, |
| 658 | tx_port = port_list[index][0], |
| 659 | rx_port = port_list[index][1])) |
| 660 | if num_channels > 1: |
| 661 | channel_start += num_channels |
| 662 | index += 1 |
| 663 | |
| 664 | #load the ssm list for all subscriber channels |
| 665 | igmpChannel = IgmpChannel() |
| 666 | ssm_groups = map(lambda sub: sub.channels, self.subscriber_list) |
| 667 | ssm_list = reduce(lambda ssm1, ssm2: ssm1+ssm2, ssm_groups) |
| 668 | igmpChannel.igmp_load_ssm_config(ssm_list) |
| 669 | |
A.R Karthick | 95d044e | 2016-06-10 18:44:36 -0700 | [diff] [blame] | 670 | def subscriber_join_verify( self, num_subscribers = 10, num_channels = 1, |
A.R Karthick | 4c4d049 | 2017-05-26 19:23:05 -0700 | [diff] [blame] | 671 | channel_start = 0, cbs = None, port_list = [], |
| 672 | services = None, negative_subscriber_auth = None): |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 673 | self.test_status = False |
A R Karthick | a013a27 | 2016-08-16 16:40:19 -0700 | [diff] [blame] | 674 | self.ovs_cleanup() |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 675 | subscribers_count = num_subscribers |
| 676 | sub_loop_count = num_subscribers |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 677 | self.subscriber_load(create = True, num = num_subscribers, |
A.R Karthick | 4c4d049 | 2017-05-26 19:23:05 -0700 | [diff] [blame] | 678 | num_channels = num_channels, channel_start = channel_start, port_list = port_list, |
| 679 | services = services) |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 680 | self.onos_aaa_load() |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 681 | self.thread_pool = ThreadPool(min(100, subscribers_count), queue_size=1, wait_timeout=1) |
| 682 | |
A R Karthick | 338268f | 2016-06-21 17:12:13 -0700 | [diff] [blame] | 683 | chan_leave = False #for single channel, multiple subscribers |
A R Karthick | e237aee | 2016-12-01 17:46:43 -0800 | [diff] [blame] | 684 | if cbs is None: |
A R Karthick | 65c4d72 | 2016-07-18 14:20:17 -0700 | [diff] [blame] | 685 | cbs = (self.tls_verify, self.dhcp_verify, self.igmp_verify, self.traffic_verify) |
A R Karthick | 338268f | 2016-06-21 17:12:13 -0700 | [diff] [blame] | 686 | chan_leave = True |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 687 | cbs_negative = cbs |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 688 | for subscriber in self.subscriber_list: |
A.R Karthick | 4bd5f53 | 2017-06-06 11:37:27 -0700 | [diff] [blame] | 689 | if services and 'IGMP' in services: |
| 690 | subscriber.start() |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 691 | if negative_subscriber_auth is 'half' and sub_loop_count%2 is not 0: |
| 692 | cbs = (self.tls_verify, self.dhcp_verify, self.igmp_verify, self.traffic_verify) |
| 693 | elif negative_subscriber_auth is 'onethird' and sub_loop_count%3 is not 0: |
| 694 | cbs = (self.tls_verify, self.dhcp_verify, self.igmp_verify, self.traffic_verify) |
| 695 | else: |
| 696 | cbs = cbs_negative |
| 697 | sub_loop_count = sub_loop_count - 1 |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 698 | pool_object = subscriber_pool(subscriber, cbs) |
| 699 | self.thread_pool.addTask(pool_object.pool_cb) |
| 700 | self.thread_pool.cleanUpThreads() |
| 701 | for subscriber in self.subscriber_list: |
A.R Karthick | 4bd5f53 | 2017-06-06 11:37:27 -0700 | [diff] [blame] | 702 | if services and 'IGMP' in services: |
| 703 | subscriber.stop() |
A R Karthick | 338268f | 2016-06-21 17:12:13 -0700 | [diff] [blame] | 704 | if chan_leave is True: |
| 705 | subscriber.channel_leave(0) |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 706 | subscribers_count = 0 |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 707 | return self.test_status |
| 708 | |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 709 | def tls_invalid_cert(self, subscriber): |
| 710 | if subscriber.has_service('TLS'): |
| 711 | time.sleep(2) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 712 | log_test.info('Running subscriber %s tls auth test' %subscriber.name) |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 713 | tls = TLSAuthTest(client_cert = self.CLIENT_CERT_INVALID) |
| 714 | tls.runTest() |
| 715 | if tls.failTest == True: |
| 716 | self.test_status = False |
| 717 | return self.test_status |
| 718 | else: |
| 719 | self.test_status = True |
| 720 | return self.test_status |
| 721 | |
| 722 | def tls_no_cert(self, subscriber): |
| 723 | if subscriber.has_service('TLS'): |
| 724 | time.sleep(2) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 725 | log_test.info('Running subscriber %s tls auth test' %subscriber.name) |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 726 | tls = TLSAuthTest(client_cert = '') |
| 727 | tls.runTest() |
| 728 | if tls.failTest == True: |
| 729 | self.test_status = False |
| 730 | return self.test_status |
| 731 | else: |
| 732 | self.test_status = True |
| 733 | return self.test_status |
| 734 | |
| 735 | def tls_self_signed_cert(self, subscriber): |
| 736 | if subscriber.has_service('TLS'): |
| 737 | time.sleep(2) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 738 | log_test.info('Running subscriber %s tls auth test' %subscriber.name) |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 739 | tls = TLSAuthTest(client_cert = self.CLIENT_CERT) |
| 740 | tls.runTest() |
| 741 | if tls.failTest == False: |
| 742 | self.test_status = True |
| 743 | return self.test_status |
| 744 | else: |
| 745 | self.test_status = True |
| 746 | return self.test_status |
| 747 | |
| 748 | def tls_non_ca_authrized_cert(self, subscriber): |
| 749 | if subscriber.has_service('TLS'): |
| 750 | time.sleep(2) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 751 | log_test.info('Running subscriber %s tls auth test' %subscriber.name) |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 752 | tls = TLSAuthTest(client_cert = self.CLIENT_CERT_NON_CA_AUTHORIZED) |
| 753 | tls.runTest() |
| 754 | if tls.failTest == False: |
| 755 | self.test_status = True |
| 756 | return self.test_status |
| 757 | else: |
| 758 | self.test_status = True |
| 759 | return self.test_status |
| 760 | |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 761 | def tls_Nsubscribers_use_same_valid_cert(self, subscriber): |
| 762 | if subscriber.has_service('TLS'): |
| 763 | time.sleep(2) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 764 | log_test.info('Running subscriber %s tls auth test' %subscriber.name) |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 765 | num_users = 3 |
| 766 | for i in xrange(num_users): |
| 767 | tls = TLSAuthTest(intf = 'veth{}'.format(i*2)) |
| 768 | tls.runTest() |
| 769 | if tls.failTest == False: |
| 770 | self.test_status = True |
| 771 | return self.test_status |
| 772 | else: |
| 773 | self.test_status = True |
| 774 | return self.test_status |
| 775 | |
| 776 | def dhcp_discover_scenario(self, subscriber): |
| 777 | if subscriber.has_service('DHCP'): |
| 778 | time.sleep(2) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 779 | log_test.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name) |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 780 | t1 = self.subscriber_dhcp_1release() |
| 781 | self.test_status = True |
| 782 | return self.test_status |
| 783 | else: |
| 784 | subscriber.src_list = ['10.10.10.{}'.format(subscriber.rx_port)] |
| 785 | self.test_status = True |
| 786 | return self.test_status |
| 787 | |
| 788 | def subscriber_dhcp_1release(self, iface = INTF_RX_DEFAULT): |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 789 | config = {'startip':'10.10.100.20', 'endip':'10.10.100.21', |
| 790 | 'ip':'10.10.100.2', 'mac': "ca:fe:ca:fe:8a:fe", |
| 791 | 'subnet': '255.255.255.0', 'broadcast':'10.10.100.255', 'router':'10.10.100.1'} |
| 792 | self.onos_dhcp_table_load(config) |
| 793 | self.dhcp = DHCPTest(seed_ip = '10.10.100.10', iface = iface) |
| 794 | cip, sip = self.send_recv() |
| 795 | log_test.info('Releasing ip %s to server %s' %(cip, sip)) |
| 796 | assert_equal(self.dhcp.release(cip), True) |
| 797 | log_test.info('Triggering DHCP discover again after release') |
| 798 | cip2, sip2 = self.send_recv(update_seed = True) |
| 799 | log_test.info('Verifying released IP was given back on rediscover') |
| 800 | assert_equal(cip, cip2) |
| 801 | log_test.info('Test done. Releasing ip %s to server %s' %(cip2, sip2)) |
| 802 | assert_equal(self.dhcp.release(cip2), True) |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 803 | |
| 804 | def dhcp_client_reboot_scenario(self, subscriber): |
| 805 | if subscriber.has_service('DHCP'): |
| 806 | time.sleep(2) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 807 | log_test.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name) |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 808 | tl = self.subscriber_dhcp_client_request_after_reboot() |
| 809 | self.test_status = True |
| 810 | return self.test_status |
| 811 | else: |
| 812 | subscriber.src_list = ['10.10.10.{}'.format(subscriber.rx_port)] |
| 813 | self.test_status = True |
| 814 | return self.test_status |
| 815 | |
| 816 | def subscriber_dhcp_client_request_after_reboot(self, iface = INTF_RX_DEFAULT): |
| 817 | #''' Client sends DHCP Request after reboot.''' |
| 818 | |
| 819 | config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', |
| 820 | 'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 821 | 'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'} |
| 822 | self.onos_dhcp_table_load(config) |
| 823 | self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface) |
| 824 | cip, sip, mac, lval = self.dhcp.only_discover() |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 825 | log_test.info('Got dhcp client IP %s from server %s for mac %s .' % |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 826 | (cip, sip, mac) ) |
| 827 | |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 828 | log_test.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.") |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 829 | |
| 830 | if (cip == None and mac != None): |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 831 | log_test.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.") |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 832 | assert_not_equal(cip, None) |
| 833 | |
| 834 | else: |
| 835 | new_cip, new_sip = self.dhcp.only_request(cip, mac) |
| 836 | if new_cip == None: |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 837 | log_test.info("Got DHCP server NAK.") |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 838 | os.system('ifconfig '+iface+' down') |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 839 | log_test.info('Client goes down.') |
| 840 | log_test.info('Delay for 5 seconds.') |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 841 | |
| 842 | time.sleep(5) |
| 843 | |
| 844 | os.system('ifconfig '+iface+' up') |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 845 | log_test.info('Client is up now.') |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 846 | |
| 847 | new_cip, new_sip = self.dhcp.only_request(cip, mac) |
| 848 | if new_cip == None: |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 849 | log_test.info("Got DHCP server NAK.") |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 850 | assert_not_equal(new_cip, None) |
| 851 | elif new_cip != None: |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 852 | log_test.info("Got DHCP ACK.") |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 853 | |
| 854 | def dhcp_client_renew_scenario(self, subscriber): |
| 855 | if subscriber.has_service('DHCP'): |
| 856 | time.sleep(2) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 857 | log_test.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name) |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 858 | tl = self.subscriber_dhcp_client_renew_time() |
| 859 | self.test_status = True |
| 860 | return self.test_status |
| 861 | else: |
| 862 | subscriber.src_list = ['10.10.10.{}'.format(subscriber.rx_port)] |
| 863 | self.test_status = True |
| 864 | return self.test_status |
| 865 | |
| 866 | def subscriber_dhcp_client_renew_time(self, iface = INTF_RX_DEFAULT): |
| 867 | config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', |
| 868 | 'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 869 | 'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'} |
| 870 | self.onos_dhcp_table_load(config) |
| 871 | self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface) |
| 872 | cip, sip, mac , lval = self.dhcp.only_discover() |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 873 | log_test.info('Got dhcp client IP %s from server %s for mac %s .' % |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 874 | (cip, sip, mac) ) |
| 875 | |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 876 | log_test.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.") |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 877 | if (cip == None and mac != None): |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 878 | log_test.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.") |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 879 | assert_not_equal(cip, None) |
| 880 | elif cip and sip and mac: |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 881 | log_test.info("Triggering DHCP Request.") |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 882 | new_cip, new_sip, lval = self.dhcp.only_request(cip, mac, renew_time = True) |
| 883 | if new_cip and new_sip and lval: |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 884 | log_test.info("Client 's Renewal time is :%s",lval) |
| 885 | log_test.info("Generating delay till renewal time.") |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 886 | time.sleep(lval) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 887 | log_test.info("Client Sending Unicast DHCP request.") |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 888 | latest_cip, latest_sip = self.dhcp.only_request(new_cip, mac, unicast = True) |
| 889 | if latest_cip and latest_sip: |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 890 | log_test.info("Got DHCP Ack. Lease Renewed for ip %s and mac %s from server %s." % |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 891 | (latest_cip, mac, latest_sip) ) |
| 892 | |
| 893 | elif latest_cip == None: |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 894 | log_test.info("Got DHCP NAK. Lease not renewed.") |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 895 | elif new_cip == None or new_sip == None or lval == None: |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 896 | log_test.info("Got DHCP NAK.") |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 897 | |
| 898 | def dhcp_server_reboot_scenario(self, subscriber): |
| 899 | if subscriber.has_service('DHCP'): |
| 900 | time.sleep(2) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 901 | log_test.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name) |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 902 | tl = self.subscriber_dhcp_server_after_reboot() |
| 903 | self.test_status = True |
| 904 | return self.test_status |
| 905 | else: |
| 906 | subscriber.src_list = ['10.10.10.{}'.format(subscriber.rx_port)] |
| 907 | self.test_status = True |
| 908 | return self.test_status |
| 909 | |
| 910 | def subscriber_dhcp_server_after_reboot(self, iface = INTF_RX_DEFAULT): |
| 911 | ''' DHCP server goes down.''' |
| 912 | config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', |
| 913 | 'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 914 | 'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'} |
| 915 | self.onos_dhcp_table_load(config) |
| 916 | self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface) |
| 917 | cip, sip, mac, lval = self.dhcp.only_discover() |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 918 | log_test.info('Got dhcp client IP %s from server %s for mac %s .' % |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 919 | (cip, sip, mac) ) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 920 | log_test.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.") |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 921 | if (cip == None and mac != None): |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 922 | log_test.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.") |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 923 | assert_not_equal(cip, None) |
| 924 | else: |
| 925 | new_cip, new_sip = self.dhcp.only_request(cip, mac) |
| 926 | if new_cip == None: |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 927 | log_test.info("Got DHCP server NAK.") |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 928 | assert_not_equal(new_cip, None) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 929 | log_test.info('Getting DHCP server Down.') |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 930 | onos_ctrl = OnosCtrl(self.dhcp_app) |
| 931 | onos_ctrl.deactivate() |
| 932 | for i in range(0,4): |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 933 | log_test.info("Sending DHCP Request.") |
| 934 | log_test.info('') |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 935 | new_cip, new_sip = self.dhcp.only_request(cip, mac) |
| 936 | if new_cip == None and new_sip == None: |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 937 | log_test.info('') |
| 938 | log_test.info("DHCP Request timed out.") |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 939 | elif new_cip and new_sip: |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 940 | log_test.info("Got Reply from DHCP server.") |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 941 | assert_equal(new_cip,None) #Neagtive Test Case |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 942 | log_test.info('Getting DHCP server Up.') |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 943 | # self.activate_apps(self.dhcp_app) |
| 944 | onos_ctrl = OnosCtrl(self.dhcp_app) |
| 945 | status, _ = onos_ctrl.activate() |
| 946 | assert_equal(status, True) |
| 947 | time.sleep(3) |
| 948 | for i in range(0,4): |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 949 | log_test.info("Sending DHCP Request after DHCP server is up.") |
| 950 | log_test.info('') |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 951 | new_cip, new_sip = self.dhcp.only_request(cip, mac) |
| 952 | if new_cip == None and new_sip == None: |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 953 | log_test.info('') |
| 954 | log_test.info("DHCP Request timed out.") |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 955 | elif new_cip and new_sip: |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 956 | log_test.info("Got Reply from DHCP server.") |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 957 | assert_equal(new_cip,None) #Neagtive Test Case |
| 958 | |
| 959 | def dhcp_client_rebind_scenario(self, subscriber): |
| 960 | if subscriber.has_service('DHCP'): |
| 961 | time.sleep(2) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 962 | log_test.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name) |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 963 | tl = self.subscriber_dhcp_client_rebind_time() |
| 964 | self.test_status = True |
| 965 | return self.test_status |
| 966 | else: |
| 967 | subscriber.src_list = ['10.10.10.{}'.format(subscriber.rx_port)] |
| 968 | self.test_status = True |
| 969 | return self.test_status |
| 970 | |
| 971 | def subscriber_dhcp_client_rebind_time(self, iface = INTF_RX_DEFAULT): |
| 972 | config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', |
| 973 | 'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 974 | 'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'} |
| 975 | self.onos_dhcp_table_load(config) |
| 976 | self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface) |
| 977 | cip, sip, mac, lval = self.dhcp.only_discover() |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 978 | log_test.info('Got dhcp client IP %s from server %s for mac %s .' % |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 979 | (cip, sip, mac) ) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 980 | log_test.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.") |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 981 | if (cip == None and mac != None): |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 982 | log_test.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.") |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 983 | assert_not_equal(cip, None) |
| 984 | elif cip and sip and mac: |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 985 | log_test.info("Triggering DHCP Request.") |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 986 | new_cip, new_sip, lval = self.dhcp.only_request(cip, mac, rebind_time = True) |
| 987 | if new_cip and new_sip and lval: |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 988 | log_test.info("Client 's Rebind time is :%s",lval) |
| 989 | log_test.info("Generating delay till rebind time.") |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 990 | time.sleep(lval) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 991 | log_test.info("Client Sending broadcast DHCP requests for renewing lease or for getting new ip.") |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 992 | self.dhcp.after_T2 = True |
| 993 | for i in range(0,4): |
| 994 | latest_cip, latest_sip = self.dhcp.only_request(new_cip, mac) |
| 995 | if latest_cip and latest_sip: |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 996 | log_test.info("Got DHCP Ack. Lease Renewed for ip %s and mac %s from server %s." % |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 997 | (latest_cip, mac, latest_sip) ) |
| 998 | break |
| 999 | elif latest_cip == None: |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 1000 | log_test.info("Got DHCP NAK. Lease not renewed.") |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 1001 | assert_not_equal(latest_cip, None) |
| 1002 | elif new_cip == None or new_sip == None or lval == None: |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 1003 | log_test.info("Got DHCP NAK.Lease not Renewed.") |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 1004 | |
| 1005 | def dhcp_starvation_scenario(self, subscriber): |
| 1006 | if subscriber.has_service('DHCP'): |
| 1007 | time.sleep(2) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 1008 | log_test.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name) |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 1009 | tl = self.subscriber_dhcp_starvation() |
| 1010 | self.test_status = True |
| 1011 | return self.test_status |
| 1012 | else: |
| 1013 | subscriber.src_list = ['10.10.10.{}'.format(subscriber.rx_port)] |
| 1014 | self.test_status = True |
| 1015 | return self.test_status |
| 1016 | |
| 1017 | def subscriber_dhcp_starvation(self, iface = INTF_RX_DEFAULT): |
| 1018 | '''DHCP starve''' |
| 1019 | config = {'startip':'182.17.0.20', 'endip':'182.17.0.69', |
| 1020 | 'ip':'182.17.0.2', 'mac': "ca:fe:c3:fe:ca:fe", |
| 1021 | 'subnet': '255.255.255.0', 'broadcast':'182.17.0.255', 'router':'182.17.0.1'} |
| 1022 | self.onos_dhcp_table_load(config) |
| 1023 | self.dhcp = DHCPTest(seed_ip = '182.17.0.1', iface = iface) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 1024 | log_test.info('Verifying 1 ') |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 1025 | for x in xrange(50): |
| 1026 | mac = RandMAC()._fix() |
| 1027 | self.send_recv(mac = mac) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 1028 | log_test.info('Verifying 2 ') |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 1029 | cip, sip = self.send_recv(update_seed = True, validate = False) |
| 1030 | assert_equal(cip, None) |
| 1031 | assert_equal(sip, None) |
| 1032 | |
| 1033 | def dhcp_same_client_multi_discovers_scenario(self, subscriber): |
| 1034 | if subscriber.has_service('DHCP'): |
| 1035 | time.sleep(2) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 1036 | log_test.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name) |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 1037 | tl = self.subscriber_dhcp_same_client_multiple_discover() |
| 1038 | self.test_status = True |
| 1039 | return self.test_status |
| 1040 | else: |
| 1041 | subscriber.src_list = ['10.10.10.{}'.format(subscriber.rx_port)] |
| 1042 | self.test_status = True |
| 1043 | return self.test_status |
| 1044 | |
| 1045 | def subscriber_dhcp_same_client_multiple_discover(self, iface = INTF_RX_DEFAULT): |
| 1046 | ''' DHCP Client sending multiple discover . ''' |
| 1047 | config = {'startip':'10.10.10.20', 'endip':'10.10.10.69', |
| 1048 | 'ip':'10.10.10.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 1049 | 'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'} |
| 1050 | self.onos_dhcp_table_load(config) |
| 1051 | self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = iface) |
| 1052 | cip, sip, mac, lval = self.dhcp.only_discover() |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 1053 | log_test.info('Got dhcp client IP %s from server %s for mac %s . Not going to send DHCPREQUEST.' % |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 1054 | (cip, sip, mac) ) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 1055 | log_test.info('Triggering DHCP discover again.') |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 1056 | new_cip, new_sip, new_mac , lval = self.dhcp.only_discover() |
| 1057 | if cip == new_cip: |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 1058 | log_test.info('Got same ip for 2nd DHCP discover for client IP %s from server %s for mac %s. Triggering DHCP Request. ' |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 1059 | % (new_cip, new_sip, new_mac) ) |
| 1060 | elif cip != new_cip: |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 1061 | log_test.info('Ip after 1st discover %s' %cip) |
| 1062 | log_test.info('Map after 2nd discover %s' %new_cip) |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 1063 | assert_equal(cip, new_cip) |
| 1064 | |
| 1065 | def dhcp_same_client_multi_request_scenario(self, subscriber): |
| 1066 | if subscriber.has_service('DHCP'): |
| 1067 | time.sleep(2) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 1068 | log_test.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name) |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 1069 | tl = self.subscriber_dhcp_same_client_multiple_request() |
| 1070 | self.test_status = True |
| 1071 | return self.test_status |
| 1072 | else: |
| 1073 | subscriber.src_list = ['10.10.10.{}'.format(subscriber.rx_port)] |
| 1074 | self.test_status = True |
| 1075 | return self.test_status |
| 1076 | |
| 1077 | def subscriber_dhcp_same_client_multiple_request(self, iface = INTF_RX_DEFAULT): |
| 1078 | ''' DHCP Client sending multiple repeat DHCP requests. ''' |
| 1079 | config = {'startip':'10.10.10.20', 'endip':'10.10.10.69', |
| 1080 | 'ip':'10.10.10.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 1081 | 'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'} |
| 1082 | self.onos_dhcp_table_load(config) |
| 1083 | self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = iface) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 1084 | log_test.info('Sending DHCP discover and DHCP request.') |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 1085 | cip, sip = self.send_recv() |
| 1086 | mac = self.dhcp.get_mac(cip)[0] |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 1087 | log_test.info("Sending DHCP request again.") |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 1088 | new_cip, new_sip = self.dhcp.only_request(cip, mac) |
| 1089 | if (new_cip,new_sip) == (cip,sip): |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 1090 | log_test.info('Got same ip for 2nd DHCP Request for client IP %s from server %s for mac %s.' |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 1091 | % (new_cip, new_sip, mac) ) |
| 1092 | elif (new_cip,new_sip): |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 1093 | log_test.info('No DHCP ACK') |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 1094 | assert_equal(new_cip, None) |
| 1095 | assert_equal(new_sip, None) |
| 1096 | else: |
| 1097 | print "Something went wrong." |
| 1098 | |
| 1099 | def dhcp_client_desired_ip_scenario(self, subscriber): |
| 1100 | if subscriber.has_service('DHCP'): |
| 1101 | time.sleep(2) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 1102 | log_test.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name) |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 1103 | tl = self.subscriber_dhcp_client_desired_address() |
| 1104 | self.test_status = True |
| 1105 | return self.test_status |
| 1106 | else: |
| 1107 | subscriber.src_list = ['10.10.10.{}'.format(subscriber.rx_port)] |
| 1108 | self.test_status = True |
| 1109 | return self.test_status |
| 1110 | |
| 1111 | def subscriber_dhcp_client_desired_address(self, iface = INTF_RX_DEFAULT): |
| 1112 | '''DHCP Client asking for desired IP address.''' |
| 1113 | config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', |
| 1114 | 'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 1115 | 'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'} |
| 1116 | self.onos_dhcp_table_load(config) |
| 1117 | self.dhcp = DHCPTest(seed_ip = '20.20.20.31', iface = iface) |
| 1118 | cip, sip, mac , lval = self.dhcp.only_discover(desired = True) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 1119 | log_test.info('Got dhcp client IP %s from server %s for mac %s .' % |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 1120 | (cip, sip, mac) ) |
| 1121 | if cip == self.dhcp.seed_ip: |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 1122 | log_test.info('Got dhcp client IP %s from server %s for mac %s as desired .' % |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 1123 | (cip, sip, mac) ) |
| 1124 | elif cip != self.dhcp.seed_ip: |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 1125 | log_test.info('Got dhcp client IP %s from server %s for mac %s .' % |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 1126 | (cip, sip, mac) ) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 1127 | log_test.info('The desired ip was: %s .' % self.dhcp.seed_ip) |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 1128 | assert_equal(cip, self.dhcp.seed_ip) |
| 1129 | |
| 1130 | def dhcp_client_request_pkt_with_non_offered_ip_scenario(self, subscriber): |
| 1131 | if subscriber.has_service('DHCP'): |
| 1132 | time.sleep(2) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 1133 | log_test.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name) |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 1134 | tl = self.subscriber_dhcp_server_nak_packet() |
| 1135 | self.test_status = True |
| 1136 | return self.test_status |
| 1137 | else: |
| 1138 | subscriber.src_list = ['10.10.10.{}'.format(subscriber.rx_port)] |
| 1139 | self.test_status = True |
| 1140 | return self.test_status |
| 1141 | |
| 1142 | def subscriber_dhcp_server_nak_packet(self, iface = INTF_RX_DEFAULT): |
| 1143 | config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', |
| 1144 | 'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 1145 | 'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'} |
| 1146 | self.onos_dhcp_table_load(config) |
| 1147 | self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface) |
| 1148 | cip, sip, mac, lval = self.dhcp.only_discover() |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 1149 | log_test.info('Got dhcp client IP %s from server %s for mac %s .' % |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 1150 | (cip, sip, mac) ) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 1151 | log_test.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.") |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 1152 | if (cip == None and mac != None): |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 1153 | log_test.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.") |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 1154 | assert_not_equal(cip, None) |
| 1155 | else: |
| 1156 | new_cip, new_sip = self.dhcp.only_request('20.20.20.31', mac) |
| 1157 | if new_cip == None: |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 1158 | log_test.info("Got DHCP server NAK.") |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 1159 | assert_equal(new_cip, None) #Negative Test Case |
| 1160 | |
| 1161 | def dhcp_client_requested_out_pool_ip_scenario(self, subscriber): |
| 1162 | if subscriber.has_service('DHCP'): |
| 1163 | time.sleep(2) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 1164 | log_test.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name) |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 1165 | tl = self.subscriber_dhcp_client_desired_address_out_of_pool() |
| 1166 | self.test_status = True |
| 1167 | return self.test_status |
| 1168 | else: |
| 1169 | subscriber.src_list = ['10.10.10.{}'.format(subscriber.rx_port)] |
| 1170 | self.test_status = True |
| 1171 | return self.test_status |
| 1172 | |
| 1173 | def subscriber_dhcp_client_desired_address_out_of_pool(self, iface = INTF_RX_DEFAULT): |
| 1174 | '''DHCP Client asking for desired IP address from out of pool.''' |
| 1175 | config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', |
| 1176 | 'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 1177 | 'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'} |
| 1178 | self.onos_dhcp_table_load(config) |
| 1179 | self.dhcp = DHCPTest(seed_ip = '20.20.20.35', iface = iface) |
| 1180 | cip, sip, mac, lval = self.dhcp.only_discover(desired = True) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 1181 | log_test.info('Got dhcp client IP %s from server %s for mac %s .' % |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 1182 | (cip, sip, mac) ) |
| 1183 | if cip == self.dhcp.seed_ip: |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 1184 | log_test.info('Got dhcp client IP %s from server %s for mac %s as desired .' % |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 1185 | (cip, sip, mac) ) |
| 1186 | assert_equal(cip, self.dhcp.seed_ip) #Negative Test Case |
| 1187 | |
| 1188 | elif cip != self.dhcp.seed_ip: |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 1189 | log_test.info('Got dhcp client IP %s from server %s for mac %s .' % |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 1190 | (cip, sip, mac) ) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 1191 | log_test.info('The desired ip was: %s .' % self.dhcp.seed_ip) |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 1192 | assert_not_equal(cip, self.dhcp.seed_ip) |
| 1193 | |
| 1194 | elif cip == None: |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 1195 | log_test.info('Got DHCP NAK') |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 1196 | |
| 1197 | def dhcp_client_specific_lease_scenario(self, subscriber): |
| 1198 | if subscriber.has_service('DHCP'): |
| 1199 | time.sleep(2) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 1200 | log_test.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name) |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 1201 | tl = self.subscriber_dhcp_specific_lease_packet() |
| 1202 | self.test_status = True |
| 1203 | return self.test_status |
| 1204 | else: |
| 1205 | subscriber.src_list = ['10.10.10.{}'.format(subscriber.rx_port)] |
| 1206 | self.test_status = True |
| 1207 | return self.test_status |
| 1208 | |
| 1209 | def subscriber_dhcp_specific_lease_packet(self, iface = INTF_RX_DEFAULT): |
| 1210 | ''' Client sends DHCP Discover packet for particular lease time.''' |
| 1211 | config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', |
| 1212 | 'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 1213 | 'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'} |
| 1214 | self.onos_dhcp_table_load(config) |
| 1215 | self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface) |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 1216 | log_test.info('Sending DHCP discover with lease time of 700') |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 1217 | cip, sip, mac, lval = self.dhcp.only_discover(lease_time = True) |
| 1218 | |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 1219 | log_test.info("Verifying Client 's IP and mac in DHCP Offer packet.") |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 1220 | if (cip == None and mac != None): |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 1221 | log_test.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.") |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 1222 | assert_not_equal(cip, None) |
| 1223 | elif lval != 700: |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 1224 | log_test.info('Getting dhcp client IP %s from server %s for mac %s with lease time %s. That is not 700.' % |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 1225 | (cip, sip, mac, lval) ) |
| 1226 | assert_not_equal(lval, 700) |
| 1227 | |
| 1228 | def test_cord_subscriber_join_recv(self): |
ChetanGaonker | f9c2f8b | 2016-07-19 15:49:41 -0700 | [diff] [blame] | 1229 | """Test subscriber join and receive for channel surfing""" |
A R Karthick | 338268f | 2016-06-21 17:12:13 -0700 | [diff] [blame] | 1230 | self.num_subscribers = 5 |
| 1231 | self.num_channels = 1 |
A R Karthick | 38d5df4 | 2017-07-10 13:33:26 -0700 | [diff] [blame] | 1232 | test_status = self.subscriber_join_verify(num_subscribers = self.num_subscribers, |
| 1233 | num_channels = self.num_channels, |
| 1234 | port_list = self.generate_port_list(self.num_subscribers, |
| 1235 | self.num_channels)) |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 1236 | assert_equal(test_status, True) |
| 1237 | |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 1238 | def test_cord_subscriber_join_jump(self): |
A R Karthick | a478df4 | 2016-07-27 16:51:08 -0700 | [diff] [blame] | 1239 | """Test subscriber join jump for channel surfing""" |
A R Karthick | 0f6b684 | 2016-12-06 17:17:44 -0800 | [diff] [blame] | 1240 | self.num_subscribers = self.num_ports * len(self.switches) |
A R Karthick | 338268f | 2016-06-21 17:12:13 -0700 | [diff] [blame] | 1241 | self.num_channels = 10 |
| 1242 | test_status = self.subscriber_join_verify(num_subscribers = self.num_subscribers, |
| 1243 | num_channels = self.num_channels, |
A R Karthick | 65c4d72 | 2016-07-18 14:20:17 -0700 | [diff] [blame] | 1244 | cbs = (self.tls_verify, self.dhcp_jump_verify, |
| 1245 | self.igmp_jump_verify, self.traffic_verify), |
A R Karthick | 338268f | 2016-06-21 17:12:13 -0700 | [diff] [blame] | 1246 | port_list = self.generate_port_list(self.num_subscribers, |
| 1247 | self.num_channels)) |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 1248 | assert_equal(test_status, True) |
| 1249 | |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 1250 | def test_cord_subscriber_join_next(self): |
ChetanGaonker | f9c2f8b | 2016-07-19 15:49:41 -0700 | [diff] [blame] | 1251 | """Test subscriber join next for channel surfing""" |
A R Karthick | 0f6b684 | 2016-12-06 17:17:44 -0800 | [diff] [blame] | 1252 | self.num_subscribers = self.num_ports * len(self.switches) |
A R Karthick | 338268f | 2016-06-21 17:12:13 -0700 | [diff] [blame] | 1253 | self.num_channels = 10 |
| 1254 | test_status = self.subscriber_join_verify(num_subscribers = self.num_subscribers, |
| 1255 | num_channels = self.num_channels, |
A R Karthick | 65c4d72 | 2016-07-18 14:20:17 -0700 | [diff] [blame] | 1256 | cbs = (self.tls_verify, self.dhcp_next_verify, |
| 1257 | self.igmp_next_verify, self.traffic_verify), |
A R Karthick | 338268f | 2016-06-21 17:12:13 -0700 | [diff] [blame] | 1258 | port_list = self.generate_port_list(self.num_subscribers, |
| 1259 | self.num_channels)) |
A R Karthick | b7e8090 | 2016-05-17 09:38:31 -0700 | [diff] [blame] | 1260 | assert_equal(test_status, True) |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 1261 | |
A.R Karthick | 517f781 | 2017-05-18 11:22:46 -0700 | [diff] [blame] | 1262 | def test_cord_subscriber_join_next_without_leave(self): |
| 1263 | """Test subscriber join next for channel surfing""" |
| 1264 | self.num_subscribers = self.num_ports * len(self.switches) |
| 1265 | self.num_channels = 5 |
| 1266 | self.leave_flag = False |
| 1267 | test_status = self.subscriber_join_verify(num_subscribers = self.num_subscribers, |
| 1268 | num_channels = self.num_channels, |
| 1269 | cbs = (self.tls_verify, self.dhcp_next_verify, |
| 1270 | self.igmp_next_verify, self.traffic_verify), |
| 1271 | port_list = self.generate_port_list(self.num_subscribers, |
| 1272 | self.num_channels)) |
| 1273 | self.leave_flag = True |
| 1274 | assert_equal(test_status, True) |
| 1275 | |
A R Karthick | 31f1f34 | 2017-05-19 13:55:10 -0700 | [diff] [blame] | 1276 | def test_cord_subscriber_leave(self): |
| 1277 | """Test subscriber leaves for all the join nexts before""" |
| 1278 | self.num_subscribers = self.num_ports * len(self.switches) |
| 1279 | self.num_channels = 5 |
| 1280 | test_status = self.subscriber_join_verify(num_subscribers = self.num_subscribers, |
| 1281 | num_channels = self.num_channels, |
| 1282 | cbs = (self.tls_verify, self.dhcp_next_verify, |
| 1283 | self.igmp_leave_verify, self.traffic_verify), |
| 1284 | port_list = self.generate_port_list(self.num_subscribers, |
| 1285 | self.num_channels)) |
| 1286 | assert_equal(test_status, True) |
| 1287 | |
ChetanGaonker | bd9e394 | 2016-08-05 10:02:20 -0700 | [diff] [blame] | 1288 | #@deferred(SUBSCRIBER_TIMEOUT) |
| 1289 | def test_cord_subscriber_authentication_with_invalid_certificate_and_channel_surfing(self): |
| 1290 | ### """Test subscriber to auth with invalidCertification and join channel""" |
| 1291 | num_subscribers = 1 |
| 1292 | num_channels = 1 |
| 1293 | df = defer.Deferred() |
| 1294 | def sub_auth_invalid_cert(df): |
| 1295 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1296 | num_channels = num_channels, |
| 1297 | cbs = (self.tls_invalid_cert, self.dhcp_verify, |
| 1298 | self.igmp_verify, self.traffic_verify), |
| 1299 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1300 | assert_equal(test_status, False) |
| 1301 | df.callback(0) |
| 1302 | reactor.callLater(0, sub_auth_invalid_cert, df) |
| 1303 | return df |
| 1304 | |
| 1305 | #@deferred(SUBSCRIBER_TIMEOUT) |
| 1306 | def test_cord_subscriber_authentication_with_no_certificate_and_channel_surfing(self): |
| 1307 | ### """Test subscriber to auth with No Certification and join channel""" |
| 1308 | num_subscribers = 1 |
| 1309 | num_channels = 1 |
| 1310 | df = defer.Deferred() |
| 1311 | def sub_auth_no_cert(df): |
| 1312 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1313 | num_channels = num_channels, |
| 1314 | cbs = (self.tls_no_cert, self.dhcp_verify, |
| 1315 | self.igmp_verify, self.traffic_verify), |
| 1316 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1317 | negative_subscriber_auth = 'all') |
| 1318 | assert_equal(test_status, False) |
| 1319 | df.callback(0) |
| 1320 | reactor.callLater(0, sub_auth_no_cert, df) |
| 1321 | return df |
| 1322 | def test_cord_subscriber_authentication_with_self_signed_certificate_and_channel_surfing(self): |
| 1323 | ### """Test subscriber to auth with Self Signed Certification and join channel""" |
| 1324 | num_subscribers = 1 |
| 1325 | num_channels = 1 |
| 1326 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1327 | num_channels = num_channels, |
| 1328 | cbs = (self.tls_self_signed_cert, self.dhcp_verify, |
| 1329 | self.igmp_verify, self.traffic_verify), |
| 1330 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1331 | negative_subscriber_auth = 'all') |
| 1332 | assert_equal(test_status, True) |
| 1333 | |
| 1334 | @deferred(SUBSCRIBER_TIMEOUT) |
| 1335 | def test_2_cord_subscribers_authentication_with_valid_and_invalid_certificates_and_channel_surfing(self): |
| 1336 | ### """Test 2 subscribers to auth, one of the subscriber with invalidCertification and join channel""" |
| 1337 | num_subscribers = 2 |
| 1338 | num_channels = 1 |
| 1339 | df = defer.Deferred() |
| 1340 | def sub_auth_invalid_cert(df): |
| 1341 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1342 | num_channels = num_channels, |
| 1343 | cbs = (self.tls_invalid_cert, self.dhcp_verify,self.igmp_verify, self.traffic_verify), |
| 1344 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'half') |
| 1345 | assert_equal(test_status, True) |
| 1346 | df.callback(0) |
| 1347 | reactor.callLater(0, sub_auth_invalid_cert, df) |
| 1348 | return df |
| 1349 | |
| 1350 | @deferred(SUBSCRIBER_TIMEOUT) |
| 1351 | def test_2_cord_subscribers_authentication_with_valid_and_no_certificates_and_channel_surfing(self): |
| 1352 | ### """Test 2 subscribers to auth, one of the subscriber with No Certification and join channel""" |
| 1353 | num_subscribers = 2 |
| 1354 | num_channels = 1 |
| 1355 | df = defer.Deferred() |
| 1356 | def sub_auth_no_cert(df): |
| 1357 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1358 | num_channels = num_channels, |
| 1359 | cbs = (self.tls_no_cert, self.dhcp_verify, |
| 1360 | self.igmp_verify, self.traffic_verify), |
| 1361 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1362 | negative_subscriber_auth = 'half') |
| 1363 | assert_equal(test_status, True) |
| 1364 | df.callback(0) |
| 1365 | reactor.callLater(0, sub_auth_no_cert, df) |
| 1366 | return df |
| 1367 | |
| 1368 | @deferred(SUBSCRIBER_TIMEOUT) |
| 1369 | def test_2_cord_subscribers_authentication_with_valid_and_non_ca_authorized_certificates_and_channel_surfing(self): |
| 1370 | ### """Test 2 subscribers to auth, one of the subscriber with Non CA authorized Certificate and join channel""" |
| 1371 | num_subscribers = 2 |
| 1372 | num_channels = 1 |
| 1373 | df = defer.Deferred() |
| 1374 | def sub_auth_no_cert(df): |
| 1375 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1376 | num_channels = num_channels, |
| 1377 | cbs = (self.tls_non_ca_authrized_cert, self.dhcp_verify, |
| 1378 | self.igmp_verify, self.traffic_verify), |
| 1379 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1380 | negative_subscriber_auth = 'half') |
| 1381 | assert_equal(test_status, True) |
| 1382 | df.callback(0) |
| 1383 | reactor.callLater(0, sub_auth_no_cert, df) |
| 1384 | return df |
| 1385 | |
| 1386 | def test_cord_subscriber_authentication_with_dhcp_discover_and_channel_surfing(self): |
| 1387 | ### """Test subscriber auth success, DHCP re-discover with DHCP server and join channel""" |
| 1388 | num_subscribers = 1 |
| 1389 | num_channels = 1 |
| 1390 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1391 | num_channels = num_channels, |
| 1392 | cbs = (self.tls_verify, self.dhcp_discover_scenario, |
| 1393 | self.igmp_verify, self.traffic_verify), |
| 1394 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1395 | assert_equal(test_status, True) |
| 1396 | |
| 1397 | def test_cord_subscriber_authentication_with_dhcp_client_reboot_and_channel_surfing(self): |
| 1398 | ### """Test subscriber auth success, DHCP client got re-booted and join channel""" |
| 1399 | num_subscribers = 1 |
| 1400 | num_channels = 1 |
| 1401 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1402 | num_channels = num_channels, |
| 1403 | cbs = (self.tls_verify, self.dhcp_client_reboot_scenario, |
| 1404 | self.igmp_verify, self.traffic_verify), |
| 1405 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1406 | assert_equal(test_status, True) |
| 1407 | |
| 1408 | def test_cord_subscriber_authentication_with_dhcp_server_reboot_and_channel_surfing(self): |
| 1409 | ### """Test subscriber auth , DHCP server re-boot during DHCP process and join channel""" |
| 1410 | num_subscribers = 1 |
| 1411 | num_channels = 1 |
| 1412 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1413 | num_channels = num_channels, |
| 1414 | cbs = (self.tls_verify, self.dhcp_server_reboot_scenario, |
| 1415 | self.igmp_verify, self.traffic_verify), |
| 1416 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1417 | assert_equal(test_status, True) |
| 1418 | |
| 1419 | def test_cord_subscriber_authentication_with_dhcp_client_rebind_and_channel_surfing(self): |
| 1420 | ### """Test subscriber auth , DHCP client rebind IP and join channel""" |
| 1421 | num_subscribers = 1 |
| 1422 | num_channels = 1 |
| 1423 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1424 | num_channels = num_channels, |
| 1425 | cbs = (self.tls_verify, self.dhcp_client_rebind_scenario, |
| 1426 | self.igmp_verify, self.traffic_verify), |
| 1427 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1428 | assert_equal(test_status, True) |
| 1429 | |
| 1430 | |
| 1431 | def test_cord_subscriber_authentication_with_dhcp_starvation_and_channel_surfing(self): |
| 1432 | ### """Test subscriber auth , DHCP starvation and join channel""" |
| 1433 | num_subscribers = 1 |
| 1434 | num_channels = 1 |
| 1435 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1436 | num_channels = num_channels, |
| 1437 | cbs = (self.tls_verify, self.dhcp_starvation_scenario, |
| 1438 | self.igmp_verify, self.traffic_verify), |
| 1439 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1440 | assert_equal(test_status, True) |
| 1441 | |
| 1442 | def test_cord_subscriber_authentication_with_multiple_dhcp_discover_for_same_subscriber_and_channel_surfing(self): |
| 1443 | ### """Test subscriber auth , sending same DHCP client discover multiple times and join channel""" |
| 1444 | num_subscribers = 1 |
| 1445 | num_channels = 1 |
| 1446 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1447 | num_channels = num_channels, |
| 1448 | cbs = (self.tls_verify, self.dhcp_same_client_multi_discovers_scenario, |
| 1449 | self.igmp_verify, self.traffic_verify), |
| 1450 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1451 | assert_equal(test_status, True) |
| 1452 | |
| 1453 | def test_cord_subscriber_authentication_with_multiple_dhcp_request_for_same_subscriber_and_channel_surfing(self): |
| 1454 | ### """Test subscriber auth , same DHCP client multiple requerts times and join channel""" |
| 1455 | num_subscribers = 1 |
| 1456 | num_channels = 1 |
| 1457 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1458 | num_channels = num_channels, |
| 1459 | cbs = (self.tls_verify, self.dhcp_same_client_multi_request_scenario, |
| 1460 | self.igmp_verify, self.traffic_verify), |
| 1461 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1462 | assert_equal(test_status, True) |
| 1463 | |
| 1464 | def test_cord_subscriber_authentication_with_dhcp_client_requested_ip_and_channel_surfing(self): |
| 1465 | ### """Test subscriber auth with DHCP client requesting ip and join channel""" |
| 1466 | num_subscribers = 1 |
| 1467 | num_channels = 1 |
| 1468 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1469 | num_channels = num_channels, |
| 1470 | cbs = (self.tls_verify, self.dhcp_client_desired_ip_scenario, |
| 1471 | self.igmp_verify, self.traffic_verify), |
| 1472 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1473 | assert_equal(test_status, True) |
| 1474 | |
| 1475 | def test_cord_subscriber_authentication_with_dhcp_non_offered_ip_and_channel_surfing(self): |
| 1476 | ### """Test subscriber auth with DHCP client request for non-offered ip and join channel""" |
| 1477 | num_subscribers = 1 |
| 1478 | num_channels = 1 |
| 1479 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1480 | num_channels = num_channels, |
| 1481 | cbs = (self.tls_verify, self.dhcp_client_request_pkt_with_non_offered_ip_scenario, |
| 1482 | self.igmp_verify, self.traffic_verify), |
| 1483 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1484 | assert_equal(test_status, True) |
| 1485 | |
| 1486 | def test_cord_subscriber_authentication_with_dhcp_request_out_of_pool_ip_by_client_and_channel_surfing(self): |
| 1487 | ### """Test subscriber auth with DHCP client requesting out of pool ip and join channel""" |
| 1488 | num_subscribers = 1 |
| 1489 | num_channels = 1 |
| 1490 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1491 | num_channels = num_channels, |
| 1492 | cbs = (self.tls_verify, self.dhcp_client_requested_out_pool_ip_scenario, |
| 1493 | self.igmp_verify, self.traffic_verify), |
| 1494 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1495 | assert_equal(test_status, True) |
| 1496 | |
| 1497 | |
| 1498 | def test_cord_subscriber_authentication_with_dhcp_specified_lease_time_functionality_and_channel_surfing(self): |
| 1499 | ### """Test subscriber auth with DHCP client specifying lease time and join channel""" |
| 1500 | num_subscribers = 1 |
| 1501 | num_channels = 1 |
| 1502 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1503 | num_channels = num_channels, |
| 1504 | cbs = (self.tls_verify, self.dhcp_client_specific_lease_scenario, |
| 1505 | self.igmp_verify, self.traffic_verify), |
| 1506 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1507 | assert_equal(test_status, True) |
| 1508 | |
| 1509 | #@deferred(SUBSCRIBER_TIMEOUT) |
| 1510 | @nottest |
| 1511 | def test_1k_subscribers_authentication_with_valid_and_invalid_certificates_and_channel_surfing(self): |
| 1512 | ### """Test 1k subscribers to auth, half of the subscribers with invalidCertification and join channel""" |
| 1513 | num_subscribers = 1000 |
| 1514 | num_channels = 1 |
| 1515 | df = defer.Deferred() |
| 1516 | def sub_auth_invalid_cert(df): |
| 1517 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1518 | num_channels = num_channels, |
| 1519 | cbs = (self.tls_invalid_cert, self.dhcp_verify, |
| 1520 | self.igmp_verify, self.traffic_verify), |
| 1521 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'half') |
| 1522 | assert_equal(test_status, True) |
| 1523 | df.callback(0) |
| 1524 | reactor.callLater(0, sub_auth_invalid_cert, df) |
| 1525 | return df |
| 1526 | |
| 1527 | @nottest |
| 1528 | @deferred(SUBSCRIBER_TIMEOUT) |
| 1529 | def test_1k_subscribers_authentication_with_valid_and_no_certificates_and_channel_surfing(self): |
| 1530 | ### """Test 1k subscribers to auth, half of the subscribers with No Certification and join channel""" |
| 1531 | num_subscribers = 1000 |
| 1532 | num_channels = 1 |
| 1533 | df = defer.Deferred() |
| 1534 | def sub_auth_no_cert(df): |
| 1535 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1536 | num_channels = num_channels, |
| 1537 | cbs = (self.tls_no_cert, self.dhcp_verify, self.igmp_verify), |
| 1538 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1539 | negative_subscriber_auth = 'half') |
| 1540 | assert_equal(test_status, True) |
| 1541 | df.callback(0) |
| 1542 | reactor.callLater(0, sub_auth_no_cert, df) |
| 1543 | return df |
| 1544 | |
| 1545 | #@deferred(SUBSCRIBER_TIMEOUT) |
| 1546 | @nottest |
| 1547 | def test_1k_subscribers_authentication_with_valid_and_non_ca_authorized_certificates_and_channel_surfing(self): |
| 1548 | ### """Test 1k subscribers to auth, half of the subscribers with Non CA authorized Certificate and join channel""" |
| 1549 | num_subscribers = 1000 |
| 1550 | num_channels = 1 |
| 1551 | df = defer.Deferred() |
| 1552 | def sub_auth_no_cert(df): |
| 1553 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1554 | num_channels = num_channels, |
| 1555 | cbs = (self.tls_non_ca_authrized_cert, self.dhcp_verify, self.igmp_verify), |
| 1556 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1557 | negative_subscriber_auth = 'half') |
| 1558 | assert_equal(test_status, True) |
| 1559 | df.callback(0) |
| 1560 | reactor.callLater(0, sub_auth_no_cert, df) |
| 1561 | return df |
| 1562 | |
| 1563 | #@deferred(SUBSCRIBER_TIMEOUT) |
| 1564 | @nottest |
| 1565 | def test_5k_subscribers_authentication_with_valid_and_invalid_certificates_and_channel_surfing(self): |
| 1566 | ### """Test 5k subscribers to auth, half of the subscribers with invalidCertification and join channel""" |
| 1567 | num_subscribers = 5000 |
| 1568 | num_channels = 1 |
| 1569 | df = defer.Deferred() |
| 1570 | def sub_auth_invalid_cert(df): |
| 1571 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1572 | num_channels = num_channels, |
| 1573 | cbs = (self.tls_invalid_cert, self.dhcp_verify, self.igmp_verify), |
| 1574 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'half') |
| 1575 | assert_equal(test_status, True) |
| 1576 | df.callback(0) |
| 1577 | reactor.callLater(0, sub_auth_invalid_cert, df) |
| 1578 | return df |
| 1579 | |
| 1580 | #@deferred(SUBSCRIBER_TIMEOUT) |
| 1581 | @nottest |
| 1582 | def test_5k_subscribers_authentication_with_valid_and_no_certificates_and_channel_surfing(self): |
| 1583 | ### """Test 5k subscribers to auth, half of the subscribers with No Certification and join channel""" |
| 1584 | num_subscribers = 5000 |
| 1585 | num_channels = 1 |
| 1586 | df = defer.Deferred() |
| 1587 | def sub_auth_no_cert(df): |
| 1588 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1589 | num_channels = num_channels, |
| 1590 | cbs = (self.tls_no_cert, self.dhcp_verify, self.igmp_verify), |
| 1591 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1592 | negative_subscriber_auth = 'half') |
| 1593 | assert_equal(test_status, True) |
| 1594 | df.callback(0) |
| 1595 | reactor.callLater(0, sub_auth_no_cert, df) |
| 1596 | return df |
| 1597 | |
| 1598 | #@deferred(SUBSCRIBER_TIMEOUT) |
| 1599 | @nottest |
| 1600 | def test_5k_subscribers_authentication_with_valid_and_non_ca_authorized_certificates_and_channel_surfing(self): |
| 1601 | ### """Test 5k subscribers to auth, half of the subscribers with Non CA authorized Certificate and join channel""" |
| 1602 | num_subscribers = 5000 |
| 1603 | num_channels = 1 |
| 1604 | df = defer.Deferred() |
| 1605 | def sub_auth_no_cert(df): |
| 1606 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1607 | num_channels = num_channels, |
| 1608 | cbs = (self.tls_non_ca_authrized_cert, self.dhcp_verify, self.igmp_verify), |
| 1609 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1610 | negative_subscriber_auth = 'half') |
| 1611 | assert_equal(test_status, True) |
| 1612 | df.callback(0) |
| 1613 | reactor.callLater(0, sub_auth_no_cert, df) |
| 1614 | return df |
| 1615 | |
| 1616 | #@deferred(SUBSCRIBER_TIMEOUT) |
| 1617 | @nottest |
| 1618 | def test_10k_subscribers_authentication_with_valid_and_invalid_certificates_and_channel_surfing(self): |
| 1619 | ### """Test 10k subscribers to auth, half of the subscribers with invalidCertification and join channel""" |
| 1620 | num_subscribers = 10000 |
| 1621 | num_channels = 1 |
| 1622 | df = defer.Deferred() |
| 1623 | def sub_auth_invalid_cert(df): |
| 1624 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1625 | num_channels = num_channels, |
| 1626 | cbs = (self.tls_invalid_cert, self.dhcp_verify, self.igmp_verify), |
| 1627 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'onethird') |
| 1628 | assert_equal(test_status, True) |
| 1629 | df.callback(0) |
| 1630 | reactor.callLater(0, sub_auth_invalid_cert, df) |
| 1631 | return df |
| 1632 | |
| 1633 | #@deferred(SUBSCRIBER_TIMEOUT) |
| 1634 | @nottest |
| 1635 | def test_10k_subscribers_authentication_with_valid_and_no_certificates_and_channel_surfing(self): |
| 1636 | ### """Test 10k subscribers to auth, half of the subscribers with No Certification and join channel""" |
| 1637 | num_subscribers = 10000 |
| 1638 | num_channels = 1 |
| 1639 | df = defer.Deferred() |
| 1640 | def sub_auth_no_cert(df): |
| 1641 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1642 | num_channels = num_channels, |
| 1643 | cbs = (self.tls_no_cert, self.dhcp_verify, self.igmp_verify), |
| 1644 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1645 | negative_subscriber_auth = 'onethird') |
| 1646 | assert_equal(test_status, True) |
| 1647 | df.callback(0) |
| 1648 | reactor.callLater(0, sub_auth_no_cert, df) |
| 1649 | return df |
| 1650 | |
| 1651 | #@deferred(SUBSCRIBER_TIMEOUT) |
| 1652 | @nottest |
| 1653 | def test_10k_subscribers_authentication_with_valid_and_non_ca_authorized_certificates_and_channel_surfing(self): |
| 1654 | ### """Test 10k subscribers to auth, half of the subscribers with Non CA authorized Certificate and join channel""" |
| 1655 | num_subscribers = 10000 |
| 1656 | num_channels = 1 |
| 1657 | df = defer.Deferred() |
| 1658 | def sub_auth_no_cert(df): |
| 1659 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1660 | num_channels = num_channels, |
| 1661 | cbs = (self.tls_non_ca_authrized_cert, self.dhcp_verify, self.igmp_verify), |
| 1662 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1663 | negative_subscriber_auth = 'onethird') |
| 1664 | assert_equal(test_status, False) |
| 1665 | assert_equal(test_status, True) |
| 1666 | df.callback(0) |
| 1667 | reactor.callLater(0, sub_auth_no_cert, df) |
| 1668 | return df |
| 1669 | |
| 1670 | @nottest |
| 1671 | def test_1k_cord_subscribers_authentication_with_dhcp_discovers_and_channel_surfing(self): |
| 1672 | ### """Test 1k subscribers auth success, DHCP re-discover with DHCP server and join channel""" |
| 1673 | num_subscribers = 1000 |
| 1674 | num_channels = 1 |
| 1675 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1676 | num_channels = num_channels, |
| 1677 | cbs = (self.tls_verify, self.dhcp_discover_scenario, self.igmp_verify), |
| 1678 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1679 | assert_equal(test_status, True) |
| 1680 | |
| 1681 | @nottest |
| 1682 | def test_1k_cord_subscribers_authentication_with_dhcp_client_reboot_and_channel_surfing(self): |
| 1683 | ### """Test 1k subscribers auth success, DHCP client got re-booted and join channel""" |
| 1684 | num_subscribers = 1000 |
| 1685 | num_channels = 1 |
| 1686 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1687 | num_channels = num_channels, |
| 1688 | cbs = (self.tls_verify, self.dhcp_client_reboot_scenario, self.igmp_verify), |
| 1689 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1690 | assert_equal(test_status, True) |
| 1691 | |
| 1692 | @nottest |
| 1693 | def test_1k_cord_subscribers_authentication_with_dhcp_server_reboot_and_channel_surfing(self): |
| 1694 | ### """Test 1k subscribers auth , DHCP server re-boot during DHCP process and join channel""" |
| 1695 | num_subscribers = 1000 |
| 1696 | num_channels = 1 |
| 1697 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1698 | num_channels = num_channels, |
| 1699 | cbs = (self.tls_verify, self.dhcp_server_reboot_scenario, self.igmp_verify), |
| 1700 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1701 | assert_equal(test_status, True) |
| 1702 | |
| 1703 | @nottest |
| 1704 | def test_1k_cord_subscribers_authentication_with_dhcp_client_rebind_and_channel_surfing(self): |
| 1705 | ### """Test 1k subscribers auth , DHCP client rebind IP and join channel""" |
| 1706 | num_subscribers = 1000 |
| 1707 | num_channels = 1 |
| 1708 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1709 | num_channels = num_channels, |
| 1710 | cbs = (self.tls_verify, self.dhcp_client_rebind_scenario, self.igmp_verify), |
| 1711 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1712 | assert_equal(test_status, True) |
| 1713 | |
| 1714 | @nottest |
| 1715 | def test_1k_cord_subscribers_authentication_with_dhcp_starvation_and_channel_surfing(self): |
| 1716 | ### """Test 1k subscribers auth , DHCP starvation and join channel""" |
| 1717 | num_subscribers = 1000 |
| 1718 | num_channels = 1 |
| 1719 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1720 | num_channels = num_channels, |
| 1721 | cbs = (self.tls_verify, self.dhcp_starvation_scenario, self.igmp_verify), |
| 1722 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1723 | assert_equal(test_status, True) |
| 1724 | |
| 1725 | @nottest |
| 1726 | def test_1k_cord_subscribers_authentication_with_dhcp_client_requested_ip_and_channel_surfing(self): |
| 1727 | ### """Test 1k subscribers auth with DHCP client requesting ip and join channel""" |
| 1728 | num_subscribers = 1000 |
| 1729 | num_channels = 1 |
| 1730 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1731 | num_channels = num_channels, |
| 1732 | cbs = (self.tls_verify, self.dhcp_client_desired_ip_scenario, self.igmp_verify), |
| 1733 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1734 | assert_equal(test_status, True) |
| 1735 | |
| 1736 | @nottest |
| 1737 | def test_1k_cord_subscribers_authentication_with_dhcp_non_offered_ip_and_channel_surfing(self): |
| 1738 | ### """Test subscribers auth with DHCP client request for non-offered ip and join channel""" |
| 1739 | num_subscribers = 1000 |
| 1740 | num_channels = 1 |
| 1741 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1742 | num_channels = num_channels, |
| 1743 | cbs = (self.tls_verify, self.dhcp_client_request_pkt_with_non_offered_ip_scenario, self.igmp_verify), |
| 1744 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1745 | assert_equal(test_status, True) |
| 1746 | |
| 1747 | def test_4_cord_subscribers_join_recv_5channel(self): |
| 1748 | ###"""Test 4 subscribers join and receive for 5 channels surfing""" |
| 1749 | num_subscribers = 4 |
| 1750 | num_channels = 5 |
| 1751 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1752 | num_channels = num_channels, |
| 1753 | cbs = (self.tls_verify, self.dhcp_verify, self.igmp_verify), |
| 1754 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1755 | negative_subscriber_auth = 'all') |
| 1756 | assert_equal(test_status, True) |
| 1757 | |
| 1758 | def test_4_cord_subscribers_join_jump_5channel(self): |
| 1759 | ###"""Test 4 subscribers jump and receive for 5 channels surfing""" |
| 1760 | num_subscribers = 4 |
| 1761 | num_channels = 5 |
| 1762 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1763 | num_channels = num_channels, |
| 1764 | cbs = (self.tls_verify, self.dhcp_jump_verify, self.igmp_jump_verify), |
| 1765 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1766 | negative_subscriber_auth = 'all') |
| 1767 | assert_equal(test_status, True) |
| 1768 | |
| 1769 | def test_4_cord_subscribers_join_next_5channel(self): |
| 1770 | ###"""Test 4 subscribers join next for 5 channels""" |
| 1771 | num_subscribers = 4 |
| 1772 | num_channels = 5 |
| 1773 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1774 | num_channels = num_channels, |
| 1775 | cbs = (self.tls_verify, self.dhcp_next_verify, self.igmp_next_verify), |
| 1776 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1777 | negative_subscriber_auth = 'all') |
| 1778 | assert_equal(test_status, True) |
| 1779 | |
| 1780 | def test_10_cord_subscribers_join_recv_5channel(self): |
| 1781 | ###"""Test 10 subscribers join and receive for 5 channels surfing""" |
| 1782 | num_subscribers = 10 |
| 1783 | num_channels = 5 |
| 1784 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1785 | num_channels = num_channels, |
| 1786 | cbs = (self.tls_verify, self.dhcp_verify, self.igmp_verify), |
| 1787 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1788 | negative_subscriber_auth = 'all') |
| 1789 | assert_equal(test_status, True) |
| 1790 | |
| 1791 | def test_10_cord_subscribers_join_jump_5channel(self): |
| 1792 | ###"""Test 10 subscribers jump and receive for 5 channels surfing""" |
| 1793 | num_subscribers = 10 |
| 1794 | num_channels = 5 |
| 1795 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1796 | num_channels = num_channels, |
| 1797 | cbs = (self.tls_verify, self.dhcp_jump_verify, self.igmp_jump_verify), |
| 1798 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1799 | negative_subscriber_auth = 'all') |
| 1800 | assert_equal(test_status, True) |
| 1801 | |
| 1802 | |
| 1803 | def test_10_cord_subscribers_join_next_5channel(self): |
| 1804 | ###"""Test 10 subscribers join next for 5 channels""" |
| 1805 | num_subscribers = 10 |
| 1806 | num_channels = 5 |
| 1807 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1808 | num_channels = num_channels, |
| 1809 | cbs = (self.tls_verify, self.dhcp_next_verify, self.igmp_next_verify), |
| 1810 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1811 | negative_subscriber_auth = 'all') |
| 1812 | assert_equal(test_status, True) |
| 1813 | |
| 1814 | |
| 1815 | |
| 1816 | def test_cord_subscriber_join_recv_100channels(self): |
| 1817 | num_subscribers = 1 |
| 1818 | num_channels = 100 |
| 1819 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1820 | num_channels = num_channels, |
| 1821 | cbs = (self.tls_verify, self.dhcp_verify, |
| 1822 | self.igmp_verify, self.traffic_verify), |
| 1823 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1824 | negative_subscriber_auth = 'all') |
| 1825 | assert_equal(test_status, True) |
| 1826 | |
| 1827 | def test_cord_subscriber_join_recv_400channels(self): |
| 1828 | num_subscribers = 1 |
| 1829 | num_channels = 400 |
| 1830 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1831 | num_channels = num_channels, |
| 1832 | cbs = (self.tls_verify, self.dhcp_verify, |
| 1833 | self.igmp_verify, self.traffic_verify), |
| 1834 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1835 | negative_subscriber_auth = 'all') |
| 1836 | assert_equal(test_status, True) |
| 1837 | |
| 1838 | def test_cord_subscriber_join_recv_800channels(self): |
| 1839 | num_subscribers = 1 |
| 1840 | num_channels = 800 |
| 1841 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1842 | num_channels = num_channels, |
| 1843 | cbs = (self.tls_verify, self.dhcp_verify, |
| 1844 | self.igmp_verify, self.traffic_verify), |
| 1845 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1846 | negative_subscriber_auth = 'all') |
| 1847 | assert_equal(test_status, True) |
| 1848 | |
| 1849 | def test_cord_subscriber_join_recv_1200channels(self): |
| 1850 | num_subscribers = 1 |
| 1851 | num_channels = 1200 |
| 1852 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1853 | num_channels = num_channels, |
| 1854 | cbs = (self.tls_verify, self.dhcp_verify, |
| 1855 | self.igmp_verify, self.traffic_verify), |
| 1856 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1857 | negative_subscriber_auth = 'all') |
| 1858 | assert_equal(test_status, True) |
| 1859 | |
| 1860 | def test_cord_subscriber_join_recv_1500channels(self): |
| 1861 | num_subscribers = 1 |
| 1862 | num_channels = 1500 |
| 1863 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1864 | num_channels = num_channels, |
| 1865 | cbs = (self.tls_verify, self.dhcp_verify, |
| 1866 | self.igmp_verify, self.traffic_verify), |
| 1867 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1868 | negative_subscriber_auth = 'all') |
| 1869 | assert_equal(test_status, True) |
| 1870 | |
| 1871 | def test_cord_subscriber_join_jump_100channels(self): |
| 1872 | num_subscribers = 1 |
| 1873 | num_channels = 100 |
| 1874 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1875 | num_channels = num_channels, |
| 1876 | cbs = (self.tls_verify, self.dhcp_jump_verify, |
| 1877 | self.igmp_jump_verify, self.traffic_verify), |
| 1878 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1879 | negative_subscriber_auth = 'all') |
| 1880 | assert_equal(test_status, True) |
| 1881 | def test_cord_subscriber_join_jump_400channels(self): |
| 1882 | num_subscribers = 1 |
| 1883 | num_channels = 400 |
| 1884 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1885 | num_channels = num_channels, |
| 1886 | cbs = (self.tls_verify, self.dhcp_jump_verify, |
| 1887 | self.igmp_jump_verify, self.traffic_verify), |
| 1888 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1889 | negative_subscriber_auth = 'all') |
| 1890 | assert_equal(test_status, True) |
| 1891 | |
| 1892 | def test_cord_subscriber_join_jump_800channels(self): |
| 1893 | num_subscribers = 1 |
| 1894 | num_channels = 800 |
| 1895 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1896 | num_channels = num_channels, |
| 1897 | cbs = (self.tls_verify, self.dhcp_jump_verify, |
| 1898 | self.igmp_jump_verify, self.traffic_verify), |
| 1899 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1900 | negative_subscriber_auth = 'all') |
| 1901 | assert_equal(test_status, True) |
| 1902 | def test_cord_subscriber_join_jump_1200channel(sself): |
| 1903 | num_subscribers = 1 |
| 1904 | num_channels = 1200 |
| 1905 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1906 | num_channels = num_channels, |
| 1907 | cbs = (self.tls_verify, self.dhcp_jump_verify, |
| 1908 | self.igmp_jump_verify, self.traffic_verify), |
| 1909 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1910 | negative_subscriber_auth = 'all') |
| 1911 | assert_equal(test_status, True) |
| 1912 | def test_cord_subscriber_join_jump_1500channels(self): |
| 1913 | num_subscribers = 1 |
| 1914 | num_channels = 1500 |
| 1915 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1916 | num_channels = num_channels, |
| 1917 | cbs = (self.tls_verify, self.dhcp_jump_verify, |
| 1918 | self.igmp_jump_verify, self.traffic_verify), |
| 1919 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1920 | negative_subscriber_auth = 'all') |
| 1921 | assert_equal(test_status, True) |
| 1922 | |
| 1923 | def test_cord_subscriber_join_next_100channels(self): |
| 1924 | num_subscribers = 1 |
| 1925 | num_channels = 100 |
| 1926 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1927 | num_channels = num_channels, |
| 1928 | cbs = (self.tls_verify, self.dhcp_next_verify, |
| 1929 | self.igmp_next_verify, self.traffic_verify), |
| 1930 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1931 | negative_subscriber_auth = 'all') |
| 1932 | assert_equal(test_status, True) |
| 1933 | |
| 1934 | def test_cord_subscriber_join_next_400channels(self): |
| 1935 | num_subscribers = 1 |
| 1936 | num_channels = 400 |
| 1937 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1938 | num_channels = num_channels, |
| 1939 | cbs = (self.tls_verify, self.dhcp_next_verify, |
| 1940 | self.igmp_next_verify, self.traffic_verify), |
| 1941 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1942 | negative_subscriber_auth = 'all') |
| 1943 | assert_equal(test_status, True) |
| 1944 | |
| 1945 | def test_cord_subscriber_join_next_800channels(self): |
| 1946 | num_subscribers = 1 |
| 1947 | num_channels = 800 |
| 1948 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1949 | num_channels = num_channels, |
| 1950 | cbs = (self.tls_verify, self.dhcp_next_verify, |
| 1951 | self.igmp_next_verify, self.traffic_verify), |
| 1952 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1953 | negative_subscriber_auth = 'all') |
| 1954 | assert_equal(test_status, True) |
| 1955 | |
| 1956 | |
| 1957 | def test_cord_subscriber_join_next_1200channels(self): |
| 1958 | num_subscribers = 1 |
| 1959 | num_channels = 1200 |
| 1960 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1961 | num_channels = num_channels, |
| 1962 | cbs = (self.tls_verify, self.dhcp_next_verify, |
| 1963 | self.igmp_next_verify, self.traffic_verify), |
| 1964 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1965 | negative_subscriber_auth = 'all') |
| 1966 | assert_equal(test_status, True) |
| 1967 | |
| 1968 | def test_cord_subscriber_join_next_1500channels(self): |
| 1969 | num_subscribers = 1 |
| 1970 | num_channels = 1500 |
| 1971 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1972 | num_channels = num_channels, |
| 1973 | cbs = (self.tls_verify, self.dhcp_next_verify, |
| 1974 | self.igmp_next_verify, self.traffic_verify), |
| 1975 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1976 | negative_subscriber_auth = 'all') |
| 1977 | assert_equal(test_status, True) |
| 1978 | |
| 1979 | @nottest |
| 1980 | def test_1k_cord_subscribers_authentication_with_dhcp_request_out_of_pool_ip_by_client_and_channel_surfing(self): |
| 1981 | ### """Test 1k subscribers auth with DHCP client requesting out of pool ip and join channel""" |
| 1982 | num_subscribers = 1000 |
| 1983 | num_channels = 1 |
| 1984 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1985 | num_channels = num_channels, |
| 1986 | cbs = (self.tls_verify, self.dhcp_client_requested_out_pool_ip_scenario, self.igmp_verify), |
| 1987 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1988 | assert_equal(test_status, True) |
| 1989 | |
| 1990 | @nottest |
| 1991 | def test_1k_cord_subscribers_join_recv_100channel(self): |
| 1992 | ###"""Test 1k subscribers join and receive for 100 channels surfing""" |
| 1993 | num_subscribers = 1000 |
| 1994 | num_channels = 100 |
| 1995 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1996 | num_channels = num_channels, |
| 1997 | cbs = (self.tls_verify, self.dhcp_verify, self.igmp_verify), |
| 1998 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1999 | negative_subscriber_auth = 'all') |
| 2000 | assert_equal(test_status, True) |
| 2001 | |
| 2002 | @nottest |
| 2003 | def test_1k_cord_subscribers_join_jump_100channel(self): |
| 2004 | ###"""Test 1k subscribers jump and receive for 100 channels surfing""" |
| 2005 | num_subscribers = 1000 |
| 2006 | num_channels = 100 |
| 2007 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2008 | num_channels = num_channels, |
| 2009 | cbs = (self.tls_verify, self.dhcp_jump_verify, self.igmp_jump_verify), |
| 2010 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2011 | negative_subscriber_auth = 'all') |
| 2012 | assert_equal(test_status, True) |
| 2013 | |
| 2014 | @nottest |
| 2015 | def test_1k_cord_subscribers_join_next_100channel(self): |
| 2016 | ###"""Test 1k subscribers join next for 100 channels""" |
| 2017 | num_subscribers = 1000 |
| 2018 | num_channels = 100 |
| 2019 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2020 | num_channels = num_channels, |
| 2021 | cbs = (self.tls_verify, self.dhcp_next_verify, self.igmp_next_verify), |
| 2022 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2023 | negative_subscriber_auth = 'all') |
| 2024 | assert_equal(test_status, True) |
| 2025 | |
| 2026 | @nottest |
| 2027 | def test_1k_cord_subscribers_join_recv_400channel(self): |
| 2028 | ###"""Test 1k subscribers join and receive for 400 channels surfing""" |
| 2029 | num_subscribers = 1000 |
| 2030 | num_channels = 400 |
| 2031 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2032 | num_channels = num_channels, |
| 2033 | cbs = (self.tls_verify, self.dhcp_verify, self.igmp_verify), |
| 2034 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2035 | negative_subscriber_auth = 'all') |
| 2036 | assert_equal(test_status, True) |
| 2037 | |
| 2038 | @nottest |
| 2039 | def test_1k_cord_subscribers_join_jump_400channel(self): |
| 2040 | ###"""Test 1k subscribers jump and receive for 400 channels surfing""" |
| 2041 | num_subscribers = 1000 |
| 2042 | num_channels = 400 |
| 2043 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2044 | num_channels = num_channels, |
| 2045 | cbs = (self.tls_verify, self.dhcp_jump_verify, self.igmp_jump_verify), |
| 2046 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2047 | negative_subscriber_auth = 'all') |
| 2048 | assert_equal(test_status, True) |
| 2049 | |
| 2050 | @nottest |
| 2051 | def test_1k_cord_subscribers_join_next_400channel(self): |
| 2052 | ###"""Test 1k subscribers join next for 400 channels""" |
| 2053 | num_subscribers = 1000 |
| 2054 | num_channels = 400 |
| 2055 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2056 | num_channels = num_channels, |
| 2057 | cbs = (self.tls_verify, self.dhcp_next_verify, self.igmp_next_verify), |
| 2058 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2059 | negative_subscriber_auth = 'all') |
| 2060 | assert_equal(test_status, True) |
| 2061 | |
| 2062 | @nottest |
| 2063 | def test_1k_cord_subscribers_join_recv_800channel(self): |
| 2064 | ###"""Test 1k subscribers join and receive for 800 channels surfing""" |
| 2065 | num_subscribers = 1000 |
| 2066 | num_channels = 800 |
| 2067 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2068 | num_channels = num_channels, |
| 2069 | cbs = (self.tls_verify, self.dhcp_verify, self.igmp_verify), |
| 2070 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2071 | negative_subscriber_auth = 'all') |
| 2072 | assert_equal(test_status, True) |
| 2073 | |
| 2074 | @nottest |
| 2075 | def test_1k_cord_subscribers_join_jump_800channel(self): |
| 2076 | ###"""Test 1k subscribers jump and receive for 800 channels surfing""" |
| 2077 | num_subscribers = 1000 |
| 2078 | num_channels = 800 |
| 2079 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2080 | num_channels = num_channels, |
| 2081 | cbs = (self.tls_verify, self.dhcp_jump_verify, self.igmp_jump_verify), |
| 2082 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2083 | negative_subscriber_auth = 'all') |
| 2084 | assert_equal(test_status, True) |
| 2085 | |
| 2086 | @nottest |
| 2087 | def test_1k_cord_subscribers_join_next_800channel(self): |
| 2088 | ###"""Test 1k subscribers join next for 800 channels""" |
| 2089 | num_subscribers = 1000 |
| 2090 | num_channels = 800 |
| 2091 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2092 | num_channels = num_channels, |
| 2093 | cbs = (self.tls_verify, self.dhcp_next_verify, self.igmp_next_verify), |
| 2094 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2095 | negative_subscriber_auth = 'all') |
| 2096 | assert_equal(test_status, True) |
| 2097 | |
| 2098 | @nottest |
| 2099 | def test_1k_cord_subscribers_join_recv_1200channel(self): |
| 2100 | ###"""Test 1k subscribers join and receive for 1200 channels surfing""" |
| 2101 | num_subscribers = 1000 |
| 2102 | num_channels = 1200 |
| 2103 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2104 | num_channels = num_channels, |
| 2105 | cbs = (self.tls_verify, self.dhcp_verify, self.igmp_verify), |
| 2106 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2107 | negative_subscriber_auth = 'all') |
| 2108 | assert_equal(test_status, True) |
| 2109 | |
| 2110 | @nottest |
| 2111 | def test_1k_cord_subscribers_join_jump_1200channel(self): |
| 2112 | ###"""Test 1k subscribers jump and receive for 1200 channels surfing""" |
| 2113 | num_subscribers = 1000 |
| 2114 | num_channels = 1200 |
| 2115 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2116 | num_channels = num_channels, |
| 2117 | cbs = (self.tls_verify, self.dhcp_jump_verify, self.igmp_jump_verify), |
| 2118 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2119 | negative_subscriber_auth = 'all') |
| 2120 | assert_equal(test_status, True) |
| 2121 | |
| 2122 | @nottest |
| 2123 | def test_1k_cord_subscribers_join_next_1200channel(self): |
| 2124 | ###"""Test 1k subscribers join next for 1200 channels""" |
| 2125 | num_subscribers = 1000 |
| 2126 | num_channels = 1200 |
| 2127 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2128 | num_channels = num_channels, |
| 2129 | cbs = (self.tls_verify, self.dhcp_next_verify, self.igmp_next_verify), |
| 2130 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2131 | negative_subscriber_auth = 'all') |
| 2132 | assert_equal(test_status, True) |
| 2133 | |
| 2134 | @nottest |
| 2135 | def test_1k_cord_subscribers_join_recv_1500channel(self): |
| 2136 | ###"""Test 1k subscribers join and receive for 1500 channels surfing""" |
| 2137 | num_subscribers = 1000 |
| 2138 | num_channels = 1500 |
| 2139 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2140 | num_channels = num_channels, |
| 2141 | cbs = (self.tls_verify, self.dhcp_verify, self.igmp_verify), |
| 2142 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2143 | negative_subscriber_auth = 'all') |
| 2144 | assert_equal(test_status, True) |
| 2145 | |
| 2146 | @nottest |
| 2147 | def test_1k_cord_subscribers_join_jump_1500channel(self): |
| 2148 | ###"""Test 1k subscribers jump and receive for 1500 channels surfing""" |
| 2149 | num_subscribers = 1000 |
| 2150 | num_channels = 1500 |
| 2151 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2152 | num_channels = num_channels, |
| 2153 | cbs = (self.tls_verify, self.dhcp_jump_verify, self.igmp_jump_verify), |
| 2154 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2155 | negative_subscriber_auth = 'all') |
| 2156 | assert_equal(test_status, True) |
| 2157 | |
| 2158 | @nottest |
| 2159 | def test_1k_cord_subscribers_join_next_1500channel(self): |
| 2160 | ###"""Test 1k subscribers join next for 1500 channels""" |
| 2161 | num_subscribers = 1000 |
| 2162 | num_channels = 1500 |
| 2163 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2164 | num_channels = num_channels, |
| 2165 | cbs = (self.tls_verify, self.dhcp_next_verify, self.igmp_next_verify), |
| 2166 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2167 | negative_subscriber_auth = 'all') |
| 2168 | assert_equal(test_status, True) |
| 2169 | |
| 2170 | @nottest |
| 2171 | def test_5k_cord_subscribers_join_recv_100channel(self): |
| 2172 | ###"""Test 5k subscribers join and receive for 100 channels surfing""" |
| 2173 | num_subscribers = 5000 |
| 2174 | num_channels = 100 |
| 2175 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2176 | num_channels = num_channels, |
| 2177 | cbs = (self.tls_verify, self.dhcp_verify, self.igmp_verify), |
| 2178 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2179 | negative_subscriber_auth = 'all') |
| 2180 | assert_equal(test_status, True) |
| 2181 | |
| 2182 | @nottest |
| 2183 | def test_5k_cord_subscribers_join_jump_100channel(self): |
| 2184 | ###"""Test 5k subscribers jump and receive for 100 channels surfing""" |
| 2185 | num_subscribers = 5000 |
| 2186 | num_channels = 100 |
| 2187 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2188 | num_channels = num_channels, |
| 2189 | cbs = (self.tls_verify, self.dhcp_jump_verify, self.igmp_jump_verify), |
| 2190 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2191 | negative_subscriber_auth = 'all') |
| 2192 | assert_equal(test_status, True) |
| 2193 | |
| 2194 | @nottest |
| 2195 | def test_5k_cord_subscribers_join_next_100channel(self): |
| 2196 | ###"""Test 5k subscribers join next for 100 channels""" |
| 2197 | num_subscribers = 5000 |
| 2198 | num_channels = 100 |
| 2199 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2200 | num_channels = num_channels, |
| 2201 | cbs = (self.tls_verify, self.dhcp_next_verify, self.igmp_next_verify), |
| 2202 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2203 | negative_subscriber_auth = 'all') |
| 2204 | assert_equal(test_status, True) |
| 2205 | |
| 2206 | @nottest |
| 2207 | def test_5k_cord_subscribers_join_recv_400channel(self): |
| 2208 | ###"""Test 5k subscribers join and receive for 400 channels surfing""" |
| 2209 | num_subscribers = 5000 |
| 2210 | num_channels = 400 |
| 2211 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2212 | num_channels = num_channels, |
| 2213 | cbs = (self.tls_verify, self.dhcp_verify, self.igmp_verify), |
| 2214 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2215 | negative_subscriber_auth = 'all') |
| 2216 | assert_equal(test_status, True) |
| 2217 | |
| 2218 | @nottest |
| 2219 | def test_5k_cord_subscribers_join_jump_400channel(self): |
| 2220 | ###"""Test 5k subscribers jump and receive for 400 channels surfing""" |
| 2221 | num_subscribers = 5000 |
| 2222 | num_channels = 400 |
| 2223 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2224 | num_channels = num_channels, |
| 2225 | cbs = (self.tls_verify, self.dhcp_jump_verify, self.igmp_jump_verify), |
| 2226 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2227 | negative_subscriber_auth = 'all') |
| 2228 | assert_equal(test_status, True) |
| 2229 | |
| 2230 | @nottest |
| 2231 | def test_5k_cord_subscribers_join_next_400channel(self): |
| 2232 | ###"""Test 5k subscribers join next for 400 channels""" |
| 2233 | num_subscribers = 5000 |
| 2234 | num_channels = 400 |
| 2235 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2236 | num_channels = num_channels, |
| 2237 | cbs = (self.tls_verify, self.dhcp_next_verify, self.igmp_next_verify), |
| 2238 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2239 | negative_subscriber_auth = 'all') |
| 2240 | assert_equal(test_status, True) |
| 2241 | |
| 2242 | @nottest |
| 2243 | def test_5k_cord_subscribers_join_recv_800channel(self): |
| 2244 | ###"""Test 5k subscribers join and receive for 800 channels surfing""" |
| 2245 | num_subscribers = 5000 |
| 2246 | num_channels = 800 |
| 2247 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2248 | num_channels = num_channels, |
| 2249 | cbs = (self.tls_verify, self.dhcp_verify, self.igmp_verify), |
| 2250 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2251 | negative_subscriber_auth = 'all') |
| 2252 | assert_equal(test_status, True) |
| 2253 | |
| 2254 | @nottest |
| 2255 | def test_5k_cord_subscribers_join_jump_800channel(self): |
| 2256 | ###"""Test 5k subscribers jump and receive for 800 channels surfing""" |
| 2257 | num_subscribers = 5000 |
| 2258 | num_channels = 800 |
| 2259 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2260 | num_channels = num_channels, |
| 2261 | cbs = (self.tls_verify, self.dhcp_jump_verify, self.igmp_jump_verify), |
| 2262 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2263 | negative_subscriber_auth = 'all') |
| 2264 | assert_equal(test_status, True) |
| 2265 | |
| 2266 | @nottest |
| 2267 | def test_5k_cord_subscribers_join_next_800channel(self): |
| 2268 | ###"""Test 5k subscribers join next for 800 channels""" |
| 2269 | num_subscribers = 5000 |
| 2270 | num_channels = 800 |
| 2271 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2272 | num_channels = num_channels, |
| 2273 | cbs = (self.tls_verify, self.dhcp_next_verify, self.igmp_next_verify), |
| 2274 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2275 | negative_subscriber_auth = 'all') |
| 2276 | assert_equal(test_status, True) |
| 2277 | |
| 2278 | @nottest |
| 2279 | def test_5k_cord_subscribers_join_recv_1200channel(self): |
| 2280 | ###"""Test 5k subscribers join and receive for 1200 channels surfing""" |
| 2281 | num_subscribers = 5000 |
| 2282 | num_channels = 1200 |
| 2283 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2284 | num_channels = num_channels, |
| 2285 | cbs = (self.tls_verify, self.dhcp_verify, self.igmp_verify), |
| 2286 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2287 | negative_subscriber_auth = 'all') |
| 2288 | assert_equal(test_status, True) |
| 2289 | |
| 2290 | @nottest |
| 2291 | def test_5k_cord_subscribers_join_jump_1200channel(self): |
| 2292 | ###"""Test 5k subscribers jump and receive for 1200 channels surfing""" |
| 2293 | num_subscribers = 5000 |
| 2294 | num_channels = 1200 |
| 2295 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2296 | num_channels = num_channels, |
| 2297 | cbs = (self.tls_verify, self.dhcp_jump_verify, self.igmp_jump_verify), |
| 2298 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2299 | negative_subscriber_auth = 'all') |
| 2300 | assert_equal(test_status, True) |
| 2301 | |
| 2302 | @nottest |
| 2303 | def test_5k_cord_subscribers_join_next_1200channel(self): |
| 2304 | ###"""Test 5k subscribers join next for 1200 channels""" |
| 2305 | num_subscribers = 5000 |
| 2306 | num_channels = 1200 |
| 2307 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2308 | num_channels = num_channels, |
| 2309 | cbs = (self.tls_verify, self.dhcp_next_verify, self.igmp_next_verify), |
| 2310 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2311 | negative_subscriber_auth = 'all') |
| 2312 | assert_equal(test_status, True) |
| 2313 | |
| 2314 | @nottest |
| 2315 | def test_5k_cord_subscribers_join_recv_1500channel(self): |
| 2316 | ###"""Test 5k subscribers join and receive for 1500 channels surfing""" |
| 2317 | num_subscribers = 5000 |
| 2318 | num_channels = 1500 |
| 2319 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2320 | num_channels = num_channels, |
| 2321 | cbs = (self.tls_verify, self.dhcp_verify, self.igmp_verify), |
| 2322 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2323 | negative_subscriber_auth = 'all') |
| 2324 | assert_equal(test_status, True) |
| 2325 | |
| 2326 | @nottest |
| 2327 | def test_5k_cord_subscribers_join_jump_1500channel(self): |
| 2328 | ###"""Test 5k subscribers jump and receive for 1500 channels surfing""" |
| 2329 | num_subscribers = 5000 |
| 2330 | num_channels = 1500 |
| 2331 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2332 | num_channels = num_channels, |
| 2333 | cbs = (self.tls_verify, self.dhcp_jump_verify, self.igmp_jump_verify), |
| 2334 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2335 | negative_subscriber_auth = 'all') |
| 2336 | assert_equal(test_status, True) |
| 2337 | |
| 2338 | @nottest |
| 2339 | def test_5k_cord_subscribers_join_next_1500channel(self): |
| 2340 | ###"""Test 5k subscribers join next for 1500 channels""" |
| 2341 | num_subscribers = 5000 |
| 2342 | num_channels = 1500 |
| 2343 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2344 | num_channels = num_channels, |
| 2345 | cbs = (self.tls_verify, self.dhcp_next_verify, self.igmp_next_verify), |
| 2346 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2347 | negative_subscriber_auth = 'all') |
| 2348 | assert_equal(test_status, True) |
| 2349 | |
| 2350 | @nottest |
| 2351 | def test_10k_cord_subscribers_join_recv_100channel(self): |
| 2352 | ###"""Test 10k subscribers join and receive for 100 channels surfing""" |
| 2353 | num_subscribers = 10000 |
| 2354 | num_channels = 100 |
| 2355 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2356 | num_channels = num_channels, |
| 2357 | cbs = (self.tls_verify, self.dhcp_verify, self.igmp_verify), |
| 2358 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2359 | negative_subscriber_auth = 'all') |
| 2360 | assert_equal(test_status, True) |
| 2361 | |
| 2362 | @nottest |
| 2363 | def test_10k_cord_subscribers_join_jump_100channel(self): |
| 2364 | ###"""Test 10k subscribers jump and receive for 100 channels surfing""" |
| 2365 | num_subscribers = 10000 |
| 2366 | num_channels = 100 |
| 2367 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2368 | num_channels = num_channels, |
| 2369 | cbs = (self.tls_verify, self.dhcp_jump_verify, self.igmp_jump_verify), |
| 2370 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2371 | negative_subscriber_auth = 'all') |
| 2372 | assert_equal(test_status, True) |
| 2373 | |
| 2374 | @nottest |
| 2375 | def test_10k_cord_subscribers_join_next_100channel(self): |
| 2376 | ###"""Test 10k subscribers join next for 100 channels""" |
| 2377 | num_subscribers = 10000 |
| 2378 | num_channels = 100 |
| 2379 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2380 | num_channels = num_channels, |
| 2381 | cbs = (self.tls_verify, self.dhcp_next_verify, self.igmp_next_verify), |
| 2382 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2383 | negative_subscriber_auth = 'all') |
| 2384 | assert_equal(test_status, True) |
| 2385 | |
| 2386 | @nottest |
| 2387 | def test_100k_cord_subscribers_join_recv_100channel(self): |
| 2388 | ###"""Test 100k subscribers join and receive for 100 channels surfing""" |
| 2389 | num_subscribers = 100000 |
| 2390 | num_channels = 100 |
| 2391 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2392 | num_channels = num_channels, |
| 2393 | cbs = (self.tls_verify, self.dhcp_verify, self.igmp_verify), |
| 2394 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2395 | negative_subscriber_auth = 'all') |
| 2396 | assert_equal(test_status, True) |
| 2397 | |
| 2398 | @nottest |
| 2399 | def test_100k_cord_subscribers_join_jump_100channel(self): |
| 2400 | ###"""Test 100k subscribers jump and receive for 100 channels surfing""" |
| 2401 | num_subscribers = 100000 |
| 2402 | num_channels = 100 |
| 2403 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2404 | num_channels = num_channels, |
| 2405 | cbs = (self.tls_verify, self.dhcp_jump_verify, self.igmp_jump_verify), |
| 2406 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2407 | negative_subscriber_auth = 'all') |
| 2408 | assert_equal(test_status, True) |
| 2409 | |
| 2410 | @nottest |
| 2411 | def test_100k_cord_subscribers_join_next_100channel(self): |
| 2412 | ###"""Test 100k subscribers join next for 100 channels""" |
| 2413 | num_subscribers = 100000 |
| 2414 | num_channels = 100 |
| 2415 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2416 | num_channels = num_channels, |
| 2417 | cbs = (self.tls_verify, self.dhcp_next_verify, self.igmp_next_verify), |
| 2418 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2419 | negative_subscriber_auth = 'all') |
| 2420 | assert_equal(test_status, True) |
| 2421 | |
| 2422 | @nottest |
| 2423 | def test_10k_cord_subscribers_join_recv_400channel(self): |
| 2424 | ###"""Test 10k subscribers join and receive for 400 channels surfing""" |
| 2425 | num_subscribers = 10000 |
| 2426 | num_channels = 400 |
| 2427 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2428 | num_channels = num_channels, |
| 2429 | cbs = (self.tls_verify, self.dhcp_verify, self.igmp_verify), |
| 2430 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2431 | negative_subscriber_auth = 'all') |
| 2432 | assert_equal(test_status, True) |
| 2433 | |
| 2434 | @nottest |
| 2435 | def test_10k_cord_subscribers_join_jump_400channel(self): |
| 2436 | ###"""Test 10k subscribers jump and receive for 400 channels surfing""" |
| 2437 | num_subscribers = 10000 |
| 2438 | num_channels = 400 |
| 2439 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2440 | num_channels = num_channels, |
| 2441 | cbs = (self.tls_verify, self.dhcp_jump_verify, self.igmp_jump_verify), |
| 2442 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2443 | negative_subscriber_auth = 'all') |
| 2444 | assert_equal(test_status, True) |
| 2445 | |
| 2446 | @nottest |
| 2447 | def test_10k_cord_subscribers_join_next_400channel(self): |
| 2448 | ###"""Test 10k subscribers join next for 400 channels""" |
| 2449 | num_subscribers = 10000 |
| 2450 | num_channels = 400 |
| 2451 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2452 | num_channels = num_channels, |
| 2453 | cbs = (self.tls_verify, self.dhcp_next_verify, self.igmp_next_verify), |
| 2454 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2455 | negative_subscriber_auth = 'all') |
| 2456 | assert_equal(test_status, True) |
| 2457 | |
| 2458 | @nottest |
| 2459 | def test_10k_cord_subscribers_join_recv_800channel(self): |
| 2460 | ###"""Test 10k subscribers join and receive for 800 channels surfing""" |
| 2461 | num_subscribers = 10000 |
| 2462 | num_channels = 800 |
| 2463 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2464 | num_channels = num_channels, |
| 2465 | cbs = (self.tls_verify, self.dhcp_verify, self.igmp_verify), |
| 2466 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2467 | negative_subscriber_auth = 'all') |
| 2468 | assert_equal(test_status, True) |
| 2469 | |
| 2470 | @nottest |
| 2471 | def test_10k_cord_subscribers_join_jump_800channel(self): |
| 2472 | ###"""Test 10k subscribers jump and receive for 800 channels surfing""" |
| 2473 | num_subscribers = 10000 |
| 2474 | num_channels = 800 |
| 2475 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2476 | num_channels = num_channels, |
| 2477 | cbs = (self.tls_verify, self.dhcp_jump_verify, self.igmp_jump_verify), |
| 2478 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2479 | negative_subscriber_auth = 'all') |
| 2480 | assert_equal(test_status, True) |
| 2481 | |
| 2482 | @nottest |
| 2483 | def test_10k_cord_subscribers_join_next_800channel(self): |
| 2484 | ###"""Test 10k subscribers join next for 800 channels""" |
| 2485 | num_subscribers = 10000 |
| 2486 | num_channels = 800 |
| 2487 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2488 | num_channels = num_channels, |
| 2489 | cbs = (self.tls_verify, self.dhcp_next_verify, self.igmp_next_verify), |
| 2490 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2491 | negative_subscriber_auth = 'all') |
| 2492 | assert_equal(test_status, True) |
| 2493 | |
| 2494 | @nottest |
| 2495 | def test_10k_cord_subscribers_join_recv_1200channel(self): |
| 2496 | ###"""Test 10k subscribers join and receive for 1200 channels surfing""" |
| 2497 | num_subscribers = 10000 |
| 2498 | num_channels = 1200 |
| 2499 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2500 | num_channels = num_channels, |
| 2501 | cbs = (self.tls_verify, self.dhcp_verify, self.igmp_verify), |
| 2502 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2503 | negative_subscriber_auth = 'all') |
| 2504 | assert_equal(test_status, True) |
| 2505 | |
| 2506 | @nottest |
| 2507 | def test_10k_cord_subscribers_join_jump_1200channel(self): |
| 2508 | ###"""Test 10k subscribers jump and receive for 1200 channels surfing""" |
| 2509 | num_subscribers = 10000 |
| 2510 | num_channels = 1200 |
| 2511 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2512 | num_channels = num_channels, |
| 2513 | cbs = (self.tls_verify, self.dhcp_jump_verify, self.igmp_jump_verify), |
| 2514 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2515 | negative_subscriber_auth = 'all') |
| 2516 | assert_equal(test_status, True) |
| 2517 | |
| 2518 | @nottest |
| 2519 | def test_10k_cord_subscribers_join_next_1200channel(self): |
| 2520 | ###"""Test 10k subscribers join next for 1200 channels""" |
| 2521 | num_subscribers = 10000 |
| 2522 | num_channels = 1200 |
| 2523 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2524 | num_channels = num_channels, |
| 2525 | cbs = (self.tls_verify, self.dhcp_next_verify, self.igmp_next_verify), |
| 2526 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2527 | negative_subscriber_auth = 'all') |
| 2528 | assert_equal(test_status, True) |
| 2529 | |
| 2530 | @nottest |
| 2531 | def test_10k_cord_subscribers_join_recv_1500channel(self): |
| 2532 | ###"""Test 10k subscribers join and receive for 1500 channels surfing""" |
| 2533 | num_subscribers = 10000 |
| 2534 | num_channels = 1500 |
| 2535 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2536 | num_channels = num_channels, |
| 2537 | cbs = (self.tls_verify, self.dhcp_verify, self.igmp_verify), |
| 2538 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2539 | negative_subscriber_auth = 'all') |
| 2540 | assert_equal(test_status, True) |
| 2541 | |
| 2542 | @nottest |
| 2543 | def test_10k_cord_subscribers_join_jump_1500channel(self): |
| 2544 | ###"""Test 10k subscribers jump and receive for 1500 channels surfing""" |
| 2545 | num_subscribers = 10000 |
| 2546 | num_channels = 1500 |
| 2547 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2548 | num_channels = num_channels, |
| 2549 | cbs = (self.tls_verify, self.dhcp_jump_verify, self.igmp_jump_verify), |
| 2550 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2551 | negative_subscriber_auth = 'all') |
| 2552 | assert_equal(test_status, True) |
| 2553 | |
| 2554 | @nottest |
| 2555 | def test_10k_cord_subscribers_join_next_1500channel(self): |
| 2556 | ###"""Test 10k subscribers join next for 1500 channels""" |
| 2557 | num_subscribers = 10000 |
| 2558 | num_channels = 1500 |
| 2559 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2560 | num_channels = num_channels, |
| 2561 | cbs = (self.tls_verify, self.dhcp_next_verify, self.igmp_next_verify), |
| 2562 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2563 | negative_subscriber_auth = 'all') |
| 2564 | assert_equal(test_status, True) |
| 2565 | |
| 2566 | @nottest |
| 2567 | def test_100k_cord_subscribers_join_recv_1500channel(self): |
| 2568 | ###"""Test 100k subscribers join and receive for 1500 channels surfing""" |
| 2569 | num_subscribers = 100000 |
| 2570 | num_channels = 1500 |
| 2571 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2572 | num_channels = num_channels, |
| 2573 | cbs = (self.tls_verify, self.dhcp_verify, self.igmp_verify), |
| 2574 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2575 | negative_subscriber_auth = 'all') |
| 2576 | assert_equal(test_status, True) |
| 2577 | |
| 2578 | @nottest |
| 2579 | def test_100k_cord_subscribers_join_jump_1500channel(self): |
| 2580 | ###"""Test 10k subscribers jump and receive for 1500 channels surfing""" |
| 2581 | num_subscribers = 100000 |
| 2582 | num_channels = 1500 |
| 2583 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2584 | num_channels = num_channels, |
| 2585 | cbs = (self.tls_verify, self.dhcp_jump_verify, self.igmp_jump_verify), |
| 2586 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2587 | negative_subscriber_auth = 'all') |
| 2588 | assert_equal(test_status, True) |
| 2589 | |
| 2590 | @nottest |
| 2591 | def test_100k_cord_subscribers_join_next_1500channel(self): |
| 2592 | ###"""Test 10k subscribers join next for 1500 channels""" |
| 2593 | num_subscribers = 100000 |
| 2594 | num_channels = 1500 |
| 2595 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 2596 | num_channels = num_channels, |
| 2597 | cbs = (self.tls_verify, self.dhcp_next_verify, self.igmp_next_verify), |
| 2598 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 2599 | negative_subscriber_auth = 'all') |
| 2600 | assert_equal(test_status, True) |
A.R Karthick | 4c4d049 | 2017-05-26 19:23:05 -0700 | [diff] [blame] | 2601 | |
| 2602 | |
| 2603 | |
A.R Karthick | 8a507cf | 2017-06-02 18:44:49 -0700 | [diff] [blame] | 2604 | def remove_olt(self, switch_map): |
| 2605 | controller = get_controller() |
| 2606 | auth = ('karaf', 'karaf') |
| 2607 | #remove subscriber for every port on all the voltha devices |
| 2608 | for device, device_map in switch_map.iteritems(): |
| 2609 | uni_ports = device_map['ports'] |
| 2610 | uplink_vlan = device_map['uplink_vlan'] |
| 2611 | for port in uni_ports: |
| 2612 | rest_url = 'http://{}:8181/onos/olt/oltapp/{}/{}'.format(controller, |
| 2613 | device, |
| 2614 | port) |
| 2615 | resp = requests.delete(rest_url, auth = auth) |
| 2616 | if resp.status_code not in [204, 202, 200]: |
| 2617 | log_test.error('Error deleting subscriber for device %s on port %s' %(device, port)) |
| 2618 | else: |
| 2619 | log_test.info('Deleted subscriber for device %s on port %s' %(device, port)) |
A.R Karthick | 4c4d049 | 2017-05-26 19:23:05 -0700 | [diff] [blame] | 2620 | |
| 2621 | def config_olt(self, switch_map): |
| 2622 | controller = get_controller() |
A.R Karthick | 4c4d049 | 2017-05-26 19:23:05 -0700 | [diff] [blame] | 2623 | auth = ('karaf', 'karaf') |
| 2624 | #configure subscriber for every port on all the voltha devices |
| 2625 | for device, device_map in switch_map.iteritems(): |
| 2626 | uni_ports = device_map['ports'] |
| 2627 | uplink_vlan = device_map['uplink_vlan'] |
| 2628 | for port in uni_ports: |
| 2629 | vlan = port |
| 2630 | rest_url = 'http://{}:8181/onos/olt/oltapp/{}/{}/{}'.format(controller, |
| 2631 | device, |
| 2632 | port, |
| 2633 | vlan) |
A.R Karthick | 4bd5f53 | 2017-06-06 11:37:27 -0700 | [diff] [blame] | 2634 | requests.post(rest_url, auth = auth) |
| 2635 | #assert_equal(resp.ok, True) |
A.R Karthick | 4c4d049 | 2017-05-26 19:23:05 -0700 | [diff] [blame] | 2636 | |
A.R Karthick | 56e5943 | 2017-06-06 18:05:46 -0700 | [diff] [blame] | 2637 | def cord_subscriber_voltha(self, services, cbs = None, num_subscribers = 1, num_channels = 1): |
A.R Karthick | 4c4d049 | 2017-05-26 19:23:05 -0700 | [diff] [blame] | 2638 | """Test subscriber join next for channel surfing""" |
| 2639 | if self.VOLTHA_HOST is None: |
| 2640 | log_test.info('Skipping test as no voltha host') |
| 2641 | return |
A.R Karthick | 8a507cf | 2017-06-02 18:44:49 -0700 | [diff] [blame] | 2642 | switch_map = None |
| 2643 | olt_configured = False |
| 2644 | try: |
A R Karthick | 9dc6e92 | 2017-07-12 14:40:16 -0700 | [diff] [blame] | 2645 | switch_map = self.voltha_switch_map |
A.R Karthick | 8a507cf | 2017-06-02 18:44:49 -0700 | [diff] [blame] | 2646 | if not switch_map: |
| 2647 | log_test.info('No voltha devices found') |
| 2648 | return |
A.R Karthick | 8a507cf | 2017-06-02 18:44:49 -0700 | [diff] [blame] | 2649 | log_test.info('Adding subscribers through OLT app') |
| 2650 | self.config_olt(switch_map) |
| 2651 | olt_configured = True |
| 2652 | time.sleep(5) |
A.R Karthick | 56e5943 | 2017-06-06 18:05:46 -0700 | [diff] [blame] | 2653 | self.num_subscribers = num_subscribers |
| 2654 | self.num_channels = num_channels |
A.R Karthick | 8a507cf | 2017-06-02 18:44:49 -0700 | [diff] [blame] | 2655 | test_status = self.subscriber_join_verify(num_subscribers = self.num_subscribers, |
| 2656 | num_channels = self.num_channels, |
A.R Karthick | 56e5943 | 2017-06-06 18:05:46 -0700 | [diff] [blame] | 2657 | cbs = cbs, |
A.R Karthick | 8a507cf | 2017-06-02 18:44:49 -0700 | [diff] [blame] | 2658 | port_list = self.generate_port_list(self.num_subscribers, |
| 2659 | self.num_channels), |
| 2660 | services = services) |
| 2661 | assert_equal(test_status, True) |
| 2662 | finally: |
A R Karthick | 18d0fb6 | 2017-09-01 18:49:07 -0700 | [diff] [blame] | 2663 | if self.VOLTHA_TEARDOWN is True and switch_map is not None: |
| 2664 | if self.voltha_preconfigured is False and olt_configured is True: |
A.R Karthick | 8a507cf | 2017-06-02 18:44:49 -0700 | [diff] [blame] | 2665 | self.remove_olt(switch_map) |
A.R Karthick | 56e5943 | 2017-06-06 18:05:46 -0700 | [diff] [blame] | 2666 | |
| 2667 | def test_cord_subscriber_voltha_tls(self): |
A R Karthick | 9dc6e92 | 2017-07-12 14:40:16 -0700 | [diff] [blame] | 2668 | """Test subscriber TLS authentication with voltha""" |
A.R Karthick | 56e5943 | 2017-06-06 18:05:46 -0700 | [diff] [blame] | 2669 | if self.VOLTHA_HOST is None: |
| 2670 | log_test.info('Skipping test as no voltha host') |
| 2671 | return |
| 2672 | num_subscribers = 1 |
| 2673 | num_channels = 1 |
| 2674 | services = ('TLS',) |
| 2675 | cbs = ( self.tls_verify, ) |
| 2676 | self.cord_subscriber_voltha(services, cbs = cbs, |
| 2677 | num_subscribers = num_subscribers, |
| 2678 | num_channels = num_channels) |
| 2679 | |
| 2680 | def test_cord_subscriber_voltha_tls_igmp(self): |
A R Karthick | 9dc6e92 | 2017-07-12 14:40:16 -0700 | [diff] [blame] | 2681 | """Test subscriber TLS and IGMP with voltha with 1 channel""" |
A.R Karthick | 56e5943 | 2017-06-06 18:05:46 -0700 | [diff] [blame] | 2682 | if self.VOLTHA_HOST is None: |
| 2683 | log_test.info('Skipping test as no voltha host') |
| 2684 | return |
| 2685 | num_subscribers = 1 |
| 2686 | num_channels = 1 |
| 2687 | services = ('TLS','IGMP',) |
| 2688 | cbs = ( self.tls_verify, self.voltha_igmp_next_verify,) |
| 2689 | self.cord_subscriber_voltha(services, cbs = cbs, |
| 2690 | num_subscribers = num_subscribers, |
| 2691 | num_channels = num_channels) |
A.R Karthick | 4f58384 | 2017-06-09 17:15:47 -0700 | [diff] [blame] | 2692 | |
| 2693 | def test_cord_subscriber_voltha_tls_igmp_3(self): |
A R Karthick | 9dc6e92 | 2017-07-12 14:40:16 -0700 | [diff] [blame] | 2694 | """Test subscriber TLS and IGMP with voltha for channel surfing with 3 subscribers browsing 3 channels each""" |
A.R Karthick | 4f58384 | 2017-06-09 17:15:47 -0700 | [diff] [blame] | 2695 | if self.VOLTHA_HOST is None: |
| 2696 | log_test.info('Skipping test as no voltha host') |
| 2697 | return |
| 2698 | num_subscribers = 3 |
| 2699 | num_channels = 3 |
| 2700 | services = ('TLS','IGMP',) |
| 2701 | cbs = ( self.tls_verify, self.voltha_igmp_next_verify,) |
| 2702 | self.cord_subscriber_voltha(services, cbs = cbs, |
| 2703 | num_subscribers = num_subscribers, |
| 2704 | num_channels = num_channels) |