Matteo Scandolo | 48d3d2d | 2017-08-08 13:05:27 -0700 | [diff] [blame] | 1 | |
| 2 | # Copyright 2017-present Open Networking Foundation |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
| 16 | |
A R Karthick | 35495c3 | 2017-05-11 14:58:32 -0700 | [diff] [blame] | 17 | import os |
| 18 | import sys |
| 19 | import unittest |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 20 | import time, monotonic |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 21 | import json |
| 22 | import requests |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 23 | import threading |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 24 | from IGMP import * |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 25 | from random import randint |
| 26 | from threading import Timer |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 27 | from threadPool import ThreadPool |
A R Karthick | 35495c3 | 2017-05-11 14:58:32 -0700 | [diff] [blame] | 28 | from nose.tools import * |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 29 | from nose.twistedtools import reactor, deferred |
| 30 | from twisted.internet import defer |
A R Karthick | 9dc6e92 | 2017-07-12 14:40:16 -0700 | [diff] [blame] | 31 | from CordTestConfig import setup_module, teardown_module |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 32 | from CordTestUtils import get_mac, log_test |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 33 | from VolthaCtrl import VolthaCtrl, VolthaService, voltha_setup, voltha_teardown |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 34 | from CordTestUtils import log_test, get_controller |
| 35 | from portmaps import g_subscriber_port_map |
| 36 | from OltConfig import * |
| 37 | from EapTLS import TLSAuthTest |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 38 | from Channels import Channels, IgmpChannel |
| 39 | from Stats import Stats |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 40 | from DHCP import DHCPTest |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 41 | from OnosCtrl import OnosCtrl |
| 42 | from CordLogger import CordLogger |
| 43 | from scapy.all import * |
| 44 | from scapy_ssl_tls.ssl_tls import * |
| 45 | from scapy_ssl_tls.ssl_tls_crypto import * |
| 46 | from CordTestServer import cord_test_onos_restart, cord_test_shell, cord_test_radius_restart |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 47 | from CordContainer import Onos |
A R Karthick | 35495c3 | 2017-05-11 14:58:32 -0700 | [diff] [blame] | 48 | |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 49 | |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 50 | class Voltha_olt_subscribers(Channels): |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 51 | |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 52 | STATS_RX = 0 |
| 53 | STATS_TX = 1 |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 54 | STATS_JOIN = 2 |
| 55 | STATS_LEAVE = 3 |
| 56 | |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 57 | def __init__(self, tx_port, rx_port, num_channels =1, channel_start = 0, src_list = None): |
| 58 | self.tx_port = tx_port |
| 59 | self.rx_port = rx_port |
| 60 | self.src_list = src_list |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 61 | self.num_channels = num_channels |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 62 | try: |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 63 | self.tx_intf = tx_port |
| 64 | self.rx_intf = rx_port |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 65 | except: |
| 66 | self.tx_intf = self.INTF_TX_DEFAULT |
| 67 | self.rx_intf = self.INTF_RX_DEFAULT |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 68 | # num = 1 |
| 69 | # channel_start = 0 |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 70 | mcast_cb = None |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 71 | Channels.__init__(self, num_channels, channel_start = channel_start, src_list = src_list, |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 72 | iface = self.rx_intf, iface_mcast = self.tx_intf, mcast_cb = mcast_cb) |
| 73 | |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 74 | self.loginType = 'wireless' |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 75 | ##start streaming channels |
| 76 | self.join_map = {} |
| 77 | ##accumulated join recv stats |
| 78 | self.join_rx_stats = Stats() |
| 79 | self.recv_timeout = False |
| 80 | |
| 81 | |
| 82 | def channel_join_update(self, chan, join_time): |
| 83 | self.join_map[chan] = ( Stats(), Stats(), Stats(), Stats() ) |
| 84 | self.channel_update(chan, self.STATS_JOIN, 1, t = join_time) |
| 85 | |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 86 | def channel_join(self, chan = 0, delay = 2, src_list = None, record_type = None): |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 87 | '''Join a channel and create a send/recv stats map''' |
| 88 | if self.join_map.has_key(chan): |
| 89 | del self.join_map[chan] |
| 90 | self.delay = delay |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 91 | chan, join_time = self.join(chan, src_list = src_list, record_type = record_type) |
| 92 | #chan, join_time = self.join(chan) |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 93 | self.channel_join_update(chan, join_time) |
| 94 | return chan |
| 95 | |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 96 | def channel_join_next(self, delay = 2, src_list = None, leave_flag = True): |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 97 | '''Joins the next channel leaving the last channel''' |
| 98 | if self.last_chan: |
| 99 | if self.join_map.has_key(self.last_chan): |
| 100 | del self.join_map[self.last_chan] |
| 101 | self.delay = delay |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 102 | chan, join_time = self.join_next(src_list = src_list, leave_flag = leave_flag) |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 103 | self.channel_join_update(chan, join_time) |
| 104 | return chan |
| 105 | |
| 106 | def channel_jump(self, delay = 2): |
| 107 | '''Jumps randomly to the next channel leaving the last channel''' |
| 108 | if self.last_chan is not None: |
| 109 | if self.join_map.has_key(self.last_chan): |
| 110 | del self.join_map[self.last_chan] |
| 111 | self.delay = delay |
| 112 | chan, join_time = self.jump() |
| 113 | self.channel_join_update(chan, join_time) |
| 114 | return chan |
| 115 | |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 116 | def channel_leave(self, chan = 0, force = False, src_list = None): |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 117 | if self.join_map.has_key(chan): |
| 118 | del self.join_map[chan] |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 119 | self.leave(chan, force = force, src_list = src_list) |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 120 | |
| 121 | def channel_update(self, chan, stats_type, packets, t=0): |
| 122 | if type(chan) == type(0): |
| 123 | chan_list = (chan,) |
| 124 | else: |
| 125 | chan_list = chan |
| 126 | for c in chan_list: |
| 127 | if self.join_map.has_key(c): |
| 128 | self.join_map[c][stats_type].update(packets = packets, t = t) |
| 129 | |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 130 | def channel_receive(self, chan, cb = None, count = 1, timeout = 5, src_list = None): |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 131 | log_test.info('Subscriber on port %s checking data traffic receiving from group %s, channel %d' % |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 132 | (self.rx_intf, self.gaddr(chan), chan)) |
| 133 | r = self.recv(chan, cb = cb, count = count, timeout = timeout, src_list = src_list) |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 134 | if len(r) == 0: |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 135 | log_test.info('Subscriber on port %s timed out' %( self.rx_intf)) |
| 136 | self.test_status = False |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 137 | else: |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 138 | self.test_status = True |
| 139 | pass |
| 140 | # log_test.info('Subscriber on port %s received %d packets' %(self.rx_intf, len(r))) |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 141 | if self.recv_timeout: |
| 142 | ##Negative test case is disabled for now |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 143 | log_test.info('Subscriber on port %s not received %d packets' %(self.rx_intf, len(r))) |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 144 | assert_equal(len(r), 0) |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 145 | self.test_status = True |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 146 | return self.test_status |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 147 | |
Thangavelu K S | 9a63733 | 2017-08-01 23:22:23 +0000 | [diff] [blame] | 148 | def channel_not_receive(self, chan, cb = None, count = 1, timeout = 5, src_list = None): |
| 149 | log_test.info('Subscriber on port %s checking data traffic receiving from group %s, channel %d' % |
| 150 | (self.rx_intf, self.gaddr(chan), chan)) |
| 151 | r = self.not_recv(chan, cb = cb, count = count, timeout = timeout, src_list = src_list) |
| 152 | if len(r) == 0: |
| 153 | log_test.info('Subscriber on port %s timed out' %( self.rx_intf)) |
| 154 | self.test_status = True |
| 155 | else: |
| 156 | self.test_status = False |
| 157 | pass |
| 158 | # log_test.info('Subscriber on port %s received %d packets' %(self.rx_intf, len(r))) |
| 159 | if self.recv_timeout: |
| 160 | ##Negative test case is disabled for now |
| 161 | log_test.info('Subscriber on port %s not received %d packets' %(self.rx_intf, len(r))) |
| 162 | assert_equal(len(r), 0) |
| 163 | self.test_status = True |
| 164 | return self.test_status |
| 165 | |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 166 | def recv_channel_cb(self, pkt, src_list = None): |
| 167 | |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 168 | ##First verify that we have received the packet for the joined instance |
Thangavelu K S | 9a63733 | 2017-08-01 23:22:23 +0000 | [diff] [blame] | 169 | log_test.info('Packet received for group %s, subscriber, port %s and from source ip %s showing full packet %s'% |
| 170 | (pkt[IP].dst, self.rx_intf, pkt[IP].src, pkt.show)) |
| 171 | if src_list is not None: |
| 172 | for i in src_list: |
| 173 | if pkt[IP].src == src_list[i]: |
| 174 | pass |
| 175 | else: |
| 176 | log_test.info('Packet received for group %s, subscriber, port %s and from source ip %s which is not expcted on that port'% |
| 177 | (pkt[IP].dst, self.rx_intf, pkt[IP].src)) |
| 178 | |
| 179 | self.recv_timeout = True |
| 180 | |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 181 | if self.recv_timeout: |
| 182 | return |
| 183 | chan = self.caddr(pkt[IP].dst) |
| 184 | assert_equal(chan in self.join_map.keys(), True) |
| 185 | recv_time = monotonic.monotonic() * 1000000 |
| 186 | join_time = self.join_map[chan][self.STATS_JOIN].start |
| 187 | delta = recv_time - join_time |
| 188 | self.join_rx_stats.update(packets=1, t = delta, usecs = True) |
| 189 | self.channel_update(chan, self.STATS_RX, 1, t = delta) |
| 190 | log_test.debug('Packet received in %.3f usecs for group %s after join' %(delta, pkt[IP].dst)) |
| 191 | |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 192 | class voltha_subscriber_pool: |
| 193 | |
| 194 | def __init__(self, subscriber, test_cbs): |
| 195 | self.subscriber = subscriber |
| 196 | self.test_cbs = test_cbs |
| 197 | |
| 198 | def pool_cb(self): |
| 199 | for cb in self.test_cbs: |
| 200 | if cb: |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 201 | self.test_status = cb(self.subscriber, multiple_sub = True) |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 202 | if self.test_status is not True: |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 203 | ## This is chaining for other sub status has to check again |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 204 | self.test_status = True |
| 205 | log_test.info('This service is failed and other services will not run for this subscriber') |
| 206 | break |
| 207 | log_test.info('This Subscriber is tested for multiple service eligibility ') |
| 208 | self.test_status = True |
| 209 | |
A R Karthick | 35495c3 | 2017-05-11 14:58:32 -0700 | [diff] [blame] | 210 | class voltha_exchange(unittest.TestCase): |
| 211 | |
| 212 | OLT_TYPE = 'tibit_olt' |
| 213 | OLT_MAC = '00:0c:e2:31:12:00' |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 214 | VOLTHA_HOST = VolthaService.DOCKER_HOST_IP |
| 215 | VOLTHA_PONSIM_HOST = VolthaService.PONSIM_HOST |
A R Karthick | 35495c3 | 2017-05-11 14:58:32 -0700 | [diff] [blame] | 216 | VOLTHA_REST_PORT = 8881 |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 217 | VOLTHA_OLT_TYPE = 'ponsim_olt' |
| 218 | VOLTHA_OLT_MAC = '00:0c:e2:31:12:00' |
| 219 | VOLTHA_IGMP_ITERATIONS = 100 |
A R Karthick | 18d0fb6 | 2017-09-01 18:49:07 -0700 | [diff] [blame] | 220 | VOLTHA_TEARDOWN = True |
A R Karthick | 35495c3 | 2017-05-11 14:58:32 -0700 | [diff] [blame] | 221 | voltha = None |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 222 | voltha_attrs = None |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 223 | success = True |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 224 | olt_device_id = None |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 225 | apps = ('org.opencord.aaa', 'org.onosproject.dhcp',) |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 226 | #apps = ('org.opencord.aaa', 'org.onosproject.dhcp', 'org.onosproject.dhcprelay') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 227 | app_dhcp = ('org.onosproject.dhcp',) |
| 228 | app_dhcprelay = ('org.onosproject.dhcprelay',) |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 229 | olt_apps = () #'org.opencord.cordmcast') |
| 230 | vtn_app = 'org.opencord.vtn' |
| 231 | table_app = 'org.ciena.cordigmp' |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 232 | test_path = os.path.dirname(os.path.realpath(__file__)) |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 233 | dhcp_data_dir = os.path.join(test_path, '..', 'setup') |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 234 | table_app_file = os.path.join(test_path, '..', 'apps/ciena-cordigmp-multitable-2.0-SNAPSHOT.oar') |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 235 | app_file = os.path.join(test_path, '..', 'apps/ciena-cordigmp-2.0-SNAPSHOT.oar') |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 236 | olt_app_file = os.path.join(test_path, '..', 'apps/olt-app-1.2-SNAPSHOT.oar') |
A.R Karthick | 3493a57 | 2017-06-07 18:28:10 -0700 | [diff] [blame] | 237 | olt_app_name = 'org.onosproject.olt' |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 238 | #onos_config_path = os.path.join(test_path, '..', 'setup/onos-config') |
| 239 | olt_conf_file = os.getenv('OLT_CONFIG_FILE', os.path.join(test_path, '..', 'setup/olt_config.json')) |
| 240 | onos_restartable = bool(int(os.getenv('ONOS_RESTART', 0))) |
A R Karthick | 9dc6e92 | 2017-07-12 14:40:16 -0700 | [diff] [blame] | 241 | VOLTHA_AUTO_CONFIGURE = False |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 242 | num_joins = 0 |
| 243 | |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 244 | relay_interfaces_last = () |
| 245 | interface_to_mac_map = {} |
| 246 | host_ip_map = {} |
| 247 | default_config = { 'default-lease-time' : 600, 'max-lease-time' : 7200, } |
| 248 | default_options = [ ('subnet-mask', '255.255.255.0'), |
| 249 | ('broadcast-address', '192.168.1.255'), |
| 250 | ('domain-name-servers', '192.168.1.1'), |
| 251 | ('domain-name', '"mydomain.cord-tester"'), |
| 252 | ] |
| 253 | ##specify the IP for the dhcp interface matching the subnet and subnet config |
| 254 | ##this is done for each interface dhcpd server would be listening on |
| 255 | default_subnet_config = [ ('192.168.1.2', |
| 256 | ''' |
| 257 | subnet 192.168.1.0 netmask 255.255.255.0 { |
| 258 | range 192.168.1.10 192.168.1.100; |
| 259 | } |
| 260 | '''), ] |
| 261 | |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 262 | configs = {} |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 263 | VOLTHA_ENABLED = True |
| 264 | INTF_TX_DEFAULT = 'veth2' |
| 265 | INTF_RX_DEFAULT = 'veth0' |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 266 | INTF_2_RX_DEFAULT = 'veth6' |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 267 | TESTCASE_TIMEOUT = 300 |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 268 | VOLTHA_IGMP_ITERATIONS = 10 |
| 269 | # VOLTHA_CONFIG_FAKE = True |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 270 | VOLTHA_CONFIG_FAKE = False |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 271 | VOLTHA_UPLINK_VLAN_MAP = { 'of:0000000000000001' : '222' } |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 272 | VOLTHA_UPLINK_VLAN_START = 444 |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 273 | VOLTHA_ONU_UNI_PORT = 'veth0' |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 274 | |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 275 | dhcp_server_config = { |
| 276 | "ip": "10.1.11.50", |
| 277 | "mac": "ca:fe:ca:fe:ca:fe", |
| 278 | "subnet": "255.255.252.0", |
| 279 | "broadcast": "10.1.11.255", |
| 280 | "router": "10.1.8.1", |
| 281 | "domain": "8.8.8.8", |
| 282 | "ttl": "63", |
| 283 | "delay": "2", |
| 284 | "startip": "10.1.11.51", |
| 285 | "endip": "10.1.11.100" |
| 286 | } |
| 287 | |
| 288 | |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 289 | CLIENT_CERT = """-----BEGIN CERTIFICATE----- |
| 290 | MIICuDCCAiGgAwIBAgIBAjANBgkqhkiG9w0BAQUFADCBizELMAkGA1UEBhMCVVMx |
| 291 | CzAJBgNVBAgTAkNBMRIwEAYDVQQHEwlTb21ld2hlcmUxEzARBgNVBAoTCkNpZW5h |
| 292 | IEluYy4xHjAcBgkqhkiG9w0BCQEWD2FkbWluQGNpZW5hLmNvbTEmMCQGA1UEAxMd |
| 293 | RXhhbXBsZSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMTYwNjA2MjExMjI3WhcN |
| 294 | MTcwNjAxMjExMjI3WjBnMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExEzARBgNV |
| 295 | BAoTCkNpZW5hIEluYy4xFzAVBgNVBAMUDnVzZXJAY2llbmEuY29tMR0wGwYJKoZI |
| 296 | hvcNAQkBFg51c2VyQGNpZW5hLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkC |
| 297 | gYEAwvXiSzb9LZ6c7uNziUfKvoHO7wu/uiFC5YUpXbmVGuGZizbVrny0xnR85Dfe |
| 298 | +9R4diansfDhIhzOUl1XjN3YDeSS9OeF5YWNNE8XDhlz2d3rVzaN6hIhdotBkUjg |
| 299 | rUewjTg5OFR31QEyG3v8xR3CLgiE9xQELjZbSA07pD79zuUCAwEAAaNPME0wEwYD |
| 300 | VR0lBAwwCgYIKwYBBQUHAwIwNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL3d3dy5l |
| 301 | eGFtcGxlLmNvbS9leGFtcGxlX2NhLmNybDANBgkqhkiG9w0BAQUFAAOBgQDAjkrY |
| 302 | 6tDChmKbvr8w6Du/t8vHjTCoCIocHTN0qzWOeb1YsAGX89+TrWIuO1dFyYd+Z0KC |
| 303 | PDKB5j/ygml9Na+AklSYAVJIjvlzXKZrOaPmhZqDufi+rXWti/utVqY4VMW2+HKC |
| 304 | nXp37qWeuFLGyR1519Y1d6F/5XzqmvbwURuEug== |
| 305 | -----END CERTIFICATE-----""" |
| 306 | |
| 307 | CLIENT_CERT_INVALID = '''-----BEGIN CERTIFICATE----- |
| 308 | MIIDvTCCAqWgAwIBAgIBAjANBgkqhkiG9w0BAQUFADCBizELMAkGA1UEBhMCVVMx |
| 309 | CzAJBgNVBAgTAkNBMRIwEAYDVQQHEwlTb21ld2hlcmUxEzARBgNVBAoTCkNpZW5h |
| 310 | IEluYy4xHjAcBgkqhkiG9w0BCQEWD2FkbWluQGNpZW5hLmNvbTEmMCQGA1UEAxMd |
| 311 | RXhhbXBsZSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMTYwMzExMTg1MzM2WhcN |
| 312 | MTcwMzA2MTg1MzM2WjBnMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExEzARBgNV |
| 313 | BAoTCkNpZW5hIEluYy4xFzAVBgNVBAMUDnVzZXJAY2llbmEuY29tMR0wGwYJKoZI |
| 314 | hvcNAQkBFg51c2VyQGNpZW5hLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC |
| 315 | AQoCggEBAOxemcBsPn9tZsCa5o2JA6sQDC7A6JgCNXXl2VFzKLNNvB9PS6D7ZBsQ |
| 316 | 5An0zEDMNzi51q7lnrYg1XyiE4S8FzMGAFr94RlGMQJUbRD9V/oqszMX4k++iAOK |
| 317 | tIA1gr3x7Zi+0tkjVSVzXTmgNnhChAamdMsjYUG5+CY9WAicXyy+VEV3zTphZZDR |
| 318 | OjcjEp4m/TSXVPYPgYDXI40YZKX5BdvqykWtT/tIgZb48RS1NPyN/XkCYzl3bv21 |
| 319 | qx7Mc0fcEbsJBIIRYTUkfxnsilcnmLxSYO+p+DZ9uBLBzcQt+4Rd5pLSfi21WM39 |
| 320 | 2Z2oOi3vs/OYAPAqgmi2JWOv3mePa/8CAwEAAaNPME0wEwYDVR0lBAwwCgYIKwYB |
| 321 | BQUHAwIwNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL3d3dy5leGFtcGxlLmNvbS9l |
| 322 | eGFtcGxlX2NhLmNybDANBgkqhkiG9w0BAQUFAAOCAQEALBzMPDTIB6sLyPl0T6JV |
| 323 | MjOkyldAVhXWiQsTjaGQGJUUe1cmUJyZbUZEc13MygXMPOM4x7z6VpXGuq1c/Vxn |
| 324 | VzQ2fNnbJcIAHi/7G8W5/SQfPesIVDsHTEc4ZspPi5jlS/MVX3HOC+BDbOjdbwqP |
| 325 | RX0JEr+uOyhjO+lRxG8ilMRACoBUbw1eDuVDoEBgErSUC44pq5ioDw2xelc+Y6hQ |
| 326 | dmtYwfY0DbvwxHtA495frLyPcastDiT/zre7NL51MyUDPjjYjghNQEwvu66IKbQ3 |
| 327 | T1tJBrgI7/WI+dqhKBFolKGKTDWIHsZXQvZ1snGu/FRYzg1l+R/jT8cRB9BDwhUt |
| 328 | yg== |
| 329 | -----END CERTIFICATE-----''' |
A R Karthick | 35495c3 | 2017-05-11 14:58:32 -0700 | [diff] [blame] | 330 | |
A.R Karthick | 3493a57 | 2017-06-07 18:28:10 -0700 | [diff] [blame] | 331 | @classmethod |
| 332 | def update_apps_version(cls): |
| 333 | version = Onos.getVersion() |
| 334 | major = int(version.split('.')[0]) |
| 335 | minor = int(version.split('.')[1]) |
| 336 | cordigmp_app_version = '2.0-SNAPSHOT' |
| 337 | olt_app_version = '1.2-SNAPSHOT' |
| 338 | if major > 1: |
| 339 | cordigmp_app_version = '3.0-SNAPSHOT' |
| 340 | olt_app_version = '2.0-SNAPSHOT' |
| 341 | elif major == 1: |
| 342 | if minor > 10: |
| 343 | cordigmp_app_version = '3.0-SNAPSHOT' |
| 344 | olt_app_version = '2.0-SNAPSHOT' |
| 345 | elif minor <= 8: |
| 346 | olt_app_version = '1.1-SNAPSHOT' |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 347 | cls.app_file = os.path.join(cls.test_path, '..', 'apps/ciena-cordigmp-{}.oar'.format(cordigmp_app_version)) |
| 348 | cls.table_app_file = os.path.join(cls.test_path, '..', 'apps/ciena-cordigmp-multitable-{}.oar'.format(cordigmp_app_version)) |
| 349 | cls.olt_app_file = os.path.join(cls.test_path, '..', 'apps/olt-app-{}.oar'.format(olt_app_version)) |
| 350 | |
A R Karthick | 35495c3 | 2017-05-11 14:58:32 -0700 | [diff] [blame] | 351 | @classmethod |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 352 | def voltha_dhcprelay_setUpClass(cls): |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 353 | ''' Activate the dhcprelay app''' |
| 354 | OnosCtrl(cls.app_dhcp).deactivate() |
| 355 | time.sleep(3) |
| 356 | cls.onos_ctrl = OnosCtrl('org.onosproject.dhcprelay') |
| 357 | status, _ = cls.onos_ctrl.activate() |
| 358 | assert_equal(status, True) |
| 359 | time.sleep(3) |
| 360 | cls.dhcp_relay_setup() |
| 361 | ##start dhcpd initially with default config |
| 362 | cls.dhcpd_start() |
| 363 | |
| 364 | @classmethod |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 365 | def voltha_dhcprelay_tearDownClass(cls): |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 366 | '''Deactivate the dhcp relay app''' |
| 367 | try: |
| 368 | os.unlink('{}/dhcpd.conf'.format(cls.dhcp_data_dir)) |
| 369 | os.unlink('{}/dhcpd.leases'.format(cls.dhcp_data_dir)) |
| 370 | except: pass |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 371 | onos_ctrl = OnosCtrl(cls.app_dhcprelay) |
| 372 | onos_ctrl.deactivate() |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 373 | cls.dhcpd_stop() |
| 374 | cls.dhcp_relay_cleanup() |
| 375 | |
| 376 | @classmethod |
A.R Karthick | f874d03 | 2017-06-07 18:47:51 -0700 | [diff] [blame] | 377 | def onos_load_config(cls, app, config): |
| 378 | status, code = OnosCtrl.config(config) |
| 379 | if status is False: |
| 380 | log_test.info('JSON config request for app %s returned status %d' %(app, code)) |
| 381 | assert_equal(status, True) |
| 382 | time.sleep(2) |
| 383 | |
| 384 | @classmethod |
| 385 | def onos_aaa_load(cls): |
| 386 | aaa_dict = {'apps' : { 'org.opencord.aaa' : { 'AAA' : { 'radiusSecret': 'radius_password', |
| 387 | 'radiusIp': '172.17.0.2' } } } } |
| 388 | radius_ip = os.getenv('ONOS_AAA_IP') or '172.17.0.2' |
| 389 | aaa_dict['apps']['org.opencord.aaa']['AAA']['radiusIp'] = radius_ip |
| 390 | cls.onos_load_config('org.opencord.aaa', aaa_dict) |
| 391 | |
| 392 | @classmethod |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 393 | def onos_dhcp_table_load(self, config = None): |
| 394 | dhcp_dict = {'apps' : { 'org.onosproject.dhcp' : { 'dhcp' : copy.copy(self.dhcp_server_config) } } } |
| 395 | dhcp_config = dhcp_dict['apps']['org.onosproject.dhcp']['dhcp'] |
| 396 | if config: |
| 397 | for k in config.keys(): |
| 398 | if dhcp_config.has_key(k): |
| 399 | dhcp_config[k] = config[k] |
| 400 | self.onos_load_config('org.onosproject.dhcp', dhcp_dict) |
| 401 | |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 402 | def dhcp_sndrcv(self, dhcp, update_seed = False, mac = None, validation = None): |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 403 | if validation: |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 404 | cip, sip = dhcp.discover(mac = mac, update_seed = update_seed) |
| 405 | assert_not_equal(cip, None) |
| 406 | assert_not_equal(sip, None) |
| 407 | log_test.info('Got dhcp client IP %s from server %s for mac %s' % |
| 408 | (cip, sip, dhcp.get_mac(cip)[0])) |
| 409 | if validation == False: |
| 410 | cip, sip = dhcp.discover(mac = mac, update_seed = update_seed) |
| 411 | assert_equal(cip, None) |
| 412 | assert_equal(sip, None) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 413 | log_test.info('Dhcp client did not get IP from server') |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 414 | |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 415 | if validation == 'skip': |
| 416 | cip, sip = dhcp.discover(mac = mac, update_seed = update_seed) |
| 417 | |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 418 | return cip,sip |
| 419 | |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 420 | def dhcp_request(self, onu_iface = None, seed_ip = '10.10.10.1', update_seed = False, validation = None, startip = '10.10.10.20', mac = None): |
| 421 | config = {'startip':startip, 'endip':'10.10.10.200', |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 422 | 'ip':'10.10.10.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 423 | 'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'} |
| 424 | self.onos_dhcp_table_load(config) |
| 425 | dhcp = DHCPTest(seed_ip = seed_ip, iface =onu_iface) |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 426 | cip, sip = self.dhcp_sndrcv(dhcp, update_seed = update_seed, validation = validation, mac = mac) |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 427 | return cip, sip |
| 428 | |
| 429 | @classmethod |
A R Karthick | 35495c3 | 2017-05-11 14:58:32 -0700 | [diff] [blame] | 430 | def setUpClass(cls): |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 431 | cls.update_apps_version() |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 432 | cls.voltha_attrs = dict(host = cls.VOLTHA_HOST, |
| 433 | rest_port = cls.VOLTHA_REST_PORT, |
| 434 | uplink_vlan_map = cls.VOLTHA_UPLINK_VLAN_MAP, |
| 435 | uplink_vlan_start = cls.VOLTHA_UPLINK_VLAN_START) |
| 436 | cls.voltha = VolthaCtrl(**cls.voltha_attrs) |
Thangavelu K S and Chetan Gaonker | e07a7b4 | 2017-08-23 17:43:31 +0000 | [diff] [blame] | 437 | cls.install_app_table() |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 438 | cls.olt = OltConfig(olt_conf_file = cls.olt_conf_file) |
| 439 | cls.port_map, cls.port_list = cls.olt.olt_port_map() |
| 440 | cls.switches = cls.port_map['switches'] |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 441 | cls.ponsim_ports = cls.port_map['ponsim'] |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 442 | cls.num_ports = cls.port_map['num_ports'] |
| 443 | if cls.num_ports > 1: |
| 444 | cls.num_ports -= 1 ##account for the tx port |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 445 | cls.activate_apps(cls.apps + cls.olt_apps, deactivate = True) |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 446 | cls.deactivate_apps(cls.app_dhcprelay) |
A.R Karthick | f874d03 | 2017-06-07 18:47:51 -0700 | [diff] [blame] | 447 | cls.onos_aaa_load() |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 448 | |
A.R Karthick | 3493a57 | 2017-06-07 18:28:10 -0700 | [diff] [blame] | 449 | @classmethod |
| 450 | def tearDownClass(cls): |
| 451 | '''Deactivate the olt apps and restart OVS back''' |
| 452 | apps = cls.olt_apps + ( cls.table_app,) |
| 453 | for app in apps: |
| 454 | onos_ctrl = OnosCtrl(app) |
| 455 | onos_ctrl.deactivate() |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 456 | cls.deactivate_apps(cls.app_dhcprelay) |
Thangavelu K S and Chetan Gaonker | e07a7b4 | 2017-08-23 17:43:31 +0000 | [diff] [blame] | 457 | cls.install_app_igmp() |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 458 | log_test.info('TearDownClass Restarting the Radius Server in the TA setup') |
Thangavelu K S and Chetan Gaonker | 0cf7564 | 2017-08-03 20:13:23 +0000 | [diff] [blame] | 459 | cord_test_radius_restart() |
| 460 | |
A.R Karthick | 3493a57 | 2017-06-07 18:28:10 -0700 | [diff] [blame] | 461 | @classmethod |
| 462 | def install_app_igmp(cls): |
| 463 | ##Uninstall the table app on class exit |
| 464 | OnosCtrl.uninstall_app(cls.table_app) |
| 465 | time.sleep(2) |
| 466 | log_test.info('Installing back the cord igmp app %s for subscriber test on exit' %(cls.app_file)) |
| 467 | OnosCtrl.install_app(cls.app_file) |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 468 | |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 469 | def remove_olt(self, switch_map): |
| 470 | controller = get_controller() |
| 471 | auth = ('karaf', 'karaf') |
| 472 | #remove subscriber for every port on all the voltha devices |
| 473 | for device, device_map in switch_map.iteritems(): |
| 474 | uni_ports = device_map['ports'] |
| 475 | uplink_vlan = device_map['uplink_vlan'] |
| 476 | for port in uni_ports: |
| 477 | rest_url = 'http://{}:8181/onos/olt/oltapp/{}/{}'.format(controller, |
| 478 | device, |
| 479 | port) |
| 480 | resp = requests.delete(rest_url, auth = auth) |
| 481 | if resp.status_code not in [204, 202, 200]: |
| 482 | log_test.error('Error deleting subscriber for device %s on port %s' %(device, port)) |
| 483 | else: |
| 484 | log_test.info('Deleted subscriber for device %s on port %s' %(device, port)) |
| 485 | OnosCtrl.uninstall_app(self.olt_app_file) |
| 486 | |
| 487 | def config_olt(self, switch_map): |
| 488 | controller = get_controller() |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 489 | auth = ('karaf', 'karaf') |
| 490 | #configure subscriber for every port on all the voltha devices |
| 491 | for device, device_map in switch_map.iteritems(): |
| 492 | uni_ports = device_map['ports'] |
| 493 | uplink_vlan = device_map['uplink_vlan'] |
| 494 | for port in uni_ports: |
| 495 | vlan = port |
| 496 | rest_url = 'http://{}:8181/onos/olt/oltapp/{}/{}/{}'.format(controller, |
| 497 | device, |
| 498 | port, |
| 499 | vlan) |
| 500 | resp = requests.post(rest_url, auth = auth) |
| 501 | #assert_equal(resp.ok, True) |
| 502 | |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 503 | def voltha_uni_port_toggle(self, uni_port = None): |
| 504 | ## Admin state of port is down and up |
| 505 | if not uni_port: |
| 506 | uni_port = self.INTF_RX_DEFAULT |
| 507 | cmd = 'ifconfig {} down'.format(uni_port) |
| 508 | os.system(cmd) |
| 509 | log_test.info('Admin state of uni_port is down') |
| 510 | time.sleep(30) |
| 511 | cmd = 'ifconfig {} up'.format(uni_port) |
| 512 | os.system(cmd) |
| 513 | log_test.info('Admin state of uni_port is up now') |
| 514 | time.sleep(30) |
| 515 | return |
| 516 | |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 517 | @classmethod |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 518 | def install_app_table(cls): |
| 519 | ##Uninstall the existing app if any |
| 520 | OnosCtrl.uninstall_app(cls.table_app) |
| 521 | time.sleep(2) |
| 522 | log_test.info('Installing the multi table app %s for subscriber test' %(cls.table_app_file)) |
| 523 | OnosCtrl.install_app(cls.table_app_file) |
| 524 | time.sleep(3) |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 525 | |
| 526 | @classmethod |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 527 | def activate_apps(cls, apps, deactivate = False): |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 528 | for app in apps: |
| 529 | onos_ctrl = OnosCtrl(app) |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 530 | if deactivate is True: |
| 531 | onos_ctrl.deactivate() |
| 532 | time.sleep(2) |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 533 | log_test.info('Activating app %s' %app) |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 534 | status, _ = onos_ctrl.activate() |
| 535 | assert_equal(status, True) |
| 536 | time.sleep(2) |
| 537 | |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 538 | @classmethod |
| 539 | def deactivate_apps(cls, apps): |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 540 | cls.success = True |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 541 | for app in apps: |
| 542 | onos_ctrl = OnosCtrl(app) |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 543 | log_test.info('Deactivating app %s' %app) |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 544 | status, _ = onos_ctrl.deactivate() |
| 545 | if status is False: |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 546 | cls.success = False |
| 547 | # assert_equal(status, True) |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 548 | time.sleep(2) |
| 549 | |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 550 | def random_ip(self,start_ip = '10.10.10.20', end_ip = '10.10.10.65'): |
| 551 | start = list(map(int, start_ip.split("."))) |
| 552 | end = list(map(int, end_ip.split("."))) |
| 553 | temp = start |
| 554 | ip_range = [] |
| 555 | ip_range.append(start_ip) |
| 556 | while temp != end: |
| 557 | start[3] += 1 |
| 558 | for i in (3, 2, 1): |
| 559 | if temp[i] == 255: |
| 560 | temp[i] = 0 |
| 561 | temp[i-1] += 1 |
| 562 | ip_range.append(".".join(map(str, temp))) |
| 563 | return random.choice(ip_range) |
| 564 | |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 565 | def random_mcast_ip(self,start_ip = '224.0.1.0', end_ip = '224.0.1.100'): |
| 566 | start = list(map(int, start_ip.split("."))) |
| 567 | end = list(map(int, end_ip.split("."))) |
| 568 | temp = start |
| 569 | ip_range = [] |
| 570 | ip_range.append(start_ip) |
| 571 | while temp != end: |
| 572 | start[3] += 1 |
| 573 | for i in (3, 2, 1): |
| 574 | if temp[i] == 255: |
| 575 | temp[i] = 0 |
| 576 | temp[i-1] += 1 |
| 577 | ip_range.append(".".join(map(str, temp))) |
| 578 | return random.choice(ip_range) |
| 579 | |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 580 | @classmethod |
| 581 | def dhcp_relay_setup(cls): |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 582 | did = OnosCtrl.get_device_id() |
| 583 | cls.relay_device_id = did |
| 584 | cls.relay_device_id = 'of:0000000000000001' |
| 585 | cls.olt = OltConfig(olt_conf_file = cls.olt_conf_file) |
| 586 | cls.port_map, _ = cls.olt.olt_port_map() |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 587 | if cls.port_map: |
| 588 | ##Per subscriber, we use 1 relay port |
| 589 | try: |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 590 | relay_port = cls.port_map[cls.port_map['relay_ports'][0]] |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 591 | except: |
| 592 | relay_port = cls.port_map['uplink'] |
| 593 | cls.relay_interface_port = relay_port |
| 594 | cls.relay_interfaces = (cls.port_map[cls.relay_interface_port],) |
| 595 | else: |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 596 | cls.relay_interface_port = 100 |
| 597 | cls.relay_interfaces = (g_subscriber_port_map[cls.relay_interface_port],) |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 598 | cls.relay_interfaces_last = cls.relay_interfaces |
| 599 | if cls.port_map: |
| 600 | ##generate a ip/mac client virtual interface config for onos |
| 601 | interface_list = [] |
| 602 | for port in cls.port_map['ports']: |
| 603 | port_num = cls.port_map[port] |
| 604 | if port_num == cls.port_map['uplink']: |
| 605 | continue |
| 606 | ip = cls.get_host_ip(port_num) |
| 607 | mac = cls.get_mac(port) |
| 608 | interface_list.append((port_num, ip, mac)) |
| 609 | |
| 610 | #configure dhcp server virtual interface on the same subnet as first client interface |
| 611 | relay_ip = cls.get_host_ip(interface_list[0][0]) |
| 612 | relay_mac = cls.get_mac(cls.port_map[cls.relay_interface_port]) |
| 613 | interface_list.append((cls.relay_interface_port, relay_ip, relay_mac)) |
| 614 | cls.onos_interface_load(interface_list) |
| 615 | |
| 616 | @classmethod |
| 617 | def onos_interface_load(cls, interface_list): |
| 618 | interface_dict = { 'ports': {} } |
| 619 | for port_num, ip, mac in interface_list: |
| 620 | port_map = interface_dict['ports'] |
| 621 | port = '{}/{}'.format(cls.relay_device_id, port_num) |
| 622 | port_map[port] = { 'interfaces': [] } |
| 623 | interface_list = port_map[port]['interfaces'] |
| 624 | interface_map = { 'ips' : [ '{}/{}'.format(ip, 24) ], |
| 625 | 'mac' : mac, |
| 626 | 'name': 'vir-{}'.format(port_num) |
| 627 | } |
| 628 | interface_list.append(interface_map) |
| 629 | |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 630 | cls.onos_load_config('org.onosproject.dhcprelay', interface_dict) |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 631 | cls.configs['interface_config'] = interface_dict |
| 632 | |
| 633 | @classmethod |
| 634 | def get_host_ip(cls, port): |
| 635 | if cls.host_ip_map.has_key(port): |
| 636 | return cls.host_ip_map[port] |
| 637 | cls.host_ip_map[port] = '192.168.1.{}'.format(port) |
| 638 | return cls.host_ip_map[port] |
| 639 | |
| 640 | @classmethod |
| 641 | def host_load(cls, iface): |
| 642 | '''Have ONOS discover the hosts for dhcp-relay responses''' |
| 643 | port = g_subscriber_port_map[iface] |
| 644 | host = '173.17.1.{}'.format(port) |
| 645 | cmds = ( 'ifconfig {} 0'.format(iface), |
| 646 | 'ifconfig {0} {1}'.format(iface, host), |
| 647 | 'arping -I {0} {1} -c 2'.format(iface, host), |
| 648 | 'ifconfig {} 0'.format(iface), ) |
| 649 | for c in cmds: |
| 650 | os.system(c) |
| 651 | |
| 652 | @classmethod |
| 653 | def dhcpd_conf_generate(cls, config = default_config, options = default_options, |
| 654 | subnet = default_subnet_config): |
| 655 | conf = '' |
| 656 | for k, v in config.items(): |
| 657 | conf += '{} {};\n'.format(k, v) |
| 658 | |
| 659 | opts = '' |
| 660 | for k, v in options: |
| 661 | opts += 'option {} {};\n'.format(k, v) |
| 662 | |
| 663 | subnet_config = '' |
| 664 | for _, v in subnet: |
| 665 | subnet_config += '{}\n'.format(v) |
| 666 | |
| 667 | return '{}{}{}'.format(conf, opts, subnet_config) |
| 668 | |
| 669 | @classmethod |
| 670 | def dhcpd_start(cls, intf_list = None, |
| 671 | config = default_config, options = default_options, |
| 672 | subnet = default_subnet_config): |
| 673 | '''Start the dhcpd server by generating the conf file''' |
| 674 | if intf_list is None: |
| 675 | intf_list = cls.relay_interfaces |
| 676 | ##stop dhcpd if already running |
| 677 | cls.dhcpd_stop() |
| 678 | dhcp_conf = cls.dhcpd_conf_generate(config = config, options = options, |
| 679 | subnet = subnet) |
| 680 | ##first touch dhcpd.leases if it doesn't exist |
| 681 | lease_file = '{}/dhcpd.leases'.format(cls.dhcp_data_dir) |
| 682 | if os.access(lease_file, os.F_OK) is False: |
| 683 | with open(lease_file, 'w') as fd: pass |
| 684 | |
| 685 | conf_file = '{}/dhcpd.conf'.format(cls.dhcp_data_dir) |
| 686 | with open(conf_file, 'w') as fd: |
| 687 | fd.write(dhcp_conf) |
| 688 | |
| 689 | #now configure the dhcpd interfaces for various subnets |
| 690 | index = 0 |
| 691 | intf_info = [] |
| 692 | for ip,_ in subnet: |
| 693 | intf = intf_list[index] |
| 694 | mac = cls.get_mac(intf) |
| 695 | intf_info.append((ip, mac)) |
| 696 | index += 1 |
| 697 | os.system('ifconfig {} {}'.format(intf, ip)) |
| 698 | |
| 699 | intf_str = ','.join(intf_list) |
| 700 | dhcpd_cmd = '/usr/sbin/dhcpd -4 --no-pid -cf {0} -lf {1} {2}'.format(conf_file, lease_file, intf_str) |
| 701 | log_test.info('Starting DHCPD server with command: %s' %dhcpd_cmd) |
| 702 | ret = os.system(dhcpd_cmd) |
| 703 | assert_equal(ret, 0) |
| 704 | time.sleep(3) |
| 705 | cls.relay_interfaces_last = cls.relay_interfaces |
| 706 | cls.relay_interfaces = intf_list |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 707 | cls.onos_dhcp_relay_load_1(*intf_info[0]) |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 708 | |
| 709 | @classmethod |
| 710 | def dhcpd_stop(cls): |
| 711 | os.system('pkill -9 dhcpd') |
| 712 | for intf in cls.relay_interfaces: |
| 713 | os.system('ifconfig {} 0'.format(intf)) |
| 714 | |
| 715 | cls.relay_interfaces = cls.relay_interfaces_last |
| 716 | |
| 717 | @classmethod |
| 718 | def get_mac(cls, iface): |
| 719 | if cls.interface_to_mac_map.has_key(iface): |
| 720 | return cls.interface_to_mac_map[iface] |
| 721 | mac = get_mac(iface, pad = 0) |
| 722 | cls.interface_to_mac_map[iface] = mac |
| 723 | return mac |
| 724 | |
Thangavelu K S and Chetan Gaonker | e07a7b4 | 2017-08-23 17:43:31 +0000 | [diff] [blame] | 725 | def send_recv(self, mac=None, update_seed = False, validate = True, dhcp_obj = None): |
| 726 | if dhcp_obj is None: |
| 727 | dhcp_obj = self.dhcp |
| 728 | cip, sip = dhcp_obj.discover(mac = mac, update_seed = update_seed) |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 729 | if validate: |
| 730 | assert_not_equal(cip, None) |
| 731 | assert_not_equal(sip, None) |
| 732 | log_test.info('Got dhcp client IP %s from server %s for mac %s' % |
Thangavelu K S and Chetan Gaonker | e07a7b4 | 2017-08-23 17:43:31 +0000 | [diff] [blame] | 733 | (cip, sip, dhcp_obj.get_mac(cip)[0])) |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 734 | return cip,sip |
| 735 | |
Thangavelu K S and Chetan Gaonker | e07a7b4 | 2017-08-23 17:43:31 +0000 | [diff] [blame] | 736 | def send_recv_function_in_thread(self, mac=None, update_seed = False, validate = False, dhcp_obj = None): |
| 737 | self.success = True |
| 738 | cip, sip = self.send_recv(mac=mac,update_seed=update_seed,validate=validate,dhcp_obj = dhcp_obj) |
| 739 | if cip is None or sip is None: |
| 740 | self.success = False |
| 741 | |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 742 | @classmethod |
| 743 | def dhcpd_conf_generate(cls, config = default_config, options = default_options, |
| 744 | subnet = default_subnet_config): |
| 745 | conf = '' |
| 746 | for k, v in config.items(): |
| 747 | conf += '{} {};\n'.format(k, v) |
| 748 | |
| 749 | opts = '' |
| 750 | for k, v in options: |
| 751 | opts += 'option {} {};\n'.format(k, v) |
| 752 | |
| 753 | subnet_config = '' |
| 754 | for _, v in subnet: |
| 755 | subnet_config += '{}\n'.format(v) |
| 756 | |
| 757 | return '{}{}{}'.format(conf, opts, subnet_config) |
| 758 | |
| 759 | @classmethod |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 760 | def onos_dhcp_relay_load_1(cls, server_ip, server_mac): |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 761 | relay_device_map = '{}/{}'.format(cls.relay_device_id, cls.relay_interface_port) |
| 762 | dhcp_dict = {'apps':{'org.onosproject.dhcp-relay':{'dhcprelay': |
| 763 | {'dhcpserverConnectPoint':relay_device_map, |
| 764 | 'serverip':server_ip, |
| 765 | 'servermac':server_mac |
| 766 | } |
| 767 | } |
| 768 | } |
| 769 | } |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 770 | cls.onos_load_config(cls.app_dhcprelay,dhcp_dict) |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 771 | cls.configs['relay_config'] = dhcp_dict |
| 772 | |
| 773 | @classmethod |
| 774 | def dhcp_relay_cleanup(cls): |
| 775 | ##reset the ONOS port configuration back to default |
| 776 | for config in cls.configs.items(): |
| 777 | OnosCtrl.delete(config) |
| 778 | # if cls.onos_restartable is True: |
| 779 | # log_test.info('Cleaning up dhcp relay config by restarting ONOS with default network cfg') |
| 780 | # return cord_test_onos_restart(config = {}) |
| 781 | |
| 782 | |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 783 | def tls_flow_check(self, olt_ports, cert_info = None, multiple_sub = False): |
| 784 | if multiple_sub is True: |
| 785 | olt_nni_port = olt_ports.tx_port |
| 786 | olt_uni_port = olt_ports.rx_port |
| 787 | else: |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 788 | olt_uni_port = olt_ports |
| 789 | |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 790 | def tls_fail_cb(): |
| 791 | log_test.info('TLS verification failed') |
| 792 | if cert_info is None: |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 793 | tls = TLSAuthTest(fail_cb = tls_fail_cb, intf = olt_uni_port) |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 794 | log_test.info('Running subscriber %s tls auth test with valid TLS certificate' %olt_uni_port) |
| 795 | tls.runTest() |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 796 | if tls.failTest is True: |
| 797 | self.success = False |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 798 | assert_equal(tls.failTest, False) |
| 799 | if cert_info == "no_cert": |
| 800 | tls = TLSAuthTest(fail_cb = tls_fail_cb, intf = olt_uni_port, client_cert = '') |
| 801 | log_test.info('Running subscriber %s tls auth test with no TLS certificate' %olt_uni_port) |
| 802 | tls.runTest() |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 803 | if tls.failTest is False: |
| 804 | self.success = False |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 805 | assert_equal(tls.failTest, True) |
| 806 | if cert_info == "invalid_cert": |
| 807 | tls = TLSAuthTest(fail_cb = tls_fail_cb, intf = olt_uni_port, client_cert = self.CLIENT_CERT_INVALID) |
| 808 | log_test.info('Running subscriber %s tls auth test with invalid TLS certificate' %olt_uni_port) |
| 809 | tls.runTest() |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 810 | if tls.failTest is False: |
| 811 | self.success = False |
| 812 | assert_equal(tls.failTest, True) |
| 813 | if cert_info == "same_cert": |
| 814 | tls = TLSAuthTest(fail_cb = tls_fail_cb, intf = olt_uni_port) |
Thangavelu K S and Chetan Gaonker | 0cf7564 | 2017-08-03 20:13:23 +0000 | [diff] [blame] | 815 | log_test.info('Running subscriber %s tls auth test with same valid TLS certificate' %olt_uni_port) |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 816 | tls.runTest() |
Thangavelu K S and Chetan Gaonker | 0cf7564 | 2017-08-03 20:13:23 +0000 | [diff] [blame] | 817 | if tls.failTest is True: |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 818 | self.success = False |
Thangavelu K S and Chetan Gaonker | 0cf7564 | 2017-08-03 20:13:23 +0000 | [diff] [blame] | 819 | assert_equal(tls.failTest, False) |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 820 | if cert_info == "app_deactivate" or cert_info == "restart_radius" or cert_info == "disable_olt_device" or \ |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 821 | cert_info == "uni_port_admin_down" or cert_info == "restart_olt_device" or cert_info == "restart_onu_device": |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 822 | tls = TLSAuthTest(fail_cb = tls_fail_cb, intf = olt_uni_port, client_cert = self.CLIENT_CERT_INVALID) |
| 823 | log_test.info('Running subscriber %s tls auth test with %s' %(olt_uni_port,cert_info)) |
| 824 | tls.runTest() |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 825 | if tls.failTest is False: |
| 826 | self.success = False |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 827 | assert_equal(tls.failTest, True) |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 828 | self.test_status = True |
| 829 | return self.test_status |
A R Karthick | 35495c3 | 2017-05-11 14:58:32 -0700 | [diff] [blame] | 830 | |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 831 | def dhcp_flow_check(self, olt_ports, negative_test = None, multiple_sub = False): |
| 832 | if multiple_sub is True: |
| 833 | olt_nni_port = olt_ports.tx_port |
| 834 | onu_iface = olt_ports.rx_port |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 835 | dhcp_server_startip = self.random_ip() |
| 836 | random_mac = '00:00:00:0a:0a:' + hex(random.randrange(50,254)).split('x')[1] |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 837 | else: |
| 838 | onu_iface = olt_ports |
| 839 | dhcp_server_startip = '10.10.10.20' |
| 840 | random_mac = None |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 841 | self.success = True |
| 842 | |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 843 | if negative_test is None: |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 844 | cip, sip = self.dhcp_request(onu_iface, update_seed = True, validation = 'skip', startip = dhcp_server_startip, mac = random_mac) |
| 845 | if cip == None or sip == None: |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 846 | self.success = False |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 847 | self.test_status = False |
| 848 | assert_not_equal(cip,None) |
| 849 | assert_not_equal(sip,None) |
| 850 | else: |
| 851 | log_test.info('Subscriber %s client ip %s from server %s' %(onu_iface, cip, sip)) |
| 852 | self.test_status = True |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 853 | |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 854 | if negative_test == "interrupting_dhcp_flows": |
| 855 | cip, sip = self.dhcp_request(onu_iface, update_seed = True, validation = False) |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 856 | if cip is not None: |
| 857 | self.success = False |
| 858 | assert_equal(cip,None) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 859 | log_test.info('Subscriber %s not got client ip %s from server' %(onu_iface, cip)) |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 860 | self.test_status = True |
| 861 | |
| 862 | if negative_test == "invalid_src_mac_broadcast": |
| 863 | config = {'startip':'10.10.10.20', 'endip':'10.10.10.69', |
| 864 | 'ip':'10.10.10.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 865 | 'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'} |
| 866 | self.onos_dhcp_table_load(config) |
| 867 | self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = onu_iface) |
| 868 | cip, sip, mac, _ = self.dhcp.only_discover(mac='ff:ff:ff:ff:ff:ff') |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 869 | |
| 870 | if cip is not None: |
| 871 | self.success = False |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 872 | log_test.info('ONOS dhcp server rejected client discover with invalid source mac as expected self.success = %s '%self.success) |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 873 | assert_equal(cip,None) |
| 874 | log_test.info('ONOS dhcp server rejected client discover with invalid source mac as expected') |
| 875 | self.test_status = True |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 876 | |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 877 | if negative_test == "invalid_src_mac_multicast": |
| 878 | config = {'startip':'10.10.10.20', 'endip':'10.10.10.69', |
| 879 | 'ip':'10.10.10.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 880 | 'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'} |
| 881 | self.onos_dhcp_table_load(config) |
| 882 | self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = onu_iface) |
| 883 | cip, sip, mac, _ = self.dhcp.only_discover(mac='01:80:c2:91:02:e4') |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 884 | if cip is not None: |
| 885 | self.success = False |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 886 | assert_equal(cip,None) |
| 887 | log_test.info('ONOS dhcp server rejected client discover with invalid source mac as expected') |
| 888 | self.test_status = True |
| 889 | |
| 890 | if negative_test == "invalid_src_mac_junk": |
| 891 | config = {'startip':'10.10.10.20', 'endip':'10.10.10.69', |
| 892 | 'ip':'10.10.10.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 893 | 'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'} |
| 894 | self.onos_dhcp_table_load(config) |
| 895 | self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = onu_iface) |
| 896 | cip, sip, mac, _ = self.dhcp.only_discover(mac='00:00:00:00:00:00') |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 897 | if cip is not None: |
| 898 | self.success = False |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 899 | assert_equal(cip,None) |
| 900 | log_test.info('ONOS dhcp server rejected client discover with invalid source mac as expected') |
| 901 | self.test_status = True |
| 902 | |
| 903 | if negative_test == "request_release": |
| 904 | config = {'startip':'10.10.100.20', 'endip':'10.10.100.230', |
| 905 | 'ip':'10.10.100.2', 'mac': "ca:fe:ca:fe:8a:fe", |
| 906 | 'subnet': '255.255.255.0', 'broadcast':'10.10.100.255', 'router':'10.10.100.1'} |
| 907 | self.onos_dhcp_table_load(config) |
| 908 | self.dhcp = DHCPTest(seed_ip = '10.10.100.10', iface = onu_iface) |
| 909 | cip, sip = self.dhcp_sndrcv(self.dhcp) |
| 910 | log_test.info('Releasing ip %s to server %s' %(cip, sip)) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 911 | if not self.dhcp.release(cip): |
| 912 | self.success = False |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 913 | assert_equal(self.dhcp.release(cip), True) |
| 914 | log_test.info('Triggering DHCP discover again after release') |
| 915 | cip2, sip2 = self.dhcp_sndrcv(self.dhcp, update_seed = True) |
| 916 | log_test.info('Verifying released IP was given back on rediscover') |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 917 | if not cip == cip2: |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 918 | self.success = False |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 919 | assert_equal(cip, cip2) |
| 920 | log_test.info('Test done. Releasing ip %s to server %s' %(cip2, sip2)) |
| 921 | assert_equal(self.dhcp.release(cip2), True) |
| 922 | self.test_status = True |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 923 | |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 924 | if negative_test == "starvation_positive": |
| 925 | config = {'startip':'193.170.1.20', 'endip':'193.170.1.69', |
| 926 | 'ip':'193.170.1.2', 'mac': "ca:fe:c2:fe:cc:fe", |
| 927 | 'subnet': '255.255.255.0', 'broadcast':'192.168.1.255', 'router': '192.168.1.1'} |
| 928 | self.onos_dhcp_table_load(config) |
| 929 | self.dhcp = DHCPTest(seed_ip = '192.169.1.1', iface = onu_iface) |
| 930 | ip_map = {} |
| 931 | for i in range(10): |
| 932 | cip, sip = self.dhcp_sndrcv(self.dhcp, update_seed = True) |
| 933 | if ip_map.has_key(cip): |
| 934 | self.success = False |
| 935 | log_test.info('IP %s given out multiple times' %cip) |
| 936 | assert_equal(False, ip_map.has_key(cip)) |
| 937 | ip_map[cip] = sip |
| 938 | self.test_status = True |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 939 | |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 940 | if negative_test == "starvation_negative": |
| 941 | config = {'startip':'182.17.0.20', 'endip':'182.17.0.69', |
| 942 | 'ip':'182.17.0.2', 'mac': "ca:fe:c3:fe:ca:fe", |
| 943 | 'subnet': '255.255.255.0', 'broadcast':'182.17.0.255', 'router':'182.17.0.1'} |
| 944 | self.onos_dhcp_table_load(config) |
| 945 | self.dhcp = DHCPTest(seed_ip = '182.17.0.1', iface = onu_iface) |
| 946 | log_test.info('Verifying passitive case') |
| 947 | for x in xrange(50): |
| 948 | mac = RandMAC()._fix() |
| 949 | self.dhcp_sndrcv(self.dhcp,mac = mac) |
| 950 | log_test.info('Verifying negative case') |
| 951 | cip, sip = self.dhcp_sndrcv(self.dhcp,update_seed = True) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 952 | if cip or sip is not None: |
| 953 | self.success = False |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 954 | assert_equal(cip, None) |
| 955 | assert_equal(sip, None) |
| 956 | self.test_status = True |
| 957 | self.success = True |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 958 | |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 959 | if negative_test == "multiple_discover": |
| 960 | config = {'startip':'10.10.10.20', 'endip':'10.10.10.69', |
| 961 | 'ip':'10.10.10.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 962 | 'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'} |
| 963 | self.onos_dhcp_table_load(config) |
| 964 | self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = onu_iface) |
| 965 | cip, sip, mac, _ = self.dhcp.only_discover() |
| 966 | log_test.info('Got dhcp client IP %s from server %s for mac %s . Not going to send DHCPREQUEST.' % |
| 967 | (cip, sip, mac) ) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 968 | if cip is None: |
| 969 | self.success = False |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 970 | assert_not_equal(cip, None) |
| 971 | log_test.info('Triggering DHCP discover again.') |
| 972 | new_cip, new_sip, new_mac, _ = self.dhcp.only_discover() |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 973 | if not new_cip == cip: |
| 974 | self.success = False |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 975 | assert_equal(new_cip, cip) |
| 976 | log_test.info('client got same IP as expected when sent 2nd discovery') |
| 977 | self.test_status = True |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 978 | # self.success = True |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 979 | if negative_test == "multiple_requests": |
| 980 | config = {'startip':'10.10.10.20', 'endip':'10.10.10.69', |
| 981 | 'ip':'10.10.10.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 982 | 'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'} |
| 983 | self.onos_dhcp_table_load(config) |
| 984 | self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = onu_iface) |
| 985 | log_test.info('Sending DHCP discover and DHCP request.') |
| 986 | cip, sip = self.dhcp_sndrcv(self.dhcp,update_seed = True) |
| 987 | mac = self.dhcp.get_mac(cip)[0] |
| 988 | log_test.info("Sending DHCP request again.") |
| 989 | new_cip, new_sip = self.dhcp.only_request(cip, mac) |
| 990 | assert_equal(new_cip,cip) |
| 991 | log_test.info('server offered same IP to clain for multiple requests, as expected') |
| 992 | self.test_status = True |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 993 | # self.success = True |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 994 | if negative_test == "desired_ip_address": |
| 995 | config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', |
| 996 | 'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 997 | 'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'} |
| 998 | self.onos_dhcp_table_load(config) |
| 999 | self.dhcp = DHCPTest(seed_ip = '20.20.20.50', iface = onu_iface) |
| 1000 | cip, sip, mac, _ = self.dhcp.only_discover(desired = True) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 1001 | if cip or sip is None: |
| 1002 | self.success = False |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 1003 | assert_not_equal(cip, None) |
| 1004 | log_test.info('Got dhcp client IP %s from server %s for mac %s .' % |
| 1005 | (cip, sip, mac)) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 1006 | if not self.dhcp.seed_ip == cip: |
| 1007 | self.success = False |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 1008 | assert_equal(cip,self.dhcp.seed_ip) |
| 1009 | log_test.info('ONOS dhcp server offered client requested IP %s as expected'%self.dhcp.seed_ip) |
| 1010 | self.test_status = True |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 1011 | # self.success = True |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 1012 | if negative_test == "desired_out_of_pool_ip_address": |
| 1013 | config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', |
| 1014 | 'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 1015 | 'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'} |
| 1016 | self.onos_dhcp_table_load(config) |
| 1017 | self.dhcp = DHCPTest(seed_ip = '20.20.20.75', iface = onu_iface) |
| 1018 | cip, sip, mac, _ = self.dhcp.only_discover(desired = True) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 1019 | if cip or sip is None: |
| 1020 | self.success = False |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 1021 | assert_not_equal(cip, None) |
| 1022 | log_test.info('Got dhcp client IP %s from server %s for mac %s .' % |
| 1023 | (cip, sip, mac) ) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 1024 | if self.dhcp.seed_ip == cip: |
| 1025 | self.success = False |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 1026 | assert_not_equal(cip,self.dhcp.seed_ip) |
| 1027 | log_test.info('server offered IP from its pool of IPs when requested out of pool IP, as expected') |
| 1028 | self.test_status = True |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 1029 | # self.success = True |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 1030 | if negative_test == "dhcp_renew": |
| 1031 | config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', |
| 1032 | 'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 1033 | 'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'} |
| 1034 | self.onos_dhcp_table_load(config) |
| 1035 | self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = onu_iface) |
| 1036 | cip, sip, mac, _ = self.dhcp.only_discover() |
| 1037 | log_test.info('Got dhcp client IP %s from server %s for mac %s .' % |
| 1038 | (cip, sip, mac) ) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 1039 | if cip or sip is None: |
| 1040 | self.success = False |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 1041 | assert_not_equal(cip, None) |
| 1042 | new_cip, new_sip, lval = self.dhcp.only_request(cip, mac, renew_time = True) |
| 1043 | log_test.info('waiting renew time %d seconds to send next request packet'%lval) |
| 1044 | time.sleep(lval) |
| 1045 | latest_cip, latest_sip, lval = self.dhcp.only_request(cip, mac, renew_time = True) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 1046 | if not latest_cip == cip: |
| 1047 | self.success = False |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 1048 | assert_equal(latest_cip,cip) |
| 1049 | log_test.info('client got same IP after renew time, as expected') |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 1050 | self.test_status = True |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 1051 | # self.success = True |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 1052 | if negative_test == "dhcp_rebind": |
| 1053 | config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', |
| 1054 | 'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 1055 | 'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'} |
| 1056 | self.onos_dhcp_table_load(config) |
| 1057 | self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = onu_iface) |
| 1058 | cip, sip, mac, _ = self.dhcp.only_discover() |
| 1059 | log_test.info('Got dhcp client IP %s from server %s for mac %s .' % |
| 1060 | (cip, sip, mac) ) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 1061 | if cip or sip is None: |
| 1062 | self.success = False |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 1063 | assert_not_equal(cip, None) |
| 1064 | new_cip, new_sip, lval = self.dhcp.only_request(cip, mac, rebind_time = True) |
| 1065 | log_test.info('waiting rebind time %d seconds to send next request packet'%lval) |
| 1066 | time.sleep(lval) |
| 1067 | latest_cip, latest_sip = self.dhcp.only_request(new_cip, mac) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 1068 | if not latest_cip == cip: |
| 1069 | self.success = False |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 1070 | assert_equal(latest_cip,cip) |
| 1071 | log_test.info('client got same IP after rebind time, as expected') |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 1072 | self.test_status = True |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 1073 | # self.success = True |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 1074 | return self.test_status |
| 1075 | |
Thangavelu K S and Chetan Gaonker | e07a7b4 | 2017-08-23 17:43:31 +0000 | [diff] [blame] | 1076 | def dhcprelay_flow_check(self, seed_ip = None, iface = None, mac= None, test_scenario = None): |
| 1077 | self.success = True |
| 1078 | if test_scenario is None: |
| 1079 | self.dhcp = DHCPTest(seed_ip = seed_ip, iface = iface) |
| 1080 | self.send_recv(mac=mac) |
| 1081 | elif test_scenario == 'multiple_discover': |
| 1082 | self.dhcp_2 = DHCPTest(seed_ip = seed_ip, iface = iface) |
| 1083 | cip, sip, mac, _ = self.dhcp_2.only_discover(mac=mac) |
| 1084 | log_test.info('Got dhcp client IP %s from server %s for mac %s . Not going to send DHCP REQUEST.' % |
| 1085 | (cip, sip, mac) ) |
| 1086 | if cip is None: |
| 1087 | self.success = False |
| 1088 | assert_not_equal(cip, None) |
| 1089 | log_test.info('Triggering DHCP discover again.') |
| 1090 | new_cip, new_sip, new_mac, _ = self.dhcp_2.only_discover(mac=mac) |
| 1091 | if new_cip != cip: |
| 1092 | self.success = False |
| 1093 | assert_equal(new_cip, cip) |
| 1094 | log_test.info('Got same ip to same the client when sent discover again, as expected') |
| 1095 | |
| 1096 | elif test_scenario == 'desired_ip': |
| 1097 | self.dhcp_3 = DHCPTest(seed_ip = '192.168.1.31', iface = iface) |
| 1098 | cip, sip, mac, _ = self.dhcp_3.only_discover(mac=mac,desired = True) |
| 1099 | if cip != self.dhcp_3.seed_ip: |
| 1100 | self.success = False |
| 1101 | assert_equal(cip,self.dhcp_3.seed_ip) |
| 1102 | log_test.info('Got dhcp client desired IP %s from server %s for mac %s as expected' % |
| 1103 | (cip, sip, mac) ) |
| 1104 | |
| 1105 | elif test_scenario == 'out_of_pool_ip': |
| 1106 | self.dhcp = DHCPTest(seed_ip = '20.20.20.35', iface = iface) |
| 1107 | cip, sip, mac, _ = self.dhcp.only_discover(mac= mac,desired = True) |
| 1108 | if cip is None or cip == self.dhcp.seed_ip: |
| 1109 | self.success = False |
| 1110 | assert_not_equal(cip,None) |
| 1111 | assert_not_equal(cip,self.dhcp.seed_ip) |
| 1112 | log_test.info('server offered IP from its pool when requested out of pool IP, as expected') |
| 1113 | elif test_scenario == 'multiple_discover_1': |
| 1114 | pass |
| 1115 | return self.success |
| 1116 | |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 1117 | def recv_channel_cb(self, pkt): |
| 1118 | ##First verify that we have received the packet for the joined instance |
| 1119 | chan = self.subscriber.caddr(pkt[IP].dst) |
| 1120 | assert_equal(chan in self.subscriber.join_map.keys(), True) |
| 1121 | recv_time = monotonic.monotonic() * 1000000 |
| 1122 | join_time = self.subscriber.join_map[chan][self.subscriber.STATS_JOIN].start |
| 1123 | delta = recv_time - join_time |
| 1124 | self.subscriber.join_rx_stats.update(packets=1, t = delta, usecs = True) |
| 1125 | self.subscriber.channel_update(chan, self.subscriber.STATS_RX, 1, t = delta) |
| 1126 | log_test.debug('Packet received in %.3f usecs for group %s after join' %(delta, pkt[IP].dst)) |
| 1127 | self.test_status = True |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 1128 | |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 1129 | def traffic_verify(self, subscriber): |
| 1130 | # if subscriber.has_service('TRAFFIC'): |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 1131 | url = 'http://www.google.com' |
| 1132 | resp = requests.get(url) |
| 1133 | self.test_status = resp.ok |
| 1134 | if resp.ok == False: |
| 1135 | log_test.info('Subscriber %s failed get from url %s with status code %d' |
| 1136 | %(subscriber.name, url, resp.status_code)) |
| 1137 | else: |
| 1138 | log_test.info('GET request from %s succeeded for subscriber %s' |
| 1139 | %(url, subscriber.name)) |
| 1140 | return self.test_status |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 1141 | |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 1142 | def igmp_flow_check(self, subscriber, multiple_sub = False): |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 1143 | chan = 0 |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 1144 | for i in range(self.VOLTHA_IGMP_ITERATIONS + subscriber.num_channels): |
| 1145 | if subscriber.num_channels == 1: |
Thangavelu K S | 9a63733 | 2017-08-01 23:22:23 +0000 | [diff] [blame] | 1146 | if i != 0: |
| 1147 | subscriber.channel_leave(chan, src_list = subscriber.src_list) |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 1148 | chan = subscriber.channel_join(chan, delay = 2, src_list = subscriber.src_list) |
| 1149 | else: |
| 1150 | chan = subscriber.channel_join_next(delay = 2, src_list = subscriber.src_list) |
| 1151 | self.num_joins += 1 |
| 1152 | while self.num_joins < self.num_subscribers: |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 1153 | time.sleep(5) |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 1154 | log_test.info('All subscribers have joined the channel') |
| 1155 | # for i in range(1): |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 1156 | time.sleep(0.5) |
| 1157 | self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 1, src_list = subscriber.src_list) |
| 1158 | #log_test.info('Leaving channel %d for subscriber on port %s' %(chan, subscriber.rx_port)) |
| 1159 | #subscriber.channel_leave(chan, src_list = subscriber.src_list) |
| 1160 | time.sleep(5) |
| 1161 | # log_test.info('Interface %s Join RX stats for subscriber, %s' %(subscriber.iface,subscriber.join_rx_stats)) |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 1162 | if subscriber.num_channels == 1: |
| 1163 | pass |
| 1164 | elif chan != 0: |
| 1165 | #Should not receive packets for this channel |
| 1166 | self.recv_timeout = True |
| 1167 | subscriber.recv_timeout = True |
| 1168 | subscriber.channel_receive(chan-1, cb = subscriber.recv_channel_cb, count = 1, src_list = subscriber.src_list) |
| 1169 | subscriber.recv_timeout = False |
| 1170 | self.recv_timeout = False |
Thangavelu K S | 9a63733 | 2017-08-01 23:22:23 +0000 | [diff] [blame] | 1171 | log_test.info('Joining channel %d for subscriber port %s' %(chan, subscriber.rx_port)) |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 1172 | # subscriber.channel_join(chan, delay = 2, src_list = subscriber.src_list) |
Thangavelu K S | 9a63733 | 2017-08-01 23:22:23 +0000 | [diff] [blame] | 1173 | # chan = subscriber.num_channels - i |
| 1174 | # self.test_status = True |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 1175 | return self.test_status |
Thangavelu K S | 9a63733 | 2017-08-01 23:22:23 +0000 | [diff] [blame] | 1176 | |
| 1177 | def igmp_join_next_channel_flow_check(self, subscriber, multiple_sub = False): |
| 1178 | chan = 0 |
| 1179 | for i in range(self.VOLTHA_IGMP_ITERATIONS + subscriber.num_channels): |
| 1180 | # if subscriber.num_channels == 1: |
| 1181 | # chan = subscriber.channel_join(chan, delay = 2, src_list = subscriber.src_list) |
| 1182 | # else: |
| 1183 | chan = subscriber.channel_join_next(delay = 2, src_list = subscriber.src_list) |
| 1184 | self.num_joins += 1 |
| 1185 | while self.num_joins < self.num_subscribers: |
| 1186 | time.sleep(5) |
| 1187 | log_test.info('All subscribers have joined the channel') |
| 1188 | # for i in range(1): |
| 1189 | time.sleep(0.5) |
| 1190 | self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 1, src_list = subscriber.src_list) |
| 1191 | #log_test.info('Leaving channel %d for subscriber on port %s' %(chan, subscriber.rx_port)) |
| 1192 | #subscriber.channel_leave(chan, src_list = subscriber.src_list) |
| 1193 | time.sleep(5) |
| 1194 | # log_test.info('Interface %s Join RX stats for subscriber, %s' %(subscriber.iface,subscriber.join_rx_stats)) |
| 1195 | # if subscriber.num_channels == 1: |
| 1196 | # pass |
| 1197 | # elif chan != 0: |
| 1198 | # pass |
| 1199 | #Should not receive packets for this channel |
| 1200 | # log_test.info |
| 1201 | # self.recv_timeout = True |
| 1202 | # subscriber.recv_timeout = True |
| 1203 | # subscriber.channel_receive(chan-1, cb = subscriber.recv_channel_cb, count = 1, src_list = subscriber.src_list) |
| 1204 | # subscriber.recv_timeout = False |
| 1205 | # self.recv_timeout = False |
| 1206 | # log_test.info('Joining channel %d for subscriber port %s' %(chan, subscriber.rx_port)) |
| 1207 | # subscriber.channel_join(chan, delay = 2, src_list = subscriber.src_list) |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 1208 | chan = subscriber.num_channels - i |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 1209 | # self.test_status = True |
Thangavelu K S and Chetan Gaonker | 0cf7564 | 2017-08-03 20:13:23 +0000 | [diff] [blame] | 1210 | return self.test_status |
| 1211 | |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 1212 | |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 1213 | def igmp_leave_flow_check(self, subscriber, multiple_sub = False): |
| 1214 | chan = 0 |
| 1215 | for i in range(self.VOLTHA_IGMP_ITERATIONS): |
| 1216 | subscriber.channel_join(chan, delay = 2, src_list = subscriber.src_list) |
| 1217 | self.num_joins += 1 |
| 1218 | while self.num_joins < self.num_subscribers: |
| 1219 | time.sleep(5) |
| 1220 | log_test.info('All subscribers have joined the channel') |
| 1221 | # for i in range(1): |
| 1222 | time.sleep(0.5) |
| 1223 | self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 1, src_list = subscriber.src_list) |
| 1224 | log_test.info('Leaving channel %d for subscriber on port %s' %(chan, subscriber.rx_port)) |
| 1225 | subscriber.channel_leave(chan, src_list = subscriber.src_list) |
| 1226 | time.sleep(10) |
| 1227 | # log_test.info('Interface %s Join RX stats for subscriber, %s' %(subscriber.iface,subscriber.join_rx_stats)) |
| 1228 | #Should not receive packets for this subscriber |
| 1229 | self.recv_timeout = True |
| 1230 | subscriber.recv_timeout = True |
| 1231 | subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 1, src_list = subscriber.src_list) |
| 1232 | subscriber.recv_timeout = False |
| 1233 | self.recv_timeout = False |
| 1234 | # log_test.info('Joining channel %d for subscriber port %s' %(chan, subscriber.rx_port)) |
| 1235 | # subscriber.channel_join(chan, delay = 2, src_list = subscriber.src_list) |
| 1236 | # self.test_status = True |
| 1237 | return self.test_status |
| 1238 | |
| 1239 | |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 1240 | def igmp_flow_check_join_change_to_exclude(self, subscriber, multiple_sub = False): |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 1241 | chan = 0 |
Thangavelu K S | 9a63733 | 2017-08-01 23:22:23 +0000 | [diff] [blame] | 1242 | #for i in range(self.VOLTHA_IGMP_ITERATIONS): |
| 1243 | for i in range(3): |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 1244 | subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list) |
Thangavelu K S | 9a63733 | 2017-08-01 23:22:23 +0000 | [diff] [blame] | 1245 | self.num_joins += 1 |
| 1246 | while self.num_joins < self.num_subscribers: |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 1247 | time.sleep(5) |
Thangavelu K S | 9a63733 | 2017-08-01 23:22:23 +0000 | [diff] [blame] | 1248 | log_test.info('All subscribers have joined the channel') |
| 1249 | self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 5, src_list = subscriber.src_list[1]) |
| 1250 | time.sleep(5) |
| 1251 | log_test.info('Leaving channel %d for subscriber on port %s from specific source address %s and waited till GMI timer expires' %(chan, subscriber.rx_port, subscriber.src_list[0])) |
| 1252 | subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list[0], record_type = IGMP_V3_GR_TYPE_CHANGE_TO_EXCLUDE) |
| 1253 | #### Adding delay till igmp timer expire data traffic is received from source specific of subscriber.src_list[0] |
| 1254 | time.sleep(60) |
| 1255 | self.recv_timeout = False |
| 1256 | subscriber.recv_timeout = False |
| 1257 | self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 1, src_list = subscriber.src_list[1]) |
| 1258 | if self.test_status is True: |
| 1259 | self.test_status = subscriber.channel_not_receive(chan, cb = subscriber.recv_channel_cb, count = 1, src_list = subscriber.src_list[0]) |
| 1260 | if self.test_status is False: |
| 1261 | subscriber.channel_leave(chan, src_list = subscriber.src_list) |
| 1262 | continue |
| 1263 | subscriber.recv_timeout = False |
| 1264 | self.recv_timeout = False |
| 1265 | subscriber.channel_leave(chan, src_list = subscriber.src_list) |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 1266 | # self.test_status = True |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 1267 | return self.test_status |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 1268 | |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 1269 | def igmp_flow_check_join_change_to_exclude_again_include_back(self, subscriber, multiple_sub = False): |
Thangavelu K S | 9a63733 | 2017-08-01 23:22:23 +0000 | [diff] [blame] | 1270 | chan = 0 |
| 1271 | #for i in range(self.VOLTHA_IGMP_ITERATIONS): |
| 1272 | for i in range(3): |
| 1273 | subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list) |
| 1274 | self.num_joins += 1 |
| 1275 | while self.num_joins < self.num_subscribers: |
| 1276 | time.sleep(5) |
| 1277 | log_test.info('All subscribers have joined the channel') |
| 1278 | self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 5, src_list = subscriber.src_list[1]) |
| 1279 | time.sleep(5) |
| 1280 | log_test.info('Leaving channel %d for subscriber on port %s from specific source address %s and waited till GMI timer expires' %(chan, subscriber.rx_port, subscriber.src_list[0])) |
| 1281 | subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list[0], record_type = IGMP_V3_GR_TYPE_CHANGE_TO_EXCLUDE) |
| 1282 | #### Adding delay till igmp timer expire data traffic is received from source specific of subscriber.src_list[0] |
| 1283 | time.sleep(60) |
| 1284 | self.recv_timeout = False |
| 1285 | subscriber.recv_timeout = False |
| 1286 | self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 1, src_list = subscriber.src_list[1]) |
| 1287 | if self.test_status is True: |
| 1288 | self.test_status = subscriber.channel_not_receive(chan, cb = subscriber.recv_channel_cb, count = 1, src_list = subscriber.src_list[0]) |
| 1289 | if self.test_status is False: |
| 1290 | subscriber.channel_leave(chan, src_list = subscriber.src_list) |
| 1291 | continue |
| 1292 | subscriber.recv_timeout = False |
| 1293 | self.recv_timeout = False |
| 1294 | log_test.info('Again include the channel %s on port %s with souce list ip %s' %(chan, subscriber.rx_port,subscriber.src_list[0])) |
| 1295 | subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list, record_type = IGMP_V3_GR_TYPE_CHANGE_TO_INCLUDE) |
| 1296 | time.sleep(5) |
| 1297 | # self.recv_timeout = True |
| 1298 | # subscriber.recv_timeout = True |
| 1299 | self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 5, src_list = subscriber.src_list[0]) |
| 1300 | subscriber.recv_timeout = False |
| 1301 | self.recv_timeout = False |
| 1302 | |
| 1303 | |
| 1304 | subscriber.channel_leave(chan, src_list = subscriber.src_list) |
| 1305 | # self.test_status = True |
| 1306 | return self.test_status |
| 1307 | |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 1308 | def igmp_flow_check_join_change_to_block(self, subscriber, multiple_sub = False): |
Thangavelu K S | 9a63733 | 2017-08-01 23:22:23 +0000 | [diff] [blame] | 1309 | chan = 0 |
| 1310 | #for i in range(self.VOLTHA_IGMP_ITERATIONS): |
| 1311 | for i in range(3): |
| 1312 | subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list) |
| 1313 | self.num_joins += 1 |
| 1314 | while self.num_joins < self.num_subscribers: |
| 1315 | time.sleep(5) |
| 1316 | log_test.info('All subscribers have joined the channel') |
| 1317 | self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 5, src_list = subscriber.src_list[1]) |
| 1318 | time.sleep(5) |
| 1319 | log_test.info('Leaving channel %d for subscriber on port %s from specific source address %s and waited till GMI timer expires' %(chan, subscriber.rx_port, subscriber.src_list[0])) |
| 1320 | subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list[0], record_type = IGMP_V3_GR_TYPE_BLOCK_OLD) |
| 1321 | #### Adding delay till igmp timer expire data traffic is received from source specific of subscriber.src_list[0] |
| 1322 | time.sleep(60) |
| 1323 | self.recv_timeout = False |
| 1324 | subscriber.recv_timeout = False |
| 1325 | self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 1, src_list = subscriber.src_list[1]) |
| 1326 | if self.test_status is True: |
| 1327 | self.test_status = subscriber.channel_not_receive(chan, cb = subscriber.recv_channel_cb, count = 1, src_list = subscriber.src_list[0]) |
| 1328 | if self.test_status is False: |
| 1329 | subscriber.channel_leave(chan, src_list = subscriber.src_list) |
| 1330 | continue |
| 1331 | subscriber.recv_timeout = False |
| 1332 | self.recv_timeout = False |
| 1333 | subscriber.channel_leave(chan, src_list = subscriber.src_list) |
| 1334 | # self.test_status = True |
| 1335 | return self.test_status |
| 1336 | |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 1337 | |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 1338 | def igmp_flow_check_join_change_to_block_again_allow_back(self, subscriber, multiple_sub = False): |
Thangavelu K S | 9a63733 | 2017-08-01 23:22:23 +0000 | [diff] [blame] | 1339 | chan = 0 |
| 1340 | #for i in range(self.VOLTHA_IGMP_ITERATIONS): |
| 1341 | for i in range(3): |
| 1342 | subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list) |
| 1343 | self.num_joins += 1 |
| 1344 | while self.num_joins < self.num_subscribers: |
| 1345 | time.sleep(5) |
| 1346 | log_test.info('All subscribers have joined the channel') |
| 1347 | self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 5, src_list = subscriber.src_list[1]) |
| 1348 | time.sleep(5) |
| 1349 | log_test.info('Leaving channel %d for subscriber on port %s from specific source address %s and waited till GMI timer expires' %(chan, subscriber.rx_port, subscriber.src_list[0])) |
| 1350 | subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list[0], record_type = IGMP_V3_GR_TYPE_CHANGE_TO_EXCLUDE) |
| 1351 | #### Adding delay till igmp timer expire data traffic is received from source specific of subscriber.src_list[0] |
| 1352 | time.sleep(60) |
| 1353 | self.recv_timeout = False |
| 1354 | subscriber.recv_timeout = False |
| 1355 | self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 1, src_list = subscriber.src_list[1]) |
| 1356 | if self.test_status is True: |
| 1357 | self.test_status = subscriber.channel_not_receive(chan, cb = subscriber.recv_channel_cb, count = 1, src_list = subscriber.src_list[0]) |
| 1358 | if self.test_status is False: |
| 1359 | subscriber.channel_leave(chan, src_list = subscriber.src_list) |
| 1360 | continue |
| 1361 | subscriber.recv_timeout = False |
| 1362 | self.recv_timeout = False |
| 1363 | log_test.info('Again include the channel %s on port %s with souce list ip %s' %(chan, subscriber.rx_port,subscriber.src_list[0])) |
| 1364 | subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list, record_type = IGMP_V3_GR_TYPE_ALLOW_NEW) |
| 1365 | time.sleep(5) |
| 1366 | # self.recv_timeout = True |
| 1367 | # subscriber.recv_timeout = True |
| 1368 | self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 5, src_list = subscriber.src_list[0]) |
| 1369 | subscriber.recv_timeout = False |
| 1370 | self.recv_timeout = False |
| 1371 | |
| 1372 | |
| 1373 | subscriber.channel_leave(chan, src_list = subscriber.src_list) |
| 1374 | # self.test_status = True |
| 1375 | return self.test_status |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 1376 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 1377 | def igmp_flow_check_group_include_source_empty_list(self, subscriber, multiple_sub = False): |
| 1378 | chan = 0 |
| 1379 | subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list) |
| 1380 | self.num_joins += 1 |
| 1381 | while self.num_joins < self.num_subscribers: |
| 1382 | time.sleep(5) |
| 1383 | log_test.info('All subscribers have joined the channel') |
| 1384 | self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10) |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 1385 | if self.test_status is True: |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 1386 | log_test.info('Subscriber should not receive data from channel %s on any specific source %s, test is failed' %(chan, subscriber.rx_port)) |
| 1387 | self.test_status = False |
| 1388 | else: |
| 1389 | log_test.info('Subscriber not receive data from channel %s on any specific source %s' %(chan, subscriber.rx_port)) |
Thangavelu K S | 9a63733 | 2017-08-01 23:22:23 +0000 | [diff] [blame] | 1390 | self.test_status = True |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 1391 | log_test.info('Leaving channel %d for subscriber on port %s' %(chan, subscriber.rx_port)) |
| 1392 | subscriber.channel_leave(chan, src_list = subscriber.src_list) |
| 1393 | time.sleep(5) |
| 1394 | subscriber.recv_timeout = False |
| 1395 | self.recv_timeout = False |
| 1396 | return self.test_status |
| 1397 | |
| 1398 | def igmp_flow_check_group_exclude_source_empty_list(self, subscriber, multiple_sub = False): |
| 1399 | chan = 0 |
Thangavelu K S | 9a63733 | 2017-08-01 23:22:23 +0000 | [diff] [blame] | 1400 | subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list) |
| 1401 | self.num_joins += 1 |
| 1402 | while self.num_joins < self.num_subscribers: |
| 1403 | time.sleep(5) |
| 1404 | log_test.info('All subscribers have joined the channel') |
| 1405 | self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10) |
| 1406 | if self.test_status is True: |
| 1407 | log_test.info('Subscriber should not receive data from channel %s on any specific source %s, test is failed' %(chan, subscriber.rx_port)) |
| 1408 | self.test_status = False |
| 1409 | else: |
| 1410 | log_test.info('Subscriber not receive data from channel %s on any specific source %s' %(chan, subscriber.rx_port)) |
| 1411 | self.test_status = True |
| 1412 | |
| 1413 | subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list, record_type = IGMP_V3_GR_TYPE_CHANGE_TO_EXCLUDE) |
| 1414 | log_test.info('Send join to multicast group with exclude empty source list and waited till GMI timer expires') |
| 1415 | time.sleep(60) |
| 1416 | |
| 1417 | self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10) |
| 1418 | log_test.info('Leaving channel %d for subscriber on port %s' %(chan, subscriber.rx_port)) |
| 1419 | subscriber.channel_leave(chan, src_list = subscriber.src_list) |
| 1420 | time.sleep(5) |
| 1421 | subscriber.recv_timeout = False |
| 1422 | self.recv_timeout = False |
| 1423 | return self.test_status |
| 1424 | |
| 1425 | def igmp_flow_check_group_exclude_source_empty_list_1(self, subscriber, multiple_sub = False): |
| 1426 | chan = 0 |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 1427 | subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list,record_type = IGMP_V3_GR_TYPE_CHANGE_TO_EXCLUDE) |
| 1428 | self.num_joins += 1 |
| 1429 | while self.num_joins < self.num_subscribers: |
| 1430 | time.sleep(5) |
| 1431 | log_test.info('All subscribers have joined the channel') |
| 1432 | for i in range(10): |
| 1433 | self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10, src_list = subscriber.src_list) |
| 1434 | log_test.info('Leaving channel %d for subscriber on port %s' %(chan, subscriber.rx_port)) |
| 1435 | subscriber.channel_leave(chan, src_list = subscriber.src_list) |
| 1436 | time.sleep(5) |
| 1437 | log_test.info('Interface %s Join RX stats for subscriber, %s' %(subscriber.iface,subscriber.join_rx_stats)) |
| 1438 | #Should not receive packets for this subscriber |
| 1439 | self.recv_timeout = True |
| 1440 | subscriber.recv_timeout = True |
| 1441 | subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10, src_list = subscriber.src_list) |
| 1442 | subscriber.recv_timeout = False |
| 1443 | self.recv_timeout = False |
| 1444 | log_test.info('Joining channel %d for subscriber port %s' %(chan, subscriber.rx_port)) |
| 1445 | subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list) |
| 1446 | # self.test_status = True |
| 1447 | return self.test_status |
| 1448 | |
| 1449 | def igmp_flow_check_during_olt_onu_operational_issues(self, subscriber, multiple_sub = False): |
| 1450 | chan = 0 |
| 1451 | subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list) |
| 1452 | self.num_joins += 1 |
| 1453 | while self.num_joins < self.num_subscribers: |
| 1454 | time.sleep(5) |
| 1455 | log_test.info('All subscribers have joined the channel') |
| 1456 | for i in range(2): |
| 1457 | self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10, src_list = subscriber.src_list) |
| 1458 | log_test.info('Leaving channel %d for subscriber on port %s' %(chan, subscriber.rx_port)) |
| 1459 | subscriber.channel_leave(chan, src_list = subscriber.src_list) |
| 1460 | time.sleep(5) |
| 1461 | log_test.info('Interface %s Join RX stats for subscriber, %s' %(subscriber.iface,subscriber.join_rx_stats)) |
| 1462 | #Should not receive packets for this subscriber |
| 1463 | self.recv_timeout = True |
| 1464 | subscriber.recv_timeout = True |
| 1465 | subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10, src_list = subscriber.src_list) |
| 1466 | subscriber.recv_timeout = False |
| 1467 | self.recv_timeout = False |
| 1468 | log_test.info('Joining channel %d for subscriber port %s' %(chan, subscriber.rx_port)) |
| 1469 | subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list) |
| 1470 | # self.test_status = True |
| 1471 | return self.test_status |
| 1472 | |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 1473 | def voltha_igmp_jump_verify(self, subscriber): |
| 1474 | if subscriber.has_service('IGMP'): |
| 1475 | for i in xrange(subscriber.num): |
| 1476 | log_test.info('Subscriber %s jumping channel' %subscriber.name) |
| 1477 | chan = subscriber.channel_jump(delay=0) |
| 1478 | subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 1) |
| 1479 | log_test.info('Verified receive for channel %d, subscriber %s' %(chan, subscriber.name)) |
| 1480 | time.sleep(3) |
| 1481 | log_test.info('Interface %s Jump RX stats for subscriber %s, %s' %(subscriber.iface, subscriber.name, subscriber.join_rx_stats)) |
| 1482 | self.test_status = True |
| 1483 | return self.test_status |
| 1484 | |
| 1485 | def voltha_igmp_next_verify(self, subscriber): |
| 1486 | for c in xrange(self.VOLTHA_IGMP_ITERATIONS): |
| 1487 | for i in xrange(subscriber.num): |
| 1488 | if i: |
| 1489 | chan = subscriber.channel_join_next(delay=0, leave_flag = self.leave_flag) |
| 1490 | time.sleep(0.2) |
| 1491 | else: |
| 1492 | chan = subscriber.channel_join(i, delay=0) |
| 1493 | time.sleep(0.2) |
| 1494 | if subscriber.num == 1: |
| 1495 | subscriber.channel_leave(chan) |
| 1496 | log_test.info('Joined next channel %d for subscriber %s' %(chan, subscriber.name)) |
| 1497 | #subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count=1) |
| 1498 | #log_test.info('Verified receive for channel %d, subscriber %s' %(chan, subscriber.name)) |
| 1499 | self.test_status = True |
| 1500 | return self.test_status |
| 1501 | |
| 1502 | def voltha_subscribers(self, services, cbs = None, num_subscribers = 1, num_channels = 1, src_list = None): |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 1503 | """Test subscriber join next for channel surfing""" |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 1504 | voltha = VolthaCtrl(self.VOLTHA_HOST, |
| 1505 | rest_port = self.VOLTHA_REST_PORT, |
| 1506 | uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP) |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 1507 | if self.VOLTHA_OLT_TYPE.startswith('ponsim'): |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 1508 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 1509 | log_test.info('Enabling ponsim olt') |
| 1510 | device_id, status = voltha.enable_device(self.VOLTHA_OLT_TYPE, address = ponsim_address) |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 1511 | if device_id != '': |
| 1512 | self.olt_device_id = device_id |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 1513 | else: |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 1514 | log_test.info('This setup test cases is developed on ponsim olt only, hence stop execution') |
| 1515 | assert_equal(False, True) |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 1516 | |
| 1517 | assert_not_equal(device_id, None) |
| 1518 | if status == False: |
| 1519 | voltha.disable_device(device_id, delete = True) |
| 1520 | assert_equal(status, True) |
| 1521 | time.sleep(10) |
| 1522 | switch_map = None |
| 1523 | olt_configured = False |
| 1524 | try: |
| 1525 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 1526 | if not switch_map: |
| 1527 | log_test.info('No voltha devices found') |
| 1528 | return |
| 1529 | log_test.info('Installing OLT app') |
| 1530 | OnosCtrl.install_app(self.olt_app_file) |
| 1531 | time.sleep(5) |
| 1532 | log_test.info('Adding subscribers through OLT app') |
| 1533 | self.config_olt(switch_map) |
| 1534 | olt_configured = True |
| 1535 | time.sleep(5) |
| 1536 | self.num_subscribers = num_subscribers |
| 1537 | self.num_channels = num_channels |
| 1538 | test_status = self.subscriber_flows_check(num_subscribers = self.num_subscribers, |
| 1539 | num_channels = self.num_channels, |
| 1540 | cbs = cbs, |
| 1541 | port_list = self.generate_port_list(self.num_subscribers, |
| 1542 | self.num_channels), |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 1543 | src_list = src_list, services = services) |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 1544 | if test_status is False: |
| 1545 | self.success = False |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 1546 | assert_equal(test_status, True) |
| 1547 | finally: |
| 1548 | if switch_map is not None: |
| 1549 | if olt_configured is True: |
| 1550 | self.remove_olt(switch_map) |
| 1551 | voltha.disable_device(device_id, delete = True) |
| 1552 | time.sleep(10) |
| 1553 | log_test.info('Uninstalling OLT app') |
| 1554 | OnosCtrl.uninstall_app(self.olt_app_name) |
| 1555 | |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 1556 | def subscriber_flows_check( self, num_subscribers = 1, num_channels = 1, |
| 1557 | channel_start = 0, cbs = None, port_list = [], src_list = None, |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 1558 | services = None, negative_subscriber_auth = None): |
| 1559 | self.test_status = False |
| 1560 | self.ovs_cleanup() |
| 1561 | subscribers_count = num_subscribers |
| 1562 | sub_loop_count = num_subscribers |
| 1563 | if not port_list: |
| 1564 | port_list = self.generate_port_list(num_subscribers, num_channels) |
| 1565 | subscriber_tx_rx_ports = [] |
| 1566 | for i in range(num_subscribers): |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 1567 | subscriber_tx_rx_ports.append(Voltha_olt_subscribers(tx_port = self.port_map[port_list[i][0]], |
| 1568 | rx_port = self.port_map[port_list[i][1]], |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 1569 | num_channels = num_channels,src_list = src_list,)) |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 1570 | self.onos_aaa_load() |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 1571 | #load the ssm list for all subscriber channels |
| 1572 | igmpChannel = IgmpChannel(src_list = src_list) |
| 1573 | ssm_groups = map(lambda sub: sub.channels, subscriber_tx_rx_ports) |
| 1574 | ssm_list = reduce(lambda ssm1, ssm2: ssm1+ssm2, ssm_groups) |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 1575 | if src_list is None: |
| 1576 | igmpChannel = IgmpChannel() |
| 1577 | igmpChannel.igmp_load_ssm_config(ssm_list) |
| 1578 | else: |
| 1579 | igmpChannel = IgmpChannel(src_list = src_list) |
| 1580 | igmpChannel.igmp_load_ssm_config(ssm_list, src_list= src_list) |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 1581 | |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 1582 | self.thread_pool = ThreadPool(min(100, subscribers_count), queue_size=1, wait_timeout=1) |
| 1583 | |
| 1584 | chan_leave = False #for single channel, multiple subscribers |
| 1585 | if cbs is None: |
| 1586 | cbs = (self.tls_flow_check, self.dhcp_flow_check, self.igmp_flow_check) |
| 1587 | chan_leave = True |
| 1588 | for subscriber in subscriber_tx_rx_ports: |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 1589 | if 'IGMP' in services: |
| 1590 | # if src_list: |
| 1591 | # for i in range(len(src_list)): |
| 1592 | # subscriber.start(src_ip = src_list[i]) |
| 1593 | # else: |
| 1594 | # subscriber.start() |
| 1595 | subscriber.start() |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 1596 | sub_loop_count = sub_loop_count - 1 |
| 1597 | pool_object = voltha_subscriber_pool(subscriber, cbs) |
| 1598 | self.thread_pool.addTask(pool_object.pool_cb) |
| 1599 | self.thread_pool.cleanUpThreads() |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 1600 | for subscriber in subscriber_tx_rx_ports: |
| 1601 | if services and 'IGMP' in services: |
| 1602 | # if src_list: |
| 1603 | # for i in range(len(src_list)): |
| 1604 | # subscriber.stop(src_ip = src_list[i]) |
| 1605 | # else: |
| 1606 | # subscriber.stop() |
| 1607 | subscriber.stop() |
| 1608 | if chan_leave is True: |
| 1609 | subscriber.channel_leave(0) |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 1610 | subscribers_count = 0 |
| 1611 | return self.test_status |
| 1612 | |
| 1613 | |
| 1614 | def generate_port_list(self, subscribers, channels): |
| 1615 | return self.port_list[:subscribers] |
| 1616 | |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 1617 | @classmethod |
| 1618 | def ovs_cleanup(cls): |
| 1619 | ##For every test case, delete all the OVS groups |
| 1620 | cmd = 'ovs-ofctl del-groups br-int -OOpenFlow11 >/dev/null 2>&1' |
| 1621 | try: |
| 1622 | cord_test_shell(cmd) |
| 1623 | ##Since olt config is used for this test, we just fire a careless local cmd as well |
| 1624 | os.system(cmd) |
| 1625 | finally: |
| 1626 | return |
| 1627 | |
A.R Karthick | 8a507cf | 2017-06-02 18:44:49 -0700 | [diff] [blame] | 1628 | def test_olt_enable_disable(self): |
A R Karthick | 35495c3 | 2017-05-11 14:58:32 -0700 | [diff] [blame] | 1629 | log_test.info('Enabling OLT type %s, MAC %s' %(self.OLT_TYPE, self.OLT_MAC)) |
A.R Karthick | 8a507cf | 2017-06-02 18:44:49 -0700 | [diff] [blame] | 1630 | device_id, status = self.voltha.enable_device(self.OLT_TYPE, self.OLT_MAC) |
| 1631 | assert_not_equal(device_id, None) |
| 1632 | try: |
| 1633 | assert_equal(status, True) |
| 1634 | time.sleep(10) |
| 1635 | finally: |
| 1636 | self.voltha.disable_device(device_id, delete = True) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 1637 | |
A.R Karthick | 8a507cf | 2017-06-02 18:44:49 -0700 | [diff] [blame] | 1638 | def test_ponsim_enable_disable(self): |
A.R Karthick | 8b9c5f1 | 2017-05-30 17:47:08 -0700 | [diff] [blame] | 1639 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 1640 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
A.R Karthick | 8a507cf | 2017-06-02 18:44:49 -0700 | [diff] [blame] | 1641 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 1642 | assert_not_equal(device_id, None) |
| 1643 | try: |
| 1644 | assert_equal(status, True) |
| 1645 | time.sleep(10) |
| 1646 | finally: |
| 1647 | self.voltha.disable_device(device_id, delete = True) |
A.R Karthick | 8b9c5f1 | 2017-05-30 17:47:08 -0700 | [diff] [blame] | 1648 | |
A R Karthick | 31a4017 | 2017-08-14 12:06:09 -0700 | [diff] [blame] | 1649 | def test_maple_enable_disable(self): |
| 1650 | log_test.info('Enabling maple olt') |
| 1651 | if self.VOLTHA_OLT_IP: |
| 1652 | address = self.VOLTHA_OLT_IP |
| 1653 | device_id, status = self.voltha.enable_device('maple_olt', address = address) |
| 1654 | assert_not_equal(device_id, None) |
| 1655 | try: |
| 1656 | assert_equal(status, True) |
| 1657 | time.sleep(10) |
| 1658 | finally: |
| 1659 | self.voltha.disable_device(device_id, delete = True) |
| 1660 | |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 1661 | def test_subscriber_with_voltha_for_eap_tls_authentication(self): |
| 1662 | """ |
| 1663 | Test Method: |
| 1664 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1665 | 1. OLT and ONU is detected and validated. |
| 1666 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 1667 | 3. Issue auth request packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1668 | 4. Validate that eap tls valid auth packets are being exchanged between subscriber, onos and freeradius. |
| 1669 | 5. Verify that subscriber is authenticated successfully. |
| 1670 | """ |
A R Karthick | caa1b6a | 2017-07-27 14:07:05 -0700 | [diff] [blame] | 1671 | ret = voltha_setup( |
| 1672 | host = self.VOLTHA_HOST, |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 1673 | ponsim_host = self.VOLTHA_PONSIM_HOST, |
A R Karthick | caa1b6a | 2017-07-27 14:07:05 -0700 | [diff] [blame] | 1674 | rest_port = self.VOLTHA_REST_PORT, |
| 1675 | olt_type = 'ponsim_olt', |
| 1676 | uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP, |
| 1677 | uplink_vlan_start = self.VOLTHA_UPLINK_VLAN_START, |
| 1678 | config_fake = self.VOLTHA_CONFIG_FAKE, |
| 1679 | olt_app = self.olt_app_file) |
| 1680 | assert_not_equal(ret, None) |
A R Karthick | 18d0fb6 | 2017-09-01 18:49:07 -0700 | [diff] [blame] | 1681 | voltha, device_id, switch_map, preconfigured = ret[0], ret[1], ret[2], ret[3] |
| 1682 | if self.VOLTHA_TEARDOWN is False: |
| 1683 | preconfigured = True |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 1684 | try: |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 1685 | log_test.info('Adding subscribers through OLT app') |
| 1686 | self.config_olt(switch_map) |
| 1687 | olt_configured = True |
| 1688 | time.sleep(5) |
| 1689 | auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT) |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 1690 | assert_equal(auth_status, True) |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 1691 | finally: |
A R Karthick | 18d0fb6 | 2017-09-01 18:49:07 -0700 | [diff] [blame] | 1692 | if switch_map is not None and preconfigured is False: |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 1693 | if olt_configured is True: |
| 1694 | self.remove_olt(switch_map) |
A R Karthick | caa1b6a | 2017-07-27 14:07:05 -0700 | [diff] [blame] | 1695 | voltha_teardown(voltha, device_id, switch_map, olt_app = self.olt_app_file) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 1696 | |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 1697 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 1698 | def test_subscriber_with_voltha_for_eap_tls_authentication_failure(self): |
| 1699 | """ |
| 1700 | Test Method: |
| 1701 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1702 | 1. OLT and ONU is detected and validated. |
| 1703 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 1704 | 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1705 | 4. Validate that eap tls without cert auth packet is being exchanged between subscriber, onos and freeradius. |
| 1706 | 5. Verify that subscriber authentication is unsuccessful.. |
| 1707 | """ |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 1708 | df = defer.Deferred() |
| 1709 | def tls_flow_check_with_no_cert_scenario(df): |
| 1710 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 1711 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 1712 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 1713 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 1714 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 1715 | time.sleep(10) |
| 1716 | switch_map = None |
| 1717 | olt_configured = False |
| 1718 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 1719 | log_test.info('Installing OLT app') |
| 1720 | OnosCtrl.install_app(self.olt_app_file) |
| 1721 | time.sleep(5) |
| 1722 | log_test.info('Adding subscribers through OLT app') |
| 1723 | self.config_olt(switch_map) |
| 1724 | olt_configured = True |
| 1725 | time.sleep(5) |
| 1726 | auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT, cert_info = "no_cert") |
| 1727 | try: |
| 1728 | assert_equal(auth_status, True) |
| 1729 | assert_equal(status, True) |
| 1730 | time.sleep(10) |
| 1731 | finally: |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 1732 | self.remove_olt(switch_map) |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 1733 | self.voltha.disable_device(device_id, delete = True) |
| 1734 | df.callback(0) |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 1735 | |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 1736 | reactor.callLater(0, tls_flow_check_with_no_cert_scenario, df) |
| 1737 | return df |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 1738 | |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 1739 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 1740 | def test_subscriber_with_voltha_for_eap_tls_authentication_using_invalid_cert(self): |
| 1741 | """ |
| 1742 | Test Method: |
| 1743 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1744 | 1. OLT and ONU is detected and validated. |
| 1745 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 1746 | 3. Issue tls auth packets and exchange invalid cert from CORD TESTER voltha test module acting as a subscriber.. |
| 1747 | 4. Validate that eap tls with invalid cert auth packet is being exchanged between subscriber, onos and freeradius. |
| 1748 | 5. Verify that subscriber authentication is unsuccessful.. |
| 1749 | """ |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 1750 | df = defer.Deferred() |
| 1751 | def tls_flow_check_with_invalid_cert_scenario(df): |
| 1752 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 1753 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 1754 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 1755 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 1756 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 1757 | time.sleep(10) |
| 1758 | switch_map = None |
| 1759 | olt_configured = False |
| 1760 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 1761 | log_test.info('Installing OLT app') |
| 1762 | OnosCtrl.install_app(self.olt_app_file) |
| 1763 | time.sleep(5) |
| 1764 | log_test.info('Adding subscribers through OLT app') |
| 1765 | self.config_olt(switch_map) |
| 1766 | olt_configured = True |
| 1767 | time.sleep(5) |
| 1768 | auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT, cert_info = "invalid_cert") |
| 1769 | try: |
| 1770 | assert_equal(auth_status, True) |
| 1771 | assert_equal(status, True) |
| 1772 | time.sleep(10) |
| 1773 | finally: |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 1774 | self.remove_olt(switch_map) |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 1775 | self.voltha.disable_device(device_id, delete = True) |
| 1776 | df.callback(0) |
| 1777 | reactor.callLater(0, tls_flow_check_with_invalid_cert_scenario, df) |
| 1778 | return df |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 1779 | |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1780 | @deferred(TESTCASE_TIMEOUT) |
| 1781 | def test_subscriber_with_voltha_for_multiple_invalid_authentication_attempts(self): |
| 1782 | """ |
| 1783 | Test Method: |
| 1784 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1785 | 1. OLT and ONU is detected and validated. |
| 1786 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 1787 | 3. Issue tls auth packets and exchange invalid cert from CORD TESTER voltha test module acting as a subscriber for multiple times. |
| 1788 | 4. Validate that eap tls with invalid cert auth packet is being exchanged between subscriber, onos and freeradius. |
| 1789 | 5. Verify that subscriber authentication is unsuccessful.. |
| 1790 | """ |
| 1791 | df = defer.Deferred() |
| 1792 | def tls_flow_check_with_no_cert_scenario(df): |
| 1793 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 1794 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1795 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 1796 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 1797 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1798 | time.sleep(10) |
| 1799 | switch_map = None |
| 1800 | olt_configured = False |
| 1801 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 1802 | log_test.info('Installing OLT app') |
| 1803 | OnosCtrl.install_app(self.olt_app_file) |
| 1804 | time.sleep(5) |
| 1805 | log_test.info('Adding subscribers through OLT app') |
| 1806 | self.config_olt(switch_map) |
| 1807 | olt_configured = True |
| 1808 | time.sleep(5) |
| 1809 | auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT, cert_info = "invalid_cert") |
| 1810 | auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT, cert_info = "invalid_cert") |
| 1811 | auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT, cert_info = "no_cert") |
| 1812 | auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT, cert_info = "invalid_cert") |
| 1813 | try: |
| 1814 | assert_equal(auth_status, True) |
| 1815 | assert_equal(status, True) |
| 1816 | time.sleep(10) |
| 1817 | finally: |
| 1818 | self.voltha.disable_device(device_id, delete = True) |
| 1819 | df.callback(0) |
| 1820 | reactor.callLater(0, tls_flow_check_with_no_cert_scenario, df) |
| 1821 | return df |
| 1822 | |
| 1823 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 1824 | def test_subscriber_with_voltha_for_eap_tls_authentication_with_aaa_app_deactivation(self): |
| 1825 | """ |
| 1826 | Test Method: |
| 1827 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1828 | 1. OLT and ONU is detected and validated. |
| 1829 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 1830 | 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1831 | 4. Validate that eap tls without sending client hello, it's not being exchanged between client, onos and freeradius. |
| 1832 | 5. Verify that subscriber authentication is unsuccessful.. |
| 1833 | """ |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1834 | df = defer.Deferred() |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 1835 | def tls_flow_check_deactivating_app(df): |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1836 | aaa_app = ["org.opencord.aaa"] |
| 1837 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 1838 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1839 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 1840 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 1841 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1842 | time.sleep(10) |
| 1843 | switch_map = None |
| 1844 | olt_configured = False |
| 1845 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 1846 | log_test.info('Installing OLT app') |
| 1847 | OnosCtrl.install_app(self.olt_app_file) |
| 1848 | time.sleep(5) |
| 1849 | log_test.info('Adding subscribers through OLT app') |
| 1850 | self.config_olt(switch_map) |
| 1851 | olt_configured = True |
| 1852 | time.sleep(5) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 1853 | |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1854 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT,"app_deactivate",)) |
| 1855 | thread2 = threading.Thread(target = self.deactivate_apps, args = (aaa_app,)) |
| 1856 | thread1.start() |
| 1857 | time.sleep(randint(1,2)) |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 1858 | log_test.info('Restart aaa app in onos during tls auth flow check on voltha') |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1859 | thread2.start() |
| 1860 | time.sleep(10) |
| 1861 | thread1.join() |
| 1862 | thread2.join() |
| 1863 | try: |
| 1864 | # assert_equal(status, True) |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 1865 | assert_equal(self.success, True) |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1866 | time.sleep(10) |
| 1867 | finally: |
| 1868 | self.voltha.disable_device(device_id, delete = True) |
| 1869 | df.callback(0) |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 1870 | reactor.callLater(0, tls_flow_check_deactivating_app, df) |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1871 | return df |
| 1872 | |
| 1873 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 1874 | def test_subscriber_with_voltha_for_eap_tls_authentication_restarting_radius_server(self): |
| 1875 | """ |
| 1876 | Test Method: |
| 1877 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1878 | 1. OLT and ONU is detected and validated. |
| 1879 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 1880 | 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1881 | 4. Validate that eap tls with restart of radius server and packets are being exchanged between subscriber, onos and freeradius. |
| 1882 | 5. Verify that subscriber authentication is unsuccessful.. |
| 1883 | """ |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1884 | df = defer.Deferred() |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 1885 | def tls_flow_check_restarting_radius(df): |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1886 | aaa_app = ["org.opencord.aaa"] |
| 1887 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 1888 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1889 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 1890 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 1891 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1892 | time.sleep(10) |
| 1893 | switch_map = None |
| 1894 | olt_configured = False |
| 1895 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 1896 | log_test.info('Installing OLT app') |
| 1897 | OnosCtrl.install_app(self.olt_app_file) |
| 1898 | time.sleep(5) |
| 1899 | log_test.info('Adding subscribers through OLT app') |
| 1900 | self.config_olt(switch_map) |
| 1901 | olt_configured = True |
| 1902 | time.sleep(5) |
| 1903 | |
| 1904 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT,"restart_radius")) |
| 1905 | thread2 = threading.Thread(target = cord_test_radius_restart) |
| 1906 | thread1.start() |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 1907 | time.sleep(randint(1,2)) |
| 1908 | log_test.info('Restart radius server during tls auth flow check on voltha') |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1909 | thread2.start() |
| 1910 | time.sleep(10) |
| 1911 | thread1.join() |
| 1912 | thread2.join() |
| 1913 | try: |
| 1914 | # assert_equal(status, True) |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 1915 | assert_equal(self.success, True) |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1916 | time.sleep(10) |
| 1917 | finally: |
| 1918 | self.voltha.disable_device(device_id, delete = True) |
| 1919 | df.callback(0) |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 1920 | reactor.callLater(0, tls_flow_check_restarting_radius, df) |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1921 | return df |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 1922 | |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 1923 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 1924 | def test_subscriber_with_voltha_for_eap_tls_authentication_with_disabled_olt(self): |
| 1925 | """ |
| 1926 | Test Method: |
| 1927 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1928 | 1. OLT and ONU is detected and validated. |
| 1929 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 1930 | 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1931 | 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius. |
| 1932 | 6. Verify that subscriber authenticated successfully. |
| 1933 | 7. Disable olt which is seen in voltha and issue tls auth packets from subscriber. |
| 1934 | 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius. |
| 1935 | 9. Verify that subscriber authentication is unsuccessful.. |
| 1936 | """ |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1937 | df = defer.Deferred() |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 1938 | def tls_flow_check_operating_olt_state(df): |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1939 | aaa_app = ["org.opencord.aaa"] |
| 1940 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 1941 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1942 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 1943 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 1944 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1945 | time.sleep(10) |
| 1946 | switch_map = None |
| 1947 | olt_configured = False |
| 1948 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 1949 | log_test.info('Installing OLT app') |
| 1950 | OnosCtrl.install_app(self.olt_app_file) |
| 1951 | time.sleep(5) |
| 1952 | log_test.info('Adding subscribers through OLT app') |
| 1953 | self.config_olt(switch_map) |
| 1954 | olt_configured = True |
| 1955 | time.sleep(5) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 1956 | |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1957 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT, "disable_olt_device",)) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 1958 | thread2 = threading.Thread(target = self.voltha.disable_device, args = (device_id, False,)) |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1959 | thread1.start() |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 1960 | time.sleep(randint(1,2)) |
| 1961 | log_test.info('Disable the ponsim olt device during tls auth flow check on voltha') |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1962 | thread2.start() |
| 1963 | time.sleep(10) |
| 1964 | thread1.join() |
| 1965 | thread2.join() |
| 1966 | try: |
| 1967 | # assert_equal(status, True) |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 1968 | assert_equal(self.success, True) |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1969 | time.sleep(10) |
| 1970 | finally: |
| 1971 | self.voltha.disable_device(device_id, delete = True) |
| 1972 | df.callback(0) |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 1973 | reactor.callLater(0, tls_flow_check_operating_olt_state, df) |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1974 | return df |
| 1975 | |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 1976 | @deferred(TESTCASE_TIMEOUT) |
| 1977 | def test_subscriber_with_voltha_for_eap_tls_authentication_disabling_uni_port(self): |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 1978 | """ |
| 1979 | Test Method: |
| 1980 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1981 | 1. OLT and ONU is detected and validated. |
| 1982 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 1983 | 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1984 | 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius. |
| 1985 | 6. Verify that subscriber authenticated successfully. |
| 1986 | 7. Disable uni port which is seen in voltha and issue tls auth packets from subscriber. |
| 1987 | 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius. |
| 1988 | 9. Verify that subscriber authentication is unsuccessful.. |
| 1989 | """ |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 1990 | df = defer.Deferred() |
| 1991 | def tls_flow_check_operating_olt_state(df): |
| 1992 | aaa_app = ["org.opencord.aaa"] |
| 1993 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 1994 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 1995 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 1996 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 1997 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 1998 | time.sleep(10) |
| 1999 | switch_map = None |
| 2000 | olt_configured = False |
| 2001 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 2002 | log_test.info('Installing OLT app') |
| 2003 | OnosCtrl.install_app(self.olt_app_file) |
| 2004 | time.sleep(5) |
| 2005 | log_test.info('Adding subscribers through OLT app') |
| 2006 | self.config_olt(switch_map) |
| 2007 | olt_configured = True |
| 2008 | time.sleep(5) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 2009 | |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 2010 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT, "uni_port_admin_down",)) |
| 2011 | thread2 = threading.Thread(target = self.voltha_uni_port_toggle) |
| 2012 | thread1.start() |
| 2013 | time.sleep(randint(1,2)) |
| 2014 | log_test.info('Admin state of uni port is down and up after delay of 30 sec during tls auth flow check on voltha') |
| 2015 | thread2.start() |
| 2016 | time.sleep(10) |
| 2017 | thread1.join() |
| 2018 | thread2.join() |
| 2019 | try: |
| 2020 | # assert_equal(status, True) |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 2021 | assert_equal(self.success, True) |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 2022 | time.sleep(10) |
| 2023 | finally: |
| 2024 | self.voltha.disable_device(device_id, delete = True) |
| 2025 | df.callback(0) |
| 2026 | reactor.callLater(0, tls_flow_check_operating_olt_state, df) |
| 2027 | return df |
| 2028 | |
Thangavelu K S and Chetan Gaonker | 0cf7564 | 2017-08-03 20:13:23 +0000 | [diff] [blame] | 2029 | @deferred(TESTCASE_TIMEOUT +600) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 2030 | def test_subscriber_with_voltha_for_eap_tls_authentication_carrying_out_multiple_times_toggling_of_uni_port(self): |
| 2031 | """ |
| 2032 | Test Method: |
| 2033 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2034 | 1. OLT and ONU is detected and validated. |
| 2035 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 2036 | 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 2037 | 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius. |
| 2038 | 6. Verify that subscriber authenticated successfully. |
| 2039 | 7. Disable uni port which is seen in voltha and issue tls auth packets from subscriber. |
| 2040 | 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius. |
| 2041 | 9. Verify that subscriber authentication is unsuccessful.. |
| 2042 | 10. Repeat steps from 3 to 9 for 10 times and finally verify tls flow |
| 2043 | |
| 2044 | """ |
| 2045 | df = defer.Deferred() |
| 2046 | no_iterations = 10 |
| 2047 | def tls_flow_check_with_disable_olt_device_scenario(df): |
| 2048 | aaa_app = ["org.opencord.aaa"] |
| 2049 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 2050 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 2051 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 2052 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 2053 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 2054 | time.sleep(10) |
| 2055 | switch_map = None |
| 2056 | olt_configured = False |
| 2057 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 2058 | log_test.info('Installing OLT app') |
| 2059 | OnosCtrl.install_app(self.olt_app_file) |
| 2060 | time.sleep(5) |
| 2061 | log_test.info('Adding subscribers through OLT app') |
| 2062 | self.config_olt(switch_map) |
| 2063 | olt_configured = True |
| 2064 | time.sleep(5) |
| 2065 | for i in range(no_iterations): |
| 2066 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT, "uni_port_admin_down",)) |
Thangavelu K S and Chetan Gaonker | 0cf7564 | 2017-08-03 20:13:23 +0000 | [diff] [blame] | 2067 | thread2 = threading.Thread(target = self.voltha_uni_port_toggle) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 2068 | thread1.start() |
| 2069 | time.sleep(randint(1,2)) |
| 2070 | log_test.info('Admin state of uni port is down and up after delay of 30 sec during tls auth flow check on voltha') |
| 2071 | thread2.start() |
| 2072 | time.sleep(10) |
| 2073 | thread1.join() |
| 2074 | thread2.join() |
Thangavelu K S and Chetan Gaonker | 0cf7564 | 2017-08-03 20:13:23 +0000 | [diff] [blame] | 2075 | time.sleep(60) |
| 2076 | cord_test_radius_restart() |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 2077 | auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT) |
| 2078 | try: |
| 2079 | # assert_equal(status, True) |
| 2080 | assert_equal(auth_status, True) |
| 2081 | assert_equal(self.success, True) |
| 2082 | time.sleep(10) |
| 2083 | finally: |
| 2084 | self.voltha.disable_device(device_id, delete = True) |
| 2085 | df.callback(0) |
| 2086 | reactor.callLater(0, tls_flow_check_with_disable_olt_device_scenario, df) |
| 2087 | return df |
| 2088 | |
| 2089 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 2090 | def test_subscriber_with_voltha_for_eap_tls_authentication_restarting_olt(self): |
| 2091 | """ |
| 2092 | Test Method: |
| 2093 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2094 | 1. OLT and ONU is detected and validated. |
| 2095 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 2096 | 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 2097 | 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius. |
| 2098 | 6. Verify that subscriber authenticated successfully. |
| 2099 | 7. Restart olt which is seen in voltha and issue tls auth packets from subscriber. |
| 2100 | 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius. |
| 2101 | 9. Verify that subscriber authentication is unsuccessful.. |
| 2102 | """ |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 2103 | df = defer.Deferred() |
| 2104 | def tls_flow_check_operating_olt_state(df): |
| 2105 | aaa_app = ["org.opencord.aaa"] |
| 2106 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 2107 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 2108 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 2109 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 2110 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 2111 | time.sleep(10) |
| 2112 | switch_map = None |
| 2113 | olt_configured = False |
| 2114 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 2115 | log_test.info('Installing OLT app') |
| 2116 | OnosCtrl.install_app(self.olt_app_file) |
| 2117 | time.sleep(5) |
| 2118 | log_test.info('Adding subscribers through OLT app') |
| 2119 | self.config_olt(switch_map) |
| 2120 | olt_configured = True |
| 2121 | time.sleep(5) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 2122 | |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 2123 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT, "restart_olt_device",)) |
| 2124 | thread2 = threading.Thread(target = self.voltha.restart_device, args = (device_id,)) |
| 2125 | thread1.start() |
| 2126 | time.sleep(randint(1,2)) |
| 2127 | log_test.info('Restart the ponsim olt device during tls auth flow check on voltha') |
| 2128 | thread2.start() |
| 2129 | time.sleep(10) |
| 2130 | thread1.join() |
| 2131 | thread2.join() |
| 2132 | try: |
| 2133 | # assert_equal(status, True) |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 2134 | assert_equal(self.success, True) |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 2135 | time.sleep(10) |
| 2136 | finally: |
| 2137 | self.voltha.disable_device(device_id, delete = True) |
| 2138 | df.callback(0) |
| 2139 | reactor.callLater(0, tls_flow_check_operating_olt_state, df) |
| 2140 | return df |
| 2141 | |
| 2142 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 2143 | def test_subscriber_with_voltha_for_eap_tls_authentication_performing_multiple_times_restart_of_olt(self): |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 2144 | """ |
| 2145 | Test Method: |
| 2146 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2147 | 1. OLT and ONU is detected and validated. |
| 2148 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 2149 | 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 2150 | 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius. |
| 2151 | 6. Verify that subscriber authenticated successfully. |
| 2152 | 7. Restart olt which is seen in voltha and issue tls auth packets from subscriber. |
| 2153 | 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius. |
| 2154 | 9. Verify that subscriber authentication is unsuccessful.. |
| 2155 | 10. Repeat steps from 3 to 9 for 10 times and finally verify tls flow |
| 2156 | """ |
| 2157 | df = defer.Deferred() |
| 2158 | no_iterations = 10 |
| 2159 | def tls_flow_check_with_disable_olt_device_scenario(df): |
| 2160 | aaa_app = ["org.opencord.aaa"] |
| 2161 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 2162 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 2163 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 2164 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 2165 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 2166 | time.sleep(10) |
| 2167 | switch_map = None |
| 2168 | olt_configured = False |
| 2169 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 2170 | log_test.info('Installing OLT app') |
| 2171 | OnosCtrl.install_app(self.olt_app_file) |
| 2172 | time.sleep(5) |
| 2173 | log_test.info('Adding subscribers through OLT app') |
| 2174 | self.config_olt(switch_map) |
| 2175 | olt_configured = True |
| 2176 | time.sleep(5) |
| 2177 | for i in range(no_iterations): |
| 2178 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT, "restart_olt_device",)) |
| 2179 | thread2 = threading.Thread(target = self.voltha.restart_device, args = (device_id,)) |
| 2180 | thread1.start() |
| 2181 | time.sleep(randint(1,2)) |
| 2182 | log_test.info('Restart the ponsim olt device during tls auth flow check on voltha') |
| 2183 | thread2.start() |
| 2184 | time.sleep(10) |
| 2185 | thread1.join() |
| 2186 | thread2.join() |
Thangavelu K S and Chetan Gaonker | 0cf7564 | 2017-08-03 20:13:23 +0000 | [diff] [blame] | 2187 | time.sleep(60) |
| 2188 | cord_test_radius_restart() |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 2189 | auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT) |
| 2190 | try: |
| 2191 | # assert_equal(status, True) |
| 2192 | assert_equal(auth_status, True) |
| 2193 | assert_equal(self.success, True) |
| 2194 | time.sleep(10) |
| 2195 | finally: |
| 2196 | self.voltha.disable_device(device_id, delete = True) |
| 2197 | df.callback(0) |
| 2198 | reactor.callLater(0, tls_flow_check_with_disable_olt_device_scenario, df) |
| 2199 | return df |
| 2200 | |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 2201 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 2202 | def test_subscriber_with_voltha_for_eap_tls_authentication_restarting_onu(self): |
| 2203 | """ |
| 2204 | Test Method: |
| 2205 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2206 | 1. OLT and ONU is detected and validated. |
| 2207 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 2208 | 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 2209 | 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius. |
| 2210 | 6. Verify that subscriber authenticated successfully. |
| 2211 | 7. Restart onu which is seen in voltha and issue tls auth packets from subscriber. |
| 2212 | 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius. |
| 2213 | 9. Verify that subscriber authentication is unsuccessful.. |
| 2214 | """ |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 2215 | df = defer.Deferred() |
Thangavelu K S and Chetan Gaonker | 0cf7564 | 2017-08-03 20:13:23 +0000 | [diff] [blame] | 2216 | def tls_flow_check_operating_onu_state(df): |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 2217 | aaa_app = ["org.opencord.aaa"] |
| 2218 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 2219 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 2220 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 2221 | devices_list = self.voltha.get_devices() |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 2222 | log_test.info('All available devices on voltha = %s'%devices_list['items']) |
| 2223 | |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 2224 | onu_device_id = devices_list['items'][1]['id'] |
| 2225 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 2226 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 2227 | time.sleep(10) |
| 2228 | switch_map = None |
| 2229 | olt_configured = False |
| 2230 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 2231 | log_test.info('Installing OLT app') |
| 2232 | OnosCtrl.install_app(self.olt_app_file) |
| 2233 | time.sleep(5) |
| 2234 | log_test.info('Adding subscribers through OLT app') |
| 2235 | self.config_olt(switch_map) |
| 2236 | olt_configured = True |
| 2237 | time.sleep(5) |
| 2238 | devices_list = self.voltha.get_devices() |
| 2239 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT, "restart_onu_device",)) |
| 2240 | thread2 = threading.Thread(target = self.voltha.restart_device, args = (onu_device_id,)) |
| 2241 | thread1.start() |
| 2242 | time.sleep(randint(1,2)) |
| 2243 | log_test.info('Restart the ponsim oon device during tls auth flow check on voltha') |
| 2244 | thread2.start() |
| 2245 | time.sleep(10) |
| 2246 | thread1.join() |
| 2247 | thread2.join() |
| 2248 | try: |
| 2249 | # assert_equal(status, True) |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 2250 | assert_equal(self.success, True) |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 2251 | time.sleep(10) |
| 2252 | finally: |
| 2253 | self.voltha.disable_device(device_id, delete = True) |
| 2254 | df.callback(0) |
Thangavelu K S and Chetan Gaonker | 0cf7564 | 2017-08-03 20:13:23 +0000 | [diff] [blame] | 2255 | reactor.callLater(0, tls_flow_check_operating_onu_state, df) |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 2256 | return df |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 2257 | |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 2258 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 2259 | def test_subscriber_with_voltha_for_eap_tls_authentication_performing_multiple_times_restart_of_onu(self): |
| 2260 | """ |
| 2261 | Test Method: |
| 2262 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2263 | 1. OLT and ONU is detected and validated. |
| 2264 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 2265 | 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 2266 | 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius. |
| 2267 | 6. Verify that subscriber authenticated successfully. |
| 2268 | 7. Restart onu which is seen in voltha and issue tls auth packets from subscriber. |
| 2269 | 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius. |
| 2270 | 9. Verify that subscriber authentication is unsuccessful.. |
| 2271 | 10. Repeat steps from 3 to 9 for 10 times and finally verify tls flow |
| 2272 | """ |
| 2273 | df = defer.Deferred() |
| 2274 | no_iterations = 10 |
| 2275 | def tls_flow_check_operating_olt_state(df): |
| 2276 | aaa_app = ["org.opencord.aaa"] |
| 2277 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 2278 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 2279 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 2280 | devices_list = self.voltha.get_devices() |
| 2281 | log_test.info('All available devices on voltha = %s'%devices_list['items']) |
| 2282 | |
| 2283 | onu_device_id = devices_list['items'][1]['id'] |
| 2284 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 2285 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 2286 | time.sleep(10) |
| 2287 | switch_map = None |
| 2288 | olt_configured = False |
| 2289 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 2290 | log_test.info('Installing OLT app') |
| 2291 | OnosCtrl.install_app(self.olt_app_file) |
| 2292 | time.sleep(5) |
| 2293 | log_test.info('Adding subscribers through OLT app') |
| 2294 | self.config_olt(switch_map) |
| 2295 | olt_configured = True |
| 2296 | time.sleep(5) |
| 2297 | devices_list = self.voltha.get_devices() |
| 2298 | for i in range(no_iterations): |
| 2299 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT, "restart_onu_device",)) |
| 2300 | thread2 = threading.Thread(target = self.voltha.restart_device, args = (onu_device_id,)) |
| 2301 | thread1.start() |
| 2302 | time.sleep(randint(1,2)) |
| 2303 | log_test.info('Restart the ponsim oon device during tls auth flow check on voltha') |
| 2304 | thread2.start() |
| 2305 | time.sleep(10) |
| 2306 | thread1.join() |
| 2307 | thread2.join() |
Thangavelu K S and Chetan Gaonker | 0cf7564 | 2017-08-03 20:13:23 +0000 | [diff] [blame] | 2308 | time.sleep(60) |
| 2309 | cord_test_radius_restart() |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 2310 | auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT) |
| 2311 | try: |
| 2312 | # assert_equal(status, True) |
| 2313 | assert_equal(auth_status, True) |
| 2314 | assert_equal(self.success, True) |
| 2315 | time.sleep(10) |
| 2316 | finally: |
| 2317 | self.voltha.disable_device(device_id, delete = True) |
| 2318 | df.callback(0) |
| 2319 | reactor.callLater(0, tls_flow_check_operating_olt_state, df) |
| 2320 | return df |
| 2321 | |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 2322 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 2323 | def test_two_subscribers_with_voltha_for_eap_tls_authentication(self): |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 2324 | """ |
| 2325 | Test Method: |
| 2326 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2327 | 1. OLT is detected and ONU ports(nni and 2 uni's) are being seen. |
| 2328 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 2329 | 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 2330 | 4. Validate that eap tls valid auth packets are being exchanged between two subscriber, onos and freeradius. |
| 2331 | 5. Verify that two subscribers are authenticated successfully. |
| 2332 | """ |
| 2333 | |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 2334 | df = defer.Deferred() |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 2335 | def tls_flow_check_on_two_subscribers_same_olt_device(df): |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 2336 | aaa_app = ["org.opencord.aaa"] |
| 2337 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 2338 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 2339 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 2340 | devices_list = self.voltha.get_devices() |
| 2341 | log_test.info('All available devices on voltha = %s'%devices_list['items']) |
| 2342 | |
| 2343 | onu_device_id = devices_list['items'][1]['id'] |
| 2344 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 2345 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 2346 | time.sleep(10) |
| 2347 | switch_map = None |
| 2348 | olt_configured = False |
| 2349 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 2350 | log_test.info('Installing OLT app') |
| 2351 | OnosCtrl.install_app(self.olt_app_file) |
| 2352 | time.sleep(5) |
| 2353 | log_test.info('Adding subscribers through OLT app') |
| 2354 | self.config_olt(switch_map) |
| 2355 | olt_configured = True |
| 2356 | time.sleep(5) |
| 2357 | devices_list = self.voltha.get_devices() |
| 2358 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT,)) |
| 2359 | thread2 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_2_RX_DEFAULT,)) |
| 2360 | thread1.start() |
| 2361 | time.sleep(randint(1,2)) |
| 2362 | log_test.info('Initiating tls auth packets from one more subscriber on same olt device which is deteced on voltha') |
| 2363 | thread2.start() |
| 2364 | time.sleep(10) |
| 2365 | thread1.join() |
| 2366 | thread2.join() |
| 2367 | try: |
| 2368 | # assert_equal(status, True) |
| 2369 | assert_equal(self.success, True) |
| 2370 | time.sleep(10) |
| 2371 | finally: |
| 2372 | self.voltha.disable_device(device_id, delete = True) |
| 2373 | df.callback(0) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 2374 | reactor.callLater(0, tls_flow_check_on_two_subscribers_same_olt_device, df) |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 2375 | return df |
| 2376 | |
| 2377 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 2378 | def test_two_subscribers_with_voltha_for_eap_tls_authentication_using_same_certificates(self): |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 2379 | """ |
| 2380 | Test Method: |
| 2381 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2382 | 1. OLT is detected and ONU ports(nni and 2 uni's) are being seen. |
| 2383 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 2384 | 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 2385 | 4. Validate that two valid certificates are being exchanged between two subscriber, onos and freeradius. |
| 2386 | 5. Verify that two subscribers are not authenticated. |
| 2387 | """ |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 2388 | df = defer.Deferred() |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 2389 | def tls_flow_check_on_two_subscribers_same_olt_device(df): |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 2390 | aaa_app = ["org.opencord.aaa"] |
| 2391 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 2392 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 2393 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 2394 | devices_list = self.voltha.get_devices() |
| 2395 | log_test.info('All available devices on voltha = %s'%devices_list['items']) |
| 2396 | |
| 2397 | onu_device_id = devices_list['items'][1]['id'] |
| 2398 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 2399 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 2400 | time.sleep(10) |
| 2401 | switch_map = None |
| 2402 | olt_configured = False |
| 2403 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 2404 | log_test.info('Installing OLT app') |
| 2405 | OnosCtrl.install_app(self.olt_app_file) |
| 2406 | time.sleep(5) |
| 2407 | log_test.info('Adding subscribers through OLT app') |
| 2408 | self.config_olt(switch_map) |
| 2409 | olt_configured = True |
| 2410 | time.sleep(5) |
| 2411 | devices_list = self.voltha.get_devices() |
| 2412 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT,)) |
| 2413 | thread2 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_2_RX_DEFAULT, "same_cert",)) |
| 2414 | thread1.start() |
| 2415 | time.sleep(randint(1,2)) |
| 2416 | log_test.info('Initiating tls auth packets from one more subscriber on same olt device which is deteced on voltha') |
| 2417 | thread2.start() |
| 2418 | time.sleep(10) |
| 2419 | thread1.join() |
| 2420 | thread2.join() |
| 2421 | try: |
| 2422 | # assert_equal(status, True) |
| 2423 | assert_equal(self.success, True) |
| 2424 | time.sleep(10) |
| 2425 | finally: |
| 2426 | self.voltha.disable_device(device_id, delete = True) |
| 2427 | df.callback(0) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 2428 | reactor.callLater(0, tls_flow_check_on_two_subscribers_same_olt_device, df) |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 2429 | return df |
| 2430 | |
Chetan Gaonker | fe1048f | 2017-06-13 20:16:25 +0000 | [diff] [blame] | 2431 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 2432 | def test_two_subscribers_with_voltha_for_eap_tls_authentication_initiating_invalid_tls_packets_for_one_subscriber(self): |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 2433 | """ |
| 2434 | Test Method: |
| 2435 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2436 | 1. OLT is detected and ONU ports(nni and 2 uni's) are being seen. |
| 2437 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 2438 | 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 2439 | 4. Validate that eap tls valid auth packets are being exchanged between valid subscriber, onos and freeradius. |
| 2440 | 5. Validate that eap tls valid auth packets are being exchanged between invalid client, onos and freeradius. |
| 2441 | 6. Verify that valid subscriber authenticated successfully. |
| 2442 | 7. Verify that invalid subscriber are not authenticated successfully. |
| 2443 | """ |
| 2444 | |
Chetan Gaonker | fe1048f | 2017-06-13 20:16:25 +0000 | [diff] [blame] | 2445 | df = defer.Deferred() |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 2446 | def tls_flow_check_on_two_subscribers_same_olt_device(df): |
Chetan Gaonker | fe1048f | 2017-06-13 20:16:25 +0000 | [diff] [blame] | 2447 | aaa_app = ["org.opencord.aaa"] |
| 2448 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 2449 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Chetan Gaonker | fe1048f | 2017-06-13 20:16:25 +0000 | [diff] [blame] | 2450 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 2451 | devices_list = self.voltha.get_devices() |
| 2452 | log_test.info('All available devices on voltha = %s'%devices_list['items']) |
| 2453 | |
| 2454 | onu_device_id = devices_list['items'][1]['id'] |
| 2455 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 2456 | voltha = VolthaCtrl(**self.voltha_attrs) |
Chetan Gaonker | fe1048f | 2017-06-13 20:16:25 +0000 | [diff] [blame] | 2457 | time.sleep(10) |
| 2458 | switch_map = None |
| 2459 | olt_configured = False |
| 2460 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 2461 | log_test.info('Installing OLT app') |
| 2462 | OnosCtrl.install_app(self.olt_app_file) |
| 2463 | time.sleep(5) |
| 2464 | log_test.info('Adding subscribers through OLT app') |
| 2465 | self.config_olt(switch_map) |
| 2466 | olt_configured = True |
| 2467 | time.sleep(5) |
| 2468 | devices_list = self.voltha.get_devices() |
| 2469 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT,)) |
| 2470 | thread2 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_2_RX_DEFAULT, "no_cert",)) |
| 2471 | thread1.start() |
| 2472 | time.sleep(randint(1,2)) |
| 2473 | log_test.info('Initiating tls auth packets from one more subscriber on same olt device which is deteced on voltha') |
| 2474 | thread2.start() |
| 2475 | time.sleep(10) |
| 2476 | thread1.join() |
| 2477 | thread2.join() |
| 2478 | try: |
| 2479 | # assert_equal(status, True) |
| 2480 | assert_equal(self.success, True) |
| 2481 | time.sleep(10) |
| 2482 | finally: |
| 2483 | self.voltha.disable_device(device_id, delete = True) |
| 2484 | df.callback(0) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 2485 | reactor.callLater(0, tls_flow_check_on_two_subscribers_same_olt_device, df) |
Chetan Gaonker | fe1048f | 2017-06-13 20:16:25 +0000 | [diff] [blame] | 2486 | return df |
| 2487 | |
| 2488 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 2489 | def test_two_subscribers_with_voltha_for_eap_tls_authentication_initiating_invalid_cert_for_one_subscriber(self): |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 2490 | """ |
| 2491 | Test Method: |
| 2492 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2493 | 1. OLT is detected and ONU ports(nni and 2 uni's) are being seen. |
| 2494 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 2495 | 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 2496 | 4. Validate that eap tls valid auth packets are being exchanged between valid subscriber, onos and freeradius. |
| 2497 | 5. Validate that eap tls invalid cert auth packets are being exchanged between invalid subscriber, onos and freeradius. |
| 2498 | 6. Verify that valid subscriber authenticated successfully. |
| 2499 | 7. Verify that invalid subscriber are not authenticated successfully. |
| 2500 | """ |
| 2501 | |
Chetan Gaonker | fe1048f | 2017-06-13 20:16:25 +0000 | [diff] [blame] | 2502 | df = defer.Deferred() |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 2503 | def tls_flow_check_on_two_subscribers_same_olt_device(df): |
Chetan Gaonker | fe1048f | 2017-06-13 20:16:25 +0000 | [diff] [blame] | 2504 | aaa_app = ["org.opencord.aaa"] |
| 2505 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 2506 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Chetan Gaonker | fe1048f | 2017-06-13 20:16:25 +0000 | [diff] [blame] | 2507 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 2508 | devices_list = self.voltha.get_devices() |
| 2509 | log_test.info('All available devices on voltha = %s'%devices_list['items']) |
| 2510 | |
| 2511 | onu_device_id = devices_list['items'][1]['id'] |
| 2512 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 2513 | voltha = VolthaCtrl(**self.voltha_attrs) |
Chetan Gaonker | fe1048f | 2017-06-13 20:16:25 +0000 | [diff] [blame] | 2514 | time.sleep(10) |
| 2515 | switch_map = None |
| 2516 | olt_configured = False |
| 2517 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 2518 | log_test.info('Installing OLT app') |
| 2519 | OnosCtrl.install_app(self.olt_app_file) |
| 2520 | time.sleep(5) |
| 2521 | log_test.info('Adding subscribers through OLT app') |
| 2522 | self.config_olt(switch_map) |
| 2523 | olt_configured = True |
| 2524 | time.sleep(5) |
| 2525 | devices_list = self.voltha.get_devices() |
| 2526 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT,)) |
| 2527 | thread2 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_2_RX_DEFAULT, "invalid_cert",)) |
| 2528 | thread1.start() |
| 2529 | time.sleep(randint(1,2)) |
| 2530 | log_test.info('Initiating tls auth packets from one more subscriber on same olt device which is deteced on voltha') |
| 2531 | thread2.start() |
| 2532 | time.sleep(10) |
| 2533 | thread1.join() |
| 2534 | thread2.join() |
| 2535 | try: |
| 2536 | # assert_equal(status, True) |
| 2537 | assert_equal(self.success, True) |
| 2538 | time.sleep(10) |
| 2539 | finally: |
| 2540 | self.voltha.disable_device(device_id, delete = True) |
| 2541 | df.callback(0) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 2542 | reactor.callLater(0, tls_flow_check_on_two_subscribers_same_olt_device, df) |
Chetan Gaonker | fe1048f | 2017-06-13 20:16:25 +0000 | [diff] [blame] | 2543 | return df |
| 2544 | |
| 2545 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 2546 | def test_two_subscribers_with_voltha_for_eap_tls_authentication_with_one_uni_port_disabled(self): |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 2547 | """ |
| 2548 | Test Method: |
| 2549 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2550 | 1. OLT and ONU is detected and validated. |
| 2551 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 2552 | 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 2553 | 5. Validate that eap tls packets are being exchanged between two subscriber, onos and freeradius. |
| 2554 | 6. Verify that subscriber authenticated successfully. |
| 2555 | 7. Disable one of the uni port which is seen in voltha and issue tls auth packets from subscriber. |
| 2556 | 8. Validate that eap tls packets are not being exchanged between one subscriber, onos and freeradius. |
| 2557 | 9. Verify that subscriber authentication is unsuccessful.. |
| 2558 | 10. Verify that other subscriber authenticated successfully. |
| 2559 | """ |
| 2560 | |
Chetan Gaonker | fe1048f | 2017-06-13 20:16:25 +0000 | [diff] [blame] | 2561 | df = defer.Deferred() |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 2562 | def tls_flow_check_on_two_subscribers_same_olt_device(df): |
Chetan Gaonker | fe1048f | 2017-06-13 20:16:25 +0000 | [diff] [blame] | 2563 | aaa_app = ["org.opencord.aaa"] |
| 2564 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 2565 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Chetan Gaonker | fe1048f | 2017-06-13 20:16:25 +0000 | [diff] [blame] | 2566 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 2567 | devices_list = self.voltha.get_devices() |
| 2568 | log_test.info('All available devices on voltha = %s'%devices_list['items']) |
| 2569 | |
| 2570 | onu_device_id = devices_list['items'][1]['id'] |
| 2571 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 2572 | voltha = VolthaCtrl(**self.voltha_attrs) |
Chetan Gaonker | fe1048f | 2017-06-13 20:16:25 +0000 | [diff] [blame] | 2573 | time.sleep(10) |
| 2574 | switch_map = None |
| 2575 | olt_configured = False |
| 2576 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 2577 | log_test.info('Installing OLT app') |
| 2578 | OnosCtrl.install_app(self.olt_app_file) |
| 2579 | time.sleep(5) |
| 2580 | log_test.info('Adding subscribers through OLT app') |
| 2581 | self.config_olt(switch_map) |
| 2582 | olt_configured = True |
| 2583 | time.sleep(5) |
| 2584 | devices_list = self.voltha.get_devices() |
| 2585 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT,)) |
| 2586 | thread2 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_2_RX_DEFAULT, "uni_port_admin_down",)) |
| 2587 | thread1.start() |
| 2588 | time.sleep(randint(1,2)) |
| 2589 | log_test.info('Initiating tls auth packets from one more subscriber on same olt device which is deteced on voltha') |
| 2590 | thread2.start() |
| 2591 | time.sleep(10) |
| 2592 | thread1.join() |
| 2593 | thread2.join() |
| 2594 | try: |
| 2595 | # assert_equal(status, True) |
| 2596 | assert_equal(self.success, True) |
| 2597 | time.sleep(10) |
| 2598 | finally: |
| 2599 | self.voltha.disable_device(device_id, delete = True) |
| 2600 | df.callback(0) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 2601 | reactor.callLater(0, tls_flow_check_on_two_subscribers_same_olt_device, df) |
Chetan Gaonker | fe1048f | 2017-06-13 20:16:25 +0000 | [diff] [blame] | 2602 | return df |
| 2603 | |
Thangavelu K S and Chetan Gaonker | e07a7b4 | 2017-08-23 17:43:31 +0000 | [diff] [blame] | 2604 | def test_three_subscribers_with_voltha_for_eap_tls_authentication(self): |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 2605 | """ |
| 2606 | Test Method: |
| 2607 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2608 | 1. OLT and ONU is detected and validated. |
| 2609 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 2610 | 3. Issue auth request packets from CORD TESTER voltha test module acting as multipe subscribers (3 subscribers) |
| 2611 | 4. Validate that eap tls valid auth packets are being exchanged between subscriber, onos and freeradius. |
| 2612 | 5. Verify that subscriber is authenticated successfully. |
| 2613 | """ |
| 2614 | """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each""" |
| 2615 | num_subscribers = 3 |
| 2616 | num_channels = 1 |
| 2617 | services = ('TLS') |
| 2618 | cbs = (self.tls_flow_check, None, None) |
| 2619 | self.voltha_subscribers(services, cbs = cbs, |
| 2620 | num_subscribers = num_subscribers, |
| 2621 | num_channels = num_channels) |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 2622 | assert_equal(self.success, True) |
| 2623 | |
Thangavelu K S and Chetan Gaonker | e07a7b4 | 2017-08-23 17:43:31 +0000 | [diff] [blame] | 2624 | def test_five_subscribers_with_voltha_for_eap_tls_authentication(self): |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 2625 | """ |
| 2626 | Test Method: |
| 2627 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2628 | 1. OLT and ONU is detected and validated. |
| 2629 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 2630 | 3. Issue auth request packets from CORD TESTER voltha test module acting as multipe subscribers (5 subscriber) |
| 2631 | 4. Validate that eap tls valid auth packets are being exchanged between subscriber, onos and freeradius. |
| 2632 | 5. Verify that subscriber is authenticated successfully. |
| 2633 | """ |
| 2634 | """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each""" |
| 2635 | num_subscribers = 5 |
| 2636 | num_channels = 1 |
| 2637 | services = ('TLS') |
| 2638 | cbs = (self.tls_flow_check, None, None) |
| 2639 | self.voltha_subscribers(services, cbs = cbs, |
| 2640 | num_subscribers = num_subscribers, |
| 2641 | num_channels = num_channels) |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 2642 | assert_equal(self.success, True) |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 2643 | |
Thangavelu K S and Chetan Gaonker | e07a7b4 | 2017-08-23 17:43:31 +0000 | [diff] [blame] | 2644 | def test_nine_subscribers_with_voltha_for_eap_tls_authentication(self): |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 2645 | """ |
| 2646 | Test Method: |
| 2647 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2648 | 1. OLT and ONU is detected and validated. |
| 2649 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 2650 | 3. Issue auth request packets from CORD TESTER voltha test module acting as multipe subscribers (9 subscriber) |
| 2651 | 4. Validate that eap tls valid auth packets are being exchanged between subscriber, onos and freeradius. |
| 2652 | 5. Verify that subscriber is authenticated successfully. |
| 2653 | """ |
| 2654 | """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each""" |
| 2655 | num_subscribers = 9 |
| 2656 | num_channels = 1 |
| 2657 | services = ('TLS') |
| 2658 | cbs = (self.tls_flow_check, None, None) |
| 2659 | self.voltha_subscribers(services, cbs = cbs, |
| 2660 | num_subscribers = num_subscribers, |
| 2661 | num_channels = num_channels) |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 2662 | assert_equal(self.success, True) |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 2663 | |
Chetan Gaonker | fe1048f | 2017-06-13 20:16:25 +0000 | [diff] [blame] | 2664 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 2665 | def test_subscriber_with_voltha_for_dhcp_request(self): |
| 2666 | """ |
| 2667 | Test Method: |
| 2668 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2669 | 1. OLT and ONU is detected and validated. |
| 2670 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 2671 | 3. Send dhcp request from residential subscrber to dhcp server which is running as onos app. |
| 2672 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 2673 | """ |
| 2674 | |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 2675 | df = defer.Deferred() |
| 2676 | def dhcp_flow_check_scenario(df): |
| 2677 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 2678 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 2679 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 2680 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 2681 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 2682 | time.sleep(10) |
| 2683 | switch_map = None |
| 2684 | olt_configured = False |
| 2685 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 2686 | log_test.info('Installing OLT app') |
| 2687 | OnosCtrl.install_app(self.olt_app_file) |
| 2688 | time.sleep(5) |
| 2689 | log_test.info('Adding subscribers through OLT app') |
| 2690 | self.config_olt(switch_map) |
| 2691 | olt_configured = True |
| 2692 | time.sleep(5) |
| 2693 | dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT) |
| 2694 | try: |
| 2695 | assert_equal(dhcp_status, True) |
| 2696 | #assert_equal(status, True) |
| 2697 | time.sleep(10) |
| 2698 | finally: |
| 2699 | self.remove_olt(switch_map) |
| 2700 | self.voltha.disable_device(device_id, delete = True) |
| 2701 | df.callback(0) |
| 2702 | |
| 2703 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 2704 | return df |
| 2705 | |
| 2706 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 2707 | def test_subscriber_with_voltha_for_dhcp_request_with_invalid_broadcast_source_mac(self): |
| 2708 | """ |
| 2709 | Test Method: |
| 2710 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2711 | 1. OLT and ONU is detected and validated. |
| 2712 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 2713 | 3. Send dhcp request with invalid source mac broadcast from residential subscrber to dhcp server which is running as onos app. |
| 2714 | 4. Verify that subscriber should not get ip from dhcp server. |
| 2715 | """ |
| 2716 | |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 2717 | df = defer.Deferred() |
| 2718 | def dhcp_flow_check_scenario(df): |
| 2719 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 2720 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 2721 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 2722 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 2723 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 2724 | time.sleep(10) |
| 2725 | switch_map = None |
| 2726 | olt_configured = False |
| 2727 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 2728 | log_test.info('Installing OLT app') |
| 2729 | OnosCtrl.install_app(self.olt_app_file) |
| 2730 | time.sleep(5) |
| 2731 | log_test.info('Adding subscribers through OLT app') |
| 2732 | self.config_olt(switch_map) |
| 2733 | olt_configured = True |
| 2734 | time.sleep(5) |
| 2735 | dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "invalid_src_mac_broadcast") |
| 2736 | try: |
| 2737 | assert_equal(dhcp_status, True) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 2738 | assert_equal(self.success, True) |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 2739 | #assert_equal(status, True) |
| 2740 | time.sleep(10) |
| 2741 | finally: |
| 2742 | self.voltha.disable_device(device_id, delete = True) |
| 2743 | self.remove_olt(switch_map) |
| 2744 | df.callback(0) |
| 2745 | |
| 2746 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 2747 | return df |
| 2748 | |
| 2749 | |
| 2750 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 2751 | def test_subscriber_with_voltha_for_dhcp_request_with_invalid_multicast_source_mac(self): |
| 2752 | """ |
| 2753 | Test Method: |
| 2754 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2755 | 1. OLT and ONU is detected and validated. |
| 2756 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 2757 | 3. Send dhcp request with invalid source mac multicast from residential subscrber to dhcp server which is running as onos app. |
| 2758 | 4. Verify that subscriber should not get ip from dhcp server. |
| 2759 | """ |
| 2760 | |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 2761 | df = defer.Deferred() |
| 2762 | def dhcp_flow_check_scenario(df): |
| 2763 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 2764 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 2765 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 2766 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 2767 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 2768 | time.sleep(10) |
| 2769 | switch_map = None |
| 2770 | olt_configured = False |
| 2771 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 2772 | log_test.info('Installing OLT app') |
| 2773 | OnosCtrl.install_app(self.olt_app_file) |
| 2774 | time.sleep(5) |
| 2775 | log_test.info('Adding subscribers through OLT app') |
| 2776 | self.config_olt(switch_map) |
| 2777 | olt_configured = True |
| 2778 | time.sleep(5) |
| 2779 | dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "invalid_src_mac_multicast") |
| 2780 | try: |
| 2781 | assert_equal(dhcp_status, True) |
| 2782 | #assert_equal(status, True) |
| 2783 | time.sleep(10) |
| 2784 | finally: |
| 2785 | self.voltha.disable_device(device_id, delete = True) |
| 2786 | self.remove_olt(switch_map) |
| 2787 | df.callback(0) |
| 2788 | |
| 2789 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 2790 | return df |
| 2791 | |
| 2792 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 2793 | def test_subscriber_with_voltha_for_dhcp_request_with_invalid_source_mac(self): |
| 2794 | """ |
| 2795 | Test Method: |
| 2796 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2797 | 1. OLT and ONU is detected and validated. |
| 2798 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 2799 | 3. Send dhcp request with invalid source mac zero from residential subscrber to dhcp server which is running as onos app. |
| 2800 | 4. Verify that subscriber should not get ip from dhcp server. |
| 2801 | """ |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 2802 | df = defer.Deferred() |
| 2803 | def dhcp_flow_check_scenario(df): |
| 2804 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 2805 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 2806 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 2807 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 2808 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 2809 | time.sleep(10) |
| 2810 | switch_map = None |
| 2811 | olt_configured = False |
| 2812 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 2813 | log_test.info('Installing OLT app') |
| 2814 | OnosCtrl.install_app(self.olt_app_file) |
| 2815 | time.sleep(5) |
| 2816 | log_test.info('Adding subscribers through OLT app') |
| 2817 | self.config_olt(switch_map) |
| 2818 | olt_configured = True |
| 2819 | time.sleep(5) |
| 2820 | dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "invalid_src_mac_junk") |
| 2821 | try: |
| 2822 | assert_equal(dhcp_status, True) |
| 2823 | #assert_equal(status, True) |
| 2824 | time.sleep(10) |
| 2825 | finally: |
| 2826 | self.voltha.disable_device(device_id, delete = True) |
| 2827 | self.remove_olt(switch_map) |
| 2828 | df.callback(0) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 2829 | |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 2830 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 2831 | return df |
| 2832 | |
| 2833 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 2834 | def test_subscriber_with_voltha_for_dhcp_request_and_release(self): |
| 2835 | """ |
| 2836 | Test Method: |
| 2837 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2838 | 1. OLT and ONU is detected and validated. |
| 2839 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 2840 | 3. Send dhcp request from residential subscrber to dhcp server which is running as onos app. |
| 2841 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 2842 | 5. Send dhcp release from residential subscrber to dhcp server which is running as onos app. |
| 2843 | 6 Verify that subscriber should not get ip from dhcp server, ping to gateway. |
| 2844 | """ |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 2845 | df = defer.Deferred() |
| 2846 | def dhcp_flow_check_scenario(df): |
| 2847 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 2848 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 2849 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 2850 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 2851 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 2852 | time.sleep(10) |
| 2853 | switch_map = None |
| 2854 | olt_configured = False |
| 2855 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 2856 | log_test.info('Installing OLT app') |
| 2857 | OnosCtrl.install_app(self.olt_app_file) |
| 2858 | time.sleep(5) |
| 2859 | log_test.info('Adding subscribers through OLT app') |
| 2860 | self.config_olt(switch_map) |
| 2861 | olt_configured = True |
| 2862 | time.sleep(5) |
| 2863 | dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "request_release") |
| 2864 | try: |
| 2865 | assert_equal(dhcp_status, True) |
| 2866 | #assert_equal(status, True) |
| 2867 | time.sleep(10) |
| 2868 | finally: |
| 2869 | self.voltha.disable_device(device_id, delete = True) |
| 2870 | self.remove_olt(switch_map) |
| 2871 | df.callback(0) |
| 2872 | |
| 2873 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 2874 | return df |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 2875 | |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 2876 | @deferred(TESTCASE_TIMEOUT) |
A.R Karthick | 57fa937 | 2017-05-24 12:47:03 -0700 | [diff] [blame] | 2877 | def test_subscriber_with_voltha_for_dhcp_starvation_positive_scenario(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 2878 | """ |
| 2879 | Test Method: |
| 2880 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2881 | 1. OLT and ONU is detected and validated. |
| 2882 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 2883 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 2884 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 2885 | 5. Repeat step 3 and 4 for 10 times. |
| 2886 | 6 Verify that subscriber should get ip from dhcp server. |
| 2887 | """ |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 2888 | df = defer.Deferred() |
| 2889 | def dhcp_flow_check_scenario(df): |
| 2890 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 2891 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 2892 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 2893 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 2894 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 2895 | time.sleep(10) |
| 2896 | switch_map = None |
| 2897 | olt_configured = False |
| 2898 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 2899 | log_test.info('Installing OLT app') |
| 2900 | OnosCtrl.install_app(self.olt_app_file) |
| 2901 | time.sleep(5) |
| 2902 | log_test.info('Adding subscribers through OLT app') |
| 2903 | self.config_olt(switch_map) |
| 2904 | olt_configured = True |
| 2905 | time.sleep(5) |
| 2906 | dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "starvation_positive") |
| 2907 | try: |
| 2908 | assert_equal(dhcp_status, True) |
| 2909 | #assert_equal(status, True) |
| 2910 | time.sleep(10) |
| 2911 | finally: |
| 2912 | self.voltha.disable_device(device_id, delete = True) |
| 2913 | self.remove_olt(switch_map) |
| 2914 | df.callback(0) |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 2915 | |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 2916 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 2917 | return df |
| 2918 | |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 2919 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 2920 | def test_subscriber_with_voltha_for_dhcp_starvation_negative_scenario(self): |
| 2921 | """ |
| 2922 | Test Method: |
| 2923 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2924 | 1. OLT and ONU is detected and validated. |
| 2925 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 2926 | 3. Send dhcp request from residential subscriber without of pool ip to dhcp server which is running as onos app. |
| 2927 | 4. Verify that subscriber should not get ip from dhcp server. |
| 2928 | 5. Repeat steps 3 and 4 for 10 times. |
| 2929 | 6 Verify that subscriber should not get ip from dhcp server. |
| 2930 | """ |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 2931 | df = defer.Deferred() |
| 2932 | def dhcp_flow_check_scenario(df): |
| 2933 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 2934 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 2935 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 2936 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 2937 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 2938 | time.sleep(10) |
| 2939 | switch_map = None |
| 2940 | olt_configured = False |
| 2941 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 2942 | log_test.info('Installing OLT app') |
| 2943 | OnosCtrl.install_app(self.olt_app_file) |
| 2944 | time.sleep(5) |
| 2945 | log_test.info('Adding subscribers through OLT app') |
| 2946 | self.config_olt(switch_map) |
| 2947 | olt_configured = True |
| 2948 | time.sleep(5) |
| 2949 | dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "starvation_negative") |
| 2950 | try: |
| 2951 | assert_equal(dhcp_status, True) |
| 2952 | #assert_equal(status, True) |
| 2953 | time.sleep(10) |
| 2954 | finally: |
| 2955 | self.voltha.disable_device(device_id, delete = True) |
| 2956 | self.remove_olt(switch_map) |
| 2957 | df.callback(0) |
| 2958 | |
| 2959 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 2960 | return df |
| 2961 | |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 2962 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 2963 | def test_subscriber_with_voltha_for_dhcp_sending_multiple_discover(self): |
| 2964 | """ |
| 2965 | Test Method: |
| 2966 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2967 | 1. OLT and ONU is detected and validated. |
| 2968 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 2969 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 2970 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 2971 | 5. Repeat step 3 for 50 times. |
| 2972 | 6 Verify that subscriber should get same ip which was received from 1st discover from dhcp server. |
| 2973 | """ |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 2974 | df = defer.Deferred() |
| 2975 | def dhcp_flow_check_scenario(df): |
| 2976 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 2977 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 2978 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 2979 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 2980 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 2981 | time.sleep(10) |
| 2982 | switch_map = None |
| 2983 | olt_configured = False |
| 2984 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 2985 | log_test.info('Installing OLT app') |
| 2986 | OnosCtrl.install_app(self.olt_app_file) |
| 2987 | time.sleep(5) |
| 2988 | log_test.info('Adding subscribers through OLT app') |
| 2989 | self.config_olt(switch_map) |
| 2990 | olt_configured = True |
| 2991 | time.sleep(5) |
| 2992 | dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "multiple_discover") |
| 2993 | try: |
| 2994 | assert_equal(dhcp_status, True) |
| 2995 | #assert_equal(status, True) |
| 2996 | time.sleep(10) |
| 2997 | finally: |
| 2998 | self.voltha.disable_device(device_id, delete = True) |
| 2999 | self.remove_olt(switch_map) |
| 3000 | df.callback(0) |
| 3001 | |
| 3002 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 3003 | return df |
| 3004 | |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 3005 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 3006 | def test_subscriber_with_voltha_for_dhcp_sending_multiple_request(self): |
| 3007 | """ |
| 3008 | Test Method: |
| 3009 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 3010 | 1. OLT and ONU is detected and validated. |
| 3011 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 3012 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 3013 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 3014 | 5. Send DHCP request to dhcp server which is running as onos app. |
| 3015 | 6. Repeat step 5 for 50 times. |
| 3016 | 7. Verify that subscriber should get same ip which was received from 1st discover from dhcp server. |
| 3017 | """ |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 3018 | df = defer.Deferred() |
| 3019 | def dhcp_flow_check_scenario(df): |
| 3020 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 3021 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 3022 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 3023 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 3024 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 3025 | time.sleep(10) |
| 3026 | switch_map = None |
| 3027 | olt_configured = False |
| 3028 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 3029 | log_test.info('Installing OLT app') |
| 3030 | OnosCtrl.install_app(self.olt_app_file) |
| 3031 | time.sleep(5) |
| 3032 | log_test.info('Adding subscribers through OLT app') |
| 3033 | self.config_olt(switch_map) |
| 3034 | olt_configured = True |
| 3035 | time.sleep(5) |
| 3036 | dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "multiple_requests") |
| 3037 | try: |
| 3038 | assert_equal(dhcp_status, True) |
| 3039 | #assert_equal(status, True) |
| 3040 | time.sleep(10) |
| 3041 | finally: |
| 3042 | self.voltha.disable_device(device_id, delete = True) |
| 3043 | self.remove_olt(switch_map) |
| 3044 | df.callback(0) |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 3045 | |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 3046 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 3047 | return df |
| 3048 | |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 3049 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 3050 | def test_subscriber_with_voltha_for_dhcp_requesting_desired_ip_address(self): |
| 3051 | """ |
| 3052 | Test Method: |
| 3053 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 3054 | 1. OLT and ONU is detected and validated. |
| 3055 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 3056 | 3. Send dhcp request with desired ip address from residential subscriber to dhcp server which is running as onos app. |
| 3057 | 4. Verify that subscriber get ip which was requested in step 3 from dhcp server successfully. |
| 3058 | """ |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 3059 | df = defer.Deferred() |
| 3060 | def dhcp_flow_check_scenario(df): |
| 3061 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 3062 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 3063 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 3064 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 3065 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 3066 | time.sleep(10) |
| 3067 | switch_map = None |
| 3068 | olt_configured = False |
| 3069 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 3070 | log_test.info('Installing OLT app') |
| 3071 | OnosCtrl.install_app(self.olt_app_file) |
| 3072 | time.sleep(5) |
| 3073 | log_test.info('Adding subscribers through OLT app') |
| 3074 | self.config_olt(switch_map) |
| 3075 | olt_configured = True |
| 3076 | time.sleep(5) |
| 3077 | dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "desired_ip_address") |
| 3078 | try: |
| 3079 | assert_equal(dhcp_status, True) |
| 3080 | #assert_equal(status, True) |
| 3081 | time.sleep(10) |
| 3082 | finally: |
| 3083 | self.voltha.disable_device(device_id, delete = True) |
| 3084 | self.remove_olt(switch_map) |
| 3085 | df.callback(0) |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 3086 | |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 3087 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 3088 | return df |
| 3089 | |
| 3090 | @deferred(TESTCASE_TIMEOUT) |
| 3091 | def test_subscriber_with_voltha_for_dhcp_requesting_desired_out_of_pool_ip_address(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 3092 | """ |
| 3093 | Test Method: |
| 3094 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 3095 | 1. OLT and ONU is detected and validated. |
| 3096 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 3097 | 3. Send dhcp request with desired out of pool ip address from residential subscriber to dhcp server which is running as onos app. |
| 3098 | 4. Verify that subscriber should not get ip which was requested in step 3 from dhcp server, and its offered only within dhcp pool of ip. |
| 3099 | """ |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 3100 | df = defer.Deferred() |
| 3101 | def dhcp_flow_check_scenario(df): |
| 3102 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 3103 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 3104 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 3105 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 3106 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 3107 | time.sleep(10) |
| 3108 | switch_map = None |
| 3109 | olt_configured = False |
| 3110 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 3111 | log_test.info('Installing OLT app') |
| 3112 | OnosCtrl.install_app(self.olt_app_file) |
| 3113 | time.sleep(5) |
| 3114 | log_test.info('Adding subscribers through OLT app') |
| 3115 | self.config_olt(switch_map) |
| 3116 | olt_configured = True |
| 3117 | time.sleep(5) |
| 3118 | dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "desired_out_of_pool_ip_address") |
| 3119 | try: |
| 3120 | assert_equal(dhcp_status, True) |
| 3121 | #assert_equal(status, True) |
| 3122 | time.sleep(10) |
| 3123 | finally: |
| 3124 | self.voltha.disable_device(device_id, delete = True) |
| 3125 | self.remove_olt(switch_map) |
| 3126 | df.callback(0) |
| 3127 | |
| 3128 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 3129 | return df |
| 3130 | |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 3131 | @deferred(TESTCASE_TIMEOUT) |
| 3132 | def test_subscriber_with_voltha_deactivating_dhcp_app_in_onos(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 3133 | """ |
| 3134 | Test Method: |
| 3135 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 3136 | 1. OLT and ONU is detected and validated. |
| 3137 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 3138 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 3139 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 3140 | 5. Deactivate dhcp server app in onos. |
| 3141 | 6. Repeat step 3. |
| 3142 | 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway. |
| 3143 | """ |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 3144 | df = defer.Deferred() |
| 3145 | dhcp_app = 'org.onosproject.dhcp' |
| 3146 | def dhcp_flow_check_scenario(df): |
| 3147 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 3148 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 3149 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 3150 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 3151 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 3152 | time.sleep(10) |
| 3153 | switch_map = None |
| 3154 | olt_configured = False |
| 3155 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 3156 | log_test.info('Installing OLT app') |
| 3157 | OnosCtrl.install_app(self.olt_app_file) |
| 3158 | time.sleep(5) |
| 3159 | log_test.info('Adding subscribers through OLT app') |
| 3160 | self.config_olt(switch_map) |
| 3161 | olt_configured = True |
| 3162 | time.sleep(5) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3163 | thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT, "interrupting_dhcp_flows",)) |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 3164 | thread2 = threading.Thread(target = self.deactivate_apps, args = (dhcp_app,)) |
| 3165 | log_test.info('Restart dhcp app in onos during client send discover to voltha') |
| 3166 | thread2.start() |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 3167 | thread1.start() |
| 3168 | time.sleep(10) |
| 3169 | thread1.join() |
| 3170 | thread2.join() |
| 3171 | try: |
| 3172 | assert_equal(self.success, True) |
| 3173 | #assert_equal(status, True) |
| 3174 | time.sleep(10) |
| 3175 | finally: |
| 3176 | self.voltha.disable_device(device_id, delete = True) |
| 3177 | self.remove_olt(switch_map) |
| 3178 | df.callback(0) |
| 3179 | |
| 3180 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 3181 | return df |
| 3182 | |
| 3183 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 3184 | def test_subscriber_with_voltha_for_dhcp_renew_time(self): |
| 3185 | """ |
| 3186 | Test Method: |
| 3187 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 3188 | 1. OLT and ONU is detected and validated. |
| 3189 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 3190 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 3191 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 3192 | 5. Send dhcp renew packet to dhcp server which is running as onos app. |
| 3193 | 6. Repeat step 4. |
| 3194 | """ |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3195 | |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3196 | df = defer.Deferred() |
| 3197 | def dhcp_flow_check_scenario(df): |
| 3198 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 3199 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3200 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 3201 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 3202 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3203 | time.sleep(10) |
| 3204 | switch_map = None |
| 3205 | olt_configured = False |
| 3206 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 3207 | log_test.info('Installing OLT app') |
| 3208 | OnosCtrl.install_app(self.olt_app_file) |
| 3209 | time.sleep(5) |
| 3210 | log_test.info('Adding subscribers through OLT app') |
| 3211 | self.config_olt(switch_map) |
| 3212 | olt_configured = True |
| 3213 | time.sleep(5) |
| 3214 | dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "dhcp_renew") |
| 3215 | try: |
| 3216 | assert_equal(dhcp_status, True) |
| 3217 | #assert_equal(status, True) |
| 3218 | time.sleep(10) |
| 3219 | finally: |
| 3220 | self.voltha.disable_device(device_id, delete = True) |
| 3221 | self.remove_olt(switch_map) |
| 3222 | df.callback(0) |
| 3223 | |
| 3224 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 3225 | return df |
| 3226 | |
| 3227 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 3228 | def test_subscriber_with_voltha_for_dhcp_rebind_time(self): |
| 3229 | """ |
| 3230 | Test Method: |
| 3231 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 3232 | 1. OLT and ONU is detected and validated. |
| 3233 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 3234 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 3235 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 3236 | 5. Send dhcp rebind packet to dhcp server which is running as onos app. |
| 3237 | 6. Repeat step 4. |
| 3238 | """ |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3239 | df = defer.Deferred() |
| 3240 | def dhcp_flow_check_scenario(df): |
| 3241 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 3242 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3243 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 3244 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 3245 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3246 | time.sleep(10) |
| 3247 | switch_map = None |
| 3248 | olt_configured = False |
| 3249 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 3250 | log_test.info('Installing OLT app') |
| 3251 | OnosCtrl.install_app(self.olt_app_file) |
| 3252 | time.sleep(5) |
| 3253 | log_test.info('Adding subscribers through OLT app') |
| 3254 | self.config_olt(switch_map) |
| 3255 | olt_configured = True |
| 3256 | time.sleep(5) |
| 3257 | dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "dhcp_rebind") |
| 3258 | try: |
| 3259 | assert_equal(dhcp_status, True) |
| 3260 | #assert_equal(status, True) |
| 3261 | time.sleep(10) |
| 3262 | finally: |
| 3263 | self.voltha.disable_device(device_id, delete = True) |
| 3264 | self.remove_olt(switch_map) |
| 3265 | df.callback(0) |
| 3266 | |
| 3267 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 3268 | return df |
| 3269 | |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3270 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3271 | def test_subscriber_with_voltha_for_dhcp_toggling_olt(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 3272 | """ |
| 3273 | Test Method: |
| 3274 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 3275 | 1. OLT and ONU is detected and validated. |
| 3276 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 3277 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 3278 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 3279 | 5. Disable olt devices which is being detected in voltha CLI. |
| 3280 | 6. Repeat step 3. |
| 3281 | 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway. |
| 3282 | """ |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3283 | df = defer.Deferred() |
| 3284 | dhcp_app = 'org.onosproject.dhcp' |
| 3285 | def dhcp_flow_check_scenario(df): |
| 3286 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 3287 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3288 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 3289 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 3290 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3291 | time.sleep(10) |
| 3292 | switch_map = None |
| 3293 | olt_configured = False |
| 3294 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 3295 | log_test.info('Installing OLT app') |
| 3296 | OnosCtrl.install_app(self.olt_app_file) |
| 3297 | time.sleep(5) |
| 3298 | log_test.info('Adding subscribers through OLT app') |
| 3299 | self.config_olt(switch_map) |
| 3300 | olt_configured = True |
| 3301 | time.sleep(5) |
| 3302 | thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT, "interrupting_dhcp_flows",)) |
| 3303 | thread2 = threading.Thread(target = self.voltha.disable_device, args = (device_id,False,)) |
| 3304 | log_test.info('Disable the olt device in during client send discover to voltha') |
| 3305 | thread2.start() |
| 3306 | # time.sleep(randint(0,1)) |
| 3307 | thread1.start() |
| 3308 | time.sleep(10) |
| 3309 | thread1.join() |
| 3310 | thread2.join() |
| 3311 | try: |
Chetan Gaonker | cf37f26 | 2017-06-19 19:11:11 +0000 | [diff] [blame] | 3312 | assert_equal(self.success, True) |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3313 | #assert_equal(status, True) |
| 3314 | time.sleep(10) |
| 3315 | finally: |
| 3316 | self.voltha.disable_device(device_id, delete = True) |
| 3317 | self.remove_olt(switch_map) |
| 3318 | df.callback(0) |
| 3319 | |
| 3320 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 3321 | return df |
| 3322 | |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3323 | @deferred(TESTCASE_TIMEOUT) |
| 3324 | def test_subscriber_with_voltha_for_dhcp_with_multiple_times_disabling_of_olt(self): |
| 3325 | """ |
| 3326 | Test Method: |
| 3327 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 3328 | 1. OLT and ONU is detected and validated. |
| 3329 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 3330 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 3331 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 3332 | 5. Disable olt devices which is being detected in voltha CLI. |
| 3333 | 6. Repeat step 3. |
| 3334 | 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway. |
| 3335 | 8. Repeat steps from 3 to 7 for 10 times and finally verify dhcp flow |
| 3336 | """ |
| 3337 | df = defer.Deferred() |
| 3338 | no_iterations = 10 |
| 3339 | dhcp_app = 'org.onosproject.dhcp' |
| 3340 | def dhcp_flow_check_scenario(df): |
| 3341 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 3342 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3343 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 3344 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 3345 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3346 | time.sleep(10) |
| 3347 | switch_map = None |
| 3348 | olt_configured = False |
| 3349 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 3350 | log_test.info('Installing OLT app') |
| 3351 | OnosCtrl.install_app(self.olt_app_file) |
| 3352 | time.sleep(5) |
| 3353 | log_test.info('Adding subscribers through OLT app') |
| 3354 | self.config_olt(switch_map) |
| 3355 | olt_configured = True |
| 3356 | time.sleep(5) |
| 3357 | for i in range(no_iterations): |
| 3358 | thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT, "interrupting_dhcp_flows",)) |
| 3359 | thread2 = threading.Thread(target = self.voltha.disable_device, args = (device_id,False,)) |
| 3360 | log_test.info('Disable the olt device in during client send discover to voltha') |
| 3361 | thread2.start() |
| 3362 | # time.sleep(randint(0,1)) |
| 3363 | thread1.start() |
| 3364 | time.sleep(10) |
| 3365 | thread1.join() |
| 3366 | thread2.join() |
| 3367 | dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT) |
| 3368 | try: |
| 3369 | assert_equal(self.success, True) |
| 3370 | assert_equal(dhcp_status, True) |
| 3371 | #assert_equal(status, True) |
| 3372 | time.sleep(10) |
| 3373 | finally: |
| 3374 | self.voltha.disable_device(device_id, delete = True) |
| 3375 | self.remove_olt(switch_map) |
| 3376 | df.callback(0) |
| 3377 | |
| 3378 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 3379 | return df |
| 3380 | |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3381 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3382 | def test_subscriber_with_voltha_for_dhcp_toggling_olt(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 3383 | """ |
| 3384 | Test Method: |
| 3385 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 3386 | 1. OLT and ONU is detected and validated. |
| 3387 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 3388 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 3389 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 3390 | 5. Disable olt devices which is being detected in voltha CLI. |
| 3391 | 6. Repeat step 3. |
| 3392 | 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway. |
| 3393 | 8. Enable olt devices which is being detected in voltha CLI. |
| 3394 | 9. Repeat steps 3 and 4. |
| 3395 | """ |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3396 | df = defer.Deferred() |
| 3397 | dhcp_app = 'org.onosproject.dhcp' |
| 3398 | def dhcp_flow_check_scenario(df): |
| 3399 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 3400 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3401 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 3402 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 3403 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3404 | time.sleep(10) |
| 3405 | switch_map = None |
| 3406 | olt_configured = False |
| 3407 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 3408 | log_test.info('Installing OLT app') |
| 3409 | OnosCtrl.install_app(self.olt_app_file) |
| 3410 | time.sleep(5) |
| 3411 | log_test.info('Adding subscribers through OLT app') |
| 3412 | self.config_olt(switch_map) |
| 3413 | olt_configured = True |
| 3414 | time.sleep(5) |
| 3415 | thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT, "interrupting_dhcp_flows",)) |
| 3416 | thread2 = threading.Thread(target = self.voltha.restart_device, args = (device_id,)) |
| 3417 | thread2.start() |
| 3418 | thread1.start() |
| 3419 | time.sleep(10) |
| 3420 | thread1.join() |
| 3421 | thread2.join() |
| 3422 | try: |
Chetan Gaonker | cf37f26 | 2017-06-19 19:11:11 +0000 | [diff] [blame] | 3423 | assert_equal(self.success, True) |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3424 | #assert_equal(status, True) |
| 3425 | time.sleep(10) |
| 3426 | finally: |
| 3427 | self.voltha.disable_device(device_id, delete = True) |
| 3428 | self.remove_olt(switch_map) |
| 3429 | df.callback(0) |
| 3430 | |
| 3431 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 3432 | return df |
| 3433 | |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3434 | @deferred(TESTCASE_TIMEOUT) |
| 3435 | def test_subscriber_with_voltha_for_dhcp_toggling_olt_multiple_times(self): |
| 3436 | """ |
| 3437 | Test Method: |
| 3438 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 3439 | 1. OLT and ONU is detected and validated. |
| 3440 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 3441 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 3442 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 3443 | 5. Disable olt devices which is being detected in voltha CLI. |
| 3444 | 6. Repeat step 3. |
| 3445 | 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway. |
| 3446 | 8. Enable olt devices which is being detected in voltha CLI. |
| 3447 | 9. Repeat steps 3 and 4. |
| 3448 | """ |
| 3449 | |
| 3450 | df = defer.Deferred() |
| 3451 | no_iterations = 10 |
| 3452 | dhcp_app = 'org.onosproject.dhcp' |
| 3453 | def dhcp_flow_check_scenario(df): |
| 3454 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 3455 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3456 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 3457 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 3458 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3459 | time.sleep(10) |
| 3460 | switch_map = None |
| 3461 | olt_configured = False |
| 3462 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 3463 | log_test.info('Installing OLT app') |
| 3464 | OnosCtrl.install_app(self.olt_app_file) |
| 3465 | time.sleep(5) |
| 3466 | log_test.info('Adding subscribers through OLT app') |
| 3467 | self.config_olt(switch_map) |
| 3468 | olt_configured = True |
| 3469 | time.sleep(5) |
| 3470 | for i in range(no_iterations): |
| 3471 | thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT, "interrupting_dhcp_flows",)) |
| 3472 | thread2 = threading.Thread(target = self.voltha.restart_device, args = (device_id,)) |
| 3473 | thread2.start() |
| 3474 | thread1.start() |
| 3475 | time.sleep(10) |
| 3476 | thread1.join() |
| 3477 | thread2.join() |
| 3478 | dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT) |
| 3479 | try: |
| 3480 | assert_equal(dhcp_status, True) |
| 3481 | #assert_equal(status, True) |
| 3482 | assert_equal(self.success, True) |
| 3483 | time.sleep(10) |
| 3484 | finally: |
| 3485 | self.voltha.disable_device(device_id, delete = True) |
| 3486 | self.remove_olt(switch_map) |
| 3487 | df.callback(0) |
| 3488 | |
| 3489 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 3490 | return df |
| 3491 | |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3492 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3493 | def test_subscriber_with_voltha_for_dhcp_disabling_onu_port(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 3494 | """ |
| 3495 | Test Method: |
| 3496 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 3497 | 1. OLT and ONU is detected and validated. |
| 3498 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 3499 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 3500 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 3501 | 5. Disable onu port which is being detected in voltha CLI. |
| 3502 | 6. Repeat step 3. |
| 3503 | 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway. |
| 3504 | """ |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3505 | df = defer.Deferred() |
| 3506 | dhcp_app = 'org.onosproject.dhcp' |
| 3507 | def dhcp_flow_check_scenario(df): |
| 3508 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 3509 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3510 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 3511 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 3512 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3513 | time.sleep(10) |
| 3514 | switch_map = None |
| 3515 | olt_configured = False |
| 3516 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 3517 | log_test.info('Installing OLT app') |
| 3518 | OnosCtrl.install_app(self.olt_app_file) |
| 3519 | time.sleep(5) |
| 3520 | log_test.info('Adding subscribers through OLT app') |
| 3521 | self.config_olt(switch_map) |
| 3522 | olt_configured = True |
| 3523 | time.sleep(5) |
| 3524 | thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT, "interrupting_dhcp_flows",)) |
Thangavelu K S and Chetan Gaonker | 0cf7564 | 2017-08-03 20:13:23 +0000 | [diff] [blame] | 3525 | thread2 = threading.Thread(target = self.voltha_uni_port_toggle) |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3526 | thread1.start() |
| 3527 | thread2.start() |
| 3528 | time.sleep(10) |
| 3529 | thread1.join() |
| 3530 | thread2.join() |
| 3531 | try: |
Chetan Gaonker | cf37f26 | 2017-06-19 19:11:11 +0000 | [diff] [blame] | 3532 | assert_equal(self.success, True) |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3533 | #assert_equal(status, True) |
| 3534 | time.sleep(10) |
| 3535 | finally: |
| 3536 | self.voltha.disable_device(device_id, delete = True) |
| 3537 | self.remove_olt(switch_map) |
| 3538 | df.callback(0) |
| 3539 | |
| 3540 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 3541 | return df |
| 3542 | |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3543 | @deferred(TESTCASE_TIMEOUT) |
| 3544 | def test_subscriber_with_voltha_for_dhcp_disabling_onu_port_multiple_times(self): |
| 3545 | """ |
| 3546 | Test Method: |
| 3547 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 3548 | 1. OLT and ONU is detected and validated. |
| 3549 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 3550 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 3551 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 3552 | 5. Disable onu port which is being detected in voltha CLI. |
| 3553 | 6. Repeat step 3. |
| 3554 | 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway. |
| 3555 | """ |
| 3556 | df = defer.Deferred() |
| 3557 | no_iterations = 10 |
| 3558 | dhcp_app = 'org.onosproject.dhcp' |
| 3559 | def dhcp_flow_check_scenario(df): |
| 3560 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 3561 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3562 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 3563 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 3564 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3565 | time.sleep(10) |
| 3566 | switch_map = None |
| 3567 | olt_configured = False |
| 3568 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 3569 | log_test.info('Installing OLT app') |
| 3570 | OnosCtrl.install_app(self.olt_app_file) |
| 3571 | time.sleep(5) |
| 3572 | log_test.info('Adding subscribers through OLT app') |
| 3573 | self.config_olt(switch_map) |
| 3574 | olt_configured = True |
| 3575 | time.sleep(5) |
| 3576 | for i in range(no_iterations): |
| 3577 | thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT, "interrupting_dhcp_flows",)) |
Thangavelu K S and Chetan Gaonker | 0cf7564 | 2017-08-03 20:13:23 +0000 | [diff] [blame] | 3578 | thread2 = threading.Thread(target = self.voltha_uni_port_toggle) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3579 | thread1.start() |
| 3580 | thread2.start() |
| 3581 | time.sleep(10) |
| 3582 | thread1.join() |
| 3583 | thread2.join() |
| 3584 | dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT) |
| 3585 | try: |
| 3586 | #assert_equal(status, True) |
| 3587 | assert_equal(dhcp_status, True) |
| 3588 | assert_equal(self.success, True) |
| 3589 | time.sleep(10) |
| 3590 | finally: |
| 3591 | self.voltha.disable_device(device_id, delete = True) |
| 3592 | self.remove_olt(switch_map) |
| 3593 | df.callback(0) |
| 3594 | |
| 3595 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 3596 | return df |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3597 | |
| 3598 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3599 | def test_subscriber_with_voltha_for_dhcp_toggling_onu_port(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 3600 | """ |
| 3601 | Test Method: |
| 3602 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 3603 | 1. OLT and ONU is detected and validated. |
| 3604 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 3605 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 3606 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 3607 | 5. Disable onu port which is being detected in voltha CLI. |
| 3608 | 6. Repeat step 3. |
| 3609 | 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway. |
| 3610 | 8. Enable onu port which is being detected in voltha CLI. |
| 3611 | 9. Repeat steps 3 and 4. |
| 3612 | """ |
| 3613 | |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3614 | df = defer.Deferred() |
| 3615 | dhcp_app = 'org.onosproject.dhcp' |
| 3616 | def dhcp_flow_check_scenario(df): |
| 3617 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 3618 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3619 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 3620 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 3621 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3622 | time.sleep(10) |
| 3623 | switch_map = None |
| 3624 | olt_configured = False |
| 3625 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 3626 | log_test.info('Installing OLT app') |
| 3627 | OnosCtrl.install_app(self.olt_app_file) |
| 3628 | time.sleep(5) |
| 3629 | log_test.info('Adding subscribers through OLT app') |
| 3630 | self.config_olt(switch_map) |
| 3631 | olt_configured = True |
| 3632 | time.sleep(5) |
| 3633 | thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT, "interrupting_dhcp_flows",)) |
Thangavelu K S and Chetan Gaonker | 0cf7564 | 2017-08-03 20:13:23 +0000 | [diff] [blame] | 3634 | thread2 = threading.Thread(target = self.voltha_uni_port_toggle) |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3635 | log_test.info('Restart dhcp app in onos during client send discover to voltha') |
| 3636 | thread2.start() |
| 3637 | time.sleep(randint(0,1)) |
| 3638 | thread1.start() |
| 3639 | time.sleep(10) |
| 3640 | thread1.join() |
| 3641 | thread2.join() |
| 3642 | dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT) |
| 3643 | assert_equal(dhcp_status, True) |
| 3644 | try: |
Chetan Gaonker | cf37f26 | 2017-06-19 19:11:11 +0000 | [diff] [blame] | 3645 | assert_equal(self.success, True) |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3646 | #assert_equal(status, True) |
| 3647 | time.sleep(10) |
| 3648 | finally: |
| 3649 | self.voltha.disable_device(device_id, delete = True) |
| 3650 | self.remove_olt(switch_map) |
| 3651 | df.callback(0) |
| 3652 | |
| 3653 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 3654 | return df |
| 3655 | |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3656 | @deferred(TESTCASE_TIMEOUT) |
| 3657 | def test_subscriber_with_voltha_for_dhcp_toggling_onu_port_multiple_times(self): |
| 3658 | """ |
| 3659 | Test Method: |
| 3660 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 3661 | 1. OLT and ONU is detected and validated. |
| 3662 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 3663 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 3664 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 3665 | 5. Disable onu port which is being detected in voltha CLI. |
| 3666 | 6. Repeat step 3. |
| 3667 | 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway. |
| 3668 | 8. Enable onu port which is being detected in voltha CLI. |
| 3669 | 9. Repeat steps 3 and 4. |
| 3670 | """ |
| 3671 | |
| 3672 | df = defer.Deferred() |
| 3673 | no_iterations = 10 |
| 3674 | dhcp_app = 'org.onosproject.dhcp' |
| 3675 | def dhcp_flow_check_scenario(df): |
| 3676 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 3677 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3678 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 3679 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 3680 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3681 | time.sleep(10) |
| 3682 | switch_map = None |
| 3683 | olt_configured = False |
| 3684 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 3685 | log_test.info('Installing OLT app') |
| 3686 | OnosCtrl.install_app(self.olt_app_file) |
| 3687 | time.sleep(5) |
| 3688 | log_test.info('Adding subscribers through OLT app') |
| 3689 | self.config_olt(switch_map) |
| 3690 | olt_configured = True |
| 3691 | time.sleep(5) |
| 3692 | for i in range(no_iterations): |
| 3693 | thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT, "interrupting_dhcp_flows",)) |
Thangavelu K S and Chetan Gaonker | 0cf7564 | 2017-08-03 20:13:23 +0000 | [diff] [blame] | 3694 | thread2 = threading.Thread(target = self.voltha_uni_port_toggle) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3695 | log_test.info('Restart dhcp app in onos during client send discover to voltha') |
| 3696 | thread2.start() |
| 3697 | time.sleep(randint(0,1)) |
| 3698 | thread1.start() |
| 3699 | time.sleep(10) |
| 3700 | thread1.join() |
| 3701 | thread2.join() |
| 3702 | dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT) |
| 3703 | assert_equal(dhcp_status, True) |
| 3704 | try: |
| 3705 | assert_equal(self.success, True) |
| 3706 | #assert_equal(status, True) |
| 3707 | time.sleep(10) |
| 3708 | finally: |
| 3709 | self.voltha.disable_device(device_id, delete = True) |
| 3710 | self.remove_olt(switch_map) |
| 3711 | df.callback(0) |
| 3712 | |
| 3713 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 3714 | return df |
| 3715 | |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3716 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3717 | def test_two_subscribers_with_voltha_for_dhcp_discover(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 3718 | """ |
| 3719 | Test Method: |
| 3720 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 3721 | 1. OLT and ONU is detected and validated. |
| 3722 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 3723 | 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app. |
| 3724 | 4. Verify that subscribers had got different ips from dhcp server successfully. |
| 3725 | """ |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3726 | df = defer.Deferred() |
| 3727 | self.success = True |
| 3728 | dhcp_app = 'org.onosproject.dhcp' |
| 3729 | def dhcp_flow_check_scenario(df): |
| 3730 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 3731 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3732 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 3733 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 3734 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3735 | time.sleep(10) |
| 3736 | switch_map = None |
| 3737 | olt_configured = False |
| 3738 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 3739 | log_test.info('Installing OLT app') |
| 3740 | OnosCtrl.install_app(self.olt_app_file) |
| 3741 | time.sleep(5) |
| 3742 | log_test.info('Adding subscribers through OLT app') |
| 3743 | self.config_olt(switch_map) |
| 3744 | olt_configured = True |
| 3745 | time.sleep(5) |
| 3746 | thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT,)) |
| 3747 | thread2 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_2_RX_DEFAULT,)) |
| 3748 | thread1.start() |
| 3749 | thread2.start() |
| 3750 | time.sleep(10) |
| 3751 | thread1.join() |
| 3752 | thread2.join() |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3753 | dhcp_flow_status = self.success |
| 3754 | try: |
| 3755 | # if self.success is not True: |
| 3756 | assert_equal(dhcp_flow_status, True) |
| 3757 | #assert_equal(status, True) |
| 3758 | time.sleep(10) |
| 3759 | finally: |
| 3760 | self.voltha.disable_device(device_id, delete = True) |
| 3761 | self.remove_olt(switch_map) |
| 3762 | df.callback(0) |
| 3763 | |
| 3764 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 3765 | return df |
| 3766 | |
| 3767 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3768 | def test_two_subscribers_with_voltha_for_dhcp_multiple_discover(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 3769 | """ |
| 3770 | Test Method: |
| 3771 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 3772 | 1. OLT and ONU is detected and validated. |
| 3773 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 3774 | 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app. |
| 3775 | 4. Verify that subscribers had got ip from dhcp server successfully. |
| 3776 | 5. Repeat step 3 and 4 for 10 times for both subscribers. |
| 3777 | 6 Verify that subscribers should get same ips which are offered the first time from dhcp server. |
| 3778 | """ |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3779 | df = defer.Deferred() |
| 3780 | self.success = True |
| 3781 | dhcp_app = 'org.onosproject.dhcp' |
| 3782 | def dhcp_flow_check_scenario(df): |
| 3783 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 3784 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3785 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 3786 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 3787 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3788 | time.sleep(10) |
| 3789 | switch_map = None |
| 3790 | olt_configured = False |
| 3791 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 3792 | log_test.info('Installing OLT app') |
| 3793 | OnosCtrl.install_app(self.olt_app_file) |
| 3794 | time.sleep(5) |
| 3795 | log_test.info('Adding subscribers through OLT app') |
| 3796 | self.config_olt(switch_map) |
| 3797 | olt_configured = True |
| 3798 | time.sleep(5) |
| 3799 | thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT,"multiple_discover",)) |
| 3800 | thread2 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_2_RX_DEFAULT,"multiple_discover",)) |
| 3801 | thread1.start() |
| 3802 | thread2.start() |
| 3803 | time.sleep(10) |
| 3804 | thread1.join() |
| 3805 | thread2.join() |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3806 | dhcp_flow_status = self.success |
| 3807 | try: |
| 3808 | # if self.success is not True: |
| 3809 | assert_equal(dhcp_flow_status, True) |
| 3810 | #assert_equal(status, True) |
| 3811 | time.sleep(10) |
| 3812 | finally: |
| 3813 | self.voltha.disable_device(device_id, delete = True) |
| 3814 | self.remove_olt(switch_map) |
| 3815 | df.callback(0) |
| 3816 | |
| 3817 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 3818 | return df |
| 3819 | |
| 3820 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3821 | def test_two_subscribers_with_voltha_for_dhcp_and_with_multiple_discover_for_one_subscriber(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 3822 | """ |
| 3823 | Test Method: |
| 3824 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 3825 | 1. OLT and ONU is detected and validated. |
| 3826 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 3827 | 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app. |
| 3828 | 4. Verify that subscribers had got ip from dhcp server successfully. |
| 3829 | 5. Repeat step 3 and 4 for 10 times for only one subscriber and ping to gateway from other subscriber. |
| 3830 | 6 Verify that subscriber should get same ip which is offered the first time from dhcp server and other subscriber ping to gateway should not failed |
| 3831 | """ |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3832 | df = defer.Deferred() |
| 3833 | self.success = True |
| 3834 | dhcp_app = 'org.onosproject.dhcp' |
| 3835 | def dhcp_flow_check_scenario(df): |
| 3836 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 3837 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3838 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 3839 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 3840 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3841 | time.sleep(10) |
| 3842 | switch_map = None |
| 3843 | olt_configured = False |
| 3844 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 3845 | log_test.info('Installing OLT app') |
| 3846 | OnosCtrl.install_app(self.olt_app_file) |
| 3847 | time.sleep(5) |
| 3848 | log_test.info('Adding subscribers through OLT app') |
| 3849 | self.config_olt(switch_map) |
| 3850 | olt_configured = True |
| 3851 | time.sleep(5) |
| 3852 | thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT,"multiple_discover",)) |
| 3853 | thread2 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_2_RX_DEFAULT,)) |
| 3854 | thread1.start() |
| 3855 | thread2.start() |
| 3856 | time.sleep(10) |
| 3857 | thread1.join() |
| 3858 | thread2.join() |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3859 | dhcp_flow_status = self.success |
| 3860 | try: |
| 3861 | # if self.success is not True: |
| 3862 | assert_equal(dhcp_flow_status, True) |
| 3863 | #assert_equal(status, True) |
| 3864 | time.sleep(10) |
| 3865 | finally: |
| 3866 | self.voltha.disable_device(device_id, delete = True) |
| 3867 | self.remove_olt(switch_map) |
| 3868 | df.callback(0) |
| 3869 | |
| 3870 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 3871 | return df |
| 3872 | |
| 3873 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3874 | def test_two_subscribers_with_voltha_for_dhcp_discover_and_desired_ip_address_for_one_subscriber(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 3875 | """ |
| 3876 | Test Method: |
| 3877 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 3878 | 1. OLT and ONU is detected and validated. |
| 3879 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 3880 | 3. Send dhcp request from one residential subscriber to dhcp server which is running as onos app. |
| 3881 | 3. Send dhcp request with desired ip from other residential subscriber to dhcp server which is running as onos app. |
| 3882 | 4. Verify that subscribers had got different ips (one subscriber desired ip and other subscriber random ip) from dhcp server successfully. |
| 3883 | """ |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3884 | |
| 3885 | df = defer.Deferred() |
| 3886 | self.success = True |
| 3887 | dhcp_app = 'org.onosproject.dhcp' |
| 3888 | def dhcp_flow_check_scenario(df): |
| 3889 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 3890 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3891 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 3892 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 3893 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3894 | time.sleep(10) |
| 3895 | switch_map = None |
| 3896 | olt_configured = False |
| 3897 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 3898 | log_test.info('Installing OLT app') |
| 3899 | OnosCtrl.install_app(self.olt_app_file) |
| 3900 | time.sleep(5) |
| 3901 | log_test.info('Adding subscribers through OLT app') |
| 3902 | self.config_olt(switch_map) |
| 3903 | olt_configured = True |
| 3904 | time.sleep(5) |
| 3905 | thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT,)) |
| 3906 | thread2 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_2_RX_DEFAULT,"desired_ip_address",)) |
| 3907 | thread1.start() |
| 3908 | thread2.start() |
| 3909 | time.sleep(10) |
| 3910 | thread1.join() |
| 3911 | thread2.join() |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3912 | dhcp_flow_status = self.success |
| 3913 | try: |
| 3914 | # if self.success is not True: |
| 3915 | assert_equal(dhcp_flow_status, True) |
| 3916 | #assert_equal(status, True) |
| 3917 | time.sleep(10) |
| 3918 | finally: |
| 3919 | self.voltha.disable_device(device_id, delete = True) |
| 3920 | self.remove_olt(switch_map) |
| 3921 | df.callback(0) |
| 3922 | |
| 3923 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 3924 | return df |
| 3925 | |
| 3926 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3927 | def test_two_subscribers_with_voltha_for_dhcp_discover_within_and_without_dhcp_pool_ip_addresses(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 3928 | """ |
| 3929 | Test Method: |
| 3930 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 3931 | 1. OLT and ONU is detected and validated. |
| 3932 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 3933 | 3. Send dhcp request with desired wihtin dhcp pool ip from one residential subscriber to dhcp server which is running as onos app. |
| 3934 | 3. Send dhcp request with desired without in dhcp pool ip from other residential subscriber to dhcp server which is running as onos app. |
| 3935 | 4. Verify that subscribers had got different ips (both subscriber got random ips within dhcp pool) from dhcp server successfully. |
| 3936 | """ |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3937 | df = defer.Deferred() |
| 3938 | self.success = True |
| 3939 | dhcp_app = 'org.onosproject.dhcp' |
| 3940 | def dhcp_flow_check_scenario(df): |
| 3941 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 3942 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3943 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 3944 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 3945 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3946 | time.sleep(10) |
| 3947 | switch_map = None |
| 3948 | olt_configured = False |
| 3949 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 3950 | log_test.info('Installing OLT app') |
| 3951 | OnosCtrl.install_app(self.olt_app_file) |
| 3952 | time.sleep(5) |
| 3953 | log_test.info('Adding subscribers through OLT app') |
| 3954 | self.config_olt(switch_map) |
| 3955 | olt_configured = True |
| 3956 | time.sleep(5) |
| 3957 | thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT,"desired_ip_address",)) |
| 3958 | thread2 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_2_RX_DEFAULT,"desired_out_of_pool_ip_address",)) |
| 3959 | thread1.start() |
| 3960 | thread2.start() |
| 3961 | time.sleep(10) |
| 3962 | thread1.join() |
| 3963 | thread2.join() |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3964 | dhcp_flow_status = self.success |
| 3965 | try: |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3966 | assert_equal(dhcp_flow_status, True) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3967 | time.sleep(10) |
| 3968 | finally: |
| 3969 | self.voltha.disable_device(device_id, delete = True) |
| 3970 | self.remove_olt(switch_map) |
| 3971 | df.callback(0) |
| 3972 | |
| 3973 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 3974 | return df |
| 3975 | |
| 3976 | @deferred(TESTCASE_TIMEOUT) |
| 3977 | def test_two_subscribers_with_voltha_for_dhcp_disabling_onu_port_for_one_subscriber(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 3978 | """ |
| 3979 | Test Method: |
| 3980 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 3981 | 1. OLT and ONU is detected and validated. |
| 3982 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 3983 | 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app. |
| 3984 | 4. Verify that subscribers had got ip from dhcp server successfully. |
| 3985 | 5. Disable onu port on which access one subscriber and ping to gateway from other subscriber. |
| 3986 | 6. Repeat step 3 and 4 for one subscriber where uni port is down. |
| 3987 | 7. Verify that subscriber should not get ip from dhcp server and other subscriber ping to gateway should not failed. |
| 3988 | """ |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3989 | df = defer.Deferred() |
| 3990 | self.success = True |
| 3991 | dhcp_app = 'org.onosproject.dhcp' |
| 3992 | def dhcp_flow_check_scenario(df): |
| 3993 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 3994 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3995 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 3996 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 3997 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3998 | time.sleep(10) |
| 3999 | switch_map = None |
| 4000 | olt_configured = False |
| 4001 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 4002 | log_test.info('Installing OLT app') |
| 4003 | OnosCtrl.install_app(self.olt_app_file) |
| 4004 | time.sleep(5) |
| 4005 | log_test.info('Adding subscribers through OLT app') |
| 4006 | self.config_olt(switch_map) |
| 4007 | olt_configured = True |
| 4008 | time.sleep(5) |
| 4009 | thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT,"desired_ip_address",)) |
| 4010 | thread2 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_2_RX_DEFAULT,"desired_out_of_pool_ip_address",)) |
| 4011 | thread1.start() |
| 4012 | thread2.start() |
| 4013 | time.sleep(10) |
| 4014 | thread1.join() |
| 4015 | thread2.join() |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 4016 | dhcp_flow_status = self.success |
| 4017 | try: |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 4018 | assert_equal(dhcp_flow_status, True) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 4019 | time.sleep(10) |
| 4020 | finally: |
| 4021 | self.voltha.disable_device(device_id, delete = True) |
| 4022 | self.remove_olt(switch_map) |
| 4023 | df.callback(0) |
| 4024 | |
| 4025 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 4026 | return df |
| 4027 | |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 4028 | @deferred(TESTCASE_TIMEOUT) |
| 4029 | def test_two_subscribers_with_voltha_for_dhcp_toggling_onu_port_for_one_subscriber(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4030 | """ |
| 4031 | Test Method: |
| 4032 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 4033 | 1. OLT and ONU is detected and validated. |
| 4034 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4035 | 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app. |
| 4036 | 4. Verify that subscribers had got ip from dhcp server successfully. |
| 4037 | 5. Disable onu port on which access one subscriber and ping to gateway from other subscriber. |
| 4038 | 6. Repeat step 3 and 4 for one subscriber where uni port is down. |
| 4039 | 7. Verify that subscriber should not get ip from dhcp server and other subscriber ping to gateway should not failed. |
| 4040 | 8. Enable onu port on which was disable at step 5 and ping to gateway from other subscriber. |
| 4041 | 9. Repeat step 3 and 4 for one subscriber where uni port is up now. |
| 4042 | 10. Verify that subscriber should get ip from dhcp server and other subscriber ping to gateway should not failed. |
| 4043 | """ |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 4044 | df = defer.Deferred() |
| 4045 | self.success = True |
| 4046 | dhcp_app = 'org.onosproject.dhcp' |
| 4047 | def dhcp_flow_check_scenario(df): |
| 4048 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 4049 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 4050 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 4051 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 4052 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 4053 | time.sleep(10) |
| 4054 | switch_map = None |
| 4055 | olt_configured = False |
| 4056 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 4057 | log_test.info('Installing OLT app') |
| 4058 | OnosCtrl.install_app(self.olt_app_file) |
| 4059 | time.sleep(5) |
| 4060 | log_test.info('Adding subscribers through OLT app') |
| 4061 | self.config_olt(switch_map) |
| 4062 | olt_configured = True |
| 4063 | time.sleep(5) |
| 4064 | thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT,)) |
| 4065 | thread2 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_2_RX_DEFAULT,)) |
Thangavelu K S and Chetan Gaonker | 0cf7564 | 2017-08-03 20:13:23 +0000 | [diff] [blame] | 4066 | thread3 = threading.Thread(target = self.voltha_uni_port_toggle, args = (self.INTF_2_RX_DEFAULT,)) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 4067 | thread1.start() |
| 4068 | thread2.start() |
| 4069 | thread3.start() |
| 4070 | time.sleep(10) |
| 4071 | thread1.join() |
| 4072 | thread2.join() |
| 4073 | thread3.join() |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 4074 | dhcp_flow_status = self.success |
| 4075 | try: |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 4076 | assert_equal(dhcp_flow_status, True) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 4077 | time.sleep(10) |
| 4078 | finally: |
| 4079 | self.voltha.disable_device(device_id, delete = True) |
| 4080 | self.remove_olt(switch_map) |
| 4081 | df.callback(0) |
| 4082 | |
| 4083 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 4084 | return df |
| 4085 | |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 4086 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 4087 | def test_two_subscribers_with_voltha_for_dhcp_disabling_olt(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4088 | """ |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 4089 | Test Method: uni_port |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4090 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 4091 | 1. OLT and ONU is detected and validated. |
| 4092 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4093 | 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app. |
| 4094 | 4. Verify that subscribers had got ip from dhcp server successfully. |
| 4095 | 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber. |
| 4096 | 6. Disable the olt device which is detected in voltha. |
| 4097 | 7. Verify that subscriber should not get ip from dhcp server and other subscriber ping to gateway should failed. |
| 4098 | """ |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 4099 | df = defer.Deferred() |
| 4100 | self.success = True |
| 4101 | dhcp_app = 'org.onosproject.dhcp' |
| 4102 | def dhcp_flow_check_scenario(df): |
| 4103 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 4104 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 4105 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 4106 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 4107 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 4108 | time.sleep(10) |
| 4109 | switch_map = None |
| 4110 | olt_configured = False |
| 4111 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 4112 | log_test.info('Installing OLT app') |
| 4113 | OnosCtrl.install_app(self.olt_app_file) |
| 4114 | time.sleep(5) |
| 4115 | log_test.info('Adding subscribers through OLT app') |
| 4116 | self.config_olt(switch_map) |
| 4117 | olt_configured = True |
| 4118 | time.sleep(5) |
| 4119 | thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT,)) |
| 4120 | thread2 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_2_RX_DEFAULT,)) |
| 4121 | thread3 = threading.Thread(target = self.voltha.disable_device, args = (device_id,False,)) |
| 4122 | |
| 4123 | thread1.start() |
| 4124 | thread2.start() |
| 4125 | thread3.start() |
| 4126 | time.sleep(10) |
| 4127 | thread1.join() |
| 4128 | thread2.join() |
| 4129 | thread3.join() |
| 4130 | dhcp_flow_status = self.success |
| 4131 | try: |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 4132 | assert_equal(dhcp_flow_status, True) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 4133 | time.sleep(10) |
| 4134 | finally: |
| 4135 | self.voltha.disable_device(device_id, delete = True) |
| 4136 | self.remove_olt(switch_map) |
| 4137 | df.callback(0) |
| 4138 | |
| 4139 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 4140 | return df |
| 4141 | |
| 4142 | @deferred(TESTCASE_TIMEOUT) |
| 4143 | def test_two_subscribers_with_voltha_for_dhcp_toggling_olt(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4144 | """ |
| 4145 | Test Method: |
| 4146 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 4147 | 1. OLT and ONU is detected and validated. |
| 4148 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4149 | 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app. |
| 4150 | 4. Verify that subscribers had got ip from dhcp server successfully. |
| 4151 | 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber. |
| 4152 | 6. Disable the olt device which is detected in voltha. |
| 4153 | 7. Verify that subscriber should not get ip from dhcp server and other subscriber ping to gateway should failed. |
| 4154 | 8. Enable the olt device which is detected in voltha. |
| 4155 | 9. Verify that subscriber should get ip from dhcp server and other subscriber ping to gateway should not failed. |
| 4156 | """ |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 4157 | df = defer.Deferred() |
| 4158 | self.success = True |
| 4159 | dhcp_app = 'org.onosproject.dhcp' |
| 4160 | def dhcp_flow_check_scenario(df): |
| 4161 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 4162 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 4163 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 4164 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 4165 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 4166 | time.sleep(10) |
| 4167 | switch_map = None |
| 4168 | olt_configured = False |
| 4169 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 4170 | log_test.info('Installing OLT app') |
| 4171 | OnosCtrl.install_app(self.olt_app_file) |
| 4172 | time.sleep(5) |
| 4173 | log_test.info('Adding subscribers through OLT app') |
| 4174 | self.config_olt(switch_map) |
| 4175 | olt_configured = True |
| 4176 | time.sleep(5) |
| 4177 | thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT,)) |
| 4178 | thread2 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_2_RX_DEFAULT,)) |
| 4179 | thread3 = threading.Thread(target = self.voltha.restart_device, args = (device_id,)) |
| 4180 | thread1.start() |
| 4181 | thread2.start() |
| 4182 | thread3.start() |
| 4183 | time.sleep(10) |
| 4184 | thread1.join() |
| 4185 | thread2.join() |
| 4186 | thread3.join() |
| 4187 | dhcp_flow_status = self.success |
| 4188 | try: |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 4189 | assert_equal(dhcp_flow_status, True) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 4190 | time.sleep(10) |
| 4191 | finally: |
| 4192 | self.voltha.disable_device(device_id, delete = True) |
| 4193 | self.remove_olt(switch_map) |
| 4194 | df.callback(0) |
| 4195 | |
| 4196 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 4197 | return df |
| 4198 | |
| 4199 | @deferred(TESTCASE_TIMEOUT) |
| 4200 | def test_two_subscribers_with_voltha_for_dhcp_with_paused_olt(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4201 | """ |
| 4202 | Test Method: |
| 4203 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 4204 | 1. OLT and ONU is detected and validated. |
| 4205 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4206 | 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app. |
| 4207 | 4. Verify that subscribers had got ip from dhcp server successfully. |
| 4208 | 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber. |
| 4209 | 6. Pause the olt device which is detected in voltha. |
| 4210 | 7. Verify that subscriber should not get ip from dhcp server and other subscriber ping to gateway should failed. |
| 4211 | """ |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 4212 | df = defer.Deferred() |
| 4213 | self.success = True |
| 4214 | dhcp_app = 'org.onosproject.dhcp' |
| 4215 | def dhcp_flow_check_scenario(df): |
| 4216 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 4217 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 4218 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 4219 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 4220 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 4221 | time.sleep(10) |
| 4222 | switch_map = None |
| 4223 | olt_configured = False |
| 4224 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 4225 | log_test.info('Installing OLT app') |
| 4226 | OnosCtrl.install_app(self.olt_app_file) |
| 4227 | time.sleep(5) |
| 4228 | log_test.info('Adding subscribers through OLT app') |
| 4229 | self.config_olt(switch_map) |
| 4230 | olt_configured = True |
| 4231 | time.sleep(5) |
| 4232 | thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT,)) |
| 4233 | thread2 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_2_RX_DEFAULT,)) |
| 4234 | thread3 = threading.Thread(target = self.voltha.pause_device, args = (device_id,)) |
| 4235 | thread1.start() |
| 4236 | thread2.start() |
| 4237 | thread3.start() |
| 4238 | time.sleep(10) |
| 4239 | thread1.join() |
| 4240 | thread2.join() |
| 4241 | thread3.join() |
| 4242 | dhcp_flow_status = self.success |
| 4243 | try: |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 4244 | assert_equal(dhcp_flow_status, True) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 4245 | time.sleep(10) |
| 4246 | finally: |
| 4247 | self.voltha.disable_device(device_id, delete = True) |
| 4248 | self.remove_olt(switch_map) |
| 4249 | df.callback(0) |
| 4250 | |
| 4251 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 4252 | return df |
| 4253 | |
Thangavelu K S and Chetan Gaonker | e07a7b4 | 2017-08-23 17:43:31 +0000 | [diff] [blame] | 4254 | def test_three_subscribers_with_voltha_for_dhcp_discover_requests(self): |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 4255 | """ |
| 4256 | Test Method: |
| 4257 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 4258 | 1. OLT and ONU is detected and validated. |
| 4259 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as multiple subscribers (3 subscribers) |
| 4260 | 3. Send dhcp request from residential subscrber to dhcp server which is running as onos app. |
| 4261 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 4262 | """ |
| 4263 | """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each""" |
| 4264 | num_subscribers = 3 |
| 4265 | num_channels = 1 |
| 4266 | services = ('DHCP') |
| 4267 | cbs = (self.dhcp_flow_check, None, None) |
| 4268 | self.voltha_subscribers(services, cbs = cbs, |
| 4269 | num_subscribers = num_subscribers, |
| 4270 | num_channels = num_channels) |
| 4271 | |
Thangavelu K S and Chetan Gaonker | e07a7b4 | 2017-08-23 17:43:31 +0000 | [diff] [blame] | 4272 | def test_five_subscribers_with_voltha_for_dhcp_discover_requests(self): |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 4273 | """ |
| 4274 | Test Method: |
| 4275 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 4276 | 1. OLT and ONU is detected and validated. |
| 4277 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as multiple subscribers (5 subscribers) |
| 4278 | 3. Send dhcp request from residential subscrber to dhcp server which is running as onos app. |
| 4279 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 4280 | """ |
| 4281 | """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each""" |
| 4282 | num_subscribers = 5 |
| 4283 | num_channels = 1 |
| 4284 | services = ('DHCP') |
| 4285 | cbs = (self.dhcp_flow_check, None, None) |
| 4286 | self.voltha_subscribers(services, cbs = cbs, |
| 4287 | num_subscribers = num_subscribers, |
| 4288 | num_channels = num_channels) |
| 4289 | |
Thangavelu K S and Chetan Gaonker | e07a7b4 | 2017-08-23 17:43:31 +0000 | [diff] [blame] | 4290 | def test_nine_subscribers_with_voltha_for_dhcp_discover_requests(self): |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 4291 | """ |
| 4292 | Test Method: |
| 4293 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 4294 | 1. OLT and ONU is detected and validated. |
| 4295 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as multiple subscribers (9 subscribers) |
| 4296 | 3. Send dhcp request from residential subscrber to dhcp server which is running as onos app. |
| 4297 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 4298 | """ |
| 4299 | """Test subscriber join next for channel surfing with 9 subscribers browsing 1 channels each""" |
| 4300 | num_subscribers = 9 |
| 4301 | num_channels = 1 |
| 4302 | services = ('DHCP') |
| 4303 | cbs = (self.dhcp_flow_check, None, None) |
| 4304 | self.voltha_subscribers(services, cbs = cbs, |
| 4305 | num_subscribers = num_subscribers, |
| 4306 | num_channels = num_channels) |
| 4307 | |
Thangavelu K S and Chetan Gaonker | e07a7b4 | 2017-08-23 17:43:31 +0000 | [diff] [blame] | 4308 | def test_three_subscribers_with_voltha_for_tls_auth_and_dhcp_discover_flows(self): |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 4309 | """ |
| 4310 | Test Method: |
| 4311 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 4312 | 1. OLT and ONU is detected and validated. |
| 4313 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as multiple subscribers (3 subscribers) |
| 4314 | 3. Send dhcp request from residential subscrber to dhcp server which is running as onos app. |
| 4315 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 4316 | """ |
| 4317 | """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each""" |
| 4318 | num_subscribers = 3 |
| 4319 | num_channels = 1 |
| 4320 | services = ('TLS','DHCP') |
| 4321 | cbs = (self.tls_flow_check, self.dhcp_flow_check, None) |
| 4322 | self.voltha_subscribers(services, cbs = cbs, |
| 4323 | num_subscribers = num_subscribers, |
| 4324 | num_channels = num_channels) |
| 4325 | |
Thangavelu K S and Chetan Gaonker | e07a7b4 | 2017-08-23 17:43:31 +0000 | [diff] [blame] | 4326 | def test_five_subscribers_with_voltha_for_tls_auth_and_dhcp_discover_flows(self): |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 4327 | """ |
| 4328 | Test Method: |
| 4329 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 4330 | 1. OLT and ONU is detected and validated. |
| 4331 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as multiple subscribers (5 subscribers) |
| 4332 | 3. Send dhcp request from residential subscrber to dhcp server which is running as onos app. |
| 4333 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 4334 | """ |
| 4335 | """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each""" |
| 4336 | num_subscribers = 5 |
| 4337 | num_channels = 1 |
| 4338 | services = ('TLS','DHCP') |
| 4339 | cbs = (self.tls_flow_check, self.dhcp_flow_check, None) |
| 4340 | self.voltha_subscribers(services, cbs = cbs, |
| 4341 | num_subscribers = num_subscribers, |
| 4342 | num_channels = num_channels) |
| 4343 | |
Thangavelu K S and Chetan Gaonker | e07a7b4 | 2017-08-23 17:43:31 +0000 | [diff] [blame] | 4344 | def test_nine_subscribers_with_voltha_for_tls_auth_and_dhcp_discover_flows(self): |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 4345 | """ |
| 4346 | Test Method: |
| 4347 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 4348 | 1. OLT and ONU is detected and validated. |
| 4349 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as multiple subscribers (9 subscribers) |
| 4350 | 3. Send dhcp request from residential subscrber to dhcp server which is running as onos app. |
| 4351 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 4352 | """ |
| 4353 | """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each""" |
| 4354 | num_subscribers = 9 |
| 4355 | num_channels = 1 |
| 4356 | services = ('TLS','DHCP') |
| 4357 | cbs = (self.tls_flow_check, self.dhcp_flow_check, None) |
| 4358 | self.voltha_subscribers(services, cbs = cbs, |
| 4359 | num_subscribers = num_subscribers, |
| 4360 | num_channels = num_channels) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 4361 | |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 4362 | # @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4363 | def test_subscriber_with_voltha_for_dhcprelay_request(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4364 | """ |
| 4365 | Test Method: |
| 4366 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 4367 | 1. OLT and ONU is detected and validated. |
| 4368 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4369 | 3. Send dhcp request from residential subscrber to external dhcp server. |
| 4370 | 4. Verify that subscriber get ip from external dhcp server successfully. |
| 4371 | """ |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 4372 | self.voltha_dhcprelay_setUpClass() |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 4373 | # if not port_list: |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 4374 | # port_list = self.generate_port_list(1, 0) |
| 4375 | iface = self.port_map[self.port_list[0][1]] |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 4376 | mac = self.get_mac(iface) |
| 4377 | self.host_load(iface) |
| 4378 | ##we use the defaults for this test that serves as an example for others |
| 4379 | ##You don't need to restart dhcpd server if retaining default config |
| 4380 | config = self.default_config |
| 4381 | options = self.default_options |
| 4382 | subnet = self.default_subnet_config |
| 4383 | dhcpd_interface_list = self.relay_interfaces |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 4384 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 4385 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 4386 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 4387 | assert_not_equal(device_id, None) |
| 4388 | voltha = VolthaCtrl(**self.voltha_attrs) |
| 4389 | time.sleep(10) |
| 4390 | switch_map = None |
| 4391 | olt_configured = False |
| 4392 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 4393 | log_test.info('Installing OLT app') |
| 4394 | OnosCtrl.install_app(self.olt_app_file) |
| 4395 | time.sleep(5) |
| 4396 | log_test.info('Adding subscribers through OLT app') |
| 4397 | self.config_olt(switch_map) |
| 4398 | olt_configured = True |
| 4399 | time.sleep(5) |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 4400 | self.dhcpd_start(intf_list = dhcpd_interface_list, |
| 4401 | config = config, |
| 4402 | options = options, |
| 4403 | subnet = subnet) |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 4404 | try: |
| 4405 | self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = iface) |
| 4406 | self.send_recv(mac=mac) |
| 4407 | finally: |
| 4408 | self.voltha.disable_device(device_id, delete = True) |
| 4409 | self.voltha_dhcprelay_tearDownClass() |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4410 | |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 4411 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4412 | def test_subscriber_with_voltha_for_dhcprelay_request_with_invalid_broadcast_source_mac(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4413 | """ |
| 4414 | Test Method: |
| 4415 | 0. Make sure that voltha and external dhcp server are is up and running on CORD-POD setup. |
| 4416 | 1. OLT and ONU is detected and validated. |
| 4417 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4418 | 3. Send dhcp request with invalid source mac broadcast from residential subscrber to external dhcp server. |
| 4419 | 4. Verify that subscriber should not get ip from external dhcp server. |
| 4420 | """ |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 4421 | self.voltha_dhcprelay_setUpClass() |
| 4422 | # if not port_list: |
| 4423 | # port_list = self.generate_port_list(1, 0) |
| 4424 | iface = self.port_map[self.port_list[0][1]] |
| 4425 | mac = self.get_mac(iface) |
| 4426 | self.host_load(iface) |
| 4427 | ##we use the defaults for this test that serves as an example for others |
| 4428 | ##You don't need to restart dhcpd server if retaining default config |
| 4429 | config = self.default_config |
| 4430 | options = self.default_options |
| 4431 | subnet = self.default_subnet_config |
| 4432 | dhcpd_interface_list = self.relay_interfaces |
| 4433 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 4434 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 4435 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 4436 | assert_not_equal(device_id, None) |
| 4437 | voltha = VolthaCtrl(**self.voltha_attrs) |
| 4438 | time.sleep(10) |
| 4439 | switch_map = None |
| 4440 | olt_configured = False |
| 4441 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 4442 | log_test.info('Installing OLT app') |
| 4443 | OnosCtrl.install_app(self.olt_app_file) |
| 4444 | time.sleep(5) |
| 4445 | log_test.info('Adding subscribers through OLT app') |
| 4446 | self.config_olt(switch_map) |
| 4447 | olt_configured = True |
| 4448 | time.sleep(5) |
| 4449 | self.dhcpd_start(intf_list = dhcpd_interface_list, |
| 4450 | config = config, |
| 4451 | options = options, |
| 4452 | subnet = subnet) |
| 4453 | self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = iface) |
| 4454 | cip, sip, mac, _ = self.dhcp.only_discover(mac='ff:ff:ff:ff:ff:ff') |
| 4455 | try: |
| 4456 | assert_equal(cip,None) |
| 4457 | log_test.info('dhcp server rejected client discover with invalid source mac, as expected') |
| 4458 | finally: |
| 4459 | self.voltha.disable_device(device_id, delete = True) |
| 4460 | self.voltha_dhcprelay_tearDownClass() |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4461 | |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 4462 | # @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4463 | def test_subscriber_with_voltha_for_dhcprelay_request_with_invalid_multicast_source_mac(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4464 | """ |
| 4465 | Test Method: |
| 4466 | 0. Make sure that voltha and external dhcp server are is up and running on CORD-POD setup. |
| 4467 | 1. OLT and ONU is detected and validated. |
| 4468 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4469 | 3. Send dhcp request with invalid source mac multicast from residential subscrber to external dhcp server. |
| 4470 | 4. Verify that subscriber should not get ip from external dhcp server. |
| 4471 | """ |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 4472 | self.voltha_dhcprelay_setUpClass() |
| 4473 | # if not port_list: |
| 4474 | # port_list = self.generate_port_list(1, 0) |
| 4475 | iface = self.port_map[self.port_list[0][1]] |
| 4476 | mac = self.get_mac(iface) |
| 4477 | self.host_load(iface) |
| 4478 | ##we use the defaults for this test that serves as an example for others |
| 4479 | ##You don't need to restart dhcpd server if retaining default config |
| 4480 | config = self.default_config |
| 4481 | options = self.default_options |
| 4482 | subnet = self.default_subnet_config |
| 4483 | dhcpd_interface_list = self.relay_interfaces |
| 4484 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 4485 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 4486 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 4487 | assert_not_equal(device_id, None) |
| 4488 | voltha = VolthaCtrl(**self.voltha_attrs) |
| 4489 | time.sleep(10) |
| 4490 | switch_map = None |
| 4491 | olt_configured = False |
| 4492 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 4493 | log_test.info('Installing OLT app') |
| 4494 | OnosCtrl.install_app(self.olt_app_file) |
| 4495 | time.sleep(5) |
| 4496 | log_test.info('Adding subscribers through OLT app') |
| 4497 | self.config_olt(switch_map) |
| 4498 | olt_configured = True |
| 4499 | time.sleep(5) |
| 4500 | self.dhcpd_start(intf_list = dhcpd_interface_list, |
| 4501 | config = config, |
| 4502 | options = options, |
| 4503 | subnet = subnet) |
| 4504 | self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = iface) |
| 4505 | cip, sip, mac, _ = self.dhcp.only_discover(mac='01:80:c2:01:98:05') |
| 4506 | try: |
| 4507 | assert_equal(cip,None) |
| 4508 | log_test.info('dhcp server rejected client discover with invalid source mac, as expected') |
| 4509 | finally: |
| 4510 | self.voltha.disable_device(device_id, delete = True) |
| 4511 | self.voltha_dhcprelay_tearDownClass() |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4512 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4513 | def test_subscriber_with_voltha_for_dhcprelay_request_with_invalid_source_mac(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4514 | """ |
| 4515 | Test Method: |
| 4516 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 4517 | 1. OLT and ONU is detected and validated. |
| 4518 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4519 | 3. Send dhcp request with invalid source mac zero from residential subscrber to external dhcp server. |
| 4520 | 4. Verify that subscriber should not get ip from external dhcp server. |
| 4521 | """ |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 4522 | self.voltha_dhcprelay_setUpClass() |
| 4523 | # if not port_list: |
| 4524 | # port_list = self.generate_port_list(1, 0) |
| 4525 | iface = self.port_map[self.port_list[0][1]] |
| 4526 | mac = self.get_mac(iface) |
| 4527 | self.host_load(iface) |
| 4528 | ##we use the defaults for this test that serves as an example for others |
| 4529 | ##You don't need to restart dhcpd server if retaining default config |
| 4530 | config = self.default_config |
| 4531 | options = self.default_options |
| 4532 | subnet = self.default_subnet_config |
| 4533 | dhcpd_interface_list = self.relay_interfaces |
| 4534 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 4535 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 4536 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 4537 | assert_not_equal(device_id, None) |
| 4538 | voltha = VolthaCtrl(**self.voltha_attrs) |
| 4539 | time.sleep(10) |
| 4540 | switch_map = None |
| 4541 | olt_configured = False |
| 4542 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 4543 | log_test.info('Installing OLT app') |
| 4544 | OnosCtrl.install_app(self.olt_app_file) |
| 4545 | time.sleep(5) |
| 4546 | log_test.info('Adding subscribers through OLT app') |
| 4547 | self.config_olt(switch_map) |
| 4548 | olt_configured = True |
| 4549 | time.sleep(5) |
| 4550 | self.dhcpd_start(intf_list = dhcpd_interface_list, |
| 4551 | config = config, |
| 4552 | options = options, |
| 4553 | subnet = subnet) |
| 4554 | self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = iface) |
| 4555 | cip, sip, mac, _ = self.dhcp.only_discover(mac='00:00:00:00:00:00') |
| 4556 | try: |
| 4557 | assert_equal(cip,None) |
| 4558 | log_test.info('dhcp server rejected client discover with invalid source mac, as expected') |
| 4559 | finally: |
| 4560 | self.voltha.disable_device(device_id, delete = True) |
| 4561 | self.voltha_dhcprelay_tearDownClass() |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4562 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4563 | def test_subscriber_with_voltha_for_dhcprelay_request_and_release(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4564 | """ |
| 4565 | Test Method: |
| 4566 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 4567 | 1. OLT and ONU is detected and validated. |
| 4568 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4569 | 3. Send dhcp request from residential subscrber to external dhcp server. |
| 4570 | 4. Verify that subscriber get ip from external dhcp server successfully. |
| 4571 | 5. Send dhcp release from residential subscrber to external dhcp server. |
| 4572 | 6 Verify that subscriber should not get ip from external dhcp server, ping to gateway. |
| 4573 | """ |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 4574 | self.voltha_dhcprelay_setUpClass() |
| 4575 | # if not port_list: |
| 4576 | # port_list = self.generate_port_list(1, 0) |
| 4577 | iface = self.port_map[self.port_list[0][1]] |
| 4578 | mac = self.get_mac(iface) |
| 4579 | self.host_load(iface) |
| 4580 | ##we use the defaults for this test that serves as an example for others |
| 4581 | ##You don't need to restart dhcpd server if retaining default config |
| 4582 | config = self.default_config |
| 4583 | options = self.default_options |
| 4584 | subnet = self.default_subnet_config |
| 4585 | dhcpd_interface_list = self.relay_interfaces |
| 4586 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 4587 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 4588 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 4589 | assert_not_equal(device_id, None) |
| 4590 | voltha = VolthaCtrl(**self.voltha_attrs) |
| 4591 | time.sleep(10) |
| 4592 | switch_map = None |
| 4593 | olt_configured = False |
| 4594 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 4595 | log_test.info('Installing OLT app') |
| 4596 | OnosCtrl.install_app(self.olt_app_file) |
| 4597 | time.sleep(5) |
| 4598 | log_test.info('Adding subscribers through OLT app') |
| 4599 | self.config_olt(switch_map) |
| 4600 | olt_configured = True |
| 4601 | time.sleep(5) |
| 4602 | self.dhcpd_start(intf_list = dhcpd_interface_list, |
| 4603 | config = config, |
| 4604 | options = options, |
| 4605 | subnet = subnet) |
| 4606 | self.dhcp = DHCPTest(seed_ip = '10.10.100.10', iface = iface) |
| 4607 | cip, sip = self.send_recv(mac=mac) |
| 4608 | log_test.info('Releasing ip %s to server %s' %(cip, sip)) |
| 4609 | try: |
| 4610 | assert_equal(self.dhcp.release(cip), True) |
| 4611 | log_test.info('Triggering DHCP discover again after release') |
| 4612 | cip2, sip2 = self.send_recv(mac=mac) |
| 4613 | log_test.info('Verifying released IP was given back on rediscover') |
| 4614 | assert_equal(cip, cip2) |
| 4615 | log_test.info('Test done. Releasing ip %s to server %s' %(cip2, sip2)) |
| 4616 | assert_equal(self.dhcp.release(cip2), True) |
| 4617 | finally: |
| 4618 | self.voltha.disable_device(device_id, delete = True) |
| 4619 | self.voltha_dhcprelay_tearDownClass() |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4620 | |
Thangavelu K S and Chetan Gaonker | e07a7b4 | 2017-08-23 17:43:31 +0000 | [diff] [blame] | 4621 | ##Not yet validated |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4622 | def test_subscriber_with_voltha_for_dhcprelay_starvation(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4623 | """ |
| 4624 | Test Method: |
| 4625 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 4626 | 1. OLT and ONU is detected and validated. |
| 4627 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4628 | 3. Send dhcp request from residential subscriber to external dhcp server. |
| 4629 | 4. Verify that subscriber get ip from external dhcp server. successfully. |
| 4630 | 5. Repeat step 3 and 4 for 10 times. |
| 4631 | 6 Verify that subscriber should get ip from external dhcp server.. |
| 4632 | """ |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 4633 | self.voltha_dhcprelay_setUpClass() |
| 4634 | # if not port_list: |
| 4635 | # port_list = self.generate_port_list(1, 0) |
| 4636 | iface = self.port_map[self.port_list[0][1]] |
| 4637 | mac = self.get_mac(iface) |
| 4638 | self.host_load(iface) |
| 4639 | ##we use the defaults for this test that serves as an example for others |
| 4640 | ##You don't need to restart dhcpd server if retaining default config |
| 4641 | config = self.default_config |
| 4642 | options = self.default_options |
| 4643 | subnet = self.default_subnet_config |
| 4644 | dhcpd_interface_list = self.relay_interfaces |
| 4645 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 4646 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 4647 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 4648 | assert_not_equal(device_id, None) |
| 4649 | voltha = VolthaCtrl(**self.voltha_attrs) |
| 4650 | time.sleep(10) |
| 4651 | switch_map = None |
| 4652 | olt_configured = False |
| 4653 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 4654 | log_test.info('Installing OLT app') |
| 4655 | OnosCtrl.install_app(self.olt_app_file) |
| 4656 | time.sleep(5) |
| 4657 | log_test.info('Adding subscribers through OLT app') |
| 4658 | self.config_olt(switch_map) |
| 4659 | olt_configured = True |
| 4660 | time.sleep(5) |
| 4661 | self.dhcpd_start(intf_list = dhcpd_interface_list, |
| 4662 | config = config, |
| 4663 | options = options, |
| 4664 | subnet = subnet) |
| 4665 | #self.dhcp = DHCPTest(seed_ip = '182.17.0.1', iface = iface) |
| 4666 | self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = iface) |
| 4667 | log_test.info('Verifying 1 ') |
| 4668 | count = 0 |
| 4669 | while True: |
| 4670 | #mac = RandMAC()._fix() |
| 4671 | cip, sip = self.send_recv(mac=mac,update_seed = True,validate = False) |
| 4672 | if cip is None: |
| 4673 | break |
| 4674 | else: |
| 4675 | count += 1 |
| 4676 | assert_equal(count,91) |
| 4677 | log_test.info('Verifying 2 ') |
| 4678 | cip, sip = self.send_recv(mac=mac, update_seed = True, validate = False) |
| 4679 | try: |
| 4680 | assert_equal(cip, None) |
| 4681 | assert_equal(sip, None) |
| 4682 | finally: |
| 4683 | self.voltha.disable_device(device_id, delete = True) |
| 4684 | self.voltha_dhcprelay_tearDownClass() |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4685 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4686 | def test_subscriber_with_voltha_for_dhcprelay_starvation_negative_scenario(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4687 | """ |
| 4688 | Test Method: |
| 4689 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 4690 | 1. OLT and ONU is detected and validated. |
| 4691 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4692 | 3. Send dhcp request from residential subscriber without of pool ip to external dhcp server. |
| 4693 | 4. Verify that subscriber should not get ip from external dhcp server.. |
| 4694 | 5. Repeat steps 3 and 4 for 10 times. |
| 4695 | 6 Verify that subscriber should not get ip from external dhcp server.. |
| 4696 | """ |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4697 | def test_subscriber_with_voltha_for_dhcprelay_sending_multiple_discover(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4698 | """ |
| 4699 | Test Method: |
| 4700 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 4701 | 1. OLT and ONU is detected and validated. |
| 4702 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4703 | 3. Send dhcp request from residential subscriber to external dhcp server. |
| 4704 | 4. Verify that subscriber get ip from external dhcp server. successfully. |
| 4705 | 5. Repeat step 3 for 50 times. |
| 4706 | 6 Verify that subscriber should get same ip which was received from 1st discover from external dhcp server.. |
| 4707 | """ |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 4708 | self.voltha_dhcprelay_setUpClass() |
| 4709 | # if not port_list: |
| 4710 | # port_list = self.generate_port_list(1, 0) |
| 4711 | iface = self.port_map[self.port_list[0][1]] |
| 4712 | mac = self.get_mac(iface) |
| 4713 | self.host_load(iface) |
| 4714 | ##we use the defaults for this test that serves as an example for others |
| 4715 | ##You don't need to restart dhcpd server if retaining default config |
| 4716 | config = self.default_config |
| 4717 | options = self.default_options |
| 4718 | subnet = self.default_subnet_config |
| 4719 | dhcpd_interface_list = self.relay_interfaces |
| 4720 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 4721 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 4722 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 4723 | assert_not_equal(device_id, None) |
| 4724 | voltha = VolthaCtrl(**self.voltha_attrs) |
| 4725 | time.sleep(10) |
| 4726 | switch_map = None |
| 4727 | olt_configured = False |
| 4728 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 4729 | log_test.info('Installing OLT app') |
| 4730 | OnosCtrl.install_app(self.olt_app_file) |
| 4731 | time.sleep(5) |
| 4732 | log_test.info('Adding subscribers through OLT app') |
| 4733 | self.config_olt(switch_map) |
| 4734 | olt_configured = True |
| 4735 | time.sleep(5) |
| 4736 | self.dhcpd_start(intf_list = dhcpd_interface_list, |
| 4737 | config = config, |
| 4738 | options = options, |
| 4739 | subnet = subnet) |
| 4740 | self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = iface) |
| 4741 | cip, sip, mac, _ = self.dhcp.only_discover(mac=mac) |
| 4742 | log_test.info('Got dhcp client IP %s from server %s for mac %s . Not going to send DHCP REQUEST.' % |
| 4743 | (cip, sip, mac) ) |
| 4744 | try: |
| 4745 | assert_not_equal(cip, None) |
| 4746 | log_test.info('Triggering DHCP discover again.') |
| 4747 | new_cip, new_sip, new_mac, _ = self.dhcp.only_discover(mac=mac) |
| 4748 | assert_equal(new_cip, cip) |
| 4749 | log_test.info('Got same ip to same the client when sent discover again, as expected') |
| 4750 | finally: |
| 4751 | self.voltha.disable_device(device_id, delete = True) |
| 4752 | self.voltha_dhcprelay_tearDownClass() |
| 4753 | |
| 4754 | def test_subscriber_with_voltha_for_dhcprelay_sending_multiple_requests(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4755 | """ |
| 4756 | Test Method: |
| 4757 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 4758 | 1. OLT and ONU is detected and validated. |
| 4759 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4760 | 3. Send dhcp request from residential subscriber to external dhcp server. |
| 4761 | 4. Verify that subscriber get ip from external dhcp server. successfully. |
| 4762 | 5. Send DHCP request to external dhcp server. |
| 4763 | 6. Repeat step 5 for 50 times. |
| 4764 | 7. Verify that subscriber should get same ip which was received from 1st discover from external dhcp server.. |
| 4765 | """ |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 4766 | self.voltha_dhcprelay_setUpClass() |
| 4767 | # if not port_list: |
| 4768 | # port_list = self.generate_port_list(1, 0) |
| 4769 | iface = self.port_map[self.port_list[0][1]] |
| 4770 | mac = self.get_mac(iface) |
| 4771 | self.host_load(iface) |
| 4772 | ##we use the defaults for this test that serves as an example for others |
| 4773 | ##You don't need to restart dhcpd server if retaining default config |
| 4774 | config = self.default_config |
| 4775 | options = self.default_options |
| 4776 | subnet = self.default_subnet_config |
| 4777 | dhcpd_interface_list = self.relay_interfaces |
| 4778 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 4779 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 4780 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 4781 | assert_not_equal(device_id, None) |
| 4782 | voltha = VolthaCtrl(**self.voltha_attrs) |
| 4783 | time.sleep(10) |
| 4784 | switch_map = None |
| 4785 | olt_configured = False |
| 4786 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 4787 | log_test.info('Installing OLT app') |
| 4788 | OnosCtrl.install_app(self.olt_app_file) |
| 4789 | time.sleep(5) |
| 4790 | log_test.info('Adding subscribers through OLT app') |
| 4791 | self.config_olt(switch_map) |
| 4792 | olt_configured = True |
| 4793 | time.sleep(5) |
| 4794 | self.dhcpd_start(intf_list = dhcpd_interface_list, |
| 4795 | config = config, |
| 4796 | options = options, |
| 4797 | subnet = subnet) |
| 4798 | self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = iface) |
| 4799 | log_test.info('Sending DHCP discover and DHCP request.') |
| 4800 | cip, sip = self.send_recv(mac=mac) |
| 4801 | mac = self.dhcp.get_mac(cip)[0] |
| 4802 | log_test.info("Sending DHCP request again.") |
| 4803 | new_cip, new_sip = self.dhcp.only_request(cip, mac) |
| 4804 | try: |
| 4805 | assert_equal(new_cip, cip) |
| 4806 | log_test.info('got same ip to smae the client when sent request again, as expected') |
| 4807 | finally: |
| 4808 | self.voltha.disable_device(device_id, delete = True) |
| 4809 | self.voltha_dhcprelay_tearDownClass() |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4810 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4811 | def test_subscriber_with_voltha_for_dhcprelay_requesting_desired_ip_address(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4812 | """ |
| 4813 | Test Method: |
| 4814 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 4815 | 1. OLT and ONU is detected and validated. |
| 4816 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4817 | 3. Send dhcp request with desired ip address from residential subscriber to external dhcp server. |
| 4818 | 4. Verify that subscriber get ip which was requested in step 3 from external dhcp server. successfully. |
| 4819 | """ |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 4820 | self.voltha_dhcprelay_setUpClass() |
| 4821 | # if not port_list: |
| 4822 | # port_list = self.generate_port_list(1, 0) |
| 4823 | iface = self.port_map[self.port_list[0][1]] |
| 4824 | mac = self.get_mac(iface) |
| 4825 | self.host_load(iface) |
| 4826 | ##we use the defaults for this test that serves as an example for others |
| 4827 | ##You don't need to restart dhcpd server if retaining default config |
| 4828 | config = self.default_config |
| 4829 | options = self.default_options |
| 4830 | subnet = self.default_subnet_config |
| 4831 | dhcpd_interface_list = self.relay_interfaces |
| 4832 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 4833 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 4834 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 4835 | assert_not_equal(device_id, None) |
| 4836 | voltha = VolthaCtrl(**self.voltha_attrs) |
| 4837 | time.sleep(10) |
| 4838 | switch_map = None |
| 4839 | olt_configured = False |
| 4840 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 4841 | log_test.info('Installing OLT app') |
| 4842 | OnosCtrl.install_app(self.olt_app_file) |
| 4843 | time.sleep(5) |
| 4844 | log_test.info('Adding subscribers through OLT app') |
| 4845 | self.config_olt(switch_map) |
| 4846 | olt_configured = True |
| 4847 | time.sleep(5) |
| 4848 | self.dhcpd_start(intf_list = dhcpd_interface_list, |
| 4849 | config = config, |
| 4850 | options = options, |
| 4851 | subnet = subnet) |
| 4852 | self.dhcp = DHCPTest(seed_ip = '192.168.1.31', iface = iface) |
| 4853 | cip, sip, mac, _ = self.dhcp.only_discover(mac=mac,desired = True) |
| 4854 | try: |
| 4855 | assert_equal(cip,self.dhcp.seed_ip) |
| 4856 | log_test.info('Got dhcp client desired IP %s from server %s for mac %s as expected' % |
| 4857 | (cip, sip, mac) ) |
| 4858 | finally: |
| 4859 | self.voltha.disable_device(device_id, delete = True) |
| 4860 | self.voltha_dhcprelay_tearDownClass() |
| 4861 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4862 | def test_subscriber_with_voltha_for_dhcprelay_requesting_desired_out_of_pool_ip_address(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4863 | """ |
| 4864 | Test Method: |
| 4865 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 4866 | 1. OLT and ONU is detected and validated. |
| 4867 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4868 | 3. Send dhcp request with desired out of pool ip address from residential subscriber to external dhcp server. |
| 4869 | 4. Verify that subscriber should not get ip which was requested in step 3 from external dhcp server., and its offered only within dhcp pool of ip. |
| 4870 | """ |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 4871 | self.voltha_dhcprelay_setUpClass() |
| 4872 | # if not port_list: |
| 4873 | # port_list = self.generate_port_list(1, 0) |
| 4874 | iface = self.port_map[self.port_list[0][1]] |
| 4875 | mac = self.get_mac(iface) |
| 4876 | self.host_load(iface) |
| 4877 | ##we use the defaults for this test that serves as an example for others |
| 4878 | ##You don't need to restart dhcpd server if retaining default config |
| 4879 | config = self.default_config |
| 4880 | options = self.default_options |
| 4881 | subnet = self.default_subnet_config |
| 4882 | dhcpd_interface_list = self.relay_interfaces |
| 4883 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 4884 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 4885 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 4886 | assert_not_equal(device_id, None) |
| 4887 | voltha = VolthaCtrl(**self.voltha_attrs) |
| 4888 | time.sleep(10) |
| 4889 | switch_map = None |
| 4890 | olt_configured = False |
| 4891 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 4892 | log_test.info('Installing OLT app') |
| 4893 | OnosCtrl.install_app(self.olt_app_file) |
| 4894 | time.sleep(5) |
| 4895 | log_test.info('Adding subscribers through OLT app') |
| 4896 | self.config_olt(switch_map) |
| 4897 | olt_configured = True |
| 4898 | time.sleep(5) |
| 4899 | self.dhcpd_start(intf_list = dhcpd_interface_list, |
| 4900 | config = config, |
| 4901 | options = options, |
| 4902 | subnet = subnet) |
| 4903 | self.dhcp = DHCPTest(seed_ip = '20.20.20.35', iface = iface) |
| 4904 | cip, sip, mac, _ = self.dhcp.only_discover(mac= mac,desired = True) |
| 4905 | try: |
| 4906 | assert_not_equal(cip,None) |
| 4907 | assert_not_equal(cip,self.dhcp.seed_ip) |
| 4908 | log_test.info('server offered IP from its pool when requested out of pool IP, as expected') |
| 4909 | finally: |
| 4910 | self.voltha.disable_device(device_id, delete = True) |
| 4911 | self.voltha_dhcprelay_tearDownClass() |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4912 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4913 | def test_subscriber_with_voltha_deactivating_dhcprelay_app_in_onos(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4914 | """ |
| 4915 | Test Method: |
| 4916 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 4917 | 1. OLT and ONU is detected and validated. |
| 4918 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4919 | 3. Send dhcp request from residential subscriber to external dhcp server. |
| 4920 | 4. Verify that subscriber get ip from external dhcp server. successfully. |
| 4921 | 5. Deactivate dhcp server app in onos. |
| 4922 | 6. Repeat step 3. |
| 4923 | 7. Verify that subscriber should not get ip from external dhcp server., and ping to gateway. |
| 4924 | """ |
Thangavelu K S and Chetan Gaonker | e07a7b4 | 2017-08-23 17:43:31 +0000 | [diff] [blame] | 4925 | self.voltha_dhcprelay_setUpClass() |
| 4926 | # if not port_list: |
| 4927 | # port_list = self.generate_port_list(1, 0) |
| 4928 | iface = self.port_map[self.port_list[0][1]] |
| 4929 | mac = self.get_mac(iface) |
| 4930 | self.host_load(iface) |
| 4931 | ##we use the defaults for this test that serves as an example for others |
| 4932 | ##You don't need to restart dhcpd server if retaining default config |
| 4933 | config = self.default_config |
| 4934 | options = self.default_options |
| 4935 | subnet = self.default_subnet_config |
| 4936 | dhcpd_interface_list = self.relay_interfaces |
| 4937 | log_test.info('Enabling ponsim_olt') |
| 4938 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 4939 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 4940 | assert_not_equal(device_id, None) |
| 4941 | voltha = VolthaCtrl(**self.voltha_attrs) |
| 4942 | time.sleep(10) |
| 4943 | switch_map = None |
| 4944 | olt_configured = False |
| 4945 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 4946 | log_test.info('Installing OLT app') |
| 4947 | OnosCtrl.install_app(self.olt_app_file) |
| 4948 | time.sleep(5) |
| 4949 | log_test.info('Adding subscribers through OLT app') |
| 4950 | self.config_olt(switch_map) |
| 4951 | olt_configured = True |
| 4952 | time.sleep(5) |
| 4953 | self.dhcpd_start(intf_list = dhcpd_interface_list, |
| 4954 | config = config, |
| 4955 | options = options, |
| 4956 | subnet = subnet) |
| 4957 | self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = iface) |
| 4958 | thread1 = threading.Thread(target = self.send_recv_function_in_thread, args = (mac,)) |
| 4959 | thread2 = threading.Thread(target = self.deactivate_apps, args = (self.app_dhcprelay,)) |
| 4960 | log_test.info('Restart dhcprelay app in onos during client send discover to voltha') |
| 4961 | thread2.start() |
| 4962 | thread1.start() |
| 4963 | time.sleep(10) |
| 4964 | thread1.join() |
| 4965 | thread2.join() |
| 4966 | try: |
| 4967 | assert_equal(self.success, False) |
| 4968 | #assert_equal(status, True) |
| 4969 | time.sleep(10) |
| 4970 | finally: |
| 4971 | self.voltha.disable_device(device_id, delete = True) |
| 4972 | self.voltha_dhcprelay_tearDownClass() |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4973 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4974 | def test_subscriber_with_voltha_for_dhcprelay_renew_time(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4975 | """ |
| 4976 | Test Method: |
| 4977 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 4978 | 1. OLT and ONU is detected and validated. |
| 4979 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4980 | 3. Send dhcp request from residential subscriber to external dhcp server. |
| 4981 | 4. Verify that subscriber get ip from external dhcp server. successfully. |
| 4982 | 5. Send dhcp renew packet to external dhcp server. |
| 4983 | 6. Repeat step 4. |
| 4984 | """ |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 4985 | self.voltha_dhcprelay_setUpClass() |
| 4986 | # if not port_list: |
| 4987 | # port_list = self.generate_port_list(1, 0) |
| 4988 | iface = self.port_map[self.port_list[0][1]] |
| 4989 | mac = self.get_mac(iface) |
| 4990 | self.host_load(iface) |
| 4991 | ##we use the defaults for this test that serves as an example for others |
| 4992 | ##You don't need to restart dhcpd server if retaining default config |
| 4993 | config = self.default_config |
| 4994 | new_options = [('dhcp-renewal-time', 100), ('dhcp-rebinding-time', 125)] |
| 4995 | options = self.default_options + new_options |
| 4996 | subnet = self.default_subnet_config |
| 4997 | dhcpd_interface_list = self.relay_interfaces |
| 4998 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 4999 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 5000 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 5001 | assert_not_equal(device_id, None) |
| 5002 | voltha = VolthaCtrl(**self.voltha_attrs) |
| 5003 | time.sleep(10) |
| 5004 | switch_map = None |
| 5005 | olt_configured = False |
| 5006 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 5007 | log_test.info('Installing OLT app') |
| 5008 | OnosCtrl.install_app(self.olt_app_file) |
| 5009 | time.sleep(5) |
| 5010 | log_test.info('Adding subscribers through OLT app') |
| 5011 | self.config_olt(switch_map) |
| 5012 | olt_configured = True |
| 5013 | time.sleep(5) |
| 5014 | self.dhcpd_start(intf_list = dhcpd_interface_list, |
| 5015 | config = config, |
| 5016 | options = options, |
| 5017 | subnet = subnet) |
| 5018 | self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface) |
| 5019 | cip, sip, mac, _ = self.dhcp.only_discover(mac=mac) |
| 5020 | log_test.info('Got dhcp client IP %s from server %s for mac %s .' % |
| 5021 | (cip, sip, mac) ) |
| 5022 | try: |
| 5023 | assert_not_equal(cip,None) |
| 5024 | new_cip, new_sip, lval = self.dhcp.only_request(cip, mac, renew_time = True) |
| 5025 | log_test.info('Waiting for renew time..') |
| 5026 | time.sleep(lval) |
| 5027 | latest_cip, latest_sip = self.dhcp.only_request(new_cip, mac, unicast = True) |
| 5028 | assert_equal(latest_cip, cip) |
| 5029 | log_test.info('Server renewed client IP when client sends request after renew time, as expected') |
| 5030 | finally: |
| 5031 | self.voltha.disable_device(device_id, delete = True) |
| 5032 | self.voltha_dhcprelay_tearDownClass() |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 5033 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 5034 | def test_subscriber_with_voltha_for_dhcprelay_rebind_time(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 5035 | """ |
| 5036 | Test Method: |
| 5037 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 5038 | 1. OLT and ONU is detected and validated. |
| 5039 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 5040 | 3. Send dhcp request from residential subscriber to external dhcp server. |
| 5041 | 4. Verify that subscriber get ip from external dhcp server. successfully. |
| 5042 | 5. Send dhcp rebind packet to external dhcp server. |
| 5043 | 6. Repeat step 4. |
| 5044 | """ |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 5045 | self.voltha_dhcprelay_setUpClass() |
| 5046 | # if not port_list: |
| 5047 | # port_list = self.generate_port_list(1, 0) |
| 5048 | iface = self.port_map[self.port_list[0][1]] |
| 5049 | mac = self.get_mac(iface) |
| 5050 | self.host_load(iface) |
| 5051 | ##we use the defaults for this test that serves as an example for others |
| 5052 | ##You don't need to restart dhcpd server if retaining default config |
| 5053 | config = self.default_config |
| 5054 | new_options = [('dhcp-renewal-time', 100), ('dhcp-rebinding-time', 125)] |
| 5055 | options = self.default_options + new_options |
| 5056 | subnet = self.default_subnet_config |
| 5057 | dhcpd_interface_list = self.relay_interfaces |
| 5058 | log_test.info('Enabling ponsim_olt') |
A R Karthick | 168e234 | 2017-08-15 16:13:10 -0700 | [diff] [blame] | 5059 | ponsim_address = '{}:50060'.format(self.VOLTHA_PONSIM_HOST) |
Thangavelu K S and Chetan Gaonker | 88b30a5 | 2017-08-15 00:27:55 +0000 | [diff] [blame] | 5060 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 5061 | assert_not_equal(device_id, None) |
| 5062 | voltha = VolthaCtrl(**self.voltha_attrs) |
| 5063 | time.sleep(10) |
| 5064 | switch_map = None |
| 5065 | olt_configured = False |
| 5066 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 5067 | log_test.info('Installing OLT app') |
| 5068 | OnosCtrl.install_app(self.olt_app_file) |
| 5069 | time.sleep(5) |
| 5070 | log_test.info('Adding subscribers through OLT app') |
| 5071 | self.config_olt(switch_map) |
| 5072 | olt_configured = True |
| 5073 | time.sleep(5) |
| 5074 | self.dhcpd_start(intf_list = dhcpd_interface_list, |
| 5075 | config = config, |
| 5076 | options = options, |
| 5077 | subnet = subnet) |
| 5078 | self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface) |
| 5079 | cip, sip, mac, _ = self.dhcp.only_discover(mac=mac) |
| 5080 | log_test.info('Got dhcp client IP %s from server %s for mac %s .' % |
| 5081 | (cip, sip, mac) ) |
| 5082 | try: |
| 5083 | assert_not_equal(cip,None) |
| 5084 | new_cip, new_sip, lval = self.dhcp.only_request(cip, mac, rebind_time = True) |
| 5085 | log_test.info('Waiting for rebind time..') |
| 5086 | time.sleep(lval) |
| 5087 | latest_cip, latest_sip = self.dhcp.only_request(new_cip, mac) |
| 5088 | assert_equal(latest_cip, cip) |
| 5089 | log_test.info('Server renewed client IP when client sends request after rebind time, as expected') |
| 5090 | finally: |
| 5091 | self.voltha.disable_device(device_id, delete = True) |
| 5092 | self.voltha_dhcprelay_tearDownClass() |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 5093 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 5094 | def test_subscriber_with_voltha_for_dhcprelay_disabling_olt(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 5095 | """ |
| 5096 | Test Method: |
| 5097 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 5098 | 1. OLT and ONU is detected and validated. |
| 5099 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 5100 | 3. Send dhcp request from residential subscriber to external dhcp server. |
| 5101 | 4. Verify that subscriber get ip from external dhcp server. successfully. |
| 5102 | 5. Disable olt devices which is being detected in voltha CLI. |
| 5103 | 6. Repeat step 3. |
| 5104 | 7. Verify that subscriber should not get ip from external dhcp server., and ping to gateway. |
| 5105 | """ |
Thangavelu K S and Chetan Gaonker | e07a7b4 | 2017-08-23 17:43:31 +0000 | [diff] [blame] | 5106 | self.voltha_dhcprelay_setUpClass() |
| 5107 | # if not port_list: |
| 5108 | # port_list = self.generate_port_list(1, 0) |
| 5109 | iface = self.port_map[self.port_list[0][1]] |
| 5110 | mac = self.get_mac(iface) |
| 5111 | self.host_load(iface) |
| 5112 | ##we use the defaults for this test that serves as an example for others |
| 5113 | ##You don't need to restart dhcpd server if retaining default config |
| 5114 | config = self.default_config |
| 5115 | options = self.default_options |
| 5116 | subnet = self.default_subnet_config |
| 5117 | dhcpd_interface_list = self.relay_interfaces |
| 5118 | log_test.info('Enabling ponsim_olt') |
| 5119 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 5120 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 5121 | assert_not_equal(device_id, None) |
| 5122 | voltha = VolthaCtrl(**self.voltha_attrs) |
| 5123 | time.sleep(10) |
| 5124 | switch_map = None |
| 5125 | olt_configured = False |
| 5126 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 5127 | log_test.info('Installing OLT app') |
| 5128 | OnosCtrl.install_app(self.olt_app_file) |
| 5129 | time.sleep(5) |
| 5130 | log_test.info('Adding subscribers through OLT app') |
| 5131 | self.config_olt(switch_map) |
| 5132 | olt_configured = True |
| 5133 | time.sleep(5) |
| 5134 | self.dhcpd_start(intf_list = dhcpd_interface_list, |
| 5135 | config = config, |
| 5136 | options = options, |
| 5137 | subnet = subnet) |
| 5138 | self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = iface) |
| 5139 | thread1 = threading.Thread(target = self.send_recv_function_in_thread, args = (mac,)) |
| 5140 | thread2 = threading.Thread(target = self.voltha.disable_device, args = (device_id,False,)) |
| 5141 | log_test.info('Disable olt devices during client send discover to voltha') |
| 5142 | thread2.start() |
| 5143 | time.sleep(4) |
| 5144 | thread1.start() |
| 5145 | time.sleep(10) |
| 5146 | thread1.join() |
| 5147 | thread2.join() |
| 5148 | try: |
| 5149 | assert_equal(self.success, False) |
| 5150 | #assert_equal(status, True) |
| 5151 | time.sleep(10) |
| 5152 | finally: |
| 5153 | self.voltha.disable_device(device_id, delete = True) |
| 5154 | self.voltha_dhcprelay_tearDownClass() |
| 5155 | |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 5156 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 5157 | def test_subscriber_with_voltha_for_dhcprelay_toggling_olt(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 5158 | """ |
| 5159 | Test Method: |
| 5160 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 5161 | 1. OLT and ONU is detected and validated. |
| 5162 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 5163 | 3. Send dhcp request from residential subscriber to external dhcp server. |
| 5164 | 4. Verify that subscriber get ip from external dhcp server. successfully. |
| 5165 | 5. Disable olt devices which is being detected in voltha CLI. |
| 5166 | 6. Repeat step 3. |
| 5167 | 7. Verify that subscriber should not get ip from external dhcp server., and ping to gateway. |
| 5168 | 8. Enable olt devices which is being detected in voltha CLI. |
| 5169 | 9. Repeat steps 3 and 4. |
| 5170 | """ |
Thangavelu K S and Chetan Gaonker | e07a7b4 | 2017-08-23 17:43:31 +0000 | [diff] [blame] | 5171 | self.voltha_dhcprelay_setUpClass() |
| 5172 | # if not port_list: |
| 5173 | # port_list = self.generate_port_list(1, 0) |
| 5174 | iface = self.port_map[self.port_list[0][1]] |
| 5175 | mac = self.get_mac(iface) |
| 5176 | self.host_load(iface) |
| 5177 | ##we use the defaults for this test that serves as an example for others |
| 5178 | ##You don't need to restart dhcpd server if retaining default config |
| 5179 | config = self.default_config |
| 5180 | options = self.default_options |
| 5181 | subnet = self.default_subnet_config |
| 5182 | dhcpd_interface_list = self.relay_interfaces |
| 5183 | log_test.info('Enabling ponsim_olt') |
| 5184 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 5185 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 5186 | assert_not_equal(device_id, None) |
| 5187 | voltha = VolthaCtrl(**self.voltha_attrs) |
| 5188 | time.sleep(10) |
| 5189 | switch_map = None |
| 5190 | olt_configured = False |
| 5191 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 5192 | log_test.info('Installing OLT app') |
| 5193 | OnosCtrl.install_app(self.olt_app_file) |
| 5194 | time.sleep(5) |
| 5195 | log_test.info('Adding subscribers through OLT app') |
| 5196 | self.config_olt(switch_map) |
| 5197 | olt_configured = True |
| 5198 | time.sleep(5) |
| 5199 | self.dhcpd_start(intf_list = dhcpd_interface_list, |
| 5200 | config = config, |
| 5201 | options = options, |
| 5202 | subnet = subnet) |
| 5203 | self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = iface) |
| 5204 | thread1 = threading.Thread(target = self.send_recv_function_in_thread, args = (mac,)) |
| 5205 | thread2 = threading.Thread(target = self.voltha.restart_device, args = (device_id,)) |
| 5206 | log_test.info('Restart olt devices during client send discover to voltha') |
| 5207 | thread2.start() |
| 5208 | time.sleep(4) |
| 5209 | thread1.start() |
| 5210 | time.sleep(10) |
| 5211 | thread1.join() |
| 5212 | thread2.join() |
| 5213 | try: |
| 5214 | assert_equal(self.success, False) |
| 5215 | #assert_equal(status, True) |
| 5216 | time.sleep(10) |
| 5217 | finally: |
| 5218 | self.voltha.disable_device(device_id, delete = True) |
| 5219 | self.voltha_dhcprelay_tearDownClass() |
| 5220 | |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 5221 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 5222 | def test_subscriber_with_voltha_for_dhcprelay_disable_onu_port_in_voltha(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 5223 | """ |
| 5224 | Test Method: |
| 5225 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 5226 | 1. OLT and ONU is detected and validated. |
| 5227 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 5228 | 3. Send dhcp request from residential subscriber to external dhcp server. |
| 5229 | 4. Verify that subscriber get ip from external dhcp server. successfully. |
| 5230 | 5. Disable onu port which is being detected in voltha CLI. |
| 5231 | 6. Repeat step 3. |
| 5232 | 7. Verify that subscriber should not get ip from external dhcp server., and ping to gateway. |
| 5233 | """ |
| 5234 | |
Thangavelu K S and Chetan Gaonker | e07a7b4 | 2017-08-23 17:43:31 +0000 | [diff] [blame] | 5235 | self.voltha_dhcprelay_setUpClass() |
| 5236 | # if not port_list: |
| 5237 | # port_list = self.generate_port_list(1, 0) |
| 5238 | iface = self.port_map[self.port_list[0][1]] |
| 5239 | mac = self.get_mac(iface) |
| 5240 | self.host_load(iface) |
| 5241 | ##we use the defaults for this test that serves as an example for others |
| 5242 | ##You don't need to restart dhcpd server if retaining default config |
| 5243 | config = self.default_config |
| 5244 | options = self.default_options |
| 5245 | subnet = self.default_subnet_config |
| 5246 | dhcpd_interface_list = self.relay_interfaces |
| 5247 | log_test.info('Enabling ponsim_olt') |
| 5248 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 5249 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 5250 | assert_not_equal(device_id, None) |
| 5251 | voltha = VolthaCtrl(**self.voltha_attrs) |
| 5252 | time.sleep(10) |
| 5253 | switch_map = None |
| 5254 | olt_configured = False |
| 5255 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 5256 | log_test.info('Installing OLT app') |
| 5257 | OnosCtrl.install_app(self.olt_app_file) |
| 5258 | time.sleep(5) |
| 5259 | log_test.info('Adding subscribers through OLT app') |
| 5260 | self.config_olt(switch_map) |
| 5261 | olt_configured = True |
| 5262 | time.sleep(5) |
| 5263 | self.dhcpd_start(intf_list = dhcpd_interface_list, |
| 5264 | config = config, |
| 5265 | options = options, |
| 5266 | subnet = subnet) |
| 5267 | self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = iface) |
| 5268 | thread1 = threading.Thread(target = self.send_recv_function_in_thread, args = (mac,)) |
| 5269 | thread2 = threading.Thread(target = self.voltha_uni_port_toggle) |
| 5270 | log_test.info('Restart olt devices during client send discover to voltha') |
| 5271 | thread2.start() |
| 5272 | time.sleep(4) |
| 5273 | thread1.start() |
| 5274 | time.sleep(10) |
| 5275 | thread1.join() |
| 5276 | thread2.join() |
| 5277 | try: |
| 5278 | assert_equal(self.success, False) |
| 5279 | #assert_equal(status, True) |
| 5280 | time.sleep(10) |
| 5281 | finally: |
| 5282 | self.voltha.disable_device(device_id, delete = True) |
| 5283 | self.voltha_dhcprelay_tearDownClass() |
| 5284 | |
| 5285 | def test_subscriber_with_voltha_for_dhcprelay_toggle_onu_port_in_voltha(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 5286 | """ |
| 5287 | Test Method: |
| 5288 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 5289 | 1. OLT and ONU is detected and validated. |
| 5290 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 5291 | 3. Send dhcp request from residential subscriber to external dhcp server. |
| 5292 | 4. Verify that subscriber get ip from external dhcp server. successfully. |
| 5293 | 5. Disable onu port which is being detected in voltha CLI. |
| 5294 | 6. Repeat step 3. |
| 5295 | 7. Verify that subscriber should not get ip from external dhcp server., and ping to gateway. |
| 5296 | 8. Enable onu port which is being detected in voltha CLI. |
| 5297 | 9. Repeat steps 3 and 4. |
| 5298 | """ |
Thangavelu K S and Chetan Gaonker | e07a7b4 | 2017-08-23 17:43:31 +0000 | [diff] [blame] | 5299 | self.voltha_dhcprelay_setUpClass() |
| 5300 | # if not port_list: |
| 5301 | # port_list = self.generate_port_list(1, 0) |
| 5302 | iface = self.port_map[self.port_list[0][1]] |
| 5303 | mac = self.get_mac(iface) |
| 5304 | self.host_load(iface) |
| 5305 | ##we use the defaults for this test that serves as an example for others |
| 5306 | ##You don't need to restart dhcpd server if retaining default config |
| 5307 | config = self.default_config |
| 5308 | options = self.default_options |
| 5309 | subnet = self.default_subnet_config |
| 5310 | dhcpd_interface_list = self.relay_interfaces |
| 5311 | log_test.info('Enabling ponsim_olt') |
| 5312 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 5313 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 5314 | assert_not_equal(device_id, None) |
| 5315 | voltha = VolthaCtrl(**self.voltha_attrs) |
| 5316 | time.sleep(10) |
| 5317 | switch_map = None |
| 5318 | olt_configured = False |
| 5319 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 5320 | log_test.info('Installing OLT app') |
| 5321 | OnosCtrl.install_app(self.olt_app_file) |
| 5322 | time.sleep(5) |
| 5323 | log_test.info('Adding subscribers through OLT app') |
| 5324 | self.config_olt(switch_map) |
| 5325 | olt_configured = True |
| 5326 | time.sleep(5) |
| 5327 | self.dhcpd_start(intf_list = dhcpd_interface_list, |
| 5328 | config = config, |
| 5329 | options = options, |
| 5330 | subnet = subnet) |
| 5331 | self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = iface) |
| 5332 | thread1 = threading.Thread(target = self.send_recv_function_in_thread, args = (mac,)) |
| 5333 | thread2 = threading.Thread(target = self.voltha_uni_port_toggle) |
| 5334 | log_test.info('Restart olt devices during client send discover to voltha') |
| 5335 | thread2.start() |
| 5336 | time.sleep(4) |
| 5337 | thread1.start() |
| 5338 | time.sleep(10) |
| 5339 | thread1.join() |
| 5340 | thread2.join() |
| 5341 | try: |
| 5342 | assert_equal(self.success, False) |
| 5343 | #assert_equal(status, True) |
| 5344 | time.sleep(10) |
| 5345 | cip, sip = self.send_recv(mac=mac) |
| 5346 | finally: |
| 5347 | self.voltha.disable_device(device_id, delete = True) |
| 5348 | self.voltha_dhcprelay_tearDownClass() |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 5349 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 5350 | def test_two_subscribers_with_voltha_for_dhcprelay_discover(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 5351 | """ |
| 5352 | Test Method: |
| 5353 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 5354 | 1. OLT and ONU is detected and validated. |
| 5355 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 5356 | 3. Send dhcp request from two residential subscribers to external dhcp server. |
| 5357 | 4. Verify that subscribers had got different ips from external dhcp server. successfully. |
| 5358 | """ |
Thangavelu K S and Chetan Gaonker | e07a7b4 | 2017-08-23 17:43:31 +0000 | [diff] [blame] | 5359 | self.voltha_dhcprelay_setUpClass() |
| 5360 | # if not port_list: |
| 5361 | # port_list = self.generate_port_list(1, 0) |
| 5362 | iface_1 = self.port_map[self.port_list[0][1]] |
| 5363 | iface_2 = self.port_map[self.port_list[3][1]] |
| 5364 | mac_1 = self.get_mac(iface_1) |
| 5365 | mac_2 = self.get_mac(iface_2) |
| 5366 | self.host_load(iface_1) |
| 5367 | self.host_load(iface_2) |
| 5368 | ##we use the defaults for this test that serves as an example for others |
| 5369 | ##You don't need to restart dhcpd server if retaining default config |
| 5370 | config = self.default_config |
| 5371 | options = self.default_options |
| 5372 | subnet = self.default_subnet_config |
| 5373 | dhcpd_interface_list = self.relay_interfaces |
| 5374 | log_test.info('Enabling ponsim_olt') |
| 5375 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 5376 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 5377 | assert_not_equal(device_id, None) |
| 5378 | voltha = VolthaCtrl(**self.voltha_attrs) |
| 5379 | time.sleep(10) |
| 5380 | switch_map = None |
| 5381 | olt_configured = False |
| 5382 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 5383 | log_test.info('Installing OLT app') |
| 5384 | OnosCtrl.install_app(self.olt_app_file) |
| 5385 | time.sleep(5) |
| 5386 | log_test.info('Adding subscribers through OLT app') |
| 5387 | self.config_olt(switch_map) |
| 5388 | olt_configured = True |
| 5389 | time.sleep(5) |
| 5390 | self.dhcpd_start(intf_list = dhcpd_interface_list, |
| 5391 | config = config, |
| 5392 | options = options, |
| 5393 | subnet = subnet) |
| 5394 | self.dhcp_1 = DHCPTest(seed_ip = '10.10.10.1', iface = iface_1) |
| 5395 | self.dhcp_2 = DHCPTest(seed_ip = '20.20.20.1', iface = iface_2) |
| 5396 | thread1 = threading.Thread(target = self.send_recv_function_in_thread, args = (mac_1,False,True,self.dhcp_1,)) |
| 5397 | thread2 = threading.Thread(target = self.send_recv_function_in_thread, args = (mac_2,False,True,self.dhcp_2,)) |
| 5398 | # log_test.info('Restart olt devices during client send discover to voltha') |
| 5399 | thread2.start() |
| 5400 | time.sleep(4) |
| 5401 | thread1.start() |
| 5402 | time.sleep(10) |
| 5403 | thread1.join() |
| 5404 | thread2.join() |
| 5405 | try: |
| 5406 | assert_equal(self.success, True) |
| 5407 | #assert_equal(status, True) |
| 5408 | time.sleep(10) |
| 5409 | finally: |
| 5410 | self.voltha.disable_device(device_id, delete = True) |
| 5411 | self.voltha_dhcprelay_tearDownClass() |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 5412 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 5413 | def test_two_subscribers_with_voltha_for_dhcprelay_multiple_discover(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 5414 | """ |
| 5415 | Test Method: |
| 5416 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 5417 | 1. OLT and ONU is detected and validated. |
| 5418 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 5419 | 3. Send dhcp request from two residential subscribers to external dhcp server. |
| 5420 | 4. Verify that subscribers had got ip from external dhcp server. successfully. |
| 5421 | 5. Repeat step 3 and 4 for 10 times for both subscribers. |
| 5422 | 6 Verify that subscribers should get same ips which are offered the first time from external dhcp server.. |
| 5423 | """ |
Thangavelu K S and Chetan Gaonker | e07a7b4 | 2017-08-23 17:43:31 +0000 | [diff] [blame] | 5424 | self.voltha_dhcprelay_setUpClass() |
| 5425 | # if not port_list: |
| 5426 | # port_list = self.generate_port_list(1, 0) |
| 5427 | iface_1 = self.port_map[self.port_list[0][1]] |
| 5428 | iface_2 = self.port_map[self.port_list[3][1]] |
| 5429 | mac_1 = self.get_mac(iface_1) |
| 5430 | mac_2 = self.get_mac(iface_2) |
| 5431 | self.host_load(iface_1) |
| 5432 | self.host_load(iface_2) |
| 5433 | ##we use the defaults for this test that serves as an example for others |
| 5434 | ##You don't need to restart dhcpd server if retaining default config |
| 5435 | config = self.default_config |
| 5436 | options = self.default_options |
| 5437 | subnet = self.default_subnet_config |
| 5438 | dhcpd_interface_list = self.relay_interfaces |
| 5439 | log_test.info('Enabling ponsim_olt') |
| 5440 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 5441 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 5442 | assert_not_equal(device_id, None) |
| 5443 | voltha = VolthaCtrl(**self.voltha_attrs) |
| 5444 | time.sleep(10) |
| 5445 | switch_map = None |
| 5446 | olt_configured = False |
| 5447 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 5448 | log_test.info('Installing OLT app') |
| 5449 | OnosCtrl.install_app(self.olt_app_file) |
| 5450 | time.sleep(5) |
| 5451 | log_test.info('Adding subscribers through OLT app') |
| 5452 | self.config_olt(switch_map) |
| 5453 | olt_configured = True |
| 5454 | time.sleep(5) |
| 5455 | self.dhcpd_start(intf_list = dhcpd_interface_list, |
| 5456 | config = config, |
| 5457 | options = options, |
| 5458 | subnet = subnet) |
| 5459 | |
| 5460 | thread1 = threading.Thread(target = self.dhcprelay_flow_check, args = ('10.10.10.1', iface_1, mac_1,'multiple_discover',)) |
| 5461 | thread2 = threading.Thread(target = self.dhcprelay_flow_check, args = ('20.20.20.1', iface_2, mac_2,'multiple_discover',)) |
| 5462 | #log_test.info('Restart olt devices during client send discover to voltha') |
| 5463 | thread2.start() |
| 5464 | time.sleep(4) |
| 5465 | thread1.start() |
| 5466 | time.sleep(10) |
| 5467 | thread1.join() |
| 5468 | thread2.join() |
| 5469 | try: |
| 5470 | assert_equal(self.success, True) |
| 5471 | #assert_equal(status, True) |
| 5472 | time.sleep(10) |
| 5473 | finally: |
| 5474 | self.voltha.disable_device(device_id, delete = True) |
| 5475 | self.voltha_dhcprelay_tearDownClass() |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 5476 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 5477 | def test_two_subscribers_with_voltha_for_dhcprelay_multiple_discover_for_one_subscriber(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 5478 | """ |
| 5479 | Test Method: |
| 5480 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 5481 | 1. OLT and ONU is detected and validated. |
| 5482 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 5483 | 3. Send dhcp request from two residential subscribers to external dhcp server. |
| 5484 | 4. Verify that subscribers had got ip from external dhcp server. successfully. |
| 5485 | 5. Repeat step 3 and 4 for 10 times for only one subscriber and ping to gateway from other subscriber. |
| 5486 | 6 Verify that subscriber should get same ip which is offered the first time from external dhcp server. and other subscriber ping to gateway should not failed |
| 5487 | """ |
| 5488 | |
Thangavelu K S and Chetan Gaonker | e07a7b4 | 2017-08-23 17:43:31 +0000 | [diff] [blame] | 5489 | self.voltha_dhcprelay_setUpClass() |
| 5490 | # if not port_list: |
| 5491 | # port_list = self.generate_port_list(1, 0) |
| 5492 | iface_1 = self.port_map[self.port_list[0][1]] |
| 5493 | iface_2 = self.port_map[self.port_list[3][1]] |
| 5494 | mac_1 = self.get_mac(iface_1) |
| 5495 | mac_2 = self.get_mac(iface_2) |
| 5496 | self.host_load(iface_1) |
| 5497 | self.host_load(iface_2) |
| 5498 | ##we use the defaults for this test that serves as an example for others |
| 5499 | ##You don't need to restart dhcpd server if retaining default config |
| 5500 | config = self.default_config |
| 5501 | options = self.default_options |
| 5502 | subnet = self.default_subnet_config |
| 5503 | dhcpd_interface_list = self.relay_interfaces |
| 5504 | log_test.info('Enabling ponsim_olt') |
| 5505 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 5506 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 5507 | assert_not_equal(device_id, None) |
| 5508 | voltha = VolthaCtrl(**self.voltha_attrs) |
| 5509 | time.sleep(10) |
| 5510 | switch_map = None |
| 5511 | olt_configured = False |
| 5512 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 5513 | log_test.info('Installing OLT app') |
| 5514 | OnosCtrl.install_app(self.olt_app_file) |
| 5515 | time.sleep(5) |
| 5516 | log_test.info('Adding subscribers through OLT app') |
| 5517 | self.config_olt(switch_map) |
| 5518 | olt_configured = True |
| 5519 | time.sleep(5) |
| 5520 | self.dhcpd_start(intf_list = dhcpd_interface_list, |
| 5521 | config = config, |
| 5522 | options = options, |
| 5523 | subnet = subnet) |
| 5524 | |
| 5525 | thread1 = threading.Thread(target = self.dhcprelay_flow_check, args = ('10.10.10.1', iface_1, mac_1,)) |
| 5526 | thread2 = threading.Thread(target = self.dhcprelay_flow_check, args = ('20.20.20.1', iface_2, mac_2,'multiple_discover',)) |
| 5527 | #log_test.info('Restart olt devices during client send discover to voltha') |
| 5528 | thread2.start() |
| 5529 | time.sleep(4) |
| 5530 | thread1.start() |
| 5531 | time.sleep(10) |
| 5532 | thread1.join() |
| 5533 | thread2.join() |
| 5534 | try: |
| 5535 | assert_equal(self.success, True) |
| 5536 | #assert_equal(status, True) |
| 5537 | time.sleep(10) |
| 5538 | finally: |
| 5539 | self.voltha.disable_device(device_id, delete = True) |
| 5540 | self.voltha_dhcprelay_tearDownClass() |
| 5541 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 5542 | def test_two_subscribers_with_voltha_for_dhcprelay_discover_desired_ip_address_for_one_subscriber(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 5543 | """ |
| 5544 | Test Method: |
| 5545 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 5546 | 1. OLT and ONU is detected and validated. |
| 5547 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 5548 | 3. Send dhcp request from one residential subscriber to external dhcp server. |
| 5549 | 3. Send dhcp request with desired ip from other residential subscriber to external dhcp server. |
| 5550 | 4. Verify that subscribers had got different ips (one subscriber desired ip and other subscriber random ip) from external dhcp server. successfully. |
| 5551 | """ |
Thangavelu K S and Chetan Gaonker | e07a7b4 | 2017-08-23 17:43:31 +0000 | [diff] [blame] | 5552 | self.voltha_dhcprelay_setUpClass() |
| 5553 | # if not port_list: |
| 5554 | # port_list = self.generate_port_list(1, 0) |
| 5555 | iface_1 = self.port_map[self.port_list[0][1]] |
| 5556 | iface_2 = self.port_map[self.port_list[3][1]] |
| 5557 | mac_1 = self.get_mac(iface_1) |
| 5558 | mac_2 = self.get_mac(iface_2) |
| 5559 | self.host_load(iface_1) |
| 5560 | self.host_load(iface_2) |
| 5561 | ##we use the defaults for this test that serves as an example for others |
| 5562 | ##You don't need to restart dhcpd server if retaining default config |
| 5563 | config = self.default_config |
| 5564 | options = self.default_options |
| 5565 | subnet = self.default_subnet_config |
| 5566 | dhcpd_interface_list = self.relay_interfaces |
| 5567 | log_test.info('Enabling ponsim_olt') |
| 5568 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 5569 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 5570 | assert_not_equal(device_id, None) |
| 5571 | voltha = VolthaCtrl(**self.voltha_attrs) |
| 5572 | time.sleep(10) |
| 5573 | switch_map = None |
| 5574 | olt_configured = False |
| 5575 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 5576 | log_test.info('Installing OLT app') |
| 5577 | OnosCtrl.install_app(self.olt_app_file) |
| 5578 | time.sleep(5) |
| 5579 | log_test.info('Adding subscribers through OLT app') |
| 5580 | self.config_olt(switch_map) |
| 5581 | olt_configured = True |
| 5582 | time.sleep(5) |
| 5583 | self.dhcpd_start(intf_list = dhcpd_interface_list, |
| 5584 | config = config, |
| 5585 | options = options, |
| 5586 | subnet = subnet) |
| 5587 | |
| 5588 | thread1 = threading.Thread(target = self.dhcprelay_flow_check, args = ('10.10.10.1', iface_1, mac_1,)) |
| 5589 | thread2 = threading.Thread(target = self.dhcprelay_flow_check, args = ('20.20.20.1', iface_2, mac_2,'desired_ip',)) |
| 5590 | #log_test.info('Restart olt devices during client send discover to voltha') |
| 5591 | thread2.start() |
| 5592 | time.sleep(4) |
| 5593 | thread1.start() |
| 5594 | time.sleep(10) |
| 5595 | thread1.join() |
| 5596 | thread2.join() |
| 5597 | try: |
| 5598 | assert_equal(self.success, True) |
| 5599 | #assert_equal(status, True) |
| 5600 | time.sleep(10) |
| 5601 | finally: |
| 5602 | self.voltha.disable_device(device_id, delete = True) |
| 5603 | self.voltha_dhcprelay_tearDownClass() |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 5604 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 5605 | def test_two_subscribers_with_voltha_for_dhcprelay_discover_for_in_range_and_out_of_range_from_dhcp_pool_ip_addresses(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 5606 | """ |
| 5607 | Test Method: |
| 5608 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 5609 | 1. OLT and ONU is detected and validated. |
| 5610 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 5611 | 3. Send dhcp request with desired wihtin dhcp pool ip from one residential subscriber to external dhcp server. |
| 5612 | 3. Send dhcp request with desired without in dhcp pool ip from other residential subscriber to external dhcp server. |
| 5613 | 4. Verify that subscribers had got different ips (both subscriber got random ips within dhcp pool) from external dhcp server. successfully. |
| 5614 | """ |
| 5615 | |
Thangavelu K S and Chetan Gaonker | e07a7b4 | 2017-08-23 17:43:31 +0000 | [diff] [blame] | 5616 | self.voltha_dhcprelay_setUpClass() |
| 5617 | # if not port_list: |
| 5618 | # port_list = self.generate_port_list(1, 0) |
| 5619 | iface_1 = self.port_map[self.port_list[0][1]] |
| 5620 | iface_2 = self.port_map[self.port_list[3][1]] |
| 5621 | mac_1 = self.get_mac(iface_1) |
| 5622 | mac_2 = self.get_mac(iface_2) |
| 5623 | self.host_load(iface_1) |
| 5624 | self.host_load(iface_2) |
| 5625 | ##we use the defaults for this test that serves as an example for others |
| 5626 | ##You don't need to restart dhcpd server if retaining default config |
| 5627 | config = self.default_config |
| 5628 | options = self.default_options |
| 5629 | subnet = self.default_subnet_config |
| 5630 | dhcpd_interface_list = self.relay_interfaces |
| 5631 | log_test.info('Enabling ponsim_olt') |
| 5632 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 5633 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 5634 | assert_not_equal(device_id, None) |
| 5635 | voltha = VolthaCtrl(**self.voltha_attrs) |
| 5636 | time.sleep(10) |
| 5637 | switch_map = None |
| 5638 | olt_configured = False |
| 5639 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 5640 | log_test.info('Installing OLT app') |
| 5641 | OnosCtrl.install_app(self.olt_app_file) |
| 5642 | time.sleep(5) |
| 5643 | log_test.info('Adding subscribers through OLT app') |
| 5644 | self.config_olt(switch_map) |
| 5645 | olt_configured = True |
| 5646 | time.sleep(5) |
| 5647 | self.dhcpd_start(intf_list = dhcpd_interface_list, |
| 5648 | config = config, |
| 5649 | options = options, |
| 5650 | subnet = subnet) |
| 5651 | |
| 5652 | thread1 = threading.Thread(target = self.dhcprelay_flow_check, args = ('10.10.10.1', iface_1, mac_1,)) |
| 5653 | thread2 = threading.Thread(target = self.dhcprelay_flow_check, args = ('20.20.20.1', iface_2, mac_2,'out_of_pool_ip',)) |
| 5654 | #log_test.info('Restart olt devices during client send discover to voltha') |
| 5655 | thread2.start() |
| 5656 | time.sleep(4) |
| 5657 | thread1.start() |
| 5658 | time.sleep(10) |
| 5659 | thread1.join() |
| 5660 | thread2.join() |
| 5661 | try: |
| 5662 | assert_equal(self.success, True) |
| 5663 | #assert_equal(status, True) |
| 5664 | time.sleep(10) |
| 5665 | finally: |
| 5666 | self.voltha.disable_device(device_id, delete = True) |
| 5667 | self.voltha_dhcprelay_tearDownClass() |
| 5668 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 5669 | def test_two_subscribers_with_voltha_for_dhcprelay_disabling_onu_port_for_one_subscriber(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 5670 | """ |
| 5671 | Test Method: |
| 5672 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 5673 | 1. OLT and ONU is detected and validated. |
| 5674 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 5675 | 3. Send dhcp request from two residential subscribers to external dhcp server. |
| 5676 | 4. Verify that subscribers had got ip from external dhcp server. successfully. |
| 5677 | 5. Disable onu port on which access one subscriber and ping to gateway from other subscriber. |
| 5678 | 6. Repeat step 3 and 4 for one subscriber where uni port is down. |
| 5679 | 7. Verify that subscriber should not get ip from external dhcp server. and other subscriber ping to gateway should not failed. |
| 5680 | """ |
Thangavelu K S and Chetan Gaonker | e07a7b4 | 2017-08-23 17:43:31 +0000 | [diff] [blame] | 5681 | self.voltha_dhcprelay_setUpClass() |
| 5682 | # if not port_list: |
| 5683 | # port_list = self.generate_port_list(1, 0) |
| 5684 | iface_1 = self.port_map[self.port_list[0][1]] |
| 5685 | iface_2 = self.port_map[self.port_list[3][1]] |
| 5686 | mac_1 = self.get_mac(iface_1) |
| 5687 | mac_2 = self.get_mac(iface_2) |
| 5688 | self.host_load(iface_1) |
| 5689 | self.host_load(iface_2) |
| 5690 | ##we use the defaults for this test that serves as an example for others |
| 5691 | ##You don't need to restart dhcpd server if retaining default config |
| 5692 | config = self.default_config |
| 5693 | options = self.default_options |
| 5694 | subnet = self.default_subnet_config |
| 5695 | dhcpd_interface_list = self.relay_interfaces |
| 5696 | log_test.info('Enabling ponsim_olt') |
| 5697 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 5698 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 5699 | assert_not_equal(device_id, None) |
| 5700 | voltha = VolthaCtrl(**self.voltha_attrs) |
| 5701 | time.sleep(10) |
| 5702 | switch_map = None |
| 5703 | olt_configured = False |
| 5704 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 5705 | log_test.info('Installing OLT app') |
| 5706 | OnosCtrl.install_app(self.olt_app_file) |
| 5707 | time.sleep(5) |
| 5708 | log_test.info('Adding subscribers through OLT app') |
| 5709 | self.config_olt(switch_map) |
| 5710 | olt_configured = True |
| 5711 | time.sleep(5) |
| 5712 | self.dhcpd_start(intf_list = dhcpd_interface_list, |
| 5713 | config = config, |
| 5714 | options = options, |
| 5715 | subnet = subnet) |
| 5716 | |
| 5717 | thread1 = threading.Thread(target = self.dhcprelay_flow_check, args = ('10.10.10.1', iface_1, mac_1,)) |
| 5718 | thread2 = threading.Thread(target = self.dhcprelay_flow_check, args = ('20.20.20.1', iface_2, mac_2,'desired_ip',)) |
| 5719 | thread3 = threading.Thread(target = self.voltha_uni_port_toggle, args = (iface_2,)) |
| 5720 | #log_test.info('Restart olt devices during client send discover to voltha') |
| 5721 | thread2.start() |
| 5722 | time.sleep(8) |
| 5723 | thread1.start() |
| 5724 | thread3.start() |
| 5725 | time.sleep(10) |
| 5726 | thread1.join() |
| 5727 | thread2.join() |
| 5728 | thread3.join() |
| 5729 | try: |
| 5730 | assert_equal(self.success, False) |
| 5731 | #assert_equal(status, True) |
| 5732 | time.sleep(10) |
| 5733 | finally: |
| 5734 | self.voltha.disable_device(device_id, delete = True) |
| 5735 | self.voltha_dhcprelay_tearDownClass() |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 5736 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 5737 | def test_two_subscribers_with_voltha_for_dhcprelay_toggling_onu_port_for_one_subscriber(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 5738 | """ |
| 5739 | Test Method: |
| 5740 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 5741 | 1. OLT and ONU is detected and validated. |
| 5742 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 5743 | 3. Send dhcp request from two residential subscribers to external dhcp server. |
| 5744 | 4. Verify that subscribers had got ip from external dhcp server. successfully. |
| 5745 | 5. Disable onu port on which access one subscriber and ping to gateway from other subscriber. |
| 5746 | 6. Repeat step 3 and 4 for one subscriber where uni port is down. |
| 5747 | 7. Verify that subscriber should not get ip from external dhcp server. and other subscriber ping to gateway should not failed. |
| 5748 | 8. Enable onu port on which was disable at step 5 and ping to gateway from other subscriber. |
| 5749 | 9. Repeat step 3 and 4 for one subscriber where uni port is up now. |
| 5750 | 10. Verify that subscriber should get ip from external dhcp server. and other subscriber ping to gateway should not failed. |
| 5751 | """ |
| 5752 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 5753 | def test_two_subscribers_with_voltha_for_dhcprelay_disabling_olt(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 5754 | """ |
| 5755 | Test Method: |
| 5756 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 5757 | 1. OLT and ONU is detected and validated. |
| 5758 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 5759 | 3. Send dhcp request from two residential subscribers to external dhcp server. |
| 5760 | 4. Verify that subscribers had got ip from external dhcp server. successfully. |
| 5761 | 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber. |
| 5762 | 6. Disable the olt device which is detected in voltha. |
| 5763 | 7. Verify that subscriber should not get ip from external dhcp server. and other subscriber ping to gateway should failed. |
| 5764 | """ |
| 5765 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 5766 | def test_two_subscribers_with_voltha_for_dhcprelay_toggling_olt(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 5767 | """ |
| 5768 | Test Method: |
| 5769 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 5770 | 1. OLT and ONU is detected and validated. |
| 5771 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 5772 | 3. Send dhcp request from two residential subscribers to external dhcp server. |
| 5773 | 4. Verify that subscribers had got ip from external dhcp server. successfully. |
| 5774 | 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber. |
| 5775 | 6. Disable the olt device which is detected in voltha. |
| 5776 | 7. Verify that subscriber should not get ip from external dhcp server. and other subscriber ping to gateway should failed. |
| 5777 | 8. Enable the olt device which is detected in voltha. |
| 5778 | 9. Verify that subscriber should get ip from external dhcp server. and other subscriber ping to gateway should not failed. |
| 5779 | """ |
| 5780 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 5781 | def test_two_subscribers_with_voltha_for_dhcprelay_with_paused_olt_detected(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 5782 | """ |
| 5783 | Test Method: |
| 5784 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 5785 | 1. OLT and ONU is detected and validated. |
| 5786 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 5787 | 3. Send dhcp request from two residential subscribers to external dhcp server. |
| 5788 | 4. Verify that subscribers had got ip from external dhcp server. successfully. |
| 5789 | 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber. |
| 5790 | 6. Pause the olt device which is detected in voltha. |
| 5791 | 7. Verify that subscriber should not get ip from external dhcp server. and other subscriber ping to gateway should failed. |
| 5792 | """ |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 5793 | |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 5794 | def test_subscriber_with_voltha_for_igmp_join_verifying_traffic(self): |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 5795 | """ |
| 5796 | Test Method: |
| 5797 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 5798 | 1. OLT and ONU is detected and validated. |
| 5799 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 5800 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 5801 | 4. Send igmp joins for a multicast group address multi-group-addressA. |
| 5802 | 5. Send multicast data traffic for a group (multi-group-addressA) from other uni port on ONU. |
| 5803 | 6. Verify that multicast data packets are being recieved on join sent uni port on ONU to cord-tester. |
| 5804 | """ |
| 5805 | |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 5806 | """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each""" |
| 5807 | num_subscribers = 1 |
| 5808 | num_channels = 1 |
| 5809 | services = ('IGMP') |
| 5810 | cbs = (self.igmp_flow_check, None, None) |
| 5811 | self.voltha_subscribers(services, cbs = cbs, |
| 5812 | num_subscribers = num_subscribers, |
| 5813 | num_channels = num_channels) |
| 5814 | |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 5815 | def test_subscriber_with_voltha_for_igmp_leave_verifying_traffic(self): |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 5816 | """ |
| 5817 | Test Method: |
| 5818 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 5819 | 1. OLT and ONU is detected and validated. |
| 5820 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 5821 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 5822 | 4. Send igmp joins for a multicast group address multi-group-addressA. |
| 5823 | 5. Send multicast data traffic for a group (multi-group-addressA) from other uni port on ONU. |
| 5824 | 6. Verify that multicast data packets are being recieved on join received uni port on ONU to cord-tester. |
| 5825 | 7. Send igmp leave for a multicast group address multi-group-addressA. |
| 5826 | 8. Verify that multicast data packets are not being recieved on leave sent uni port on ONU to cord-tester. |
| 5827 | """ |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 5828 | """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each""" |
| 5829 | num_subscribers = 1 |
| 5830 | num_channels = 1 |
| 5831 | services = ('IGMP') |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 5832 | cbs = (self.igmp_leave_flow_check, None, None) |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 5833 | self.voltha_subscribers(services, cbs = cbs, |
| 5834 | num_subscribers = num_subscribers, |
| 5835 | num_channels = num_channels) |
| 5836 | |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 5837 | def test_subscriber_with_voltha_for_igmp_leave_and_again_join_verifying_traffic(self): |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 5838 | """ |
| 5839 | Test Method: |
| 5840 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 5841 | 1. OLT and ONU is detected and validated. |
| 5842 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 5843 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 5844 | 4. Send igmp joins for a multicast group address multi-group-addressA. |
| 5845 | 5. Send multicast data traffic for a group (multi-group-addressA) from other uni port on ONU. |
| 5846 | 6. Verify that multicast data packets are being recieved on join received uni port on ONU to cord-tester. |
| 5847 | 7. Send igmp leave for a multicast group address multi-group-addressA. |
| 5848 | 8. Verify that multicast data packets are not being recieved on leave sent uni port on ONU to cord-tester. |
| 5849 | 9. Repeat steps 4 to 6. |
| 5850 | """ |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 5851 | """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each""" |
| 5852 | num_subscribers = 1 |
| 5853 | num_channels = 1 |
| 5854 | services = ('IGMP') |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 5855 | cbs = (self.igmp_leave_flow_check, None, None) |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 5856 | self.voltha_subscribers(services, cbs = cbs, |
| 5857 | num_subscribers = num_subscribers, |
| 5858 | num_channels = num_channels) |
| 5859 | |
Thangavelu K S and Chetan Gaonker | e07a7b4 | 2017-08-23 17:43:31 +0000 | [diff] [blame] | 5860 | def test_subscriber_with_voltha_for_igmp_with_five_groups_joins_verifying_traffic(self): |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 5861 | """ |
| 5862 | Test Method: |
| 5863 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 5864 | 1. OLT and ONU is detected and validated. |
| 5865 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 5866 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 5867 | 4. Send igmp joins for multicast group addresses multi-group-addressA,multi-group-addressB |
| 5868 | 5. Send multicast data traffic for two groups (multi-group-addressA and multi-group-addressB) from other uni port on ONU. |
| 5869 | 6. Verify that 2 groups multicast data packets are being recieved on join sent uni port on ONU to cord-tester. |
| 5870 | """ |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 5871 | """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each""" |
| 5872 | num_subscribers = 1 |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 5873 | num_channels = 5 |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 5874 | services = ('IGMP') |
| 5875 | cbs = (self.igmp_flow_check, None, None) |
| 5876 | self.voltha_subscribers(services, cbs = cbs, |
| 5877 | num_subscribers = num_subscribers, |
| 5878 | num_channels = num_channels) |
| 5879 | |
Thangavelu K S and Chetan Gaonker | e07a7b4 | 2017-08-23 17:43:31 +0000 | [diff] [blame] | 5880 | def test_subscriber_with_voltha_for_igmp_with_five_groups_joins_and_leave_for_one_group_verifying_traffic(self): |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 5881 | """ |
| 5882 | Test Method: |
| 5883 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 5884 | 1. OLT and ONU is detected and validated. |
| 5885 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 5886 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 5887 | 4. Send igmp joins for multicast group addresses multi-group-addressA,multi-group-addressB |
| 5888 | 5. Send multicast data traffic for two groups (multi-group-addressA and multi-group-addressB) from other uni port on ONU. |
| 5889 | 6. Verify that 2 groups multicast data packets are being recieved on join sent uni port on ONU to cord-tester. |
| 5890 | 7. Send igmp leave for a multicast group address multi-group-addressA. |
| 5891 | 8. Verify that multicast data packets of group(multi-group-addressA) are not being recieved on leave sent uni port on ONU to cord-tester. |
| 5892 | 9. Verify that multicast data packets of group (multi-group-addressB) are being recieved on join sent uni port on ONU to cord-tester. |
| 5893 | """ |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 5894 | """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each""" |
| 5895 | num_subscribers = 1 |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 5896 | num_channels = 5 |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 5897 | services = ('IGMP') |
| 5898 | cbs = (self.igmp_flow_check, None, None) |
| 5899 | self.voltha_subscribers(services, cbs = cbs, |
| 5900 | num_subscribers = num_subscribers, |
| 5901 | num_channels = num_channels) |
| 5902 | |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 5903 | def test_subscriber_with_voltha_for_igmp_join_different_group_src_list_verifying_traffic(self): |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 5904 | """ |
| 5905 | Test Method: |
| 5906 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 5907 | 1. OLT and ONU is detected and validated. |
| 5908 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 5909 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 5910 | 4. Send igmp joins for a multicast group address multi-group-addressA with source list src_listA |
| 5911 | 5. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listA on ONU. |
| 5912 | 6. Verify that multicast data packets are being recieved on join sent uni port on ONU to cord-tester. |
| 5913 | 7. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listB on ONU. |
| 5914 | 8. Verify that multicast data packets are not being recieved on join sent uni port on ONU from other source list to cord-tester. |
| 5915 | """ |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 5916 | num_subscribers = 1 |
| 5917 | num_channels = 1 |
| 5918 | services = ('IGMP') |
| 5919 | cbs = (self.igmp_flow_check, None, None) |
| 5920 | self.voltha_subscribers(services, cbs = cbs, src_list = ['2.3.4.5','3.4.5.6'], |
| 5921 | num_subscribers = num_subscribers, |
| 5922 | num_channels = num_channels) |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 5923 | |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 5924 | def test_subscriber_with_voltha_for_igmp_change_to_exclude_mcast_group_verifying_traffic(self): |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 5925 | """ |
| 5926 | Test Method: |
| 5927 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 5928 | 1. OLT and ONU is detected and validated. |
| 5929 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 5930 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 5931 | 4. Send igmp joins for a multicast group address multi-group-addressA with source list src_listA |
| 5932 | 5. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listA on ONU. |
| 5933 | 6. Verify that multicast data packets are being recieved on join sent uni port on ONU to cord-tester. |
| 5934 | 7. Send igmp joins for a multicast group address multi-group-addressA with exclude source list src_listA |
| 5935 | 8. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listA on ONU. |
| 5936 | 9. Verify that multicast data packets are not being recieved on join sent uni port on ONU from other source list to cord-tester. |
| 5937 | """ |
| 5938 | |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 5939 | num_subscribers = 1 |
Thangavelu K S | 9a63733 | 2017-08-01 23:22:23 +0000 | [diff] [blame] | 5940 | num_channels = 1 |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 5941 | services = ('IGMP') |
| 5942 | cbs = (self.igmp_flow_check_join_change_to_exclude, None, None) |
| 5943 | self.voltha_subscribers(services, cbs = cbs, src_list = ['2.3.4.5','3.4.5.6'], |
| 5944 | num_subscribers = num_subscribers, |
| 5945 | num_channels = num_channels) |
| 5946 | |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 5947 | def test_subscriber_with_voltha_for_igmp_change_to_include_back_from_exclude_mcast_group_verifying_traffic(self): |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 5948 | """ |
| 5949 | Test Method: |
| 5950 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 5951 | 1. OLT and ONU is detected and validated. |
| 5952 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 5953 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 5954 | 4. Send igmp joins for a multicast group address multi-group-addressA with source exclude list src_listA |
| 5955 | 5. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listA on ONU. |
| 5956 | 6. Verify that multicast data packets are not being recieved on join sent uni port on ONU to cord-tester. |
| 5957 | 7. Send igmp joins for a multicast group address multi-group-addressA with allow source list src_listA |
| 5958 | 8. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listA on ONU. |
| 5959 | 9. Verify that multicast data packets are being recieved on join sent uni port on ONU from other source list to cord-tester. |
| 5960 | """ |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 5961 | num_subscribers = 1 |
Thangavelu K S | 9a63733 | 2017-08-01 23:22:23 +0000 | [diff] [blame] | 5962 | num_channels = 1 |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 5963 | services = ('IGMP') |
| 5964 | cbs = (self.igmp_flow_check_join_change_to_exclude_again_include_back, None, None) |
| 5965 | self.voltha_subscribers(services, cbs = cbs, src_list = ['2.3.4.5','3.4.5.6'], |
| 5966 | num_subscribers = num_subscribers, |
| 5967 | num_channels = num_channels) |
| 5968 | |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 5969 | def test_subscriber_with_voltha_for_igmp_change_to_block_src_list_verifying_traffic(self): |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 5970 | """ |
| 5971 | Test Method: |
| 5972 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 5973 | 1. OLT and ONU is detected and validated. |
| 5974 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 5975 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 5976 | 4. Send igmp joins for a multicast group address multi-group-addressA with source list src_listA |
| 5977 | 5. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listA on ONU. |
| 5978 | 6. Verify that multicast data packets are being recieved on join sent uni port on ONU to cord-tester. |
| 5979 | 7. Send igmp joins for a multicast group address multi-group-addressA with block source list src_listA |
| 5980 | 8. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listA on ONU. |
| 5981 | 9. Verify that multicast data packets are not being recieved on join sent uni port on ONU from other source list to cord-tester. |
| 5982 | """ |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 5983 | |
| 5984 | num_subscribers = 1 |
| 5985 | num_channels = 1 |
| 5986 | services = ('IGMP') |
| 5987 | cbs = (self.igmp_flow_check_join_change_to_block, None, None) |
| 5988 | self.voltha_subscribers(services, cbs = cbs, src_list = ['2.3.4.5','3.4.5.6'], |
| 5989 | num_subscribers = num_subscribers, |
| 5990 | num_channels = num_channels) |
| 5991 | |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 5992 | def test_subscriber_with_voltha_for_igmp_allow_new_src_list_verifying_traffic(self): |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 5993 | """ |
| 5994 | Test Method: |
| 5995 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 5996 | 1. OLT and ONU is detected and validated. |
| 5997 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 5998 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 5999 | 4. Send igmp joins for a multicast group address multi-group-addressA with source exclude list src_listA |
| 6000 | 5. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listA on ONU. |
| 6001 | 6. Verify that multicast data packets are being recieved on join sent uni port on ONU to cord-tester. |
| 6002 | 7. Send igmp joins for a multicast group address multi-group-addressA with allow new source list src_listB |
| 6003 | 8. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listB on ONU. |
| 6004 | 9. Verify that multicast data packets are being recieved on join sent uni port on ONU from other source list to cord-tester. |
| 6005 | """ |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 6006 | |
| 6007 | num_subscribers = 1 |
| 6008 | num_channels = 1 |
| 6009 | services = ('IGMP') |
| 6010 | cbs = (self.igmp_flow_check_join_change_to_block_again_allow_back, None, None) |
| 6011 | self.voltha_subscribers(services, cbs = cbs, src_list = ['2.3.4.5','3.4.5.6'], |
| 6012 | num_subscribers = num_subscribers, |
| 6013 | num_channels = num_channels) |
| 6014 | |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 6015 | def test_subscriber_with_voltha_for_igmp_group_include_empty_src_list_verifying_traffic(self): |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 6016 | """ |
| 6017 | Test Method: |
| 6018 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 6019 | 1. OLT and ONU is detected and validated. |
| 6020 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 6021 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 6022 | 4. Send igmp joins for a multicast group address multi-group-addressA with source exclude list src_listA |
| 6023 | 5. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listA on ONU. |
| 6024 | 6. Verify that multicast data packets are not being recieved on join sent uni port on ONU to cord-tester. |
| 6025 | 7. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listB on ONU. |
| 6026 | 8. Verify that multicast data packets are not being recieved on join sent uni port on ONU from other source list to cord-tester. |
| 6027 | """ |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 6028 | |
| 6029 | num_subscribers = 1 |
| 6030 | num_channels = 1 |
| 6031 | services = ('IGMP') |
| 6032 | cbs = (self.igmp_flow_check_group_include_source_empty_list, None, None) |
| 6033 | self.voltha_subscribers(services, cbs = cbs, src_list = ['0'], |
| 6034 | num_subscribers = num_subscribers, |
| 6035 | num_channels = num_channels) |
| 6036 | |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 6037 | def test_subscribers_with_voltha_for_igmp_group_exclude_empty_src_list_verifying_traffic(self): |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 6038 | """ |
| 6039 | Test Method: |
| 6040 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 6041 | 1. OLT and ONU is detected and validated. |
| 6042 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 6043 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 6044 | 4. Send igmp joins for a multicast group address multi-group-addressA with source exclude list src_listA |
| 6045 | 5. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listA on ONU. |
| 6046 | 6. Verify that multicast data packets are being recieved on join sent uni port on ONU to cord-tester. |
| 6047 | 7. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listB on ONU. |
| 6048 | 8. Verify that multicast data packets are being recieved on join sent uni port on ONU from other source list to cord-tester. |
| 6049 | """ |
| 6050 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 6051 | num_subscribers = 1 |
| 6052 | num_channels = 1 |
| 6053 | services = ('IGMP') |
| 6054 | cbs = (self.igmp_flow_check_group_exclude_source_empty_list, None, None) |
| 6055 | self.voltha_subscribers(services, cbs = cbs, src_list = ['0'], |
| 6056 | num_subscribers = num_subscribers, |
| 6057 | num_channels = num_channels) |
| 6058 | |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 6059 | def test_two_subscribers_with_voltha_for_igmp_join_verifying_traffic(self): |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 6060 | """ |
| 6061 | Test Method: |
| 6062 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 6063 | 1. OLT and ONU is detected and validated. |
| 6064 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 6065 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 6066 | 4. Send igmp joins for a multicast group address multi-group-addressA from one subscribers (uni_1 port) |
| 6067 | 5. Send igmp joins for a multicast group address multi-group-addressB from other subscribers ( uni_2 port) |
| 6068 | 6. Send multicast data traffic for a group (multi-group-addressA) from other uni_3 port on ONU. |
| 6069 | 7. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester. |
| 6070 | 8. Verify that multicast data packets are not being recieved on join sent uni (uni_2) port on ONU to cord-tester. |
| 6071 | """ |
| 6072 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 6073 | num_subscribers = 2 |
| 6074 | num_channels = 1 |
| 6075 | services = ('IGMP') |
| 6076 | cbs = (self.igmp_flow_check, None, None) |
| 6077 | self.voltha_subscribers(services, cbs = cbs, src_list = ['1.2.3.4'], |
| 6078 | num_subscribers = num_subscribers, |
| 6079 | num_channels = num_channels) |
| 6080 | |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 6081 | def test_two_subscribers_with_voltha_for_igmp_join_leave_for_one_subscriber_verifying_traffic(self): |
| 6082 | """ |
| 6083 | Test Method: |
| 6084 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 6085 | 1. OLT and ONU is detected and validated. |
| 6086 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 6087 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 6088 | 4. Send igmp joins for a multicast group address multi-group-addressA from one subscribers (uni_1 port) |
| 6089 | 5. Send igmp joins for a multicast group address multi-group-addressA from other subscribers ( uni_2 port) |
| 6090 | 6. Send multicast data traffic for a group (multi-group-addressA) from other uni_3 port on ONU. |
| 6091 | 7. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester. |
| 6092 | 8. Verify that multicast data packets are being recieved on join sent uni (uni_2) port on ONU to cord-tester. |
| 6093 | 9. Send igmp leave for a multicast group address multi-group-addressA from other subscribers ( uni_2 port) |
| 6094 | 10. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester. |
| 6095 | 11. Verify that multicast data packets are not being recieved on join sent uni (uni_2) port on ONU to cord-tester. |
| 6096 | """ |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 6097 | num_subscribers = 2 |
Thangavelu K S | 9a63733 | 2017-08-01 23:22:23 +0000 | [diff] [blame] | 6098 | num_channels = 1 |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 6099 | services = ('IGMP') |
| 6100 | cbs = (self.igmp_flow_check_join_change_to_exclude, None, None) |
| 6101 | self.voltha_subscribers(services, cbs = cbs, src_list = ['1.2.3.4','2.3.4.5'], |
| 6102 | num_subscribers = num_subscribers, |
| 6103 | num_channels = num_channels) |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 6104 | |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 6105 | def test_two_subscribers_with_voltha_for_igmp_leave_join_for_one_subscriber_verifying_traffic(self): |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 6106 | """ |
| 6107 | Test Method: |
| 6108 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 6109 | 1. OLT and ONU is detected and validated. |
| 6110 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 6111 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 6112 | 4. Send igmp joins for a multicast group address multi-group-addressA from one subscribers (uni_1 port) |
| 6113 | 5. Send igmp leave for a multicast group address multi-group-addressB from other subscribers ( uni_2 port) |
| 6114 | 6. Send multicast data traffic for a group (multi-group-addressA) from other uni_3 port on ONU. |
| 6115 | 7. Verify that multicast group adress (multi-group-addressA) data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester. |
| 6116 | 8. Verify that multicast group adress (multi-group-addressB) data packets are not being recieved on join sent uni (uni_2) port on ONU to cord-tester. |
| 6117 | 9. Send igmp join for a multicast group address multi-group-addressA from other subscribers ( uni_2 port) |
| 6118 | 10. Verify that multicast of group (multi-group-addressA) data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester. |
| 6119 | 11. Verify that multicast of group (multi-group-addressA) data packets are being recieved on join sent uni (uni_2) port on ONU to cord-tester. |
| 6120 | 12. Verify that multicast of group (multi-group-addressB) data packets are not being recieved on join sent uni (uni_2) port on ONU to cord-tester. |
| 6121 | """ |
| 6122 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 6123 | num_subscribers = 2 |
Thangavelu K S | 9a63733 | 2017-08-01 23:22:23 +0000 | [diff] [blame] | 6124 | num_channels = 1 |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 6125 | services = ('IGMP') |
| 6126 | cbs = (self.igmp_flow_check_join_change_to_exclude_again_include_back, None, None) |
| 6127 | self.voltha_subscribers(services, cbs = cbs, src_list = ['1.2.3.4', '3.4.5.6'], |
| 6128 | num_subscribers = num_subscribers, |
| 6129 | num_channels = num_channels) |
| 6130 | |
| 6131 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 6132 | def test_two_subscribers_with_voltha_for_igmp_with_uni_port_down_for_one_subscriber_verifying_traffic(self): |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 6133 | """ |
| 6134 | Test Method: |
| 6135 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 6136 | 1. OLT and ONU is detected and validated. |
| 6137 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 6138 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 6139 | 4. Send igmp joins for a multicast group address multi-group-addressA from one subscribers (uni_1 port) |
| 6140 | 5. Send igmp joins for a multicast group address multi-group-addressA from other subscribers ( uni_2 port) |
| 6141 | 6. Send multicast data traffic for a group (multi-group-addressA) from other uni_3 port on ONU. |
| 6142 | 7. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester. |
| 6143 | 8. Verify that multicast data packets are being recieved on join sent uni (uni_2) port on ONU to cord-tester. |
| 6144 | 9. Disable uni_2 port which is being shown on voltha CLI. |
| 6145 | 10. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester. |
| 6146 | 11. Verify that multicast data packets are not being recieved on join sent uni (uni_2) port on ONU to cord-tester. |
| 6147 | """ |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 6148 | #rx_port = self.port_map['ports'][port_list[i][1]] |
| 6149 | df = defer.Deferred() |
| 6150 | def igmp_flow_check_operating_onu_admin_state(df): |
| 6151 | num_subscribers = 2 |
Thangavelu K S | 9a63733 | 2017-08-01 23:22:23 +0000 | [diff] [blame] | 6152 | num_channels = 1 |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 6153 | services = ('IGMP') |
| 6154 | cbs = (self.igmp_flow_check_during_olt_onu_operational_issues, None, None) |
| 6155 | port_list = self.generate_port_list(num_subscribers, num_channels) |
| 6156 | |
Thangavelu K S | 9a63733 | 2017-08-01 23:22:23 +0000 | [diff] [blame] | 6157 | thread1 = threading.Thread(target = self.voltha_subscribers, args = (services, cbs, 2, 1, ['1.2.3.4', '3.4.5.6'],)) |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 6158 | thread2 = threading.Thread(target = self.voltha_uni_port_toggle, args = (self.port_map['ports'][port_list[1][1]],)) |
| 6159 | thread1.start() |
| 6160 | time.sleep(randint(40,50)) |
| 6161 | log_test.info('Admin state of uni port is down and up after delay of 30 sec during tls auth flow check on voltha') |
| 6162 | thread2.start() |
| 6163 | time.sleep(10) |
| 6164 | thread1.join() |
| 6165 | thread2.join() |
| 6166 | try: |
| 6167 | assert_equal(self.success, False) |
| 6168 | log_test.info('Igmp flow check expected to fail, hence ignore the test_status of igmp flow check') |
| 6169 | time.sleep(10) |
| 6170 | finally: |
| 6171 | pass |
| 6172 | df.callback(0) |
| 6173 | reactor.callLater(0, igmp_flow_check_operating_onu_admin_state, df) |
| 6174 | return df |
| 6175 | |
| 6176 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 6177 | def test_two_subscribers_with_voltha_for_igmp_toggling_uni_port_for_one_subscriber_and_verifying_traffic(self): |
| 6178 | """ |
| 6179 | Test Method: |
| 6180 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 6181 | 1. OLT and ONU is detected and validated. |
| 6182 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 6183 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 6184 | 4. Send igmp joins for a multicast group address multi-group-addressA from one subscribers (uni_1 port) |
| 6185 | 5. Send igmp joins for a multicast group address multi-group-addressA from other subscribers ( uni_2 port) |
| 6186 | 6. Send multicast data traffic for a group (multi-group-addressA) from other uni_3 port on ONU. |
| 6187 | 7. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester. |
| 6188 | 8. Verify that multicast data packets are being recieved on join sent uni (uni_2) port on ONU to cord-tester. |
| 6189 | 9. Disable uni_2 port which is being shown on voltha CLI. |
| 6190 | 10. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester. |
| 6191 | 11. Verify that multicast data packets are not being recieved on join sent uni (uni_2) port on ONU to cord-tester. |
| 6192 | 12. Enable uni_2 port which we disable at step 9. |
| 6193 | 13. Repeat step 5,6 and 8. |
| 6194 | """ |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 6195 | df = defer.Deferred() |
| 6196 | def igmp_flow_check_operating_onu_admin_state(df): |
| 6197 | num_subscribers = 2 |
Thangavelu K S | 9a63733 | 2017-08-01 23:22:23 +0000 | [diff] [blame] | 6198 | num_channels = 1 |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 6199 | services = ('IGMP') |
| 6200 | cbs = (self.igmp_flow_check, None, None) |
| 6201 | port_list = self.generate_port_list(num_subscribers, num_channels) |
| 6202 | |
Thangavelu K S | 9a63733 | 2017-08-01 23:22:23 +0000 | [diff] [blame] | 6203 | thread1 = threading.Thread(target = self.voltha_subscribers, args = (services, cbs, 2, 1, ['1.2.3.4', '3.4.5.6'],)) |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 6204 | thread2 = threading.Thread(target = self.voltha_uni_port_toggle, args = (self.port_map['ports'][port_list[1][1]],)) |
| 6205 | thread1.start() |
| 6206 | time.sleep(randint(50,60)) |
| 6207 | log_test.info('Admin state of uni port is down and up after delay of 30 sec during tls auth flow check on voltha') |
| 6208 | thread2.start() |
| 6209 | time.sleep(10) |
| 6210 | thread1.join() |
| 6211 | thread2.join() |
| 6212 | try: |
| 6213 | assert_equal(self.success, True) |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 6214 | log_test.info('Igmp flow check expected to fail during UNI port down only, after UNI port is up it should be successful') |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 6215 | time.sleep(10) |
| 6216 | finally: |
| 6217 | pass |
| 6218 | df.callback(0) |
| 6219 | reactor.callLater(0, igmp_flow_check_operating_onu_admin_state, df) |
| 6220 | return df |
| 6221 | |
| 6222 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 6223 | def test_two_subscribers_with_voltha_for_igmp_disabling_olt_verifying_traffic(self): |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 6224 | """ |
| 6225 | Test Method: |
| 6226 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 6227 | 1. OLT and ONU is detected and validated. |
| 6228 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 6229 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 6230 | 4. Send igmp joins for a multicast group address multi-group-addressA from one subscribers (uni_1 port) |
| 6231 | 5. Send igmp joins for a multicast group address multi-group-addressA from other subscribers ( uni_2 port) |
| 6232 | 6. Send multicast data traffic for a group (multi-group-addressA) from other uni_3 port on ONU. |
| 6233 | 7. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester. |
| 6234 | 8. Verify that multicast data packets are being recieved on join sent uni (uni_2) port on ONU to cord-tester. |
| 6235 | 9. Disable olt device which is being shown on voltha CLI. |
| 6236 | 10. Verify that multicast data packets are not being recieved on join sent uni (uni_1) port on ONU to cord-tester. |
| 6237 | 11. Verify that multicast data packets are not being recieved on join sent uni (uni_2) port on ONU to cord-tester. |
| 6238 | """ |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 6239 | df = defer.Deferred() |
| 6240 | def igmp_flow_check_operating_olt_admin_disble(df): |
| 6241 | num_subscribers = 2 |
Thangavelu K S | 9a63733 | 2017-08-01 23:22:23 +0000 | [diff] [blame] | 6242 | num_channels = 1 |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 6243 | services = ('IGMP') |
| 6244 | cbs = (self.igmp_flow_check_during_olt_onu_operational_issues, None, None) |
| 6245 | port_list = self.generate_port_list(num_subscribers, num_channels) |
| 6246 | |
Thangavelu K S | 9a63733 | 2017-08-01 23:22:23 +0000 | [diff] [blame] | 6247 | thread1 = threading.Thread(target = self.voltha_subscribers, args = (services, cbs, 2, 1, ['1.2.3.4', '3.4.5.6'],)) |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 6248 | thread1.start() |
| 6249 | time.sleep(randint(50,60)) |
| 6250 | thread2 = threading.Thread(target = self.voltha.disable_device, args = (self.olt_device_id, False,)) |
| 6251 | thread2.start() |
| 6252 | time.sleep(10) |
| 6253 | thread1.join() |
| 6254 | thread2.join() |
| 6255 | try: |
| 6256 | assert_equal(self.success, False) |
| 6257 | log_test.info('Igmp flow check expected to fail during olt device is disabled, so ignored test_status of this test') |
| 6258 | time.sleep(10) |
| 6259 | finally: |
| 6260 | pass |
| 6261 | df.callback(0) |
| 6262 | reactor.callLater(0, igmp_flow_check_operating_olt_admin_disble, df) |
| 6263 | return df |
| 6264 | |
| 6265 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 6266 | def test_two_subscribers_with_voltha_for_igmp_pausing_olt_verifying_traffic(self): |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 6267 | """ |
| 6268 | Test Method: |
| 6269 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 6270 | 1. OLT and ONU is detected and validated. |
| 6271 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 6272 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 6273 | 4. Send igmp joins for a multicast group address multi-group-addressA from one subscribers (uni_1 port) |
| 6274 | 5. Send igmp joins for a multicast group address multi-group-addressA from other subscribers ( uni_2 port) |
| 6275 | 6. Send multicast data traffic for a group (multi-group-addressA) from other uni_3 port on ONU. |
| 6276 | 7. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester. |
| 6277 | 8. Verify that multicast data packets are being recieved on join sent uni (uni_2) port on ONU to cord-tester. |
| 6278 | 9. Pause olt device which is being shown on voltha CLI. |
| 6279 | 10. Verify that multicast data packets are not being recieved on join sent uni (uni_1) port on ONU to cord-tester. |
| 6280 | 11. Verify that multicast data packets are not being recieved on join sent uni (uni_2) port on ONU to cord-tester. |
| 6281 | """ |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 6282 | df = defer.Deferred() |
| 6283 | def igmp_flow_check_operating_olt_admin_pause(df): |
| 6284 | num_subscribers = 2 |
Thangavelu K S | 9a63733 | 2017-08-01 23:22:23 +0000 | [diff] [blame] | 6285 | num_channels = 1 |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 6286 | services = ('IGMP') |
| 6287 | cbs = (self.igmp_flow_check_during_olt_onu_operational_issues, None, None) |
| 6288 | port_list = self.generate_port_list(num_subscribers, num_channels) |
| 6289 | |
Thangavelu K S | 9a63733 | 2017-08-01 23:22:23 +0000 | [diff] [blame] | 6290 | thread1 = threading.Thread(target = self.voltha_subscribers, args = (services, cbs, 2, 1, ['1.2.3.4', '3.4.5.6'],)) |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 6291 | thread1.start() |
| 6292 | time.sleep(randint(50,60)) |
| 6293 | thread2 = threading.Thread(target = self.voltha.pause_device, args = (self.olt_device_id,)) |
| 6294 | thread2.start() |
| 6295 | time.sleep(10) |
| 6296 | thread1.join() |
| 6297 | thread2.join() |
| 6298 | try: |
| 6299 | assert_equal(self.success, False) |
| 6300 | log_test.info('Igmp flow check expected to fail during olt device is paused, so ignored test_status of this test') |
| 6301 | time.sleep(10) |
| 6302 | finally: |
| 6303 | pass |
| 6304 | df.callback(0) |
| 6305 | reactor.callLater(0, igmp_flow_check_operating_olt_admin_pause, df) |
| 6306 | return df |
| 6307 | |
| 6308 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 6309 | def test_two_subscribers_with_voltha_for_igmp_toggling_olt_verifying_traffic(self): |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 6310 | """ |
| 6311 | Test Method: |
| 6312 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 6313 | 1. OLT and ONU is detected and validated. |
| 6314 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 6315 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 6316 | 4. Send igmp joins for a multicast group address multi-group-addressA from one subscribers (uni_1 port) |
| 6317 | 5. Send igmp joins for a multicast group address multi-group-addressA from other subscribers ( uni_2 port) |
| 6318 | 6. Send multicast data traffic for a group (multi-group-addressA) from other uni_3 port on ONU. |
| 6319 | 7. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester. |
| 6320 | 8. Verify that multicast data packets are being recieved on join sent uni (uni_2) port on ONU to cord-tester. |
| 6321 | 9. Disable olt device which is being shown on voltha CLI. |
| 6322 | 10. Verify that multicast data packets are not being recieved on join sent uni (uni_1) port on ONU to cord-tester. |
| 6323 | 11. Verify that multicast data packets are not being recieved on join sent uni (uni_2) port on ONU to cord-tester. |
| 6324 | 12. Enable olt device which is disable at step 9. |
| 6325 | 13. Repeat steps 4,5, 7 and 8. |
| 6326 | """ |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 6327 | df = defer.Deferred() |
| 6328 | def igmp_flow_check_operating_olt_admin_restart(df): |
| 6329 | num_subscribers = 2 |
Thangavelu K S | 9a63733 | 2017-08-01 23:22:23 +0000 | [diff] [blame] | 6330 | num_channels = 1 |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 6331 | services = ('IGMP') |
| 6332 | cbs = (self.igmp_flow_check, None, None) |
| 6333 | port_list = self.generate_port_list(num_subscribers, num_channels) |
| 6334 | |
Thangavelu K S | 9a63733 | 2017-08-01 23:22:23 +0000 | [diff] [blame] | 6335 | thread1 = threading.Thread(target = self.voltha_subscribers, args = (services, cbs, 2, 1, ['1.2.3.4', '3.4.5.6'],)) |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 6336 | thread1.start() |
| 6337 | time.sleep(randint(50,60)) |
| 6338 | thread2 = threading.Thread(target = self.voltha.restart_device, args = (self.olt_device_id,)) |
| 6339 | thread2.start() |
| 6340 | time.sleep(10) |
| 6341 | thread1.join() |
| 6342 | thread2.join() |
| 6343 | try: |
| 6344 | assert_equal(self.success, True) |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 6345 | log_test.info('Igmp flow check expected to fail during olt device restart, After OLT device is up, it should be successful') |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 6346 | time.sleep(10) |
| 6347 | finally: |
| 6348 | pass |
| 6349 | df.callback(0) |
| 6350 | reactor.callLater(0, igmp_flow_check_operating_olt_admin_restart, df) |
| 6351 | return df |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 6352 | |
| 6353 | @deferred(TESTCASE_TIMEOUT) |
| 6354 | def test_two_subscribers_with_voltha_for_igmp_multiple_times_disabling_olt_verifying_traffic(self): |
| 6355 | """ |
| 6356 | Test Method: |
| 6357 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 6358 | 1. OLT and ONU is detected and validated. |
| 6359 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 6360 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 6361 | 4. Send igmp joins for a multicast group address multi-group-addressA from one subscribers (uni_1 port) |
| 6362 | 5. Send igmp joins for a multicast group address multi-group-addressA from other subscribers ( uni_2 port) |
| 6363 | 6. Send multicast data traffic for a group (multi-group-addressA) from other uni_3 port on ONU. |
| 6364 | 7. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester. |
| 6365 | 8. Verify that multicast data packets are being recieved on join sent uni (uni_2) port on ONU to cord-tester. |
| 6366 | 9. Disable olt device which is being shown on voltha CLI. |
| 6367 | 10. Verify that multicast data packets are not being recieved on join sent uni (uni_1) port on ONU to cord-tester. |
| 6368 | 11. Verify that multicast data packets are not being recieved on join sent uni (uni_2) port on ONU to cord-tester. |
| 6369 | 12. Repeat steps 4 to 11 steps multiple times (example 20 times) |
| 6370 | """ |
| 6371 | df = defer.Deferred() |
| 6372 | no_iterations = 20 |
| 6373 | def igmp_flow_check_operating_olt_admin_disble(df): |
| 6374 | num_subscribers = 2 |
Thangavelu K S | 9a63733 | 2017-08-01 23:22:23 +0000 | [diff] [blame] | 6375 | num_channels = 1 |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 6376 | services = ('IGMP') |
| 6377 | cbs = (self.igmp_flow_check, None, None) |
| 6378 | port_list = self.generate_port_list(num_subscribers, num_channels) |
| 6379 | |
Thangavelu K S | 9a63733 | 2017-08-01 23:22:23 +0000 | [diff] [blame] | 6380 | thread1 = threading.Thread(target = self.voltha_subscribers, args = (services, cbs, 2, 1, ['1.2.3.4', '3.4.5.6'],)) |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 6381 | thread1.start() |
| 6382 | time.sleep(randint(30,40)) |
| 6383 | for i in range(no_iterations): |
| 6384 | thread2 = threading.Thread(target = self.voltha.disable_device, args = (self.olt_device_id, False,)) |
| 6385 | thread2.start() |
| 6386 | time.sleep(8) |
| 6387 | thread2.join() |
| 6388 | thread1.join() |
| 6389 | thread1.isAlive() |
| 6390 | thread2.join() |
| 6391 | try: |
| 6392 | assert_equal(self.success, False) |
| 6393 | log_test.info('Igmp flow check expected to fail during olt device is disabled, so ignored test_status of this test') |
| 6394 | time.sleep(10) |
| 6395 | finally: |
| 6396 | pass |
| 6397 | df.callback(0) |
| 6398 | reactor.callLater(0, igmp_flow_check_operating_olt_admin_disble, df) |
| 6399 | return df |
| 6400 | |
| 6401 | @deferred(TESTCASE_TIMEOUT + 200) |
| 6402 | def test_two_subscribers_with_voltha_for_igmp_multiple_times_toggling_uni_port_for_one_subscriber_verifying_traffic(self): |
| 6403 | """ |
| 6404 | Test Method: |
| 6405 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 6406 | 1. OLT and ONU is detected and validated. |
| 6407 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 6408 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 6409 | 4. Send igmp joins for a multicast group address multi-group-addressA from one subscribers (uni_1 port) |
| 6410 | 5. Send igmp joins for a multicast group address multi-group-addressA from other subscribers ( uni_2 port) |
| 6411 | 6. Send multicast data traffic for a group (multi-group-addressA) from other uni_3 port on ONU. |
| 6412 | 7. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester. |
| 6413 | 8. Verify that multicast data packets are being recieved on join sent uni (uni_2) port on ONU to cord-tester. |
| 6414 | 9. Disable uni_2 port which is being shown on voltha CLI. |
| 6415 | 10. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester. |
| 6416 | 11. Verify that multicast data packets are not being recieved on join sent uni (uni_2) port on ONU to cord-tester. |
| 6417 | 12. Enable uni_2 port which we disable at step 9. |
| 6418 | 13. Repeat step 5,6 and 8. |
| 6419 | 14. Repeat steps 4 to 13 steps multiple times (example 5 times) |
| 6420 | """ |
| 6421 | df = defer.Deferred() |
| 6422 | no_iterations = 5 |
| 6423 | def igmp_flow_check_operating_onu_admin_state(df): |
| 6424 | num_subscribers = 2 |
Thangavelu K S | 9a63733 | 2017-08-01 23:22:23 +0000 | [diff] [blame] | 6425 | num_channels = 1 |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 6426 | services = ('IGMP') |
| 6427 | cbs = (self.igmp_flow_check, None, None) |
| 6428 | port_list = self.generate_port_list(num_subscribers, num_channels) |
| 6429 | |
Thangavelu K S | 9a63733 | 2017-08-01 23:22:23 +0000 | [diff] [blame] | 6430 | thread1 = threading.Thread(target = self.voltha_subscribers, args = (services, cbs, 2, 1, ['1.2.3.4', '3.4.5.6'],)) |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 6431 | thread1.start() |
| 6432 | time.sleep(randint(40,60)) |
| 6433 | for i in range(no_iterations): |
| 6434 | thread2 = threading.Thread(target = self.voltha_uni_port_toggle, args = (self.port_map['ports'][port_list[1][1]],)) |
| 6435 | log_test.info('Admin state of uni port is down and up after delay of 30 sec during igmp flow check on voltha') |
| 6436 | thread2.start() |
| 6437 | time.sleep(1) |
| 6438 | thread2.join() |
| 6439 | thread1.isAlive() |
| 6440 | thread1.join() |
| 6441 | thread2.join() |
| 6442 | try: |
| 6443 | assert_equal(self.success, True) |
| 6444 | log_test.info('Igmp flow check expected to fail during UNI port down only, after UNI port is up it should be successful') |
| 6445 | time.sleep(10) |
| 6446 | finally: |
| 6447 | pass |
| 6448 | df.callback(0) |
| 6449 | reactor.callLater(0, igmp_flow_check_operating_onu_admin_state, df) |
| 6450 | return df |
| 6451 | |
| 6452 | @deferred(TESTCASE_TIMEOUT) |
| 6453 | def test_two_subscribers_with_voltha_for_igmp_multiple_times_toggling_olt_verifying_traffic(self): |
| 6454 | """ |
| 6455 | Test Method: |
| 6456 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 6457 | 1. OLT and ONU is detected and validated. |
| 6458 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 6459 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 6460 | 4. Send igmp joins for a multicast group address multi-group-addressA from one subscribers (uni_1 port) |
| 6461 | 5. Send igmp joins for a multicast group address multi-group-addressA from other subscribers ( uni_2 port) |
| 6462 | 6. Send multicast data traffic for a group (multi-group-addressA) from other uni_3 port on ONU. |
| 6463 | 7. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester. |
| 6464 | 8. Verify that multicast data packets are being recieved on join sent uni (uni_2) port on ONU to cord-tester. |
| 6465 | 9. Disable olt device which is being shown on voltha CLI. |
| 6466 | 10. Verify that multicast data packets are not being recieved on join sent uni (uni_1) port on ONU to cord-tester. |
| 6467 | 11. Verify that multicast data packets are not being recieved on join sent uni (uni_2) port on ONU to cord-tester. |
| 6468 | 12. Enable olt device which is disable at step 9. |
| 6469 | 13. Repeat steps 4,5, 7 and 8. |
| 6470 | 14. Repeat steps 4 to 13 steps multiple times (example 10 times) |
| 6471 | """ |
| 6472 | df = defer.Deferred() |
| 6473 | no_iterations = 10 |
| 6474 | def igmp_flow_check_operating_olt_admin_restart(df): |
| 6475 | num_subscribers = 2 |
Thangavelu K S | 9a63733 | 2017-08-01 23:22:23 +0000 | [diff] [blame] | 6476 | num_channels = 1 |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 6477 | services = ('IGMP') |
| 6478 | cbs = (self.igmp_flow_check, None, None) |
| 6479 | port_list = self.generate_port_list(num_subscribers, num_channels) |
| 6480 | |
Thangavelu K S | 9a63733 | 2017-08-01 23:22:23 +0000 | [diff] [blame] | 6481 | thread1 = threading.Thread(target = self.voltha_subscribers, args = (services, cbs, 2, 1, ['1.2.3.4', '3.4.5.6'],)) |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 6482 | thread1.start() |
| 6483 | time.sleep(randint(50,60)) |
| 6484 | for i in range(no_iterations): |
| 6485 | thread2 = threading.Thread(target = self.voltha.restart_device, args = (self.olt_device_id,)) |
| 6486 | thread2.start() |
| 6487 | time.sleep(10) |
| 6488 | thread2.join() |
| 6489 | thread1.join() |
| 6490 | thread2.join() |
| 6491 | try: |
| 6492 | assert_equal(self.success, True) |
| 6493 | log_test.info('Igmp flow check expected to fail during olt device restart, after OLT device is up, it should be successful') |
| 6494 | time.sleep(10) |
| 6495 | finally: |
| 6496 | pass |
| 6497 | df.callback(0) |
| 6498 | reactor.callLater(0, igmp_flow_check_operating_olt_admin_restart, df) |
| 6499 | return df |
| 6500 | |
Thangavelu K S and Chetan Gaonker | e07a7b4 | 2017-08-23 17:43:31 +0000 | [diff] [blame] | 6501 | def test_five_subscribers_with_voltha_for_igmp_with_ten_group_joins_verifying_traffic(self): |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 6502 | """ |
| 6503 | Test Method: |
| 6504 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 6505 | 1. OLT and ONU is detected and validated. |
| 6506 | 2. Issue multiple tls auth packets from CORD TESTER voltha test module acting as subscribers.. |
| 6507 | 3. Issue multiple dhcp client packets to get IP address from dhcp server for as subscribers and check connectivity. |
| 6508 | 4. Send multiple igmp joins for 10 multicast group addresses multi-group-addressA,multi-group-addressB etc |
| 6509 | 5. Send multicast data traffic for two groups (multi-group-addressA and multi-group-addressB) from other uni port on ONU. |
| 6510 | 6. Verify that 2 groups multicast data packets are being recieved on join sent uni port on ONU to cord-tester. |
| 6511 | """ |
| 6512 | |
| 6513 | num_subscribers = 5 |
| 6514 | num_channels = 10 |
| 6515 | services = ('IGMP') |
| 6516 | cbs = (self.igmp_flow_check, None, None) |
| 6517 | self.voltha_subscribers(services, cbs = cbs, |
| 6518 | num_subscribers = num_subscribers, |
| 6519 | num_channels = num_channels) |
| 6520 | |
Thangavelu K S and Chetan Gaonker | e07a7b4 | 2017-08-23 17:43:31 +0000 | [diff] [blame] | 6521 | def test_nine_subscribers_with_voltha_for_igmp_with_ten_group_joins_and_verify_traffic(self): |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 6522 | """ |
| 6523 | Test Method: |
| 6524 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 6525 | 1. OLT and ONU is detected and validated. |
| 6526 | 2. Issue multiple tls auth packets from CORD TESTER voltha test module acting as subscribers.. |
| 6527 | 3. Issue multiple dhcp client packets to get IP address from dhcp server for subscribers and check connectivity. |
| 6528 | 4. Send multiple igmp joins for 10 multicast group addresses multi-group-addressA,multi-group-addressB etc |
| 6529 | 5. Send multicast data traffic for two groups (multi-group-addressA and multi-group-addressB) from other uni port on ONU. |
| 6530 | 6. Verify that 2 groups multicast data packets are being recieved on join sent uni port on ONU to cord-tester. |
| 6531 | """ |
| 6532 | num_subscribers = 9 |
| 6533 | num_channels = 10 |
| 6534 | services = ('IGMP') |
| 6535 | cbs = (self.igmp_flow_check, None, None) |
| 6536 | self.voltha_subscribers(services, cbs = cbs, |
| 6537 | num_subscribers = num_subscribers, |
| 6538 | num_channels = num_channels) |