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 | |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 17 | # |
Chetan Gaonker | cfcce78 | 2016-05-10 10:10:42 -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 |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 23 | # |
Chetan Gaonker | cfcce78 | 2016-05-10 10:10:42 -0700 | [diff] [blame] | 24 | # http://www.apache.org/licenses/LICENSE-2.0 |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 25 | # |
Chetan Gaonker | cfcce78 | 2016-05-10 10:10:42 -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 | # |
Chetan Gaonker | cbe7964 | 2016-03-09 17:45:58 -0800 | [diff] [blame] | 32 | import unittest |
| 33 | from nose.tools import * |
| 34 | from nose.twistedtools import reactor, deferred |
| 35 | from twisted.internet import defer |
Chetan Gaonker | cbe7964 | 2016-03-09 17:45:58 -0800 | [diff] [blame] | 36 | import time, monotonic |
| 37 | import os, sys |
| 38 | import tempfile |
| 39 | import random |
| 40 | import threading |
| 41 | from Stats import Stats |
| 42 | from OnosCtrl import OnosCtrl |
| 43 | from DHCP import DHCPTest |
| 44 | from EapTLS import TLSAuthTest |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 45 | from Channels import Channels, IgmpChannel |
Chetan Gaonker | 41d2e07 | 2016-03-15 16:41:31 -0700 | [diff] [blame] | 46 | from subscriberDb import SubscriberDB |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 47 | from threadPool import ThreadPool |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 48 | from portmaps import g_subscriber_port_map |
Chetan Gaonker | 7997bb4 | 2016-03-28 09:46:15 -0700 | [diff] [blame] | 49 | from OltConfig import * |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 50 | from CordContainer import * |
A R Karthick | 9313b76 | 2016-11-07 13:14:35 -0800 | [diff] [blame] | 51 | from CordTestServer import cord_test_radius_restart |
| 52 | from CordLogger import CordLogger |
A R Karthick | 76a497a | 2017-04-12 10:59:39 -0700 | [diff] [blame] | 53 | from CordTestUtils import log_test as log |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 54 | import copy |
Chetan Gaonker | cbe7964 | 2016-03-09 17:45:58 -0800 | [diff] [blame] | 55 | log.setLevel('INFO') |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 56 | DEFAULT_NO_CHANNELS = 1 |
Chetan Gaonker | cbe7964 | 2016-03-09 17:45:58 -0800 | [diff] [blame] | 57 | |
| 58 | class Subscriber(Channels): |
Chetan Gaonker | 7997bb4 | 2016-03-28 09:46:15 -0700 | [diff] [blame] | 59 | PORT_TX_DEFAULT = 2 |
| 60 | PORT_RX_DEFAULT = 1 |
| 61 | INTF_TX_DEFAULT = 'veth2' |
| 62 | INTF_RX_DEFAULT = 'veth0' |
Chetan Gaonker | cbe7964 | 2016-03-09 17:45:58 -0800 | [diff] [blame] | 63 | STATS_RX = 0 |
| 64 | STATS_TX = 1 |
| 65 | STATS_JOIN = 2 |
| 66 | STATS_LEAVE = 3 |
Chetan Gaonker | 41d2e07 | 2016-03-15 16:41:31 -0700 | [diff] [blame] | 67 | SUBSCRIBER_SERVICES = 'DHCP IGMP TLS' |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 68 | |
| 69 | |
Chetan Gaonker | 7997bb4 | 2016-03-28 09:46:15 -0700 | [diff] [blame] | 70 | def __init__(self, name = 'sub', service = SUBSCRIBER_SERVICES, port_map = None, |
| 71 | num = 1, channel_start = 0, |
| 72 | tx_port = PORT_TX_DEFAULT, rx_port = PORT_RX_DEFAULT, |
| 73 | iface = INTF_RX_DEFAULT, iface_mcast = INTF_TX_DEFAULT, |
Chetan Gaonker | cbe7964 | 2016-03-09 17:45:58 -0800 | [diff] [blame] | 74 | mcast_cb = None, loginType = 'wireless'): |
Chetan Gaonker | a58ab6e | 2016-03-23 15:04:20 -0700 | [diff] [blame] | 75 | self.tx_port = tx_port |
| 76 | self.rx_port = rx_port |
Chetan Gaonker | 7997bb4 | 2016-03-28 09:46:15 -0700 | [diff] [blame] | 77 | self.port_map = port_map or g_subscriber_port_map |
| 78 | try: |
| 79 | self.tx_intf = self.port_map[tx_port] |
| 80 | self.rx_intf = self.port_map[rx_port] |
| 81 | except: |
Chetan Gaonker | 3d16385 | 2016-03-28 12:20:25 -0700 | [diff] [blame] | 82 | self.tx_intf = self.port_map[self.PORT_TX_DEFAULT] |
| 83 | self.rx_intf = self.port_map[self.PORT_RX_DEFAULT] |
Chetan Gaonker | 7997bb4 | 2016-03-28 09:46:15 -0700 | [diff] [blame] | 84 | |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 85 | Channels.__init__(self, num, channel_start = channel_start, |
Chetan Gaonker | a58ab6e | 2016-03-23 15:04:20 -0700 | [diff] [blame] | 86 | iface = self.rx_intf, iface_mcast = self.tx_intf, mcast_cb = mcast_cb) |
Chetan Gaonker | 41d2e07 | 2016-03-15 16:41:31 -0700 | [diff] [blame] | 87 | self.name = name |
| 88 | self.service = service |
| 89 | self.service_map = {} |
| 90 | services = self.service.strip().split(' ') |
| 91 | for s in services: |
| 92 | self.service_map[s] = True |
Chetan Gaonker | cbe7964 | 2016-03-09 17:45:58 -0800 | [diff] [blame] | 93 | self.loginType = loginType |
| 94 | ##start streaming channels |
| 95 | self.join_map = {} |
| 96 | ##accumulated join recv stats |
| 97 | self.join_rx_stats = Stats() |
| 98 | |
Chetan Gaonker | 41d2e07 | 2016-03-15 16:41:31 -0700 | [diff] [blame] | 99 | def has_service(self, service): |
| 100 | if self.service_map.has_key(service): |
| 101 | return self.service_map[service] |
| 102 | if self.service_map.has_key(service.upper()): |
| 103 | return self.service_map[service.upper()] |
| 104 | return False |
| 105 | |
Chetan Gaonker | cbe7964 | 2016-03-09 17:45:58 -0800 | [diff] [blame] | 106 | def channel_join_update(self, chan, join_time): |
| 107 | self.join_map[chan] = ( Stats(), Stats(), Stats(), Stats() ) |
| 108 | self.channel_update(chan, self.STATS_JOIN, 1, t = join_time) |
| 109 | |
| 110 | def channel_join(self, chan = 0, delay = 2): |
| 111 | '''Join a channel and create a send/recv stats map''' |
| 112 | if self.join_map.has_key(chan): |
| 113 | del self.join_map[chan] |
| 114 | self.delay = delay |
| 115 | chan, join_time = self.join(chan) |
| 116 | self.channel_join_update(chan, join_time) |
| 117 | return chan |
| 118 | |
| 119 | def channel_join_next(self, delay = 2): |
| 120 | '''Joins the next channel leaving the last channel''' |
| 121 | if self.last_chan: |
| 122 | if self.join_map.has_key(self.last_chan): |
| 123 | del self.join_map[self.last_chan] |
| 124 | self.delay = delay |
| 125 | chan, join_time = self.join_next() |
| 126 | self.channel_join_update(chan, join_time) |
| 127 | return chan |
| 128 | |
| 129 | def channel_jump(self, delay = 2): |
| 130 | '''Jumps randomly to the next channel leaving the last channel''' |
Chetan Gaonker | 4a82bae | 2016-05-19 17:35:30 -0700 | [diff] [blame] | 131 | log.info("Jumps randomly to the next channel leaving the last channel") |
Chetan Gaonker | cbe7964 | 2016-03-09 17:45:58 -0800 | [diff] [blame] | 132 | if self.last_chan is not None: |
| 133 | if self.join_map.has_key(self.last_chan): |
| 134 | del self.join_map[self.last_chan] |
| 135 | self.delay = delay |
| 136 | chan, join_time = self.jump() |
| 137 | self.channel_join_update(chan, join_time) |
| 138 | return chan |
| 139 | |
| 140 | def channel_leave(self, chan = 0): |
| 141 | if self.join_map.has_key(chan): |
| 142 | del self.join_map[chan] |
| 143 | self.leave(chan) |
| 144 | |
| 145 | def channel_update(self, chan, stats_type, packets, t=0): |
| 146 | if type(chan) == type(0): |
| 147 | chan_list = (chan,) |
| 148 | else: |
| 149 | chan_list = chan |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 150 | for c in chan_list: |
Chetan Gaonker | cbe7964 | 2016-03-09 17:45:58 -0800 | [diff] [blame] | 151 | if self.join_map.has_key(c): |
| 152 | self.join_map[c][stats_type].update(packets = packets, t = t) |
| 153 | |
| 154 | def channel_receive(self, chan, cb = None, count = 1): |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 155 | log.info('Subscriber %s receiving from group %s, channel %d' %(self.name, self.gaddr(chan), chan)) |
Chetan Gaonker | cbe7964 | 2016-03-09 17:45:58 -0800 | [diff] [blame] | 156 | self.recv(chan, cb = cb, count = count) |
| 157 | |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 158 | def recv_channel_cb(self, pkt): |
| 159 | ##First verify that we have received the packet for the joined instance |
| 160 | log.debug('Packet received for group %s, subscriber %s' %(pkt[IP].dst, self.name)) |
| 161 | chan = self.caddr(pkt[IP].dst) |
| 162 | assert_equal(chan in self.join_map.keys(), True) |
| 163 | recv_time = monotonic.monotonic() * 1000000 |
| 164 | join_time = self.join_map[chan][self.STATS_JOIN].start |
| 165 | delta = recv_time - join_time |
| 166 | self.join_rx_stats.update(packets=1, t = delta, usecs = True) |
| 167 | self.channel_update(chan, self.STATS_RX, 1, t = delta) |
| 168 | log.debug('Packet received in %.3f usecs for group %s after join' %(delta, pkt[IP].dst)) |
| 169 | |
| 170 | class subscriber_pool: |
| 171 | |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 172 | def __init__(self, subscriber, test_cbs, test_status): |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 173 | self.subscriber = subscriber |
| 174 | self.test_cbs = test_cbs |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 175 | self.test_status = test_status |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 176 | |
| 177 | def pool_cb(self): |
| 178 | for cb in self.test_cbs: |
| 179 | if cb: |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 180 | self.test_status = cb(self.subscriber) |
| 181 | # cb(self.subscriber) |
| 182 | if self.test_status is not True: |
| 183 | log.info('This service is failed and other services will not run for this subscriber') |
| 184 | break |
| 185 | log.info('This Subscriber is tested for multiple service elgibility ') |
| 186 | self.test_status = True |
| 187 | |
A R Karthick | 9313b76 | 2016-11-07 13:14:35 -0800 | [diff] [blame] | 188 | class subscriber_exchange(CordLogger): |
Chetan Gaonker | cbe7964 | 2016-03-09 17:45:58 -0800 | [diff] [blame] | 189 | |
A.R Karthick | 95d044e | 2016-06-10 18:44:36 -0700 | [diff] [blame] | 190 | apps = [ 'org.opencord.aaa', 'org.onosproject.dhcp' ] |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 191 | |
| 192 | dhcp_app = 'org.onosproject.dhcp' |
| 193 | |
A.R Karthick | 95d044e | 2016-06-10 18:44:36 -0700 | [diff] [blame] | 194 | olt_apps = [ 'org.opencord.igmp', 'org.opencord.cordmcast' ] |
Chetan Gaonker | cbe7964 | 2016-03-09 17:45:58 -0800 | [diff] [blame] | 195 | dhcp_server_config = { |
| 196 | "ip": "10.1.11.50", |
| 197 | "mac": "ca:fe:ca:fe:ca:fe", |
| 198 | "subnet": "255.255.252.0", |
| 199 | "broadcast": "10.1.11.255", |
| 200 | "router": "10.1.8.1", |
| 201 | "domain": "8.8.8.8", |
| 202 | "ttl": "63", |
| 203 | "delay": "2", |
| 204 | "startip": "10.1.11.51", |
| 205 | "endip": "10.1.11.100" |
| 206 | } |
| 207 | |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 208 | aaa_loaded = False |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 209 | INTF_TX_DEFAULT = 'veth2' |
| 210 | INTF_RX_DEFAULT = 'veth0' |
| 211 | SUBSCRIBER_TIMEOUT = 20 |
| 212 | |
| 213 | CLIENT_CERT = """-----BEGIN CERTIFICATE----- |
| 214 | MIICuDCCAiGgAwIBAgIBAjANBgkqhkiG9w0BAQUFADCBizELMAkGA1UEBhMCVVMx |
| 215 | CzAJBgNVBAgTAkNBMRIwEAYDVQQHEwlTb21ld2hlcmUxEzARBgNVBAoTCkNpZW5h |
| 216 | IEluYy4xHjAcBgkqhkiG9w0BCQEWD2FkbWluQGNpZW5hLmNvbTEmMCQGA1UEAxMd |
| 217 | RXhhbXBsZSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMTYwNjA2MjExMjI3WhcN |
| 218 | MTcwNjAxMjExMjI3WjBnMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExEzARBgNV |
| 219 | BAoTCkNpZW5hIEluYy4xFzAVBgNVBAMUDnVzZXJAY2llbmEuY29tMR0wGwYJKoZI |
| 220 | hvcNAQkBFg51c2VyQGNpZW5hLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkC |
| 221 | gYEAwvXiSzb9LZ6c7uNziUfKvoHO7wu/uiFC5YUpXbmVGuGZizbVrny0xnR85Dfe |
| 222 | +9R4diansfDhIhzOUl1XjN3YDeSS9OeF5YWNNE8XDhlz2d3rVzaN6hIhdotBkUjg |
| 223 | rUewjTg5OFR31QEyG3v8xR3CLgiE9xQELjZbSA07pD79zuUCAwEAAaNPME0wEwYD |
| 224 | VR0lBAwwCgYIKwYBBQUHAwIwNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL3d3dy5l |
| 225 | eGFtcGxlLmNvbS9leGFtcGxlX2NhLmNybDANBgkqhkiG9w0BAQUFAAOBgQDAjkrY |
| 226 | 6tDChmKbvr8w6Du/t8vHjTCoCIocHTN0qzWOeb1YsAGX89+TrWIuO1dFyYd+Z0KC |
| 227 | PDKB5j/ygml9Na+AklSYAVJIjvlzXKZrOaPmhZqDufi+rXWti/utVqY4VMW2+HKC |
| 228 | nXp37qWeuFLGyR1519Y1d6F/5XzqmvbwURuEug== |
| 229 | -----END CERTIFICATE-----""" |
| 230 | |
| 231 | CLIENT_CERT_INVALID = '''-----BEGIN CERTIFICATE----- |
| 232 | MIIDvTCCAqWgAwIBAgIBAjANBgkqhkiG9w0BAQUFADCBizELMAkGA1UEBhMCVVMx |
| 233 | CzAJBgNVBAgTAkNBMRIwEAYDVQQHEwlTb21ld2hlcmUxEzARBgNVBAoTCkNpZW5h |
| 234 | IEluYy4xHjAcBgkqhkiG9w0BCQEWD2FkbWluQGNpZW5hLmNvbTEmMCQGA1UEAxMd |
| 235 | RXhhbXBsZSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMTYwMzExMTg1MzM2WhcN |
| 236 | MTcwMzA2MTg1MzM2WjBnMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExEzARBgNV |
| 237 | BAoTCkNpZW5hIEluYy4xFzAVBgNVBAMUDnVzZXJAY2llbmEuY29tMR0wGwYJKoZI |
| 238 | hvcNAQkBFg51c2VyQGNpZW5hLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC |
| 239 | AQoCggEBAOxemcBsPn9tZsCa5o2JA6sQDC7A6JgCNXXl2VFzKLNNvB9PS6D7ZBsQ |
| 240 | 5An0zEDMNzi51q7lnrYg1XyiE4S8FzMGAFr94RlGMQJUbRD9V/oqszMX4k++iAOK |
| 241 | tIA1gr3x7Zi+0tkjVSVzXTmgNnhChAamdMsjYUG5+CY9WAicXyy+VEV3zTphZZDR |
| 242 | OjcjEp4m/TSXVPYPgYDXI40YZKX5BdvqykWtT/tIgZb48RS1NPyN/XkCYzl3bv21 |
| 243 | qx7Mc0fcEbsJBIIRYTUkfxnsilcnmLxSYO+p+DZ9uBLBzcQt+4Rd5pLSfi21WM39 |
| 244 | 2Z2oOi3vs/OYAPAqgmi2JWOv3mePa/8CAwEAAaNPME0wEwYDVR0lBAwwCgYIKwYB |
| 245 | BQUHAwIwNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL3d3dy5leGFtcGxlLmNvbS9l |
| 246 | eGFtcGxlX2NhLmNybDANBgkqhkiG9w0BAQUFAAOCAQEALBzMPDTIB6sLyPl0T6JV |
| 247 | MjOkyldAVhXWiQsTjaGQGJUUe1cmUJyZbUZEc13MygXMPOM4x7z6VpXGuq1c/Vxn |
| 248 | VzQ2fNnbJcIAHi/7G8W5/SQfPesIVDsHTEc4ZspPi5jlS/MVX3HOC+BDbOjdbwqP |
| 249 | RX0JEr+uOyhjO+lRxG8ilMRACoBUbw1eDuVDoEBgErSUC44pq5ioDw2xelc+Y6hQ |
| 250 | dmtYwfY0DbvwxHtA495frLyPcastDiT/zre7NL51MyUDPjjYjghNQEwvu66IKbQ3 |
| 251 | T1tJBrgI7/WI+dqhKBFolKGKTDWIHsZXQvZ1snGu/FRYzg1l+R/jT8cRB9BDwhUt |
| 252 | yg== |
| 253 | -----END CERTIFICATE-----''' |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 254 | |
Chetan Gaonker | cbe7964 | 2016-03-09 17:45:58 -0800 | [diff] [blame] | 255 | def setUp(self): |
Chetan Gaonker | 7997bb4 | 2016-03-28 09:46:15 -0700 | [diff] [blame] | 256 | '''Load the OLT config and activate relevant apps''' |
A R Karthick | 9313b76 | 2016-11-07 13:14:35 -0800 | [diff] [blame] | 257 | super(subscriber_exchange, self).setUp() |
Chetan Gaonker | 7997bb4 | 2016-03-28 09:46:15 -0700 | [diff] [blame] | 258 | self.olt = OltConfig() |
A R Karthick | b03cecd | 2016-07-27 10:27:55 -0700 | [diff] [blame] | 259 | self.port_map, _ = self.olt.olt_port_map() |
Chetan Gaonker | 7997bb4 | 2016-03-28 09:46:15 -0700 | [diff] [blame] | 260 | ##if no olt config, fall back to ovs port map |
| 261 | if not self.port_map: |
| 262 | self.port_map = g_subscriber_port_map |
| 263 | else: |
| 264 | log.info('Using OLT Port configuration for test setup') |
Chetan Gaonker | a2b87df | 2016-03-31 15:41:31 -0700 | [diff] [blame] | 265 | log.info('Configuring CORD OLT access device information') |
A R Karthick | 0f6b684 | 2016-12-06 17:17:44 -0800 | [diff] [blame] | 266 | OnosCtrl.cord_olt_config(self.olt) |
Chetan Gaonker | a2b87df | 2016-03-31 15:41:31 -0700 | [diff] [blame] | 267 | self.activate_apps(self.olt_apps) |
| 268 | |
| 269 | self.activate_apps(self.apps) |
Chetan Gaonker | cbe7964 | 2016-03-09 17:45:58 -0800 | [diff] [blame] | 270 | |
A R Karthick | 9313b76 | 2016-11-07 13:14:35 -0800 | [diff] [blame] | 271 | def tearDown(self): |
Chetan Gaonker | cbe7964 | 2016-03-09 17:45:58 -0800 | [diff] [blame] | 272 | '''Deactivate the dhcp app''' |
A R Karthick | 9313b76 | 2016-11-07 13:14:35 -0800 | [diff] [blame] | 273 | super(subscriber_exchange, self).tearDown() |
Chetan Gaonker | cbe7964 | 2016-03-09 17:45:58 -0800 | [diff] [blame] | 274 | for app in self.apps: |
| 275 | onos_ctrl = OnosCtrl(app) |
| 276 | onos_ctrl.deactivate() |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 277 | log.info('Restarting the Radius container in the setup after running every subscriber test cases by default') |
A R Karthick | 9313b76 | 2016-11-07 13:14:35 -0800 | [diff] [blame] | 278 | cord_test_radius_restart() |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 279 | #os.system('ifconfig '+INTF_RX_DEFAULT+' up') |
| 280 | |
Chetan Gaonker | a2b87df | 2016-03-31 15:41:31 -0700 | [diff] [blame] | 281 | def activate_apps(self, apps): |
Chetan Gaonker | 735495f | 2016-05-10 14:51:16 -0700 | [diff] [blame] | 282 | for app in apps: |
Chetan Gaonker | a2b87df | 2016-03-31 15:41:31 -0700 | [diff] [blame] | 283 | onos_ctrl = OnosCtrl(app) |
| 284 | status, _ = onos_ctrl.activate() |
| 285 | assert_equal(status, True) |
| 286 | time.sleep(2) |
| 287 | |
Chetan Gaonker | cbe7964 | 2016-03-09 17:45:58 -0800 | [diff] [blame] | 288 | def onos_aaa_load(self): |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 289 | if self.aaa_loaded: |
| 290 | return |
A R Karthick | 1555c7c | 2017-09-07 14:59:41 -0700 | [diff] [blame] | 291 | OnosCtrl.aaa_load_config() |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 292 | self.aaa_loaded = True |
Chetan Gaonker | cbe7964 | 2016-03-09 17:45:58 -0800 | [diff] [blame] | 293 | |
| 294 | def onos_dhcp_table_load(self, config = None): |
| 295 | dhcp_dict = {'apps' : { 'org.onosproject.dhcp' : { 'dhcp' : copy.copy(self.dhcp_server_config) } } } |
| 296 | dhcp_config = dhcp_dict['apps']['org.onosproject.dhcp']['dhcp'] |
| 297 | if config: |
| 298 | for k in config.keys(): |
| 299 | if dhcp_config.has_key(k): |
| 300 | dhcp_config[k] = config[k] |
| 301 | self.onos_load_config('org.onosproject.dhcp', dhcp_dict) |
| 302 | |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 303 | def send_recv(self, mac = None, update_seed = False, validate = True): |
| 304 | cip, sip = self.dhcp.discover(mac = mac, update_seed = update_seed) |
| 305 | if validate: |
| 306 | assert_not_equal(cip, None) |
| 307 | assert_not_equal(sip, None) |
| 308 | log.info('Got dhcp client IP %s from server %s for mac %s' % |
| 309 | (cip, sip, self.dhcp.get_mac(cip)[0])) |
| 310 | return cip,sip |
| 311 | |
Chetan Gaonker | cbe7964 | 2016-03-09 17:45:58 -0800 | [diff] [blame] | 312 | def onos_load_config(self, app, config): |
Chetan Gaonker | a2b87df | 2016-03-31 15:41:31 -0700 | [diff] [blame] | 313 | status, code = OnosCtrl.config(config) |
Chetan Gaonker | cbe7964 | 2016-03-09 17:45:58 -0800 | [diff] [blame] | 314 | if status is False: |
| 315 | log.info('JSON config request for app %s returned status %d' %(app, code)) |
| 316 | assert_equal(status, True) |
| 317 | time.sleep(2) |
| 318 | |
Chetan Gaonker | a58ab6e | 2016-03-23 15:04:20 -0700 | [diff] [blame] | 319 | def dhcp_sndrcv(self, dhcp, update_seed = False): |
| 320 | cip, sip = dhcp.discover(update_seed = update_seed) |
Chetan Gaonker | cbe7964 | 2016-03-09 17:45:58 -0800 | [diff] [blame] | 321 | assert_not_equal(cip, None) |
| 322 | assert_not_equal(sip, None) |
| 323 | log.info('Got dhcp client IP %s from server %s for mac %s' % |
Chetan Gaonker | a58ab6e | 2016-03-23 15:04:20 -0700 | [diff] [blame] | 324 | (cip, sip, dhcp.get_mac(cip)[0])) |
Chetan Gaonker | cbe7964 | 2016-03-09 17:45:58 -0800 | [diff] [blame] | 325 | return cip,sip |
| 326 | |
Chetan Gaonker | a58ab6e | 2016-03-23 15:04:20 -0700 | [diff] [blame] | 327 | def dhcp_request(self, subscriber, seed_ip = '10.10.10.1', update_seed = False): |
Chetan Gaonker | 0097120 | 2016-03-23 15:11:12 -0700 | [diff] [blame] | 328 | config = {'startip':'10.10.10.20', 'endip':'10.10.10.200', |
Chetan Gaonker | cbe7964 | 2016-03-09 17:45:58 -0800 | [diff] [blame] | 329 | 'ip':'10.10.10.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 330 | 'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'} |
| 331 | self.onos_dhcp_table_load(config) |
Chetan Gaonker | a58ab6e | 2016-03-23 15:04:20 -0700 | [diff] [blame] | 332 | dhcp = DHCPTest(seed_ip = seed_ip, iface = subscriber.iface) |
| 333 | cip, sip = self.dhcp_sndrcv(dhcp, update_seed = update_seed) |
Chetan Gaonker | cbe7964 | 2016-03-09 17:45:58 -0800 | [diff] [blame] | 334 | return cip, sip |
| 335 | |
| 336 | def recv_channel_cb(self, pkt): |
| 337 | ##First verify that we have received the packet for the joined instance |
| 338 | chan = self.subscriber.caddr(pkt[IP].dst) |
| 339 | assert_equal(chan in self.subscriber.join_map.keys(), True) |
| 340 | recv_time = monotonic.monotonic() * 1000000 |
| 341 | join_time = self.subscriber.join_map[chan][self.subscriber.STATS_JOIN].start |
| 342 | delta = recv_time - join_time |
| 343 | self.subscriber.join_rx_stats.update(packets=1, t = delta, usecs = True) |
| 344 | self.subscriber.channel_update(chan, self.subscriber.STATS_RX, 1, t = delta) |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 345 | log.debug('Packet received in %.3f usecs for group %s after join' %(delta, pkt[IP].dst)) |
Chetan Gaonker | cbe7964 | 2016-03-09 17:45:58 -0800 | [diff] [blame] | 346 | self.test_status = True |
| 347 | |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 348 | def tls_verify(self, subscriber): |
| 349 | if subscriber.has_service('TLS'): |
| 350 | time.sleep(2) |
| 351 | tls = TLSAuthTest() |
| 352 | log.info('Running subscriber %s tls auth test' %subscriber.name) |
| 353 | tls.runTest() |
| 354 | self.test_status = True |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 355 | return self.test_status |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 356 | |
| 357 | def dhcp_verify(self, subscriber): |
Chetan Gaonker | a58ab6e | 2016-03-23 15:04:20 -0700 | [diff] [blame] | 358 | cip, sip = self.dhcp_request(subscriber, update_seed = True) |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 359 | log.info('Subscriber %s got client ip %s from server %s' %(subscriber.name, cip, sip)) |
| 360 | subscriber.src_list = [cip] |
| 361 | self.test_status = True |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 362 | return self.test_status |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 363 | |
| 364 | def dhcp_jump_verify(self, subscriber): |
Chetan Gaonker | a58ab6e | 2016-03-23 15:04:20 -0700 | [diff] [blame] | 365 | cip, sip = self.dhcp_request(subscriber, seed_ip = '10.10.200.1') |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 366 | log.info('Subscriber %s got client ip %s from server %s' %(subscriber.name, cip, sip)) |
| 367 | subscriber.src_list = [cip] |
| 368 | self.test_status = True |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 369 | return self.test_status |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 370 | |
| 371 | def dhcp_next_verify(self, subscriber): |
Chetan Gaonker | a58ab6e | 2016-03-23 15:04:20 -0700 | [diff] [blame] | 372 | cip, sip = self.dhcp_request(subscriber, seed_ip = '10.10.150.1') |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 373 | log.info('Subscriber %s got client ip %s from server %s' %(subscriber.name, cip, sip)) |
| 374 | subscriber.src_list = [cip] |
| 375 | self.test_status = True |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 376 | return self.test_status |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 377 | |
| 378 | def igmp_verify(self, subscriber): |
| 379 | chan = 0 |
| 380 | if subscriber.has_service('IGMP'): |
| 381 | for i in range(5): |
| 382 | log.info('Joining channel %d for subscriber %s' %(chan, subscriber.name)) |
| 383 | subscriber.channel_join(chan, delay = 0) |
| 384 | subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 1) |
| 385 | log.info('Leaving channel %d for subscriber %s' %(chan, subscriber.name)) |
| 386 | subscriber.channel_leave(chan) |
| 387 | time.sleep(3) |
Chetan Gaonker | a58ab6e | 2016-03-23 15:04:20 -0700 | [diff] [blame] | 388 | log.info('Interface %s Join RX stats for subscriber %s, %s' %(subscriber.iface, subscriber.name,subscriber.join_rx_stats)) |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 389 | self.test_status = True |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 390 | return self.test_status |
| 391 | |
| 392 | def igmp_verify_multiChannel(self, subscriber): |
| 393 | if subscriber.has_service('IGMP'): |
| 394 | for chan in range(DEFAULT_NO_CHANNELS): |
| 395 | log.info('Joining channel %d for subscriber %s' %(chan, subscriber.name)) |
| 396 | subscriber.channel_join(chan, delay = 0) |
| 397 | subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 1) |
| 398 | log.info('Leaving channel %d for subscriber %s' %(chan, subscriber.name)) |
| 399 | subscriber.channel_leave(chan) |
| 400 | time.sleep(3) |
| 401 | log.info('Interface %s Join RX stats for subscriber %s, %s' %(subscriber.iface, subscriber.name,subscriber.join_rx_stats)) |
| 402 | self.test_status = True |
| 403 | return self.test_status |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 404 | |
| 405 | def igmp_jump_verify(self, subscriber): |
| 406 | if subscriber.has_service('IGMP'): |
| 407 | for i in xrange(subscriber.num): |
| 408 | log.info('Subscriber %s jumping channel' %subscriber.name) |
| 409 | chan = subscriber.channel_jump(delay=0) |
| 410 | subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 1) |
| 411 | log.info('Verified receive for channel %d, subscriber %s' %(chan, subscriber.name)) |
| 412 | time.sleep(3) |
Chetan Gaonker | a58ab6e | 2016-03-23 15:04:20 -0700 | [diff] [blame] | 413 | log.info('Interface %s Jump RX stats for subscriber %s, %s' %(subscriber.iface, subscriber.name, subscriber.join_rx_stats)) |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 414 | self.test_status = True |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 415 | return self.test_status |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 416 | |
| 417 | def igmp_next_verify(self, subscriber): |
| 418 | if subscriber.has_service('IGMP'): |
| 419 | for i in xrange(subscriber.num): |
| 420 | if i: |
| 421 | chan = subscriber.channel_join_next(delay=0) |
| 422 | else: |
| 423 | chan = subscriber.channel_join(i, delay=0) |
| 424 | log.info('Joined next channel %d for subscriber %s' %(chan, subscriber.name)) |
| 425 | subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count=1) |
| 426 | log.info('Verified receive for channel %d, subscriber %s' %(chan, subscriber.name)) |
| 427 | time.sleep(3) |
Chetan Gaonker | a58ab6e | 2016-03-23 15:04:20 -0700 | [diff] [blame] | 428 | log.info('Interface %s Join Next RX stats for subscriber %s, %s' %(subscriber.iface, subscriber.name, subscriber.join_rx_stats)) |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 429 | self.test_status = True |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 430 | return self.test_status |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 431 | |
Chetan Gaonker | 3d16385 | 2016-03-28 12:20:25 -0700 | [diff] [blame] | 432 | def generate_port_list(self, subscribers, channels): |
Chetan Gaonker | a58ab6e | 2016-03-23 15:04:20 -0700 | [diff] [blame] | 433 | port_list = [] |
Chetan Gaonker | 3d16385 | 2016-03-28 12:20:25 -0700 | [diff] [blame] | 434 | for i in xrange(subscribers): |
| 435 | if channels > 1: |
| 436 | rx_port = 2*i+1 |
| 437 | tx_port = 2*i+2 |
| 438 | else: |
| 439 | rx_port = Subscriber.PORT_RX_DEFAULT |
| 440 | tx_port = Subscriber.PORT_TX_DEFAULT |
Chetan Gaonker | a58ab6e | 2016-03-23 15:04:20 -0700 | [diff] [blame] | 441 | port_list.append((tx_port, rx_port)) |
| 442 | return port_list |
| 443 | |
| 444 | def subscriber_load(self, create = True, num = 10, num_channels = 1, channel_start = 0, port_list = []): |
Chetan Gaonker | 41d2e07 | 2016-03-15 16:41:31 -0700 | [diff] [blame] | 445 | '''Load the subscriber from the database''' |
| 446 | self.subscriber_db = SubscriberDB(create = create) |
| 447 | if create is True: |
| 448 | self.subscriber_db.generate(num) |
| 449 | self.subscriber_info = self.subscriber_db.read(num) |
| 450 | self.subscriber_list = [] |
Chetan Gaonker | a58ab6e | 2016-03-23 15:04:20 -0700 | [diff] [blame] | 451 | if not port_list: |
Chetan Gaonker | 3d16385 | 2016-03-28 12:20:25 -0700 | [diff] [blame] | 452 | port_list = self.generate_port_list(num, num_channels) |
Chetan Gaonker | a58ab6e | 2016-03-23 15:04:20 -0700 | [diff] [blame] | 453 | |
| 454 | index = 0 |
Chetan Gaonker | 41d2e07 | 2016-03-15 16:41:31 -0700 | [diff] [blame] | 455 | for info in self.subscriber_info: |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 456 | self.subscriber_list.append(Subscriber(name=info['Name'], |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 457 | service=info['Service'], |
Chetan Gaonker | 7997bb4 | 2016-03-28 09:46:15 -0700 | [diff] [blame] | 458 | port_map = self.port_map, |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 459 | num=num_channels, |
Chetan Gaonker | a58ab6e | 2016-03-23 15:04:20 -0700 | [diff] [blame] | 460 | channel_start = channel_start, |
| 461 | tx_port = port_list[index][0], |
| 462 | rx_port = port_list[index][1])) |
Chetan Gaonker | 3d16385 | 2016-03-28 12:20:25 -0700 | [diff] [blame] | 463 | if num_channels > 1: |
| 464 | channel_start += num_channels |
Chetan Gaonker | a58ab6e | 2016-03-23 15:04:20 -0700 | [diff] [blame] | 465 | index += 1 |
| 466 | |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 467 | #load the ssm list for all subscriber channels |
| 468 | igmpChannel = IgmpChannel() |
| 469 | ssm_groups = map(lambda sub: sub.channels, self.subscriber_list) |
| 470 | ssm_list = reduce(lambda ssm1, ssm2: ssm1+ssm2, ssm_groups) |
| 471 | igmpChannel.igmp_load_ssm_config(ssm_list) |
Chetan Gaonker | a58ab6e | 2016-03-23 15:04:20 -0700 | [diff] [blame] | 472 | #load the subscriber to mcast port map for cord |
| 473 | cord_port_map = {} |
| 474 | for sub in self.subscriber_list: |
| 475 | for chan in sub.channels: |
| 476 | cord_port_map[chan] = (sub.tx_port, sub.rx_port) |
| 477 | |
| 478 | igmpChannel.cord_port_table_load(cord_port_map) |
Chetan Gaonker | 41d2e07 | 2016-03-15 16:41:31 -0700 | [diff] [blame] | 479 | |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 480 | def subscriber_join_verify( self, num_subscribers = 10, num_channels = 1, |
| 481 | channel_start = 0, cbs = None, port_list = [], negative_subscriber_auth = None): |
Chetan Gaonker | cbe7964 | 2016-03-09 17:45:58 -0800 | [diff] [blame] | 482 | self.test_status = False |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 483 | self.num_subscribers = num_subscribers |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 484 | self.sub_loop_count = num_subscribers |
Chetan Gaonker | 7997bb4 | 2016-03-28 09:46:15 -0700 | [diff] [blame] | 485 | self.subscriber_load(create = True, num = num_subscribers, |
Chetan Gaonker | a58ab6e | 2016-03-23 15:04:20 -0700 | [diff] [blame] | 486 | num_channels = num_channels, channel_start = channel_start, port_list = port_list) |
Chetan Gaonker | 55fc788 | 2016-03-15 17:46:47 -0700 | [diff] [blame] | 487 | self.onos_aaa_load() |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 488 | self.thread_pool = ThreadPool(min(100, self.num_subscribers), queue_size=1, wait_timeout=1) |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 489 | |
| 490 | if cbs and negative_subscriber_auth is None: |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 491 | cbs = (self.tls_verify, self.dhcp_verify, self.igmp_verify) |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 492 | cbs_negative = cbs |
Chetan Gaonker | 41d2e07 | 2016-03-15 16:41:31 -0700 | [diff] [blame] | 493 | for subscriber in self.subscriber_list: |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 494 | subscriber.start() |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 495 | if negative_subscriber_auth is 'half' and self.sub_loop_count%2 is not 0: |
| 496 | cbs = (self.tls_verify, self.dhcp_verify, self.igmp_verify) |
| 497 | elif negative_subscriber_auth is 'onethird' and self.sub_loop_count%3 is not 0: |
| 498 | cbs = (self.tls_verify, self.dhcp_verify, self.igmp_verify) |
| 499 | else: |
| 500 | cbs = cbs_negative |
| 501 | self.sub_loop_count = self.sub_loop_count - 1 |
| 502 | pool_object = subscriber_pool(subscriber, cbs, self.test_status) |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 503 | self.thread_pool.addTask(pool_object.pool_cb) |
| 504 | self.thread_pool.cleanUpThreads() |
| 505 | for subscriber in self.subscriber_list: |
| 506 | subscriber.stop() |
ChetanGaonker | 5b984cb | 2016-07-12 15:50:49 -0700 | [diff] [blame] | 507 | print "self.test_status %s\n"%(self.test_status) |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 508 | return self.test_status |
Chetan Gaonker | cbe7964 | 2016-03-09 17:45:58 -0800 | [diff] [blame] | 509 | |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 510 | def tls_invalid_cert(self, subscriber): |
| 511 | if subscriber.has_service('TLS'): |
| 512 | time.sleep(2) |
| 513 | log.info('Running subscriber %s tls auth test' %subscriber.name) |
| 514 | tls = TLSAuthTest(client_cert = self.CLIENT_CERT_INVALID) |
| 515 | tls.runTest() |
| 516 | if tls.failTest == True: |
| 517 | self.test_status = False |
| 518 | return self.test_status |
| 519 | |
| 520 | def tls_no_cert(self, subscriber): |
| 521 | if subscriber.has_service('TLS'): |
| 522 | time.sleep(2) |
| 523 | log.info('Running subscriber %s tls auth test' %subscriber.name) |
| 524 | tls = TLSAuthTest(client_cert = '') |
| 525 | tls.runTest() |
| 526 | if tls.failTest == True: |
| 527 | self.test_status = False |
| 528 | return self.test_status |
| 529 | |
| 530 | def tls_self_signed_cert(self, subscriber): |
| 531 | if subscriber.has_service('TLS'): |
| 532 | time.sleep(2) |
| 533 | log.info('Running subscriber %s tls auth test' %subscriber.name) |
| 534 | tls = TLSAuthTest(client_cert = self.CLIENT_CERT) |
| 535 | tls.runTest() |
| 536 | if tls.failTest == False: |
| 537 | self.test_status = True |
| 538 | return self.test_status |
| 539 | |
| 540 | def tls_Nsubscribers_use_same_valid_cert(self, subscriber): |
| 541 | if subscriber.has_service('TLS'): |
| 542 | time.sleep(2) |
| 543 | log.info('Running subscriber %s tls auth test' %subscriber.name) |
| 544 | num_users = 3 |
| 545 | for i in xrange(num_users): |
| 546 | tls = TLSAuthTest(intf = 'veth{}'.format(i*2)) |
| 547 | tls.runTest() |
| 548 | if tls.failTest == False: |
| 549 | self.test_status = True |
| 550 | return self.test_status |
| 551 | |
| 552 | def dhcp_discover_scenario(self, subscriber): |
| 553 | if subscriber.has_service('DHCP'): |
| 554 | time.sleep(2) |
| 555 | log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name) |
| 556 | t1 = self.subscriber_dhcp_1release() |
| 557 | self.test_status = True |
| 558 | return self.test_status |
| 559 | |
| 560 | def subscriber_dhcp_1release(self, iface = INTF_RX_DEFAULT): |
| 561 | config = {'startip':'10.10.100.20', 'endip':'10.10.100.21', |
| 562 | 'ip':'10.10.100.2', 'mac': "ca:fe:ca:fe:8a:fe", |
| 563 | 'subnet': '255.255.255.0', 'broadcast':'10.10.100.255', 'router':'10.10.100.1'} |
| 564 | self.onos_dhcp_table_load(config) |
| 565 | self.dhcp = DHCPTest(seed_ip = '10.10.100.10', iface = iface) |
| 566 | cip, sip = self.send_recv() |
| 567 | log.info('Releasing ip %s to server %s' %(cip, sip)) |
| 568 | assert_equal(self.dhcp.release(cip), True) |
| 569 | log.info('Triggering DHCP discover again after release') |
| 570 | cip2, sip2 = self.send_recv(update_seed = True) |
| 571 | log.info('Verifying released IP was given back on rediscover') |
| 572 | assert_equal(cip, cip2) |
| 573 | log.info('Test done. Releasing ip %s to server %s' %(cip2, sip2)) |
| 574 | assert_equal(self.dhcp.release(cip2), True) |
| 575 | |
| 576 | |
| 577 | def dhcp_client_reboot_scenario(self, subscriber): |
| 578 | if subscriber.has_service('DHCP'): |
| 579 | time.sleep(2) |
| 580 | log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name) |
| 581 | tl = self.subscriber_dhcp_client_request_after_reboot() |
| 582 | self.test_status = True |
| 583 | return self.test_status |
| 584 | |
| 585 | def subscriber_dhcp_client_request_after_reboot(self, iface = INTF_RX_DEFAULT): |
| 586 | #''' Client sends DHCP Request after reboot.''' |
| 587 | |
| 588 | config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', |
| 589 | 'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 590 | 'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'} |
| 591 | self.onos_dhcp_table_load(config) |
| 592 | self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface) |
| 593 | cip, sip, mac, lval = self.dhcp.only_discover() |
| 594 | log.info('Got dhcp client IP %s from server %s for mac %s .' % |
| 595 | (cip, sip, mac) ) |
| 596 | |
| 597 | log.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.") |
| 598 | |
| 599 | if (cip == None and mac != None): |
| 600 | log.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.") |
| 601 | assert_not_equal(cip, None) |
| 602 | |
| 603 | else: |
| 604 | new_cip, new_sip = self.dhcp.only_request(cip, mac) |
| 605 | if new_cip == None: |
| 606 | log.info("Got DHCP server NAK.") |
| 607 | os.system('ifconfig '+iface+' down') |
| 608 | log.info('Client goes down.') |
| 609 | log.info('Delay for 5 seconds.') |
| 610 | |
| 611 | time.sleep(5) |
| 612 | |
| 613 | os.system('ifconfig '+iface+' up') |
| 614 | log.info('Client is up now.') |
| 615 | |
| 616 | new_cip, new_sip = self.dhcp.only_request(cip, mac) |
| 617 | if new_cip == None: |
| 618 | log.info("Got DHCP server NAK.") |
| 619 | assert_not_equal(new_cip, None) |
| 620 | elif new_cip != None: |
| 621 | log.info("Got DHCP ACK.") |
| 622 | |
| 623 | |
| 624 | def dhcp_client_renew_scenario(self, subscriber): |
| 625 | if subscriber.has_service('DHCP'): |
| 626 | time.sleep(2) |
| 627 | log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name) |
| 628 | tl = self.subscriber_dhcp_client_renew_time() |
| 629 | self.test_status = True |
| 630 | return self.test_status |
| 631 | |
| 632 | def subscriber_dhcp_client_renew_time(self, iface = INTF_RX_DEFAULT): |
| 633 | config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', |
| 634 | 'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 635 | 'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'} |
| 636 | self.onos_dhcp_table_load(config) |
| 637 | self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface) |
| 638 | cip, sip, mac , lval = self.dhcp.only_discover() |
| 639 | log.info('Got dhcp client IP %s from server %s for mac %s .' % |
| 640 | (cip, sip, mac) ) |
| 641 | |
| 642 | log.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.") |
| 643 | if (cip == None and mac != None): |
| 644 | log.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.") |
| 645 | assert_not_equal(cip, None) |
| 646 | elif cip and sip and mac: |
| 647 | log.info("Triggering DHCP Request.") |
| 648 | new_cip, new_sip, lval = self.dhcp.only_request(cip, mac, renew_time = True) |
| 649 | if new_cip and new_sip and lval: |
| 650 | log.info("Client 's Renewal time is :%s",lval) |
| 651 | log.info("Generating delay till renewal time.") |
| 652 | time.sleep(lval) |
| 653 | log.info("Client Sending Unicast DHCP request.") |
| 654 | latest_cip, latest_sip = self.dhcp.only_request(new_cip, mac, unicast = True) |
| 655 | if latest_cip and latest_sip: |
| 656 | log.info("Got DHCP Ack. Lease Renewed for ip %s and mac %s from server %s." % |
| 657 | (latest_cip, mac, latest_sip) ) |
| 658 | |
| 659 | elif latest_cip == None: |
| 660 | log.info("Got DHCP NAK. Lease not renewed.") |
| 661 | elif new_cip == None or new_sip == None or lval == None: |
| 662 | log.info("Got DHCP NAK.") |
| 663 | |
| 664 | |
| 665 | def dhcp_server_reboot_scenario(self, subscriber): |
| 666 | if subscriber.has_service('DHCP'): |
| 667 | time.sleep(2) |
| 668 | log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name) |
| 669 | tl = self.subscriber_dhcp_server_after_reboot() |
| 670 | self.test_status = True |
| 671 | return self.test_status |
| 672 | |
| 673 | def subscriber_dhcp_server_after_reboot(self, iface = INTF_RX_DEFAULT): |
| 674 | ''' DHCP server goes down.''' |
| 675 | config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', |
| 676 | 'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 677 | 'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'} |
| 678 | self.onos_dhcp_table_load(config) |
| 679 | self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface) |
| 680 | cip, sip, mac, lval = self.dhcp.only_discover() |
| 681 | log.info('Got dhcp client IP %s from server %s for mac %s .' % |
| 682 | (cip, sip, mac) ) |
| 683 | log.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.") |
| 684 | if (cip == None and mac != None): |
| 685 | log.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.") |
| 686 | assert_not_equal(cip, None) |
| 687 | else: |
| 688 | new_cip, new_sip = self.dhcp.only_request(cip, mac) |
| 689 | if new_cip == None: |
| 690 | log.info("Got DHCP server NAK.") |
| 691 | assert_not_equal(new_cip, None) |
| 692 | log.info('Getting DHCP server Down.') |
| 693 | onos_ctrl = OnosCtrl(self.dhcp_app) |
| 694 | onos_ctrl.deactivate() |
| 695 | for i in range(0,4): |
| 696 | log.info("Sending DHCP Request.") |
| 697 | log.info('') |
| 698 | new_cip, new_sip = self.dhcp.only_request(cip, mac) |
| 699 | if new_cip == None and new_sip == None: |
| 700 | log.info('') |
| 701 | log.info("DHCP Request timed out.") |
| 702 | elif new_cip and new_sip: |
| 703 | log.info("Got Reply from DHCP server.") |
| 704 | assert_equal(new_cip,None) #Neagtive Test Case |
| 705 | log.info('Getting DHCP server Up.') |
| 706 | # self.activate_apps(self.dhcp_app) |
| 707 | onos_ctrl = OnosCtrl(self.dhcp_app) |
| 708 | status, _ = onos_ctrl.activate() |
| 709 | assert_equal(status, True) |
| 710 | time.sleep(3) |
| 711 | for i in range(0,4): |
| 712 | log.info("Sending DHCP Request after DHCP server is up.") |
| 713 | log.info('') |
| 714 | new_cip, new_sip = self.dhcp.only_request(cip, mac) |
| 715 | if new_cip == None and new_sip == None: |
| 716 | log.info('') |
| 717 | log.info("DHCP Request timed out.") |
| 718 | elif new_cip and new_sip: |
| 719 | log.info("Got Reply from DHCP server.") |
| 720 | assert_equal(new_cip,None) #Neagtive Test Case |
| 721 | |
| 722 | def dhcp_client_rebind_scenario(self, subscriber): |
| 723 | if subscriber.has_service('DHCP'): |
| 724 | time.sleep(2) |
| 725 | log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name) |
| 726 | tl = self.subscriber_dhcp_client_rebind_time() |
| 727 | self.test_status = True |
| 728 | return self.test_status |
| 729 | |
| 730 | def subscriber_dhcp_client_rebind_time(self, iface = INTF_RX_DEFAULT): |
| 731 | config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', |
| 732 | 'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 733 | 'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'} |
| 734 | self.onos_dhcp_table_load(config) |
| 735 | self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface) |
| 736 | cip, sip, mac, lval = self.dhcp.only_discover() |
| 737 | log.info('Got dhcp client IP %s from server %s for mac %s .' % |
| 738 | (cip, sip, mac) ) |
| 739 | log.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.") |
| 740 | if (cip == None and mac != None): |
| 741 | log.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.") |
| 742 | assert_not_equal(cip, None) |
| 743 | elif cip and sip and mac: |
| 744 | log.info("Triggering DHCP Request.") |
| 745 | new_cip, new_sip, lval = self.dhcp.only_request(cip, mac, rebind_time = True) |
| 746 | if new_cip and new_sip and lval: |
| 747 | log.info("Client 's Rebind time is :%s",lval) |
| 748 | log.info("Generating delay till rebind time.") |
| 749 | time.sleep(lval) |
| 750 | log.info("Client Sending broadcast DHCP requests for renewing lease or for getting new ip.") |
| 751 | self.dhcp.after_T2 = True |
| 752 | for i in range(0,4): |
| 753 | latest_cip, latest_sip = self.dhcp.only_request(new_cip, mac) |
| 754 | if latest_cip and latest_sip: |
| 755 | log.info("Got DHCP Ack. Lease Renewed for ip %s and mac %s from server %s." % |
| 756 | (latest_cip, mac, latest_sip) ) |
| 757 | break |
| 758 | elif latest_cip == None: |
| 759 | log.info("Got DHCP NAK. Lease not renewed.") |
| 760 | assert_not_equal(latest_cip, None) |
| 761 | elif new_cip == None or new_sip == None or lval == None: |
| 762 | log.info("Got DHCP NAK.Lease not Renewed.") |
| 763 | |
| 764 | def dhcp_starvation_scenario(self, subscriber): |
| 765 | if subscriber.has_service('DHCP'): |
| 766 | time.sleep(2) |
| 767 | log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name) |
| 768 | tl = self.subscriber_dhcp_starvation() |
| 769 | self.test_status = True |
| 770 | return self.test_status |
| 771 | |
| 772 | |
| 773 | def subscriber_dhcp_starvation(self, iface = INTF_RX_DEFAULT): |
| 774 | '''DHCP starve''' |
| 775 | config = {'startip':'182.17.0.20', 'endip':'182.17.0.69', |
| 776 | 'ip':'182.17.0.2', 'mac': "ca:fe:c3:fe:ca:fe", |
| 777 | 'subnet': '255.255.255.0', 'broadcast':'182.17.0.255', 'router':'182.17.0.1'} |
| 778 | self.onos_dhcp_table_load(config) |
| 779 | self.dhcp = DHCPTest(seed_ip = '182.17.0.1', iface = iface) |
| 780 | log.info('Verifying 1 ') |
| 781 | for x in xrange(50): |
| 782 | mac = RandMAC()._fix() |
| 783 | self.send_recv(mac = mac) |
| 784 | log.info('Verifying 2 ') |
| 785 | cip, sip = self.send_recv(update_seed = True, validate = False) |
| 786 | assert_equal(cip, None) |
| 787 | assert_equal(sip, None) |
| 788 | |
| 789 | def dhcp_same_client_multi_discovers_scenario(self, subscriber): |
| 790 | if subscriber.has_service('DHCP'): |
| 791 | time.sleep(2) |
| 792 | log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name) |
| 793 | tl = self.subscriber_dhcp_same_client_multiple_discover() |
| 794 | self.test_status = True |
| 795 | return self.test_status |
| 796 | |
| 797 | |
| 798 | def subscriber_dhcp_same_client_multiple_discover(self, iface = INTF_RX_DEFAULT): |
| 799 | ''' DHCP Client sending multiple discover . ''' |
| 800 | config = {'startip':'10.10.10.20', 'endip':'10.10.10.69', |
| 801 | 'ip':'10.10.10.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 802 | 'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'} |
| 803 | self.onos_dhcp_table_load(config) |
| 804 | self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = iface) |
| 805 | cip, sip, mac, lval = self.dhcp.only_discover() |
| 806 | log.info('Got dhcp client IP %s from server %s for mac %s . Not going to send DHCPREQUEST.' % |
| 807 | (cip, sip, mac) ) |
| 808 | log.info('Triggering DHCP discover again.') |
| 809 | new_cip, new_sip, new_mac , lval = self.dhcp.only_discover() |
| 810 | if cip == new_cip: |
| 811 | log.info('Got same ip for 2nd DHCP discover for client IP %s from server %s for mac %s. Triggering DHCP Request. ' |
| 812 | % (new_cip, new_sip, new_mac) ) |
| 813 | elif cip != new_cip: |
| 814 | log.info('Ip after 1st discover %s' %cip) |
| 815 | log.info('Map after 2nd discover %s' %new_cip) |
| 816 | assert_equal(cip, new_cip) |
| 817 | |
| 818 | def dhcp_same_client_multi_request_scenario(self, subscriber): |
| 819 | if subscriber.has_service('DHCP'): |
| 820 | time.sleep(2) |
| 821 | log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name) |
| 822 | tl = self.subscriber_dhcp_same_client_multiple_request() |
| 823 | self.test_status = True |
| 824 | return self.test_status |
| 825 | |
| 826 | def subscriber_dhcp_same_client_multiple_request(self, iface = INTF_RX_DEFAULT): |
| 827 | ''' DHCP Client sending multiple repeat DHCP requests. ''' |
| 828 | config = {'startip':'10.10.10.20', 'endip':'10.10.10.69', |
| 829 | 'ip':'10.10.10.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 830 | 'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'} |
| 831 | self.onos_dhcp_table_load(config) |
| 832 | self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = iface) |
| 833 | log.info('Sending DHCP discover and DHCP request.') |
| 834 | cip, sip = self.send_recv() |
| 835 | mac = self.dhcp.get_mac(cip)[0] |
| 836 | log.info("Sending DHCP request again.") |
| 837 | new_cip, new_sip = self.dhcp.only_request(cip, mac) |
| 838 | if (new_cip,new_sip) == (cip,sip): |
| 839 | log.info('Got same ip for 2nd DHCP Request for client IP %s from server %s for mac %s.' |
| 840 | % (new_cip, new_sip, mac) ) |
| 841 | elif (new_cip,new_sip): |
| 842 | log.info('No DHCP ACK') |
| 843 | assert_equal(new_cip, None) |
| 844 | assert_equal(new_sip, None) |
| 845 | else: |
| 846 | print "Something went wrong." |
| 847 | |
| 848 | |
| 849 | def dhcp_client_desired_ip_scenario(self, subscriber): |
| 850 | if subscriber.has_service('DHCP'): |
| 851 | time.sleep(2) |
| 852 | log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name) |
| 853 | tl = self.subscriber_dhcp_client_desired_address() |
| 854 | self.test_status = True |
| 855 | return self.test_status |
| 856 | |
| 857 | def subscriber_dhcp_client_desired_address(self, iface = INTF_RX_DEFAULT): |
| 858 | '''DHCP Client asking for desired IP address.''' |
| 859 | config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', |
| 860 | 'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 861 | 'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'} |
| 862 | self.onos_dhcp_table_load(config) |
| 863 | self.dhcp = DHCPTest(seed_ip = '20.20.20.31', iface = iface) |
| 864 | cip, sip, mac , lval = self.dhcp.only_discover(desired = True) |
| 865 | log.info('Got dhcp client IP %s from server %s for mac %s .' % |
| 866 | (cip, sip, mac) ) |
| 867 | if cip == self.dhcp.seed_ip: |
| 868 | log.info('Got dhcp client IP %s from server %s for mac %s as desired .' % |
| 869 | (cip, sip, mac) ) |
| 870 | elif cip != self.dhcp.seed_ip: |
| 871 | log.info('Got dhcp client IP %s from server %s for mac %s .' % |
| 872 | (cip, sip, mac) ) |
| 873 | log.info('The desired ip was: %s .' % self.dhcp.seed_ip) |
| 874 | assert_equal(cip, self.dhcp.seed_ip) |
| 875 | |
| 876 | def dhcp_client_request_pkt_with_non_offered_ip_scenario(self, subscriber): |
| 877 | if subscriber.has_service('DHCP'): |
| 878 | time.sleep(2) |
| 879 | log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name) |
| 880 | tl = self.subscriber_dhcp_server_nak_packet() |
| 881 | self.test_status = True |
| 882 | return self.test_status |
| 883 | |
| 884 | def subscriber_dhcp_server_nak_packet(self, iface = INTF_RX_DEFAULT): |
| 885 | config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', |
| 886 | 'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 887 | 'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'} |
| 888 | self.onos_dhcp_table_load(config) |
| 889 | self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface) |
| 890 | cip, sip, mac, lval = self.dhcp.only_discover() |
| 891 | log.info('Got dhcp client IP %s from server %s for mac %s .' % |
| 892 | (cip, sip, mac) ) |
| 893 | log.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.") |
| 894 | if (cip == None and mac != None): |
| 895 | log.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.") |
| 896 | assert_not_equal(cip, None) |
| 897 | else: |
| 898 | new_cip, new_sip = self.dhcp.only_request('20.20.20.31', mac) |
| 899 | if new_cip == None: |
| 900 | log.info("Got DHCP server NAK.") |
| 901 | assert_equal(new_cip, None) #Negative Test Case |
| 902 | |
| 903 | def dhcp_client_requested_out_pool_ip_scenario(self, subscriber): |
| 904 | if subscriber.has_service('DHCP'): |
| 905 | time.sleep(2) |
| 906 | log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name) |
| 907 | tl = self.subscriber_dhcp_client_desired_address_out_of_pool() |
| 908 | self.test_status = True |
| 909 | return self.test_status |
| 910 | |
| 911 | |
| 912 | def subscriber_dhcp_client_desired_address_out_of_pool(self, iface = INTF_RX_DEFAULT): |
| 913 | '''DHCP Client asking for desired IP address from out of pool.''' |
| 914 | config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', |
| 915 | 'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 916 | 'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'} |
| 917 | self.onos_dhcp_table_load(config) |
| 918 | self.dhcp = DHCPTest(seed_ip = '20.20.20.35', iface = iface) |
| 919 | cip, sip, mac, lval = self.dhcp.only_discover(desired = True) |
| 920 | log.info('Got dhcp client IP %s from server %s for mac %s .' % |
| 921 | (cip, sip, mac) ) |
| 922 | if cip == self.dhcp.seed_ip: |
| 923 | log.info('Got dhcp client IP %s from server %s for mac %s as desired .' % |
| 924 | (cip, sip, mac) ) |
| 925 | assert_equal(cip, self.dhcp.seed_ip) #Negative Test Case |
| 926 | |
| 927 | elif cip != self.dhcp.seed_ip: |
| 928 | log.info('Got dhcp client IP %s from server %s for mac %s .' % |
| 929 | (cip, sip, mac) ) |
| 930 | log.info('The desired ip was: %s .' % self.dhcp.seed_ip) |
| 931 | assert_not_equal(cip, self.dhcp.seed_ip) |
| 932 | |
| 933 | elif cip == None: |
| 934 | log.info('Got DHCP NAK') |
| 935 | |
| 936 | |
| 937 | def dhcp_client_specific_lease_scenario(self, subscriber): |
| 938 | if subscriber.has_service('DHCP'): |
| 939 | time.sleep(2) |
| 940 | log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name) |
| 941 | tl = self.subscriber_dhcp_specific_lease_packet() |
| 942 | self.test_status = True |
| 943 | return self.test_status |
| 944 | |
| 945 | def subscriber_dhcp_specific_lease_packet(self, iface = INTF_RX_DEFAULT): |
| 946 | ''' Client sends DHCP Discover packet for particular lease time.''' |
| 947 | config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', |
| 948 | 'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 949 | 'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'} |
| 950 | self.onos_dhcp_table_load(config) |
| 951 | self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface) |
| 952 | log.info('Sending DHCP discover with lease time of 700') |
| 953 | cip, sip, mac, lval = self.dhcp.only_discover(lease_time = True) |
| 954 | |
| 955 | log.info("Verifying Client 's IP and mac in DHCP Offer packet.") |
| 956 | if (cip == None and mac != None): |
| 957 | log.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.") |
| 958 | assert_not_equal(cip, None) |
| 959 | elif lval != 700: |
| 960 | log.info('Getting dhcp client IP %s from server %s for mac %s with lease time %s. That is not 700.' % |
| 961 | (cip, sip, mac, lval) ) |
| 962 | assert_not_equal(lval, 700) |
| 963 | |
| 964 | def test_subscriber_join_recv_channel(self): |
| 965 | ###"""Test subscriber join and receive""" |
| 966 | num_subscribers = 1 |
Chetan Gaonker | 3d16385 | 2016-03-28 12:20:25 -0700 | [diff] [blame] | 967 | num_channels = 1 |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 968 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
Chetan Gaonker | 3d16385 | 2016-03-28 12:20:25 -0700 | [diff] [blame] | 969 | num_channels = num_channels, |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 970 | cbs = (self.tls_verify, self.dhcp_verify, self.igmp_verify), |
Chetan Gaonker | 3d16385 | 2016-03-28 12:20:25 -0700 | [diff] [blame] | 971 | port_list = self.generate_port_list(num_subscribers, num_channels)) |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 972 | assert_equal(test_status, True) |
Chetan Gaonker | cbe7964 | 2016-03-09 17:45:58 -0800 | [diff] [blame] | 973 | |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 974 | def test_subscriber_join_jump_channel(self): |
| 975 | ###"""Test subscriber join and receive for channel surfing""" |
| 976 | num_subscribers = 1 |
| 977 | num_channels = 1 |
| 978 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
Chetan Gaonker | 3d16385 | 2016-03-28 12:20:25 -0700 | [diff] [blame] | 979 | num_channels = num_channels, |
Chetan Gaonker | a58ab6e | 2016-03-23 15:04:20 -0700 | [diff] [blame] | 980 | cbs = (self.tls_verify, self.dhcp_jump_verify, self.igmp_jump_verify), |
Chetan Gaonker | 3d16385 | 2016-03-28 12:20:25 -0700 | [diff] [blame] | 981 | port_list = self.generate_port_list(num_subscribers, num_channels)) |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 982 | assert_equal(test_status, True) |
Chetan Gaonker | 4b959fc | 2016-03-09 19:20:16 -0800 | [diff] [blame] | 983 | |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 984 | def test_subscriber_join_next_channel(self): |
| 985 | ###"""Test subscriber join next for channels""" |
| 986 | num_subscribers = 1 |
| 987 | num_channels = 1 |
| 988 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
Chetan Gaonker | 3d16385 | 2016-03-28 12:20:25 -0700 | [diff] [blame] | 989 | num_channels = num_channels, |
Chetan Gaonker | a58ab6e | 2016-03-23 15:04:20 -0700 | [diff] [blame] | 990 | cbs = (self.tls_verify, self.dhcp_next_verify, self.igmp_next_verify), |
Chetan Gaonker | 3d16385 | 2016-03-28 12:20:25 -0700 | [diff] [blame] | 991 | port_list = self.generate_port_list(num_subscribers, num_channels)) |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 992 | assert_equal(test_status, True) |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 993 | |
| 994 | #@deferred(SUBSCRIBER_TIMEOUT) |
| 995 | def test_subscriber_authentication_with_invalid_certificate_and_channel_surfing(self): |
| 996 | ### """Test subscriber to auth with invalidCertification and join channel""" |
| 997 | num_subscribers = 1 |
| 998 | num_channels = 1 |
| 999 | df = defer.Deferred() |
| 1000 | def sub_auth_invalid_cert(df): |
| 1001 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1002 | num_channels = num_channels, |
| 1003 | cbs = (self.tls_invalid_cert, self.dhcp_verify, self.igmp_verify), |
| 1004 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1005 | assert_equal(test_status, False) |
| 1006 | df.callback(0) |
| 1007 | reactor.callLater(0, sub_auth_invalid_cert, df) |
| 1008 | return df |
| 1009 | |
| 1010 | |
| 1011 | #@deferred(SUBSCRIBER_TIMEOUT) |
| 1012 | def test_subscriber_authentication_with_no_certificate_and_channel_surfing(self): |
| 1013 | ### """Test subscriber to auth with No Certification and join channel""" |
| 1014 | num_subscribers = 1 |
| 1015 | num_channels = 1 |
| 1016 | df = defer.Deferred() |
| 1017 | def sub_auth_no_cert(df): |
| 1018 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1019 | num_channels = num_channels, |
| 1020 | cbs = (self.tls_no_cert, self.dhcp_verify, self.igmp_verify), |
| 1021 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1022 | negative_subscriber_auth = 'all') |
| 1023 | assert_equal(test_status, False) |
| 1024 | df.callback(0) |
| 1025 | reactor.callLater(0, sub_auth_no_cert, df) |
| 1026 | return df |
| 1027 | |
| 1028 | def test_subscriber_authentication_with_self_signed_certificate_and_channel_surfing(self): |
| 1029 | ### """Test subscriber to auth with Self Signed Certification and join channel""" |
| 1030 | num_subscribers = 1 |
| 1031 | num_channels = 1 |
| 1032 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1033 | num_channels = num_channels, |
| 1034 | cbs = (self.tls_self_signed_cert, self.dhcp_verify, self.igmp_verify), |
| 1035 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1036 | negative_subscriber_auth = 'all') |
| 1037 | assert_equal(test_status, True) |
| 1038 | |
| 1039 | def test_subscriber_authentication_with_dhcp_discover_and_channel_surfing(self): |
| 1040 | ### """Test subscriber auth success, DHCP re-discover with DHCP server and join channel""" |
| 1041 | num_subscribers = 1 |
| 1042 | num_channels = 1 |
| 1043 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1044 | num_channels = num_channels, |
| 1045 | cbs = (self.tls_verify, self.dhcp_discover_scenario, self.igmp_verify), |
| 1046 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1047 | assert_equal(test_status, True) |
| 1048 | |
| 1049 | def test_subscriber_authentication_with_dhcp_client_reboot_scenario_and_channel_surfing(self): |
| 1050 | ### """Test subscriber auth success, DHCP client got re-booted and join channel""" |
| 1051 | num_subscribers = 1 |
| 1052 | num_channels = 1 |
| 1053 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1054 | num_channels = num_channels, |
| 1055 | cbs = (self.tls_verify, self.dhcp_client_reboot_scenario, self.igmp_verify), |
| 1056 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1057 | assert_equal(test_status, True) |
| 1058 | |
| 1059 | def test_subscriber_authentication_with_dhcp_server_reboot_scenario_and_channel_surfing(self): |
| 1060 | ### """Test subscriber auth , DHCP server re-boot during DHCP process and join channel""" |
| 1061 | num_subscribers = 1 |
| 1062 | num_channels = 1 |
| 1063 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1064 | num_channels = num_channels, |
| 1065 | cbs = (self.tls_verify, self.dhcp_server_reboot_scenario, self.igmp_verify), |
| 1066 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1067 | assert_equal(test_status, True) |
| 1068 | |
| 1069 | def test_subscriber_authentication_with_dhcp_client_rebind_and_channel_surfing(self): |
| 1070 | ### """Test subscriber auth , DHCP client rebind IP and join channel""" |
| 1071 | num_subscribers = 1 |
| 1072 | num_channels = 1 |
| 1073 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1074 | num_channels = num_channels, |
| 1075 | cbs = (self.tls_verify, self.dhcp_client_rebind_scenario, self.igmp_verify), |
| 1076 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1077 | assert_equal(test_status, True) |
| 1078 | |
| 1079 | |
| 1080 | def test_subscriber_authentication_with_dhcp_starvation_scenario_and_channel_surfing(self): |
| 1081 | ### """Test subscriber auth , DHCP starvation and join channel""" |
| 1082 | num_subscribers = 1 |
| 1083 | num_channels = 1 |
| 1084 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1085 | num_channels = num_channels, |
| 1086 | cbs = (self.tls_verify, self.dhcp_starvation_scenario, self.igmp_verify), |
| 1087 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1088 | assert_equal(test_status, True) |
| 1089 | |
| 1090 | def test_subscriber_authentication_with_multiple_dhcp_discover_for_same_subscriber_and_channel_surfing(self): |
| 1091 | ### """Test subscriber auth , sending same DHCP client discover multiple times and join channel""" |
| 1092 | num_subscribers = 1 |
| 1093 | num_channels = 1 |
| 1094 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1095 | num_channels = num_channels, |
| 1096 | cbs = (self.tls_verify, self.dhcp_same_client_multi_discovers_scenario, self.igmp_verify), |
| 1097 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1098 | assert_equal(test_status, True) |
| 1099 | |
| 1100 | def test_subscriber_authentication_with_multiple_dhcp_request_for_same_subscriber_and_channel_surfing(self): |
| 1101 | ### """Test subscriber auth , same DHCP client multiple requerts times and join channel""" |
| 1102 | num_subscribers = 1 |
| 1103 | num_channels = 1 |
| 1104 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1105 | num_channels = num_channels, |
| 1106 | cbs = (self.tls_verify, self.dhcp_same_client_multi_request_scenario, self.igmp_verify), |
| 1107 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1108 | assert_equal(test_status, True) |
| 1109 | |
| 1110 | def test_subscriber_authentication_with_dhcp_client_requested_ip_and_channel_surfing(self): |
| 1111 | ### """Test subscriber auth with DHCP client requesting ip and join channel""" |
| 1112 | num_subscribers = 1 |
| 1113 | num_channels = 1 |
| 1114 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1115 | num_channels = num_channels, |
| 1116 | cbs = (self.tls_verify, self.dhcp_client_desired_ip_scenario, self.igmp_verify), |
| 1117 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1118 | assert_equal(test_status, True) |
| 1119 | |
| 1120 | def test_subscriber_authentication_with_dhcp_non_offered_ip_and_channel_surfing(self): |
| 1121 | ### """Test subscriber auth with DHCP client request for non-offered ip and join channel""" |
| 1122 | num_subscribers = 1 |
| 1123 | num_channels = 1 |
| 1124 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1125 | num_channels = num_channels, |
| 1126 | cbs = (self.tls_verify, self.dhcp_client_request_pkt_with_non_offered_ip_scenario, self.igmp_verify), |
| 1127 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1128 | assert_equal(test_status, True) |
| 1129 | |
| 1130 | def test_subscriber_authentication_with_dhcp_request_out_of_pool_ip_by_client_and_channel_surfing(self): |
| 1131 | ### """Test subscriber auth with DHCP client requesting out of pool ip and join channel""" |
| 1132 | num_subscribers = 1 |
| 1133 | num_channels = 1 |
| 1134 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1135 | num_channels = num_channels, |
| 1136 | cbs = (self.tls_verify, self.dhcp_client_requested_out_pool_ip_scenario, self.igmp_verify), |
| 1137 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1138 | assert_equal(test_status, True) |
| 1139 | |
| 1140 | def test_subscriber_authentication_with_dhcp_specified_lease_time_functionality_and_channel_surfing(self): |
| 1141 | ### """Test subscriber auth with DHCP client specifying lease time and join channel""" |
| 1142 | num_subscribers = 1 |
| 1143 | num_channels = 1 |
| 1144 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1145 | num_channels = num_channels, |
| 1146 | cbs = (self.tls_verify, self.dhcp_client_specific_lease_scenario, self.igmp_verify), |
| 1147 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1148 | assert_equal(test_status, True) |
ChetanGaonker | 5b984cb | 2016-07-12 15:50:49 -0700 | [diff] [blame] | 1149 | |
| 1150 | |
| 1151 | def test_subscriber_join_recv_100channels(self): |
| 1152 | num_subscribers = 1 |
| 1153 | num_channels = 100 |
| 1154 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1155 | num_channels = num_channels, |
| 1156 | cbs = (self.tls_verify, self.dhcp_verify, self.igmp_verify), |
| 1157 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1158 | negative_subscriber_auth = 'all') |
| 1159 | assert_equal(test_status, True) |
| 1160 | |
| 1161 | def test_subscriber_join_recv_400channels(self): |
| 1162 | num_subscribers = 1 |
| 1163 | num_channels = 400 |
| 1164 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1165 | num_channels = num_channels, |
| 1166 | cbs = (self.tls_verify, self.dhcp_verify, self.igmp_verify), |
| 1167 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1168 | negative_subscriber_auth = 'all') |
| 1169 | assert_equal(test_status, True) |
| 1170 | |
| 1171 | def test_subscriber_join_recv_800channels(self): |
| 1172 | num_subscribers = 1 |
| 1173 | num_channels = 800 |
| 1174 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1175 | num_channels = num_channels, |
| 1176 | cbs = (self.tls_verify, self.dhcp_verify, self.igmp_verify), |
| 1177 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1178 | negative_subscriber_auth = 'all') |
| 1179 | assert_equal(test_status, True) |
| 1180 | |
| 1181 | def test_subscriber_join_recv_1200channels(self): |
| 1182 | num_subscribers = 1 |
| 1183 | num_channels = 1200 |
| 1184 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1185 | num_channels = num_channels, |
| 1186 | cbs = (self.tls_verify, self.dhcp_verify, self.igmp_verify), |
| 1187 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1188 | negative_subscriber_auth = 'all') |
| 1189 | assert_equal(test_status, True) |
| 1190 | |
| 1191 | def test_subscriber_join_recv_1500channels(self): |
| 1192 | num_subscribers = 1 |
| 1193 | num_channels = 1500 |
| 1194 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1195 | num_channels = num_channels, |
| 1196 | cbs = (self.tls_verify, self.dhcp_verify, self.igmp_verify), |
| 1197 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1198 | negative_subscriber_auth = 'all') |
| 1199 | assert_equal(test_status, True) |
| 1200 | |
| 1201 | def test_subscriber_join_jump_100channels(self): |
| 1202 | num_subscribers = 1 |
| 1203 | num_channels = 100 |
| 1204 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1205 | num_channels = num_channels, |
| 1206 | cbs = (self.tls_verify, self.dhcp_jump_verify, self.igmp_jump_verify), |
| 1207 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1208 | negative_subscriber_auth = 'all') |
| 1209 | assert_equal(test_status, True) |
| 1210 | def test_subscriber_join_jump_400channels(self): |
| 1211 | num_subscribers = 1 |
| 1212 | num_channels = 400 |
| 1213 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1214 | num_channels = num_channels, |
| 1215 | cbs = (self.tls_verify, self.dhcp_jump_verify, self.igmp_jump_verify), |
| 1216 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1217 | negative_subscriber_auth = 'all') |
| 1218 | assert_equal(test_status, True) |
| 1219 | def test_subscriber_join_jump_800channels(self): |
| 1220 | num_subscribers = 1 |
| 1221 | num_channels = 800 |
| 1222 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1223 | num_channels = num_channels, |
| 1224 | cbs = (self.tls_verify, self.dhcp_jump_verify, self.igmp_jump_verify), |
| 1225 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1226 | negative_subscriber_auth = 'all') |
| 1227 | assert_equal(test_status, True) |
| 1228 | def test_subscriber_join_jump_1200channel(sself): |
| 1229 | num_subscribers = 1 |
| 1230 | num_channels = 1200 |
| 1231 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1232 | num_channels = num_channels, |
| 1233 | cbs = (self.tls_verify, self.dhcp_jump_verify, self.igmp_jump_verify), |
| 1234 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1235 | negative_subscriber_auth = 'all') |
| 1236 | assert_equal(test_status, True) |
| 1237 | def test_subscriber_join_jump_1500channels(self): |
| 1238 | num_subscribers = 1 |
| 1239 | num_channels = 1500 |
| 1240 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1241 | num_channels = num_channels, |
| 1242 | cbs = (self.tls_verify, self.dhcp_jump_verify, self.igmp_jump_verify), |
| 1243 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1244 | negative_subscriber_auth = 'all') |
| 1245 | assert_equal(test_status, True) |
| 1246 | |
| 1247 | def test_subscriber_join_next_100channels(self): |
| 1248 | num_subscribers = 1 |
| 1249 | num_channels = 100 |
| 1250 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1251 | num_channels = num_channels, |
| 1252 | cbs = (self.tls_verify, self.dhcp_next_verify, self.igmp_next_verify), |
| 1253 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1254 | negative_subscriber_auth = 'all') |
| 1255 | assert_equal(test_status, True) |
| 1256 | |
| 1257 | def test_subscriber_join_next_400channels(self): |
| 1258 | num_subscribers = 1 |
| 1259 | num_channels = 400 |
| 1260 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1261 | num_channels = num_channels, |
| 1262 | cbs = (self.tls_verify, self.dhcp_next_verify, self.igmp_next_verify), |
| 1263 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1264 | negative_subscriber_auth = 'all') |
| 1265 | assert_equal(test_status, True) |
| 1266 | |
| 1267 | def test_subscriber_join_next_800channels(self): |
| 1268 | num_subscribers = 1 |
| 1269 | num_channels = 800 |
| 1270 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1271 | num_channels = num_channels, |
| 1272 | cbs = (self.tls_verify, self.dhcp_next_verify, self.igmp_next_verify), |
| 1273 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1274 | negative_subscriber_auth = 'all') |
| 1275 | assert_equal(test_status, True) |
| 1276 | |
| 1277 | |
| 1278 | def test_subscriber_join_next_1200channels(self): |
| 1279 | num_subscribers = 1 |
| 1280 | num_channels = 1200 |
| 1281 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1282 | num_channels = num_channels, |
| 1283 | cbs = (self.tls_verify, self.dhcp_next_verify, self.igmp_next_verify), |
| 1284 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1285 | negative_subscriber_auth = 'all') |
| 1286 | assert_equal(test_status, True) |
| 1287 | |
| 1288 | def test_subscriber_join_next_1500channels(self): |
| 1289 | num_subscribers = 1 |
| 1290 | num_channels = 1500 |
| 1291 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1292 | num_channels = num_channels, |
| 1293 | cbs = (self.tls_verify, self.dhcp_next_verify, self.igmp_next_verify), |
| 1294 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1295 | negative_subscriber_auth = 'all') |
| 1296 | assert_equal(test_status, True) |