A R Karthick | 35495c3 | 2017-05-11 14:58:32 -0700 | [diff] [blame] | 1 | import os |
| 2 | import sys |
| 3 | import unittest |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 4 | import time, monotonic |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 5 | import json |
| 6 | import requests |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 7 | import threading |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 8 | from IGMP import * |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 9 | from random import randint |
| 10 | from threading import Timer |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 11 | from threadPool import ThreadPool |
A R Karthick | 35495c3 | 2017-05-11 14:58:32 -0700 | [diff] [blame] | 12 | from nose.tools import * |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 13 | from nose.twistedtools import reactor, deferred |
| 14 | from twisted.internet import defer |
A R Karthick | 9dc6e92 | 2017-07-12 14:40:16 -0700 | [diff] [blame] | 15 | from CordTestConfig import setup_module, teardown_module |
A R Karthick | 35495c3 | 2017-05-11 14:58:32 -0700 | [diff] [blame] | 16 | from CordTestUtils import log_test |
A R Karthick | caa1b6a | 2017-07-27 14:07:05 -0700 | [diff] [blame] | 17 | from VolthaCtrl import VolthaCtrl, voltha_setup, voltha_teardown |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 18 | from CordTestUtils import log_test, get_controller |
| 19 | from portmaps import g_subscriber_port_map |
| 20 | from OltConfig import * |
| 21 | from EapTLS import TLSAuthTest |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 22 | from Channels import Channels, IgmpChannel |
| 23 | from Stats import Stats |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 24 | from DHCP import DHCPTest |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 25 | from OnosCtrl import OnosCtrl |
| 26 | from CordLogger import CordLogger |
| 27 | from scapy.all import * |
| 28 | from scapy_ssl_tls.ssl_tls import * |
| 29 | from scapy_ssl_tls.ssl_tls_crypto import * |
| 30 | 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] | 31 | from CordContainer import Onos |
A R Karthick | 35495c3 | 2017-05-11 14:58:32 -0700 | [diff] [blame] | 32 | |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 33 | |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 34 | class Voltha_olt_subscribers(Channels): |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 35 | |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 36 | STATS_RX = 0 |
| 37 | STATS_TX = 1 |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 38 | STATS_JOIN = 2 |
| 39 | STATS_LEAVE = 3 |
| 40 | |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 41 | def __init__(self, tx_port, rx_port, num_channels =1, channel_start = 0, src_list = None): |
| 42 | self.tx_port = tx_port |
| 43 | self.rx_port = rx_port |
| 44 | self.src_list = src_list |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 45 | self.num_channels = num_channels |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 46 | try: |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 47 | self.tx_intf = tx_port |
| 48 | self.rx_intf = rx_port |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 49 | except: |
| 50 | self.tx_intf = self.INTF_TX_DEFAULT |
| 51 | self.rx_intf = self.INTF_RX_DEFAULT |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 52 | # num = 1 |
| 53 | # channel_start = 0 |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 54 | mcast_cb = None |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 55 | 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] | 56 | iface = self.rx_intf, iface_mcast = self.tx_intf, mcast_cb = mcast_cb) |
| 57 | |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 58 | self.loginType = 'wireless' |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 59 | ##start streaming channels |
| 60 | self.join_map = {} |
| 61 | ##accumulated join recv stats |
| 62 | self.join_rx_stats = Stats() |
| 63 | self.recv_timeout = False |
| 64 | |
| 65 | |
| 66 | def channel_join_update(self, chan, join_time): |
| 67 | self.join_map[chan] = ( Stats(), Stats(), Stats(), Stats() ) |
| 68 | self.channel_update(chan, self.STATS_JOIN, 1, t = join_time) |
| 69 | |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 70 | 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] | 71 | '''Join a channel and create a send/recv stats map''' |
| 72 | if self.join_map.has_key(chan): |
| 73 | del self.join_map[chan] |
| 74 | self.delay = delay |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 75 | chan, join_time = self.join(chan, src_list = src_list, record_type = record_type) |
| 76 | #chan, join_time = self.join(chan) |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 77 | self.channel_join_update(chan, join_time) |
| 78 | return chan |
| 79 | |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 80 | 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] | 81 | '''Joins the next channel leaving the last channel''' |
| 82 | if self.last_chan: |
| 83 | if self.join_map.has_key(self.last_chan): |
| 84 | del self.join_map[self.last_chan] |
| 85 | self.delay = delay |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 86 | 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] | 87 | self.channel_join_update(chan, join_time) |
| 88 | return chan |
| 89 | |
| 90 | def channel_jump(self, delay = 2): |
| 91 | '''Jumps randomly to the next channel leaving the last channel''' |
| 92 | if self.last_chan is not None: |
| 93 | if self.join_map.has_key(self.last_chan): |
| 94 | del self.join_map[self.last_chan] |
| 95 | self.delay = delay |
| 96 | chan, join_time = self.jump() |
| 97 | self.channel_join_update(chan, join_time) |
| 98 | return chan |
| 99 | |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 100 | def channel_leave(self, chan = 0, force = False, src_list = None): |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 101 | if self.join_map.has_key(chan): |
| 102 | del self.join_map[chan] |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 103 | self.leave(chan, force = force, src_list = src_list) |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 104 | |
| 105 | def channel_update(self, chan, stats_type, packets, t=0): |
| 106 | if type(chan) == type(0): |
| 107 | chan_list = (chan,) |
| 108 | else: |
| 109 | chan_list = chan |
| 110 | for c in chan_list: |
| 111 | if self.join_map.has_key(c): |
| 112 | self.join_map[c][stats_type].update(packets = packets, t = t) |
| 113 | |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 114 | 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] | 115 | 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] | 116 | (self.rx_intf, self.gaddr(chan), chan)) |
| 117 | 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] | 118 | if len(r) == 0: |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 119 | log_test.info('Subscriber on port %s timed out' %( self.rx_intf)) |
| 120 | self.test_status = False |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 121 | else: |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 122 | self.test_status = True |
| 123 | pass |
| 124 | # 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] | 125 | if self.recv_timeout: |
| 126 | ##Negative test case is disabled for now |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 127 | 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] | 128 | assert_equal(len(r), 0) |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 129 | self.test_status = True |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 130 | return self.test_status |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 131 | |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 132 | def recv_channel_cb(self, pkt, src_list = None): |
| 133 | |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 134 | ##First verify that we have received the packet for the joined instance |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 135 | log_test.info('Packet received for group %s, subscriber, port %s showing full packet %s'% |
| 136 | (pkt[IP].dst, self.rx_intf, pkt.show)) |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 137 | if self.recv_timeout: |
| 138 | return |
| 139 | chan = self.caddr(pkt[IP].dst) |
| 140 | assert_equal(chan in self.join_map.keys(), True) |
| 141 | recv_time = monotonic.monotonic() * 1000000 |
| 142 | join_time = self.join_map[chan][self.STATS_JOIN].start |
| 143 | delta = recv_time - join_time |
| 144 | self.join_rx_stats.update(packets=1, t = delta, usecs = True) |
| 145 | self.channel_update(chan, self.STATS_RX, 1, t = delta) |
| 146 | log_test.debug('Packet received in %.3f usecs for group %s after join' %(delta, pkt[IP].dst)) |
| 147 | |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 148 | class voltha_subscriber_pool: |
| 149 | |
| 150 | def __init__(self, subscriber, test_cbs): |
| 151 | self.subscriber = subscriber |
| 152 | self.test_cbs = test_cbs |
| 153 | |
| 154 | def pool_cb(self): |
| 155 | for cb in self.test_cbs: |
| 156 | if cb: |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 157 | self.test_status = cb(self.subscriber, multiple_sub = True) |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 158 | if self.test_status is not True: |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 159 | ## This is chaining for other sub status has to check again |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 160 | self.test_status = True |
| 161 | log_test.info('This service is failed and other services will not run for this subscriber') |
| 162 | break |
| 163 | log_test.info('This Subscriber is tested for multiple service eligibility ') |
| 164 | self.test_status = True |
| 165 | |
A R Karthick | 35495c3 | 2017-05-11 14:58:32 -0700 | [diff] [blame] | 166 | class voltha_exchange(unittest.TestCase): |
| 167 | |
| 168 | OLT_TYPE = 'tibit_olt' |
| 169 | OLT_MAC = '00:0c:e2:31:12:00' |
| 170 | VOLTHA_HOST = 'localhost' |
| 171 | VOLTHA_REST_PORT = 8881 |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 172 | VOLTHA_OLT_TYPE = 'ponsim_olt' |
| 173 | VOLTHA_OLT_MAC = '00:0c:e2:31:12:00' |
| 174 | VOLTHA_IGMP_ITERATIONS = 100 |
A R Karthick | 35495c3 | 2017-05-11 14:58:32 -0700 | [diff] [blame] | 175 | voltha = None |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 176 | voltha_attrs = None |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 177 | success = True |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 178 | olt_device_id = None |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 179 | apps = ('org.opencord.aaa', 'org.onosproject.dhcp', 'org.onosproject.dhcprelay') |
| 180 | app_dhcp = ('org.onosproject.dhcp') |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 181 | olt_apps = () #'org.opencord.cordmcast') |
| 182 | vtn_app = 'org.opencord.vtn' |
| 183 | table_app = 'org.ciena.cordigmp' |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 184 | test_path = os.path.dirname(os.path.realpath(__file__)) |
| 185 | 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] | 186 | 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] | 187 | 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] | 188 | olt_app_name = 'org.onosproject.olt' |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 189 | #onos_config_path = os.path.join(test_path, '..', 'setup/onos-config') |
| 190 | olt_conf_file = os.getenv('OLT_CONFIG_FILE', os.path.join(test_path, '..', 'setup/olt_config.json')) |
| 191 | onos_restartable = bool(int(os.getenv('ONOS_RESTART', 0))) |
A R Karthick | 9dc6e92 | 2017-07-12 14:40:16 -0700 | [diff] [blame] | 192 | VOLTHA_AUTO_CONFIGURE = False |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 193 | num_joins = 0 |
| 194 | |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 195 | relay_interfaces_last = () |
| 196 | interface_to_mac_map = {} |
| 197 | host_ip_map = {} |
| 198 | default_config = { 'default-lease-time' : 600, 'max-lease-time' : 7200, } |
| 199 | default_options = [ ('subnet-mask', '255.255.255.0'), |
| 200 | ('broadcast-address', '192.168.1.255'), |
| 201 | ('domain-name-servers', '192.168.1.1'), |
| 202 | ('domain-name', '"mydomain.cord-tester"'), |
| 203 | ] |
| 204 | ##specify the IP for the dhcp interface matching the subnet and subnet config |
| 205 | ##this is done for each interface dhcpd server would be listening on |
| 206 | default_subnet_config = [ ('192.168.1.2', |
| 207 | ''' |
| 208 | subnet 192.168.1.0 netmask 255.255.255.0 { |
| 209 | range 192.168.1.10 192.168.1.100; |
| 210 | } |
| 211 | '''), ] |
| 212 | |
| 213 | |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 214 | VOLTHA_ENABLED = True |
| 215 | INTF_TX_DEFAULT = 'veth2' |
| 216 | INTF_RX_DEFAULT = 'veth0' |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 217 | INTF_2_RX_DEFAULT = 'veth6' |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 218 | TESTCASE_TIMEOUT = 300 |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 219 | VOLTHA_IGMP_ITERATIONS = 10 |
| 220 | # VOLTHA_CONFIG_FAKE = True |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 221 | VOLTHA_CONFIG_FAKE = False |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 222 | VOLTHA_UPLINK_VLAN_MAP = { 'of:0000000000000001' : '222' } |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 223 | VOLTHA_UPLINK_VLAN_START = 444 |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 224 | VOLTHA_ONU_UNI_PORT = 'veth0' |
| 225 | |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 226 | dhcp_server_config = { |
| 227 | "ip": "10.1.11.50", |
| 228 | "mac": "ca:fe:ca:fe:ca:fe", |
| 229 | "subnet": "255.255.252.0", |
| 230 | "broadcast": "10.1.11.255", |
| 231 | "router": "10.1.8.1", |
| 232 | "domain": "8.8.8.8", |
| 233 | "ttl": "63", |
| 234 | "delay": "2", |
| 235 | "startip": "10.1.11.51", |
| 236 | "endip": "10.1.11.100" |
| 237 | } |
| 238 | |
| 239 | |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 240 | CLIENT_CERT = """-----BEGIN CERTIFICATE----- |
| 241 | MIICuDCCAiGgAwIBAgIBAjANBgkqhkiG9w0BAQUFADCBizELMAkGA1UEBhMCVVMx |
| 242 | CzAJBgNVBAgTAkNBMRIwEAYDVQQHEwlTb21ld2hlcmUxEzARBgNVBAoTCkNpZW5h |
| 243 | IEluYy4xHjAcBgkqhkiG9w0BCQEWD2FkbWluQGNpZW5hLmNvbTEmMCQGA1UEAxMd |
| 244 | RXhhbXBsZSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMTYwNjA2MjExMjI3WhcN |
| 245 | MTcwNjAxMjExMjI3WjBnMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExEzARBgNV |
| 246 | BAoTCkNpZW5hIEluYy4xFzAVBgNVBAMUDnVzZXJAY2llbmEuY29tMR0wGwYJKoZI |
| 247 | hvcNAQkBFg51c2VyQGNpZW5hLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkC |
| 248 | gYEAwvXiSzb9LZ6c7uNziUfKvoHO7wu/uiFC5YUpXbmVGuGZizbVrny0xnR85Dfe |
| 249 | +9R4diansfDhIhzOUl1XjN3YDeSS9OeF5YWNNE8XDhlz2d3rVzaN6hIhdotBkUjg |
| 250 | rUewjTg5OFR31QEyG3v8xR3CLgiE9xQELjZbSA07pD79zuUCAwEAAaNPME0wEwYD |
| 251 | VR0lBAwwCgYIKwYBBQUHAwIwNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL3d3dy5l |
| 252 | eGFtcGxlLmNvbS9leGFtcGxlX2NhLmNybDANBgkqhkiG9w0BAQUFAAOBgQDAjkrY |
| 253 | 6tDChmKbvr8w6Du/t8vHjTCoCIocHTN0qzWOeb1YsAGX89+TrWIuO1dFyYd+Z0KC |
| 254 | PDKB5j/ygml9Na+AklSYAVJIjvlzXKZrOaPmhZqDufi+rXWti/utVqY4VMW2+HKC |
| 255 | nXp37qWeuFLGyR1519Y1d6F/5XzqmvbwURuEug== |
| 256 | -----END CERTIFICATE-----""" |
| 257 | |
| 258 | CLIENT_CERT_INVALID = '''-----BEGIN CERTIFICATE----- |
| 259 | MIIDvTCCAqWgAwIBAgIBAjANBgkqhkiG9w0BAQUFADCBizELMAkGA1UEBhMCVVMx |
| 260 | CzAJBgNVBAgTAkNBMRIwEAYDVQQHEwlTb21ld2hlcmUxEzARBgNVBAoTCkNpZW5h |
| 261 | IEluYy4xHjAcBgkqhkiG9w0BCQEWD2FkbWluQGNpZW5hLmNvbTEmMCQGA1UEAxMd |
| 262 | RXhhbXBsZSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMTYwMzExMTg1MzM2WhcN |
| 263 | MTcwMzA2MTg1MzM2WjBnMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExEzARBgNV |
| 264 | BAoTCkNpZW5hIEluYy4xFzAVBgNVBAMUDnVzZXJAY2llbmEuY29tMR0wGwYJKoZI |
| 265 | hvcNAQkBFg51c2VyQGNpZW5hLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC |
| 266 | AQoCggEBAOxemcBsPn9tZsCa5o2JA6sQDC7A6JgCNXXl2VFzKLNNvB9PS6D7ZBsQ |
| 267 | 5An0zEDMNzi51q7lnrYg1XyiE4S8FzMGAFr94RlGMQJUbRD9V/oqszMX4k++iAOK |
| 268 | tIA1gr3x7Zi+0tkjVSVzXTmgNnhChAamdMsjYUG5+CY9WAicXyy+VEV3zTphZZDR |
| 269 | OjcjEp4m/TSXVPYPgYDXI40YZKX5BdvqykWtT/tIgZb48RS1NPyN/XkCYzl3bv21 |
| 270 | qx7Mc0fcEbsJBIIRYTUkfxnsilcnmLxSYO+p+DZ9uBLBzcQt+4Rd5pLSfi21WM39 |
| 271 | 2Z2oOi3vs/OYAPAqgmi2JWOv3mePa/8CAwEAAaNPME0wEwYDVR0lBAwwCgYIKwYB |
| 272 | BQUHAwIwNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL3d3dy5leGFtcGxlLmNvbS9l |
| 273 | eGFtcGxlX2NhLmNybDANBgkqhkiG9w0BAQUFAAOCAQEALBzMPDTIB6sLyPl0T6JV |
| 274 | MjOkyldAVhXWiQsTjaGQGJUUe1cmUJyZbUZEc13MygXMPOM4x7z6VpXGuq1c/Vxn |
| 275 | VzQ2fNnbJcIAHi/7G8W5/SQfPesIVDsHTEc4ZspPi5jlS/MVX3HOC+BDbOjdbwqP |
| 276 | RX0JEr+uOyhjO+lRxG8ilMRACoBUbw1eDuVDoEBgErSUC44pq5ioDw2xelc+Y6hQ |
| 277 | dmtYwfY0DbvwxHtA495frLyPcastDiT/zre7NL51MyUDPjjYjghNQEwvu66IKbQ3 |
| 278 | T1tJBrgI7/WI+dqhKBFolKGKTDWIHsZXQvZ1snGu/FRYzg1l+R/jT8cRB9BDwhUt |
| 279 | yg== |
| 280 | -----END CERTIFICATE-----''' |
A R Karthick | 35495c3 | 2017-05-11 14:58:32 -0700 | [diff] [blame] | 281 | |
A.R Karthick | 3493a57 | 2017-06-07 18:28:10 -0700 | [diff] [blame] | 282 | @classmethod |
| 283 | def update_apps_version(cls): |
| 284 | version = Onos.getVersion() |
| 285 | major = int(version.split('.')[0]) |
| 286 | minor = int(version.split('.')[1]) |
| 287 | cordigmp_app_version = '2.0-SNAPSHOT' |
| 288 | olt_app_version = '1.2-SNAPSHOT' |
| 289 | if major > 1: |
| 290 | cordigmp_app_version = '3.0-SNAPSHOT' |
| 291 | olt_app_version = '2.0-SNAPSHOT' |
| 292 | elif major == 1: |
| 293 | if minor > 10: |
| 294 | cordigmp_app_version = '3.0-SNAPSHOT' |
| 295 | olt_app_version = '2.0-SNAPSHOT' |
| 296 | elif minor <= 8: |
| 297 | olt_app_version = '1.1-SNAPSHOT' |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 298 | cls.app_file = os.path.join(cls.test_path, '..', 'apps/ciena-cordigmp-{}.oar'.format(cordigmp_app_version)) |
| 299 | cls.table_app_file = os.path.join(cls.test_path, '..', 'apps/ciena-cordigmp-multitable-{}.oar'.format(cordigmp_app_version)) |
| 300 | cls.olt_app_file = os.path.join(cls.test_path, '..', 'apps/olt-app-{}.oar'.format(olt_app_version)) |
| 301 | |
A R Karthick | 35495c3 | 2017-05-11 14:58:32 -0700 | [diff] [blame] | 302 | @classmethod |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 303 | def dhcprelay_setUpClass(cls): |
| 304 | ''' Activate the dhcprelay app''' |
| 305 | OnosCtrl(cls.app_dhcp).deactivate() |
| 306 | time.sleep(3) |
| 307 | cls.onos_ctrl = OnosCtrl('org.onosproject.dhcprelay') |
| 308 | status, _ = cls.onos_ctrl.activate() |
| 309 | assert_equal(status, True) |
| 310 | time.sleep(3) |
| 311 | cls.dhcp_relay_setup() |
| 312 | ##start dhcpd initially with default config |
| 313 | cls.dhcpd_start() |
| 314 | |
| 315 | @classmethod |
| 316 | def dhcprelay_tearDownClass(cls): |
| 317 | '''Deactivate the dhcp relay app''' |
| 318 | try: |
| 319 | os.unlink('{}/dhcpd.conf'.format(cls.dhcp_data_dir)) |
| 320 | os.unlink('{}/dhcpd.leases'.format(cls.dhcp_data_dir)) |
| 321 | except: pass |
| 322 | cls.onos_ctrl.deactivate() |
| 323 | cls.dhcpd_stop() |
| 324 | cls.dhcp_relay_cleanup() |
| 325 | |
| 326 | @classmethod |
A.R Karthick | f874d03 | 2017-06-07 18:47:51 -0700 | [diff] [blame] | 327 | def onos_load_config(cls, app, config): |
| 328 | status, code = OnosCtrl.config(config) |
| 329 | if status is False: |
| 330 | log_test.info('JSON config request for app %s returned status %d' %(app, code)) |
| 331 | assert_equal(status, True) |
| 332 | time.sleep(2) |
| 333 | |
| 334 | @classmethod |
| 335 | def onos_aaa_load(cls): |
| 336 | aaa_dict = {'apps' : { 'org.opencord.aaa' : { 'AAA' : { 'radiusSecret': 'radius_password', |
| 337 | 'radiusIp': '172.17.0.2' } } } } |
| 338 | radius_ip = os.getenv('ONOS_AAA_IP') or '172.17.0.2' |
| 339 | aaa_dict['apps']['org.opencord.aaa']['AAA']['radiusIp'] = radius_ip |
| 340 | cls.onos_load_config('org.opencord.aaa', aaa_dict) |
| 341 | |
| 342 | @classmethod |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 343 | def onos_dhcp_table_load(self, config = None): |
| 344 | dhcp_dict = {'apps' : { 'org.onosproject.dhcp' : { 'dhcp' : copy.copy(self.dhcp_server_config) } } } |
| 345 | dhcp_config = dhcp_dict['apps']['org.onosproject.dhcp']['dhcp'] |
| 346 | if config: |
| 347 | for k in config.keys(): |
| 348 | if dhcp_config.has_key(k): |
| 349 | dhcp_config[k] = config[k] |
| 350 | self.onos_load_config('org.onosproject.dhcp', dhcp_dict) |
| 351 | |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 352 | 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] | 353 | if validation: |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 354 | cip, sip = dhcp.discover(mac = mac, update_seed = update_seed) |
| 355 | assert_not_equal(cip, None) |
| 356 | assert_not_equal(sip, None) |
| 357 | log_test.info('Got dhcp client IP %s from server %s for mac %s' % |
| 358 | (cip, sip, dhcp.get_mac(cip)[0])) |
| 359 | if validation == False: |
| 360 | cip, sip = dhcp.discover(mac = mac, update_seed = update_seed) |
| 361 | assert_equal(cip, None) |
| 362 | assert_equal(sip, None) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 363 | log_test.info('Dhcp client did not get IP from server') |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 364 | |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 365 | if validation == 'skip': |
| 366 | cip, sip = dhcp.discover(mac = mac, update_seed = update_seed) |
| 367 | |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 368 | return cip,sip |
| 369 | |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 370 | 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): |
| 371 | config = {'startip':startip, 'endip':'10.10.10.200', |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 372 | 'ip':'10.10.10.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 373 | 'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'} |
| 374 | self.onos_dhcp_table_load(config) |
| 375 | dhcp = DHCPTest(seed_ip = seed_ip, iface =onu_iface) |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 376 | 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] | 377 | return cip, sip |
| 378 | |
| 379 | @classmethod |
A R Karthick | 35495c3 | 2017-05-11 14:58:32 -0700 | [diff] [blame] | 380 | def setUpClass(cls): |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 381 | cls.update_apps_version() |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 382 | cls.voltha_attrs = dict(host = cls.VOLTHA_HOST, |
| 383 | rest_port = cls.VOLTHA_REST_PORT, |
| 384 | uplink_vlan_map = cls.VOLTHA_UPLINK_VLAN_MAP, |
| 385 | uplink_vlan_start = cls.VOLTHA_UPLINK_VLAN_START) |
| 386 | cls.voltha = VolthaCtrl(**cls.voltha_attrs) |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 387 | cls.install_app_table() |
| 388 | cls.olt = OltConfig(olt_conf_file = cls.olt_conf_file) |
| 389 | cls.port_map, cls.port_list = cls.olt.olt_port_map() |
| 390 | cls.switches = cls.port_map['switches'] |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 391 | cls.ponsim_ports = cls.port_map['ponsim'] |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 392 | cls.num_ports = cls.port_map['num_ports'] |
| 393 | if cls.num_ports > 1: |
| 394 | cls.num_ports -= 1 ##account for the tx port |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 395 | cls.activate_apps(cls.apps + cls.olt_apps, deactivate = True) |
A.R Karthick | f874d03 | 2017-06-07 18:47:51 -0700 | [diff] [blame] | 396 | cls.onos_aaa_load() |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 397 | |
A.R Karthick | 3493a57 | 2017-06-07 18:28:10 -0700 | [diff] [blame] | 398 | @classmethod |
| 399 | def tearDownClass(cls): |
| 400 | '''Deactivate the olt apps and restart OVS back''' |
| 401 | apps = cls.olt_apps + ( cls.table_app,) |
| 402 | for app in apps: |
| 403 | onos_ctrl = OnosCtrl(app) |
| 404 | onos_ctrl.deactivate() |
| 405 | cls.install_app_igmp() |
A.R Karthick | 3493a57 | 2017-06-07 18:28:10 -0700 | [diff] [blame] | 406 | @classmethod |
| 407 | def install_app_igmp(cls): |
| 408 | ##Uninstall the table app on class exit |
| 409 | OnosCtrl.uninstall_app(cls.table_app) |
| 410 | time.sleep(2) |
| 411 | log_test.info('Installing back the cord igmp app %s for subscriber test on exit' %(cls.app_file)) |
| 412 | OnosCtrl.install_app(cls.app_file) |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 413 | |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 414 | def remove_olt(self, switch_map): |
| 415 | controller = get_controller() |
| 416 | auth = ('karaf', 'karaf') |
| 417 | #remove subscriber for every port on all the voltha devices |
| 418 | for device, device_map in switch_map.iteritems(): |
| 419 | uni_ports = device_map['ports'] |
| 420 | uplink_vlan = device_map['uplink_vlan'] |
| 421 | for port in uni_ports: |
| 422 | rest_url = 'http://{}:8181/onos/olt/oltapp/{}/{}'.format(controller, |
| 423 | device, |
| 424 | port) |
| 425 | resp = requests.delete(rest_url, auth = auth) |
| 426 | if resp.status_code not in [204, 202, 200]: |
| 427 | log_test.error('Error deleting subscriber for device %s on port %s' %(device, port)) |
| 428 | else: |
| 429 | log_test.info('Deleted subscriber for device %s on port %s' %(device, port)) |
| 430 | OnosCtrl.uninstall_app(self.olt_app_file) |
| 431 | |
| 432 | def config_olt(self, switch_map): |
| 433 | controller = get_controller() |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 434 | auth = ('karaf', 'karaf') |
| 435 | #configure subscriber for every port on all the voltha devices |
| 436 | for device, device_map in switch_map.iteritems(): |
| 437 | uni_ports = device_map['ports'] |
| 438 | uplink_vlan = device_map['uplink_vlan'] |
| 439 | for port in uni_ports: |
| 440 | vlan = port |
| 441 | rest_url = 'http://{}:8181/onos/olt/oltapp/{}/{}/{}'.format(controller, |
| 442 | device, |
| 443 | port, |
| 444 | vlan) |
| 445 | resp = requests.post(rest_url, auth = auth) |
| 446 | #assert_equal(resp.ok, True) |
| 447 | |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 448 | def voltha_uni_port_toggle(self, uni_port = None): |
| 449 | ## Admin state of port is down and up |
| 450 | if not uni_port: |
| 451 | uni_port = self.INTF_RX_DEFAULT |
| 452 | cmd = 'ifconfig {} down'.format(uni_port) |
| 453 | os.system(cmd) |
| 454 | log_test.info('Admin state of uni_port is down') |
| 455 | time.sleep(30) |
| 456 | cmd = 'ifconfig {} up'.format(uni_port) |
| 457 | os.system(cmd) |
| 458 | log_test.info('Admin state of uni_port is up now') |
| 459 | time.sleep(30) |
| 460 | return |
| 461 | |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 462 | @classmethod |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 463 | def install_app_table(cls): |
| 464 | ##Uninstall the existing app if any |
| 465 | OnosCtrl.uninstall_app(cls.table_app) |
| 466 | time.sleep(2) |
| 467 | log_test.info('Installing the multi table app %s for subscriber test' %(cls.table_app_file)) |
| 468 | OnosCtrl.install_app(cls.table_app_file) |
| 469 | time.sleep(3) |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 470 | |
| 471 | @classmethod |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 472 | def activate_apps(cls, apps, deactivate = False): |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 473 | for app in apps: |
| 474 | onos_ctrl = OnosCtrl(app) |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 475 | if deactivate is True: |
| 476 | onos_ctrl.deactivate() |
| 477 | time.sleep(2) |
| 478 | status, _ = onos_ctrl.activate() |
| 479 | assert_equal(status, True) |
| 480 | time.sleep(2) |
| 481 | |
| 482 | |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 483 | |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 484 | @classmethod |
| 485 | def deactivate_apps(cls, apps): |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 486 | cls.success = True |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 487 | for app in apps: |
| 488 | onos_ctrl = OnosCtrl(app) |
| 489 | status, _ = onos_ctrl.deactivate() |
| 490 | if status is False: |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 491 | cls.success = False |
| 492 | # assert_equal(status, True) |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 493 | time.sleep(2) |
| 494 | |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 495 | def random_ip(self,start_ip = '10.10.10.20', end_ip = '10.10.10.65'): |
| 496 | start = list(map(int, start_ip.split("."))) |
| 497 | end = list(map(int, end_ip.split("."))) |
| 498 | temp = start |
| 499 | ip_range = [] |
| 500 | ip_range.append(start_ip) |
| 501 | while temp != end: |
| 502 | start[3] += 1 |
| 503 | for i in (3, 2, 1): |
| 504 | if temp[i] == 255: |
| 505 | temp[i] = 0 |
| 506 | temp[i-1] += 1 |
| 507 | ip_range.append(".".join(map(str, temp))) |
| 508 | return random.choice(ip_range) |
| 509 | |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 510 | def random_mcast_ip(self,start_ip = '224.0.1.0', end_ip = '224.0.1.100'): |
| 511 | start = list(map(int, start_ip.split("."))) |
| 512 | end = list(map(int, end_ip.split("."))) |
| 513 | temp = start |
| 514 | ip_range = [] |
| 515 | ip_range.append(start_ip) |
| 516 | while temp != end: |
| 517 | start[3] += 1 |
| 518 | for i in (3, 2, 1): |
| 519 | if temp[i] == 255: |
| 520 | temp[i] = 0 |
| 521 | temp[i-1] += 1 |
| 522 | ip_range.append(".".join(map(str, temp))) |
| 523 | return random.choice(ip_range) |
| 524 | |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 525 | @classmethod |
| 526 | def dhcp_relay_setup(cls): |
| 527 | #did = OnosCtrl.get_device_id() |
| 528 | #cls.relay_device_id = did |
| 529 | #cls.olt = OltConfig(olt_conf_file = cls.olt_conf_file) |
| 530 | #cls.port_map, _ = cls.olt.olt_port_map() self.port_map['ports'][port_list[1][1]] |
| 531 | if cls.port_map: |
| 532 | ##Per subscriber, we use 1 relay port |
| 533 | try: |
| 534 | relay_port = cls.port_map['ports'] |
| 535 | except: |
| 536 | relay_port = cls.port_map['uplink'] |
| 537 | cls.relay_interface_port = relay_port |
| 538 | cls.relay_interfaces = (cls.port_map[cls.relay_interface_port],) |
| 539 | else: |
| 540 | # cls.relay_interface_port = 100 |
| 541 | # cls.relay_interfaces = (g_subscriber_port_map[cls.relay_interface_port],) |
| 542 | log_test.info('No ONU ports are available, hence returning nothing') |
| 543 | cls.relay_interfaces_last = cls.relay_interfaces |
| 544 | if cls.port_map: |
| 545 | ##generate a ip/mac client virtual interface config for onos |
| 546 | interface_list = [] |
| 547 | for port in cls.port_map['ports']: |
| 548 | port_num = cls.port_map[port] |
| 549 | if port_num == cls.port_map['uplink']: |
| 550 | continue |
| 551 | ip = cls.get_host_ip(port_num) |
| 552 | mac = cls.get_mac(port) |
| 553 | interface_list.append((port_num, ip, mac)) |
| 554 | |
| 555 | #configure dhcp server virtual interface on the same subnet as first client interface |
| 556 | relay_ip = cls.get_host_ip(interface_list[0][0]) |
| 557 | relay_mac = cls.get_mac(cls.port_map[cls.relay_interface_port]) |
| 558 | interface_list.append((cls.relay_interface_port, relay_ip, relay_mac)) |
| 559 | cls.onos_interface_load(interface_list) |
| 560 | |
| 561 | @classmethod |
| 562 | def onos_interface_load(cls, interface_list): |
| 563 | interface_dict = { 'ports': {} } |
| 564 | for port_num, ip, mac in interface_list: |
| 565 | port_map = interface_dict['ports'] |
| 566 | port = '{}/{}'.format(cls.relay_device_id, port_num) |
| 567 | port_map[port] = { 'interfaces': [] } |
| 568 | interface_list = port_map[port]['interfaces'] |
| 569 | interface_map = { 'ips' : [ '{}/{}'.format(ip, 24) ], |
| 570 | 'mac' : mac, |
| 571 | 'name': 'vir-{}'.format(port_num) |
| 572 | } |
| 573 | interface_list.append(interface_map) |
| 574 | |
| 575 | cls.onos_load_config(interface_dict) |
| 576 | cls.configs['interface_config'] = interface_dict |
| 577 | |
| 578 | @classmethod |
| 579 | def get_host_ip(cls, port): |
| 580 | if cls.host_ip_map.has_key(port): |
| 581 | return cls.host_ip_map[port] |
| 582 | cls.host_ip_map[port] = '192.168.1.{}'.format(port) |
| 583 | return cls.host_ip_map[port] |
| 584 | |
| 585 | @classmethod |
| 586 | def host_load(cls, iface): |
| 587 | '''Have ONOS discover the hosts for dhcp-relay responses''' |
| 588 | port = g_subscriber_port_map[iface] |
| 589 | host = '173.17.1.{}'.format(port) |
| 590 | cmds = ( 'ifconfig {} 0'.format(iface), |
| 591 | 'ifconfig {0} {1}'.format(iface, host), |
| 592 | 'arping -I {0} {1} -c 2'.format(iface, host), |
| 593 | 'ifconfig {} 0'.format(iface), ) |
| 594 | for c in cmds: |
| 595 | os.system(c) |
| 596 | |
| 597 | @classmethod |
| 598 | def dhcpd_conf_generate(cls, config = default_config, options = default_options, |
| 599 | subnet = default_subnet_config): |
| 600 | conf = '' |
| 601 | for k, v in config.items(): |
| 602 | conf += '{} {};\n'.format(k, v) |
| 603 | |
| 604 | opts = '' |
| 605 | for k, v in options: |
| 606 | opts += 'option {} {};\n'.format(k, v) |
| 607 | |
| 608 | subnet_config = '' |
| 609 | for _, v in subnet: |
| 610 | subnet_config += '{}\n'.format(v) |
| 611 | |
| 612 | return '{}{}{}'.format(conf, opts, subnet_config) |
| 613 | |
| 614 | @classmethod |
| 615 | def dhcpd_start(cls, intf_list = None, |
| 616 | config = default_config, options = default_options, |
| 617 | subnet = default_subnet_config): |
| 618 | '''Start the dhcpd server by generating the conf file''' |
| 619 | if intf_list is None: |
| 620 | intf_list = cls.relay_interfaces |
| 621 | ##stop dhcpd if already running |
| 622 | cls.dhcpd_stop() |
| 623 | dhcp_conf = cls.dhcpd_conf_generate(config = config, options = options, |
| 624 | subnet = subnet) |
| 625 | ##first touch dhcpd.leases if it doesn't exist |
| 626 | lease_file = '{}/dhcpd.leases'.format(cls.dhcp_data_dir) |
| 627 | if os.access(lease_file, os.F_OK) is False: |
| 628 | with open(lease_file, 'w') as fd: pass |
| 629 | |
| 630 | conf_file = '{}/dhcpd.conf'.format(cls.dhcp_data_dir) |
| 631 | with open(conf_file, 'w') as fd: |
| 632 | fd.write(dhcp_conf) |
| 633 | |
| 634 | #now configure the dhcpd interfaces for various subnets |
| 635 | index = 0 |
| 636 | intf_info = [] |
| 637 | for ip,_ in subnet: |
| 638 | intf = intf_list[index] |
| 639 | mac = cls.get_mac(intf) |
| 640 | intf_info.append((ip, mac)) |
| 641 | index += 1 |
| 642 | os.system('ifconfig {} {}'.format(intf, ip)) |
| 643 | |
| 644 | intf_str = ','.join(intf_list) |
| 645 | dhcpd_cmd = '/usr/sbin/dhcpd -4 --no-pid -cf {0} -lf {1} {2}'.format(conf_file, lease_file, intf_str) |
| 646 | log_test.info('Starting DHCPD server with command: %s' %dhcpd_cmd) |
| 647 | ret = os.system(dhcpd_cmd) |
| 648 | assert_equal(ret, 0) |
| 649 | time.sleep(3) |
| 650 | cls.relay_interfaces_last = cls.relay_interfaces |
| 651 | cls.relay_interfaces = intf_list |
| 652 | cls.onos_dhcp_relay_load(*intf_info[0]) |
| 653 | |
| 654 | @classmethod |
| 655 | def dhcpd_stop(cls): |
| 656 | os.system('pkill -9 dhcpd') |
| 657 | for intf in cls.relay_interfaces: |
| 658 | os.system('ifconfig {} 0'.format(intf)) |
| 659 | |
| 660 | cls.relay_interfaces = cls.relay_interfaces_last |
| 661 | |
| 662 | @classmethod |
| 663 | def get_mac(cls, iface): |
| 664 | if cls.interface_to_mac_map.has_key(iface): |
| 665 | return cls.interface_to_mac_map[iface] |
| 666 | mac = get_mac(iface, pad = 0) |
| 667 | cls.interface_to_mac_map[iface] = mac |
| 668 | return mac |
| 669 | |
| 670 | def send_recv(self, mac=None, update_seed = False, validate = True): |
| 671 | cip, sip = self.dhcp.discover(mac = mac, update_seed = update_seed) |
| 672 | if validate: |
| 673 | assert_not_equal(cip, None) |
| 674 | assert_not_equal(sip, None) |
| 675 | log_test.info('Got dhcp client IP %s from server %s for mac %s' % |
| 676 | (cip, sip, self.dhcp.get_mac(cip)[0])) |
| 677 | return cip,sip |
| 678 | |
| 679 | @classmethod |
| 680 | def dhcpd_conf_generate(cls, config = default_config, options = default_options, |
| 681 | subnet = default_subnet_config): |
| 682 | conf = '' |
| 683 | for k, v in config.items(): |
| 684 | conf += '{} {};\n'.format(k, v) |
| 685 | |
| 686 | opts = '' |
| 687 | for k, v in options: |
| 688 | opts += 'option {} {};\n'.format(k, v) |
| 689 | |
| 690 | subnet_config = '' |
| 691 | for _, v in subnet: |
| 692 | subnet_config += '{}\n'.format(v) |
| 693 | |
| 694 | return '{}{}{}'.format(conf, opts, subnet_config) |
| 695 | |
| 696 | @classmethod |
| 697 | def onos_dhcp_relay_load(cls, server_ip, server_mac): |
| 698 | relay_device_map = '{}/{}'.format(cls.relay_device_id, cls.relay_interface_port) |
| 699 | dhcp_dict = {'apps':{'org.onosproject.dhcp-relay':{'dhcprelay': |
| 700 | {'dhcpserverConnectPoint':relay_device_map, |
| 701 | 'serverip':server_ip, |
| 702 | 'servermac':server_mac |
| 703 | } |
| 704 | } |
| 705 | } |
| 706 | } |
| 707 | cls.onos_load_config(dhcp_dict) |
| 708 | cls.configs['relay_config'] = dhcp_dict |
| 709 | |
| 710 | @classmethod |
| 711 | def dhcp_relay_cleanup(cls): |
| 712 | ##reset the ONOS port configuration back to default |
| 713 | for config in cls.configs.items(): |
| 714 | OnosCtrl.delete(config) |
| 715 | # if cls.onos_restartable is True: |
| 716 | # log_test.info('Cleaning up dhcp relay config by restarting ONOS with default network cfg') |
| 717 | # return cord_test_onos_restart(config = {}) |
| 718 | |
| 719 | |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 720 | def tls_flow_check(self, olt_ports, cert_info = None, multiple_sub = False): |
| 721 | if multiple_sub is True: |
| 722 | olt_nni_port = olt_ports.tx_port |
| 723 | olt_uni_port = olt_ports.rx_port |
| 724 | else: |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 725 | olt_uni_port = olt_ports |
| 726 | |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 727 | def tls_fail_cb(): |
| 728 | log_test.info('TLS verification failed') |
| 729 | if cert_info is None: |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 730 | tls = TLSAuthTest(fail_cb = tls_fail_cb, intf = olt_uni_port) |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 731 | log_test.info('Running subscriber %s tls auth test with valid TLS certificate' %olt_uni_port) |
| 732 | tls.runTest() |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 733 | if tls.failTest is True: |
| 734 | self.success = False |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 735 | assert_equal(tls.failTest, False) |
| 736 | if cert_info == "no_cert": |
| 737 | tls = TLSAuthTest(fail_cb = tls_fail_cb, intf = olt_uni_port, client_cert = '') |
| 738 | log_test.info('Running subscriber %s tls auth test with no TLS certificate' %olt_uni_port) |
| 739 | tls.runTest() |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 740 | if tls.failTest is False: |
| 741 | self.success = False |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 742 | assert_equal(tls.failTest, True) |
| 743 | if cert_info == "invalid_cert": |
| 744 | tls = TLSAuthTest(fail_cb = tls_fail_cb, intf = olt_uni_port, client_cert = self.CLIENT_CERT_INVALID) |
| 745 | log_test.info('Running subscriber %s tls auth test with invalid TLS certificate' %olt_uni_port) |
| 746 | tls.runTest() |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 747 | if tls.failTest is False: |
| 748 | self.success = False |
| 749 | assert_equal(tls.failTest, True) |
| 750 | if cert_info == "same_cert": |
| 751 | tls = TLSAuthTest(fail_cb = tls_fail_cb, intf = olt_uni_port) |
| 752 | log_test.info('Running subscriber %s tls auth test with invalid TLS certificate' %olt_uni_port) |
| 753 | tls.runTest() |
| 754 | if tls.failTest is False: |
| 755 | self.success = False |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 756 | assert_equal(tls.failTest, True) |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 757 | 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] | 758 | 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] | 759 | tls = TLSAuthTest(fail_cb = tls_fail_cb, intf = olt_uni_port, client_cert = self.CLIENT_CERT_INVALID) |
| 760 | log_test.info('Running subscriber %s tls auth test with %s' %(olt_uni_port,cert_info)) |
| 761 | tls.runTest() |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 762 | if tls.failTest is False: |
| 763 | self.success = False |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 764 | assert_equal(tls.failTest, True) |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 765 | self.test_status = True |
| 766 | return self.test_status |
A R Karthick | 35495c3 | 2017-05-11 14:58:32 -0700 | [diff] [blame] | 767 | |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 768 | def dhcp_flow_check(self, olt_ports, negative_test = None, multiple_sub = False): |
| 769 | if multiple_sub is True: |
| 770 | olt_nni_port = olt_ports.tx_port |
| 771 | onu_iface = olt_ports.rx_port |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 772 | dhcp_server_startip = self.random_ip() |
| 773 | 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] | 774 | else: |
| 775 | onu_iface = olt_ports |
| 776 | dhcp_server_startip = '10.10.10.20' |
| 777 | random_mac = None |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 778 | self.success = True |
| 779 | |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 780 | if negative_test is None: |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 781 | cip, sip = self.dhcp_request(onu_iface, update_seed = True, validation = 'skip', startip = dhcp_server_startip, mac = random_mac) |
| 782 | if cip == None or sip == None: |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 783 | self.success = False |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 784 | self.test_status = False |
| 785 | assert_not_equal(cip,None) |
| 786 | assert_not_equal(sip,None) |
| 787 | else: |
| 788 | log_test.info('Subscriber %s client ip %s from server %s' %(onu_iface, cip, sip)) |
| 789 | self.test_status = True |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 790 | |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 791 | if negative_test == "interrupting_dhcp_flows": |
| 792 | 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] | 793 | if cip is not None: |
| 794 | self.success = False |
| 795 | assert_equal(cip,None) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 796 | 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] | 797 | self.test_status = True |
| 798 | |
| 799 | if negative_test == "invalid_src_mac_broadcast": |
| 800 | config = {'startip':'10.10.10.20', 'endip':'10.10.10.69', |
| 801 | 'ip':'10.10.10.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 802 | 'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'} |
| 803 | self.onos_dhcp_table_load(config) |
| 804 | self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = onu_iface) |
| 805 | 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] | 806 | |
| 807 | if cip is not None: |
| 808 | self.success = False |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 809 | 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] | 810 | assert_equal(cip,None) |
| 811 | log_test.info('ONOS dhcp server rejected client discover with invalid source mac as expected') |
| 812 | self.test_status = True |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 813 | |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 814 | if negative_test == "invalid_src_mac_multicast": |
| 815 | config = {'startip':'10.10.10.20', 'endip':'10.10.10.69', |
| 816 | 'ip':'10.10.10.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 817 | 'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'} |
| 818 | self.onos_dhcp_table_load(config) |
| 819 | self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = onu_iface) |
| 820 | 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] | 821 | if cip is not None: |
| 822 | self.success = False |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 823 | assert_equal(cip,None) |
| 824 | log_test.info('ONOS dhcp server rejected client discover with invalid source mac as expected') |
| 825 | self.test_status = True |
| 826 | |
| 827 | if negative_test == "invalid_src_mac_junk": |
| 828 | config = {'startip':'10.10.10.20', 'endip':'10.10.10.69', |
| 829 | 'ip':'10.10.10.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 830 | 'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'} |
| 831 | self.onos_dhcp_table_load(config) |
| 832 | self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = onu_iface) |
| 833 | 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] | 834 | if cip is not None: |
| 835 | self.success = False |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 836 | assert_equal(cip,None) |
| 837 | log_test.info('ONOS dhcp server rejected client discover with invalid source mac as expected') |
| 838 | self.test_status = True |
| 839 | |
| 840 | if negative_test == "request_release": |
| 841 | config = {'startip':'10.10.100.20', 'endip':'10.10.100.230', |
| 842 | 'ip':'10.10.100.2', 'mac': "ca:fe:ca:fe:8a:fe", |
| 843 | 'subnet': '255.255.255.0', 'broadcast':'10.10.100.255', 'router':'10.10.100.1'} |
| 844 | self.onos_dhcp_table_load(config) |
| 845 | self.dhcp = DHCPTest(seed_ip = '10.10.100.10', iface = onu_iface) |
| 846 | cip, sip = self.dhcp_sndrcv(self.dhcp) |
| 847 | log_test.info('Releasing ip %s to server %s' %(cip, sip)) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 848 | if not self.dhcp.release(cip): |
| 849 | self.success = False |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 850 | assert_equal(self.dhcp.release(cip), True) |
| 851 | log_test.info('Triggering DHCP discover again after release') |
| 852 | cip2, sip2 = self.dhcp_sndrcv(self.dhcp, update_seed = True) |
| 853 | log_test.info('Verifying released IP was given back on rediscover') |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 854 | if not cip == cip2: |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 855 | self.success = False |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 856 | assert_equal(cip, cip2) |
| 857 | log_test.info('Test done. Releasing ip %s to server %s' %(cip2, sip2)) |
| 858 | assert_equal(self.dhcp.release(cip2), True) |
| 859 | self.test_status = True |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 860 | |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 861 | if negative_test == "starvation_positive": |
| 862 | config = {'startip':'193.170.1.20', 'endip':'193.170.1.69', |
| 863 | 'ip':'193.170.1.2', 'mac': "ca:fe:c2:fe:cc:fe", |
| 864 | 'subnet': '255.255.255.0', 'broadcast':'192.168.1.255', 'router': '192.168.1.1'} |
| 865 | self.onos_dhcp_table_load(config) |
| 866 | self.dhcp = DHCPTest(seed_ip = '192.169.1.1', iface = onu_iface) |
| 867 | ip_map = {} |
| 868 | for i in range(10): |
| 869 | cip, sip = self.dhcp_sndrcv(self.dhcp, update_seed = True) |
| 870 | if ip_map.has_key(cip): |
| 871 | self.success = False |
| 872 | log_test.info('IP %s given out multiple times' %cip) |
| 873 | assert_equal(False, ip_map.has_key(cip)) |
| 874 | ip_map[cip] = sip |
| 875 | self.test_status = True |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 876 | |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 877 | if negative_test == "starvation_negative": |
| 878 | config = {'startip':'182.17.0.20', 'endip':'182.17.0.69', |
| 879 | 'ip':'182.17.0.2', 'mac': "ca:fe:c3:fe:ca:fe", |
| 880 | 'subnet': '255.255.255.0', 'broadcast':'182.17.0.255', 'router':'182.17.0.1'} |
| 881 | self.onos_dhcp_table_load(config) |
| 882 | self.dhcp = DHCPTest(seed_ip = '182.17.0.1', iface = onu_iface) |
| 883 | log_test.info('Verifying passitive case') |
| 884 | for x in xrange(50): |
| 885 | mac = RandMAC()._fix() |
| 886 | self.dhcp_sndrcv(self.dhcp,mac = mac) |
| 887 | log_test.info('Verifying negative case') |
| 888 | cip, sip = self.dhcp_sndrcv(self.dhcp,update_seed = True) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 889 | if cip or sip is not None: |
| 890 | self.success = False |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 891 | assert_equal(cip, None) |
| 892 | assert_equal(sip, None) |
| 893 | self.test_status = True |
| 894 | self.success = True |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 895 | |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 896 | if negative_test == "multiple_discover": |
| 897 | config = {'startip':'10.10.10.20', 'endip':'10.10.10.69', |
| 898 | 'ip':'10.10.10.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 899 | 'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'} |
| 900 | self.onos_dhcp_table_load(config) |
| 901 | self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = onu_iface) |
| 902 | cip, sip, mac, _ = self.dhcp.only_discover() |
| 903 | log_test.info('Got dhcp client IP %s from server %s for mac %s . Not going to send DHCPREQUEST.' % |
| 904 | (cip, sip, mac) ) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 905 | if cip is None: |
| 906 | self.success = False |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 907 | assert_not_equal(cip, None) |
| 908 | log_test.info('Triggering DHCP discover again.') |
| 909 | new_cip, new_sip, new_mac, _ = self.dhcp.only_discover() |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 910 | if not new_cip == cip: |
| 911 | self.success = False |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 912 | assert_equal(new_cip, cip) |
| 913 | log_test.info('client got same IP as expected when sent 2nd discovery') |
| 914 | self.test_status = True |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 915 | # self.success = True |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 916 | if negative_test == "multiple_requests": |
| 917 | config = {'startip':'10.10.10.20', 'endip':'10.10.10.69', |
| 918 | 'ip':'10.10.10.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 919 | 'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'} |
| 920 | self.onos_dhcp_table_load(config) |
| 921 | self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = onu_iface) |
| 922 | log_test.info('Sending DHCP discover and DHCP request.') |
| 923 | cip, sip = self.dhcp_sndrcv(self.dhcp,update_seed = True) |
| 924 | mac = self.dhcp.get_mac(cip)[0] |
| 925 | log_test.info("Sending DHCP request again.") |
| 926 | new_cip, new_sip = self.dhcp.only_request(cip, mac) |
| 927 | assert_equal(new_cip,cip) |
| 928 | log_test.info('server offered same IP to clain for multiple requests, as expected') |
| 929 | self.test_status = True |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 930 | # self.success = True |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 931 | if negative_test == "desired_ip_address": |
| 932 | config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', |
| 933 | 'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 934 | 'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'} |
| 935 | self.onos_dhcp_table_load(config) |
| 936 | self.dhcp = DHCPTest(seed_ip = '20.20.20.50', iface = onu_iface) |
| 937 | cip, sip, mac, _ = self.dhcp.only_discover(desired = True) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 938 | if cip or sip is None: |
| 939 | self.success = False |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 940 | assert_not_equal(cip, None) |
| 941 | log_test.info('Got dhcp client IP %s from server %s for mac %s .' % |
| 942 | (cip, sip, mac)) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 943 | if not self.dhcp.seed_ip == cip: |
| 944 | self.success = False |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 945 | assert_equal(cip,self.dhcp.seed_ip) |
| 946 | log_test.info('ONOS dhcp server offered client requested IP %s as expected'%self.dhcp.seed_ip) |
| 947 | self.test_status = True |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 948 | # self.success = True |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 949 | if negative_test == "desired_out_of_pool_ip_address": |
| 950 | config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', |
| 951 | 'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 952 | 'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'} |
| 953 | self.onos_dhcp_table_load(config) |
| 954 | self.dhcp = DHCPTest(seed_ip = '20.20.20.75', iface = onu_iface) |
| 955 | cip, sip, mac, _ = self.dhcp.only_discover(desired = True) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 956 | if cip or sip is None: |
| 957 | self.success = False |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 958 | assert_not_equal(cip, None) |
| 959 | log_test.info('Got dhcp client IP %s from server %s for mac %s .' % |
| 960 | (cip, sip, mac) ) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 961 | if self.dhcp.seed_ip == cip: |
| 962 | self.success = False |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 963 | assert_not_equal(cip,self.dhcp.seed_ip) |
| 964 | log_test.info('server offered IP from its pool of IPs when requested out of pool IP, as expected') |
| 965 | self.test_status = True |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 966 | # self.success = True |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 967 | if negative_test == "dhcp_renew": |
| 968 | config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', |
| 969 | 'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 970 | 'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'} |
| 971 | self.onos_dhcp_table_load(config) |
| 972 | self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = onu_iface) |
| 973 | cip, sip, mac, _ = self.dhcp.only_discover() |
| 974 | log_test.info('Got dhcp client IP %s from server %s for mac %s .' % |
| 975 | (cip, sip, mac) ) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 976 | if cip or sip is None: |
| 977 | self.success = False |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 978 | assert_not_equal(cip, None) |
| 979 | new_cip, new_sip, lval = self.dhcp.only_request(cip, mac, renew_time = True) |
| 980 | log_test.info('waiting renew time %d seconds to send next request packet'%lval) |
| 981 | time.sleep(lval) |
| 982 | 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] | 983 | if not latest_cip == cip: |
| 984 | self.success = False |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 985 | assert_equal(latest_cip,cip) |
| 986 | 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] | 987 | self.test_status = True |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 988 | # self.success = True |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 989 | if negative_test == "dhcp_rebind": |
| 990 | config = {'startip':'20.20.20.30', 'endip':'20.20.20.69', |
| 991 | 'ip':'20.20.20.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 992 | 'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'} |
| 993 | self.onos_dhcp_table_load(config) |
| 994 | self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = onu_iface) |
| 995 | cip, sip, mac, _ = self.dhcp.only_discover() |
| 996 | log_test.info('Got dhcp client IP %s from server %s for mac %s .' % |
| 997 | (cip, sip, mac) ) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 998 | if cip or sip is None: |
| 999 | self.success = False |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 1000 | assert_not_equal(cip, None) |
| 1001 | new_cip, new_sip, lval = self.dhcp.only_request(cip, mac, rebind_time = True) |
| 1002 | log_test.info('waiting rebind time %d seconds to send next request packet'%lval) |
| 1003 | time.sleep(lval) |
| 1004 | latest_cip, latest_sip = self.dhcp.only_request(new_cip, mac) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 1005 | if not latest_cip == cip: |
| 1006 | self.success = False |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 1007 | assert_equal(latest_cip,cip) |
| 1008 | 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] | 1009 | self.test_status = True |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 1010 | # self.success = True |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 1011 | return self.test_status |
| 1012 | |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 1013 | def recv_channel_cb(self, pkt): |
| 1014 | ##First verify that we have received the packet for the joined instance |
| 1015 | chan = self.subscriber.caddr(pkt[IP].dst) |
| 1016 | assert_equal(chan in self.subscriber.join_map.keys(), True) |
| 1017 | recv_time = monotonic.monotonic() * 1000000 |
| 1018 | join_time = self.subscriber.join_map[chan][self.subscriber.STATS_JOIN].start |
| 1019 | delta = recv_time - join_time |
| 1020 | self.subscriber.join_rx_stats.update(packets=1, t = delta, usecs = True) |
| 1021 | self.subscriber.channel_update(chan, self.subscriber.STATS_RX, 1, t = delta) |
| 1022 | log_test.debug('Packet received in %.3f usecs for group %s after join' %(delta, pkt[IP].dst)) |
| 1023 | self.test_status = True |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 1024 | |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 1025 | def traffic_verify(self, subscriber): |
| 1026 | # if subscriber.has_service('TRAFFIC'): |
| 1027 | url = 'http://www.google.com' |
| 1028 | resp = requests.get(url) |
| 1029 | self.test_status = resp.ok |
| 1030 | if resp.ok == False: |
| 1031 | log_test.info('Subscriber %s failed get from url %s with status code %d' |
| 1032 | %(subscriber.name, url, resp.status_code)) |
| 1033 | else: |
| 1034 | log_test.info('GET request from %s succeeded for subscriber %s' |
| 1035 | %(url, subscriber.name)) |
| 1036 | return self.test_status |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 1037 | |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 1038 | def igmp_flow_check(self, subscriber, multiple_sub = False): |
| 1039 | chan = 0 |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 1040 | for i in range(self.VOLTHA_IGMP_ITERATIONS + subscriber.num_channels): |
| 1041 | if subscriber.num_channels == 1: |
| 1042 | chan = subscriber.channel_join(chan, delay = 2, src_list = subscriber.src_list) |
| 1043 | else: |
| 1044 | chan = subscriber.channel_join_next(delay = 2, src_list = subscriber.src_list) |
| 1045 | self.num_joins += 1 |
| 1046 | while self.num_joins < self.num_subscribers: |
| 1047 | time.sleep(5) |
| 1048 | log_test.info('All subscribers have joined the channel') |
| 1049 | # for i in range(1): |
| 1050 | time.sleep(0.5) |
| 1051 | self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 1, src_list = subscriber.src_list) |
| 1052 | #log_test.info('Leaving channel %d for subscriber on port %s' %(chan, subscriber.rx_port)) |
| 1053 | #subscriber.channel_leave(chan, src_list = subscriber.src_list) |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 1054 | time.sleep(5) |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 1055 | # log_test.info('Interface %s Join RX stats for subscriber, %s' %(subscriber.iface,subscriber.join_rx_stats)) |
| 1056 | if subscriber.num_channels == 1: |
| 1057 | pass |
| 1058 | elif chan != 0: |
| 1059 | #Should not receive packets for this channel |
| 1060 | self.recv_timeout = True |
| 1061 | subscriber.recv_timeout = True |
| 1062 | subscriber.channel_receive(chan-1, cb = subscriber.recv_channel_cb, count = 1, src_list = subscriber.src_list) |
| 1063 | subscriber.recv_timeout = False |
| 1064 | self.recv_timeout = False |
| 1065 | # log_test.info('Joining channel %d for subscriber port %s' %(chan, subscriber.rx_port)) |
| 1066 | # subscriber.channel_join(chan, delay = 2, src_list = subscriber.src_list) |
| 1067 | chan = subscriber.num_channels - i |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 1068 | # self.test_status = True |
| 1069 | return self.test_status |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 1070 | |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 1071 | def igmp_leave_flow_check(self, subscriber, multiple_sub = False): |
| 1072 | chan = 0 |
| 1073 | for i in range(self.VOLTHA_IGMP_ITERATIONS): |
| 1074 | subscriber.channel_join(chan, delay = 2, src_list = subscriber.src_list) |
| 1075 | self.num_joins += 1 |
| 1076 | while self.num_joins < self.num_subscribers: |
| 1077 | time.sleep(5) |
| 1078 | log_test.info('All subscribers have joined the channel') |
| 1079 | # for i in range(1): |
| 1080 | time.sleep(0.5) |
| 1081 | self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 1, src_list = subscriber.src_list) |
| 1082 | log_test.info('Leaving channel %d for subscriber on port %s' %(chan, subscriber.rx_port)) |
| 1083 | subscriber.channel_leave(chan, src_list = subscriber.src_list) |
| 1084 | time.sleep(10) |
| 1085 | # log_test.info('Interface %s Join RX stats for subscriber, %s' %(subscriber.iface,subscriber.join_rx_stats)) |
| 1086 | #Should not receive packets for this subscriber |
| 1087 | self.recv_timeout = True |
| 1088 | subscriber.recv_timeout = True |
| 1089 | subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 1, src_list = subscriber.src_list) |
| 1090 | subscriber.recv_timeout = False |
| 1091 | self.recv_timeout = False |
| 1092 | # log_test.info('Joining channel %d for subscriber port %s' %(chan, subscriber.rx_port)) |
| 1093 | # subscriber.channel_join(chan, delay = 2, src_list = subscriber.src_list) |
| 1094 | # self.test_status = True |
| 1095 | return self.test_status |
| 1096 | |
| 1097 | |
| 1098 | |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 1099 | def igmp_flow_check_join_change_to_exclude(self, subscriber, multiple_sub = False): |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 1100 | chan = 2 |
| 1101 | subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list) |
| 1102 | self.num_joins += 1 |
| 1103 | while self.num_joins < self.num_subscribers: |
| 1104 | time.sleep(5) |
| 1105 | log_test.info('All subscribers have joined the channel') |
| 1106 | self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10, src_list = subscriber.src_list) |
| 1107 | time.sleep(5) |
| 1108 | chan = 1 |
| 1109 | log_test.info('Leaving channel %d for subscriber on port %s' %(chan, subscriber.rx_port)) |
| 1110 | subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list, record_type = IGMP_V3_GR_TYPE_CHANGE_TO_EXCLUDE) |
| 1111 | time.sleep(5) |
| 1112 | self.recv_timeout = True |
| 1113 | subscriber.recv_timeout = True |
| 1114 | self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10, src_list = subscriber.src_list[1]) |
| 1115 | if self.test_status is True: |
| 1116 | self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10, src_list = subscriber.src_list[0]) |
| 1117 | if self.test_status is True: |
| 1118 | log_test.info('Subscriber should not receive data from channel %s on specific source %s, test is failed' %(chan, subscriber.rx_port)) |
| 1119 | self.test_status = False |
| 1120 | subscriber.recv_timeout = False |
| 1121 | self.recv_timeout = False |
| 1122 | chan = 0 |
| 1123 | subscriber.channel_leave(chan, src_list = subscriber.src_list) |
| 1124 | # self.test_status = True |
| 1125 | return self.test_status |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 1126 | |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 1127 | def igmp_flow_check_join_change_to_exclude_again_include_back(self, subscriber, multiple_sub = False): |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 1128 | chan = 2 |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 1129 | subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list) |
| 1130 | self.num_joins += 1 |
| 1131 | while self.num_joins < self.num_subscribers: |
| 1132 | time.sleep(5) |
| 1133 | log_test.info('All subscribers have joined the channel') |
| 1134 | self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10, src_list = subscriber.src_list) |
| 1135 | time.sleep(5) |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 1136 | chan = 1 |
| 1137 | log_test.info('Leaving channel %d for subscriber on port %s' %(chan, subscriber.rx_port,)) |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 1138 | subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list[0], record_type = IGMP_V3_GR_TYPE_CHANGE_TO_EXCLUDE) |
| 1139 | time.sleep(5) |
| 1140 | self.recv_timeout = True |
| 1141 | subscriber.recv_timeout = True |
| 1142 | self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10, src_list = subscriber.src_list[1]) |
| 1143 | if self.test_status is True: |
| 1144 | self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10, src_list = subscriber.src_list[0]) |
| 1145 | if self.test_status is True: |
| 1146 | log_test.info('Subscriber should not receive data from channel %s on specific source %s, test is failed' %(chan, subscriber.rx_port)) |
| 1147 | self.test_status = False |
| 1148 | subscriber.recv_timeout = False |
| 1149 | self.recv_timeout = False |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 1150 | chan = 1 |
| 1151 | log_test.info('Again include the channel %s on port %s with souce list ip %s' %(chan, subscriber.rx_port,subscriber.src_list[0])) |
| 1152 | subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list, record_type = IGMP_V3_GR_TYPE_CHANGE_TO_INCLUDE) |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 1153 | time.sleep(5) |
| 1154 | self.recv_timeout = True |
| 1155 | subscriber.recv_timeout = True |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 1156 | self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10, src_list = subscriber.src_list[0]) |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 1157 | subscriber.recv_timeout = False |
| 1158 | self.recv_timeout = False |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 1159 | chan = 2 |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 1160 | subscriber.channel_leave(chan, src_list = subscriber.src_list) |
| 1161 | # self.test_status = True |
| 1162 | return self.test_status |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 1163 | |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 1164 | def igmp_flow_check_join_change_to_block(self, subscriber, multiple_sub = False): |
| 1165 | chan = 0 |
| 1166 | subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list) |
| 1167 | self.num_joins += 1 |
| 1168 | while self.num_joins < self.num_subscribers: |
| 1169 | time.sleep(5) |
| 1170 | log_test.info('All subscribers have joined the channel') |
| 1171 | self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10, src_list = subscriber.src_list) |
| 1172 | time.sleep(5) |
| 1173 | log_test.info('Leaving channel %d for subscriber on port %s from specific source ip %s' %(chan, subscriber.rx_port,subscriber.src_list[0])) |
| 1174 | subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list[0], record_type = IGMP_V3_GR_TYPE_BLOCK_OLD) |
| 1175 | time.sleep(5) |
| 1176 | self.recv_timeout = True |
| 1177 | subscriber.recv_timeout = True |
| 1178 | self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10, src_list = subscriber.src_list[1]) |
| 1179 | if self.test_status is True: |
| 1180 | self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10, src_list = subscriber.src_list[0]) |
| 1181 | if self.test_status is True: |
| 1182 | log_test.info('Subscriber should not receive data from channel %s on specific source %s, test is failed' %(chan, subscriber.rx_port)) |
| 1183 | self.test_status = False |
| 1184 | subscriber.recv_timeout = False |
| 1185 | self.recv_timeout = False |
| 1186 | subscriber.channel_leave(chan, src_list = subscriber.src_list) |
| 1187 | return self.test_status |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 1188 | |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 1189 | def igmp_flow_check_join_change_to_block_again_allow_back(self, subscriber, multiple_sub = False): |
| 1190 | chan = 0 |
| 1191 | subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list) |
| 1192 | self.num_joins += 1 |
| 1193 | while self.num_joins < self.num_subscribers: |
| 1194 | time.sleep(5) |
| 1195 | log_test.info('All subscribers have joined the channel') |
| 1196 | self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10, src_list = subscriber.src_list) |
| 1197 | time.sleep(5) |
| 1198 | log_test.info('Leaving channel %d for subscriber on port %s from specific source ip %s' %(chan, subscriber.rx_port,subscriber.src_list[0])) |
| 1199 | subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list[0], record_type = IGMP_V3_GR_TYPE_CHANGE_TO_EXCLUDE) |
| 1200 | time.sleep(5) |
| 1201 | self.recv_timeout = True |
| 1202 | subscriber.recv_timeout = True |
| 1203 | self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10, src_list = subscriber.src_list[1]) |
| 1204 | if self.test_status is True: |
| 1205 | self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10, src_list = subscriber.src_list[0]) |
| 1206 | if self.test_status is True: |
| 1207 | log_test.info('Subscriber should not receive data from channel %s on specific source %s, test is failed' %(chan, subscriber.rx_port)) |
| 1208 | self.test_status = False |
| 1209 | subscriber.recv_timeout = False |
| 1210 | self.recv_timeout = False |
| 1211 | log_test.info('Again include the source list in the group %s souce ip %s' %(chan, subscriber.rx_port,subscriber.src_list[0])) |
| 1212 | subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list[0], record_type = IGMP_V3_GR_TYPE_ALLOW_NEW) |
| 1213 | time.sleep(5) |
| 1214 | self.recv_timeout = True |
| 1215 | subscriber.recv_timeout = True |
| 1216 | self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10, src_list = subscriber.src_list) |
| 1217 | subscriber.recv_timeout = False |
| 1218 | self.recv_timeout = False |
| 1219 | subscriber.channel_leave(chan, src_list = subscriber.src_list) |
| 1220 | return self.test_status |
| 1221 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 1222 | def igmp_flow_check_group_include_source_empty_list(self, subscriber, multiple_sub = False): |
| 1223 | chan = 0 |
| 1224 | subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list) |
| 1225 | self.num_joins += 1 |
| 1226 | while self.num_joins < self.num_subscribers: |
| 1227 | time.sleep(5) |
| 1228 | log_test.info('All subscribers have joined the channel') |
| 1229 | self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10) |
| 1230 | if self.test_status is True: |
| 1231 | log_test.info('Subscriber should not receive data from channel %s on any specific source %s, test is failed' %(chan, subscriber.rx_port)) |
| 1232 | self.test_status = False |
| 1233 | else: |
| 1234 | log_test.info('Subscriber not receive data from channel %s on any specific source %s' %(chan, subscriber.rx_port)) |
| 1235 | log_test.info('Leaving channel %d for subscriber on port %s' %(chan, subscriber.rx_port)) |
| 1236 | subscriber.channel_leave(chan, src_list = subscriber.src_list) |
| 1237 | time.sleep(5) |
| 1238 | subscriber.recv_timeout = False |
| 1239 | self.recv_timeout = False |
| 1240 | return self.test_status |
| 1241 | |
| 1242 | def igmp_flow_check_group_exclude_source_empty_list(self, subscriber, multiple_sub = False): |
| 1243 | chan = 0 |
| 1244 | subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list,record_type = IGMP_V3_GR_TYPE_CHANGE_TO_EXCLUDE) |
| 1245 | self.num_joins += 1 |
| 1246 | while self.num_joins < self.num_subscribers: |
| 1247 | time.sleep(5) |
| 1248 | log_test.info('All subscribers have joined the channel') |
| 1249 | for i in range(10): |
| 1250 | self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10, src_list = subscriber.src_list) |
| 1251 | log_test.info('Leaving channel %d for subscriber on port %s' %(chan, subscriber.rx_port)) |
| 1252 | subscriber.channel_leave(chan, src_list = subscriber.src_list) |
| 1253 | time.sleep(5) |
| 1254 | log_test.info('Interface %s Join RX stats for subscriber, %s' %(subscriber.iface,subscriber.join_rx_stats)) |
| 1255 | #Should not receive packets for this subscriber |
| 1256 | self.recv_timeout = True |
| 1257 | subscriber.recv_timeout = True |
| 1258 | subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10, src_list = subscriber.src_list) |
| 1259 | subscriber.recv_timeout = False |
| 1260 | self.recv_timeout = False |
| 1261 | log_test.info('Joining channel %d for subscriber port %s' %(chan, subscriber.rx_port)) |
| 1262 | subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list) |
| 1263 | # self.test_status = True |
| 1264 | return self.test_status |
| 1265 | |
| 1266 | def igmp_flow_check_during_olt_onu_operational_issues(self, subscriber, multiple_sub = False): |
| 1267 | chan = 0 |
| 1268 | subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list) |
| 1269 | self.num_joins += 1 |
| 1270 | while self.num_joins < self.num_subscribers: |
| 1271 | time.sleep(5) |
| 1272 | log_test.info('All subscribers have joined the channel') |
| 1273 | for i in range(2): |
| 1274 | self.test_status = subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10, src_list = subscriber.src_list) |
| 1275 | log_test.info('Leaving channel %d for subscriber on port %s' %(chan, subscriber.rx_port)) |
| 1276 | subscriber.channel_leave(chan, src_list = subscriber.src_list) |
| 1277 | time.sleep(5) |
| 1278 | log_test.info('Interface %s Join RX stats for subscriber, %s' %(subscriber.iface,subscriber.join_rx_stats)) |
| 1279 | #Should not receive packets for this subscriber |
| 1280 | self.recv_timeout = True |
| 1281 | subscriber.recv_timeout = True |
| 1282 | subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10, src_list = subscriber.src_list) |
| 1283 | subscriber.recv_timeout = False |
| 1284 | self.recv_timeout = False |
| 1285 | log_test.info('Joining channel %d for subscriber port %s' %(chan, subscriber.rx_port)) |
| 1286 | subscriber.channel_join(chan, delay = 0, src_list = subscriber.src_list) |
| 1287 | # self.test_status = True |
| 1288 | return self.test_status |
| 1289 | |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 1290 | def voltha_igmp_jump_verify(self, subscriber): |
| 1291 | if subscriber.has_service('IGMP'): |
| 1292 | for i in xrange(subscriber.num): |
| 1293 | log_test.info('Subscriber %s jumping channel' %subscriber.name) |
| 1294 | chan = subscriber.channel_jump(delay=0) |
| 1295 | subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 1) |
| 1296 | log_test.info('Verified receive for channel %d, subscriber %s' %(chan, subscriber.name)) |
| 1297 | time.sleep(3) |
| 1298 | log_test.info('Interface %s Jump RX stats for subscriber %s, %s' %(subscriber.iface, subscriber.name, subscriber.join_rx_stats)) |
| 1299 | self.test_status = True |
| 1300 | return self.test_status |
| 1301 | |
| 1302 | def voltha_igmp_next_verify(self, subscriber): |
| 1303 | for c in xrange(self.VOLTHA_IGMP_ITERATIONS): |
| 1304 | for i in xrange(subscriber.num): |
| 1305 | if i: |
| 1306 | chan = subscriber.channel_join_next(delay=0, leave_flag = self.leave_flag) |
| 1307 | time.sleep(0.2) |
| 1308 | else: |
| 1309 | chan = subscriber.channel_join(i, delay=0) |
| 1310 | time.sleep(0.2) |
| 1311 | if subscriber.num == 1: |
| 1312 | subscriber.channel_leave(chan) |
| 1313 | log_test.info('Joined next channel %d for subscriber %s' %(chan, subscriber.name)) |
| 1314 | #subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count=1) |
| 1315 | #log_test.info('Verified receive for channel %d, subscriber %s' %(chan, subscriber.name)) |
| 1316 | self.test_status = True |
| 1317 | return self.test_status |
| 1318 | |
| 1319 | 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] | 1320 | """Test subscriber join next for channel surfing""" |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 1321 | voltha = VolthaCtrl(self.VOLTHA_HOST, |
| 1322 | rest_port = self.VOLTHA_REST_PORT, |
| 1323 | uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP) |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 1324 | if self.VOLTHA_OLT_TYPE.startswith('ponsim'): |
| 1325 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 1326 | log_test.info('Enabling ponsim olt') |
| 1327 | 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] | 1328 | if device_id != '': |
| 1329 | self.olt_device_id = device_id |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 1330 | else: |
| 1331 | log_test.info('This setup test cases is developed on ponsim olt only, hence stop execution') |
| 1332 | assert_equal(False, True) |
| 1333 | |
| 1334 | assert_not_equal(device_id, None) |
| 1335 | if status == False: |
| 1336 | voltha.disable_device(device_id, delete = True) |
| 1337 | assert_equal(status, True) |
| 1338 | time.sleep(10) |
| 1339 | switch_map = None |
| 1340 | olt_configured = False |
| 1341 | try: |
| 1342 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 1343 | if not switch_map: |
| 1344 | log_test.info('No voltha devices found') |
| 1345 | return |
| 1346 | log_test.info('Installing OLT app') |
| 1347 | OnosCtrl.install_app(self.olt_app_file) |
| 1348 | time.sleep(5) |
| 1349 | log_test.info('Adding subscribers through OLT app') |
| 1350 | self.config_olt(switch_map) |
| 1351 | olt_configured = True |
| 1352 | time.sleep(5) |
| 1353 | self.num_subscribers = num_subscribers |
| 1354 | self.num_channels = num_channels |
| 1355 | test_status = self.subscriber_flows_check(num_subscribers = self.num_subscribers, |
| 1356 | num_channels = self.num_channels, |
| 1357 | cbs = cbs, |
| 1358 | port_list = self.generate_port_list(self.num_subscribers, |
| 1359 | self.num_channels), |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 1360 | src_list = src_list, services = services) |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 1361 | if test_status is False: |
| 1362 | self.success = False |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 1363 | assert_equal(test_status, True) |
| 1364 | finally: |
| 1365 | if switch_map is not None: |
| 1366 | if olt_configured is True: |
| 1367 | self.remove_olt(switch_map) |
| 1368 | voltha.disable_device(device_id, delete = True) |
| 1369 | time.sleep(10) |
| 1370 | log_test.info('Uninstalling OLT app') |
| 1371 | OnosCtrl.uninstall_app(self.olt_app_name) |
| 1372 | |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 1373 | def subscriber_flows_check( self, num_subscribers = 1, num_channels = 1, |
| 1374 | channel_start = 0, cbs = None, port_list = [], src_list = None, |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 1375 | services = None, negative_subscriber_auth = None): |
| 1376 | self.test_status = False |
| 1377 | self.ovs_cleanup() |
| 1378 | subscribers_count = num_subscribers |
| 1379 | sub_loop_count = num_subscribers |
| 1380 | if not port_list: |
| 1381 | port_list = self.generate_port_list(num_subscribers, num_channels) |
| 1382 | subscriber_tx_rx_ports = [] |
| 1383 | for i in range(num_subscribers): |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 1384 | subscriber_tx_rx_ports.append(Voltha_olt_subscribers(tx_port = self.port_map[port_list[i][0]], |
| 1385 | rx_port = self.port_map[port_list[i][1]], |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 1386 | num_channels = num_channels,src_list = src_list,)) |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 1387 | self.onos_aaa_load() |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 1388 | #load the ssm list for all subscriber channels |
| 1389 | igmpChannel = IgmpChannel(src_list = src_list) |
| 1390 | ssm_groups = map(lambda sub: sub.channels, subscriber_tx_rx_ports) |
| 1391 | ssm_list = reduce(lambda ssm1, ssm2: ssm1+ssm2, ssm_groups) |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 1392 | if src_list is None: |
| 1393 | igmpChannel = IgmpChannel() |
| 1394 | igmpChannel.igmp_load_ssm_config(ssm_list) |
| 1395 | else: |
| 1396 | igmpChannel = IgmpChannel(src_list = src_list) |
| 1397 | igmpChannel.igmp_load_ssm_config(ssm_list, src_list= src_list) |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 1398 | |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 1399 | self.thread_pool = ThreadPool(min(100, subscribers_count), queue_size=1, wait_timeout=1) |
| 1400 | |
| 1401 | chan_leave = False #for single channel, multiple subscribers |
| 1402 | if cbs is None: |
| 1403 | cbs = (self.tls_flow_check, self.dhcp_flow_check, self.igmp_flow_check) |
| 1404 | chan_leave = True |
| 1405 | for subscriber in subscriber_tx_rx_ports: |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 1406 | if 'IGMP' in services: |
| 1407 | # if src_list: |
| 1408 | # for i in range(len(src_list)): |
| 1409 | # subscriber.start(src_ip = src_list[i]) |
| 1410 | # else: |
| 1411 | # subscriber.start() |
| 1412 | subscriber.start() |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 1413 | sub_loop_count = sub_loop_count - 1 |
| 1414 | pool_object = voltha_subscriber_pool(subscriber, cbs) |
| 1415 | self.thread_pool.addTask(pool_object.pool_cb) |
| 1416 | self.thread_pool.cleanUpThreads() |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 1417 | for subscriber in subscriber_tx_rx_ports: |
| 1418 | if services and 'IGMP' in services: |
| 1419 | # if src_list: |
| 1420 | # for i in range(len(src_list)): |
| 1421 | # subscriber.stop(src_ip = src_list[i]) |
| 1422 | # else: |
| 1423 | # subscriber.stop() |
| 1424 | subscriber.stop() |
| 1425 | if chan_leave is True: |
| 1426 | subscriber.channel_leave(0) |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 1427 | subscribers_count = 0 |
| 1428 | return self.test_status |
| 1429 | |
| 1430 | |
| 1431 | def generate_port_list(self, subscribers, channels): |
| 1432 | return self.port_list[:subscribers] |
| 1433 | |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 1434 | @classmethod |
| 1435 | def ovs_cleanup(cls): |
| 1436 | ##For every test case, delete all the OVS groups |
| 1437 | cmd = 'ovs-ofctl del-groups br-int -OOpenFlow11 >/dev/null 2>&1' |
| 1438 | try: |
| 1439 | cord_test_shell(cmd) |
| 1440 | ##Since olt config is used for this test, we just fire a careless local cmd as well |
| 1441 | os.system(cmd) |
| 1442 | finally: |
| 1443 | return |
| 1444 | |
A.R Karthick | 8a507cf | 2017-06-02 18:44:49 -0700 | [diff] [blame] | 1445 | def test_olt_enable_disable(self): |
A R Karthick | 35495c3 | 2017-05-11 14:58:32 -0700 | [diff] [blame] | 1446 | 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] | 1447 | device_id, status = self.voltha.enable_device(self.OLT_TYPE, self.OLT_MAC) |
| 1448 | assert_not_equal(device_id, None) |
| 1449 | try: |
| 1450 | assert_equal(status, True) |
| 1451 | time.sleep(10) |
| 1452 | finally: |
| 1453 | self.voltha.disable_device(device_id, delete = True) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 1454 | |
A.R Karthick | 8a507cf | 2017-06-02 18:44:49 -0700 | [diff] [blame] | 1455 | def test_ponsim_enable_disable(self): |
A.R Karthick | 8b9c5f1 | 2017-05-30 17:47:08 -0700 | [diff] [blame] | 1456 | log_test.info('Enabling ponsim_olt') |
| 1457 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
A.R Karthick | 8a507cf | 2017-06-02 18:44:49 -0700 | [diff] [blame] | 1458 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 1459 | assert_not_equal(device_id, None) |
| 1460 | try: |
| 1461 | assert_equal(status, True) |
| 1462 | time.sleep(10) |
| 1463 | finally: |
| 1464 | self.voltha.disable_device(device_id, delete = True) |
A.R Karthick | 8b9c5f1 | 2017-05-30 17:47:08 -0700 | [diff] [blame] | 1465 | |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 1466 | def test_subscriber_with_voltha_for_eap_tls_authentication(self): |
| 1467 | """ |
| 1468 | Test Method: |
| 1469 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1470 | 1. OLT and ONU is detected and validated. |
| 1471 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 1472 | 3. Issue auth request packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1473 | 4. Validate that eap tls valid auth packets are being exchanged between subscriber, onos and freeradius. |
| 1474 | 5. Verify that subscriber is authenticated successfully. |
| 1475 | """ |
A R Karthick | caa1b6a | 2017-07-27 14:07:05 -0700 | [diff] [blame] | 1476 | ret = voltha_setup( |
| 1477 | host = self.VOLTHA_HOST, |
| 1478 | rest_port = self.VOLTHA_REST_PORT, |
| 1479 | olt_type = 'ponsim_olt', |
| 1480 | uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP, |
| 1481 | uplink_vlan_start = self.VOLTHA_UPLINK_VLAN_START, |
| 1482 | config_fake = self.VOLTHA_CONFIG_FAKE, |
| 1483 | olt_app = self.olt_app_file) |
| 1484 | assert_not_equal(ret, None) |
| 1485 | voltha, device_id, switch_map = ret[0], ret[1], ret[2] |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 1486 | try: |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 1487 | log_test.info('Adding subscribers through OLT app') |
| 1488 | self.config_olt(switch_map) |
| 1489 | olt_configured = True |
| 1490 | time.sleep(5) |
| 1491 | auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT) |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 1492 | assert_equal(auth_status, True) |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 1493 | finally: |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 1494 | if switch_map is not None: |
| 1495 | if olt_configured is True: |
| 1496 | self.remove_olt(switch_map) |
A R Karthick | caa1b6a | 2017-07-27 14:07:05 -0700 | [diff] [blame] | 1497 | 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] | 1498 | |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 1499 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 1500 | def test_subscriber_with_voltha_for_eap_tls_authentication_failure(self): |
| 1501 | """ |
| 1502 | Test Method: |
| 1503 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1504 | 1. OLT and ONU is detected and validated. |
| 1505 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 1506 | 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1507 | 4. Validate that eap tls without cert auth packet is being exchanged between subscriber, onos and freeradius. |
| 1508 | 5. Verify that subscriber authentication is unsuccessful.. |
| 1509 | """ |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 1510 | df = defer.Deferred() |
| 1511 | def tls_flow_check_with_no_cert_scenario(df): |
| 1512 | log_test.info('Enabling ponsim_olt') |
| 1513 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 1514 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 1515 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 1516 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 1517 | time.sleep(10) |
| 1518 | switch_map = None |
| 1519 | olt_configured = False |
| 1520 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 1521 | log_test.info('Installing OLT app') |
| 1522 | OnosCtrl.install_app(self.olt_app_file) |
| 1523 | time.sleep(5) |
| 1524 | log_test.info('Adding subscribers through OLT app') |
| 1525 | self.config_olt(switch_map) |
| 1526 | olt_configured = True |
| 1527 | time.sleep(5) |
| 1528 | auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT, cert_info = "no_cert") |
| 1529 | try: |
| 1530 | assert_equal(auth_status, True) |
| 1531 | assert_equal(status, True) |
| 1532 | time.sleep(10) |
| 1533 | finally: |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 1534 | self.remove_olt(switch_map) |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 1535 | self.voltha.disable_device(device_id, delete = True) |
| 1536 | df.callback(0) |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 1537 | |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 1538 | reactor.callLater(0, tls_flow_check_with_no_cert_scenario, df) |
| 1539 | return df |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 1540 | |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 1541 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 1542 | def test_subscriber_with_voltha_for_eap_tls_authentication_using_invalid_cert(self): |
| 1543 | """ |
| 1544 | Test Method: |
| 1545 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1546 | 1. OLT and ONU is detected and validated. |
| 1547 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 1548 | 3. Issue tls auth packets and exchange invalid cert from CORD TESTER voltha test module acting as a subscriber.. |
| 1549 | 4. Validate that eap tls with invalid cert auth packet is being exchanged between subscriber, onos and freeradius. |
| 1550 | 5. Verify that subscriber authentication is unsuccessful.. |
| 1551 | """ |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 1552 | df = defer.Deferred() |
| 1553 | def tls_flow_check_with_invalid_cert_scenario(df): |
| 1554 | log_test.info('Enabling ponsim_olt') |
| 1555 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 1556 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 1557 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 1558 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 1559 | time.sleep(10) |
| 1560 | switch_map = None |
| 1561 | olt_configured = False |
| 1562 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 1563 | log_test.info('Installing OLT app') |
| 1564 | OnosCtrl.install_app(self.olt_app_file) |
| 1565 | time.sleep(5) |
| 1566 | log_test.info('Adding subscribers through OLT app') |
| 1567 | self.config_olt(switch_map) |
| 1568 | olt_configured = True |
| 1569 | time.sleep(5) |
| 1570 | auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT, cert_info = "invalid_cert") |
| 1571 | try: |
| 1572 | assert_equal(auth_status, True) |
| 1573 | assert_equal(status, True) |
| 1574 | time.sleep(10) |
| 1575 | finally: |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 1576 | self.remove_olt(switch_map) |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 1577 | self.voltha.disable_device(device_id, delete = True) |
| 1578 | df.callback(0) |
| 1579 | reactor.callLater(0, tls_flow_check_with_invalid_cert_scenario, df) |
| 1580 | return df |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 1581 | |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1582 | @deferred(TESTCASE_TIMEOUT) |
| 1583 | def test_subscriber_with_voltha_for_multiple_invalid_authentication_attempts(self): |
| 1584 | """ |
| 1585 | Test Method: |
| 1586 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1587 | 1. OLT and ONU is detected and validated. |
| 1588 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 1589 | 3. Issue tls auth packets and exchange invalid cert from CORD TESTER voltha test module acting as a subscriber for multiple times. |
| 1590 | 4. Validate that eap tls with invalid cert auth packet is being exchanged between subscriber, onos and freeradius. |
| 1591 | 5. Verify that subscriber authentication is unsuccessful.. |
| 1592 | """ |
| 1593 | df = defer.Deferred() |
| 1594 | def tls_flow_check_with_no_cert_scenario(df): |
| 1595 | log_test.info('Enabling ponsim_olt') |
| 1596 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 1597 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 1598 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 1599 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1600 | time.sleep(10) |
| 1601 | switch_map = None |
| 1602 | olt_configured = False |
| 1603 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 1604 | log_test.info('Installing OLT app') |
| 1605 | OnosCtrl.install_app(self.olt_app_file) |
| 1606 | time.sleep(5) |
| 1607 | log_test.info('Adding subscribers through OLT app') |
| 1608 | self.config_olt(switch_map) |
| 1609 | olt_configured = True |
| 1610 | time.sleep(5) |
| 1611 | auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT, cert_info = "invalid_cert") |
| 1612 | auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT, cert_info = "invalid_cert") |
| 1613 | auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT, cert_info = "no_cert") |
| 1614 | auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT, cert_info = "invalid_cert") |
| 1615 | try: |
| 1616 | assert_equal(auth_status, True) |
| 1617 | assert_equal(status, True) |
| 1618 | time.sleep(10) |
| 1619 | finally: |
| 1620 | self.voltha.disable_device(device_id, delete = True) |
| 1621 | df.callback(0) |
| 1622 | reactor.callLater(0, tls_flow_check_with_no_cert_scenario, df) |
| 1623 | return df |
| 1624 | |
| 1625 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 1626 | def test_subscriber_with_voltha_for_eap_tls_authentication_with_aaa_app_deactivation(self): |
| 1627 | """ |
| 1628 | Test Method: |
| 1629 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1630 | 1. OLT and ONU is detected and validated. |
| 1631 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 1632 | 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1633 | 4. Validate that eap tls without sending client hello, it's not being exchanged between client, onos and freeradius. |
| 1634 | 5. Verify that subscriber authentication is unsuccessful.. |
| 1635 | """ |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1636 | df = defer.Deferred() |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 1637 | def tls_flow_check_deactivating_app(df): |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1638 | aaa_app = ["org.opencord.aaa"] |
| 1639 | log_test.info('Enabling ponsim_olt') |
| 1640 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 1641 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 1642 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 1643 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1644 | time.sleep(10) |
| 1645 | switch_map = None |
| 1646 | olt_configured = False |
| 1647 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 1648 | log_test.info('Installing OLT app') |
| 1649 | OnosCtrl.install_app(self.olt_app_file) |
| 1650 | time.sleep(5) |
| 1651 | log_test.info('Adding subscribers through OLT app') |
| 1652 | self.config_olt(switch_map) |
| 1653 | olt_configured = True |
| 1654 | time.sleep(5) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 1655 | |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1656 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT,"app_deactivate",)) |
| 1657 | thread2 = threading.Thread(target = self.deactivate_apps, args = (aaa_app,)) |
| 1658 | thread1.start() |
| 1659 | time.sleep(randint(1,2)) |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 1660 | 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] | 1661 | thread2.start() |
| 1662 | time.sleep(10) |
| 1663 | thread1.join() |
| 1664 | thread2.join() |
| 1665 | try: |
| 1666 | # assert_equal(status, True) |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 1667 | assert_equal(self.success, True) |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1668 | time.sleep(10) |
| 1669 | finally: |
| 1670 | self.voltha.disable_device(device_id, delete = True) |
| 1671 | df.callback(0) |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 1672 | reactor.callLater(0, tls_flow_check_deactivating_app, df) |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1673 | return df |
| 1674 | |
| 1675 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 1676 | def test_subscriber_with_voltha_for_eap_tls_authentication_restarting_radius_server(self): |
| 1677 | """ |
| 1678 | Test Method: |
| 1679 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1680 | 1. OLT and ONU is detected and validated. |
| 1681 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 1682 | 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1683 | 4. Validate that eap tls with restart of radius server and packets are being exchanged between subscriber, onos and freeradius. |
| 1684 | 5. Verify that subscriber authentication is unsuccessful.. |
| 1685 | """ |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1686 | df = defer.Deferred() |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 1687 | def tls_flow_check_restarting_radius(df): |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1688 | aaa_app = ["org.opencord.aaa"] |
| 1689 | log_test.info('Enabling ponsim_olt') |
| 1690 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 1691 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 1692 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 1693 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1694 | time.sleep(10) |
| 1695 | switch_map = None |
| 1696 | olt_configured = False |
| 1697 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 1698 | log_test.info('Installing OLT app') |
| 1699 | OnosCtrl.install_app(self.olt_app_file) |
| 1700 | time.sleep(5) |
| 1701 | log_test.info('Adding subscribers through OLT app') |
| 1702 | self.config_olt(switch_map) |
| 1703 | olt_configured = True |
| 1704 | time.sleep(5) |
| 1705 | |
| 1706 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT,"restart_radius")) |
| 1707 | thread2 = threading.Thread(target = cord_test_radius_restart) |
| 1708 | thread1.start() |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 1709 | time.sleep(randint(1,2)) |
| 1710 | 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] | 1711 | thread2.start() |
| 1712 | time.sleep(10) |
| 1713 | thread1.join() |
| 1714 | thread2.join() |
| 1715 | try: |
| 1716 | # assert_equal(status, True) |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 1717 | assert_equal(self.success, True) |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1718 | time.sleep(10) |
| 1719 | finally: |
| 1720 | self.voltha.disable_device(device_id, delete = True) |
| 1721 | df.callback(0) |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 1722 | reactor.callLater(0, tls_flow_check_restarting_radius, df) |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1723 | return df |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 1724 | |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 1725 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 1726 | def test_subscriber_with_voltha_for_eap_tls_authentication_with_disabled_olt(self): |
| 1727 | """ |
| 1728 | Test Method: |
| 1729 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1730 | 1. OLT and ONU is detected and validated. |
| 1731 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 1732 | 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1733 | 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius. |
| 1734 | 6. Verify that subscriber authenticated successfully. |
| 1735 | 7. Disable olt which is seen in voltha and issue tls auth packets from subscriber. |
| 1736 | 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius. |
| 1737 | 9. Verify that subscriber authentication is unsuccessful.. |
| 1738 | """ |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1739 | df = defer.Deferred() |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 1740 | def tls_flow_check_operating_olt_state(df): |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1741 | aaa_app = ["org.opencord.aaa"] |
| 1742 | log_test.info('Enabling ponsim_olt') |
| 1743 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 1744 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 1745 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 1746 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1747 | time.sleep(10) |
| 1748 | switch_map = None |
| 1749 | olt_configured = False |
| 1750 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 1751 | log_test.info('Installing OLT app') |
| 1752 | OnosCtrl.install_app(self.olt_app_file) |
| 1753 | time.sleep(5) |
| 1754 | log_test.info('Adding subscribers through OLT app') |
| 1755 | self.config_olt(switch_map) |
| 1756 | olt_configured = True |
| 1757 | time.sleep(5) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 1758 | |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1759 | 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] | 1760 | 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] | 1761 | thread1.start() |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 1762 | time.sleep(randint(1,2)) |
| 1763 | 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] | 1764 | thread2.start() |
| 1765 | time.sleep(10) |
| 1766 | thread1.join() |
| 1767 | thread2.join() |
| 1768 | try: |
| 1769 | # assert_equal(status, True) |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 1770 | assert_equal(self.success, True) |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1771 | time.sleep(10) |
| 1772 | finally: |
| 1773 | self.voltha.disable_device(device_id, delete = True) |
| 1774 | df.callback(0) |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 1775 | reactor.callLater(0, tls_flow_check_operating_olt_state, df) |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 1776 | return df |
| 1777 | |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 1778 | @deferred(TESTCASE_TIMEOUT) |
| 1779 | 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] | 1780 | """ |
| 1781 | Test Method: |
| 1782 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1783 | 1. OLT and ONU is detected and validated. |
| 1784 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 1785 | 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1786 | 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius. |
| 1787 | 6. Verify that subscriber authenticated successfully. |
| 1788 | 7. Disable uni port which is seen in voltha and issue tls auth packets from subscriber. |
| 1789 | 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius. |
| 1790 | 9. Verify that subscriber authentication is unsuccessful.. |
| 1791 | """ |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 1792 | df = defer.Deferred() |
| 1793 | def tls_flow_check_operating_olt_state(df): |
| 1794 | aaa_app = ["org.opencord.aaa"] |
| 1795 | log_test.info('Enabling ponsim_olt') |
| 1796 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 1797 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 1798 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 1799 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 1800 | time.sleep(10) |
| 1801 | switch_map = None |
| 1802 | olt_configured = False |
| 1803 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 1804 | log_test.info('Installing OLT app') |
| 1805 | OnosCtrl.install_app(self.olt_app_file) |
| 1806 | time.sleep(5) |
| 1807 | log_test.info('Adding subscribers through OLT app') |
| 1808 | self.config_olt(switch_map) |
| 1809 | olt_configured = True |
| 1810 | time.sleep(5) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 1811 | |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 1812 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT, "uni_port_admin_down",)) |
| 1813 | thread2 = threading.Thread(target = self.voltha_uni_port_toggle) |
| 1814 | thread1.start() |
| 1815 | time.sleep(randint(1,2)) |
| 1816 | log_test.info('Admin state of uni port is down and up after delay of 30 sec during tls auth flow check on voltha') |
| 1817 | thread2.start() |
| 1818 | time.sleep(10) |
| 1819 | thread1.join() |
| 1820 | thread2.join() |
| 1821 | try: |
| 1822 | # assert_equal(status, True) |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 1823 | assert_equal(self.success, True) |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 1824 | time.sleep(10) |
| 1825 | finally: |
| 1826 | self.voltha.disable_device(device_id, delete = True) |
| 1827 | df.callback(0) |
| 1828 | reactor.callLater(0, tls_flow_check_operating_olt_state, df) |
| 1829 | return df |
| 1830 | |
| 1831 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 1832 | def test_subscriber_with_voltha_for_eap_tls_authentication_carrying_out_multiple_times_toggling_of_uni_port(self): |
| 1833 | """ |
| 1834 | Test Method: |
| 1835 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1836 | 1. OLT and ONU is detected and validated. |
| 1837 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 1838 | 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1839 | 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius. |
| 1840 | 6. Verify that subscriber authenticated successfully. |
| 1841 | 7. Disable uni port which is seen in voltha and issue tls auth packets from subscriber. |
| 1842 | 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius. |
| 1843 | 9. Verify that subscriber authentication is unsuccessful.. |
| 1844 | 10. Repeat steps from 3 to 9 for 10 times and finally verify tls flow |
| 1845 | |
| 1846 | """ |
| 1847 | df = defer.Deferred() |
| 1848 | no_iterations = 10 |
| 1849 | def tls_flow_check_with_disable_olt_device_scenario(df): |
| 1850 | aaa_app = ["org.opencord.aaa"] |
| 1851 | log_test.info('Enabling ponsim_olt') |
| 1852 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 1853 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 1854 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 1855 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 1856 | time.sleep(10) |
| 1857 | switch_map = None |
| 1858 | olt_configured = False |
| 1859 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 1860 | log_test.info('Installing OLT app') |
| 1861 | OnosCtrl.install_app(self.olt_app_file) |
| 1862 | time.sleep(5) |
| 1863 | log_test.info('Adding subscribers through OLT app') |
| 1864 | self.config_olt(switch_map) |
| 1865 | olt_configured = True |
| 1866 | time.sleep(5) |
| 1867 | for i in range(no_iterations): |
| 1868 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT, "uni_port_admin_down",)) |
| 1869 | thread2 = threading.Thread(target = self.voltha_uni_port_down_up) |
| 1870 | thread1.start() |
| 1871 | time.sleep(randint(1,2)) |
| 1872 | log_test.info('Admin state of uni port is down and up after delay of 30 sec during tls auth flow check on voltha') |
| 1873 | thread2.start() |
| 1874 | time.sleep(10) |
| 1875 | thread1.join() |
| 1876 | thread2.join() |
| 1877 | auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT) |
| 1878 | try: |
| 1879 | # assert_equal(status, True) |
| 1880 | assert_equal(auth_status, True) |
| 1881 | assert_equal(self.success, True) |
| 1882 | time.sleep(10) |
| 1883 | finally: |
| 1884 | self.voltha.disable_device(device_id, delete = True) |
| 1885 | df.callback(0) |
| 1886 | reactor.callLater(0, tls_flow_check_with_disable_olt_device_scenario, df) |
| 1887 | return df |
| 1888 | |
| 1889 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 1890 | def test_subscriber_with_voltha_for_eap_tls_authentication_restarting_olt(self): |
| 1891 | """ |
| 1892 | Test Method: |
| 1893 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1894 | 1. OLT and ONU is detected and validated. |
| 1895 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 1896 | 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1897 | 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius. |
| 1898 | 6. Verify that subscriber authenticated successfully. |
| 1899 | 7. Restart olt which is seen in voltha and issue tls auth packets from subscriber. |
| 1900 | 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius. |
| 1901 | 9. Verify that subscriber authentication is unsuccessful.. |
| 1902 | """ |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 1903 | df = defer.Deferred() |
| 1904 | def tls_flow_check_operating_olt_state(df): |
| 1905 | aaa_app = ["org.opencord.aaa"] |
| 1906 | log_test.info('Enabling ponsim_olt') |
| 1907 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 1908 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 1909 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 1910 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 1911 | time.sleep(10) |
| 1912 | switch_map = None |
| 1913 | olt_configured = False |
| 1914 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 1915 | log_test.info('Installing OLT app') |
| 1916 | OnosCtrl.install_app(self.olt_app_file) |
| 1917 | time.sleep(5) |
| 1918 | log_test.info('Adding subscribers through OLT app') |
| 1919 | self.config_olt(switch_map) |
| 1920 | olt_configured = True |
| 1921 | time.sleep(5) |
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 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT, "restart_olt_device",)) |
| 1924 | thread2 = threading.Thread(target = self.voltha.restart_device, args = (device_id,)) |
| 1925 | thread1.start() |
| 1926 | time.sleep(randint(1,2)) |
| 1927 | log_test.info('Restart the ponsim olt device during tls auth flow check on voltha') |
| 1928 | thread2.start() |
| 1929 | time.sleep(10) |
| 1930 | thread1.join() |
| 1931 | thread2.join() |
| 1932 | try: |
| 1933 | # assert_equal(status, True) |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 1934 | assert_equal(self.success, True) |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 1935 | time.sleep(10) |
| 1936 | finally: |
| 1937 | self.voltha.disable_device(device_id, delete = True) |
| 1938 | df.callback(0) |
| 1939 | reactor.callLater(0, tls_flow_check_operating_olt_state, df) |
| 1940 | return df |
| 1941 | |
| 1942 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 1943 | 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] | 1944 | """ |
| 1945 | Test Method: |
| 1946 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1947 | 1. OLT and ONU is detected and validated. |
| 1948 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 1949 | 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1950 | 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius. |
| 1951 | 6. Verify that subscriber authenticated successfully. |
| 1952 | 7. Restart olt which is seen in voltha and issue tls auth packets from subscriber. |
| 1953 | 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius. |
| 1954 | 9. Verify that subscriber authentication is unsuccessful.. |
| 1955 | 10. Repeat steps from 3 to 9 for 10 times and finally verify tls flow |
| 1956 | """ |
| 1957 | df = defer.Deferred() |
| 1958 | no_iterations = 10 |
| 1959 | def tls_flow_check_with_disable_olt_device_scenario(df): |
| 1960 | aaa_app = ["org.opencord.aaa"] |
| 1961 | log_test.info('Enabling ponsim_olt') |
| 1962 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 1963 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 1964 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 1965 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 1966 | time.sleep(10) |
| 1967 | switch_map = None |
| 1968 | olt_configured = False |
| 1969 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 1970 | log_test.info('Installing OLT app') |
| 1971 | OnosCtrl.install_app(self.olt_app_file) |
| 1972 | time.sleep(5) |
| 1973 | log_test.info('Adding subscribers through OLT app') |
| 1974 | self.config_olt(switch_map) |
| 1975 | olt_configured = True |
| 1976 | time.sleep(5) |
| 1977 | for i in range(no_iterations): |
| 1978 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT, "restart_olt_device",)) |
| 1979 | thread2 = threading.Thread(target = self.voltha.restart_device, args = (device_id,)) |
| 1980 | thread1.start() |
| 1981 | time.sleep(randint(1,2)) |
| 1982 | log_test.info('Restart the ponsim olt device during tls auth flow check on voltha') |
| 1983 | thread2.start() |
| 1984 | time.sleep(10) |
| 1985 | thread1.join() |
| 1986 | thread2.join() |
| 1987 | auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT) |
| 1988 | try: |
| 1989 | # assert_equal(status, True) |
| 1990 | assert_equal(auth_status, True) |
| 1991 | assert_equal(self.success, True) |
| 1992 | time.sleep(10) |
| 1993 | finally: |
| 1994 | self.voltha.disable_device(device_id, delete = True) |
| 1995 | df.callback(0) |
| 1996 | reactor.callLater(0, tls_flow_check_with_disable_olt_device_scenario, df) |
| 1997 | return df |
| 1998 | |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 1999 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 2000 | def test_subscriber_with_voltha_for_eap_tls_authentication_restarting_onu(self): |
| 2001 | """ |
| 2002 | Test Method: |
| 2003 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2004 | 1. OLT and ONU is detected and validated. |
| 2005 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 2006 | 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 2007 | 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius. |
| 2008 | 6. Verify that subscriber authenticated successfully. |
| 2009 | 7. Restart onu which is seen in voltha and issue tls auth packets from subscriber. |
| 2010 | 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius. |
| 2011 | 9. Verify that subscriber authentication is unsuccessful.. |
| 2012 | """ |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 2013 | df = defer.Deferred() |
| 2014 | def tls_flow_check_operating_olt_state(df): |
| 2015 | aaa_app = ["org.opencord.aaa"] |
| 2016 | log_test.info('Enabling ponsim_olt') |
| 2017 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 2018 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 2019 | devices_list = self.voltha.get_devices() |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 2020 | log_test.info('All available devices on voltha = %s'%devices_list['items']) |
| 2021 | |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 2022 | onu_device_id = devices_list['items'][1]['id'] |
| 2023 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 2024 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 2025 | time.sleep(10) |
| 2026 | switch_map = None |
| 2027 | olt_configured = False |
| 2028 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 2029 | log_test.info('Installing OLT app') |
| 2030 | OnosCtrl.install_app(self.olt_app_file) |
| 2031 | time.sleep(5) |
| 2032 | log_test.info('Adding subscribers through OLT app') |
| 2033 | self.config_olt(switch_map) |
| 2034 | olt_configured = True |
| 2035 | time.sleep(5) |
| 2036 | devices_list = self.voltha.get_devices() |
| 2037 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT, "restart_onu_device",)) |
| 2038 | thread2 = threading.Thread(target = self.voltha.restart_device, args = (onu_device_id,)) |
| 2039 | thread1.start() |
| 2040 | time.sleep(randint(1,2)) |
| 2041 | log_test.info('Restart the ponsim oon device during tls auth flow check on voltha') |
| 2042 | thread2.start() |
| 2043 | time.sleep(10) |
| 2044 | thread1.join() |
| 2045 | thread2.join() |
| 2046 | try: |
| 2047 | # assert_equal(status, True) |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 2048 | assert_equal(self.success, True) |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 2049 | time.sleep(10) |
| 2050 | finally: |
| 2051 | self.voltha.disable_device(device_id, delete = True) |
| 2052 | df.callback(0) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 2053 | reactor.callLater(0, tls_flow_check_with_disable_olt_device_scenario, df) |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 2054 | return df |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 2055 | |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 2056 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 2057 | def test_subscriber_with_voltha_for_eap_tls_authentication_performing_multiple_times_restart_of_onu(self): |
| 2058 | """ |
| 2059 | Test Method: |
| 2060 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2061 | 1. OLT and ONU is detected and validated. |
| 2062 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 2063 | 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 2064 | 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius. |
| 2065 | 6. Verify that subscriber authenticated successfully. |
| 2066 | 7. Restart onu which is seen in voltha and issue tls auth packets from subscriber. |
| 2067 | 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius. |
| 2068 | 9. Verify that subscriber authentication is unsuccessful.. |
| 2069 | 10. Repeat steps from 3 to 9 for 10 times and finally verify tls flow |
| 2070 | """ |
| 2071 | df = defer.Deferred() |
| 2072 | no_iterations = 10 |
| 2073 | def tls_flow_check_operating_olt_state(df): |
| 2074 | aaa_app = ["org.opencord.aaa"] |
| 2075 | log_test.info('Enabling ponsim_olt') |
| 2076 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 2077 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 2078 | devices_list = self.voltha.get_devices() |
| 2079 | log_test.info('All available devices on voltha = %s'%devices_list['items']) |
| 2080 | |
| 2081 | onu_device_id = devices_list['items'][1]['id'] |
| 2082 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 2083 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 2084 | time.sleep(10) |
| 2085 | switch_map = None |
| 2086 | olt_configured = False |
| 2087 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 2088 | log_test.info('Installing OLT app') |
| 2089 | OnosCtrl.install_app(self.olt_app_file) |
| 2090 | time.sleep(5) |
| 2091 | log_test.info('Adding subscribers through OLT app') |
| 2092 | self.config_olt(switch_map) |
| 2093 | olt_configured = True |
| 2094 | time.sleep(5) |
| 2095 | devices_list = self.voltha.get_devices() |
| 2096 | for i in range(no_iterations): |
| 2097 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT, "restart_onu_device",)) |
| 2098 | thread2 = threading.Thread(target = self.voltha.restart_device, args = (onu_device_id,)) |
| 2099 | thread1.start() |
| 2100 | time.sleep(randint(1,2)) |
| 2101 | log_test.info('Restart the ponsim oon device during tls auth flow check on voltha') |
| 2102 | thread2.start() |
| 2103 | time.sleep(10) |
| 2104 | thread1.join() |
| 2105 | thread2.join() |
| 2106 | auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT) |
| 2107 | try: |
| 2108 | # assert_equal(status, True) |
| 2109 | assert_equal(auth_status, True) |
| 2110 | assert_equal(self.success, True) |
| 2111 | time.sleep(10) |
| 2112 | finally: |
| 2113 | self.voltha.disable_device(device_id, delete = True) |
| 2114 | df.callback(0) |
| 2115 | reactor.callLater(0, tls_flow_check_operating_olt_state, df) |
| 2116 | return df |
| 2117 | |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 2118 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 2119 | def test_two_subscribers_with_voltha_for_eap_tls_authentication(self): |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 2120 | """ |
| 2121 | Test Method: |
| 2122 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2123 | 1. OLT is detected and ONU ports(nni and 2 uni's) are being seen. |
| 2124 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 2125 | 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 2126 | 4. Validate that eap tls valid auth packets are being exchanged between two subscriber, onos and freeradius. |
| 2127 | 5. Verify that two subscribers are authenticated successfully. |
| 2128 | """ |
| 2129 | |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 2130 | df = defer.Deferred() |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 2131 | def tls_flow_check_on_two_subscribers_same_olt_device(df): |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 2132 | aaa_app = ["org.opencord.aaa"] |
| 2133 | log_test.info('Enabling ponsim_olt') |
| 2134 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 2135 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 2136 | devices_list = self.voltha.get_devices() |
| 2137 | log_test.info('All available devices on voltha = %s'%devices_list['items']) |
| 2138 | |
| 2139 | onu_device_id = devices_list['items'][1]['id'] |
| 2140 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 2141 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 2142 | time.sleep(10) |
| 2143 | switch_map = None |
| 2144 | olt_configured = False |
| 2145 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 2146 | log_test.info('Installing OLT app') |
| 2147 | OnosCtrl.install_app(self.olt_app_file) |
| 2148 | time.sleep(5) |
| 2149 | log_test.info('Adding subscribers through OLT app') |
| 2150 | self.config_olt(switch_map) |
| 2151 | olt_configured = True |
| 2152 | time.sleep(5) |
| 2153 | devices_list = self.voltha.get_devices() |
| 2154 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT,)) |
| 2155 | thread2 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_2_RX_DEFAULT,)) |
| 2156 | thread1.start() |
| 2157 | time.sleep(randint(1,2)) |
| 2158 | log_test.info('Initiating tls auth packets from one more subscriber on same olt device which is deteced on voltha') |
| 2159 | thread2.start() |
| 2160 | time.sleep(10) |
| 2161 | thread1.join() |
| 2162 | thread2.join() |
| 2163 | try: |
| 2164 | # assert_equal(status, True) |
| 2165 | assert_equal(self.success, True) |
| 2166 | time.sleep(10) |
| 2167 | finally: |
| 2168 | self.voltha.disable_device(device_id, delete = True) |
| 2169 | df.callback(0) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 2170 | 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] | 2171 | return df |
| 2172 | |
| 2173 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 2174 | 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] | 2175 | """ |
| 2176 | Test Method: |
| 2177 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2178 | 1. OLT is detected and ONU ports(nni and 2 uni's) are being seen. |
| 2179 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 2180 | 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 2181 | 4. Validate that two valid certificates are being exchanged between two subscriber, onos and freeradius. |
| 2182 | 5. Verify that two subscribers are not authenticated. |
| 2183 | """ |
| 2184 | |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 2185 | df = defer.Deferred() |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 2186 | def tls_flow_check_on_two_subscribers_same_olt_device(df): |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 2187 | aaa_app = ["org.opencord.aaa"] |
| 2188 | log_test.info('Enabling ponsim_olt') |
| 2189 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 2190 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 2191 | devices_list = self.voltha.get_devices() |
| 2192 | log_test.info('All available devices on voltha = %s'%devices_list['items']) |
| 2193 | |
| 2194 | onu_device_id = devices_list['items'][1]['id'] |
| 2195 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 2196 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 2197 | time.sleep(10) |
| 2198 | switch_map = None |
| 2199 | olt_configured = False |
| 2200 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 2201 | log_test.info('Installing OLT app') |
| 2202 | OnosCtrl.install_app(self.olt_app_file) |
| 2203 | time.sleep(5) |
| 2204 | log_test.info('Adding subscribers through OLT app') |
| 2205 | self.config_olt(switch_map) |
| 2206 | olt_configured = True |
| 2207 | time.sleep(5) |
| 2208 | devices_list = self.voltha.get_devices() |
| 2209 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT,)) |
| 2210 | thread2 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_2_RX_DEFAULT, "same_cert",)) |
| 2211 | thread1.start() |
| 2212 | time.sleep(randint(1,2)) |
| 2213 | log_test.info('Initiating tls auth packets from one more subscriber on same olt device which is deteced on voltha') |
| 2214 | thread2.start() |
| 2215 | time.sleep(10) |
| 2216 | thread1.join() |
| 2217 | thread2.join() |
| 2218 | try: |
| 2219 | # assert_equal(status, True) |
| 2220 | assert_equal(self.success, True) |
| 2221 | time.sleep(10) |
| 2222 | finally: |
| 2223 | self.voltha.disable_device(device_id, delete = True) |
| 2224 | df.callback(0) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 2225 | 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] | 2226 | return df |
| 2227 | |
Chetan Gaonker | fe1048f | 2017-06-13 20:16:25 +0000 | [diff] [blame] | 2228 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 2229 | 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] | 2230 | """ |
| 2231 | Test Method: |
| 2232 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2233 | 1. OLT is detected and ONU ports(nni and 2 uni's) are being seen. |
| 2234 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 2235 | 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 2236 | 4. Validate that eap tls valid auth packets are being exchanged between valid subscriber, onos and freeradius. |
| 2237 | 5. Validate that eap tls valid auth packets are being exchanged between invalid client, onos and freeradius. |
| 2238 | 6. Verify that valid subscriber authenticated successfully. |
| 2239 | 7. Verify that invalid subscriber are not authenticated successfully. |
| 2240 | """ |
| 2241 | |
Chetan Gaonker | fe1048f | 2017-06-13 20:16:25 +0000 | [diff] [blame] | 2242 | df = defer.Deferred() |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 2243 | def tls_flow_check_on_two_subscribers_same_olt_device(df): |
Chetan Gaonker | fe1048f | 2017-06-13 20:16:25 +0000 | [diff] [blame] | 2244 | aaa_app = ["org.opencord.aaa"] |
| 2245 | log_test.info('Enabling ponsim_olt') |
| 2246 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 2247 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 2248 | devices_list = self.voltha.get_devices() |
| 2249 | log_test.info('All available devices on voltha = %s'%devices_list['items']) |
| 2250 | |
| 2251 | onu_device_id = devices_list['items'][1]['id'] |
| 2252 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 2253 | voltha = VolthaCtrl(**self.voltha_attrs) |
Chetan Gaonker | fe1048f | 2017-06-13 20:16:25 +0000 | [diff] [blame] | 2254 | time.sleep(10) |
| 2255 | switch_map = None |
| 2256 | olt_configured = False |
| 2257 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 2258 | log_test.info('Installing OLT app') |
| 2259 | OnosCtrl.install_app(self.olt_app_file) |
| 2260 | time.sleep(5) |
| 2261 | log_test.info('Adding subscribers through OLT app') |
| 2262 | self.config_olt(switch_map) |
| 2263 | olt_configured = True |
| 2264 | time.sleep(5) |
| 2265 | devices_list = self.voltha.get_devices() |
| 2266 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT,)) |
| 2267 | thread2 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_2_RX_DEFAULT, "no_cert",)) |
| 2268 | thread1.start() |
| 2269 | time.sleep(randint(1,2)) |
| 2270 | log_test.info('Initiating tls auth packets from one more subscriber on same olt device which is deteced on voltha') |
| 2271 | thread2.start() |
| 2272 | time.sleep(10) |
| 2273 | thread1.join() |
| 2274 | thread2.join() |
| 2275 | try: |
| 2276 | # assert_equal(status, True) |
| 2277 | assert_equal(self.success, True) |
| 2278 | time.sleep(10) |
| 2279 | finally: |
| 2280 | self.voltha.disable_device(device_id, delete = True) |
| 2281 | df.callback(0) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 2282 | 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] | 2283 | return df |
| 2284 | |
| 2285 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 2286 | 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] | 2287 | """ |
| 2288 | Test Method: |
| 2289 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2290 | 1. OLT is detected and ONU ports(nni and 2 uni's) are being seen. |
| 2291 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 2292 | 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 2293 | 4. Validate that eap tls valid auth packets are being exchanged between valid subscriber, onos and freeradius. |
| 2294 | 5. Validate that eap tls invalid cert auth packets are being exchanged between invalid subscriber, onos and freeradius. |
| 2295 | 6. Verify that valid subscriber authenticated successfully. |
| 2296 | 7. Verify that invalid subscriber are not authenticated successfully. |
| 2297 | """ |
| 2298 | |
Chetan Gaonker | fe1048f | 2017-06-13 20:16:25 +0000 | [diff] [blame] | 2299 | df = defer.Deferred() |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 2300 | def tls_flow_check_on_two_subscribers_same_olt_device(df): |
Chetan Gaonker | fe1048f | 2017-06-13 20:16:25 +0000 | [diff] [blame] | 2301 | aaa_app = ["org.opencord.aaa"] |
| 2302 | log_test.info('Enabling ponsim_olt') |
| 2303 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 2304 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 2305 | devices_list = self.voltha.get_devices() |
| 2306 | log_test.info('All available devices on voltha = %s'%devices_list['items']) |
| 2307 | |
| 2308 | onu_device_id = devices_list['items'][1]['id'] |
| 2309 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 2310 | voltha = VolthaCtrl(**self.voltha_attrs) |
Chetan Gaonker | fe1048f | 2017-06-13 20:16:25 +0000 | [diff] [blame] | 2311 | time.sleep(10) |
| 2312 | switch_map = None |
| 2313 | olt_configured = False |
| 2314 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 2315 | log_test.info('Installing OLT app') |
| 2316 | OnosCtrl.install_app(self.olt_app_file) |
| 2317 | time.sleep(5) |
| 2318 | log_test.info('Adding subscribers through OLT app') |
| 2319 | self.config_olt(switch_map) |
| 2320 | olt_configured = True |
| 2321 | time.sleep(5) |
| 2322 | devices_list = self.voltha.get_devices() |
| 2323 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT,)) |
| 2324 | thread2 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_2_RX_DEFAULT, "invalid_cert",)) |
| 2325 | thread1.start() |
| 2326 | time.sleep(randint(1,2)) |
| 2327 | log_test.info('Initiating tls auth packets from one more subscriber on same olt device which is deteced on voltha') |
| 2328 | thread2.start() |
| 2329 | time.sleep(10) |
| 2330 | thread1.join() |
| 2331 | thread2.join() |
| 2332 | try: |
| 2333 | # assert_equal(status, True) |
| 2334 | assert_equal(self.success, True) |
| 2335 | time.sleep(10) |
| 2336 | finally: |
| 2337 | self.voltha.disable_device(device_id, delete = True) |
| 2338 | df.callback(0) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 2339 | 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] | 2340 | return df |
| 2341 | |
| 2342 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 2343 | 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] | 2344 | """ |
| 2345 | Test Method: |
| 2346 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2347 | 1. OLT and ONU is detected and validated. |
| 2348 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 2349 | 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 2350 | 5. Validate that eap tls packets are being exchanged between two subscriber, onos and freeradius. |
| 2351 | 6. Verify that subscriber authenticated successfully. |
| 2352 | 7. Disable one of the uni port which is seen in voltha and issue tls auth packets from subscriber. |
| 2353 | 8. Validate that eap tls packets are not being exchanged between one subscriber, onos and freeradius. |
| 2354 | 9. Verify that subscriber authentication is unsuccessful.. |
| 2355 | 10. Verify that other subscriber authenticated successfully. |
| 2356 | """ |
| 2357 | |
Chetan Gaonker | fe1048f | 2017-06-13 20:16:25 +0000 | [diff] [blame] | 2358 | df = defer.Deferred() |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 2359 | def tls_flow_check_on_two_subscribers_same_olt_device(df): |
Chetan Gaonker | fe1048f | 2017-06-13 20:16:25 +0000 | [diff] [blame] | 2360 | aaa_app = ["org.opencord.aaa"] |
| 2361 | log_test.info('Enabling ponsim_olt') |
| 2362 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 2363 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 2364 | devices_list = self.voltha.get_devices() |
| 2365 | log_test.info('All available devices on voltha = %s'%devices_list['items']) |
| 2366 | |
| 2367 | onu_device_id = devices_list['items'][1]['id'] |
| 2368 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 2369 | voltha = VolthaCtrl(**self.voltha_attrs) |
Chetan Gaonker | fe1048f | 2017-06-13 20:16:25 +0000 | [diff] [blame] | 2370 | time.sleep(10) |
| 2371 | switch_map = None |
| 2372 | olt_configured = False |
| 2373 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 2374 | log_test.info('Installing OLT app') |
| 2375 | OnosCtrl.install_app(self.olt_app_file) |
| 2376 | time.sleep(5) |
| 2377 | log_test.info('Adding subscribers through OLT app') |
| 2378 | self.config_olt(switch_map) |
| 2379 | olt_configured = True |
| 2380 | time.sleep(5) |
| 2381 | devices_list = self.voltha.get_devices() |
| 2382 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT,)) |
| 2383 | thread2 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_2_RX_DEFAULT, "uni_port_admin_down",)) |
| 2384 | thread1.start() |
| 2385 | time.sleep(randint(1,2)) |
| 2386 | log_test.info('Initiating tls auth packets from one more subscriber on same olt device which is deteced on voltha') |
| 2387 | thread2.start() |
| 2388 | time.sleep(10) |
| 2389 | thread1.join() |
| 2390 | thread2.join() |
| 2391 | try: |
| 2392 | # assert_equal(status, True) |
| 2393 | assert_equal(self.success, True) |
| 2394 | time.sleep(10) |
| 2395 | finally: |
| 2396 | self.voltha.disable_device(device_id, delete = True) |
| 2397 | df.callback(0) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 2398 | 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] | 2399 | return df |
| 2400 | |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 2401 | def test_3_subscribers_with_voltha_for_eap_tls_authentication(self): |
| 2402 | """ |
| 2403 | Test Method: |
| 2404 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2405 | 1. OLT and ONU is detected and validated. |
| 2406 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 2407 | 3. Issue auth request packets from CORD TESTER voltha test module acting as multipe subscribers (3 subscribers) |
| 2408 | 4. Validate that eap tls valid auth packets are being exchanged between subscriber, onos and freeradius. |
| 2409 | 5. Verify that subscriber is authenticated successfully. |
| 2410 | """ |
| 2411 | """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each""" |
| 2412 | num_subscribers = 3 |
| 2413 | num_channels = 1 |
| 2414 | services = ('TLS') |
| 2415 | cbs = (self.tls_flow_check, None, None) |
| 2416 | self.voltha_subscribers(services, cbs = cbs, |
| 2417 | num_subscribers = num_subscribers, |
| 2418 | num_channels = num_channels) |
| 2419 | |
| 2420 | def test_5_subscribers_with_voltha_for_eap_tls_authentication(self): |
| 2421 | """ |
| 2422 | Test Method: |
| 2423 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2424 | 1. OLT and ONU is detected and validated. |
| 2425 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 2426 | 3. Issue auth request packets from CORD TESTER voltha test module acting as multipe subscribers (5 subscriber) |
| 2427 | 4. Validate that eap tls valid auth packets are being exchanged between subscriber, onos and freeradius. |
| 2428 | 5. Verify that subscriber is authenticated successfully. |
| 2429 | """ |
| 2430 | """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each""" |
| 2431 | num_subscribers = 5 |
| 2432 | num_channels = 1 |
| 2433 | services = ('TLS') |
| 2434 | cbs = (self.tls_flow_check, None, None) |
| 2435 | self.voltha_subscribers(services, cbs = cbs, |
| 2436 | num_subscribers = num_subscribers, |
| 2437 | num_channels = num_channels) |
| 2438 | |
| 2439 | def test_9_subscribers_with_voltha_for_eap_tls_authentication(self): |
| 2440 | """ |
| 2441 | Test Method: |
| 2442 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2443 | 1. OLT and ONU is detected and validated. |
| 2444 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 2445 | 3. Issue auth request packets from CORD TESTER voltha test module acting as multipe subscribers (9 subscriber) |
| 2446 | 4. Validate that eap tls valid auth packets are being exchanged between subscriber, onos and freeradius. |
| 2447 | 5. Verify that subscriber is authenticated successfully. |
| 2448 | """ |
| 2449 | """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each""" |
| 2450 | num_subscribers = 9 |
| 2451 | num_channels = 1 |
| 2452 | services = ('TLS') |
| 2453 | cbs = (self.tls_flow_check, None, None) |
| 2454 | self.voltha_subscribers(services, cbs = cbs, |
| 2455 | num_subscribers = num_subscribers, |
| 2456 | num_channels = num_channels) |
| 2457 | |
Chetan Gaonker | fe1048f | 2017-06-13 20:16:25 +0000 | [diff] [blame] | 2458 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 2459 | def test_subscriber_with_voltha_for_dhcp_request(self): |
| 2460 | """ |
| 2461 | Test Method: |
| 2462 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2463 | 1. OLT and ONU is detected and validated. |
| 2464 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 2465 | 3. Send dhcp request from residential subscrber to dhcp server which is running as onos app. |
| 2466 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 2467 | """ |
| 2468 | |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 2469 | df = defer.Deferred() |
| 2470 | def dhcp_flow_check_scenario(df): |
| 2471 | log_test.info('Enabling ponsim_olt') |
| 2472 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 2473 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 2474 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 2475 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 2476 | time.sleep(10) |
| 2477 | switch_map = None |
| 2478 | olt_configured = False |
| 2479 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 2480 | log_test.info('Installing OLT app') |
| 2481 | OnosCtrl.install_app(self.olt_app_file) |
| 2482 | time.sleep(5) |
| 2483 | log_test.info('Adding subscribers through OLT app') |
| 2484 | self.config_olt(switch_map) |
| 2485 | olt_configured = True |
| 2486 | time.sleep(5) |
| 2487 | dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT) |
| 2488 | try: |
| 2489 | assert_equal(dhcp_status, True) |
| 2490 | #assert_equal(status, True) |
| 2491 | time.sleep(10) |
| 2492 | finally: |
| 2493 | self.remove_olt(switch_map) |
| 2494 | self.voltha.disable_device(device_id, delete = True) |
| 2495 | df.callback(0) |
| 2496 | |
| 2497 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 2498 | return df |
| 2499 | |
| 2500 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 2501 | def test_subscriber_with_voltha_for_dhcp_request_with_invalid_broadcast_source_mac(self): |
| 2502 | """ |
| 2503 | Test Method: |
| 2504 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2505 | 1. OLT and ONU is detected and validated. |
| 2506 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 2507 | 3. Send dhcp request with invalid source mac broadcast from residential subscrber to dhcp server which is running as onos app. |
| 2508 | 4. Verify that subscriber should not get ip from dhcp server. |
| 2509 | """ |
| 2510 | |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 2511 | df = defer.Deferred() |
| 2512 | def dhcp_flow_check_scenario(df): |
| 2513 | log_test.info('Enabling ponsim_olt') |
| 2514 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 2515 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 2516 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 2517 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 2518 | time.sleep(10) |
| 2519 | switch_map = None |
| 2520 | olt_configured = False |
| 2521 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 2522 | log_test.info('Installing OLT app') |
| 2523 | OnosCtrl.install_app(self.olt_app_file) |
| 2524 | time.sleep(5) |
| 2525 | log_test.info('Adding subscribers through OLT app') |
| 2526 | self.config_olt(switch_map) |
| 2527 | olt_configured = True |
| 2528 | time.sleep(5) |
| 2529 | dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "invalid_src_mac_broadcast") |
| 2530 | try: |
| 2531 | assert_equal(dhcp_status, True) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 2532 | assert_equal(self.success, True) |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 2533 | #assert_equal(status, True) |
| 2534 | time.sleep(10) |
| 2535 | finally: |
| 2536 | self.voltha.disable_device(device_id, delete = True) |
| 2537 | self.remove_olt(switch_map) |
| 2538 | df.callback(0) |
| 2539 | |
| 2540 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 2541 | return df |
| 2542 | |
| 2543 | |
| 2544 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 2545 | def test_subscriber_with_voltha_for_dhcp_request_with_invalid_multicast_source_mac(self): |
| 2546 | """ |
| 2547 | Test Method: |
| 2548 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2549 | 1. OLT and ONU is detected and validated. |
| 2550 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 2551 | 3. Send dhcp request with invalid source mac multicast from residential subscrber to dhcp server which is running as onos app. |
| 2552 | 4. Verify that subscriber should not get ip from dhcp server. |
| 2553 | """ |
| 2554 | |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 2555 | df = defer.Deferred() |
| 2556 | def dhcp_flow_check_scenario(df): |
| 2557 | log_test.info('Enabling ponsim_olt') |
| 2558 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 2559 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 2560 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 2561 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 2562 | time.sleep(10) |
| 2563 | switch_map = None |
| 2564 | olt_configured = False |
| 2565 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 2566 | log_test.info('Installing OLT app') |
| 2567 | OnosCtrl.install_app(self.olt_app_file) |
| 2568 | time.sleep(5) |
| 2569 | log_test.info('Adding subscribers through OLT app') |
| 2570 | self.config_olt(switch_map) |
| 2571 | olt_configured = True |
| 2572 | time.sleep(5) |
| 2573 | dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "invalid_src_mac_multicast") |
| 2574 | try: |
| 2575 | assert_equal(dhcp_status, True) |
| 2576 | #assert_equal(status, True) |
| 2577 | time.sleep(10) |
| 2578 | finally: |
| 2579 | self.voltha.disable_device(device_id, delete = True) |
| 2580 | self.remove_olt(switch_map) |
| 2581 | df.callback(0) |
| 2582 | |
| 2583 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 2584 | return df |
| 2585 | |
| 2586 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 2587 | def test_subscriber_with_voltha_for_dhcp_request_with_invalid_source_mac(self): |
| 2588 | """ |
| 2589 | Test Method: |
| 2590 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2591 | 1. OLT and ONU is detected and validated. |
| 2592 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 2593 | 3. Send dhcp request with invalid source mac zero from residential subscrber to dhcp server which is running as onos app. |
| 2594 | 4. Verify that subscriber should not get ip from dhcp server. |
| 2595 | """ |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 2596 | df = defer.Deferred() |
| 2597 | def dhcp_flow_check_scenario(df): |
| 2598 | log_test.info('Enabling ponsim_olt') |
| 2599 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 2600 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 2601 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 2602 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 2603 | time.sleep(10) |
| 2604 | switch_map = None |
| 2605 | olt_configured = False |
| 2606 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 2607 | log_test.info('Installing OLT app') |
| 2608 | OnosCtrl.install_app(self.olt_app_file) |
| 2609 | time.sleep(5) |
| 2610 | log_test.info('Adding subscribers through OLT app') |
| 2611 | self.config_olt(switch_map) |
| 2612 | olt_configured = True |
| 2613 | time.sleep(5) |
| 2614 | dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "invalid_src_mac_junk") |
| 2615 | try: |
| 2616 | assert_equal(dhcp_status, True) |
| 2617 | #assert_equal(status, True) |
| 2618 | time.sleep(10) |
| 2619 | finally: |
| 2620 | self.voltha.disable_device(device_id, delete = True) |
| 2621 | self.remove_olt(switch_map) |
| 2622 | df.callback(0) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 2623 | |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 2624 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 2625 | return df |
| 2626 | |
| 2627 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 2628 | def test_subscriber_with_voltha_for_dhcp_request_and_release(self): |
| 2629 | """ |
| 2630 | Test Method: |
| 2631 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2632 | 1. OLT and ONU is detected and validated. |
| 2633 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 2634 | 3. Send dhcp request from residential subscrber to dhcp server which is running as onos app. |
| 2635 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 2636 | 5. Send dhcp release from residential subscrber to dhcp server which is running as onos app. |
| 2637 | 6 Verify that subscriber should not get ip from dhcp server, ping to gateway. |
| 2638 | """ |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 2639 | df = defer.Deferred() |
| 2640 | def dhcp_flow_check_scenario(df): |
| 2641 | log_test.info('Enabling ponsim_olt') |
| 2642 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 2643 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 2644 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 2645 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame] | 2646 | time.sleep(10) |
| 2647 | switch_map = None |
| 2648 | olt_configured = False |
| 2649 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 2650 | log_test.info('Installing OLT app') |
| 2651 | OnosCtrl.install_app(self.olt_app_file) |
| 2652 | time.sleep(5) |
| 2653 | log_test.info('Adding subscribers through OLT app') |
| 2654 | self.config_olt(switch_map) |
| 2655 | olt_configured = True |
| 2656 | time.sleep(5) |
| 2657 | dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "request_release") |
| 2658 | try: |
| 2659 | assert_equal(dhcp_status, True) |
| 2660 | #assert_equal(status, True) |
| 2661 | time.sleep(10) |
| 2662 | finally: |
| 2663 | self.voltha.disable_device(device_id, delete = True) |
| 2664 | self.remove_olt(switch_map) |
| 2665 | df.callback(0) |
| 2666 | |
| 2667 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 2668 | return df |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 2669 | |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 2670 | |
| 2671 | @deferred(TESTCASE_TIMEOUT) |
A.R Karthick | 57fa937 | 2017-05-24 12:47:03 -0700 | [diff] [blame] | 2672 | def test_subscriber_with_voltha_for_dhcp_starvation_positive_scenario(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 2673 | """ |
| 2674 | Test Method: |
| 2675 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2676 | 1. OLT and ONU is detected and validated. |
| 2677 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 2678 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 2679 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 2680 | 5. Repeat step 3 and 4 for 10 times. |
| 2681 | 6 Verify that subscriber should get ip from dhcp server. |
| 2682 | """ |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 2683 | df = defer.Deferred() |
| 2684 | def dhcp_flow_check_scenario(df): |
| 2685 | log_test.info('Enabling ponsim_olt') |
| 2686 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 2687 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 2688 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 2689 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 2690 | time.sleep(10) |
| 2691 | switch_map = None |
| 2692 | olt_configured = False |
| 2693 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 2694 | log_test.info('Installing OLT app') |
| 2695 | OnosCtrl.install_app(self.olt_app_file) |
| 2696 | time.sleep(5) |
| 2697 | log_test.info('Adding subscribers through OLT app') |
| 2698 | self.config_olt(switch_map) |
| 2699 | olt_configured = True |
| 2700 | time.sleep(5) |
| 2701 | dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "starvation_positive") |
| 2702 | try: |
| 2703 | assert_equal(dhcp_status, True) |
| 2704 | #assert_equal(status, True) |
| 2705 | time.sleep(10) |
| 2706 | finally: |
| 2707 | self.voltha.disable_device(device_id, delete = True) |
| 2708 | self.remove_olt(switch_map) |
| 2709 | df.callback(0) |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 2710 | |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 2711 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 2712 | return df |
| 2713 | |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 2714 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 2715 | def test_subscriber_with_voltha_for_dhcp_starvation_negative_scenario(self): |
| 2716 | """ |
| 2717 | Test Method: |
| 2718 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2719 | 1. OLT and ONU is detected and validated. |
| 2720 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 2721 | 3. Send dhcp request from residential subscriber without of pool ip to dhcp server which is running as onos app. |
| 2722 | 4. Verify that subscriber should not get ip from dhcp server. |
| 2723 | 5. Repeat steps 3 and 4 for 10 times. |
| 2724 | 6 Verify that subscriber should not get ip from dhcp server. |
| 2725 | """ |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 2726 | df = defer.Deferred() |
| 2727 | def dhcp_flow_check_scenario(df): |
| 2728 | log_test.info('Enabling ponsim_olt') |
| 2729 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 2730 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 2731 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 2732 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 2733 | time.sleep(10) |
| 2734 | switch_map = None |
| 2735 | olt_configured = False |
| 2736 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 2737 | log_test.info('Installing OLT app') |
| 2738 | OnosCtrl.install_app(self.olt_app_file) |
| 2739 | time.sleep(5) |
| 2740 | log_test.info('Adding subscribers through OLT app') |
| 2741 | self.config_olt(switch_map) |
| 2742 | olt_configured = True |
| 2743 | time.sleep(5) |
| 2744 | dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "starvation_negative") |
| 2745 | try: |
| 2746 | assert_equal(dhcp_status, True) |
| 2747 | #assert_equal(status, True) |
| 2748 | time.sleep(10) |
| 2749 | finally: |
| 2750 | self.voltha.disable_device(device_id, delete = True) |
| 2751 | self.remove_olt(switch_map) |
| 2752 | df.callback(0) |
| 2753 | |
| 2754 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 2755 | return df |
| 2756 | |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 2757 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 2758 | def test_subscriber_with_voltha_for_dhcp_sending_multiple_discover(self): |
| 2759 | """ |
| 2760 | Test Method: |
| 2761 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2762 | 1. OLT and ONU is detected and validated. |
| 2763 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 2764 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 2765 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 2766 | 5. Repeat step 3 for 50 times. |
| 2767 | 6 Verify that subscriber should get same ip which was received from 1st discover from dhcp server. |
| 2768 | """ |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 2769 | df = defer.Deferred() |
| 2770 | def dhcp_flow_check_scenario(df): |
| 2771 | log_test.info('Enabling ponsim_olt') |
| 2772 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 2773 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 2774 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 2775 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 2776 | time.sleep(10) |
| 2777 | switch_map = None |
| 2778 | olt_configured = False |
| 2779 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 2780 | log_test.info('Installing OLT app') |
| 2781 | OnosCtrl.install_app(self.olt_app_file) |
| 2782 | time.sleep(5) |
| 2783 | log_test.info('Adding subscribers through OLT app') |
| 2784 | self.config_olt(switch_map) |
| 2785 | olt_configured = True |
| 2786 | time.sleep(5) |
| 2787 | dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "multiple_discover") |
| 2788 | try: |
| 2789 | assert_equal(dhcp_status, True) |
| 2790 | #assert_equal(status, True) |
| 2791 | time.sleep(10) |
| 2792 | finally: |
| 2793 | self.voltha.disable_device(device_id, delete = True) |
| 2794 | self.remove_olt(switch_map) |
| 2795 | df.callback(0) |
| 2796 | |
| 2797 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 2798 | return df |
| 2799 | |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 2800 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 2801 | def test_subscriber_with_voltha_for_dhcp_sending_multiple_request(self): |
| 2802 | """ |
| 2803 | Test Method: |
| 2804 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2805 | 1. OLT and ONU is detected and validated. |
| 2806 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 2807 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 2808 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 2809 | 5. Send DHCP request to dhcp server which is running as onos app. |
| 2810 | 6. Repeat step 5 for 50 times. |
| 2811 | 7. Verify that subscriber should get same ip which was received from 1st discover from dhcp server. |
| 2812 | """ |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 2813 | df = defer.Deferred() |
| 2814 | def dhcp_flow_check_scenario(df): |
| 2815 | log_test.info('Enabling ponsim_olt') |
| 2816 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 2817 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 2818 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 2819 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 2820 | time.sleep(10) |
| 2821 | switch_map = None |
| 2822 | olt_configured = False |
| 2823 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 2824 | log_test.info('Installing OLT app') |
| 2825 | OnosCtrl.install_app(self.olt_app_file) |
| 2826 | time.sleep(5) |
| 2827 | log_test.info('Adding subscribers through OLT app') |
| 2828 | self.config_olt(switch_map) |
| 2829 | olt_configured = True |
| 2830 | time.sleep(5) |
| 2831 | dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "multiple_requests") |
| 2832 | try: |
| 2833 | assert_equal(dhcp_status, True) |
| 2834 | #assert_equal(status, True) |
| 2835 | time.sleep(10) |
| 2836 | finally: |
| 2837 | self.voltha.disable_device(device_id, delete = True) |
| 2838 | self.remove_olt(switch_map) |
| 2839 | df.callback(0) |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 2840 | |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 2841 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 2842 | return df |
| 2843 | |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 2844 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 2845 | def test_subscriber_with_voltha_for_dhcp_requesting_desired_ip_address(self): |
| 2846 | """ |
| 2847 | Test Method: |
| 2848 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2849 | 1. OLT and ONU is detected and validated. |
| 2850 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 2851 | 3. Send dhcp request with desired ip address from residential subscriber to dhcp server which is running as onos app. |
| 2852 | 4. Verify that subscriber get ip which was requested in step 3 from dhcp server successfully. |
| 2853 | """ |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 2854 | df = defer.Deferred() |
| 2855 | def dhcp_flow_check_scenario(df): |
| 2856 | log_test.info('Enabling ponsim_olt') |
| 2857 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 2858 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 2859 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 2860 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 2861 | time.sleep(10) |
| 2862 | switch_map = None |
| 2863 | olt_configured = False |
| 2864 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 2865 | log_test.info('Installing OLT app') |
| 2866 | OnosCtrl.install_app(self.olt_app_file) |
| 2867 | time.sleep(5) |
| 2868 | log_test.info('Adding subscribers through OLT app') |
| 2869 | self.config_olt(switch_map) |
| 2870 | olt_configured = True |
| 2871 | time.sleep(5) |
| 2872 | dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "desired_ip_address") |
| 2873 | try: |
| 2874 | assert_equal(dhcp_status, True) |
| 2875 | #assert_equal(status, True) |
| 2876 | time.sleep(10) |
| 2877 | finally: |
| 2878 | self.voltha.disable_device(device_id, delete = True) |
| 2879 | self.remove_olt(switch_map) |
| 2880 | df.callback(0) |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 2881 | |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 2882 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 2883 | return df |
| 2884 | |
| 2885 | @deferred(TESTCASE_TIMEOUT) |
| 2886 | 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] | 2887 | """ |
| 2888 | Test Method: |
| 2889 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2890 | 1. OLT and ONU is detected and validated. |
| 2891 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 2892 | 3. Send dhcp request with desired out of pool ip address from residential subscriber to dhcp server which is running as onos app. |
| 2893 | 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. |
| 2894 | """ |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 2895 | df = defer.Deferred() |
| 2896 | def dhcp_flow_check_scenario(df): |
| 2897 | log_test.info('Enabling ponsim_olt') |
| 2898 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 2899 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 2900 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 2901 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 2902 | time.sleep(10) |
| 2903 | switch_map = None |
| 2904 | olt_configured = False |
| 2905 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 2906 | log_test.info('Installing OLT app') |
| 2907 | OnosCtrl.install_app(self.olt_app_file) |
| 2908 | time.sleep(5) |
| 2909 | log_test.info('Adding subscribers through OLT app') |
| 2910 | self.config_olt(switch_map) |
| 2911 | olt_configured = True |
| 2912 | time.sleep(5) |
| 2913 | dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "desired_out_of_pool_ip_address") |
| 2914 | try: |
| 2915 | assert_equal(dhcp_status, True) |
| 2916 | #assert_equal(status, True) |
| 2917 | time.sleep(10) |
| 2918 | finally: |
| 2919 | self.voltha.disable_device(device_id, delete = True) |
| 2920 | self.remove_olt(switch_map) |
| 2921 | df.callback(0) |
| 2922 | |
| 2923 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 2924 | return df |
| 2925 | |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 2926 | @deferred(TESTCASE_TIMEOUT) |
| 2927 | def test_subscriber_with_voltha_deactivating_dhcp_app_in_onos(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 2928 | """ |
| 2929 | Test Method: |
| 2930 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2931 | 1. OLT and ONU is detected and validated. |
| 2932 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 2933 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 2934 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 2935 | 5. Deactivate dhcp server app in onos. |
| 2936 | 6. Repeat step 3. |
| 2937 | 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway. |
| 2938 | """ |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 2939 | df = defer.Deferred() |
| 2940 | dhcp_app = 'org.onosproject.dhcp' |
| 2941 | def dhcp_flow_check_scenario(df): |
| 2942 | log_test.info('Enabling ponsim_olt') |
| 2943 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 2944 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 2945 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 2946 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 2947 | time.sleep(10) |
| 2948 | switch_map = None |
| 2949 | olt_configured = False |
| 2950 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 2951 | log_test.info('Installing OLT app') |
| 2952 | OnosCtrl.install_app(self.olt_app_file) |
| 2953 | time.sleep(5) |
| 2954 | log_test.info('Adding subscribers through OLT app') |
| 2955 | self.config_olt(switch_map) |
| 2956 | olt_configured = True |
| 2957 | time.sleep(5) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 2958 | 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] | 2959 | thread2 = threading.Thread(target = self.deactivate_apps, args = (dhcp_app,)) |
| 2960 | log_test.info('Restart dhcp app in onos during client send discover to voltha') |
| 2961 | thread2.start() |
Thangavelu K S | 735a666 | 2017-06-15 18:08:23 +0000 | [diff] [blame] | 2962 | thread1.start() |
| 2963 | time.sleep(10) |
| 2964 | thread1.join() |
| 2965 | thread2.join() |
| 2966 | try: |
| 2967 | assert_equal(self.success, True) |
| 2968 | #assert_equal(status, True) |
| 2969 | time.sleep(10) |
| 2970 | finally: |
| 2971 | self.voltha.disable_device(device_id, delete = True) |
| 2972 | self.remove_olt(switch_map) |
| 2973 | df.callback(0) |
| 2974 | |
| 2975 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 2976 | return df |
| 2977 | |
| 2978 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 2979 | def test_subscriber_with_voltha_for_dhcp_renew_time(self): |
| 2980 | """ |
| 2981 | Test Method: |
| 2982 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 2983 | 1. OLT and ONU is detected and validated. |
| 2984 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 2985 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 2986 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 2987 | 5. Send dhcp renew packet to dhcp server which is running as onos app. |
| 2988 | 6. Repeat step 4. |
| 2989 | """ |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 2990 | |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 2991 | df = defer.Deferred() |
| 2992 | def dhcp_flow_check_scenario(df): |
| 2993 | log_test.info('Enabling ponsim_olt') |
| 2994 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 2995 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 2996 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 2997 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 2998 | time.sleep(10) |
| 2999 | switch_map = None |
| 3000 | olt_configured = False |
| 3001 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 3002 | log_test.info('Installing OLT app') |
| 3003 | OnosCtrl.install_app(self.olt_app_file) |
| 3004 | time.sleep(5) |
| 3005 | log_test.info('Adding subscribers through OLT app') |
| 3006 | self.config_olt(switch_map) |
| 3007 | olt_configured = True |
| 3008 | time.sleep(5) |
| 3009 | dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "dhcp_renew") |
| 3010 | try: |
| 3011 | assert_equal(dhcp_status, True) |
| 3012 | #assert_equal(status, True) |
| 3013 | time.sleep(10) |
| 3014 | finally: |
| 3015 | self.voltha.disable_device(device_id, delete = True) |
| 3016 | self.remove_olt(switch_map) |
| 3017 | df.callback(0) |
| 3018 | |
| 3019 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 3020 | return df |
| 3021 | |
| 3022 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 3023 | def test_subscriber_with_voltha_for_dhcp_rebind_time(self): |
| 3024 | """ |
| 3025 | Test Method: |
| 3026 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 3027 | 1. OLT and ONU is detected and validated. |
| 3028 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 3029 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 3030 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 3031 | 5. Send dhcp rebind packet to dhcp server which is running as onos app. |
| 3032 | 6. Repeat step 4. |
| 3033 | """ |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3034 | df = defer.Deferred() |
| 3035 | def dhcp_flow_check_scenario(df): |
| 3036 | log_test.info('Enabling ponsim_olt') |
| 3037 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 3038 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 3039 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 3040 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3041 | time.sleep(10) |
| 3042 | switch_map = None |
| 3043 | olt_configured = False |
| 3044 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 3045 | log_test.info('Installing OLT app') |
| 3046 | OnosCtrl.install_app(self.olt_app_file) |
| 3047 | time.sleep(5) |
| 3048 | log_test.info('Adding subscribers through OLT app') |
| 3049 | self.config_olt(switch_map) |
| 3050 | olt_configured = True |
| 3051 | time.sleep(5) |
| 3052 | dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "dhcp_rebind") |
| 3053 | try: |
| 3054 | assert_equal(dhcp_status, True) |
| 3055 | #assert_equal(status, True) |
| 3056 | time.sleep(10) |
| 3057 | finally: |
| 3058 | self.voltha.disable_device(device_id, delete = True) |
| 3059 | self.remove_olt(switch_map) |
| 3060 | df.callback(0) |
| 3061 | |
| 3062 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 3063 | return df |
| 3064 | |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3065 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3066 | def test_subscriber_with_voltha_for_dhcp_toggling_olt(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 3067 | """ |
| 3068 | Test Method: |
| 3069 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 3070 | 1. OLT and ONU is detected and validated. |
| 3071 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 3072 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 3073 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 3074 | 5. Disable olt devices which is being detected in voltha CLI. |
| 3075 | 6. Repeat step 3. |
| 3076 | 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway. |
| 3077 | """ |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3078 | df = defer.Deferred() |
| 3079 | dhcp_app = 'org.onosproject.dhcp' |
| 3080 | def dhcp_flow_check_scenario(df): |
| 3081 | log_test.info('Enabling ponsim_olt') |
| 3082 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 3083 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 3084 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 3085 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3086 | time.sleep(10) |
| 3087 | switch_map = None |
| 3088 | olt_configured = False |
| 3089 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 3090 | log_test.info('Installing OLT app') |
| 3091 | OnosCtrl.install_app(self.olt_app_file) |
| 3092 | time.sleep(5) |
| 3093 | log_test.info('Adding subscribers through OLT app') |
| 3094 | self.config_olt(switch_map) |
| 3095 | olt_configured = True |
| 3096 | time.sleep(5) |
| 3097 | thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT, "interrupting_dhcp_flows",)) |
| 3098 | thread2 = threading.Thread(target = self.voltha.disable_device, args = (device_id,False,)) |
| 3099 | log_test.info('Disable the olt device in during client send discover to voltha') |
| 3100 | thread2.start() |
| 3101 | # time.sleep(randint(0,1)) |
| 3102 | thread1.start() |
| 3103 | time.sleep(10) |
| 3104 | thread1.join() |
| 3105 | thread2.join() |
| 3106 | try: |
Chetan Gaonker | cf37f26 | 2017-06-19 19:11:11 +0000 | [diff] [blame] | 3107 | assert_equal(self.success, True) |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3108 | #assert_equal(status, True) |
| 3109 | time.sleep(10) |
| 3110 | finally: |
| 3111 | self.voltha.disable_device(device_id, delete = True) |
| 3112 | self.remove_olt(switch_map) |
| 3113 | df.callback(0) |
| 3114 | |
| 3115 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 3116 | return df |
| 3117 | |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3118 | @deferred(TESTCASE_TIMEOUT) |
| 3119 | def test_subscriber_with_voltha_for_dhcp_with_multiple_times_disabling_of_olt(self): |
| 3120 | """ |
| 3121 | Test Method: |
| 3122 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 3123 | 1. OLT and ONU is detected and validated. |
| 3124 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 3125 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 3126 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 3127 | 5. Disable olt devices which is being detected in voltha CLI. |
| 3128 | 6. Repeat step 3. |
| 3129 | 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway. |
| 3130 | 8. Repeat steps from 3 to 7 for 10 times and finally verify dhcp flow |
| 3131 | """ |
| 3132 | df = defer.Deferred() |
| 3133 | no_iterations = 10 |
| 3134 | dhcp_app = 'org.onosproject.dhcp' |
| 3135 | def dhcp_flow_check_scenario(df): |
| 3136 | log_test.info('Enabling ponsim_olt') |
| 3137 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 3138 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 3139 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 3140 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3141 | time.sleep(10) |
| 3142 | switch_map = None |
| 3143 | olt_configured = False |
| 3144 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 3145 | log_test.info('Installing OLT app') |
| 3146 | OnosCtrl.install_app(self.olt_app_file) |
| 3147 | time.sleep(5) |
| 3148 | log_test.info('Adding subscribers through OLT app') |
| 3149 | self.config_olt(switch_map) |
| 3150 | olt_configured = True |
| 3151 | time.sleep(5) |
| 3152 | for i in range(no_iterations): |
| 3153 | thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT, "interrupting_dhcp_flows",)) |
| 3154 | thread2 = threading.Thread(target = self.voltha.disable_device, args = (device_id,False,)) |
| 3155 | log_test.info('Disable the olt device in during client send discover to voltha') |
| 3156 | thread2.start() |
| 3157 | # time.sleep(randint(0,1)) |
| 3158 | thread1.start() |
| 3159 | time.sleep(10) |
| 3160 | thread1.join() |
| 3161 | thread2.join() |
| 3162 | dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT) |
| 3163 | try: |
| 3164 | assert_equal(self.success, True) |
| 3165 | assert_equal(dhcp_status, True) |
| 3166 | #assert_equal(status, True) |
| 3167 | time.sleep(10) |
| 3168 | finally: |
| 3169 | self.voltha.disable_device(device_id, delete = True) |
| 3170 | self.remove_olt(switch_map) |
| 3171 | df.callback(0) |
| 3172 | |
| 3173 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 3174 | return df |
| 3175 | |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3176 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3177 | def test_subscriber_with_voltha_for_dhcp_toggling_olt(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 3178 | """ |
| 3179 | Test Method: |
| 3180 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 3181 | 1. OLT and ONU is detected and validated. |
| 3182 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 3183 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 3184 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 3185 | 5. Disable olt devices which is being detected in voltha CLI. |
| 3186 | 6. Repeat step 3. |
| 3187 | 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway. |
| 3188 | 8. Enable olt devices which is being detected in voltha CLI. |
| 3189 | 9. Repeat steps 3 and 4. |
| 3190 | """ |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3191 | df = defer.Deferred() |
| 3192 | dhcp_app = 'org.onosproject.dhcp' |
| 3193 | def dhcp_flow_check_scenario(df): |
| 3194 | log_test.info('Enabling ponsim_olt') |
| 3195 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 3196 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 3197 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 3198 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3199 | time.sleep(10) |
| 3200 | switch_map = None |
| 3201 | olt_configured = False |
| 3202 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 3203 | log_test.info('Installing OLT app') |
| 3204 | OnosCtrl.install_app(self.olt_app_file) |
| 3205 | time.sleep(5) |
| 3206 | log_test.info('Adding subscribers through OLT app') |
| 3207 | self.config_olt(switch_map) |
| 3208 | olt_configured = True |
| 3209 | time.sleep(5) |
| 3210 | thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT, "interrupting_dhcp_flows",)) |
| 3211 | thread2 = threading.Thread(target = self.voltha.restart_device, args = (device_id,)) |
| 3212 | thread2.start() |
| 3213 | thread1.start() |
| 3214 | time.sleep(10) |
| 3215 | thread1.join() |
| 3216 | thread2.join() |
| 3217 | try: |
Chetan Gaonker | cf37f26 | 2017-06-19 19:11:11 +0000 | [diff] [blame] | 3218 | assert_equal(self.success, True) |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3219 | #assert_equal(status, True) |
| 3220 | time.sleep(10) |
| 3221 | finally: |
| 3222 | self.voltha.disable_device(device_id, delete = True) |
| 3223 | self.remove_olt(switch_map) |
| 3224 | df.callback(0) |
| 3225 | |
| 3226 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 3227 | return df |
| 3228 | |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3229 | @deferred(TESTCASE_TIMEOUT) |
| 3230 | def test_subscriber_with_voltha_for_dhcp_toggling_olt_multiple_times(self): |
| 3231 | """ |
| 3232 | Test Method: |
| 3233 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 3234 | 1. OLT and ONU is detected and validated. |
| 3235 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 3236 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 3237 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 3238 | 5. Disable olt devices which is being detected in voltha CLI. |
| 3239 | 6. Repeat step 3. |
| 3240 | 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway. |
| 3241 | 8. Enable olt devices which is being detected in voltha CLI. |
| 3242 | 9. Repeat steps 3 and 4. |
| 3243 | """ |
| 3244 | |
| 3245 | df = defer.Deferred() |
| 3246 | no_iterations = 10 |
| 3247 | dhcp_app = 'org.onosproject.dhcp' |
| 3248 | def dhcp_flow_check_scenario(df): |
| 3249 | log_test.info('Enabling ponsim_olt') |
| 3250 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 3251 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 3252 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 3253 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3254 | time.sleep(10) |
| 3255 | switch_map = None |
| 3256 | olt_configured = False |
| 3257 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 3258 | log_test.info('Installing OLT app') |
| 3259 | OnosCtrl.install_app(self.olt_app_file) |
| 3260 | time.sleep(5) |
| 3261 | log_test.info('Adding subscribers through OLT app') |
| 3262 | self.config_olt(switch_map) |
| 3263 | olt_configured = True |
| 3264 | time.sleep(5) |
| 3265 | for i in range(no_iterations): |
| 3266 | thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT, "interrupting_dhcp_flows",)) |
| 3267 | thread2 = threading.Thread(target = self.voltha.restart_device, args = (device_id,)) |
| 3268 | thread2.start() |
| 3269 | thread1.start() |
| 3270 | time.sleep(10) |
| 3271 | thread1.join() |
| 3272 | thread2.join() |
| 3273 | dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT) |
| 3274 | try: |
| 3275 | assert_equal(dhcp_status, True) |
| 3276 | #assert_equal(status, True) |
| 3277 | assert_equal(self.success, True) |
| 3278 | time.sleep(10) |
| 3279 | finally: |
| 3280 | self.voltha.disable_device(device_id, delete = True) |
| 3281 | self.remove_olt(switch_map) |
| 3282 | df.callback(0) |
| 3283 | |
| 3284 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 3285 | return df |
| 3286 | |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3287 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3288 | def test_subscriber_with_voltha_for_dhcp_disabling_onu_port(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 3289 | """ |
| 3290 | Test Method: |
| 3291 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 3292 | 1. OLT and ONU is detected and validated. |
| 3293 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 3294 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 3295 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 3296 | 5. Disable onu port which is being detected in voltha CLI. |
| 3297 | 6. Repeat step 3. |
| 3298 | 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway. |
| 3299 | """ |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3300 | df = defer.Deferred() |
| 3301 | dhcp_app = 'org.onosproject.dhcp' |
| 3302 | def dhcp_flow_check_scenario(df): |
| 3303 | log_test.info('Enabling ponsim_olt') |
| 3304 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 3305 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 3306 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 3307 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3308 | time.sleep(10) |
| 3309 | switch_map = None |
| 3310 | olt_configured = False |
| 3311 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 3312 | log_test.info('Installing OLT app') |
| 3313 | OnosCtrl.install_app(self.olt_app_file) |
| 3314 | time.sleep(5) |
| 3315 | log_test.info('Adding subscribers through OLT app') |
| 3316 | self.config_olt(switch_map) |
| 3317 | olt_configured = True |
| 3318 | time.sleep(5) |
| 3319 | thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT, "interrupting_dhcp_flows",)) |
| 3320 | thread2 = threading.Thread(target = self.voltha_uni_port_down_up) |
| 3321 | thread1.start() |
| 3322 | thread2.start() |
| 3323 | time.sleep(10) |
| 3324 | thread1.join() |
| 3325 | thread2.join() |
| 3326 | try: |
Chetan Gaonker | cf37f26 | 2017-06-19 19:11:11 +0000 | [diff] [blame] | 3327 | assert_equal(self.success, True) |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3328 | #assert_equal(status, True) |
| 3329 | time.sleep(10) |
| 3330 | finally: |
| 3331 | self.voltha.disable_device(device_id, delete = True) |
| 3332 | self.remove_olt(switch_map) |
| 3333 | df.callback(0) |
| 3334 | |
| 3335 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 3336 | return df |
| 3337 | |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3338 | @deferred(TESTCASE_TIMEOUT) |
| 3339 | def test_subscriber_with_voltha_for_dhcp_disabling_onu_port_multiple_times(self): |
| 3340 | """ |
| 3341 | Test Method: |
| 3342 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 3343 | 1. OLT and ONU is detected and validated. |
| 3344 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 3345 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 3346 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 3347 | 5. Disable onu port which is being detected in voltha CLI. |
| 3348 | 6. Repeat step 3. |
| 3349 | 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway. |
| 3350 | """ |
| 3351 | df = defer.Deferred() |
| 3352 | no_iterations = 10 |
| 3353 | dhcp_app = 'org.onosproject.dhcp' |
| 3354 | def dhcp_flow_check_scenario(df): |
| 3355 | log_test.info('Enabling ponsim_olt') |
| 3356 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 3357 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 3358 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 3359 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3360 | time.sleep(10) |
| 3361 | switch_map = None |
| 3362 | olt_configured = False |
| 3363 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 3364 | log_test.info('Installing OLT app') |
| 3365 | OnosCtrl.install_app(self.olt_app_file) |
| 3366 | time.sleep(5) |
| 3367 | log_test.info('Adding subscribers through OLT app') |
| 3368 | self.config_olt(switch_map) |
| 3369 | olt_configured = True |
| 3370 | time.sleep(5) |
| 3371 | for i in range(no_iterations): |
| 3372 | thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT, "interrupting_dhcp_flows",)) |
| 3373 | thread2 = threading.Thread(target = self.voltha_uni_port_down_up) |
| 3374 | thread1.start() |
| 3375 | thread2.start() |
| 3376 | time.sleep(10) |
| 3377 | thread1.join() |
| 3378 | thread2.join() |
| 3379 | dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT) |
| 3380 | try: |
| 3381 | #assert_equal(status, True) |
| 3382 | assert_equal(dhcp_status, True) |
| 3383 | assert_equal(self.success, True) |
| 3384 | time.sleep(10) |
| 3385 | finally: |
| 3386 | self.voltha.disable_device(device_id, delete = True) |
| 3387 | self.remove_olt(switch_map) |
| 3388 | df.callback(0) |
| 3389 | |
| 3390 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 3391 | return df |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3392 | |
| 3393 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3394 | def test_subscriber_with_voltha_for_dhcp_toggling_onu_port(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 3395 | """ |
| 3396 | Test Method: |
| 3397 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 3398 | 1. OLT and ONU is detected and validated. |
| 3399 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 3400 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 3401 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 3402 | 5. Disable onu port which is being detected in voltha CLI. |
| 3403 | 6. Repeat step 3. |
| 3404 | 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway. |
| 3405 | 8. Enable onu port which is being detected in voltha CLI. |
| 3406 | 9. Repeat steps 3 and 4. |
| 3407 | """ |
| 3408 | |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3409 | df = defer.Deferred() |
| 3410 | dhcp_app = 'org.onosproject.dhcp' |
| 3411 | def dhcp_flow_check_scenario(df): |
| 3412 | log_test.info('Enabling ponsim_olt') |
| 3413 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 3414 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 3415 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 3416 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3417 | time.sleep(10) |
| 3418 | switch_map = None |
| 3419 | olt_configured = False |
| 3420 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 3421 | log_test.info('Installing OLT app') |
| 3422 | OnosCtrl.install_app(self.olt_app_file) |
| 3423 | time.sleep(5) |
| 3424 | log_test.info('Adding subscribers through OLT app') |
| 3425 | self.config_olt(switch_map) |
| 3426 | olt_configured = True |
| 3427 | time.sleep(5) |
| 3428 | thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT, "interrupting_dhcp_flows",)) |
| 3429 | thread2 = threading.Thread(target = self.voltha_uni_port_down_up) |
| 3430 | log_test.info('Restart dhcp app in onos during client send discover to voltha') |
| 3431 | thread2.start() |
| 3432 | time.sleep(randint(0,1)) |
| 3433 | thread1.start() |
| 3434 | time.sleep(10) |
| 3435 | thread1.join() |
| 3436 | thread2.join() |
| 3437 | dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT) |
| 3438 | assert_equal(dhcp_status, True) |
| 3439 | try: |
Chetan Gaonker | cf37f26 | 2017-06-19 19:11:11 +0000 | [diff] [blame] | 3440 | assert_equal(self.success, True) |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3441 | #assert_equal(status, True) |
| 3442 | time.sleep(10) |
| 3443 | finally: |
| 3444 | self.voltha.disable_device(device_id, delete = True) |
| 3445 | self.remove_olt(switch_map) |
| 3446 | df.callback(0) |
| 3447 | |
| 3448 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 3449 | return df |
| 3450 | |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3451 | @deferred(TESTCASE_TIMEOUT) |
| 3452 | def test_subscriber_with_voltha_for_dhcp_toggling_onu_port_multiple_times(self): |
| 3453 | """ |
| 3454 | Test Method: |
| 3455 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 3456 | 1. OLT and ONU is detected and validated. |
| 3457 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 3458 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 3459 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 3460 | 5. Disable onu port which is being detected in voltha CLI. |
| 3461 | 6. Repeat step 3. |
| 3462 | 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway. |
| 3463 | 8. Enable onu port which is being detected in voltha CLI. |
| 3464 | 9. Repeat steps 3 and 4. |
| 3465 | """ |
| 3466 | |
| 3467 | df = defer.Deferred() |
| 3468 | no_iterations = 10 |
| 3469 | dhcp_app = 'org.onosproject.dhcp' |
| 3470 | def dhcp_flow_check_scenario(df): |
| 3471 | log_test.info('Enabling ponsim_olt') |
| 3472 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 3473 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 3474 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 3475 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3476 | time.sleep(10) |
| 3477 | switch_map = None |
| 3478 | olt_configured = False |
| 3479 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 3480 | log_test.info('Installing OLT app') |
| 3481 | OnosCtrl.install_app(self.olt_app_file) |
| 3482 | time.sleep(5) |
| 3483 | log_test.info('Adding subscribers through OLT app') |
| 3484 | self.config_olt(switch_map) |
| 3485 | olt_configured = True |
| 3486 | time.sleep(5) |
| 3487 | for i in range(no_iterations): |
| 3488 | thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT, "interrupting_dhcp_flows",)) |
| 3489 | thread2 = threading.Thread(target = self.voltha_uni_port_down_up) |
| 3490 | log_test.info('Restart dhcp app in onos during client send discover to voltha') |
| 3491 | thread2.start() |
| 3492 | time.sleep(randint(0,1)) |
| 3493 | thread1.start() |
| 3494 | time.sleep(10) |
| 3495 | thread1.join() |
| 3496 | thread2.join() |
| 3497 | dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT) |
| 3498 | assert_equal(dhcp_status, True) |
| 3499 | try: |
| 3500 | assert_equal(self.success, True) |
| 3501 | #assert_equal(status, True) |
| 3502 | time.sleep(10) |
| 3503 | finally: |
| 3504 | self.voltha.disable_device(device_id, delete = True) |
| 3505 | self.remove_olt(switch_map) |
| 3506 | df.callback(0) |
| 3507 | |
| 3508 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 3509 | return df |
| 3510 | |
Thangavelu K S | 0f2c523 | 2017-06-19 19:11:43 +0000 | [diff] [blame] | 3511 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3512 | def test_two_subscribers_with_voltha_for_dhcp_discover(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 3513 | """ |
| 3514 | Test Method: |
| 3515 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 3516 | 1. OLT and ONU is detected and validated. |
| 3517 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 3518 | 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app. |
| 3519 | 4. Verify that subscribers had got different ips from dhcp server successfully. |
| 3520 | """ |
| 3521 | |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3522 | df = defer.Deferred() |
| 3523 | self.success = True |
| 3524 | dhcp_app = 'org.onosproject.dhcp' |
| 3525 | def dhcp_flow_check_scenario(df): |
| 3526 | log_test.info('Enabling ponsim_olt') |
| 3527 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 3528 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 3529 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 3530 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3531 | time.sleep(10) |
| 3532 | switch_map = None |
| 3533 | olt_configured = False |
| 3534 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 3535 | log_test.info('Installing OLT app') |
| 3536 | OnosCtrl.install_app(self.olt_app_file) |
| 3537 | time.sleep(5) |
| 3538 | log_test.info('Adding subscribers through OLT app') |
| 3539 | self.config_olt(switch_map) |
| 3540 | olt_configured = True |
| 3541 | time.sleep(5) |
| 3542 | thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT,)) |
| 3543 | thread2 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_2_RX_DEFAULT,)) |
| 3544 | thread1.start() |
| 3545 | thread2.start() |
| 3546 | time.sleep(10) |
| 3547 | thread1.join() |
| 3548 | thread2.join() |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3549 | dhcp_flow_status = self.success |
| 3550 | try: |
| 3551 | # if self.success is not True: |
| 3552 | assert_equal(dhcp_flow_status, True) |
| 3553 | #assert_equal(status, True) |
| 3554 | time.sleep(10) |
| 3555 | finally: |
| 3556 | self.voltha.disable_device(device_id, delete = True) |
| 3557 | self.remove_olt(switch_map) |
| 3558 | df.callback(0) |
| 3559 | |
| 3560 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 3561 | return df |
| 3562 | |
| 3563 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3564 | def test_two_subscribers_with_voltha_for_dhcp_multiple_discover(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 3565 | """ |
| 3566 | Test Method: |
| 3567 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 3568 | 1. OLT and ONU is detected and validated. |
| 3569 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 3570 | 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app. |
| 3571 | 4. Verify that subscribers had got ip from dhcp server successfully. |
| 3572 | 5. Repeat step 3 and 4 for 10 times for both subscribers. |
| 3573 | 6 Verify that subscribers should get same ips which are offered the first time from dhcp server. |
| 3574 | """ |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3575 | |
| 3576 | |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3577 | df = defer.Deferred() |
| 3578 | self.success = True |
| 3579 | dhcp_app = 'org.onosproject.dhcp' |
| 3580 | def dhcp_flow_check_scenario(df): |
| 3581 | log_test.info('Enabling ponsim_olt') |
| 3582 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 3583 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 3584 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 3585 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3586 | time.sleep(10) |
| 3587 | switch_map = None |
| 3588 | olt_configured = False |
| 3589 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 3590 | log_test.info('Installing OLT app') |
| 3591 | OnosCtrl.install_app(self.olt_app_file) |
| 3592 | time.sleep(5) |
| 3593 | log_test.info('Adding subscribers through OLT app') |
| 3594 | self.config_olt(switch_map) |
| 3595 | olt_configured = True |
| 3596 | time.sleep(5) |
| 3597 | thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT,"multiple_discover",)) |
| 3598 | thread2 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_2_RX_DEFAULT,"multiple_discover",)) |
| 3599 | thread1.start() |
| 3600 | thread2.start() |
| 3601 | time.sleep(10) |
| 3602 | thread1.join() |
| 3603 | thread2.join() |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3604 | dhcp_flow_status = self.success |
| 3605 | try: |
| 3606 | # if self.success is not True: |
| 3607 | assert_equal(dhcp_flow_status, True) |
| 3608 | #assert_equal(status, True) |
| 3609 | time.sleep(10) |
| 3610 | finally: |
| 3611 | self.voltha.disable_device(device_id, delete = True) |
| 3612 | self.remove_olt(switch_map) |
| 3613 | df.callback(0) |
| 3614 | |
| 3615 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 3616 | return df |
| 3617 | |
| 3618 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3619 | 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] | 3620 | """ |
| 3621 | Test Method: |
| 3622 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 3623 | 1. OLT and ONU is detected and validated. |
| 3624 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 3625 | 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app. |
| 3626 | 4. Verify that subscribers had got ip from dhcp server successfully. |
| 3627 | 5. Repeat step 3 and 4 for 10 times for only one subscriber and ping to gateway from other subscriber. |
| 3628 | 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 |
| 3629 | """ |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3630 | |
| 3631 | df = defer.Deferred() |
| 3632 | self.success = True |
| 3633 | dhcp_app = 'org.onosproject.dhcp' |
| 3634 | def dhcp_flow_check_scenario(df): |
| 3635 | log_test.info('Enabling ponsim_olt') |
| 3636 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 3637 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 3638 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 3639 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3640 | time.sleep(10) |
| 3641 | switch_map = None |
| 3642 | olt_configured = False |
| 3643 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 3644 | log_test.info('Installing OLT app') |
| 3645 | OnosCtrl.install_app(self.olt_app_file) |
| 3646 | time.sleep(5) |
| 3647 | log_test.info('Adding subscribers through OLT app') |
| 3648 | self.config_olt(switch_map) |
| 3649 | olt_configured = True |
| 3650 | time.sleep(5) |
| 3651 | thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT,"multiple_discover",)) |
| 3652 | thread2 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_2_RX_DEFAULT,)) |
| 3653 | thread1.start() |
| 3654 | thread2.start() |
| 3655 | time.sleep(10) |
| 3656 | thread1.join() |
| 3657 | thread2.join() |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3658 | dhcp_flow_status = self.success |
| 3659 | try: |
| 3660 | # if self.success is not True: |
| 3661 | assert_equal(dhcp_flow_status, True) |
| 3662 | #assert_equal(status, True) |
| 3663 | time.sleep(10) |
| 3664 | finally: |
| 3665 | self.voltha.disable_device(device_id, delete = True) |
| 3666 | self.remove_olt(switch_map) |
| 3667 | df.callback(0) |
| 3668 | |
| 3669 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 3670 | return df |
| 3671 | |
| 3672 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3673 | 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] | 3674 | """ |
| 3675 | Test Method: |
| 3676 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 3677 | 1. OLT and ONU is detected and validated. |
| 3678 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 3679 | 3. Send dhcp request from one residential subscriber to dhcp server which is running as onos app. |
| 3680 | 3. Send dhcp request with desired ip from other residential subscriber to dhcp server which is running as onos app. |
| 3681 | 4. Verify that subscribers had got different ips (one subscriber desired ip and other subscriber random ip) from dhcp server successfully. |
| 3682 | """ |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3683 | |
| 3684 | df = defer.Deferred() |
| 3685 | self.success = True |
| 3686 | dhcp_app = 'org.onosproject.dhcp' |
| 3687 | def dhcp_flow_check_scenario(df): |
| 3688 | log_test.info('Enabling ponsim_olt') |
| 3689 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 3690 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 3691 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 3692 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3693 | time.sleep(10) |
| 3694 | switch_map = None |
| 3695 | olt_configured = False |
| 3696 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 3697 | log_test.info('Installing OLT app') |
| 3698 | OnosCtrl.install_app(self.olt_app_file) |
| 3699 | time.sleep(5) |
| 3700 | log_test.info('Adding subscribers through OLT app') |
| 3701 | self.config_olt(switch_map) |
| 3702 | olt_configured = True |
| 3703 | time.sleep(5) |
| 3704 | thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT,)) |
| 3705 | thread2 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_2_RX_DEFAULT,"desired_ip_address",)) |
| 3706 | thread1.start() |
| 3707 | thread2.start() |
| 3708 | time.sleep(10) |
| 3709 | thread1.join() |
| 3710 | thread2.join() |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3711 | dhcp_flow_status = self.success |
| 3712 | try: |
| 3713 | # if self.success is not True: |
| 3714 | assert_equal(dhcp_flow_status, True) |
| 3715 | #assert_equal(status, True) |
| 3716 | time.sleep(10) |
| 3717 | finally: |
| 3718 | self.voltha.disable_device(device_id, delete = True) |
| 3719 | self.remove_olt(switch_map) |
| 3720 | df.callback(0) |
| 3721 | |
| 3722 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 3723 | return df |
| 3724 | |
| 3725 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3726 | 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] | 3727 | """ |
| 3728 | Test Method: |
| 3729 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 3730 | 1. OLT and ONU is detected and validated. |
| 3731 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 3732 | 3. Send dhcp request with desired wihtin dhcp pool ip from one residential subscriber to dhcp server which is running as onos app. |
| 3733 | 3. Send dhcp request with desired without in dhcp pool ip from other residential subscriber to dhcp server which is running as onos app. |
| 3734 | 4. Verify that subscribers had got different ips (both subscriber got random ips within dhcp pool) from dhcp server successfully. |
| 3735 | """ |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3736 | df = defer.Deferred() |
| 3737 | self.success = True |
| 3738 | dhcp_app = 'org.onosproject.dhcp' |
| 3739 | def dhcp_flow_check_scenario(df): |
| 3740 | log_test.info('Enabling ponsim_olt') |
| 3741 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 3742 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 3743 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 3744 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3745 | time.sleep(10) |
| 3746 | switch_map = None |
| 3747 | olt_configured = False |
| 3748 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 3749 | log_test.info('Installing OLT app') |
| 3750 | OnosCtrl.install_app(self.olt_app_file) |
| 3751 | time.sleep(5) |
| 3752 | log_test.info('Adding subscribers through OLT app') |
| 3753 | self.config_olt(switch_map) |
| 3754 | olt_configured = True |
| 3755 | time.sleep(5) |
| 3756 | thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT,"desired_ip_address",)) |
| 3757 | thread2 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_2_RX_DEFAULT,"desired_out_of_pool_ip_address",)) |
| 3758 | thread1.start() |
| 3759 | thread2.start() |
| 3760 | time.sleep(10) |
| 3761 | thread1.join() |
| 3762 | thread2.join() |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3763 | dhcp_flow_status = self.success |
| 3764 | try: |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3765 | assert_equal(dhcp_flow_status, True) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3766 | time.sleep(10) |
| 3767 | finally: |
| 3768 | self.voltha.disable_device(device_id, delete = True) |
| 3769 | self.remove_olt(switch_map) |
| 3770 | df.callback(0) |
| 3771 | |
| 3772 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 3773 | return df |
| 3774 | |
| 3775 | @deferred(TESTCASE_TIMEOUT) |
| 3776 | 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] | 3777 | """ |
| 3778 | Test Method: |
| 3779 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 3780 | 1. OLT and ONU is detected and validated. |
| 3781 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 3782 | 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app. |
| 3783 | 4. Verify that subscribers had got ip from dhcp server successfully. |
| 3784 | 5. Disable onu port on which access one subscriber and ping to gateway from other subscriber. |
| 3785 | 6. Repeat step 3 and 4 for one subscriber where uni port is down. |
| 3786 | 7. Verify that subscriber should not get ip from dhcp server and other subscriber ping to gateway should not failed. |
| 3787 | """ |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3788 | df = defer.Deferred() |
| 3789 | self.success = True |
| 3790 | dhcp_app = 'org.onosproject.dhcp' |
| 3791 | def dhcp_flow_check_scenario(df): |
| 3792 | log_test.info('Enabling ponsim_olt') |
| 3793 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 3794 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 3795 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 3796 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3797 | time.sleep(10) |
| 3798 | switch_map = None |
| 3799 | olt_configured = False |
| 3800 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 3801 | log_test.info('Installing OLT app') |
| 3802 | OnosCtrl.install_app(self.olt_app_file) |
| 3803 | time.sleep(5) |
| 3804 | log_test.info('Adding subscribers through OLT app') |
| 3805 | self.config_olt(switch_map) |
| 3806 | olt_configured = True |
| 3807 | time.sleep(5) |
| 3808 | thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT,"desired_ip_address",)) |
| 3809 | thread2 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_2_RX_DEFAULT,"desired_out_of_pool_ip_address",)) |
| 3810 | thread1.start() |
| 3811 | thread2.start() |
| 3812 | time.sleep(10) |
| 3813 | thread1.join() |
| 3814 | thread2.join() |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3815 | dhcp_flow_status = self.success |
| 3816 | try: |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3817 | assert_equal(dhcp_flow_status, True) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3818 | time.sleep(10) |
| 3819 | finally: |
| 3820 | self.voltha.disable_device(device_id, delete = True) |
| 3821 | self.remove_olt(switch_map) |
| 3822 | df.callback(0) |
| 3823 | |
| 3824 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 3825 | return df |
| 3826 | |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3827 | @deferred(TESTCASE_TIMEOUT) |
| 3828 | 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] | 3829 | """ |
| 3830 | Test Method: |
| 3831 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 3832 | 1. OLT and ONU is detected and validated. |
| 3833 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 3834 | 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app. |
| 3835 | 4. Verify that subscribers had got ip from dhcp server successfully. |
| 3836 | 5. Disable onu port on which access one subscriber and ping to gateway from other subscriber. |
| 3837 | 6. Repeat step 3 and 4 for one subscriber where uni port is down. |
| 3838 | 7. Verify that subscriber should not get ip from dhcp server and other subscriber ping to gateway should not failed. |
| 3839 | 8. Enable onu port on which was disable at step 5 and ping to gateway from other subscriber. |
| 3840 | 9. Repeat step 3 and 4 for one subscriber where uni port is up now. |
| 3841 | 10. Verify that subscriber should get ip from dhcp server and other subscriber ping to gateway should not failed. |
| 3842 | """ |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3843 | df = defer.Deferred() |
| 3844 | self.success = True |
| 3845 | dhcp_app = 'org.onosproject.dhcp' |
| 3846 | def dhcp_flow_check_scenario(df): |
| 3847 | log_test.info('Enabling ponsim_olt') |
| 3848 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 3849 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 3850 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 3851 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3852 | time.sleep(10) |
| 3853 | switch_map = None |
| 3854 | olt_configured = False |
| 3855 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 3856 | log_test.info('Installing OLT app') |
| 3857 | OnosCtrl.install_app(self.olt_app_file) |
| 3858 | time.sleep(5) |
| 3859 | log_test.info('Adding subscribers through OLT app') |
| 3860 | self.config_olt(switch_map) |
| 3861 | olt_configured = True |
| 3862 | time.sleep(5) |
| 3863 | thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT,)) |
| 3864 | thread2 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_2_RX_DEFAULT,)) |
| 3865 | thread3 = threading.Thread(target = self.voltha_uni_port_down_up, args = (self.INTF_2_RX_DEFAULT,)) |
| 3866 | thread1.start() |
| 3867 | thread2.start() |
| 3868 | thread3.start() |
| 3869 | time.sleep(10) |
| 3870 | thread1.join() |
| 3871 | thread2.join() |
| 3872 | thread3.join() |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3873 | dhcp_flow_status = self.success |
| 3874 | try: |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3875 | assert_equal(dhcp_flow_status, True) |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3876 | time.sleep(10) |
| 3877 | finally: |
| 3878 | self.voltha.disable_device(device_id, delete = True) |
| 3879 | self.remove_olt(switch_map) |
| 3880 | df.callback(0) |
| 3881 | |
| 3882 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 3883 | return df |
| 3884 | |
Thangavelu K S | 0ffd5b8 | 2017-06-21 18:01:59 +0000 | [diff] [blame] | 3885 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3886 | def test_two_subscribers_with_voltha_for_dhcp_disabling_olt(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 3887 | """ |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3888 | Test Method: uni_port |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 3889 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 3890 | 1. OLT and ONU is detected and validated. |
| 3891 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 3892 | 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app. |
| 3893 | 4. Verify that subscribers had got ip from dhcp server successfully. |
| 3894 | 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber. |
| 3895 | 6. Disable the olt device which is detected in voltha. |
| 3896 | 7. Verify that subscriber should not get ip from dhcp server and other subscriber ping to gateway should failed. |
| 3897 | """ |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3898 | df = defer.Deferred() |
| 3899 | self.success = True |
| 3900 | dhcp_app = 'org.onosproject.dhcp' |
| 3901 | def dhcp_flow_check_scenario(df): |
| 3902 | log_test.info('Enabling ponsim_olt') |
| 3903 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 3904 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 3905 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 3906 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3907 | time.sleep(10) |
| 3908 | switch_map = None |
| 3909 | olt_configured = False |
| 3910 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 3911 | log_test.info('Installing OLT app') |
| 3912 | OnosCtrl.install_app(self.olt_app_file) |
| 3913 | time.sleep(5) |
| 3914 | log_test.info('Adding subscribers through OLT app') |
| 3915 | self.config_olt(switch_map) |
| 3916 | olt_configured = True |
| 3917 | time.sleep(5) |
| 3918 | thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT,)) |
| 3919 | thread2 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_2_RX_DEFAULT,)) |
| 3920 | thread3 = threading.Thread(target = self.voltha.disable_device, args = (device_id,False,)) |
| 3921 | |
| 3922 | thread1.start() |
| 3923 | thread2.start() |
| 3924 | thread3.start() |
| 3925 | time.sleep(10) |
| 3926 | thread1.join() |
| 3927 | thread2.join() |
| 3928 | thread3.join() |
| 3929 | dhcp_flow_status = self.success |
| 3930 | try: |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3931 | assert_equal(dhcp_flow_status, True) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3932 | time.sleep(10) |
| 3933 | finally: |
| 3934 | self.voltha.disable_device(device_id, delete = True) |
| 3935 | self.remove_olt(switch_map) |
| 3936 | df.callback(0) |
| 3937 | |
| 3938 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 3939 | return df |
| 3940 | |
| 3941 | @deferred(TESTCASE_TIMEOUT) |
| 3942 | def test_two_subscribers_with_voltha_for_dhcp_toggling_olt(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 3943 | """ |
| 3944 | Test Method: |
| 3945 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 3946 | 1. OLT and ONU is detected and validated. |
| 3947 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 3948 | 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app. |
| 3949 | 4. Verify that subscribers had got ip from dhcp server successfully. |
| 3950 | 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber. |
| 3951 | 6. Disable the olt device which is detected in voltha. |
| 3952 | 7. Verify that subscriber should not get ip from dhcp server and other subscriber ping to gateway should failed. |
| 3953 | 8. Enable the olt device which is detected in voltha. |
| 3954 | 9. Verify that subscriber should get ip from dhcp server and other subscriber ping to gateway should not failed. |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3955 | |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 3956 | """ |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3957 | df = defer.Deferred() |
| 3958 | self.success = True |
| 3959 | dhcp_app = 'org.onosproject.dhcp' |
| 3960 | def dhcp_flow_check_scenario(df): |
| 3961 | log_test.info('Enabling ponsim_olt') |
| 3962 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 3963 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 3964 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 3965 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3966 | time.sleep(10) |
| 3967 | switch_map = None |
| 3968 | olt_configured = False |
| 3969 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 3970 | log_test.info('Installing OLT app') |
| 3971 | OnosCtrl.install_app(self.olt_app_file) |
| 3972 | time.sleep(5) |
| 3973 | log_test.info('Adding subscribers through OLT app') |
| 3974 | self.config_olt(switch_map) |
| 3975 | olt_configured = True |
| 3976 | time.sleep(5) |
| 3977 | thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT,)) |
| 3978 | thread2 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_2_RX_DEFAULT,)) |
| 3979 | thread3 = threading.Thread(target = self.voltha.restart_device, args = (device_id,)) |
| 3980 | thread1.start() |
| 3981 | thread2.start() |
| 3982 | thread3.start() |
| 3983 | time.sleep(10) |
| 3984 | thread1.join() |
| 3985 | thread2.join() |
| 3986 | thread3.join() |
| 3987 | dhcp_flow_status = self.success |
| 3988 | try: |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3989 | assert_equal(dhcp_flow_status, True) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 3990 | time.sleep(10) |
| 3991 | finally: |
| 3992 | self.voltha.disable_device(device_id, delete = True) |
| 3993 | self.remove_olt(switch_map) |
| 3994 | df.callback(0) |
| 3995 | |
| 3996 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 3997 | return df |
| 3998 | |
| 3999 | @deferred(TESTCASE_TIMEOUT) |
| 4000 | 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] | 4001 | """ |
| 4002 | Test Method: |
| 4003 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 4004 | 1. OLT and ONU is detected and validated. |
| 4005 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4006 | 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app. |
| 4007 | 4. Verify that subscribers had got ip from dhcp server successfully. |
| 4008 | 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber. |
| 4009 | 6. Pause the olt device which is detected in voltha. |
| 4010 | 7. Verify that subscriber should not get ip from dhcp server and other subscriber ping to gateway should failed. |
| 4011 | """ |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 4012 | df = defer.Deferred() |
| 4013 | self.success = True |
| 4014 | dhcp_app = 'org.onosproject.dhcp' |
| 4015 | def dhcp_flow_check_scenario(df): |
| 4016 | log_test.info('Enabling ponsim_olt') |
| 4017 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 4018 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 4019 | assert_not_equal(device_id, None) |
A R Karthick | 5344271 | 2017-07-27 12:23:30 -0700 | [diff] [blame] | 4020 | voltha = VolthaCtrl(**self.voltha_attrs) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 4021 | time.sleep(10) |
| 4022 | switch_map = None |
| 4023 | olt_configured = False |
| 4024 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 4025 | log_test.info('Installing OLT app') |
| 4026 | OnosCtrl.install_app(self.olt_app_file) |
| 4027 | time.sleep(5) |
| 4028 | log_test.info('Adding subscribers through OLT app') |
| 4029 | self.config_olt(switch_map) |
| 4030 | olt_configured = True |
| 4031 | time.sleep(5) |
| 4032 | thread1 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_RX_DEFAULT,)) |
| 4033 | thread2 = threading.Thread(target = self.dhcp_flow_check, args = (self.INTF_2_RX_DEFAULT,)) |
| 4034 | thread3 = threading.Thread(target = self.voltha.pause_device, args = (device_id,)) |
| 4035 | thread1.start() |
| 4036 | thread2.start() |
| 4037 | thread3.start() |
| 4038 | time.sleep(10) |
| 4039 | thread1.join() |
| 4040 | thread2.join() |
| 4041 | thread3.join() |
| 4042 | dhcp_flow_status = self.success |
| 4043 | try: |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 4044 | assert_equal(dhcp_flow_status, True) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 4045 | time.sleep(10) |
| 4046 | finally: |
| 4047 | self.voltha.disable_device(device_id, delete = True) |
| 4048 | self.remove_olt(switch_map) |
| 4049 | df.callback(0) |
| 4050 | |
| 4051 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 4052 | return df |
| 4053 | |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 4054 | def test_3_subscribers_with_voltha_for_dhcp_discover_requests(self): |
| 4055 | """ |
| 4056 | Test Method: |
| 4057 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 4058 | 1. OLT and ONU is detected and validated. |
| 4059 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as multiple subscribers (3 subscribers) |
| 4060 | 3. Send dhcp request from residential subscrber to dhcp server which is running as onos app. |
| 4061 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 4062 | """ |
| 4063 | """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each""" |
| 4064 | num_subscribers = 3 |
| 4065 | num_channels = 1 |
| 4066 | services = ('DHCP') |
| 4067 | cbs = (self.dhcp_flow_check, None, None) |
| 4068 | self.voltha_subscribers(services, cbs = cbs, |
| 4069 | num_subscribers = num_subscribers, |
| 4070 | num_channels = num_channels) |
| 4071 | |
| 4072 | def test_5_subscribers_with_voltha_for_dhcp_discover_requests(self): |
| 4073 | """ |
| 4074 | Test Method: |
| 4075 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 4076 | 1. OLT and ONU is detected and validated. |
| 4077 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as multiple subscribers (5 subscribers) |
| 4078 | 3. Send dhcp request from residential subscrber to dhcp server which is running as onos app. |
| 4079 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 4080 | """ |
| 4081 | """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each""" |
| 4082 | num_subscribers = 5 |
| 4083 | num_channels = 1 |
| 4084 | services = ('DHCP') |
| 4085 | cbs = (self.dhcp_flow_check, None, None) |
| 4086 | self.voltha_subscribers(services, cbs = cbs, |
| 4087 | num_subscribers = num_subscribers, |
| 4088 | num_channels = num_channels) |
| 4089 | |
| 4090 | def test_9_subscribers_with_voltha_for_dhcp_discover_requests(self): |
| 4091 | """ |
| 4092 | Test Method: |
| 4093 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 4094 | 1. OLT and ONU is detected and validated. |
| 4095 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as multiple subscribers (9 subscribers) |
| 4096 | 3. Send dhcp request from residential subscrber to dhcp server which is running as onos app. |
| 4097 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 4098 | """ |
| 4099 | """Test subscriber join next for channel surfing with 9 subscribers browsing 1 channels each""" |
| 4100 | num_subscribers = 9 |
| 4101 | num_channels = 1 |
| 4102 | services = ('DHCP') |
| 4103 | cbs = (self.dhcp_flow_check, None, None) |
| 4104 | self.voltha_subscribers(services, cbs = cbs, |
| 4105 | num_subscribers = num_subscribers, |
| 4106 | num_channels = num_channels) |
| 4107 | |
| 4108 | def test_3_subscribers_with_voltha_for_tls_auth_and_dhcp_discover_flows(self): |
| 4109 | """ |
| 4110 | Test Method: |
| 4111 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 4112 | 1. OLT and ONU is detected and validated. |
| 4113 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as multiple subscribers (3 subscribers) |
| 4114 | 3. Send dhcp request from residential subscrber to dhcp server which is running as onos app. |
| 4115 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 4116 | """ |
| 4117 | """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each""" |
| 4118 | num_subscribers = 3 |
| 4119 | num_channels = 1 |
| 4120 | services = ('TLS','DHCP') |
| 4121 | cbs = (self.tls_flow_check, self.dhcp_flow_check, None) |
| 4122 | self.voltha_subscribers(services, cbs = cbs, |
| 4123 | num_subscribers = num_subscribers, |
| 4124 | num_channels = num_channels) |
| 4125 | |
| 4126 | def test_5_subscribers_with_voltha_for_tls_auth_and_dhcp_discover_flows(self): |
| 4127 | """ |
| 4128 | Test Method: |
| 4129 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 4130 | 1. OLT and ONU is detected and validated. |
| 4131 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as multiple subscribers (5 subscribers) |
| 4132 | 3. Send dhcp request from residential subscrber to dhcp server which is running as onos app. |
| 4133 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 4134 | """ |
| 4135 | """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each""" |
| 4136 | num_subscribers = 5 |
| 4137 | num_channels = 1 |
| 4138 | services = ('TLS','DHCP') |
| 4139 | cbs = (self.tls_flow_check, self.dhcp_flow_check, None) |
| 4140 | self.voltha_subscribers(services, cbs = cbs, |
| 4141 | num_subscribers = num_subscribers, |
| 4142 | num_channels = num_channels) |
| 4143 | |
| 4144 | def test_9_subscribers_with_voltha_for_tls_auth_and_dhcp_discover_flows(self): |
| 4145 | """ |
| 4146 | Test Method: |
| 4147 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 4148 | 1. OLT and ONU is detected and validated. |
| 4149 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as multiple subscribers (9 subscribers) |
| 4150 | 3. Send dhcp request from residential subscrber to dhcp server which is running as onos app. |
| 4151 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 4152 | """ |
| 4153 | """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each""" |
| 4154 | num_subscribers = 9 |
| 4155 | num_channels = 1 |
| 4156 | services = ('TLS','DHCP') |
| 4157 | cbs = (self.tls_flow_check, self.dhcp_flow_check, None) |
| 4158 | self.voltha_subscribers(services, cbs = cbs, |
| 4159 | num_subscribers = num_subscribers, |
| 4160 | num_channels = num_channels) |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 4161 | |
| 4162 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4163 | def test_subscriber_with_voltha_for_dhcprelay_request(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4164 | """ |
| 4165 | Test Method: |
| 4166 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 4167 | 1. OLT and ONU is detected and validated. |
| 4168 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4169 | 3. Send dhcp request from residential subscrber to external dhcp server. |
| 4170 | 4. Verify that subscriber get ip from external dhcp server successfully. |
| 4171 | """ |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 4172 | self.dhcprelay_setUpClass() |
| 4173 | # if not port_list: |
| 4174 | port_list = self.generate_port_list(1, 0) |
| 4175 | iface = self.port_map['ports'][port_list[1][1]] |
| 4176 | mac = self.get_mac(iface) |
| 4177 | self.host_load(iface) |
| 4178 | ##we use the defaults for this test that serves as an example for others |
| 4179 | ##You don't need to restart dhcpd server if retaining default config |
| 4180 | config = self.default_config |
| 4181 | options = self.default_options |
| 4182 | subnet = self.default_subnet_config |
| 4183 | dhcpd_interface_list = self.relay_interfaces |
| 4184 | self.dhcpd_start(intf_list = dhcpd_interface_list, |
| 4185 | config = config, |
| 4186 | options = options, |
| 4187 | subnet = subnet) |
| 4188 | self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = iface) |
| 4189 | self.send_recv(mac=mac) |
| 4190 | self.dhcprelay_tearDwonClass() |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4191 | |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 4192 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4193 | 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] | 4194 | """ |
| 4195 | Test Method: |
| 4196 | 0. Make sure that voltha and external dhcp server are is up and running on CORD-POD setup. |
| 4197 | 1. OLT and ONU is detected and validated. |
| 4198 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4199 | 3. Send dhcp request with invalid source mac broadcast from residential subscrber to external dhcp server. |
| 4200 | 4. Verify that subscriber should not get ip from external dhcp server. |
| 4201 | """ |
| 4202 | |
Thangavelu K S | e6c77c7 | 2017-06-23 21:28:48 +0000 | [diff] [blame] | 4203 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4204 | 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] | 4205 | """ |
| 4206 | Test Method: |
| 4207 | 0. Make sure that voltha and external dhcp server are is up and running on CORD-POD setup. |
| 4208 | 1. OLT and ONU is detected and validated. |
| 4209 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4210 | 3. Send dhcp request with invalid source mac multicast from residential subscrber to external dhcp server. |
| 4211 | 4. Verify that subscriber should not get ip from external dhcp server. |
| 4212 | """ |
| 4213 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4214 | 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] | 4215 | """ |
| 4216 | Test Method: |
| 4217 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 4218 | 1. OLT and ONU is detected and validated. |
| 4219 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4220 | 3. Send dhcp request with invalid source mac zero from residential subscrber to external dhcp server. |
| 4221 | 4. Verify that subscriber should not get ip from external dhcp server. |
| 4222 | """ |
| 4223 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4224 | def test_subscriber_with_voltha_for_dhcprelay_request_and_release(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4225 | """ |
| 4226 | Test Method: |
| 4227 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 4228 | 1. OLT and ONU is detected and validated. |
| 4229 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4230 | 3. Send dhcp request from residential subscrber to external dhcp server. |
| 4231 | 4. Verify that subscriber get ip from external dhcp server successfully. |
| 4232 | 5. Send dhcp release from residential subscrber to external dhcp server. |
| 4233 | 6 Verify that subscriber should not get ip from external dhcp server, ping to gateway. |
| 4234 | """ |
| 4235 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4236 | def test_subscriber_with_voltha_for_dhcprelay_starvation(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4237 | """ |
| 4238 | Test Method: |
| 4239 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 4240 | 1. OLT and ONU is detected and validated. |
| 4241 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4242 | 3. Send dhcp request from residential subscriber to external dhcp server. |
| 4243 | 4. Verify that subscriber get ip from external dhcp server. successfully. |
| 4244 | 5. Repeat step 3 and 4 for 10 times. |
| 4245 | 6 Verify that subscriber should get ip from external dhcp server.. |
| 4246 | """ |
| 4247 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4248 | def test_subscriber_with_voltha_for_dhcprelay_starvation_negative_scenario(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4249 | """ |
| 4250 | Test Method: |
| 4251 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 4252 | 1. OLT and ONU is detected and validated. |
| 4253 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4254 | 3. Send dhcp request from residential subscriber without of pool ip to external dhcp server. |
| 4255 | 4. Verify that subscriber should not get ip from external dhcp server.. |
| 4256 | 5. Repeat steps 3 and 4 for 10 times. |
| 4257 | 6 Verify that subscriber should not get ip from external dhcp server.. |
| 4258 | """ |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4259 | def test_subscriber_with_voltha_for_dhcprelay_sending_multiple_discover(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4260 | """ |
| 4261 | Test Method: |
| 4262 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 4263 | 1. OLT and ONU is detected and validated. |
| 4264 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4265 | 3. Send dhcp request from residential subscriber to external dhcp server. |
| 4266 | 4. Verify that subscriber get ip from external dhcp server. successfully. |
| 4267 | 5. Repeat step 3 for 50 times. |
| 4268 | 6 Verify that subscriber should get same ip which was received from 1st discover from external dhcp server.. |
| 4269 | """ |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4270 | def test_subscriber_with_voltha_for_dhcprelay_sending_multiple_request(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4271 | """ |
| 4272 | Test Method: |
| 4273 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 4274 | 1. OLT and ONU is detected and validated. |
| 4275 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4276 | 3. Send dhcp request from residential subscriber to external dhcp server. |
| 4277 | 4. Verify that subscriber get ip from external dhcp server. successfully. |
| 4278 | 5. Send DHCP request to external dhcp server. |
| 4279 | 6. Repeat step 5 for 50 times. |
| 4280 | 7. Verify that subscriber should get same ip which was received from 1st discover from external dhcp server.. |
| 4281 | """ |
| 4282 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4283 | 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] | 4284 | """ |
| 4285 | Test Method: |
| 4286 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 4287 | 1. OLT and ONU is detected and validated. |
| 4288 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4289 | 3. Send dhcp request with desired ip address from residential subscriber to external dhcp server. |
| 4290 | 4. Verify that subscriber get ip which was requested in step 3 from external dhcp server. successfully. |
| 4291 | """ |
| 4292 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4293 | 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] | 4294 | """ |
| 4295 | Test Method: |
| 4296 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 4297 | 1. OLT and ONU is detected and validated. |
| 4298 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4299 | 3. Send dhcp request with desired out of pool ip address from residential subscriber to external dhcp server. |
| 4300 | 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. |
| 4301 | """ |
| 4302 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4303 | def test_subscriber_with_voltha_deactivating_dhcprelay_app_in_onos(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4304 | """ |
| 4305 | Test Method: |
| 4306 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 4307 | 1. OLT and ONU is detected and validated. |
| 4308 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4309 | 3. Send dhcp request from residential subscriber to external dhcp server. |
| 4310 | 4. Verify that subscriber get ip from external dhcp server. successfully. |
| 4311 | 5. Deactivate dhcp server app in onos. |
| 4312 | 6. Repeat step 3. |
| 4313 | 7. Verify that subscriber should not get ip from external dhcp server., and ping to gateway. |
| 4314 | """ |
| 4315 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4316 | def test_subscriber_with_voltha_for_dhcprelay_renew_time(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4317 | """ |
| 4318 | Test Method: |
| 4319 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 4320 | 1. OLT and ONU is detected and validated. |
| 4321 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4322 | 3. Send dhcp request from residential subscriber to external dhcp server. |
| 4323 | 4. Verify that subscriber get ip from external dhcp server. successfully. |
| 4324 | 5. Send dhcp renew packet to external dhcp server. |
| 4325 | 6. Repeat step 4. |
| 4326 | """ |
| 4327 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4328 | def test_subscriber_with_voltha_for_dhcprelay_rebind_time(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4329 | """ |
| 4330 | Test Method: |
| 4331 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 4332 | 1. OLT and ONU is detected and validated. |
| 4333 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4334 | 3. Send dhcp request from residential subscriber to external dhcp server. |
| 4335 | 4. Verify that subscriber get ip from external dhcp server. successfully. |
| 4336 | 5. Send dhcp rebind packet to external dhcp server. |
| 4337 | 6. Repeat step 4. |
| 4338 | """ |
| 4339 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4340 | def test_subscriber_with_voltha_for_dhcprelay_disabling_olt(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4341 | """ |
| 4342 | Test Method: |
| 4343 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 4344 | 1. OLT and ONU is detected and validated. |
| 4345 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4346 | 3. Send dhcp request from residential subscriber to external dhcp server. |
| 4347 | 4. Verify that subscriber get ip from external dhcp server. successfully. |
| 4348 | 5. Disable olt devices which is being detected in voltha CLI. |
| 4349 | 6. Repeat step 3. |
| 4350 | 7. Verify that subscriber should not get ip from external dhcp server., and ping to gateway. |
| 4351 | """ |
| 4352 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4353 | def test_subscriber_with_voltha_for_dhcprelay_toggling_olt(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4354 | """ |
| 4355 | Test Method: |
| 4356 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 4357 | 1. OLT and ONU is detected and validated. |
| 4358 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4359 | 3. Send dhcp request from residential subscriber to external dhcp server. |
| 4360 | 4. Verify that subscriber get ip from external dhcp server. successfully. |
| 4361 | 5. Disable olt devices which is being detected in voltha CLI. |
| 4362 | 6. Repeat step 3. |
| 4363 | 7. Verify that subscriber should not get ip from external dhcp server., and ping to gateway. |
| 4364 | 8. Enable olt devices which is being detected in voltha CLI. |
| 4365 | 9. Repeat steps 3 and 4. |
| 4366 | """ |
| 4367 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4368 | 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] | 4369 | """ |
| 4370 | Test Method: |
| 4371 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 4372 | 1. OLT and ONU is detected and validated. |
| 4373 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4374 | 3. Send dhcp request from residential subscriber to external dhcp server. |
| 4375 | 4. Verify that subscriber get ip from external dhcp server. successfully. |
| 4376 | 5. Disable onu port which is being detected in voltha CLI. |
| 4377 | 6. Repeat step 3. |
| 4378 | 7. Verify that subscriber should not get ip from external dhcp server., and ping to gateway. |
| 4379 | """ |
| 4380 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4381 | def test_subscriber_with_voltha_for_dhcprelay_disable_enable_onu_port_in_voltha(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4382 | """ |
| 4383 | Test Method: |
| 4384 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 4385 | 1. OLT and ONU is detected and validated. |
| 4386 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4387 | 3. Send dhcp request from residential subscriber to external dhcp server. |
| 4388 | 4. Verify that subscriber get ip from external dhcp server. successfully. |
| 4389 | 5. Disable onu port which is being detected in voltha CLI. |
| 4390 | 6. Repeat step 3. |
| 4391 | 7. Verify that subscriber should not get ip from external dhcp server., and ping to gateway. |
| 4392 | 8. Enable onu port which is being detected in voltha CLI. |
| 4393 | 9. Repeat steps 3 and 4. |
| 4394 | """ |
| 4395 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4396 | def test_two_subscribers_with_voltha_for_dhcprelay_discover(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4397 | """ |
| 4398 | Test Method: |
| 4399 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 4400 | 1. OLT and ONU is detected and validated. |
| 4401 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4402 | 3. Send dhcp request from two residential subscribers to external dhcp server. |
| 4403 | 4. Verify that subscribers had got different ips from external dhcp server. successfully. |
| 4404 | """ |
| 4405 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4406 | def test_two_subscribers_with_voltha_for_dhcprelay_multiple_discover(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4407 | """ |
| 4408 | Test Method: |
| 4409 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 4410 | 1. OLT and ONU is detected and validated. |
| 4411 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4412 | 3. Send dhcp request from two residential subscribers to external dhcp server. |
| 4413 | 4. Verify that subscribers had got ip from external dhcp server. successfully. |
| 4414 | 5. Repeat step 3 and 4 for 10 times for both subscribers. |
| 4415 | 6 Verify that subscribers should get same ips which are offered the first time from external dhcp server.. |
| 4416 | """ |
| 4417 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4418 | 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] | 4419 | """ |
| 4420 | Test Method: |
| 4421 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 4422 | 1. OLT and ONU is detected and validated. |
| 4423 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4424 | 3. Send dhcp request from two residential subscribers to external dhcp server. |
| 4425 | 4. Verify that subscribers had got ip from external dhcp server. successfully. |
| 4426 | 5. Repeat step 3 and 4 for 10 times for only one subscriber and ping to gateway from other subscriber. |
| 4427 | 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 |
| 4428 | """ |
| 4429 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4430 | 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] | 4431 | """ |
| 4432 | Test Method: |
| 4433 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 4434 | 1. OLT and ONU is detected and validated. |
| 4435 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4436 | 3. Send dhcp request from one residential subscriber to external dhcp server. |
| 4437 | 3. Send dhcp request with desired ip from other residential subscriber to external dhcp server. |
| 4438 | 4. Verify that subscribers had got different ips (one subscriber desired ip and other subscriber random ip) from external dhcp server. successfully. |
| 4439 | """ |
| 4440 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4441 | 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] | 4442 | """ |
| 4443 | Test Method: |
| 4444 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 4445 | 1. OLT and ONU is detected and validated. |
| 4446 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4447 | 3. Send dhcp request with desired wihtin dhcp pool ip from one residential subscriber to external dhcp server. |
| 4448 | 3. Send dhcp request with desired without in dhcp pool ip from other residential subscriber to external dhcp server. |
| 4449 | 4. Verify that subscribers had got different ips (both subscriber got random ips within dhcp pool) from external dhcp server. successfully. |
| 4450 | """ |
| 4451 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4452 | 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] | 4453 | """ |
| 4454 | Test Method: |
| 4455 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 4456 | 1. OLT and ONU is detected and validated. |
| 4457 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4458 | 3. Send dhcp request from two residential subscribers to external dhcp server. |
| 4459 | 4. Verify that subscribers had got ip from external dhcp server. successfully. |
| 4460 | 5. Disable onu port on which access one subscriber and ping to gateway from other subscriber. |
| 4461 | 6. Repeat step 3 and 4 for one subscriber where uni port is down. |
| 4462 | 7. Verify that subscriber should not get ip from external dhcp server. and other subscriber ping to gateway should not failed. |
| 4463 | """ |
| 4464 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4465 | 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] | 4466 | """ |
| 4467 | Test Method: |
| 4468 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 4469 | 1. OLT and ONU is detected and validated. |
| 4470 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4471 | 3. Send dhcp request from two residential subscribers to external dhcp server. |
| 4472 | 4. Verify that subscribers had got ip from external dhcp server. successfully. |
| 4473 | 5. Disable onu port on which access one subscriber and ping to gateway from other subscriber. |
| 4474 | 6. Repeat step 3 and 4 for one subscriber where uni port is down. |
| 4475 | 7. Verify that subscriber should not get ip from external dhcp server. and other subscriber ping to gateway should not failed. |
| 4476 | 8. Enable onu port on which was disable at step 5 and ping to gateway from other subscriber. |
| 4477 | 9. Repeat step 3 and 4 for one subscriber where uni port is up now. |
| 4478 | 10. Verify that subscriber should get ip from external dhcp server. and other subscriber ping to gateway should not failed. |
| 4479 | """ |
| 4480 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4481 | def test_two_subscribers_with_voltha_for_dhcprelay_disabling_olt(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4482 | """ |
| 4483 | Test Method: |
| 4484 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 4485 | 1. OLT and ONU is detected and validated. |
| 4486 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4487 | 3. Send dhcp request from two residential subscribers to external dhcp server. |
| 4488 | 4. Verify that subscribers had got ip from external dhcp server. successfully. |
| 4489 | 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber. |
| 4490 | 6. Disable the olt device which is detected in voltha. |
| 4491 | 7. Verify that subscriber should not get ip from external dhcp server. and other subscriber ping to gateway should failed. |
| 4492 | """ |
| 4493 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4494 | def test_two_subscribers_with_voltha_for_dhcprelay_toggling_olt(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 4495 | """ |
| 4496 | Test Method: |
| 4497 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 4498 | 1. OLT and ONU is detected and validated. |
| 4499 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4500 | 3. Send dhcp request from two residential subscribers to external dhcp server. |
| 4501 | 4. Verify that subscribers had got ip from external dhcp server. successfully. |
| 4502 | 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber. |
| 4503 | 6. Disable the olt device which is detected in voltha. |
| 4504 | 7. Verify that subscriber should not get ip from external dhcp server. and other subscriber ping to gateway should failed. |
| 4505 | 8. Enable the olt device which is detected in voltha. |
| 4506 | 9. Verify that subscriber should get ip from external dhcp server. and other subscriber ping to gateway should not failed. |
| 4507 | """ |
| 4508 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4509 | 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] | 4510 | """ |
| 4511 | Test Method: |
| 4512 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 4513 | 1. OLT and ONU is detected and validated. |
| 4514 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4515 | 3. Send dhcp request from two residential subscribers to external dhcp server. |
| 4516 | 4. Verify that subscribers had got ip from external dhcp server. successfully. |
| 4517 | 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber. |
| 4518 | 6. Pause the olt device which is detected in voltha. |
| 4519 | 7. Verify that subscriber should not get ip from external dhcp server. and other subscriber ping to gateway should failed. |
| 4520 | """ |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 4521 | |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 4522 | def test_subscriber_with_voltha_for_igmp_join_verifying_traffic(self): |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 4523 | """ |
| 4524 | Test Method: |
| 4525 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 4526 | 1. OLT and ONU is detected and validated. |
| 4527 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4528 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 4529 | 4. Send igmp joins for a multicast group address multi-group-addressA. |
| 4530 | 5. Send multicast data traffic for a group (multi-group-addressA) from other uni port on ONU. |
| 4531 | 6. Verify that multicast data packets are being recieved on join sent uni port on ONU to cord-tester. |
| 4532 | """ |
| 4533 | |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 4534 | """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each""" |
| 4535 | num_subscribers = 1 |
| 4536 | num_channels = 1 |
| 4537 | services = ('IGMP') |
| 4538 | cbs = (self.igmp_flow_check, None, None) |
| 4539 | self.voltha_subscribers(services, cbs = cbs, |
| 4540 | num_subscribers = num_subscribers, |
| 4541 | num_channels = num_channels) |
| 4542 | |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 4543 | def test_subscriber_with_voltha_for_igmp_leave_verifying_traffic(self): |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 4544 | """ |
| 4545 | Test Method: |
| 4546 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 4547 | 1. OLT and ONU is detected and validated. |
| 4548 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4549 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 4550 | 4. Send igmp joins for a multicast group address multi-group-addressA. |
| 4551 | 5. Send multicast data traffic for a group (multi-group-addressA) from other uni port on ONU. |
| 4552 | 6. Verify that multicast data packets are being recieved on join received uni port on ONU to cord-tester. |
| 4553 | 7. Send igmp leave for a multicast group address multi-group-addressA. |
| 4554 | 8. Verify that multicast data packets are not being recieved on leave sent uni port on ONU to cord-tester. |
| 4555 | """ |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 4556 | """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each""" |
| 4557 | num_subscribers = 1 |
| 4558 | num_channels = 1 |
| 4559 | services = ('IGMP') |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 4560 | cbs = (self.igmp_leave_flow_check, None, None) |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 4561 | self.voltha_subscribers(services, cbs = cbs, |
| 4562 | num_subscribers = num_subscribers, |
| 4563 | num_channels = num_channels) |
| 4564 | |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 4565 | 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] | 4566 | """ |
| 4567 | Test Method: |
| 4568 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 4569 | 1. OLT and ONU is detected and validated. |
| 4570 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4571 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 4572 | 4. Send igmp joins for a multicast group address multi-group-addressA. |
| 4573 | 5. Send multicast data traffic for a group (multi-group-addressA) from other uni port on ONU. |
| 4574 | 6. Verify that multicast data packets are being recieved on join received uni port on ONU to cord-tester. |
| 4575 | 7. Send igmp leave for a multicast group address multi-group-addressA. |
| 4576 | 8. Verify that multicast data packets are not being recieved on leave sent uni port on ONU to cord-tester. |
| 4577 | 9. Repeat steps 4 to 6. |
| 4578 | """ |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 4579 | """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each""" |
| 4580 | num_subscribers = 1 |
| 4581 | num_channels = 1 |
| 4582 | services = ('IGMP') |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 4583 | cbs = (self.igmp_leave_flow_check, None, None) |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 4584 | self.voltha_subscribers(services, cbs = cbs, |
| 4585 | num_subscribers = num_subscribers, |
| 4586 | num_channels = num_channels) |
| 4587 | |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 4588 | def test_subscriber_with_voltha_for_igmp_5_groups_joins_verifying_traffic(self): |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 4589 | """ |
| 4590 | Test Method: |
| 4591 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 4592 | 1. OLT and ONU is detected and validated. |
| 4593 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4594 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 4595 | 4. Send igmp joins for multicast group addresses multi-group-addressA,multi-group-addressB |
| 4596 | 5. Send multicast data traffic for two groups (multi-group-addressA and multi-group-addressB) from other uni port on ONU. |
| 4597 | 6. Verify that 2 groups multicast data packets are being recieved on join sent uni port on ONU to cord-tester. |
| 4598 | """ |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 4599 | """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each""" |
| 4600 | num_subscribers = 1 |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 4601 | num_channels = 5 |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 4602 | services = ('IGMP') |
| 4603 | cbs = (self.igmp_flow_check, None, None) |
| 4604 | self.voltha_subscribers(services, cbs = cbs, |
| 4605 | num_subscribers = num_subscribers, |
| 4606 | num_channels = num_channels) |
| 4607 | |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 4608 | def test_subscriber_with_voltha_for_igmp_5_groups_joins_and_leave_for_one_group_verifying_traffic(self): |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 4609 | """ |
| 4610 | Test Method: |
| 4611 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 4612 | 1. OLT and ONU is detected and validated. |
| 4613 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4614 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 4615 | 4. Send igmp joins for multicast group addresses multi-group-addressA,multi-group-addressB |
| 4616 | 5. Send multicast data traffic for two groups (multi-group-addressA and multi-group-addressB) from other uni port on ONU. |
| 4617 | 6. Verify that 2 groups multicast data packets are being recieved on join sent uni port on ONU to cord-tester. |
| 4618 | 7. Send igmp leave for a multicast group address multi-group-addressA. |
| 4619 | 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. |
| 4620 | 9. Verify that multicast data packets of group (multi-group-addressB) are being recieved on join sent uni port on ONU to cord-tester. |
| 4621 | """ |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 4622 | """Test subscriber join next for channel surfing with 3 subscribers browsing 3 channels each""" |
| 4623 | num_subscribers = 1 |
Thangavelu K S | b006b8a | 2017-07-28 19:29:39 +0000 | [diff] [blame] | 4624 | num_channels = 5 |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 4625 | services = ('IGMP') |
| 4626 | cbs = (self.igmp_flow_check, None, None) |
| 4627 | self.voltha_subscribers(services, cbs = cbs, |
| 4628 | num_subscribers = num_subscribers, |
| 4629 | num_channels = num_channels) |
| 4630 | |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 4631 | 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] | 4632 | """ |
| 4633 | Test Method: |
| 4634 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 4635 | 1. OLT and ONU is detected and validated. |
| 4636 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4637 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 4638 | 4. Send igmp joins for a multicast group address multi-group-addressA with source list src_listA |
| 4639 | 5. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listA on ONU. |
| 4640 | 6. Verify that multicast data packets are being recieved on join sent uni port on ONU to cord-tester. |
| 4641 | 7. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listB on ONU. |
| 4642 | 8. Verify that multicast data packets are not being recieved on join sent uni port on ONU from other source list to cord-tester. |
| 4643 | """ |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 4644 | num_subscribers = 1 |
| 4645 | num_channels = 1 |
| 4646 | services = ('IGMP') |
| 4647 | cbs = (self.igmp_flow_check, None, None) |
| 4648 | self.voltha_subscribers(services, cbs = cbs, src_list = ['2.3.4.5','3.4.5.6'], |
| 4649 | num_subscribers = num_subscribers, |
| 4650 | num_channels = num_channels) |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 4651 | |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 4652 | 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] | 4653 | """ |
| 4654 | Test Method: |
| 4655 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 4656 | 1. OLT and ONU is detected and validated. |
| 4657 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4658 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 4659 | 4. Send igmp joins for a multicast group address multi-group-addressA with source list src_listA |
| 4660 | 5. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listA on ONU. |
| 4661 | 6. Verify that multicast data packets are being recieved on join sent uni port on ONU to cord-tester. |
| 4662 | 7. Send igmp joins for a multicast group address multi-group-addressA with exclude source list src_listA |
| 4663 | 8. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listA on ONU. |
| 4664 | 9. Verify that multicast data packets are not being recieved on join sent uni port on ONU from other source list to cord-tester. |
| 4665 | """ |
| 4666 | |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 4667 | num_subscribers = 1 |
| 4668 | num_channels = 2 |
| 4669 | services = ('IGMP') |
| 4670 | cbs = (self.igmp_flow_check_join_change_to_exclude, None, None) |
| 4671 | self.voltha_subscribers(services, cbs = cbs, src_list = ['2.3.4.5','3.4.5.6'], |
| 4672 | num_subscribers = num_subscribers, |
| 4673 | num_channels = num_channels) |
| 4674 | |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 4675 | 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] | 4676 | """ |
| 4677 | Test Method: |
| 4678 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 4679 | 1. OLT and ONU is detected and validated. |
| 4680 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4681 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 4682 | 4. Send igmp joins for a multicast group address multi-group-addressA with source exclude list src_listA |
| 4683 | 5. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listA on ONU. |
| 4684 | 6. Verify that multicast data packets are not being recieved on join sent uni port on ONU to cord-tester. |
| 4685 | 7. Send igmp joins for a multicast group address multi-group-addressA with allow source list src_listA |
| 4686 | 8. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listA on ONU. |
| 4687 | 9. Verify that multicast data packets are being recieved on join sent uni port on ONU from other source list to cord-tester. |
| 4688 | """ |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 4689 | num_subscribers = 1 |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4690 | num_channels = 2 |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 4691 | services = ('IGMP') |
| 4692 | cbs = (self.igmp_flow_check_join_change_to_exclude_again_include_back, None, None) |
| 4693 | self.voltha_subscribers(services, cbs = cbs, src_list = ['2.3.4.5','3.4.5.6'], |
| 4694 | num_subscribers = num_subscribers, |
| 4695 | num_channels = num_channels) |
| 4696 | |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 4697 | 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] | 4698 | """ |
| 4699 | Test Method: |
| 4700 | 0. Make sure that voltha is 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. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 4704 | 4. Send igmp joins for a multicast group address multi-group-addressA with source list src_listA |
| 4705 | 5. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listA on ONU. |
| 4706 | 6. Verify that multicast data packets are being recieved on join sent uni port on ONU to cord-tester. |
| 4707 | 7. Send igmp joins for a multicast group address multi-group-addressA with block source list src_listA |
| 4708 | 8. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listA on ONU. |
| 4709 | 9. Verify that multicast data packets are not being recieved on join sent uni port on ONU from other source list to cord-tester. |
| 4710 | """ |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 4711 | |
| 4712 | num_subscribers = 1 |
| 4713 | num_channels = 1 |
| 4714 | services = ('IGMP') |
| 4715 | cbs = (self.igmp_flow_check_join_change_to_block, None, None) |
| 4716 | self.voltha_subscribers(services, cbs = cbs, src_list = ['2.3.4.5','3.4.5.6'], |
| 4717 | num_subscribers = num_subscribers, |
| 4718 | num_channels = num_channels) |
| 4719 | |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 4720 | 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] | 4721 | """ |
| 4722 | Test Method: |
| 4723 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 4724 | 1. OLT and ONU is detected and validated. |
| 4725 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4726 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 4727 | 4. Send igmp joins for a multicast group address multi-group-addressA with source exclude list src_listA |
| 4728 | 5. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listA on ONU. |
| 4729 | 6. Verify that multicast data packets are being recieved on join sent uni port on ONU to cord-tester. |
| 4730 | 7. Send igmp joins for a multicast group address multi-group-addressA with allow new source list src_listB |
| 4731 | 8. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listB on ONU. |
| 4732 | 9. Verify that multicast data packets are being recieved on join sent uni port on ONU from other source list to cord-tester. |
| 4733 | """ |
Thangavelu K S | 8e41308 | 2017-07-13 20:02:14 +0000 | [diff] [blame] | 4734 | |
| 4735 | num_subscribers = 1 |
| 4736 | num_channels = 1 |
| 4737 | services = ('IGMP') |
| 4738 | cbs = (self.igmp_flow_check_join_change_to_block_again_allow_back, None, None) |
| 4739 | self.voltha_subscribers(services, cbs = cbs, src_list = ['2.3.4.5','3.4.5.6'], |
| 4740 | num_subscribers = num_subscribers, |
| 4741 | num_channels = num_channels) |
| 4742 | |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 4743 | 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] | 4744 | """ |
| 4745 | Test Method: |
| 4746 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 4747 | 1. OLT and ONU is detected and validated. |
| 4748 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4749 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 4750 | 4. Send igmp joins for a multicast group address multi-group-addressA with source exclude list src_listA |
| 4751 | 5. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listA on ONU. |
| 4752 | 6. Verify that multicast data packets are not being recieved on join sent uni port on ONU to cord-tester. |
| 4753 | 7. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listB on ONU. |
| 4754 | 8. Verify that multicast data packets are not being recieved on join sent uni port on ONU from other source list to cord-tester. |
| 4755 | """ |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4756 | |
| 4757 | num_subscribers = 1 |
| 4758 | num_channels = 1 |
| 4759 | services = ('IGMP') |
| 4760 | cbs = (self.igmp_flow_check_group_include_source_empty_list, None, None) |
| 4761 | self.voltha_subscribers(services, cbs = cbs, src_list = ['0'], |
| 4762 | num_subscribers = num_subscribers, |
| 4763 | num_channels = num_channels) |
| 4764 | |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 4765 | 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] | 4766 | """ |
| 4767 | Test Method: |
| 4768 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 4769 | 1. OLT and ONU is detected and validated. |
| 4770 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4771 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 4772 | 4. Send igmp joins for a multicast group address multi-group-addressA with source exclude list src_listA |
| 4773 | 5. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listA on ONU. |
| 4774 | 6. Verify that multicast data packets are being recieved on join sent uni port on ONU to cord-tester. |
| 4775 | 7. Send multicast data traffic for a group (multi-group-addressA) from other uni port with source ip as src_listB on ONU. |
| 4776 | 8. Verify that multicast data packets are being recieved on join sent uni port on ONU from other source list to cord-tester. |
| 4777 | """ |
| 4778 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4779 | num_subscribers = 1 |
| 4780 | num_channels = 1 |
| 4781 | services = ('IGMP') |
| 4782 | cbs = (self.igmp_flow_check_group_exclude_source_empty_list, None, None) |
| 4783 | self.voltha_subscribers(services, cbs = cbs, src_list = ['0'], |
| 4784 | num_subscribers = num_subscribers, |
| 4785 | num_channels = num_channels) |
| 4786 | |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 4787 | 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] | 4788 | """ |
| 4789 | Test Method: |
| 4790 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 4791 | 1. OLT and ONU is detected and validated. |
| 4792 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4793 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 4794 | 4. Send igmp joins for a multicast group address multi-group-addressA from one subscribers (uni_1 port) |
| 4795 | 5. Send igmp joins for a multicast group address multi-group-addressB from other subscribers ( uni_2 port) |
| 4796 | 6. Send multicast data traffic for a group (multi-group-addressA) from other uni_3 port on ONU. |
| 4797 | 7. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester. |
| 4798 | 8. Verify that multicast data packets are not being recieved on join sent uni (uni_2) port on ONU to cord-tester. |
| 4799 | """ |
| 4800 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4801 | num_subscribers = 2 |
| 4802 | num_channels = 1 |
| 4803 | services = ('IGMP') |
| 4804 | cbs = (self.igmp_flow_check, None, None) |
| 4805 | self.voltha_subscribers(services, cbs = cbs, src_list = ['1.2.3.4'], |
| 4806 | num_subscribers = num_subscribers, |
| 4807 | num_channels = num_channels) |
| 4808 | |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 4809 | def test_two_subscribers_with_voltha_for_igmp_join_leave_for_one_subscriber_verifying_traffic(self): |
| 4810 | """ |
| 4811 | Test Method: |
| 4812 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 4813 | 1. OLT and ONU is detected and validated. |
| 4814 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4815 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 4816 | 4. Send igmp joins for a multicast group address multi-group-addressA from one subscribers (uni_1 port) |
| 4817 | 5. Send igmp joins for a multicast group address multi-group-addressA from other subscribers ( uni_2 port) |
| 4818 | 6. Send multicast data traffic for a group (multi-group-addressA) from other uni_3 port on ONU. |
| 4819 | 7. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester. |
| 4820 | 8. Verify that multicast data packets are being recieved on join sent uni (uni_2) port on ONU to cord-tester. |
| 4821 | 9. Send igmp leave for a multicast group address multi-group-addressA from other subscribers ( uni_2 port) |
| 4822 | 10. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester. |
| 4823 | 11. Verify that multicast data packets are not being recieved on join sent uni (uni_2) port on ONU to cord-tester. |
| 4824 | """ |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4825 | num_subscribers = 2 |
| 4826 | num_channels = 2 |
| 4827 | services = ('IGMP') |
| 4828 | cbs = (self.igmp_flow_check_join_change_to_exclude, None, None) |
| 4829 | self.voltha_subscribers(services, cbs = cbs, src_list = ['1.2.3.4','2.3.4.5'], |
| 4830 | num_subscribers = num_subscribers, |
| 4831 | num_channels = num_channels) |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 4832 | |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 4833 | 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] | 4834 | """ |
| 4835 | Test Method: |
| 4836 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 4837 | 1. OLT and ONU is detected and validated. |
| 4838 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4839 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 4840 | 4. Send igmp joins for a multicast group address multi-group-addressA from one subscribers (uni_1 port) |
| 4841 | 5. Send igmp leave for a multicast group address multi-group-addressB from other subscribers ( uni_2 port) |
| 4842 | 6. Send multicast data traffic for a group (multi-group-addressA) from other uni_3 port on ONU. |
| 4843 | 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. |
| 4844 | 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. |
| 4845 | 9. Send igmp join for a multicast group address multi-group-addressA from other subscribers ( uni_2 port) |
| 4846 | 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. |
| 4847 | 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. |
| 4848 | 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. |
| 4849 | """ |
| 4850 | |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4851 | num_subscribers = 2 |
| 4852 | num_channels = 2 |
| 4853 | services = ('IGMP') |
| 4854 | cbs = (self.igmp_flow_check_join_change_to_exclude_again_include_back, None, None) |
| 4855 | self.voltha_subscribers(services, cbs = cbs, src_list = ['1.2.3.4', '3.4.5.6'], |
| 4856 | num_subscribers = num_subscribers, |
| 4857 | num_channels = num_channels) |
| 4858 | |
| 4859 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 4860 | 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] | 4861 | """ |
| 4862 | Test Method: |
| 4863 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 4864 | 1. OLT and ONU is detected and validated. |
| 4865 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4866 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 4867 | 4. Send igmp joins for a multicast group address multi-group-addressA from one subscribers (uni_1 port) |
| 4868 | 5. Send igmp joins for a multicast group address multi-group-addressA from other subscribers ( uni_2 port) |
| 4869 | 6. Send multicast data traffic for a group (multi-group-addressA) from other uni_3 port on ONU. |
| 4870 | 7. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester. |
| 4871 | 8. Verify that multicast data packets are being recieved on join sent uni (uni_2) port on ONU to cord-tester. |
| 4872 | 9. Disable uni_2 port which is being shown on voltha CLI. |
| 4873 | 10. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester. |
| 4874 | 11. Verify that multicast data packets are not being recieved on join sent uni (uni_2) port on ONU to cord-tester. |
| 4875 | """ |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4876 | #rx_port = self.port_map['ports'][port_list[i][1]] |
| 4877 | df = defer.Deferred() |
| 4878 | def igmp_flow_check_operating_onu_admin_state(df): |
| 4879 | num_subscribers = 2 |
| 4880 | num_channels = 2 |
| 4881 | services = ('IGMP') |
| 4882 | cbs = (self.igmp_flow_check_during_olt_onu_operational_issues, None, None) |
| 4883 | port_list = self.generate_port_list(num_subscribers, num_channels) |
| 4884 | |
| 4885 | thread1 = threading.Thread(target = self.voltha_subscribers, args = (services, cbs, 2, 2, ['1.2.3.4', '3.4.5.6'],)) |
| 4886 | thread2 = threading.Thread(target = self.voltha_uni_port_toggle, args = (self.port_map['ports'][port_list[1][1]],)) |
| 4887 | thread1.start() |
| 4888 | time.sleep(randint(40,50)) |
| 4889 | log_test.info('Admin state of uni port is down and up after delay of 30 sec during tls auth flow check on voltha') |
| 4890 | thread2.start() |
| 4891 | time.sleep(10) |
| 4892 | thread1.join() |
| 4893 | thread2.join() |
| 4894 | try: |
| 4895 | assert_equal(self.success, False) |
| 4896 | log_test.info('Igmp flow check expected to fail, hence ignore the test_status of igmp flow check') |
| 4897 | time.sleep(10) |
| 4898 | finally: |
| 4899 | pass |
| 4900 | df.callback(0) |
| 4901 | reactor.callLater(0, igmp_flow_check_operating_onu_admin_state, df) |
| 4902 | return df |
| 4903 | |
| 4904 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 36edb01 | 2017-07-05 18:24:12 +0000 | [diff] [blame] | 4905 | def test_two_subscribers_with_voltha_for_igmp_toggling_uni_port_for_one_subscriber_and_verifying_traffic(self): |
| 4906 | """ |
| 4907 | Test Method: |
| 4908 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 4909 | 1. OLT and ONU is detected and validated. |
| 4910 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4911 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 4912 | 4. Send igmp joins for a multicast group address multi-group-addressA from one subscribers (uni_1 port) |
| 4913 | 5. Send igmp joins for a multicast group address multi-group-addressA from other subscribers ( uni_2 port) |
| 4914 | 6. Send multicast data traffic for a group (multi-group-addressA) from other uni_3 port on ONU. |
| 4915 | 7. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester. |
| 4916 | 8. Verify that multicast data packets are being recieved on join sent uni (uni_2) port on ONU to cord-tester. |
| 4917 | 9. Disable uni_2 port which is being shown on voltha CLI. |
| 4918 | 10. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester. |
| 4919 | 11. Verify that multicast data packets are not being recieved on join sent uni (uni_2) port on ONU to cord-tester. |
| 4920 | 12. Enable uni_2 port which we disable at step 9. |
| 4921 | 13. Repeat step 5,6 and 8. |
| 4922 | """ |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4923 | df = defer.Deferred() |
| 4924 | def igmp_flow_check_operating_onu_admin_state(df): |
| 4925 | num_subscribers = 2 |
| 4926 | num_channels = 2 |
| 4927 | services = ('IGMP') |
| 4928 | cbs = (self.igmp_flow_check, None, None) |
| 4929 | port_list = self.generate_port_list(num_subscribers, num_channels) |
| 4930 | |
| 4931 | thread1 = threading.Thread(target = self.voltha_subscribers, args = (services, cbs, 2, 2, ['1.2.3.4', '3.4.5.6'],)) |
| 4932 | thread2 = threading.Thread(target = self.voltha_uni_port_toggle, args = (self.port_map['ports'][port_list[1][1]],)) |
| 4933 | thread1.start() |
| 4934 | time.sleep(randint(50,60)) |
| 4935 | log_test.info('Admin state of uni port is down and up after delay of 30 sec during tls auth flow check on voltha') |
| 4936 | thread2.start() |
| 4937 | time.sleep(10) |
| 4938 | thread1.join() |
| 4939 | thread2.join() |
| 4940 | try: |
| 4941 | assert_equal(self.success, True) |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 4942 | 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] | 4943 | time.sleep(10) |
| 4944 | finally: |
| 4945 | pass |
| 4946 | df.callback(0) |
| 4947 | reactor.callLater(0, igmp_flow_check_operating_onu_admin_state, df) |
| 4948 | return df |
| 4949 | |
| 4950 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 4951 | 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] | 4952 | """ |
| 4953 | Test Method: |
| 4954 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 4955 | 1. OLT and ONU is detected and validated. |
| 4956 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 4957 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 4958 | 4. Send igmp joins for a multicast group address multi-group-addressA from one subscribers (uni_1 port) |
| 4959 | 5. Send igmp joins for a multicast group address multi-group-addressA from other subscribers ( uni_2 port) |
| 4960 | 6. Send multicast data traffic for a group (multi-group-addressA) from other uni_3 port on ONU. |
| 4961 | 7. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester. |
| 4962 | 8. Verify that multicast data packets are being recieved on join sent uni (uni_2) port on ONU to cord-tester. |
| 4963 | 9. Disable olt device which is being shown on voltha CLI. |
| 4964 | 10. Verify that multicast data packets are not being recieved on join sent uni (uni_1) port on ONU to cord-tester. |
| 4965 | 11. Verify that multicast data packets are not being recieved on join sent uni (uni_2) port on ONU to cord-tester. |
| 4966 | """ |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 4967 | df = defer.Deferred() |
| 4968 | def igmp_flow_check_operating_olt_admin_disble(df): |
| 4969 | num_subscribers = 2 |
| 4970 | num_channels = 2 |
| 4971 | services = ('IGMP') |
| 4972 | cbs = (self.igmp_flow_check_during_olt_onu_operational_issues, None, None) |
| 4973 | port_list = self.generate_port_list(num_subscribers, num_channels) |
| 4974 | |
| 4975 | thread1 = threading.Thread(target = self.voltha_subscribers, args = (services, cbs, 2, 2, ['1.2.3.4', '3.4.5.6'],)) |
| 4976 | thread1.start() |
| 4977 | time.sleep(randint(50,60)) |
| 4978 | thread2 = threading.Thread(target = self.voltha.disable_device, args = (self.olt_device_id, False,)) |
| 4979 | thread2.start() |
| 4980 | time.sleep(10) |
| 4981 | thread1.join() |
| 4982 | thread2.join() |
| 4983 | try: |
| 4984 | assert_equal(self.success, False) |
| 4985 | log_test.info('Igmp flow check expected to fail during olt device is disabled, so ignored test_status of this test') |
| 4986 | time.sleep(10) |
| 4987 | finally: |
| 4988 | pass |
| 4989 | df.callback(0) |
| 4990 | reactor.callLater(0, igmp_flow_check_operating_olt_admin_disble, df) |
| 4991 | return df |
| 4992 | |
| 4993 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 4994 | 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] | 4995 | """ |
| 4996 | Test Method: |
| 4997 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 4998 | 1. OLT and ONU is detected and validated. |
| 4999 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 5000 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 5001 | 4. Send igmp joins for a multicast group address multi-group-addressA from one subscribers (uni_1 port) |
| 5002 | 5. Send igmp joins for a multicast group address multi-group-addressA from other subscribers ( uni_2 port) |
| 5003 | 6. Send multicast data traffic for a group (multi-group-addressA) from other uni_3 port on ONU. |
| 5004 | 7. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester. |
| 5005 | 8. Verify that multicast data packets are being recieved on join sent uni (uni_2) port on ONU to cord-tester. |
| 5006 | 9. Pause olt device which is being shown on voltha CLI. |
| 5007 | 10. Verify that multicast data packets are not being recieved on join sent uni (uni_1) port on ONU to cord-tester. |
| 5008 | 11. Verify that multicast data packets are not being recieved on join sent uni (uni_2) port on ONU to cord-tester. |
| 5009 | """ |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 5010 | df = defer.Deferred() |
| 5011 | def igmp_flow_check_operating_olt_admin_pause(df): |
| 5012 | num_subscribers = 2 |
| 5013 | num_channels = 2 |
| 5014 | services = ('IGMP') |
| 5015 | cbs = (self.igmp_flow_check_during_olt_onu_operational_issues, None, None) |
| 5016 | port_list = self.generate_port_list(num_subscribers, num_channels) |
| 5017 | |
| 5018 | thread1 = threading.Thread(target = self.voltha_subscribers, args = (services, cbs, 2, 2, ['1.2.3.4', '3.4.5.6'],)) |
| 5019 | thread1.start() |
| 5020 | time.sleep(randint(50,60)) |
| 5021 | thread2 = threading.Thread(target = self.voltha.pause_device, args = (self.olt_device_id,)) |
| 5022 | thread2.start() |
| 5023 | time.sleep(10) |
| 5024 | thread1.join() |
| 5025 | thread2.join() |
| 5026 | try: |
| 5027 | assert_equal(self.success, False) |
| 5028 | log_test.info('Igmp flow check expected to fail during olt device is paused, so ignored test_status of this test') |
| 5029 | time.sleep(10) |
| 5030 | finally: |
| 5031 | pass |
| 5032 | df.callback(0) |
| 5033 | reactor.callLater(0, igmp_flow_check_operating_olt_admin_pause, df) |
| 5034 | return df |
| 5035 | |
| 5036 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 5037 | 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] | 5038 | """ |
| 5039 | Test Method: |
| 5040 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 5041 | 1. OLT and ONU is detected and validated. |
| 5042 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 5043 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 5044 | 4. Send igmp joins for a multicast group address multi-group-addressA from one subscribers (uni_1 port) |
| 5045 | 5. Send igmp joins for a multicast group address multi-group-addressA from other subscribers ( uni_2 port) |
| 5046 | 6. Send multicast data traffic for a group (multi-group-addressA) from other uni_3 port on ONU. |
| 5047 | 7. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester. |
| 5048 | 8. Verify that multicast data packets are being recieved on join sent uni (uni_2) port on ONU to cord-tester. |
| 5049 | 9. Disable olt device which is being shown on voltha CLI. |
| 5050 | 10. Verify that multicast data packets are not being recieved on join sent uni (uni_1) port on ONU to cord-tester. |
| 5051 | 11. Verify that multicast data packets are not being recieved on join sent uni (uni_2) port on ONU to cord-tester. |
| 5052 | 12. Enable olt device which is disable at step 9. |
| 5053 | 13. Repeat steps 4,5, 7 and 8. |
| 5054 | """ |
Thangavelu K S | fdf5cac | 2017-07-18 21:57:07 +0000 | [diff] [blame] | 5055 | df = defer.Deferred() |
| 5056 | def igmp_flow_check_operating_olt_admin_restart(df): |
| 5057 | num_subscribers = 2 |
| 5058 | num_channels = 2 |
| 5059 | services = ('IGMP') |
| 5060 | cbs = (self.igmp_flow_check, None, None) |
| 5061 | port_list = self.generate_port_list(num_subscribers, num_channels) |
| 5062 | |
| 5063 | thread1 = threading.Thread(target = self.voltha_subscribers, args = (services, cbs, 2, 2, ['1.2.3.4', '3.4.5.6'],)) |
| 5064 | thread1.start() |
| 5065 | time.sleep(randint(50,60)) |
| 5066 | thread2 = threading.Thread(target = self.voltha.restart_device, args = (self.olt_device_id,)) |
| 5067 | thread2.start() |
| 5068 | time.sleep(10) |
| 5069 | thread1.join() |
| 5070 | thread2.join() |
| 5071 | try: |
| 5072 | assert_equal(self.success, True) |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 5073 | 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] | 5074 | time.sleep(10) |
| 5075 | finally: |
| 5076 | pass |
| 5077 | df.callback(0) |
| 5078 | reactor.callLater(0, igmp_flow_check_operating_olt_admin_restart, df) |
| 5079 | return df |
Thangavelu K S | 6432b52 | 2017-07-22 00:05:54 +0000 | [diff] [blame] | 5080 | |
| 5081 | @deferred(TESTCASE_TIMEOUT) |
| 5082 | def test_two_subscribers_with_voltha_for_igmp_multiple_times_disabling_olt_verifying_traffic(self): |
| 5083 | """ |
| 5084 | Test Method: |
| 5085 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 5086 | 1. OLT and ONU is detected and validated. |
| 5087 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 5088 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 5089 | 4. Send igmp joins for a multicast group address multi-group-addressA from one subscribers (uni_1 port) |
| 5090 | 5. Send igmp joins for a multicast group address multi-group-addressA from other subscribers ( uni_2 port) |
| 5091 | 6. Send multicast data traffic for a group (multi-group-addressA) from other uni_3 port on ONU. |
| 5092 | 7. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester. |
| 5093 | 8. Verify that multicast data packets are being recieved on join sent uni (uni_2) port on ONU to cord-tester. |
| 5094 | 9. Disable olt device which is being shown on voltha CLI. |
| 5095 | 10. Verify that multicast data packets are not being recieved on join sent uni (uni_1) port on ONU to cord-tester. |
| 5096 | 11. Verify that multicast data packets are not being recieved on join sent uni (uni_2) port on ONU to cord-tester. |
| 5097 | 12. Repeat steps 4 to 11 steps multiple times (example 20 times) |
| 5098 | """ |
| 5099 | df = defer.Deferred() |
| 5100 | no_iterations = 20 |
| 5101 | def igmp_flow_check_operating_olt_admin_disble(df): |
| 5102 | num_subscribers = 2 |
| 5103 | num_channels = 2 |
| 5104 | services = ('IGMP') |
| 5105 | cbs = (self.igmp_flow_check, None, None) |
| 5106 | port_list = self.generate_port_list(num_subscribers, num_channels) |
| 5107 | |
| 5108 | thread1 = threading.Thread(target = self.voltha_subscribers, args = (services, cbs, 2, 2, ['1.2.3.4', '3.4.5.6'],)) |
| 5109 | thread1.start() |
| 5110 | time.sleep(randint(30,40)) |
| 5111 | for i in range(no_iterations): |
| 5112 | thread2 = threading.Thread(target = self.voltha.disable_device, args = (self.olt_device_id, False,)) |
| 5113 | thread2.start() |
| 5114 | time.sleep(8) |
| 5115 | thread2.join() |
| 5116 | thread1.join() |
| 5117 | thread1.isAlive() |
| 5118 | thread2.join() |
| 5119 | try: |
| 5120 | assert_equal(self.success, False) |
| 5121 | log_test.info('Igmp flow check expected to fail during olt device is disabled, so ignored test_status of this test') |
| 5122 | time.sleep(10) |
| 5123 | finally: |
| 5124 | pass |
| 5125 | df.callback(0) |
| 5126 | reactor.callLater(0, igmp_flow_check_operating_olt_admin_disble, df) |
| 5127 | return df |
| 5128 | |
| 5129 | @deferred(TESTCASE_TIMEOUT + 200) |
| 5130 | def test_two_subscribers_with_voltha_for_igmp_multiple_times_toggling_uni_port_for_one_subscriber_verifying_traffic(self): |
| 5131 | """ |
| 5132 | Test Method: |
| 5133 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 5134 | 1. OLT and ONU is detected and validated. |
| 5135 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 5136 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 5137 | 4. Send igmp joins for a multicast group address multi-group-addressA from one subscribers (uni_1 port) |
| 5138 | 5. Send igmp joins for a multicast group address multi-group-addressA from other subscribers ( uni_2 port) |
| 5139 | 6. Send multicast data traffic for a group (multi-group-addressA) from other uni_3 port on ONU. |
| 5140 | 7. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester. |
| 5141 | 8. Verify that multicast data packets are being recieved on join sent uni (uni_2) port on ONU to cord-tester. |
| 5142 | 9. Disable uni_2 port which is being shown on voltha CLI. |
| 5143 | 10. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester. |
| 5144 | 11. Verify that multicast data packets are not being recieved on join sent uni (uni_2) port on ONU to cord-tester. |
| 5145 | 12. Enable uni_2 port which we disable at step 9. |
| 5146 | 13. Repeat step 5,6 and 8. |
| 5147 | 14. Repeat steps 4 to 13 steps multiple times (example 5 times) |
| 5148 | """ |
| 5149 | df = defer.Deferred() |
| 5150 | no_iterations = 5 |
| 5151 | def igmp_flow_check_operating_onu_admin_state(df): |
| 5152 | num_subscribers = 2 |
| 5153 | num_channels = 2 |
| 5154 | services = ('IGMP') |
| 5155 | cbs = (self.igmp_flow_check, None, None) |
| 5156 | port_list = self.generate_port_list(num_subscribers, num_channels) |
| 5157 | |
| 5158 | thread1 = threading.Thread(target = self.voltha_subscribers, args = (services, cbs, 2, 2, ['1.2.3.4', '3.4.5.6'],)) |
| 5159 | thread1.start() |
| 5160 | time.sleep(randint(40,60)) |
| 5161 | for i in range(no_iterations): |
| 5162 | thread2 = threading.Thread(target = self.voltha_uni_port_toggle, args = (self.port_map['ports'][port_list[1][1]],)) |
| 5163 | log_test.info('Admin state of uni port is down and up after delay of 30 sec during igmp flow check on voltha') |
| 5164 | thread2.start() |
| 5165 | time.sleep(1) |
| 5166 | thread2.join() |
| 5167 | thread1.isAlive() |
| 5168 | thread1.join() |
| 5169 | thread2.join() |
| 5170 | try: |
| 5171 | assert_equal(self.success, True) |
| 5172 | log_test.info('Igmp flow check expected to fail during UNI port down only, after UNI port is up it should be successful') |
| 5173 | time.sleep(10) |
| 5174 | finally: |
| 5175 | pass |
| 5176 | df.callback(0) |
| 5177 | reactor.callLater(0, igmp_flow_check_operating_onu_admin_state, df) |
| 5178 | return df |
| 5179 | |
| 5180 | @deferred(TESTCASE_TIMEOUT) |
| 5181 | def test_two_subscribers_with_voltha_for_igmp_multiple_times_toggling_olt_verifying_traffic(self): |
| 5182 | """ |
| 5183 | Test Method: |
| 5184 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 5185 | 1. OLT and ONU is detected and validated. |
| 5186 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 5187 | 3. Issue dhcp client packets to get IP address from dhcp server for a subscriber and check connectivity. |
| 5188 | 4. Send igmp joins for a multicast group address multi-group-addressA from one subscribers (uni_1 port) |
| 5189 | 5. Send igmp joins for a multicast group address multi-group-addressA from other subscribers ( uni_2 port) |
| 5190 | 6. Send multicast data traffic for a group (multi-group-addressA) from other uni_3 port on ONU. |
| 5191 | 7. Verify that multicast data packets are being recieved on join sent uni (uni_1) port on ONU to cord-tester. |
| 5192 | 8. Verify that multicast data packets are being recieved on join sent uni (uni_2) port on ONU to cord-tester. |
| 5193 | 9. Disable olt device which is being shown on voltha CLI. |
| 5194 | 10. Verify that multicast data packets are not being recieved on join sent uni (uni_1) port on ONU to cord-tester. |
| 5195 | 11. Verify that multicast data packets are not being recieved on join sent uni (uni_2) port on ONU to cord-tester. |
| 5196 | 12. Enable olt device which is disable at step 9. |
| 5197 | 13. Repeat steps 4,5, 7 and 8. |
| 5198 | 14. Repeat steps 4 to 13 steps multiple times (example 10 times) |
| 5199 | """ |
| 5200 | df = defer.Deferred() |
| 5201 | no_iterations = 10 |
| 5202 | def igmp_flow_check_operating_olt_admin_restart(df): |
| 5203 | num_subscribers = 2 |
| 5204 | num_channels = 2 |
| 5205 | services = ('IGMP') |
| 5206 | cbs = (self.igmp_flow_check, None, None) |
| 5207 | port_list = self.generate_port_list(num_subscribers, num_channels) |
| 5208 | |
| 5209 | thread1 = threading.Thread(target = self.voltha_subscribers, args = (services, cbs, 2, 2, ['1.2.3.4', '3.4.5.6'],)) |
| 5210 | thread1.start() |
| 5211 | time.sleep(randint(50,60)) |
| 5212 | for i in range(no_iterations): |
| 5213 | thread2 = threading.Thread(target = self.voltha.restart_device, args = (self.olt_device_id,)) |
| 5214 | thread2.start() |
| 5215 | time.sleep(10) |
| 5216 | thread2.join() |
| 5217 | thread1.join() |
| 5218 | thread2.join() |
| 5219 | try: |
| 5220 | assert_equal(self.success, True) |
| 5221 | log_test.info('Igmp flow check expected to fail during olt device restart, after OLT device is up, it should be successful') |
| 5222 | time.sleep(10) |
| 5223 | finally: |
| 5224 | pass |
| 5225 | df.callback(0) |
| 5226 | reactor.callLater(0, igmp_flow_check_operating_olt_admin_restart, df) |
| 5227 | return df |
| 5228 | |
| 5229 | def test_5_subscriber_with_voltha_for_igmp_with_10_group_joins_verifying_traffic(self): |
| 5230 | """ |
| 5231 | Test Method: |
| 5232 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 5233 | 1. OLT and ONU is detected and validated. |
| 5234 | 2. Issue multiple tls auth packets from CORD TESTER voltha test module acting as subscribers.. |
| 5235 | 3. Issue multiple dhcp client packets to get IP address from dhcp server for as subscribers and check connectivity. |
| 5236 | 4. Send multiple igmp joins for 10 multicast group addresses multi-group-addressA,multi-group-addressB etc |
| 5237 | 5. Send multicast data traffic for two groups (multi-group-addressA and multi-group-addressB) from other uni port on ONU. |
| 5238 | 6. Verify that 2 groups multicast data packets are being recieved on join sent uni port on ONU to cord-tester. |
| 5239 | """ |
| 5240 | |
| 5241 | num_subscribers = 5 |
| 5242 | num_channels = 10 |
| 5243 | services = ('IGMP') |
| 5244 | cbs = (self.igmp_flow_check, None, None) |
| 5245 | self.voltha_subscribers(services, cbs = cbs, |
| 5246 | num_subscribers = num_subscribers, |
| 5247 | num_channels = num_channels) |
| 5248 | |
| 5249 | def test_9_subscriber_with_voltha_for_igmp_with_10_group_joins_and_verify_traffic(self): |
| 5250 | """ |
| 5251 | Test Method: |
| 5252 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 5253 | 1. OLT and ONU is detected and validated. |
| 5254 | 2. Issue multiple tls auth packets from CORD TESTER voltha test module acting as subscribers.. |
| 5255 | 3. Issue multiple dhcp client packets to get IP address from dhcp server for subscribers and check connectivity. |
| 5256 | 4. Send multiple igmp joins for 10 multicast group addresses multi-group-addressA,multi-group-addressB etc |
| 5257 | 5. Send multicast data traffic for two groups (multi-group-addressA and multi-group-addressB) from other uni port on ONU. |
| 5258 | 6. Verify that 2 groups multicast data packets are being recieved on join sent uni port on ONU to cord-tester. |
| 5259 | """ |
| 5260 | num_subscribers = 9 |
| 5261 | num_channels = 10 |
| 5262 | services = ('IGMP') |
| 5263 | cbs = (self.igmp_flow_check, None, None) |
| 5264 | self.voltha_subscribers(services, cbs = cbs, |
| 5265 | num_subscribers = num_subscribers, |
| 5266 | num_channels = num_channels) |