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 | a6c88fd | 2017-03-13 09:29:41 -0700 | [diff] [blame] | 291 | aaa_dict = {'apps' : { 'org.opencord.aaa' : { 'AAA' : { 'radiusSecret': 'radius_password', |
| 292 | 'radiusIp': '172.17.0.2' } } } } |
Chetan Gaonker | cbe7964 | 2016-03-09 17:45:58 -0800 | [diff] [blame] | 293 | radius_ip = os.getenv('ONOS_AAA_IP') or '172.17.0.2' |
A.R Karthick | a6c88fd | 2017-03-13 09:29:41 -0700 | [diff] [blame] | 294 | aaa_dict['apps']['org.opencord.aaa']['AAA']['radiusIp'] = radius_ip |
| 295 | self.onos_load_config('org.opencord.aaa', aaa_dict) |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 296 | self.aaa_loaded = True |
Chetan Gaonker | cbe7964 | 2016-03-09 17:45:58 -0800 | [diff] [blame] | 297 | |
| 298 | def onos_dhcp_table_load(self, config = None): |
| 299 | dhcp_dict = {'apps' : { 'org.onosproject.dhcp' : { 'dhcp' : copy.copy(self.dhcp_server_config) } } } |
| 300 | dhcp_config = dhcp_dict['apps']['org.onosproject.dhcp']['dhcp'] |
| 301 | if config: |
| 302 | for k in config.keys(): |
| 303 | if dhcp_config.has_key(k): |
| 304 | dhcp_config[k] = config[k] |
| 305 | self.onos_load_config('org.onosproject.dhcp', dhcp_dict) |
| 306 | |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 307 | def send_recv(self, mac = None, update_seed = False, validate = True): |
| 308 | cip, sip = self.dhcp.discover(mac = mac, update_seed = update_seed) |
| 309 | if validate: |
| 310 | assert_not_equal(cip, None) |
| 311 | assert_not_equal(sip, None) |
| 312 | log.info('Got dhcp client IP %s from server %s for mac %s' % |
| 313 | (cip, sip, self.dhcp.get_mac(cip)[0])) |
| 314 | return cip,sip |
| 315 | |
Chetan Gaonker | cbe7964 | 2016-03-09 17:45:58 -0800 | [diff] [blame] | 316 | def onos_load_config(self, app, config): |
Chetan Gaonker | a2b87df | 2016-03-31 15:41:31 -0700 | [diff] [blame] | 317 | status, code = OnosCtrl.config(config) |
Chetan Gaonker | cbe7964 | 2016-03-09 17:45:58 -0800 | [diff] [blame] | 318 | if status is False: |
| 319 | log.info('JSON config request for app %s returned status %d' %(app, code)) |
| 320 | assert_equal(status, True) |
| 321 | time.sleep(2) |
| 322 | |
Chetan Gaonker | a58ab6e | 2016-03-23 15:04:20 -0700 | [diff] [blame] | 323 | def dhcp_sndrcv(self, dhcp, update_seed = False): |
| 324 | cip, sip = dhcp.discover(update_seed = update_seed) |
Chetan Gaonker | cbe7964 | 2016-03-09 17:45:58 -0800 | [diff] [blame] | 325 | assert_not_equal(cip, None) |
| 326 | assert_not_equal(sip, None) |
| 327 | 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] | 328 | (cip, sip, dhcp.get_mac(cip)[0])) |
Chetan Gaonker | cbe7964 | 2016-03-09 17:45:58 -0800 | [diff] [blame] | 329 | return cip,sip |
| 330 | |
Chetan Gaonker | a58ab6e | 2016-03-23 15:04:20 -0700 | [diff] [blame] | 331 | 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] | 332 | config = {'startip':'10.10.10.20', 'endip':'10.10.10.200', |
Chetan Gaonker | cbe7964 | 2016-03-09 17:45:58 -0800 | [diff] [blame] | 333 | 'ip':'10.10.10.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 334 | 'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'} |
| 335 | self.onos_dhcp_table_load(config) |
Chetan Gaonker | a58ab6e | 2016-03-23 15:04:20 -0700 | [diff] [blame] | 336 | dhcp = DHCPTest(seed_ip = seed_ip, iface = subscriber.iface) |
| 337 | cip, sip = self.dhcp_sndrcv(dhcp, update_seed = update_seed) |
Chetan Gaonker | cbe7964 | 2016-03-09 17:45:58 -0800 | [diff] [blame] | 338 | return cip, sip |
| 339 | |
| 340 | def recv_channel_cb(self, pkt): |
| 341 | ##First verify that we have received the packet for the joined instance |
| 342 | chan = self.subscriber.caddr(pkt[IP].dst) |
| 343 | assert_equal(chan in self.subscriber.join_map.keys(), True) |
| 344 | recv_time = monotonic.monotonic() * 1000000 |
| 345 | join_time = self.subscriber.join_map[chan][self.subscriber.STATS_JOIN].start |
| 346 | delta = recv_time - join_time |
| 347 | self.subscriber.join_rx_stats.update(packets=1, t = delta, usecs = True) |
| 348 | self.subscriber.channel_update(chan, self.subscriber.STATS_RX, 1, t = delta) |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 349 | 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] | 350 | self.test_status = True |
| 351 | |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 352 | def tls_verify(self, subscriber): |
| 353 | if subscriber.has_service('TLS'): |
| 354 | time.sleep(2) |
| 355 | tls = TLSAuthTest() |
| 356 | log.info('Running subscriber %s tls auth test' %subscriber.name) |
| 357 | tls.runTest() |
| 358 | self.test_status = True |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 359 | return self.test_status |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 360 | |
| 361 | def dhcp_verify(self, subscriber): |
Chetan Gaonker | a58ab6e | 2016-03-23 15:04:20 -0700 | [diff] [blame] | 362 | cip, sip = self.dhcp_request(subscriber, update_seed = True) |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 363 | log.info('Subscriber %s got client ip %s from server %s' %(subscriber.name, cip, sip)) |
| 364 | subscriber.src_list = [cip] |
| 365 | self.test_status = True |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 366 | return self.test_status |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 367 | |
| 368 | def dhcp_jump_verify(self, subscriber): |
Chetan Gaonker | a58ab6e | 2016-03-23 15:04:20 -0700 | [diff] [blame] | 369 | cip, sip = self.dhcp_request(subscriber, seed_ip = '10.10.200.1') |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 370 | log.info('Subscriber %s got client ip %s from server %s' %(subscriber.name, cip, sip)) |
| 371 | subscriber.src_list = [cip] |
| 372 | self.test_status = True |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 373 | return self.test_status |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 374 | |
| 375 | def dhcp_next_verify(self, subscriber): |
Chetan Gaonker | a58ab6e | 2016-03-23 15:04:20 -0700 | [diff] [blame] | 376 | cip, sip = self.dhcp_request(subscriber, seed_ip = '10.10.150.1') |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 377 | log.info('Subscriber %s got client ip %s from server %s' %(subscriber.name, cip, sip)) |
| 378 | subscriber.src_list = [cip] |
| 379 | self.test_status = True |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 380 | return self.test_status |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 381 | |
| 382 | def igmp_verify(self, subscriber): |
| 383 | chan = 0 |
| 384 | if subscriber.has_service('IGMP'): |
| 385 | for i in range(5): |
| 386 | log.info('Joining channel %d for subscriber %s' %(chan, subscriber.name)) |
| 387 | subscriber.channel_join(chan, delay = 0) |
| 388 | subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 1) |
| 389 | log.info('Leaving channel %d for subscriber %s' %(chan, subscriber.name)) |
| 390 | subscriber.channel_leave(chan) |
| 391 | time.sleep(3) |
Chetan Gaonker | a58ab6e | 2016-03-23 15:04:20 -0700 | [diff] [blame] | 392 | 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] | 393 | self.test_status = True |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 394 | return self.test_status |
| 395 | |
| 396 | def igmp_verify_multiChannel(self, subscriber): |
| 397 | if subscriber.has_service('IGMP'): |
| 398 | for chan in range(DEFAULT_NO_CHANNELS): |
| 399 | log.info('Joining channel %d for subscriber %s' %(chan, subscriber.name)) |
| 400 | subscriber.channel_join(chan, delay = 0) |
| 401 | subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 1) |
| 402 | log.info('Leaving channel %d for subscriber %s' %(chan, subscriber.name)) |
| 403 | subscriber.channel_leave(chan) |
| 404 | time.sleep(3) |
| 405 | log.info('Interface %s Join RX stats for subscriber %s, %s' %(subscriber.iface, subscriber.name,subscriber.join_rx_stats)) |
| 406 | self.test_status = True |
| 407 | return self.test_status |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 408 | |
| 409 | def igmp_jump_verify(self, subscriber): |
| 410 | if subscriber.has_service('IGMP'): |
| 411 | for i in xrange(subscriber.num): |
| 412 | log.info('Subscriber %s jumping channel' %subscriber.name) |
| 413 | chan = subscriber.channel_jump(delay=0) |
| 414 | subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 1) |
| 415 | log.info('Verified receive for channel %d, subscriber %s' %(chan, subscriber.name)) |
| 416 | time.sleep(3) |
Chetan Gaonker | a58ab6e | 2016-03-23 15:04:20 -0700 | [diff] [blame] | 417 | 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] | 418 | self.test_status = True |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 419 | return self.test_status |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 420 | |
| 421 | def igmp_next_verify(self, subscriber): |
| 422 | if subscriber.has_service('IGMP'): |
| 423 | for i in xrange(subscriber.num): |
| 424 | if i: |
| 425 | chan = subscriber.channel_join_next(delay=0) |
| 426 | else: |
| 427 | chan = subscriber.channel_join(i, delay=0) |
| 428 | log.info('Joined next channel %d for subscriber %s' %(chan, subscriber.name)) |
| 429 | subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count=1) |
| 430 | log.info('Verified receive for channel %d, subscriber %s' %(chan, subscriber.name)) |
| 431 | time.sleep(3) |
Chetan Gaonker | a58ab6e | 2016-03-23 15:04:20 -0700 | [diff] [blame] | 432 | 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] | 433 | self.test_status = True |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 434 | return self.test_status |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 435 | |
Chetan Gaonker | 3d16385 | 2016-03-28 12:20:25 -0700 | [diff] [blame] | 436 | def generate_port_list(self, subscribers, channels): |
Chetan Gaonker | a58ab6e | 2016-03-23 15:04:20 -0700 | [diff] [blame] | 437 | port_list = [] |
Chetan Gaonker | 3d16385 | 2016-03-28 12:20:25 -0700 | [diff] [blame] | 438 | for i in xrange(subscribers): |
| 439 | if channels > 1: |
| 440 | rx_port = 2*i+1 |
| 441 | tx_port = 2*i+2 |
| 442 | else: |
| 443 | rx_port = Subscriber.PORT_RX_DEFAULT |
| 444 | tx_port = Subscriber.PORT_TX_DEFAULT |
Chetan Gaonker | a58ab6e | 2016-03-23 15:04:20 -0700 | [diff] [blame] | 445 | port_list.append((tx_port, rx_port)) |
| 446 | return port_list |
| 447 | |
| 448 | 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] | 449 | '''Load the subscriber from the database''' |
| 450 | self.subscriber_db = SubscriberDB(create = create) |
| 451 | if create is True: |
| 452 | self.subscriber_db.generate(num) |
| 453 | self.subscriber_info = self.subscriber_db.read(num) |
| 454 | self.subscriber_list = [] |
Chetan Gaonker | a58ab6e | 2016-03-23 15:04:20 -0700 | [diff] [blame] | 455 | if not port_list: |
Chetan Gaonker | 3d16385 | 2016-03-28 12:20:25 -0700 | [diff] [blame] | 456 | port_list = self.generate_port_list(num, num_channels) |
Chetan Gaonker | a58ab6e | 2016-03-23 15:04:20 -0700 | [diff] [blame] | 457 | |
| 458 | index = 0 |
Chetan Gaonker | 41d2e07 | 2016-03-15 16:41:31 -0700 | [diff] [blame] | 459 | for info in self.subscriber_info: |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 460 | self.subscriber_list.append(Subscriber(name=info['Name'], |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 461 | service=info['Service'], |
Chetan Gaonker | 7997bb4 | 2016-03-28 09:46:15 -0700 | [diff] [blame] | 462 | port_map = self.port_map, |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 463 | num=num_channels, |
Chetan Gaonker | a58ab6e | 2016-03-23 15:04:20 -0700 | [diff] [blame] | 464 | channel_start = channel_start, |
| 465 | tx_port = port_list[index][0], |
| 466 | rx_port = port_list[index][1])) |
Chetan Gaonker | 3d16385 | 2016-03-28 12:20:25 -0700 | [diff] [blame] | 467 | if num_channels > 1: |
| 468 | channel_start += num_channels |
Chetan Gaonker | a58ab6e | 2016-03-23 15:04:20 -0700 | [diff] [blame] | 469 | index += 1 |
| 470 | |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 471 | #load the ssm list for all subscriber channels |
| 472 | igmpChannel = IgmpChannel() |
| 473 | ssm_groups = map(lambda sub: sub.channels, self.subscriber_list) |
| 474 | ssm_list = reduce(lambda ssm1, ssm2: ssm1+ssm2, ssm_groups) |
| 475 | igmpChannel.igmp_load_ssm_config(ssm_list) |
Chetan Gaonker | a58ab6e | 2016-03-23 15:04:20 -0700 | [diff] [blame] | 476 | #load the subscriber to mcast port map for cord |
| 477 | cord_port_map = {} |
| 478 | for sub in self.subscriber_list: |
| 479 | for chan in sub.channels: |
| 480 | cord_port_map[chan] = (sub.tx_port, sub.rx_port) |
| 481 | |
| 482 | igmpChannel.cord_port_table_load(cord_port_map) |
Chetan Gaonker | 41d2e07 | 2016-03-15 16:41:31 -0700 | [diff] [blame] | 483 | |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 484 | def subscriber_join_verify( self, num_subscribers = 10, num_channels = 1, |
| 485 | channel_start = 0, cbs = None, port_list = [], negative_subscriber_auth = None): |
Chetan Gaonker | cbe7964 | 2016-03-09 17:45:58 -0800 | [diff] [blame] | 486 | self.test_status = False |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 487 | self.num_subscribers = num_subscribers |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 488 | self.sub_loop_count = num_subscribers |
Chetan Gaonker | 7997bb4 | 2016-03-28 09:46:15 -0700 | [diff] [blame] | 489 | self.subscriber_load(create = True, num = num_subscribers, |
Chetan Gaonker | a58ab6e | 2016-03-23 15:04:20 -0700 | [diff] [blame] | 490 | num_channels = num_channels, channel_start = channel_start, port_list = port_list) |
Chetan Gaonker | 55fc788 | 2016-03-15 17:46:47 -0700 | [diff] [blame] | 491 | self.onos_aaa_load() |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 492 | 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] | 493 | |
| 494 | if cbs and negative_subscriber_auth is None: |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 495 | cbs = (self.tls_verify, self.dhcp_verify, self.igmp_verify) |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 496 | cbs_negative = cbs |
Chetan Gaonker | 41d2e07 | 2016-03-15 16:41:31 -0700 | [diff] [blame] | 497 | for subscriber in self.subscriber_list: |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 498 | subscriber.start() |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 499 | if negative_subscriber_auth is 'half' and self.sub_loop_count%2 is not 0: |
| 500 | cbs = (self.tls_verify, self.dhcp_verify, self.igmp_verify) |
| 501 | elif negative_subscriber_auth is 'onethird' and self.sub_loop_count%3 is not 0: |
| 502 | cbs = (self.tls_verify, self.dhcp_verify, self.igmp_verify) |
| 503 | else: |
| 504 | cbs = cbs_negative |
| 505 | self.sub_loop_count = self.sub_loop_count - 1 |
| 506 | pool_object = subscriber_pool(subscriber, cbs, self.test_status) |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 507 | self.thread_pool.addTask(pool_object.pool_cb) |
| 508 | self.thread_pool.cleanUpThreads() |
| 509 | for subscriber in self.subscriber_list: |
| 510 | subscriber.stop() |
ChetanGaonker | 5b984cb | 2016-07-12 15:50:49 -0700 | [diff] [blame] | 511 | print "self.test_status %s\n"%(self.test_status) |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 512 | return self.test_status |
Chetan Gaonker | cbe7964 | 2016-03-09 17:45:58 -0800 | [diff] [blame] | 513 | |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 514 | def tls_invalid_cert(self, subscriber): |
| 515 | if subscriber.has_service('TLS'): |
| 516 | time.sleep(2) |
| 517 | log.info('Running subscriber %s tls auth test' %subscriber.name) |
| 518 | tls = TLSAuthTest(client_cert = self.CLIENT_CERT_INVALID) |
| 519 | tls.runTest() |
| 520 | if tls.failTest == True: |
| 521 | self.test_status = False |
| 522 | return self.test_status |
| 523 | |
| 524 | def tls_no_cert(self, subscriber): |
| 525 | if subscriber.has_service('TLS'): |
| 526 | time.sleep(2) |
| 527 | log.info('Running subscriber %s tls auth test' %subscriber.name) |
| 528 | tls = TLSAuthTest(client_cert = '') |
| 529 | tls.runTest() |
| 530 | if tls.failTest == True: |
| 531 | self.test_status = False |
| 532 | return self.test_status |
| 533 | |
| 534 | def tls_self_signed_cert(self, subscriber): |
| 535 | if subscriber.has_service('TLS'): |
| 536 | time.sleep(2) |
| 537 | log.info('Running subscriber %s tls auth test' %subscriber.name) |
| 538 | tls = TLSAuthTest(client_cert = self.CLIENT_CERT) |
| 539 | tls.runTest() |
| 540 | if tls.failTest == False: |
| 541 | self.test_status = True |
| 542 | return self.test_status |
| 543 | |
| 544 | def tls_Nsubscribers_use_same_valid_cert(self, subscriber): |
| 545 | if subscriber.has_service('TLS'): |
| 546 | time.sleep(2) |
| 547 | log.info('Running subscriber %s tls auth test' %subscriber.name) |
| 548 | num_users = 3 |
| 549 | for i in xrange(num_users): |
| 550 | tls = TLSAuthTest(intf = 'veth{}'.format(i*2)) |
| 551 | tls.runTest() |
| 552 | if tls.failTest == False: |
| 553 | self.test_status = True |
| 554 | return self.test_status |
| 555 | |
| 556 | def dhcp_discover_scenario(self, subscriber): |
| 557 | if subscriber.has_service('DHCP'): |
| 558 | time.sleep(2) |
| 559 | log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name) |
| 560 | t1 = self.subscriber_dhcp_1release() |
| 561 | self.test_status = True |
| 562 | return self.test_status |
| 563 | |
| 564 | def subscriber_dhcp_1release(self, iface = INTF_RX_DEFAULT): |
| 565 | config = {'startip':'10.10.100.20', 'endip':'10.10.100.21', |
| 566 | 'ip':'10.10.100.2', 'mac': "ca:fe:ca:fe:8a:fe", |
| 567 | 'subnet': '255.255.255.0', 'broadcast':'10.10.100.255', 'router':'10.10.100.1'} |
| 568 | self.onos_dhcp_table_load(config) |
| 569 | self.dhcp = DHCPTest(seed_ip = '10.10.100.10', iface = iface) |
| 570 | cip, sip = self.send_recv() |
| 571 | log.info('Releasing ip %s to server %s' %(cip, sip)) |
| 572 | assert_equal(self.dhcp.release(cip), True) |
| 573 | log.info('Triggering DHCP discover again after release') |
| 574 | cip2, sip2 = self.send_recv(update_seed = True) |
| 575 | log.info('Verifying released IP was given back on rediscover') |
| 576 | assert_equal(cip, cip2) |
| 577 | log.info('Test done. Releasing ip %s to server %s' %(cip2, sip2)) |
| 578 | assert_equal(self.dhcp.release(cip2), True) |
| 579 | |
| 580 | |
| 581 | def dhcp_client_reboot_scenario(self, subscriber): |
| 582 | if subscriber.has_service('DHCP'): |
| 583 | time.sleep(2) |
| 584 | log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name) |
| 585 | tl = self.subscriber_dhcp_client_request_after_reboot() |
| 586 | self.test_status = True |
| 587 | return self.test_status |
| 588 | |
| 589 | def subscriber_dhcp_client_request_after_reboot(self, iface = INTF_RX_DEFAULT): |
| 590 | #''' Client sends DHCP Request after reboot.''' |
| 591 | |
| 592 | config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', |
| 593 | 'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 594 | 'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'} |
| 595 | self.onos_dhcp_table_load(config) |
| 596 | self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface) |
| 597 | cip, sip, mac, lval = self.dhcp.only_discover() |
| 598 | log.info('Got dhcp client IP %s from server %s for mac %s .' % |
| 599 | (cip, sip, mac) ) |
| 600 | |
| 601 | log.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.") |
| 602 | |
| 603 | if (cip == None and mac != None): |
| 604 | log.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.") |
| 605 | assert_not_equal(cip, None) |
| 606 | |
| 607 | else: |
| 608 | new_cip, new_sip = self.dhcp.only_request(cip, mac) |
| 609 | if new_cip == None: |
| 610 | log.info("Got DHCP server NAK.") |
| 611 | os.system('ifconfig '+iface+' down') |
| 612 | log.info('Client goes down.') |
| 613 | log.info('Delay for 5 seconds.') |
| 614 | |
| 615 | time.sleep(5) |
| 616 | |
| 617 | os.system('ifconfig '+iface+' up') |
| 618 | log.info('Client is up now.') |
| 619 | |
| 620 | new_cip, new_sip = self.dhcp.only_request(cip, mac) |
| 621 | if new_cip == None: |
| 622 | log.info("Got DHCP server NAK.") |
| 623 | assert_not_equal(new_cip, None) |
| 624 | elif new_cip != None: |
| 625 | log.info("Got DHCP ACK.") |
| 626 | |
| 627 | |
| 628 | def dhcp_client_renew_scenario(self, subscriber): |
| 629 | if subscriber.has_service('DHCP'): |
| 630 | time.sleep(2) |
| 631 | log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name) |
| 632 | tl = self.subscriber_dhcp_client_renew_time() |
| 633 | self.test_status = True |
| 634 | return self.test_status |
| 635 | |
| 636 | def subscriber_dhcp_client_renew_time(self, iface = INTF_RX_DEFAULT): |
| 637 | config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', |
| 638 | 'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 639 | 'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'} |
| 640 | self.onos_dhcp_table_load(config) |
| 641 | self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface) |
| 642 | cip, sip, mac , lval = self.dhcp.only_discover() |
| 643 | log.info('Got dhcp client IP %s from server %s for mac %s .' % |
| 644 | (cip, sip, mac) ) |
| 645 | |
| 646 | log.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.") |
| 647 | if (cip == None and mac != None): |
| 648 | log.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.") |
| 649 | assert_not_equal(cip, None) |
| 650 | elif cip and sip and mac: |
| 651 | log.info("Triggering DHCP Request.") |
| 652 | new_cip, new_sip, lval = self.dhcp.only_request(cip, mac, renew_time = True) |
| 653 | if new_cip and new_sip and lval: |
| 654 | log.info("Client 's Renewal time is :%s",lval) |
| 655 | log.info("Generating delay till renewal time.") |
| 656 | time.sleep(lval) |
| 657 | log.info("Client Sending Unicast DHCP request.") |
| 658 | latest_cip, latest_sip = self.dhcp.only_request(new_cip, mac, unicast = True) |
| 659 | if latest_cip and latest_sip: |
| 660 | log.info("Got DHCP Ack. Lease Renewed for ip %s and mac %s from server %s." % |
| 661 | (latest_cip, mac, latest_sip) ) |
| 662 | |
| 663 | elif latest_cip == None: |
| 664 | log.info("Got DHCP NAK. Lease not renewed.") |
| 665 | elif new_cip == None or new_sip == None or lval == None: |
| 666 | log.info("Got DHCP NAK.") |
| 667 | |
| 668 | |
| 669 | def dhcp_server_reboot_scenario(self, subscriber): |
| 670 | if subscriber.has_service('DHCP'): |
| 671 | time.sleep(2) |
| 672 | log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name) |
| 673 | tl = self.subscriber_dhcp_server_after_reboot() |
| 674 | self.test_status = True |
| 675 | return self.test_status |
| 676 | |
| 677 | def subscriber_dhcp_server_after_reboot(self, iface = INTF_RX_DEFAULT): |
| 678 | ''' DHCP server goes down.''' |
| 679 | config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', |
| 680 | 'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 681 | 'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'} |
| 682 | self.onos_dhcp_table_load(config) |
| 683 | self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface) |
| 684 | cip, sip, mac, lval = self.dhcp.only_discover() |
| 685 | log.info('Got dhcp client IP %s from server %s for mac %s .' % |
| 686 | (cip, sip, mac) ) |
| 687 | log.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.") |
| 688 | if (cip == None and mac != None): |
| 689 | log.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.") |
| 690 | assert_not_equal(cip, None) |
| 691 | else: |
| 692 | new_cip, new_sip = self.dhcp.only_request(cip, mac) |
| 693 | if new_cip == None: |
| 694 | log.info("Got DHCP server NAK.") |
| 695 | assert_not_equal(new_cip, None) |
| 696 | log.info('Getting DHCP server Down.') |
| 697 | onos_ctrl = OnosCtrl(self.dhcp_app) |
| 698 | onos_ctrl.deactivate() |
| 699 | for i in range(0,4): |
| 700 | log.info("Sending DHCP Request.") |
| 701 | log.info('') |
| 702 | new_cip, new_sip = self.dhcp.only_request(cip, mac) |
| 703 | if new_cip == None and new_sip == None: |
| 704 | log.info('') |
| 705 | log.info("DHCP Request timed out.") |
| 706 | elif new_cip and new_sip: |
| 707 | log.info("Got Reply from DHCP server.") |
| 708 | assert_equal(new_cip,None) #Neagtive Test Case |
| 709 | log.info('Getting DHCP server Up.') |
| 710 | # self.activate_apps(self.dhcp_app) |
| 711 | onos_ctrl = OnosCtrl(self.dhcp_app) |
| 712 | status, _ = onos_ctrl.activate() |
| 713 | assert_equal(status, True) |
| 714 | time.sleep(3) |
| 715 | for i in range(0,4): |
| 716 | log.info("Sending DHCP Request after DHCP server is up.") |
| 717 | log.info('') |
| 718 | new_cip, new_sip = self.dhcp.only_request(cip, mac) |
| 719 | if new_cip == None and new_sip == None: |
| 720 | log.info('') |
| 721 | log.info("DHCP Request timed out.") |
| 722 | elif new_cip and new_sip: |
| 723 | log.info("Got Reply from DHCP server.") |
| 724 | assert_equal(new_cip,None) #Neagtive Test Case |
| 725 | |
| 726 | def dhcp_client_rebind_scenario(self, subscriber): |
| 727 | if subscriber.has_service('DHCP'): |
| 728 | time.sleep(2) |
| 729 | log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name) |
| 730 | tl = self.subscriber_dhcp_client_rebind_time() |
| 731 | self.test_status = True |
| 732 | return self.test_status |
| 733 | |
| 734 | def subscriber_dhcp_client_rebind_time(self, iface = INTF_RX_DEFAULT): |
| 735 | config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', |
| 736 | 'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 737 | 'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'} |
| 738 | self.onos_dhcp_table_load(config) |
| 739 | self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface) |
| 740 | cip, sip, mac, lval = self.dhcp.only_discover() |
| 741 | log.info('Got dhcp client IP %s from server %s for mac %s .' % |
| 742 | (cip, sip, mac) ) |
| 743 | log.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.") |
| 744 | if (cip == None and mac != None): |
| 745 | log.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.") |
| 746 | assert_not_equal(cip, None) |
| 747 | elif cip and sip and mac: |
| 748 | log.info("Triggering DHCP Request.") |
| 749 | new_cip, new_sip, lval = self.dhcp.only_request(cip, mac, rebind_time = True) |
| 750 | if new_cip and new_sip and lval: |
| 751 | log.info("Client 's Rebind time is :%s",lval) |
| 752 | log.info("Generating delay till rebind time.") |
| 753 | time.sleep(lval) |
| 754 | log.info("Client Sending broadcast DHCP requests for renewing lease or for getting new ip.") |
| 755 | self.dhcp.after_T2 = True |
| 756 | for i in range(0,4): |
| 757 | latest_cip, latest_sip = self.dhcp.only_request(new_cip, mac) |
| 758 | if latest_cip and latest_sip: |
| 759 | log.info("Got DHCP Ack. Lease Renewed for ip %s and mac %s from server %s." % |
| 760 | (latest_cip, mac, latest_sip) ) |
| 761 | break |
| 762 | elif latest_cip == None: |
| 763 | log.info("Got DHCP NAK. Lease not renewed.") |
| 764 | assert_not_equal(latest_cip, None) |
| 765 | elif new_cip == None or new_sip == None or lval == None: |
| 766 | log.info("Got DHCP NAK.Lease not Renewed.") |
| 767 | |
| 768 | def dhcp_starvation_scenario(self, subscriber): |
| 769 | if subscriber.has_service('DHCP'): |
| 770 | time.sleep(2) |
| 771 | log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name) |
| 772 | tl = self.subscriber_dhcp_starvation() |
| 773 | self.test_status = True |
| 774 | return self.test_status |
| 775 | |
| 776 | |
| 777 | def subscriber_dhcp_starvation(self, iface = INTF_RX_DEFAULT): |
| 778 | '''DHCP starve''' |
| 779 | config = {'startip':'182.17.0.20', 'endip':'182.17.0.69', |
| 780 | 'ip':'182.17.0.2', 'mac': "ca:fe:c3:fe:ca:fe", |
| 781 | 'subnet': '255.255.255.0', 'broadcast':'182.17.0.255', 'router':'182.17.0.1'} |
| 782 | self.onos_dhcp_table_load(config) |
| 783 | self.dhcp = DHCPTest(seed_ip = '182.17.0.1', iface = iface) |
| 784 | log.info('Verifying 1 ') |
| 785 | for x in xrange(50): |
| 786 | mac = RandMAC()._fix() |
| 787 | self.send_recv(mac = mac) |
| 788 | log.info('Verifying 2 ') |
| 789 | cip, sip = self.send_recv(update_seed = True, validate = False) |
| 790 | assert_equal(cip, None) |
| 791 | assert_equal(sip, None) |
| 792 | |
| 793 | def dhcp_same_client_multi_discovers_scenario(self, subscriber): |
| 794 | if subscriber.has_service('DHCP'): |
| 795 | time.sleep(2) |
| 796 | log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name) |
| 797 | tl = self.subscriber_dhcp_same_client_multiple_discover() |
| 798 | self.test_status = True |
| 799 | return self.test_status |
| 800 | |
| 801 | |
| 802 | def subscriber_dhcp_same_client_multiple_discover(self, iface = INTF_RX_DEFAULT): |
| 803 | ''' DHCP Client sending multiple discover . ''' |
| 804 | config = {'startip':'10.10.10.20', 'endip':'10.10.10.69', |
| 805 | 'ip':'10.10.10.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 806 | 'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'} |
| 807 | self.onos_dhcp_table_load(config) |
| 808 | self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = iface) |
| 809 | cip, sip, mac, lval = self.dhcp.only_discover() |
| 810 | log.info('Got dhcp client IP %s from server %s for mac %s . Not going to send DHCPREQUEST.' % |
| 811 | (cip, sip, mac) ) |
| 812 | log.info('Triggering DHCP discover again.') |
| 813 | new_cip, new_sip, new_mac , lval = self.dhcp.only_discover() |
| 814 | if cip == new_cip: |
| 815 | log.info('Got same ip for 2nd DHCP discover for client IP %s from server %s for mac %s. Triggering DHCP Request. ' |
| 816 | % (new_cip, new_sip, new_mac) ) |
| 817 | elif cip != new_cip: |
| 818 | log.info('Ip after 1st discover %s' %cip) |
| 819 | log.info('Map after 2nd discover %s' %new_cip) |
| 820 | assert_equal(cip, new_cip) |
| 821 | |
| 822 | def dhcp_same_client_multi_request_scenario(self, subscriber): |
| 823 | if subscriber.has_service('DHCP'): |
| 824 | time.sleep(2) |
| 825 | log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name) |
| 826 | tl = self.subscriber_dhcp_same_client_multiple_request() |
| 827 | self.test_status = True |
| 828 | return self.test_status |
| 829 | |
| 830 | def subscriber_dhcp_same_client_multiple_request(self, iface = INTF_RX_DEFAULT): |
| 831 | ''' DHCP Client sending multiple repeat DHCP requests. ''' |
| 832 | config = {'startip':'10.10.10.20', 'endip':'10.10.10.69', |
| 833 | 'ip':'10.10.10.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 834 | 'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'} |
| 835 | self.onos_dhcp_table_load(config) |
| 836 | self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = iface) |
| 837 | log.info('Sending DHCP discover and DHCP request.') |
| 838 | cip, sip = self.send_recv() |
| 839 | mac = self.dhcp.get_mac(cip)[0] |
| 840 | log.info("Sending DHCP request again.") |
| 841 | new_cip, new_sip = self.dhcp.only_request(cip, mac) |
| 842 | if (new_cip,new_sip) == (cip,sip): |
| 843 | log.info('Got same ip for 2nd DHCP Request for client IP %s from server %s for mac %s.' |
| 844 | % (new_cip, new_sip, mac) ) |
| 845 | elif (new_cip,new_sip): |
| 846 | log.info('No DHCP ACK') |
| 847 | assert_equal(new_cip, None) |
| 848 | assert_equal(new_sip, None) |
| 849 | else: |
| 850 | print "Something went wrong." |
| 851 | |
| 852 | |
| 853 | def dhcp_client_desired_ip_scenario(self, subscriber): |
| 854 | if subscriber.has_service('DHCP'): |
| 855 | time.sleep(2) |
| 856 | log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name) |
| 857 | tl = self.subscriber_dhcp_client_desired_address() |
| 858 | self.test_status = True |
| 859 | return self.test_status |
| 860 | |
| 861 | def subscriber_dhcp_client_desired_address(self, iface = INTF_RX_DEFAULT): |
| 862 | '''DHCP Client asking for desired IP address.''' |
| 863 | config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', |
| 864 | 'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 865 | 'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'} |
| 866 | self.onos_dhcp_table_load(config) |
| 867 | self.dhcp = DHCPTest(seed_ip = '20.20.20.31', iface = iface) |
| 868 | cip, sip, mac , lval = self.dhcp.only_discover(desired = True) |
| 869 | log.info('Got dhcp client IP %s from server %s for mac %s .' % |
| 870 | (cip, sip, mac) ) |
| 871 | if cip == self.dhcp.seed_ip: |
| 872 | log.info('Got dhcp client IP %s from server %s for mac %s as desired .' % |
| 873 | (cip, sip, mac) ) |
| 874 | elif cip != self.dhcp.seed_ip: |
| 875 | log.info('Got dhcp client IP %s from server %s for mac %s .' % |
| 876 | (cip, sip, mac) ) |
| 877 | log.info('The desired ip was: %s .' % self.dhcp.seed_ip) |
| 878 | assert_equal(cip, self.dhcp.seed_ip) |
| 879 | |
| 880 | def dhcp_client_request_pkt_with_non_offered_ip_scenario(self, subscriber): |
| 881 | if subscriber.has_service('DHCP'): |
| 882 | time.sleep(2) |
| 883 | log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name) |
| 884 | tl = self.subscriber_dhcp_server_nak_packet() |
| 885 | self.test_status = True |
| 886 | return self.test_status |
| 887 | |
| 888 | def subscriber_dhcp_server_nak_packet(self, iface = INTF_RX_DEFAULT): |
| 889 | config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', |
| 890 | 'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 891 | 'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'} |
| 892 | self.onos_dhcp_table_load(config) |
| 893 | self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface) |
| 894 | cip, sip, mac, lval = self.dhcp.only_discover() |
| 895 | log.info('Got dhcp client IP %s from server %s for mac %s .' % |
| 896 | (cip, sip, mac) ) |
| 897 | log.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.") |
| 898 | if (cip == None and mac != None): |
| 899 | log.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.") |
| 900 | assert_not_equal(cip, None) |
| 901 | else: |
| 902 | new_cip, new_sip = self.dhcp.only_request('20.20.20.31', mac) |
| 903 | if new_cip == None: |
| 904 | log.info("Got DHCP server NAK.") |
| 905 | assert_equal(new_cip, None) #Negative Test Case |
| 906 | |
| 907 | def dhcp_client_requested_out_pool_ip_scenario(self, subscriber): |
| 908 | if subscriber.has_service('DHCP'): |
| 909 | time.sleep(2) |
| 910 | log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name) |
| 911 | tl = self.subscriber_dhcp_client_desired_address_out_of_pool() |
| 912 | self.test_status = True |
| 913 | return self.test_status |
| 914 | |
| 915 | |
| 916 | def subscriber_dhcp_client_desired_address_out_of_pool(self, iface = INTF_RX_DEFAULT): |
| 917 | '''DHCP Client asking for desired IP address from out of pool.''' |
| 918 | config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', |
| 919 | 'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 920 | 'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'} |
| 921 | self.onos_dhcp_table_load(config) |
| 922 | self.dhcp = DHCPTest(seed_ip = '20.20.20.35', iface = iface) |
| 923 | cip, sip, mac, lval = self.dhcp.only_discover(desired = True) |
| 924 | log.info('Got dhcp client IP %s from server %s for mac %s .' % |
| 925 | (cip, sip, mac) ) |
| 926 | if cip == self.dhcp.seed_ip: |
| 927 | log.info('Got dhcp client IP %s from server %s for mac %s as desired .' % |
| 928 | (cip, sip, mac) ) |
| 929 | assert_equal(cip, self.dhcp.seed_ip) #Negative Test Case |
| 930 | |
| 931 | elif cip != self.dhcp.seed_ip: |
| 932 | log.info('Got dhcp client IP %s from server %s for mac %s .' % |
| 933 | (cip, sip, mac) ) |
| 934 | log.info('The desired ip was: %s .' % self.dhcp.seed_ip) |
| 935 | assert_not_equal(cip, self.dhcp.seed_ip) |
| 936 | |
| 937 | elif cip == None: |
| 938 | log.info('Got DHCP NAK') |
| 939 | |
| 940 | |
| 941 | def dhcp_client_specific_lease_scenario(self, subscriber): |
| 942 | if subscriber.has_service('DHCP'): |
| 943 | time.sleep(2) |
| 944 | log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name) |
| 945 | tl = self.subscriber_dhcp_specific_lease_packet() |
| 946 | self.test_status = True |
| 947 | return self.test_status |
| 948 | |
| 949 | def subscriber_dhcp_specific_lease_packet(self, iface = INTF_RX_DEFAULT): |
| 950 | ''' Client sends DHCP Discover packet for particular lease time.''' |
| 951 | config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', |
| 952 | 'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 953 | 'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'} |
| 954 | self.onos_dhcp_table_load(config) |
| 955 | self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface) |
| 956 | log.info('Sending DHCP discover with lease time of 700') |
| 957 | cip, sip, mac, lval = self.dhcp.only_discover(lease_time = True) |
| 958 | |
| 959 | log.info("Verifying Client 's IP and mac in DHCP Offer packet.") |
| 960 | if (cip == None and mac != None): |
| 961 | log.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.") |
| 962 | assert_not_equal(cip, None) |
| 963 | elif lval != 700: |
| 964 | log.info('Getting dhcp client IP %s from server %s for mac %s with lease time %s. That is not 700.' % |
| 965 | (cip, sip, mac, lval) ) |
| 966 | assert_not_equal(lval, 700) |
| 967 | |
| 968 | def test_subscriber_join_recv_channel(self): |
| 969 | ###"""Test subscriber join and receive""" |
| 970 | num_subscribers = 1 |
Chetan Gaonker | 3d16385 | 2016-03-28 12:20:25 -0700 | [diff] [blame] | 971 | num_channels = 1 |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 972 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
Chetan Gaonker | 3d16385 | 2016-03-28 12:20:25 -0700 | [diff] [blame] | 973 | num_channels = num_channels, |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 974 | cbs = (self.tls_verify, self.dhcp_verify, self.igmp_verify), |
Chetan Gaonker | 3d16385 | 2016-03-28 12:20:25 -0700 | [diff] [blame] | 975 | port_list = self.generate_port_list(num_subscribers, num_channels)) |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 976 | assert_equal(test_status, True) |
Chetan Gaonker | cbe7964 | 2016-03-09 17:45:58 -0800 | [diff] [blame] | 977 | |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 978 | def test_subscriber_join_jump_channel(self): |
| 979 | ###"""Test subscriber join and receive for channel surfing""" |
| 980 | num_subscribers = 1 |
| 981 | num_channels = 1 |
| 982 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
Chetan Gaonker | 3d16385 | 2016-03-28 12:20:25 -0700 | [diff] [blame] | 983 | num_channels = num_channels, |
Chetan Gaonker | a58ab6e | 2016-03-23 15:04:20 -0700 | [diff] [blame] | 984 | cbs = (self.tls_verify, self.dhcp_jump_verify, self.igmp_jump_verify), |
Chetan Gaonker | 3d16385 | 2016-03-28 12:20:25 -0700 | [diff] [blame] | 985 | port_list = self.generate_port_list(num_subscribers, num_channels)) |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 986 | assert_equal(test_status, True) |
Chetan Gaonker | 4b959fc | 2016-03-09 19:20:16 -0800 | [diff] [blame] | 987 | |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 988 | def test_subscriber_join_next_channel(self): |
| 989 | ###"""Test subscriber join next for channels""" |
| 990 | num_subscribers = 1 |
| 991 | num_channels = 1 |
| 992 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
Chetan Gaonker | 3d16385 | 2016-03-28 12:20:25 -0700 | [diff] [blame] | 993 | num_channels = num_channels, |
Chetan Gaonker | a58ab6e | 2016-03-23 15:04:20 -0700 | [diff] [blame] | 994 | cbs = (self.tls_verify, self.dhcp_next_verify, self.igmp_next_verify), |
Chetan Gaonker | 3d16385 | 2016-03-28 12:20:25 -0700 | [diff] [blame] | 995 | port_list = self.generate_port_list(num_subscribers, num_channels)) |
Chetan Gaonker | cd86bdd | 2016-03-17 00:08:12 -0700 | [diff] [blame] | 996 | assert_equal(test_status, True) |
ChetanGaonker | eff07bc | 2016-06-09 16:39:23 -0700 | [diff] [blame] | 997 | |
| 998 | #@deferred(SUBSCRIBER_TIMEOUT) |
| 999 | def test_subscriber_authentication_with_invalid_certificate_and_channel_surfing(self): |
| 1000 | ### """Test subscriber to auth with invalidCertification and join channel""" |
| 1001 | num_subscribers = 1 |
| 1002 | num_channels = 1 |
| 1003 | df = defer.Deferred() |
| 1004 | def sub_auth_invalid_cert(df): |
| 1005 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1006 | num_channels = num_channels, |
| 1007 | cbs = (self.tls_invalid_cert, self.dhcp_verify, self.igmp_verify), |
| 1008 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1009 | assert_equal(test_status, False) |
| 1010 | df.callback(0) |
| 1011 | reactor.callLater(0, sub_auth_invalid_cert, df) |
| 1012 | return df |
| 1013 | |
| 1014 | |
| 1015 | #@deferred(SUBSCRIBER_TIMEOUT) |
| 1016 | def test_subscriber_authentication_with_no_certificate_and_channel_surfing(self): |
| 1017 | ### """Test subscriber to auth with No Certification and join channel""" |
| 1018 | num_subscribers = 1 |
| 1019 | num_channels = 1 |
| 1020 | df = defer.Deferred() |
| 1021 | def sub_auth_no_cert(df): |
| 1022 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1023 | num_channels = num_channels, |
| 1024 | cbs = (self.tls_no_cert, self.dhcp_verify, self.igmp_verify), |
| 1025 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1026 | negative_subscriber_auth = 'all') |
| 1027 | assert_equal(test_status, False) |
| 1028 | df.callback(0) |
| 1029 | reactor.callLater(0, sub_auth_no_cert, df) |
| 1030 | return df |
| 1031 | |
| 1032 | def test_subscriber_authentication_with_self_signed_certificate_and_channel_surfing(self): |
| 1033 | ### """Test subscriber to auth with Self Signed Certification and join channel""" |
| 1034 | num_subscribers = 1 |
| 1035 | num_channels = 1 |
| 1036 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1037 | num_channels = num_channels, |
| 1038 | cbs = (self.tls_self_signed_cert, self.dhcp_verify, self.igmp_verify), |
| 1039 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1040 | negative_subscriber_auth = 'all') |
| 1041 | assert_equal(test_status, True) |
| 1042 | |
| 1043 | def test_subscriber_authentication_with_dhcp_discover_and_channel_surfing(self): |
| 1044 | ### """Test subscriber auth success, DHCP re-discover with DHCP server and join channel""" |
| 1045 | num_subscribers = 1 |
| 1046 | num_channels = 1 |
| 1047 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1048 | num_channels = num_channels, |
| 1049 | cbs = (self.tls_verify, self.dhcp_discover_scenario, self.igmp_verify), |
| 1050 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1051 | assert_equal(test_status, True) |
| 1052 | |
| 1053 | def test_subscriber_authentication_with_dhcp_client_reboot_scenario_and_channel_surfing(self): |
| 1054 | ### """Test subscriber auth success, DHCP client got re-booted and join channel""" |
| 1055 | num_subscribers = 1 |
| 1056 | num_channels = 1 |
| 1057 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1058 | num_channels = num_channels, |
| 1059 | cbs = (self.tls_verify, self.dhcp_client_reboot_scenario, self.igmp_verify), |
| 1060 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1061 | assert_equal(test_status, True) |
| 1062 | |
| 1063 | def test_subscriber_authentication_with_dhcp_server_reboot_scenario_and_channel_surfing(self): |
| 1064 | ### """Test subscriber auth , DHCP server re-boot during DHCP process and join channel""" |
| 1065 | num_subscribers = 1 |
| 1066 | num_channels = 1 |
| 1067 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1068 | num_channels = num_channels, |
| 1069 | cbs = (self.tls_verify, self.dhcp_server_reboot_scenario, self.igmp_verify), |
| 1070 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1071 | assert_equal(test_status, True) |
| 1072 | |
| 1073 | def test_subscriber_authentication_with_dhcp_client_rebind_and_channel_surfing(self): |
| 1074 | ### """Test subscriber auth , DHCP client rebind IP and join channel""" |
| 1075 | num_subscribers = 1 |
| 1076 | num_channels = 1 |
| 1077 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1078 | num_channels = num_channels, |
| 1079 | cbs = (self.tls_verify, self.dhcp_client_rebind_scenario, self.igmp_verify), |
| 1080 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1081 | assert_equal(test_status, True) |
| 1082 | |
| 1083 | |
| 1084 | def test_subscriber_authentication_with_dhcp_starvation_scenario_and_channel_surfing(self): |
| 1085 | ### """Test subscriber auth , DHCP starvation and join channel""" |
| 1086 | num_subscribers = 1 |
| 1087 | num_channels = 1 |
| 1088 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1089 | num_channels = num_channels, |
| 1090 | cbs = (self.tls_verify, self.dhcp_starvation_scenario, self.igmp_verify), |
| 1091 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1092 | assert_equal(test_status, True) |
| 1093 | |
| 1094 | def test_subscriber_authentication_with_multiple_dhcp_discover_for_same_subscriber_and_channel_surfing(self): |
| 1095 | ### """Test subscriber auth , sending same DHCP client discover multiple times and join channel""" |
| 1096 | num_subscribers = 1 |
| 1097 | num_channels = 1 |
| 1098 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1099 | num_channels = num_channels, |
| 1100 | cbs = (self.tls_verify, self.dhcp_same_client_multi_discovers_scenario, self.igmp_verify), |
| 1101 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1102 | assert_equal(test_status, True) |
| 1103 | |
| 1104 | def test_subscriber_authentication_with_multiple_dhcp_request_for_same_subscriber_and_channel_surfing(self): |
| 1105 | ### """Test subscriber auth , same DHCP client multiple requerts times and join channel""" |
| 1106 | num_subscribers = 1 |
| 1107 | num_channels = 1 |
| 1108 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1109 | num_channels = num_channels, |
| 1110 | cbs = (self.tls_verify, self.dhcp_same_client_multi_request_scenario, self.igmp_verify), |
| 1111 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1112 | assert_equal(test_status, True) |
| 1113 | |
| 1114 | def test_subscriber_authentication_with_dhcp_client_requested_ip_and_channel_surfing(self): |
| 1115 | ### """Test subscriber auth with DHCP client requesting ip and join channel""" |
| 1116 | num_subscribers = 1 |
| 1117 | num_channels = 1 |
| 1118 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1119 | num_channels = num_channels, |
| 1120 | cbs = (self.tls_verify, self.dhcp_client_desired_ip_scenario, self.igmp_verify), |
| 1121 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1122 | assert_equal(test_status, True) |
| 1123 | |
| 1124 | def test_subscriber_authentication_with_dhcp_non_offered_ip_and_channel_surfing(self): |
| 1125 | ### """Test subscriber auth with DHCP client request for non-offered ip and join channel""" |
| 1126 | num_subscribers = 1 |
| 1127 | num_channels = 1 |
| 1128 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1129 | num_channels = num_channels, |
| 1130 | cbs = (self.tls_verify, self.dhcp_client_request_pkt_with_non_offered_ip_scenario, self.igmp_verify), |
| 1131 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1132 | assert_equal(test_status, True) |
| 1133 | |
| 1134 | def test_subscriber_authentication_with_dhcp_request_out_of_pool_ip_by_client_and_channel_surfing(self): |
| 1135 | ### """Test subscriber auth with DHCP client requesting out of pool ip and join channel""" |
| 1136 | num_subscribers = 1 |
| 1137 | num_channels = 1 |
| 1138 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1139 | num_channels = num_channels, |
| 1140 | cbs = (self.tls_verify, self.dhcp_client_requested_out_pool_ip_scenario, self.igmp_verify), |
| 1141 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1142 | assert_equal(test_status, True) |
| 1143 | |
| 1144 | def test_subscriber_authentication_with_dhcp_specified_lease_time_functionality_and_channel_surfing(self): |
| 1145 | ### """Test subscriber auth with DHCP client specifying lease time and join channel""" |
| 1146 | num_subscribers = 1 |
| 1147 | num_channels = 1 |
| 1148 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1149 | num_channels = num_channels, |
| 1150 | cbs = (self.tls_verify, self.dhcp_client_specific_lease_scenario, self.igmp_verify), |
| 1151 | port_list = self.generate_port_list(num_subscribers, num_channels), negative_subscriber_auth = 'all') |
| 1152 | assert_equal(test_status, True) |
ChetanGaonker | 5b984cb | 2016-07-12 15:50:49 -0700 | [diff] [blame] | 1153 | |
| 1154 | |
| 1155 | def test_subscriber_join_recv_100channels(self): |
| 1156 | num_subscribers = 1 |
| 1157 | num_channels = 100 |
| 1158 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1159 | num_channels = num_channels, |
| 1160 | cbs = (self.tls_verify, self.dhcp_verify, self.igmp_verify), |
| 1161 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1162 | negative_subscriber_auth = 'all') |
| 1163 | assert_equal(test_status, True) |
| 1164 | |
| 1165 | def test_subscriber_join_recv_400channels(self): |
| 1166 | num_subscribers = 1 |
| 1167 | num_channels = 400 |
| 1168 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1169 | num_channels = num_channels, |
| 1170 | cbs = (self.tls_verify, self.dhcp_verify, self.igmp_verify), |
| 1171 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1172 | negative_subscriber_auth = 'all') |
| 1173 | assert_equal(test_status, True) |
| 1174 | |
| 1175 | def test_subscriber_join_recv_800channels(self): |
| 1176 | num_subscribers = 1 |
| 1177 | num_channels = 800 |
| 1178 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1179 | num_channels = num_channels, |
| 1180 | cbs = (self.tls_verify, self.dhcp_verify, self.igmp_verify), |
| 1181 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1182 | negative_subscriber_auth = 'all') |
| 1183 | assert_equal(test_status, True) |
| 1184 | |
| 1185 | def test_subscriber_join_recv_1200channels(self): |
| 1186 | num_subscribers = 1 |
| 1187 | num_channels = 1200 |
| 1188 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1189 | num_channels = num_channels, |
| 1190 | cbs = (self.tls_verify, self.dhcp_verify, self.igmp_verify), |
| 1191 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1192 | negative_subscriber_auth = 'all') |
| 1193 | assert_equal(test_status, True) |
| 1194 | |
| 1195 | def test_subscriber_join_recv_1500channels(self): |
| 1196 | num_subscribers = 1 |
| 1197 | num_channels = 1500 |
| 1198 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1199 | num_channels = num_channels, |
| 1200 | cbs = (self.tls_verify, self.dhcp_verify, self.igmp_verify), |
| 1201 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1202 | negative_subscriber_auth = 'all') |
| 1203 | assert_equal(test_status, True) |
| 1204 | |
| 1205 | def test_subscriber_join_jump_100channels(self): |
| 1206 | num_subscribers = 1 |
| 1207 | num_channels = 100 |
| 1208 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1209 | num_channels = num_channels, |
| 1210 | cbs = (self.tls_verify, self.dhcp_jump_verify, self.igmp_jump_verify), |
| 1211 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1212 | negative_subscriber_auth = 'all') |
| 1213 | assert_equal(test_status, True) |
| 1214 | def test_subscriber_join_jump_400channels(self): |
| 1215 | num_subscribers = 1 |
| 1216 | num_channels = 400 |
| 1217 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1218 | num_channels = num_channels, |
| 1219 | cbs = (self.tls_verify, self.dhcp_jump_verify, self.igmp_jump_verify), |
| 1220 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1221 | negative_subscriber_auth = 'all') |
| 1222 | assert_equal(test_status, True) |
| 1223 | def test_subscriber_join_jump_800channels(self): |
| 1224 | num_subscribers = 1 |
| 1225 | num_channels = 800 |
| 1226 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1227 | num_channels = num_channels, |
| 1228 | cbs = (self.tls_verify, self.dhcp_jump_verify, self.igmp_jump_verify), |
| 1229 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1230 | negative_subscriber_auth = 'all') |
| 1231 | assert_equal(test_status, True) |
| 1232 | def test_subscriber_join_jump_1200channel(sself): |
| 1233 | num_subscribers = 1 |
| 1234 | num_channels = 1200 |
| 1235 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1236 | num_channels = num_channels, |
| 1237 | cbs = (self.tls_verify, self.dhcp_jump_verify, self.igmp_jump_verify), |
| 1238 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1239 | negative_subscriber_auth = 'all') |
| 1240 | assert_equal(test_status, True) |
| 1241 | def test_subscriber_join_jump_1500channels(self): |
| 1242 | num_subscribers = 1 |
| 1243 | num_channels = 1500 |
| 1244 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1245 | num_channels = num_channels, |
| 1246 | cbs = (self.tls_verify, self.dhcp_jump_verify, self.igmp_jump_verify), |
| 1247 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1248 | negative_subscriber_auth = 'all') |
| 1249 | assert_equal(test_status, True) |
| 1250 | |
| 1251 | def test_subscriber_join_next_100channels(self): |
| 1252 | num_subscribers = 1 |
| 1253 | num_channels = 100 |
| 1254 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1255 | num_channels = num_channels, |
| 1256 | cbs = (self.tls_verify, self.dhcp_next_verify, self.igmp_next_verify), |
| 1257 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1258 | negative_subscriber_auth = 'all') |
| 1259 | assert_equal(test_status, True) |
| 1260 | |
| 1261 | def test_subscriber_join_next_400channels(self): |
| 1262 | num_subscribers = 1 |
| 1263 | num_channels = 400 |
| 1264 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1265 | num_channels = num_channels, |
| 1266 | cbs = (self.tls_verify, self.dhcp_next_verify, self.igmp_next_verify), |
| 1267 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1268 | negative_subscriber_auth = 'all') |
| 1269 | assert_equal(test_status, True) |
| 1270 | |
| 1271 | def test_subscriber_join_next_800channels(self): |
| 1272 | num_subscribers = 1 |
| 1273 | num_channels = 800 |
| 1274 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1275 | num_channels = num_channels, |
| 1276 | cbs = (self.tls_verify, self.dhcp_next_verify, self.igmp_next_verify), |
| 1277 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1278 | negative_subscriber_auth = 'all') |
| 1279 | assert_equal(test_status, True) |
| 1280 | |
| 1281 | |
| 1282 | def test_subscriber_join_next_1200channels(self): |
| 1283 | num_subscribers = 1 |
| 1284 | num_channels = 1200 |
| 1285 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1286 | num_channels = num_channels, |
| 1287 | cbs = (self.tls_verify, self.dhcp_next_verify, self.igmp_next_verify), |
| 1288 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1289 | negative_subscriber_auth = 'all') |
| 1290 | assert_equal(test_status, True) |
| 1291 | |
| 1292 | def test_subscriber_join_next_1500channels(self): |
| 1293 | num_subscribers = 1 |
| 1294 | num_channels = 1500 |
| 1295 | test_status = self.subscriber_join_verify(num_subscribers = num_subscribers, |
| 1296 | num_channels = num_channels, |
| 1297 | cbs = (self.tls_verify, self.dhcp_next_verify, self.igmp_next_verify), |
| 1298 | port_list = self.generate_port_list(num_subscribers, num_channels), |
| 1299 | negative_subscriber_auth = 'all') |
| 1300 | assert_equal(test_status, True) |