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