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 |
A R Karthick | 35495c3 | 2017-05-11 14:58:32 -0700 | [diff] [blame] | 10 | from nose.tools import * |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 11 | from nose.twistedtools import reactor, deferred |
| 12 | from twisted.internet import defer |
A R Karthick | 35495c3 | 2017-05-11 14:58:32 -0700 | [diff] [blame] | 13 | from CordTestConfig import setup_module |
| 14 | from CordTestUtils import log_test |
| 15 | from VolthaCtrl import VolthaCtrl |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 16 | from CordTestUtils import log_test, get_controller |
| 17 | from portmaps import g_subscriber_port_map |
| 18 | from OltConfig import * |
| 19 | from EapTLS import TLSAuthTest |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame^] | 20 | from DHCP import DHCPTest |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 21 | from OnosCtrl import OnosCtrl |
| 22 | from CordLogger import CordLogger |
| 23 | from scapy.all import * |
| 24 | from scapy_ssl_tls.ssl_tls import * |
| 25 | from scapy_ssl_tls.ssl_tls_crypto import * |
| 26 | 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] | 27 | from CordContainer import Onos |
A R Karthick | 35495c3 | 2017-05-11 14:58:32 -0700 | [diff] [blame] | 28 | |
| 29 | class voltha_exchange(unittest.TestCase): |
| 30 | |
| 31 | OLT_TYPE = 'tibit_olt' |
| 32 | OLT_MAC = '00:0c:e2:31:12:00' |
| 33 | VOLTHA_HOST = 'localhost' |
| 34 | VOLTHA_REST_PORT = 8881 |
| 35 | voltha = None |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 36 | success = True |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 37 | apps = ('org.opencord.aaa', 'org.onosproject.dhcp') |
| 38 | olt_apps = () #'org.opencord.cordmcast') |
| 39 | vtn_app = 'org.opencord.vtn' |
| 40 | table_app = 'org.ciena.cordigmp' |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 41 | test_path = os.path.dirname(os.path.realpath(__file__)) |
| 42 | 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] | 43 | 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] | 44 | 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] | 45 | olt_app_name = 'org.onosproject.olt' |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 46 | #onos_config_path = os.path.join(test_path, '..', 'setup/onos-config') |
| 47 | olt_conf_file = os.getenv('OLT_CONFIG_FILE', os.path.join(test_path, '..', 'setup/olt_config.json')) |
| 48 | onos_restartable = bool(int(os.getenv('ONOS_RESTART', 0))) |
| 49 | VOLTHA_ENABLED = True |
| 50 | INTF_TX_DEFAULT = 'veth2' |
| 51 | INTF_RX_DEFAULT = 'veth0' |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 52 | INTF_2_RX_DEFAULT = 'veth6' |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 53 | TESTCASE_TIMEOUT = 300 |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 54 | # VOLTHA_CONFIG_FAKE = True |
| 55 | VOLTHA_CONFIG_FAKE = False |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 56 | VOLTHA_UPLINK_VLAN_MAP = { 'of:0000000000000001' : '222' } |
| 57 | VOLTHA_ONU_UNI_PORT = 'veth0' |
| 58 | |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame^] | 59 | dhcp_server_config = { |
| 60 | "ip": "10.1.11.50", |
| 61 | "mac": "ca:fe:ca:fe:ca:fe", |
| 62 | "subnet": "255.255.252.0", |
| 63 | "broadcast": "10.1.11.255", |
| 64 | "router": "10.1.8.1", |
| 65 | "domain": "8.8.8.8", |
| 66 | "ttl": "63", |
| 67 | "delay": "2", |
| 68 | "startip": "10.1.11.51", |
| 69 | "endip": "10.1.11.100" |
| 70 | } |
| 71 | |
| 72 | |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 73 | CLIENT_CERT = """-----BEGIN CERTIFICATE----- |
| 74 | MIICuDCCAiGgAwIBAgIBAjANBgkqhkiG9w0BAQUFADCBizELMAkGA1UEBhMCVVMx |
| 75 | CzAJBgNVBAgTAkNBMRIwEAYDVQQHEwlTb21ld2hlcmUxEzARBgNVBAoTCkNpZW5h |
| 76 | IEluYy4xHjAcBgkqhkiG9w0BCQEWD2FkbWluQGNpZW5hLmNvbTEmMCQGA1UEAxMd |
| 77 | RXhhbXBsZSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMTYwNjA2MjExMjI3WhcN |
| 78 | MTcwNjAxMjExMjI3WjBnMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExEzARBgNV |
| 79 | BAoTCkNpZW5hIEluYy4xFzAVBgNVBAMUDnVzZXJAY2llbmEuY29tMR0wGwYJKoZI |
| 80 | hvcNAQkBFg51c2VyQGNpZW5hLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkC |
| 81 | gYEAwvXiSzb9LZ6c7uNziUfKvoHO7wu/uiFC5YUpXbmVGuGZizbVrny0xnR85Dfe |
| 82 | +9R4diansfDhIhzOUl1XjN3YDeSS9OeF5YWNNE8XDhlz2d3rVzaN6hIhdotBkUjg |
| 83 | rUewjTg5OFR31QEyG3v8xR3CLgiE9xQELjZbSA07pD79zuUCAwEAAaNPME0wEwYD |
| 84 | VR0lBAwwCgYIKwYBBQUHAwIwNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL3d3dy5l |
| 85 | eGFtcGxlLmNvbS9leGFtcGxlX2NhLmNybDANBgkqhkiG9w0BAQUFAAOBgQDAjkrY |
| 86 | 6tDChmKbvr8w6Du/t8vHjTCoCIocHTN0qzWOeb1YsAGX89+TrWIuO1dFyYd+Z0KC |
| 87 | PDKB5j/ygml9Na+AklSYAVJIjvlzXKZrOaPmhZqDufi+rXWti/utVqY4VMW2+HKC |
| 88 | nXp37qWeuFLGyR1519Y1d6F/5XzqmvbwURuEug== |
| 89 | -----END CERTIFICATE-----""" |
| 90 | |
| 91 | CLIENT_CERT_INVALID = '''-----BEGIN CERTIFICATE----- |
| 92 | MIIDvTCCAqWgAwIBAgIBAjANBgkqhkiG9w0BAQUFADCBizELMAkGA1UEBhMCVVMx |
| 93 | CzAJBgNVBAgTAkNBMRIwEAYDVQQHEwlTb21ld2hlcmUxEzARBgNVBAoTCkNpZW5h |
| 94 | IEluYy4xHjAcBgkqhkiG9w0BCQEWD2FkbWluQGNpZW5hLmNvbTEmMCQGA1UEAxMd |
| 95 | RXhhbXBsZSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMTYwMzExMTg1MzM2WhcN |
| 96 | MTcwMzA2MTg1MzM2WjBnMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExEzARBgNV |
| 97 | BAoTCkNpZW5hIEluYy4xFzAVBgNVBAMUDnVzZXJAY2llbmEuY29tMR0wGwYJKoZI |
| 98 | hvcNAQkBFg51c2VyQGNpZW5hLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC |
| 99 | AQoCggEBAOxemcBsPn9tZsCa5o2JA6sQDC7A6JgCNXXl2VFzKLNNvB9PS6D7ZBsQ |
| 100 | 5An0zEDMNzi51q7lnrYg1XyiE4S8FzMGAFr94RlGMQJUbRD9V/oqszMX4k++iAOK |
| 101 | tIA1gr3x7Zi+0tkjVSVzXTmgNnhChAamdMsjYUG5+CY9WAicXyy+VEV3zTphZZDR |
| 102 | OjcjEp4m/TSXVPYPgYDXI40YZKX5BdvqykWtT/tIgZb48RS1NPyN/XkCYzl3bv21 |
| 103 | qx7Mc0fcEbsJBIIRYTUkfxnsilcnmLxSYO+p+DZ9uBLBzcQt+4Rd5pLSfi21WM39 |
| 104 | 2Z2oOi3vs/OYAPAqgmi2JWOv3mePa/8CAwEAAaNPME0wEwYDVR0lBAwwCgYIKwYB |
| 105 | BQUHAwIwNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL3d3dy5leGFtcGxlLmNvbS9l |
| 106 | eGFtcGxlX2NhLmNybDANBgkqhkiG9w0BAQUFAAOCAQEALBzMPDTIB6sLyPl0T6JV |
| 107 | MjOkyldAVhXWiQsTjaGQGJUUe1cmUJyZbUZEc13MygXMPOM4x7z6VpXGuq1c/Vxn |
| 108 | VzQ2fNnbJcIAHi/7G8W5/SQfPesIVDsHTEc4ZspPi5jlS/MVX3HOC+BDbOjdbwqP |
| 109 | RX0JEr+uOyhjO+lRxG8ilMRACoBUbw1eDuVDoEBgErSUC44pq5ioDw2xelc+Y6hQ |
| 110 | dmtYwfY0DbvwxHtA495frLyPcastDiT/zre7NL51MyUDPjjYjghNQEwvu66IKbQ3 |
| 111 | T1tJBrgI7/WI+dqhKBFolKGKTDWIHsZXQvZ1snGu/FRYzg1l+R/jT8cRB9BDwhUt |
| 112 | yg== |
| 113 | -----END CERTIFICATE-----''' |
A R Karthick | 35495c3 | 2017-05-11 14:58:32 -0700 | [diff] [blame] | 114 | |
A.R Karthick | 3493a57 | 2017-06-07 18:28:10 -0700 | [diff] [blame] | 115 | @classmethod |
| 116 | def update_apps_version(cls): |
| 117 | version = Onos.getVersion() |
| 118 | major = int(version.split('.')[0]) |
| 119 | minor = int(version.split('.')[1]) |
| 120 | cordigmp_app_version = '2.0-SNAPSHOT' |
| 121 | olt_app_version = '1.2-SNAPSHOT' |
| 122 | if major > 1: |
| 123 | cordigmp_app_version = '3.0-SNAPSHOT' |
| 124 | olt_app_version = '2.0-SNAPSHOT' |
| 125 | elif major == 1: |
| 126 | if minor > 10: |
| 127 | cordigmp_app_version = '3.0-SNAPSHOT' |
| 128 | olt_app_version = '2.0-SNAPSHOT' |
| 129 | elif minor <= 8: |
| 130 | olt_app_version = '1.1-SNAPSHOT' |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 131 | cls.app_file = os.path.join(cls.test_path, '..', 'apps/ciena-cordigmp-{}.oar'.format(cordigmp_app_version)) |
| 132 | cls.table_app_file = os.path.join(cls.test_path, '..', 'apps/ciena-cordigmp-multitable-{}.oar'.format(cordigmp_app_version)) |
| 133 | cls.olt_app_file = os.path.join(cls.test_path, '..', 'apps/olt-app-{}.oar'.format(olt_app_version)) |
| 134 | |
A R Karthick | 35495c3 | 2017-05-11 14:58:32 -0700 | [diff] [blame] | 135 | @classmethod |
A.R Karthick | f874d03 | 2017-06-07 18:47:51 -0700 | [diff] [blame] | 136 | def onos_load_config(cls, app, config): |
| 137 | status, code = OnosCtrl.config(config) |
| 138 | if status is False: |
| 139 | log_test.info('JSON config request for app %s returned status %d' %(app, code)) |
| 140 | assert_equal(status, True) |
| 141 | time.sleep(2) |
| 142 | |
| 143 | @classmethod |
| 144 | def onos_aaa_load(cls): |
| 145 | aaa_dict = {'apps' : { 'org.opencord.aaa' : { 'AAA' : { 'radiusSecret': 'radius_password', |
| 146 | 'radiusIp': '172.17.0.2' } } } } |
| 147 | radius_ip = os.getenv('ONOS_AAA_IP') or '172.17.0.2' |
| 148 | aaa_dict['apps']['org.opencord.aaa']['AAA']['radiusIp'] = radius_ip |
| 149 | cls.onos_load_config('org.opencord.aaa', aaa_dict) |
| 150 | |
| 151 | @classmethod |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame^] | 152 | def onos_dhcp_table_load(self, config = None): |
| 153 | dhcp_dict = {'apps' : { 'org.onosproject.dhcp' : { 'dhcp' : copy.copy(self.dhcp_server_config) } } } |
| 154 | dhcp_config = dhcp_dict['apps']['org.onosproject.dhcp']['dhcp'] |
| 155 | if config: |
| 156 | for k in config.keys(): |
| 157 | if dhcp_config.has_key(k): |
| 158 | dhcp_config[k] = config[k] |
| 159 | self.onos_load_config('org.onosproject.dhcp', dhcp_dict) |
| 160 | |
| 161 | def dhcp_sndrcv(self, dhcp, update_seed = False): |
| 162 | cip, sip = dhcp.discover(update_seed = update_seed) |
| 163 | assert_not_equal(cip, None) |
| 164 | assert_not_equal(sip, None) |
| 165 | log_test.info('Got dhcp client IP %s from server %s for mac %s' % |
| 166 | (cip, sip, dhcp.get_mac(cip)[0])) |
| 167 | return cip,sip |
| 168 | |
| 169 | def dhcp_request(self, onu_iface = None, seed_ip = '10.10.10.1', update_seed = False): |
| 170 | config = {'startip':'10.10.10.20', 'endip':'10.10.10.200', |
| 171 | 'ip':'10.10.10.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 172 | 'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'} |
| 173 | self.onos_dhcp_table_load(config) |
| 174 | dhcp = DHCPTest(seed_ip = seed_ip, iface =onu_iface) |
| 175 | cip, sip = self.dhcp_sndrcv(dhcp, update_seed = update_seed) |
| 176 | return cip, sip |
| 177 | |
| 178 | @classmethod |
A R Karthick | 35495c3 | 2017-05-11 14:58:32 -0700 | [diff] [blame] | 179 | def setUpClass(cls): |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 180 | cls.update_apps_version() |
A R Karthick | 35495c3 | 2017-05-11 14:58:32 -0700 | [diff] [blame] | 181 | 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] | 182 | cls.install_app_table() |
| 183 | cls.olt = OltConfig(olt_conf_file = cls.olt_conf_file) |
| 184 | cls.port_map, cls.port_list = cls.olt.olt_port_map() |
| 185 | cls.switches = cls.port_map['switches'] |
| 186 | cls.num_ports = cls.port_map['num_ports'] |
| 187 | if cls.num_ports > 1: |
| 188 | cls.num_ports -= 1 ##account for the tx port |
| 189 | cls.activate_apps(cls.apps + cls.olt_apps) |
A.R Karthick | f874d03 | 2017-06-07 18:47:51 -0700 | [diff] [blame] | 190 | cls.onos_aaa_load() |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 191 | |
A.R Karthick | 3493a57 | 2017-06-07 18:28:10 -0700 | [diff] [blame] | 192 | @classmethod |
| 193 | def tearDownClass(cls): |
| 194 | '''Deactivate the olt apps and restart OVS back''' |
| 195 | apps = cls.olt_apps + ( cls.table_app,) |
| 196 | for app in apps: |
| 197 | onos_ctrl = OnosCtrl(app) |
| 198 | onos_ctrl.deactivate() |
| 199 | cls.install_app_igmp() |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 200 | |
A.R Karthick | 3493a57 | 2017-06-07 18:28:10 -0700 | [diff] [blame] | 201 | @classmethod |
| 202 | def install_app_igmp(cls): |
| 203 | ##Uninstall the table app on class exit |
| 204 | OnosCtrl.uninstall_app(cls.table_app) |
| 205 | time.sleep(2) |
| 206 | log_test.info('Installing back the cord igmp app %s for subscriber test on exit' %(cls.app_file)) |
| 207 | OnosCtrl.install_app(cls.app_file) |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 208 | |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 209 | def remove_olt(self, switch_map): |
| 210 | controller = get_controller() |
| 211 | auth = ('karaf', 'karaf') |
| 212 | #remove subscriber for every port on all the voltha devices |
| 213 | for device, device_map in switch_map.iteritems(): |
| 214 | uni_ports = device_map['ports'] |
| 215 | uplink_vlan = device_map['uplink_vlan'] |
| 216 | for port in uni_ports: |
| 217 | rest_url = 'http://{}:8181/onos/olt/oltapp/{}/{}'.format(controller, |
| 218 | device, |
| 219 | port) |
| 220 | resp = requests.delete(rest_url, auth = auth) |
| 221 | if resp.status_code not in [204, 202, 200]: |
| 222 | log_test.error('Error deleting subscriber for device %s on port %s' %(device, port)) |
| 223 | else: |
| 224 | log_test.info('Deleted subscriber for device %s on port %s' %(device, port)) |
| 225 | OnosCtrl.uninstall_app(self.olt_app_file) |
| 226 | |
| 227 | def config_olt(self, switch_map): |
| 228 | controller = get_controller() |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 229 | auth = ('karaf', 'karaf') |
| 230 | #configure subscriber for every port on all the voltha devices |
| 231 | for device, device_map in switch_map.iteritems(): |
| 232 | uni_ports = device_map['ports'] |
| 233 | uplink_vlan = device_map['uplink_vlan'] |
| 234 | for port in uni_ports: |
| 235 | vlan = port |
| 236 | rest_url = 'http://{}:8181/onos/olt/oltapp/{}/{}/{}'.format(controller, |
| 237 | device, |
| 238 | port, |
| 239 | vlan) |
| 240 | resp = requests.post(rest_url, auth = auth) |
| 241 | #assert_equal(resp.ok, True) |
| 242 | |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 243 | def voltha_uni_port_toggle(self, uni_port = None): |
| 244 | ## Admin state of port is down and up |
| 245 | if not uni_port: |
| 246 | uni_port = self.INTF_RX_DEFAULT |
| 247 | cmd = 'ifconfig {} down'.format(uni_port) |
| 248 | os.system(cmd) |
| 249 | log_test.info('Admin state of uni_port is down') |
| 250 | time.sleep(30) |
| 251 | cmd = 'ifconfig {} up'.format(uni_port) |
| 252 | os.system(cmd) |
| 253 | log_test.info('Admin state of uni_port is up now') |
| 254 | time.sleep(30) |
| 255 | return |
| 256 | |
| 257 | |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 258 | @classmethod |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 259 | def install_app_table(cls): |
| 260 | ##Uninstall the existing app if any |
| 261 | OnosCtrl.uninstall_app(cls.table_app) |
| 262 | time.sleep(2) |
| 263 | log_test.info('Installing the multi table app %s for subscriber test' %(cls.table_app_file)) |
| 264 | OnosCtrl.install_app(cls.table_app_file) |
| 265 | time.sleep(3) |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 266 | |
| 267 | @classmethod |
| 268 | def activate_apps(cls, apps): |
| 269 | for app in apps: |
| 270 | onos_ctrl = OnosCtrl(app) |
| 271 | status, _ = onos_ctrl.activate() |
| 272 | assert_equal(status, True) |
| 273 | time.sleep(2) |
| 274 | |
| 275 | def tls_flow_check(self, olt_uni_port, cert_info = None): |
| 276 | def tls_fail_cb(): |
| 277 | log_test.info('TLS verification failed') |
| 278 | if cert_info is None: |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 279 | tls = TLSAuthTest(fail_cb = tls_fail_cb, intf = olt_uni_port) |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 280 | log_test.info('Running subscriber %s tls auth test with valid TLS certificate' %olt_uni_port) |
| 281 | tls.runTest() |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 282 | if tls.failTest is True: |
| 283 | self.success = False |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 284 | assert_equal(tls.failTest, False) |
| 285 | if cert_info == "no_cert": |
| 286 | tls = TLSAuthTest(fail_cb = tls_fail_cb, intf = olt_uni_port, client_cert = '') |
| 287 | log_test.info('Running subscriber %s tls auth test with no TLS certificate' %olt_uni_port) |
| 288 | tls.runTest() |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 289 | if tls.failTest is False: |
| 290 | self.success = False |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 291 | assert_equal(tls.failTest, True) |
| 292 | if cert_info == "invalid_cert": |
| 293 | tls = TLSAuthTest(fail_cb = tls_fail_cb, intf = olt_uni_port, client_cert = self.CLIENT_CERT_INVALID) |
| 294 | log_test.info('Running subscriber %s tls auth test with invalid TLS certificate' %olt_uni_port) |
| 295 | tls.runTest() |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 296 | if tls.failTest is False: |
| 297 | self.success = False |
| 298 | assert_equal(tls.failTest, True) |
| 299 | if cert_info == "same_cert": |
| 300 | tls = TLSAuthTest(fail_cb = tls_fail_cb, intf = olt_uni_port) |
| 301 | log_test.info('Running subscriber %s tls auth test with invalid TLS certificate' %olt_uni_port) |
| 302 | tls.runTest() |
| 303 | if tls.failTest is False: |
| 304 | self.success = False |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 305 | assert_equal(tls.failTest, True) |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 306 | 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] | 307 | 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] | 308 | tls = TLSAuthTest(fail_cb = tls_fail_cb, intf = olt_uni_port, client_cert = self.CLIENT_CERT_INVALID) |
| 309 | log_test.info('Running subscriber %s tls auth test with %s' %(olt_uni_port,cert_info)) |
| 310 | tls.runTest() |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 311 | if tls.failTest is False: |
| 312 | self.success = False |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 313 | assert_equal(tls.failTest, True) |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 314 | self.test_status = True |
| 315 | return self.test_status |
A R Karthick | 35495c3 | 2017-05-11 14:58:32 -0700 | [diff] [blame] | 316 | |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame^] | 317 | def dhcp_flow_check(self, onu_iface =None, negative_test = None): |
| 318 | if negative_test is None: |
| 319 | cip, sip = self.dhcp_request(onu_iface, update_seed = True) |
| 320 | log_test.info('Subscriber %s got client ip %s from server %s' %(onu_iface, cip, sip)) |
| 321 | self.test_status = True |
| 322 | |
| 323 | if negative_test == "invalid_src_mac_broadcast": |
| 324 | config = {'startip':'10.10.10.20', 'endip':'10.10.10.69', |
| 325 | 'ip':'10.10.10.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 326 | 'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'} |
| 327 | self.onos_dhcp_table_load(config) |
| 328 | self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = onu_iface) |
| 329 | cip, sip, mac, _ = self.dhcp.only_discover(mac='ff:ff:ff:ff:ff:ff') |
| 330 | assert_equal(cip,None) |
| 331 | log_test.info('ONOS dhcp server rejected client discover with invalid source mac as expected') |
| 332 | self.test_status = True |
| 333 | if negative_test == "invalid_src_mac_multicast": |
| 334 | config = {'startip':'10.10.10.20', 'endip':'10.10.10.69', |
| 335 | 'ip':'10.10.10.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 336 | 'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'} |
| 337 | self.onos_dhcp_table_load(config) |
| 338 | self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = onu_iface) |
| 339 | cip, sip, mac, _ = self.dhcp.only_discover(mac='01:80:c2:91:02:e4') |
| 340 | assert_equal(cip,None) |
| 341 | log_test.info('ONOS dhcp server rejected client discover with invalid source mac as expected') |
| 342 | self.test_status = True |
| 343 | |
| 344 | if negative_test == "invalid_src_mac_junk": |
| 345 | config = {'startip':'10.10.10.20', 'endip':'10.10.10.69', |
| 346 | 'ip':'10.10.10.2', 'mac': "ca:fe:ca:fe:ca:fe", |
| 347 | 'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'} |
| 348 | self.onos_dhcp_table_load(config) |
| 349 | self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = onu_iface) |
| 350 | cip, sip, mac, _ = self.dhcp.only_discover(mac='00:00:00:00:00:00') |
| 351 | assert_equal(cip,None) |
| 352 | log_test.info('ONOS dhcp server rejected client discover with invalid source mac as expected') |
| 353 | self.test_status = True |
| 354 | |
| 355 | if negative_test == "request_release": |
| 356 | config = {'startip':'10.10.100.20', 'endip':'10.10.100.230', |
| 357 | 'ip':'10.10.100.2', 'mac': "ca:fe:ca:fe:8a:fe", |
| 358 | 'subnet': '255.255.255.0', 'broadcast':'10.10.100.255', 'router':'10.10.100.1'} |
| 359 | self.onos_dhcp_table_load(config) |
| 360 | self.dhcp = DHCPTest(seed_ip = '10.10.100.10', iface = onu_iface) |
| 361 | cip, sip = self.dhcp_sndrcv(self.dhcp) |
| 362 | log_test.info('Releasing ip %s to server %s' %(cip, sip)) |
| 363 | assert_equal(self.dhcp.release(cip), True) |
| 364 | log_test.info('Triggering DHCP discover again after release') |
| 365 | cip2, sip2 = self.dhcp_sndrcv(self.dhcp, update_seed = True) |
| 366 | log_test.info('Verifying released IP was given back on rediscover') |
| 367 | assert_equal(cip, cip2) |
| 368 | log_test.info('Test done. Releasing ip %s to server %s' %(cip2, sip2)) |
| 369 | assert_equal(self.dhcp.release(cip2), True) |
| 370 | self.test_status = True |
| 371 | |
| 372 | |
| 373 | return self.test_status |
| 374 | |
A.R Karthick | 8a507cf | 2017-06-02 18:44:49 -0700 | [diff] [blame] | 375 | def test_olt_enable_disable(self): |
A R Karthick | 35495c3 | 2017-05-11 14:58:32 -0700 | [diff] [blame] | 376 | 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] | 377 | device_id, status = self.voltha.enable_device(self.OLT_TYPE, self.OLT_MAC) |
| 378 | assert_not_equal(device_id, None) |
| 379 | try: |
| 380 | assert_equal(status, True) |
| 381 | time.sleep(10) |
| 382 | finally: |
| 383 | self.voltha.disable_device(device_id, delete = True) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 384 | |
A.R Karthick | 8a507cf | 2017-06-02 18:44:49 -0700 | [diff] [blame] | 385 | def test_ponsim_enable_disable(self): |
A.R Karthick | 8b9c5f1 | 2017-05-30 17:47:08 -0700 | [diff] [blame] | 386 | log_test.info('Enabling ponsim_olt') |
| 387 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
A.R Karthick | 8a507cf | 2017-06-02 18:44:49 -0700 | [diff] [blame] | 388 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 389 | assert_not_equal(device_id, None) |
| 390 | try: |
| 391 | assert_equal(status, True) |
| 392 | time.sleep(10) |
| 393 | finally: |
| 394 | self.voltha.disable_device(device_id, delete = True) |
A.R Karthick | 8b9c5f1 | 2017-05-30 17:47:08 -0700 | [diff] [blame] | 395 | |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 396 | def test_subscriber_with_voltha_for_eap_tls_authentication(self): |
| 397 | """ |
| 398 | Test Method: |
| 399 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 400 | 1. OLT and ONU is detected and validated. |
| 401 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 402 | 3. Issue auth request packets from CORD TESTER voltha test module acting as a subscriber.. |
| 403 | 4. Validate that eap tls valid auth packets are being exchanged between subscriber, onos and freeradius. |
| 404 | 5. Verify that subscriber is authenticated successfully. |
| 405 | """ |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 406 | log_test.info('Enabling ponsim_olt') |
| 407 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 408 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 409 | assert_not_equal(device_id, None) |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 410 | if status == False: |
| 411 | self.voltha.disable_device(device_id, delete = True) |
| 412 | assert_equal(status, True) |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 413 | time.sleep(10) |
| 414 | switch_map = None |
| 415 | olt_configured = False |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 416 | voltha = VolthaCtrl(self.VOLTHA_HOST, |
| 417 | rest_port = self.VOLTHA_REST_PORT, |
| 418 | uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP) |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 419 | try: |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 420 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 421 | if not switch_map: |
| 422 | log_test.info('No voltha devices found') |
| 423 | return |
| 424 | log_test.info('Installing OLT app') |
| 425 | OnosCtrl.install_app(self.olt_app_file) |
| 426 | time.sleep(5) |
| 427 | log_test.info('Adding subscribers through OLT app') |
| 428 | self.config_olt(switch_map) |
| 429 | olt_configured = True |
| 430 | time.sleep(5) |
| 431 | auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT) |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 432 | assert_equal(auth_status, True) |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 433 | finally: |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 434 | if switch_map is not None: |
| 435 | if olt_configured is True: |
| 436 | self.remove_olt(switch_map) |
| 437 | self.voltha.disable_device(device_id, delete = True) |
| 438 | time.sleep(10) |
| 439 | OnosCtrl.uninstall_app(self.olt_app_name) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 440 | |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 441 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 442 | def test_subscriber_with_voltha_for_eap_tls_authentication_failure(self): |
| 443 | """ |
| 444 | Test Method: |
| 445 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 446 | 1. OLT and ONU is detected and validated. |
| 447 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 448 | 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 449 | 4. Validate that eap tls without cert auth packet is being exchanged between subscriber, onos and freeradius. |
| 450 | 5. Verify that subscriber authentication is unsuccessful.. |
| 451 | """ |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 452 | df = defer.Deferred() |
| 453 | def tls_flow_check_with_no_cert_scenario(df): |
| 454 | log_test.info('Enabling ponsim_olt') |
| 455 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 456 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 457 | assert_not_equal(device_id, None) |
| 458 | voltha = VolthaCtrl(self.VOLTHA_HOST, |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 459 | rest_port = self.VOLTHA_REST_PORT, |
| 460 | uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP) |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 461 | time.sleep(10) |
| 462 | switch_map = None |
| 463 | olt_configured = False |
| 464 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 465 | log_test.info('Installing OLT app') |
| 466 | OnosCtrl.install_app(self.olt_app_file) |
| 467 | time.sleep(5) |
| 468 | log_test.info('Adding subscribers through OLT app') |
| 469 | self.config_olt(switch_map) |
| 470 | olt_configured = True |
| 471 | time.sleep(5) |
| 472 | auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT, cert_info = "no_cert") |
| 473 | try: |
| 474 | assert_equal(auth_status, True) |
| 475 | assert_equal(status, True) |
| 476 | time.sleep(10) |
| 477 | finally: |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 478 | self.remove_olt(switch_map) |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 479 | self.voltha.disable_device(device_id, delete = True) |
| 480 | df.callback(0) |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 481 | |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 482 | reactor.callLater(0, tls_flow_check_with_no_cert_scenario, df) |
| 483 | return df |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 484 | |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 485 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 486 | def test_subscriber_with_voltha_for_eap_tls_authentication_using_invalid_cert(self): |
| 487 | """ |
| 488 | Test Method: |
| 489 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 490 | 1. OLT and ONU is detected and validated. |
| 491 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 492 | 3. Issue tls auth packets and exchange invalid cert from CORD TESTER voltha test module acting as a subscriber.. |
| 493 | 4. Validate that eap tls with invalid cert auth packet is being exchanged between subscriber, onos and freeradius. |
| 494 | 5. Verify that subscriber authentication is unsuccessful.. |
| 495 | """ |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 496 | df = defer.Deferred() |
| 497 | def tls_flow_check_with_invalid_cert_scenario(df): |
| 498 | log_test.info('Enabling ponsim_olt') |
| 499 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 500 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 501 | assert_not_equal(device_id, None) |
| 502 | voltha = VolthaCtrl(self.VOLTHA_HOST, |
| 503 | rest_port = self.VOLTHA_REST_PORT, |
| 504 | uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP) |
| 505 | time.sleep(10) |
| 506 | switch_map = None |
| 507 | olt_configured = False |
| 508 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 509 | log_test.info('Installing OLT app') |
| 510 | OnosCtrl.install_app(self.olt_app_file) |
| 511 | time.sleep(5) |
| 512 | log_test.info('Adding subscribers through OLT app') |
| 513 | self.config_olt(switch_map) |
| 514 | olt_configured = True |
| 515 | time.sleep(5) |
| 516 | auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT, cert_info = "invalid_cert") |
| 517 | try: |
| 518 | assert_equal(auth_status, True) |
| 519 | assert_equal(status, True) |
| 520 | time.sleep(10) |
| 521 | finally: |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 522 | self.remove_olt(switch_map) |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 523 | self.voltha.disable_device(device_id, delete = True) |
| 524 | df.callback(0) |
| 525 | reactor.callLater(0, tls_flow_check_with_invalid_cert_scenario, df) |
| 526 | return df |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 527 | |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 528 | @deferred(TESTCASE_TIMEOUT) |
| 529 | def test_subscriber_with_voltha_for_multiple_invalid_authentication_attempts(self): |
| 530 | """ |
| 531 | Test Method: |
| 532 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 533 | 1. OLT and ONU is detected and validated. |
| 534 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 535 | 3. Issue tls auth packets and exchange invalid cert from CORD TESTER voltha test module acting as a subscriber for multiple times. |
| 536 | 4. Validate that eap tls with invalid cert auth packet is being exchanged between subscriber, onos and freeradius. |
| 537 | 5. Verify that subscriber authentication is unsuccessful.. |
| 538 | """ |
| 539 | df = defer.Deferred() |
| 540 | def tls_flow_check_with_no_cert_scenario(df): |
| 541 | log_test.info('Enabling ponsim_olt') |
| 542 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 543 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 544 | assert_not_equal(device_id, None) |
| 545 | voltha = VolthaCtrl(self.VOLTHA_HOST, |
| 546 | rest_port = self.VOLTHA_REST_PORT, |
| 547 | uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP) |
| 548 | time.sleep(10) |
| 549 | switch_map = None |
| 550 | olt_configured = False |
| 551 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 552 | log_test.info('Installing OLT app') |
| 553 | OnosCtrl.install_app(self.olt_app_file) |
| 554 | time.sleep(5) |
| 555 | log_test.info('Adding subscribers through OLT app') |
| 556 | self.config_olt(switch_map) |
| 557 | olt_configured = True |
| 558 | time.sleep(5) |
| 559 | auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT, cert_info = "invalid_cert") |
| 560 | auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT, cert_info = "invalid_cert") |
| 561 | auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT, cert_info = "no_cert") |
| 562 | auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT, cert_info = "invalid_cert") |
| 563 | try: |
| 564 | assert_equal(auth_status, True) |
| 565 | assert_equal(status, True) |
| 566 | time.sleep(10) |
| 567 | finally: |
| 568 | self.voltha.disable_device(device_id, delete = True) |
| 569 | df.callback(0) |
| 570 | reactor.callLater(0, tls_flow_check_with_no_cert_scenario, df) |
| 571 | return df |
| 572 | |
| 573 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 574 | def test_subscriber_with_voltha_for_eap_tls_authentication_with_aaa_app_deactivation(self): |
| 575 | """ |
| 576 | Test Method: |
| 577 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 578 | 1. OLT and ONU is detected and validated. |
| 579 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 580 | 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 581 | 4. Validate that eap tls without sending client hello, it's not being exchanged between client, onos and freeradius. |
| 582 | 5. Verify that subscriber authentication is unsuccessful.. |
| 583 | """ |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 584 | df = defer.Deferred() |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 585 | def tls_flow_check_deactivating_app(df): |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 586 | aaa_app = ["org.opencord.aaa"] |
| 587 | log_test.info('Enabling ponsim_olt') |
| 588 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 589 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 590 | assert_not_equal(device_id, None) |
| 591 | voltha = VolthaCtrl(self.VOLTHA_HOST, |
| 592 | rest_port = self.VOLTHA_REST_PORT, |
| 593 | uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP) |
| 594 | time.sleep(10) |
| 595 | switch_map = None |
| 596 | olt_configured = False |
| 597 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 598 | log_test.info('Installing OLT app') |
| 599 | OnosCtrl.install_app(self.olt_app_file) |
| 600 | time.sleep(5) |
| 601 | log_test.info('Adding subscribers through OLT app') |
| 602 | self.config_olt(switch_map) |
| 603 | olt_configured = True |
| 604 | time.sleep(5) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 605 | |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 606 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT,"app_deactivate",)) |
| 607 | thread2 = threading.Thread(target = self.deactivate_apps, args = (aaa_app,)) |
| 608 | thread1.start() |
| 609 | time.sleep(randint(1,2)) |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 610 | 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] | 611 | thread2.start() |
| 612 | time.sleep(10) |
| 613 | thread1.join() |
| 614 | thread2.join() |
| 615 | try: |
| 616 | # assert_equal(status, True) |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 617 | assert_equal(self.success, True) |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 618 | time.sleep(10) |
| 619 | finally: |
| 620 | self.voltha.disable_device(device_id, delete = True) |
| 621 | df.callback(0) |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 622 | reactor.callLater(0, tls_flow_check_deactivating_app, df) |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 623 | return df |
| 624 | |
| 625 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 626 | def test_subscriber_with_voltha_for_eap_tls_authentication_restarting_radius_server(self): |
| 627 | """ |
| 628 | Test Method: |
| 629 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 630 | 1. OLT and ONU is detected and validated. |
| 631 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 632 | 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 633 | 4. Validate that eap tls with restart of radius server and packets are being exchanged between subscriber, onos and freeradius. |
| 634 | 5. Verify that subscriber authentication is unsuccessful.. |
| 635 | """ |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 636 | df = defer.Deferred() |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 637 | def tls_flow_check_restarting_radius(df): |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 638 | aaa_app = ["org.opencord.aaa"] |
| 639 | log_test.info('Enabling ponsim_olt') |
| 640 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 641 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 642 | assert_not_equal(device_id, None) |
| 643 | voltha = VolthaCtrl(self.VOLTHA_HOST, |
| 644 | rest_port = self.VOLTHA_REST_PORT, |
| 645 | uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP) |
| 646 | time.sleep(10) |
| 647 | switch_map = None |
| 648 | olt_configured = False |
| 649 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 650 | log_test.info('Installing OLT app') |
| 651 | OnosCtrl.install_app(self.olt_app_file) |
| 652 | time.sleep(5) |
| 653 | log_test.info('Adding subscribers through OLT app') |
| 654 | self.config_olt(switch_map) |
| 655 | olt_configured = True |
| 656 | time.sleep(5) |
| 657 | |
| 658 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT,"restart_radius")) |
| 659 | thread2 = threading.Thread(target = cord_test_radius_restart) |
| 660 | thread1.start() |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 661 | time.sleep(randint(1,2)) |
| 662 | 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] | 663 | thread2.start() |
| 664 | time.sleep(10) |
| 665 | thread1.join() |
| 666 | thread2.join() |
| 667 | try: |
| 668 | # assert_equal(status, True) |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 669 | assert_equal(self.success, True) |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 670 | time.sleep(10) |
| 671 | finally: |
| 672 | self.voltha.disable_device(device_id, delete = True) |
| 673 | df.callback(0) |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 674 | reactor.callLater(0, tls_flow_check_restarting_radius, df) |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 675 | return df |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 676 | |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 677 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 678 | def test_subscriber_with_voltha_for_eap_tls_authentication_with_disabled_olt(self): |
| 679 | """ |
| 680 | Test Method: |
| 681 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 682 | 1. OLT and ONU is detected and validated. |
| 683 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 684 | 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 685 | 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius. |
| 686 | 6. Verify that subscriber authenticated successfully. |
| 687 | 7. Disable olt which is seen in voltha and issue tls auth packets from subscriber. |
| 688 | 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius. |
| 689 | 9. Verify that subscriber authentication is unsuccessful.. |
| 690 | """ |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 691 | df = defer.Deferred() |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 692 | def tls_flow_check_operating_olt_state(df): |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 693 | aaa_app = ["org.opencord.aaa"] |
| 694 | log_test.info('Enabling ponsim_olt') |
| 695 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 696 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 697 | assert_not_equal(device_id, None) |
| 698 | voltha = VolthaCtrl(self.VOLTHA_HOST, |
| 699 | rest_port = self.VOLTHA_REST_PORT, |
| 700 | uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP) |
| 701 | time.sleep(10) |
| 702 | switch_map = None |
| 703 | olt_configured = False |
| 704 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 705 | log_test.info('Installing OLT app') |
| 706 | OnosCtrl.install_app(self.olt_app_file) |
| 707 | time.sleep(5) |
| 708 | log_test.info('Adding subscribers through OLT app') |
| 709 | self.config_olt(switch_map) |
| 710 | olt_configured = True |
| 711 | time.sleep(5) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 712 | |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 713 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT, "disable_olt_device",)) |
| 714 | thread2 = threading.Thread(target = self.voltha.disable_device, args = (device_id,)) |
| 715 | thread1.start() |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 716 | time.sleep(randint(1,2)) |
| 717 | 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] | 718 | thread2.start() |
| 719 | time.sleep(10) |
| 720 | thread1.join() |
| 721 | thread2.join() |
| 722 | try: |
| 723 | # assert_equal(status, True) |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 724 | assert_equal(self.success, True) |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 725 | time.sleep(10) |
| 726 | finally: |
| 727 | self.voltha.disable_device(device_id, delete = True) |
| 728 | df.callback(0) |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 729 | reactor.callLater(0, tls_flow_check_operating_olt_state, df) |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 730 | return df |
| 731 | |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 732 | @deferred(TESTCASE_TIMEOUT) |
| 733 | 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] | 734 | """ |
| 735 | Test Method: |
| 736 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 737 | 1. OLT and ONU is detected and validated. |
| 738 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 739 | 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 740 | 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius. |
| 741 | 6. Verify that subscriber authenticated successfully. |
| 742 | 7. Disable uni port which is seen in voltha and issue tls auth packets from subscriber. |
| 743 | 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius. |
| 744 | 9. Verify that subscriber authentication is unsuccessful.. |
| 745 | """ |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 746 | df = defer.Deferred() |
| 747 | def tls_flow_check_operating_olt_state(df): |
| 748 | aaa_app = ["org.opencord.aaa"] |
| 749 | log_test.info('Enabling ponsim_olt') |
| 750 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 751 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 752 | assert_not_equal(device_id, None) |
| 753 | voltha = VolthaCtrl(self.VOLTHA_HOST, |
| 754 | rest_port = self.VOLTHA_REST_PORT, |
| 755 | uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP) |
| 756 | time.sleep(10) |
| 757 | switch_map = None |
| 758 | olt_configured = False |
| 759 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 760 | log_test.info('Installing OLT app') |
| 761 | OnosCtrl.install_app(self.olt_app_file) |
| 762 | time.sleep(5) |
| 763 | log_test.info('Adding subscribers through OLT app') |
| 764 | self.config_olt(switch_map) |
| 765 | olt_configured = True |
| 766 | time.sleep(5) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 767 | |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 768 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT, "uni_port_admin_down",)) |
| 769 | thread2 = threading.Thread(target = self.voltha_uni_port_toggle) |
| 770 | thread1.start() |
| 771 | time.sleep(randint(1,2)) |
| 772 | log_test.info('Admin state of uni port is down and up after delay of 30 sec during tls auth flow check on voltha') |
| 773 | thread2.start() |
| 774 | time.sleep(10) |
| 775 | thread1.join() |
| 776 | thread2.join() |
| 777 | try: |
| 778 | # assert_equal(status, True) |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 779 | assert_equal(self.success, True) |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 780 | time.sleep(10) |
| 781 | finally: |
| 782 | self.voltha.disable_device(device_id, delete = True) |
| 783 | df.callback(0) |
| 784 | reactor.callLater(0, tls_flow_check_operating_olt_state, df) |
| 785 | return df |
| 786 | |
| 787 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 788 | def test_subscriber_with_voltha_for_eap_tls_authentication_restarting_olt(self): |
| 789 | """ |
| 790 | Test Method: |
| 791 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 792 | 1. OLT and ONU is detected and validated. |
| 793 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 794 | 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 795 | 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius. |
| 796 | 6. Verify that subscriber authenticated successfully. |
| 797 | 7. Restart olt which is seen in voltha and issue tls auth packets from subscriber. |
| 798 | 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius. |
| 799 | 9. Verify that subscriber authentication is unsuccessful.. |
| 800 | """ |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 801 | df = defer.Deferred() |
| 802 | def tls_flow_check_operating_olt_state(df): |
| 803 | aaa_app = ["org.opencord.aaa"] |
| 804 | log_test.info('Enabling ponsim_olt') |
| 805 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 806 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 807 | assert_not_equal(device_id, None) |
| 808 | voltha = VolthaCtrl(self.VOLTHA_HOST, |
| 809 | rest_port = self.VOLTHA_REST_PORT, |
| 810 | uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP) |
| 811 | time.sleep(10) |
| 812 | switch_map = None |
| 813 | olt_configured = False |
| 814 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 815 | log_test.info('Installing OLT app') |
| 816 | OnosCtrl.install_app(self.olt_app_file) |
| 817 | time.sleep(5) |
| 818 | log_test.info('Adding subscribers through OLT app') |
| 819 | self.config_olt(switch_map) |
| 820 | olt_configured = True |
| 821 | time.sleep(5) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 822 | |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 823 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT, "restart_olt_device",)) |
| 824 | thread2 = threading.Thread(target = self.voltha.restart_device, args = (device_id,)) |
| 825 | thread1.start() |
| 826 | time.sleep(randint(1,2)) |
| 827 | log_test.info('Restart the ponsim olt device during tls auth flow check on voltha') |
| 828 | thread2.start() |
| 829 | time.sleep(10) |
| 830 | thread1.join() |
| 831 | thread2.join() |
| 832 | try: |
| 833 | # assert_equal(status, True) |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 834 | assert_equal(self.success, True) |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 835 | time.sleep(10) |
| 836 | finally: |
| 837 | self.voltha.disable_device(device_id, delete = True) |
| 838 | df.callback(0) |
| 839 | reactor.callLater(0, tls_flow_check_operating_olt_state, df) |
| 840 | return df |
| 841 | |
| 842 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 843 | def test_subscriber_with_voltha_for_eap_tls_authentication_restarting_onu(self): |
| 844 | """ |
| 845 | Test Method: |
| 846 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 847 | 1. OLT and ONU is detected and validated. |
| 848 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 849 | 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 850 | 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius. |
| 851 | 6. Verify that subscriber authenticated successfully. |
| 852 | 7. Restart onu which is seen in voltha and issue tls auth packets from subscriber. |
| 853 | 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius. |
| 854 | 9. Verify that subscriber authentication is unsuccessful.. |
| 855 | """ |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 856 | df = defer.Deferred() |
| 857 | def tls_flow_check_operating_olt_state(df): |
| 858 | aaa_app = ["org.opencord.aaa"] |
| 859 | log_test.info('Enabling ponsim_olt') |
| 860 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 861 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 862 | devices_list = self.voltha.get_devices() |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 863 | log_test.info('All available devices on voltha = %s'%devices_list['items']) |
| 864 | |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 865 | onu_device_id = devices_list['items'][1]['id'] |
| 866 | assert_not_equal(device_id, None) |
| 867 | voltha = VolthaCtrl(self.VOLTHA_HOST, |
| 868 | rest_port = self.VOLTHA_REST_PORT, |
| 869 | uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP) |
| 870 | time.sleep(10) |
| 871 | switch_map = None |
| 872 | olt_configured = False |
| 873 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 874 | log_test.info('Installing OLT app') |
| 875 | OnosCtrl.install_app(self.olt_app_file) |
| 876 | time.sleep(5) |
| 877 | log_test.info('Adding subscribers through OLT app') |
| 878 | self.config_olt(switch_map) |
| 879 | olt_configured = True |
| 880 | time.sleep(5) |
| 881 | devices_list = self.voltha.get_devices() |
| 882 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT, "restart_onu_device",)) |
| 883 | thread2 = threading.Thread(target = self.voltha.restart_device, args = (onu_device_id,)) |
| 884 | thread1.start() |
| 885 | time.sleep(randint(1,2)) |
| 886 | log_test.info('Restart the ponsim oon device during tls auth flow check on voltha') |
| 887 | thread2.start() |
| 888 | time.sleep(10) |
| 889 | thread1.join() |
| 890 | thread2.join() |
| 891 | try: |
| 892 | # assert_equal(status, True) |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 893 | assert_equal(self.success, True) |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 894 | time.sleep(10) |
| 895 | finally: |
| 896 | self.voltha.disable_device(device_id, delete = True) |
| 897 | df.callback(0) |
| 898 | reactor.callLater(0, tls_flow_check_operating_olt_state, df) |
| 899 | return df |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 900 | |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 901 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 902 | def test_two_subscribers_with_voltha_for_eap_tls_authentication(self): |
| 903 | """ |
| 904 | Test Method: |
| 905 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 906 | 1. OLT is detected and ONU ports(nni and 2 uni's) are being seen. |
| 907 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 908 | 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 909 | 4. Validate that eap tls valid auth packets are being exchanged between two subscriber, onos and freeradius. |
| 910 | 5. Verify that two subscribers are authenticated successfully. |
| 911 | """ |
| 912 | |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 913 | df = defer.Deferred() |
| 914 | def tls_flow_check_on_two_subscriber_same_olt_device(df): |
| 915 | aaa_app = ["org.opencord.aaa"] |
| 916 | log_test.info('Enabling ponsim_olt') |
| 917 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 918 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 919 | devices_list = self.voltha.get_devices() |
| 920 | log_test.info('All available devices on voltha = %s'%devices_list['items']) |
| 921 | |
| 922 | onu_device_id = devices_list['items'][1]['id'] |
| 923 | assert_not_equal(device_id, None) |
| 924 | voltha = VolthaCtrl(self.VOLTHA_HOST, |
| 925 | rest_port = self.VOLTHA_REST_PORT, |
| 926 | uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP) |
| 927 | time.sleep(10) |
| 928 | switch_map = None |
| 929 | olt_configured = False |
| 930 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 931 | log_test.info('Installing OLT app') |
| 932 | OnosCtrl.install_app(self.olt_app_file) |
| 933 | time.sleep(5) |
| 934 | log_test.info('Adding subscribers through OLT app') |
| 935 | self.config_olt(switch_map) |
| 936 | olt_configured = True |
| 937 | time.sleep(5) |
| 938 | devices_list = self.voltha.get_devices() |
| 939 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT,)) |
| 940 | thread2 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_2_RX_DEFAULT,)) |
| 941 | thread1.start() |
| 942 | time.sleep(randint(1,2)) |
| 943 | log_test.info('Initiating tls auth packets from one more subscriber on same olt device which is deteced on voltha') |
| 944 | thread2.start() |
| 945 | time.sleep(10) |
| 946 | thread1.join() |
| 947 | thread2.join() |
| 948 | try: |
| 949 | # assert_equal(status, True) |
| 950 | assert_equal(self.success, True) |
| 951 | time.sleep(10) |
| 952 | finally: |
| 953 | self.voltha.disable_device(device_id, delete = True) |
| 954 | df.callback(0) |
| 955 | reactor.callLater(0, tls_flow_check_on_two_subscriber_same_olt_device, df) |
| 956 | return df |
| 957 | |
| 958 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 959 | def test_two_subscribers_with_voltha_for_eap_tls_authentication_using_same_certificates(self): |
| 960 | """ |
| 961 | Test Method: |
| 962 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 963 | 1. OLT is detected and ONU ports(nni and 2 uni's) are being seen. |
| 964 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 965 | 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 966 | 4. Validate that two valid certificates are being exchanged between two subscriber, onos and freeradius. |
| 967 | 5. Verify that two subscribers are not authenticated. |
| 968 | """ |
| 969 | |
Thangavelu K S | 9648eed | 2017-06-13 20:15:25 +0000 | [diff] [blame] | 970 | df = defer.Deferred() |
| 971 | def tls_flow_check_on_two_subscriber_same_olt_device(df): |
| 972 | aaa_app = ["org.opencord.aaa"] |
| 973 | log_test.info('Enabling ponsim_olt') |
| 974 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 975 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 976 | devices_list = self.voltha.get_devices() |
| 977 | log_test.info('All available devices on voltha = %s'%devices_list['items']) |
| 978 | |
| 979 | onu_device_id = devices_list['items'][1]['id'] |
| 980 | assert_not_equal(device_id, None) |
| 981 | voltha = VolthaCtrl(self.VOLTHA_HOST, |
| 982 | rest_port = self.VOLTHA_REST_PORT, |
| 983 | uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP) |
| 984 | time.sleep(10) |
| 985 | switch_map = None |
| 986 | olt_configured = False |
| 987 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 988 | log_test.info('Installing OLT app') |
| 989 | OnosCtrl.install_app(self.olt_app_file) |
| 990 | time.sleep(5) |
| 991 | log_test.info('Adding subscribers through OLT app') |
| 992 | self.config_olt(switch_map) |
| 993 | olt_configured = True |
| 994 | time.sleep(5) |
| 995 | devices_list = self.voltha.get_devices() |
| 996 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT,)) |
| 997 | thread2 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_2_RX_DEFAULT, "same_cert",)) |
| 998 | thread1.start() |
| 999 | time.sleep(randint(1,2)) |
| 1000 | log_test.info('Initiating tls auth packets from one more subscriber on same olt device which is deteced on voltha') |
| 1001 | thread2.start() |
| 1002 | time.sleep(10) |
| 1003 | thread1.join() |
| 1004 | thread2.join() |
| 1005 | try: |
| 1006 | # assert_equal(status, True) |
| 1007 | assert_equal(self.success, True) |
| 1008 | time.sleep(10) |
| 1009 | finally: |
| 1010 | self.voltha.disable_device(device_id, delete = True) |
| 1011 | df.callback(0) |
| 1012 | reactor.callLater(0, tls_flow_check_on_two_subscriber_same_olt_device, df) |
| 1013 | return df |
| 1014 | |
Chetan Gaonker | fe1048f | 2017-06-13 20:16:25 +0000 | [diff] [blame] | 1015 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 1016 | def test_two_subscribers_with_voltha_for_eap_tls_authentication_initiating_invalid_tls_packets_for_one_subscriber(self): |
| 1017 | """ |
| 1018 | Test Method: |
| 1019 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1020 | 1. OLT is detected and ONU ports(nni and 2 uni's) are being seen. |
| 1021 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 1022 | 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1023 | 4. Validate that eap tls valid auth packets are being exchanged between valid subscriber, onos and freeradius. |
| 1024 | 5. Validate that eap tls valid auth packets are being exchanged between invalid client, onos and freeradius. |
| 1025 | 6. Verify that valid subscriber authenticated successfully. |
| 1026 | 7. Verify that invalid subscriber are not authenticated successfully. |
| 1027 | """ |
| 1028 | |
Chetan Gaonker | fe1048f | 2017-06-13 20:16:25 +0000 | [diff] [blame] | 1029 | df = defer.Deferred() |
| 1030 | def tls_flow_check_on_two_subscriber_same_olt_device(df): |
| 1031 | aaa_app = ["org.opencord.aaa"] |
| 1032 | log_test.info('Enabling ponsim_olt') |
| 1033 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 1034 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 1035 | devices_list = self.voltha.get_devices() |
| 1036 | log_test.info('All available devices on voltha = %s'%devices_list['items']) |
| 1037 | |
| 1038 | onu_device_id = devices_list['items'][1]['id'] |
| 1039 | assert_not_equal(device_id, None) |
| 1040 | voltha = VolthaCtrl(self.VOLTHA_HOST, |
| 1041 | rest_port = self.VOLTHA_REST_PORT, |
| 1042 | uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP) |
| 1043 | time.sleep(10) |
| 1044 | switch_map = None |
| 1045 | olt_configured = False |
| 1046 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 1047 | log_test.info('Installing OLT app') |
| 1048 | OnosCtrl.install_app(self.olt_app_file) |
| 1049 | time.sleep(5) |
| 1050 | log_test.info('Adding subscribers through OLT app') |
| 1051 | self.config_olt(switch_map) |
| 1052 | olt_configured = True |
| 1053 | time.sleep(5) |
| 1054 | devices_list = self.voltha.get_devices() |
| 1055 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT,)) |
| 1056 | thread2 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_2_RX_DEFAULT, "no_cert",)) |
| 1057 | thread1.start() |
| 1058 | time.sleep(randint(1,2)) |
| 1059 | log_test.info('Initiating tls auth packets from one more subscriber on same olt device which is deteced on voltha') |
| 1060 | thread2.start() |
| 1061 | time.sleep(10) |
| 1062 | thread1.join() |
| 1063 | thread2.join() |
| 1064 | try: |
| 1065 | # assert_equal(status, True) |
| 1066 | assert_equal(self.success, True) |
| 1067 | time.sleep(10) |
| 1068 | finally: |
| 1069 | self.voltha.disable_device(device_id, delete = True) |
| 1070 | df.callback(0) |
| 1071 | reactor.callLater(0, tls_flow_check_on_two_subscriber_same_olt_device, df) |
| 1072 | return df |
| 1073 | |
| 1074 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 1075 | def test_two_subscribers_with_voltha_for_eap_tls_authentication_initiating_invalid_cert_for_one_subscriber(self): |
| 1076 | """ |
| 1077 | Test Method: |
| 1078 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1079 | 1. OLT is detected and ONU ports(nni and 2 uni's) are being seen. |
| 1080 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 1081 | 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1082 | 4. Validate that eap tls valid auth packets are being exchanged between valid subscriber, onos and freeradius. |
| 1083 | 5. Validate that eap tls invalid cert auth packets are being exchanged between invalid subscriber, onos and freeradius. |
| 1084 | 6. Verify that valid subscriber authenticated successfully. |
| 1085 | 7. Verify that invalid subscriber are not authenticated successfully. |
| 1086 | """ |
| 1087 | |
Chetan Gaonker | fe1048f | 2017-06-13 20:16:25 +0000 | [diff] [blame] | 1088 | df = defer.Deferred() |
| 1089 | def tls_flow_check_on_two_subscriber_same_olt_device(df): |
| 1090 | aaa_app = ["org.opencord.aaa"] |
| 1091 | log_test.info('Enabling ponsim_olt') |
| 1092 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 1093 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 1094 | devices_list = self.voltha.get_devices() |
| 1095 | log_test.info('All available devices on voltha = %s'%devices_list['items']) |
| 1096 | |
| 1097 | onu_device_id = devices_list['items'][1]['id'] |
| 1098 | assert_not_equal(device_id, None) |
| 1099 | voltha = VolthaCtrl(self.VOLTHA_HOST, |
| 1100 | rest_port = self.VOLTHA_REST_PORT, |
| 1101 | uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP) |
| 1102 | time.sleep(10) |
| 1103 | switch_map = None |
| 1104 | olt_configured = False |
| 1105 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 1106 | log_test.info('Installing OLT app') |
| 1107 | OnosCtrl.install_app(self.olt_app_file) |
| 1108 | time.sleep(5) |
| 1109 | log_test.info('Adding subscribers through OLT app') |
| 1110 | self.config_olt(switch_map) |
| 1111 | olt_configured = True |
| 1112 | time.sleep(5) |
| 1113 | devices_list = self.voltha.get_devices() |
| 1114 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT,)) |
| 1115 | thread2 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_2_RX_DEFAULT, "invalid_cert",)) |
| 1116 | thread1.start() |
| 1117 | time.sleep(randint(1,2)) |
| 1118 | log_test.info('Initiating tls auth packets from one more subscriber on same olt device which is deteced on voltha') |
| 1119 | thread2.start() |
| 1120 | time.sleep(10) |
| 1121 | thread1.join() |
| 1122 | thread2.join() |
| 1123 | try: |
| 1124 | # assert_equal(status, True) |
| 1125 | assert_equal(self.success, True) |
| 1126 | time.sleep(10) |
| 1127 | finally: |
| 1128 | self.voltha.disable_device(device_id, delete = True) |
| 1129 | df.callback(0) |
| 1130 | reactor.callLater(0, tls_flow_check_on_two_subscriber_same_olt_device, df) |
| 1131 | return df |
| 1132 | |
| 1133 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 1134 | def test_two_subscribers_with_voltha_for_eap_tls_authentication_with_one_uni_port_disabled(self): |
| 1135 | """ |
| 1136 | Test Method: |
| 1137 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1138 | 1. OLT and ONU is detected and validated. |
| 1139 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 1140 | 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1141 | 5. Validate that eap tls packets are being exchanged between two subscriber, onos and freeradius. |
| 1142 | 6. Verify that subscriber authenticated successfully. |
| 1143 | 7. Disable one of the uni port which is seen in voltha and issue tls auth packets from subscriber. |
| 1144 | 8. Validate that eap tls packets are not being exchanged between one subscriber, onos and freeradius. |
| 1145 | 9. Verify that subscriber authentication is unsuccessful.. |
| 1146 | 10. Verify that other subscriber authenticated successfully. |
| 1147 | """ |
| 1148 | |
Chetan Gaonker | fe1048f | 2017-06-13 20:16:25 +0000 | [diff] [blame] | 1149 | df = defer.Deferred() |
| 1150 | def tls_flow_check_on_two_subscriber_same_olt_device(df): |
| 1151 | aaa_app = ["org.opencord.aaa"] |
| 1152 | log_test.info('Enabling ponsim_olt') |
| 1153 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 1154 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 1155 | devices_list = self.voltha.get_devices() |
| 1156 | log_test.info('All available devices on voltha = %s'%devices_list['items']) |
| 1157 | |
| 1158 | onu_device_id = devices_list['items'][1]['id'] |
| 1159 | assert_not_equal(device_id, None) |
| 1160 | voltha = VolthaCtrl(self.VOLTHA_HOST, |
| 1161 | rest_port = self.VOLTHA_REST_PORT, |
| 1162 | uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP) |
| 1163 | time.sleep(10) |
| 1164 | switch_map = None |
| 1165 | olt_configured = False |
| 1166 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 1167 | log_test.info('Installing OLT app') |
| 1168 | OnosCtrl.install_app(self.olt_app_file) |
| 1169 | time.sleep(5) |
| 1170 | log_test.info('Adding subscribers through OLT app') |
| 1171 | self.config_olt(switch_map) |
| 1172 | olt_configured = True |
| 1173 | time.sleep(5) |
| 1174 | devices_list = self.voltha.get_devices() |
| 1175 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT,)) |
| 1176 | thread2 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_2_RX_DEFAULT, "uni_port_admin_down",)) |
| 1177 | thread1.start() |
| 1178 | time.sleep(randint(1,2)) |
| 1179 | log_test.info('Initiating tls auth packets from one more subscriber on same olt device which is deteced on voltha') |
| 1180 | thread2.start() |
| 1181 | time.sleep(10) |
| 1182 | thread1.join() |
| 1183 | thread2.join() |
| 1184 | try: |
| 1185 | # assert_equal(status, True) |
| 1186 | assert_equal(self.success, True) |
| 1187 | time.sleep(10) |
| 1188 | finally: |
| 1189 | self.voltha.disable_device(device_id, delete = True) |
| 1190 | df.callback(0) |
| 1191 | reactor.callLater(0, tls_flow_check_on_two_subscriber_same_olt_device, df) |
| 1192 | return df |
| 1193 | |
| 1194 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 1195 | def test_subscriber_with_voltha_for_dhcp_request(self): |
| 1196 | """ |
| 1197 | Test Method: |
| 1198 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1199 | 1. OLT and ONU is detected and validated. |
| 1200 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1201 | 3. Send dhcp request from residential subscrber to dhcp server which is running as onos app. |
| 1202 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 1203 | """ |
| 1204 | |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame^] | 1205 | df = defer.Deferred() |
| 1206 | def dhcp_flow_check_scenario(df): |
| 1207 | log_test.info('Enabling ponsim_olt') |
| 1208 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 1209 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 1210 | assert_not_equal(device_id, None) |
| 1211 | voltha = VolthaCtrl(self.VOLTHA_HOST, |
| 1212 | rest_port = self.VOLTHA_REST_PORT, |
| 1213 | uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP) |
| 1214 | time.sleep(10) |
| 1215 | switch_map = None |
| 1216 | olt_configured = False |
| 1217 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 1218 | log_test.info('Installing OLT app') |
| 1219 | OnosCtrl.install_app(self.olt_app_file) |
| 1220 | time.sleep(5) |
| 1221 | log_test.info('Adding subscribers through OLT app') |
| 1222 | self.config_olt(switch_map) |
| 1223 | olt_configured = True |
| 1224 | time.sleep(5) |
| 1225 | dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT) |
| 1226 | try: |
| 1227 | assert_equal(dhcp_status, True) |
| 1228 | #assert_equal(status, True) |
| 1229 | time.sleep(10) |
| 1230 | finally: |
| 1231 | self.remove_olt(switch_map) |
| 1232 | self.voltha.disable_device(device_id, delete = True) |
| 1233 | df.callback(0) |
| 1234 | |
| 1235 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 1236 | return df |
| 1237 | |
| 1238 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 1239 | def test_subscriber_with_voltha_for_dhcp_request_with_invalid_broadcast_source_mac(self): |
| 1240 | """ |
| 1241 | Test Method: |
| 1242 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1243 | 1. OLT and ONU is detected and validated. |
| 1244 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1245 | 3. Send dhcp request with invalid source mac broadcast from residential subscrber to dhcp server which is running as onos app. |
| 1246 | 4. Verify that subscriber should not get ip from dhcp server. |
| 1247 | """ |
| 1248 | |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame^] | 1249 | df = defer.Deferred() |
| 1250 | def dhcp_flow_check_scenario(df): |
| 1251 | log_test.info('Enabling ponsim_olt') |
| 1252 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 1253 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 1254 | assert_not_equal(device_id, None) |
| 1255 | voltha = VolthaCtrl(self.VOLTHA_HOST, |
| 1256 | rest_port = self.VOLTHA_REST_PORT, |
| 1257 | uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP) |
| 1258 | time.sleep(10) |
| 1259 | switch_map = None |
| 1260 | olt_configured = False |
| 1261 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 1262 | log_test.info('Installing OLT app') |
| 1263 | OnosCtrl.install_app(self.olt_app_file) |
| 1264 | time.sleep(5) |
| 1265 | log_test.info('Adding subscribers through OLT app') |
| 1266 | self.config_olt(switch_map) |
| 1267 | olt_configured = True |
| 1268 | time.sleep(5) |
| 1269 | dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "invalid_src_mac_broadcast") |
| 1270 | try: |
| 1271 | assert_equal(dhcp_status, True) |
| 1272 | #assert_equal(status, True) |
| 1273 | time.sleep(10) |
| 1274 | finally: |
| 1275 | self.voltha.disable_device(device_id, delete = True) |
| 1276 | self.remove_olt(switch_map) |
| 1277 | df.callback(0) |
| 1278 | |
| 1279 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 1280 | return df |
| 1281 | |
| 1282 | |
| 1283 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 1284 | def test_subscriber_with_voltha_for_dhcp_request_with_invalid_multicast_source_mac(self): |
| 1285 | """ |
| 1286 | Test Method: |
| 1287 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1288 | 1. OLT and ONU is detected and validated. |
| 1289 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1290 | 3. Send dhcp request with invalid source mac multicast from residential subscrber to dhcp server which is running as onos app. |
| 1291 | 4. Verify that subscriber should not get ip from dhcp server. |
| 1292 | """ |
| 1293 | |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame^] | 1294 | df = defer.Deferred() |
| 1295 | def dhcp_flow_check_scenario(df): |
| 1296 | log_test.info('Enabling ponsim_olt') |
| 1297 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 1298 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 1299 | assert_not_equal(device_id, None) |
| 1300 | voltha = VolthaCtrl(self.VOLTHA_HOST, |
| 1301 | rest_port = self.VOLTHA_REST_PORT, |
| 1302 | uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP) |
| 1303 | time.sleep(10) |
| 1304 | switch_map = None |
| 1305 | olt_configured = False |
| 1306 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 1307 | log_test.info('Installing OLT app') |
| 1308 | OnosCtrl.install_app(self.olt_app_file) |
| 1309 | time.sleep(5) |
| 1310 | log_test.info('Adding subscribers through OLT app') |
| 1311 | self.config_olt(switch_map) |
| 1312 | olt_configured = True |
| 1313 | time.sleep(5) |
| 1314 | dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "invalid_src_mac_multicast") |
| 1315 | try: |
| 1316 | assert_equal(dhcp_status, True) |
| 1317 | #assert_equal(status, True) |
| 1318 | time.sleep(10) |
| 1319 | finally: |
| 1320 | self.voltha.disable_device(device_id, delete = True) |
| 1321 | self.remove_olt(switch_map) |
| 1322 | df.callback(0) |
| 1323 | |
| 1324 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 1325 | return df |
| 1326 | |
| 1327 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 1328 | def test_subscriber_with_voltha_for_dhcp_request_with_invalid_source_mac(self): |
| 1329 | """ |
| 1330 | Test Method: |
| 1331 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1332 | 1. OLT and ONU is detected and validated. |
| 1333 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1334 | 3. Send dhcp request with invalid source mac zero from residential subscrber to dhcp server which is running as onos app. |
| 1335 | 4. Verify that subscriber should not get ip from dhcp server. |
| 1336 | """ |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame^] | 1337 | df = defer.Deferred() |
| 1338 | def dhcp_flow_check_scenario(df): |
| 1339 | log_test.info('Enabling ponsim_olt') |
| 1340 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 1341 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 1342 | assert_not_equal(device_id, None) |
| 1343 | voltha = VolthaCtrl(self.VOLTHA_HOST, |
| 1344 | rest_port = self.VOLTHA_REST_PORT, |
| 1345 | uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP) |
| 1346 | time.sleep(10) |
| 1347 | switch_map = None |
| 1348 | olt_configured = False |
| 1349 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 1350 | log_test.info('Installing OLT app') |
| 1351 | OnosCtrl.install_app(self.olt_app_file) |
| 1352 | time.sleep(5) |
| 1353 | log_test.info('Adding subscribers through OLT app') |
| 1354 | self.config_olt(switch_map) |
| 1355 | olt_configured = True |
| 1356 | time.sleep(5) |
| 1357 | dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "invalid_src_mac_junk") |
| 1358 | try: |
| 1359 | assert_equal(dhcp_status, True) |
| 1360 | #assert_equal(status, True) |
| 1361 | time.sleep(10) |
| 1362 | finally: |
| 1363 | self.voltha.disable_device(device_id, delete = True) |
| 1364 | self.remove_olt(switch_map) |
| 1365 | df.callback(0) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 1366 | |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame^] | 1367 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 1368 | return df |
| 1369 | |
| 1370 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 1371 | def test_subscriber_with_voltha_for_dhcp_request_and_release(self): |
| 1372 | """ |
| 1373 | Test Method: |
| 1374 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1375 | 1. OLT and ONU is detected and validated. |
| 1376 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1377 | 3. Send dhcp request from residential subscrber to dhcp server which is running as onos app. |
| 1378 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 1379 | 5. Send dhcp release from residential subscrber to dhcp server which is running as onos app. |
| 1380 | 6 Verify that subscriber should not get ip from dhcp server, ping to gateway. |
| 1381 | """ |
Thangavelu K S | a1c71b4 | 2017-06-14 18:13:21 +0000 | [diff] [blame^] | 1382 | df = defer.Deferred() |
| 1383 | def dhcp_flow_check_scenario(df): |
| 1384 | log_test.info('Enabling ponsim_olt') |
| 1385 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 1386 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 1387 | assert_not_equal(device_id, None) |
| 1388 | voltha = VolthaCtrl(self.VOLTHA_HOST, |
| 1389 | rest_port = self.VOLTHA_REST_PORT, |
| 1390 | uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP) |
| 1391 | time.sleep(10) |
| 1392 | switch_map = None |
| 1393 | olt_configured = False |
| 1394 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 1395 | log_test.info('Installing OLT app') |
| 1396 | OnosCtrl.install_app(self.olt_app_file) |
| 1397 | time.sleep(5) |
| 1398 | log_test.info('Adding subscribers through OLT app') |
| 1399 | self.config_olt(switch_map) |
| 1400 | olt_configured = True |
| 1401 | time.sleep(5) |
| 1402 | dhcp_status = self.dhcp_flow_check(self.INTF_RX_DEFAULT, "request_release") |
| 1403 | try: |
| 1404 | assert_equal(dhcp_status, True) |
| 1405 | #assert_equal(status, True) |
| 1406 | time.sleep(10) |
| 1407 | finally: |
| 1408 | self.voltha.disable_device(device_id, delete = True) |
| 1409 | self.remove_olt(switch_map) |
| 1410 | df.callback(0) |
| 1411 | |
| 1412 | reactor.callLater(0, dhcp_flow_check_scenario, df) |
| 1413 | return df |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 1414 | |
A.R Karthick | 57fa937 | 2017-05-24 12:47:03 -0700 | [diff] [blame] | 1415 | def test_subscriber_with_voltha_for_dhcp_starvation_positive_scenario(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 1416 | """ |
| 1417 | Test Method: |
| 1418 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1419 | 1. OLT and ONU is detected and validated. |
| 1420 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1421 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 1422 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 1423 | 5. Repeat step 3 and 4 for 10 times. |
| 1424 | 6 Verify that subscriber should get ip from dhcp server. |
| 1425 | """ |
| 1426 | |
| 1427 | def test_subscriber_with_voltha_for_dhcp_starvation_negative_scenario(self): |
| 1428 | """ |
| 1429 | Test Method: |
| 1430 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1431 | 1. OLT and ONU is detected and validated. |
| 1432 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1433 | 3. Send dhcp request from residential subscriber without of pool ip to dhcp server which is running as onos app. |
| 1434 | 4. Verify that subscriber should not get ip from dhcp server. |
| 1435 | 5. Repeat steps 3 and 4 for 10 times. |
| 1436 | 6 Verify that subscriber should not get ip from dhcp server. |
| 1437 | """ |
| 1438 | def test_subscriber_with_voltha_for_dhcp_sending_multiple_discover(self): |
| 1439 | """ |
| 1440 | Test Method: |
| 1441 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1442 | 1. OLT and ONU is detected and validated. |
| 1443 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1444 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 1445 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 1446 | 5. Repeat step 3 for 50 times. |
| 1447 | 6 Verify that subscriber should get same ip which was received from 1st discover from dhcp server. |
| 1448 | """ |
| 1449 | def test_subscriber_with_voltha_for_dhcp_sending_multiple_request(self): |
| 1450 | """ |
| 1451 | Test Method: |
| 1452 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1453 | 1. OLT and ONU is detected and validated. |
| 1454 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1455 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 1456 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 1457 | 5. Send DHCP request to dhcp server which is running as onos app. |
| 1458 | 6. Repeat step 5 for 50 times. |
| 1459 | 7. Verify that subscriber should get same ip which was received from 1st discover from dhcp server. |
| 1460 | """ |
| 1461 | |
| 1462 | def test_subscriber_with_voltha_for_dhcp_requesting_desired_ip_address(self): |
| 1463 | """ |
| 1464 | Test Method: |
| 1465 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1466 | 1. OLT and ONU is detected and validated. |
| 1467 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1468 | 3. Send dhcp request with desired ip address from residential subscriber to dhcp server which is running as onos app. |
| 1469 | 4. Verify that subscriber get ip which was requested in step 3 from dhcp server successfully. |
| 1470 | """ |
| 1471 | |
| 1472 | def test_subscriber_with_voltha_for_dhcp_requesting_desired_out_pool_ip_address(self): |
| 1473 | """ |
| 1474 | Test Method: |
| 1475 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1476 | 1. OLT and ONU is detected and validated. |
| 1477 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1478 | 3. Send dhcp request with desired out of pool ip address from residential subscriber to dhcp server which is running as onos app. |
| 1479 | 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. |
| 1480 | """ |
| 1481 | def test_subscriber_with_voltha_for_dhcp_deactivate_dhcp_app_in_onos(self): |
| 1482 | """ |
| 1483 | Test Method: |
| 1484 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1485 | 1. OLT and ONU is detected and validated. |
| 1486 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1487 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 1488 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 1489 | 5. Deactivate dhcp server app in onos. |
| 1490 | 6. Repeat step 3. |
| 1491 | 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway. |
| 1492 | """ |
| 1493 | def test_subscriber_with_voltha_for_dhcp_renew_time(self): |
| 1494 | """ |
| 1495 | Test Method: |
| 1496 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1497 | 1. OLT and ONU is detected and validated. |
| 1498 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1499 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 1500 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 1501 | 5. Send dhcp renew packet to dhcp server which is running as onos app. |
| 1502 | 6. Repeat step 4. |
| 1503 | """ |
| 1504 | def test_subscriber_with_voltha_for_dhcp_rebind_time(self): |
| 1505 | """ |
| 1506 | Test Method: |
| 1507 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1508 | 1. OLT and ONU is detected and validated. |
| 1509 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1510 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 1511 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 1512 | 5. Send dhcp rebind packet to dhcp server which is running as onos app. |
| 1513 | 6. Repeat step 4. |
| 1514 | """ |
| 1515 | def test_subscriber_with_voltha_for_dhcp_disable_olt_in_voltha(self): |
| 1516 | """ |
| 1517 | Test Method: |
| 1518 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1519 | 1. OLT and ONU is detected and validated. |
| 1520 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1521 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 1522 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 1523 | 5. Disable olt devices which is being detected in voltha CLI. |
| 1524 | 6. Repeat step 3. |
| 1525 | 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway. |
| 1526 | """ |
| 1527 | def test_subscriber_with_voltha_for_dhcp_disable_enable_olt_in_voltha(self): |
| 1528 | """ |
| 1529 | Test Method: |
| 1530 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1531 | 1. OLT and ONU is detected and validated. |
| 1532 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1533 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 1534 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 1535 | 5. Disable olt devices which is being detected in voltha CLI. |
| 1536 | 6. Repeat step 3. |
| 1537 | 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway. |
| 1538 | 8. Enable olt devices which is being detected in voltha CLI. |
| 1539 | 9. Repeat steps 3 and 4. |
| 1540 | """ |
| 1541 | def test_subscriber_with_voltha_for_dhcp_disable_onu_port_in_voltha(self): |
| 1542 | """ |
| 1543 | Test Method: |
| 1544 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1545 | 1. OLT and ONU is detected and validated. |
| 1546 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1547 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 1548 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 1549 | 5. Disable onu port which is being detected in voltha CLI. |
| 1550 | 6. Repeat step 3. |
| 1551 | 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway. |
| 1552 | """ |
| 1553 | def test_subscriber_with_voltha_for_dhcp_disable_enable_onu_port_in_voltha(self): |
| 1554 | """ |
| 1555 | Test Method: |
| 1556 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1557 | 1. OLT and ONU is detected and validated. |
| 1558 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1559 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 1560 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 1561 | 5. Disable onu port which is being detected in voltha CLI. |
| 1562 | 6. Repeat step 3. |
| 1563 | 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway. |
| 1564 | 8. Enable onu port which is being detected in voltha CLI. |
| 1565 | 9. Repeat steps 3 and 4. |
| 1566 | """ |
| 1567 | |
| 1568 | def test_two_subscriber_with_voltha_for_dhcp_discover(self): |
| 1569 | """ |
| 1570 | Test Method: |
| 1571 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1572 | 1. OLT and ONU is detected and validated. |
| 1573 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1574 | 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app. |
| 1575 | 4. Verify that subscribers had got different ips from dhcp server successfully. |
| 1576 | """ |
| 1577 | |
| 1578 | def test_two_subscriber_with_voltha_for_dhcp_multiple_discover(self): |
| 1579 | """ |
| 1580 | Test Method: |
| 1581 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1582 | 1. OLT and ONU is detected and validated. |
| 1583 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1584 | 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app. |
| 1585 | 4. Verify that subscribers had got ip from dhcp server successfully. |
| 1586 | 5. Repeat step 3 and 4 for 10 times for both subscribers. |
| 1587 | 6 Verify that subscribers should get same ips which are offered the first time from dhcp server. |
| 1588 | """ |
| 1589 | def test_two_subscriber_with_voltha_for_dhcp_multiple_discover_for_one_subscriber(self): |
| 1590 | """ |
| 1591 | Test Method: |
| 1592 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1593 | 1. OLT and ONU is detected and validated. |
| 1594 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1595 | 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app. |
| 1596 | 4. Verify that subscribers had got ip from dhcp server successfully. |
| 1597 | 5. Repeat step 3 and 4 for 10 times for only one subscriber and ping to gateway from other subscriber. |
| 1598 | 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 |
| 1599 | """ |
| 1600 | def test_two_subscriber_with_voltha_for_dhcp_discover_desired_ip_address_for_one_subscriber(self): |
| 1601 | """ |
| 1602 | Test Method: |
| 1603 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1604 | 1. OLT and ONU is detected and validated. |
| 1605 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1606 | 3. Send dhcp request from one residential subscriber to dhcp server which is running as onos app. |
| 1607 | 3. Send dhcp request with desired ip from other residential subscriber to dhcp server which is running as onos app. |
| 1608 | 4. Verify that subscribers had got different ips (one subscriber desired ip and other subscriber random ip) from dhcp server successfully. |
| 1609 | """ |
| 1610 | def test_two_subscriber_with_voltha_for_dhcp_discover_within_and_wothout_dhcp_pool_ip_addresses(self): |
| 1611 | """ |
| 1612 | Test Method: |
| 1613 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1614 | 1. OLT and ONU is detected and validated. |
| 1615 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1616 | 3. Send dhcp request with desired wihtin dhcp pool ip from one residential subscriber to dhcp server which is running as onos app. |
| 1617 | 3. Send dhcp request with desired without in dhcp pool ip from other residential subscriber to dhcp server which is running as onos app. |
| 1618 | 4. Verify that subscribers had got different ips (both subscriber got random ips within dhcp pool) from dhcp server successfully. |
| 1619 | """ |
| 1620 | def test_two_subscriber_with_voltha_for_dhcp_disable_onu_port_for_one_subscriber(self): |
| 1621 | """ |
| 1622 | Test Method: |
| 1623 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1624 | 1. OLT and ONU is detected and validated. |
| 1625 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1626 | 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app. |
| 1627 | 4. Verify that subscribers had got ip from dhcp server successfully. |
| 1628 | 5. Disable onu port on which access one subscriber and ping to gateway from other subscriber. |
| 1629 | 6. Repeat step 3 and 4 for one subscriber where uni port is down. |
| 1630 | 7. Verify that subscriber should not get ip from dhcp server and other subscriber ping to gateway should not failed. |
| 1631 | """ |
| 1632 | def test_two_subscriber_with_voltha_for_dhcp_disable_enable_onu_port_for_one_subscriber(self): |
| 1633 | """ |
| 1634 | Test Method: |
| 1635 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1636 | 1. OLT and ONU is detected and validated. |
| 1637 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1638 | 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app. |
| 1639 | 4. Verify that subscribers had got ip from dhcp server successfully. |
| 1640 | 5. Disable onu port on which access one subscriber and ping to gateway from other subscriber. |
| 1641 | 6. Repeat step 3 and 4 for one subscriber where uni port is down. |
| 1642 | 7. Verify that subscriber should not get ip from dhcp server and other subscriber ping to gateway should not failed. |
| 1643 | 8. Enable onu port on which was disable at step 5 and ping to gateway from other subscriber. |
| 1644 | 9. Repeat step 3 and 4 for one subscriber where uni port is up now. |
| 1645 | 10. Verify that subscriber should get ip from dhcp server and other subscriber ping to gateway should not failed. |
| 1646 | """ |
| 1647 | def test_two_subscriber_with_voltha_for_dhcp_disable_olt_detected_in_voltha(self): |
| 1648 | """ |
| 1649 | Test Method: |
| 1650 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1651 | 1. OLT and ONU is detected and validated. |
| 1652 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1653 | 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app. |
| 1654 | 4. Verify that subscribers had got ip from dhcp server successfully. |
| 1655 | 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber. |
| 1656 | 6. Disable the olt device which is detected in voltha. |
| 1657 | 7. Verify that subscriber should not get ip from dhcp server and other subscriber ping to gateway should failed. |
| 1658 | """ |
| 1659 | def test_two_subscriber_with_voltha_for_dhcp_disable_enable_olt_detected_in_voltha(self): |
| 1660 | """ |
| 1661 | Test Method: |
| 1662 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1663 | 1. OLT and ONU is detected and validated. |
| 1664 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1665 | 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app. |
| 1666 | 4. Verify that subscribers had got ip from dhcp server successfully. |
| 1667 | 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber. |
| 1668 | 6. Disable the olt device which is detected in voltha. |
| 1669 | 7. Verify that subscriber should not get ip from dhcp server and other subscriber ping to gateway should failed. |
| 1670 | 8. Enable the olt device which is detected in voltha. |
| 1671 | 9. Verify that subscriber should get ip from dhcp server and other subscriber ping to gateway should not failed. |
| 1672 | """ |
| 1673 | def test_two_subscriber_with_voltha_for_dhcp_pause_olt_detected_in_voltha(self): |
| 1674 | """ |
| 1675 | Test Method: |
| 1676 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1677 | 1. OLT and ONU is detected and validated. |
| 1678 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1679 | 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app. |
| 1680 | 4. Verify that subscribers had got ip from dhcp server successfully. |
| 1681 | 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber. |
| 1682 | 6. Pause the olt device which is detected in voltha. |
| 1683 | 7. Verify that subscriber should not get ip from dhcp server and other subscriber ping to gateway should failed. |
| 1684 | """ |
| 1685 | def test_subscriber_with_voltha_for_dhcpRelay_dhcp_request(self): |
| 1686 | """ |
| 1687 | Test Method: |
| 1688 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1689 | 1. OLT and ONU is detected and validated. |
| 1690 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1691 | 3. Send dhcp request from residential subscrber to external dhcp server. |
| 1692 | 4. Verify that subscriber get ip from external dhcp server successfully. |
| 1693 | """ |
| 1694 | |
| 1695 | def test_subscriber_with_voltha_for_dhcpRelay_dhcp_request_with_invalid_broadcast_source_mac(self): |
| 1696 | """ |
| 1697 | Test Method: |
| 1698 | 0. Make sure that voltha and external dhcp server are is up and running on CORD-POD setup. |
| 1699 | 1. OLT and ONU is detected and validated. |
| 1700 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1701 | 3. Send dhcp request with invalid source mac broadcast from residential subscrber to external dhcp server. |
| 1702 | 4. Verify that subscriber should not get ip from external dhcp server. |
| 1703 | """ |
| 1704 | |
| 1705 | def test_subscriber_with_voltha_for_dhcpRelay_dhcp_request_with_invalid_multicast_source_mac(self): |
| 1706 | """ |
| 1707 | Test Method: |
| 1708 | 0. Make sure that voltha and external dhcp server are is up and running on CORD-POD setup. |
| 1709 | 1. OLT and ONU is detected and validated. |
| 1710 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1711 | 3. Send dhcp request with invalid source mac multicast from residential subscrber to external dhcp server. |
| 1712 | 4. Verify that subscriber should not get ip from external dhcp server. |
| 1713 | """ |
| 1714 | |
| 1715 | def test_subscriber_with_voltha_for_dhcpRelay_dhcp_request_with_invalid_source_mac(self): |
| 1716 | """ |
| 1717 | Test Method: |
| 1718 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1719 | 1. OLT and ONU is detected and validated. |
| 1720 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1721 | 3. Send dhcp request with invalid source mac zero from residential subscrber to external dhcp server. |
| 1722 | 4. Verify that subscriber should not get ip from external dhcp server. |
| 1723 | """ |
| 1724 | |
| 1725 | def test_subscriber_with_voltha_for_dhcpRelay_dhcp_request_and_release(self): |
| 1726 | """ |
| 1727 | Test Method: |
| 1728 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1729 | 1. OLT and ONU is detected and validated. |
| 1730 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1731 | 3. Send dhcp request from residential subscrber to external dhcp server. |
| 1732 | 4. Verify that subscriber get ip from external dhcp server successfully. |
| 1733 | 5. Send dhcp release from residential subscrber to external dhcp server. |
| 1734 | 6 Verify that subscriber should not get ip from external dhcp server, ping to gateway. |
| 1735 | """ |
| 1736 | |
| 1737 | def test_subscriber_with_voltha_for_dhcpRelay_starvation(self): |
| 1738 | """ |
| 1739 | Test Method: |
| 1740 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1741 | 1. OLT and ONU is detected and validated. |
| 1742 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1743 | 3. Send dhcp request from residential subscriber to external dhcp server. |
| 1744 | 4. Verify that subscriber get ip from external dhcp server. successfully. |
| 1745 | 5. Repeat step 3 and 4 for 10 times. |
| 1746 | 6 Verify that subscriber should get ip from external dhcp server.. |
| 1747 | """ |
| 1748 | |
| 1749 | def test_subscriber_with_voltha_for_dhcpRelay_starvation_negative_scenario(self): |
| 1750 | """ |
| 1751 | Test Method: |
| 1752 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1753 | 1. OLT and ONU is detected and validated. |
| 1754 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1755 | 3. Send dhcp request from residential subscriber without of pool ip to external dhcp server. |
| 1756 | 4. Verify that subscriber should not get ip from external dhcp server.. |
| 1757 | 5. Repeat steps 3 and 4 for 10 times. |
| 1758 | 6 Verify that subscriber should not get ip from external dhcp server.. |
| 1759 | """ |
| 1760 | def test_subscriber_with_voltha_for_dhcpRelay_sending_multiple_discover(self): |
| 1761 | """ |
| 1762 | Test Method: |
| 1763 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1764 | 1. OLT and ONU is detected and validated. |
| 1765 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1766 | 3. Send dhcp request from residential subscriber to external dhcp server. |
| 1767 | 4. Verify that subscriber get ip from external dhcp server. successfully. |
| 1768 | 5. Repeat step 3 for 50 times. |
| 1769 | 6 Verify that subscriber should get same ip which was received from 1st discover from external dhcp server.. |
| 1770 | """ |
| 1771 | def test_subscriber_with_voltha_for_dhcpRelay_sending_multiple_request(self): |
| 1772 | """ |
| 1773 | Test Method: |
| 1774 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1775 | 1. OLT and ONU is detected and validated. |
| 1776 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1777 | 3. Send dhcp request from residential subscriber to external dhcp server. |
| 1778 | 4. Verify that subscriber get ip from external dhcp server. successfully. |
| 1779 | 5. Send DHCP request to external dhcp server. |
| 1780 | 6. Repeat step 5 for 50 times. |
| 1781 | 7. Verify that subscriber should get same ip which was received from 1st discover from external dhcp server.. |
| 1782 | """ |
| 1783 | |
| 1784 | def test_subscriber_with_voltha_for_dhcpRelay_requesting_desired_ip_address(self): |
| 1785 | """ |
| 1786 | Test Method: |
| 1787 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1788 | 1. OLT and ONU is detected and validated. |
| 1789 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1790 | 3. Send dhcp request with desired ip address from residential subscriber to external dhcp server. |
| 1791 | 4. Verify that subscriber get ip which was requested in step 3 from external dhcp server. successfully. |
| 1792 | """ |
| 1793 | |
| 1794 | def test_subscriber_with_voltha_for_dhcpRelay_requesting_desired_out_of_pool_ip_address(self): |
| 1795 | """ |
| 1796 | Test Method: |
| 1797 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1798 | 1. OLT and ONU is detected and validated. |
| 1799 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1800 | 3. Send dhcp request with desired out of pool ip address from residential subscriber to external dhcp server. |
| 1801 | 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. |
| 1802 | """ |
| 1803 | |
| 1804 | def test_subscriber_with_voltha_for_dhcpRelay_deactivating_dhcpRelay_app_in_onos(self): |
| 1805 | """ |
| 1806 | Test Method: |
| 1807 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1808 | 1. OLT and ONU is detected and validated. |
| 1809 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1810 | 3. Send dhcp request from residential subscriber to external dhcp server. |
| 1811 | 4. Verify that subscriber get ip from external dhcp server. successfully. |
| 1812 | 5. Deactivate dhcp server app in onos. |
| 1813 | 6. Repeat step 3. |
| 1814 | 7. Verify that subscriber should not get ip from external dhcp server., and ping to gateway. |
| 1815 | """ |
| 1816 | |
| 1817 | def test_subscriber_with_voltha_for_dhcpRelay_renew_time(self): |
| 1818 | """ |
| 1819 | Test Method: |
| 1820 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1821 | 1. OLT and ONU is detected and validated. |
| 1822 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1823 | 3. Send dhcp request from residential subscriber to external dhcp server. |
| 1824 | 4. Verify that subscriber get ip from external dhcp server. successfully. |
| 1825 | 5. Send dhcp renew packet to external dhcp server. |
| 1826 | 6. Repeat step 4. |
| 1827 | """ |
| 1828 | |
| 1829 | def test_subscriber_with_voltha_for_dhcpRelay_rebind_time(self): |
| 1830 | """ |
| 1831 | Test Method: |
| 1832 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1833 | 1. OLT and ONU is detected and validated. |
| 1834 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1835 | 3. Send dhcp request from residential subscriber to external dhcp server. |
| 1836 | 4. Verify that subscriber get ip from external dhcp server. successfully. |
| 1837 | 5. Send dhcp rebind packet to external dhcp server. |
| 1838 | 6. Repeat step 4. |
| 1839 | """ |
| 1840 | |
| 1841 | def test_subscriber_with_voltha_for_dhcpRelay_disable_olt_in_voltha(self): |
| 1842 | """ |
| 1843 | Test Method: |
| 1844 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1845 | 1. OLT and ONU is detected and validated. |
| 1846 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1847 | 3. Send dhcp request from residential subscriber to external dhcp server. |
| 1848 | 4. Verify that subscriber get ip from external dhcp server. successfully. |
| 1849 | 5. Disable olt devices which is being detected in voltha CLI. |
| 1850 | 6. Repeat step 3. |
| 1851 | 7. Verify that subscriber should not get ip from external dhcp server., and ping to gateway. |
| 1852 | """ |
| 1853 | |
| 1854 | def test_subscriber_with_voltha_for_dhcpRelay_toggling_olt_in_voltha(self): |
| 1855 | """ |
| 1856 | Test Method: |
| 1857 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1858 | 1. OLT and ONU is detected and validated. |
| 1859 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1860 | 3. Send dhcp request from residential subscriber to external dhcp server. |
| 1861 | 4. Verify that subscriber get ip from external dhcp server. successfully. |
| 1862 | 5. Disable olt devices which is being detected in voltha CLI. |
| 1863 | 6. Repeat step 3. |
| 1864 | 7. Verify that subscriber should not get ip from external dhcp server., and ping to gateway. |
| 1865 | 8. Enable olt devices which is being detected in voltha CLI. |
| 1866 | 9. Repeat steps 3 and 4. |
| 1867 | """ |
| 1868 | |
| 1869 | def test_subscriber_with_voltha_for_dhcpRelay_disable_onu_port_in_voltha(self): |
| 1870 | """ |
| 1871 | Test Method: |
| 1872 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1873 | 1. OLT and ONU is detected and validated. |
| 1874 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1875 | 3. Send dhcp request from residential subscriber to external dhcp server. |
| 1876 | 4. Verify that subscriber get ip from external dhcp server. successfully. |
| 1877 | 5. Disable onu port which is being detected in voltha CLI. |
| 1878 | 6. Repeat step 3. |
| 1879 | 7. Verify that subscriber should not get ip from external dhcp server., and ping to gateway. |
| 1880 | """ |
| 1881 | |
| 1882 | def test_subscriber_with_voltha_for_dhcpRelay_disable_enable_onu_port_in_voltha(self): |
| 1883 | """ |
| 1884 | Test Method: |
| 1885 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1886 | 1. OLT and ONU is detected and validated. |
| 1887 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1888 | 3. Send dhcp request from residential subscriber to external dhcp server. |
| 1889 | 4. Verify that subscriber get ip from external dhcp server. successfully. |
| 1890 | 5. Disable onu port which is being detected in voltha CLI. |
| 1891 | 6. Repeat step 3. |
| 1892 | 7. Verify that subscriber should not get ip from external dhcp server., and ping to gateway. |
| 1893 | 8. Enable onu port which is being detected in voltha CLI. |
| 1894 | 9. Repeat steps 3 and 4. |
| 1895 | """ |
| 1896 | |
| 1897 | def test_two_subscriber_with_voltha_for_dhcpRelay_discover(self): |
| 1898 | """ |
| 1899 | Test Method: |
| 1900 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1901 | 1. OLT and ONU is detected and validated. |
| 1902 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1903 | 3. Send dhcp request from two residential subscribers to external dhcp server. |
| 1904 | 4. Verify that subscribers had got different ips from external dhcp server. successfully. |
| 1905 | """ |
| 1906 | |
| 1907 | def test_two_subscriber_with_voltha_for_dhcpRelay_multiple_discover(self): |
| 1908 | """ |
| 1909 | Test Method: |
| 1910 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1911 | 1. OLT and ONU is detected and validated. |
| 1912 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1913 | 3. Send dhcp request from two residential subscribers to external dhcp server. |
| 1914 | 4. Verify that subscribers had got ip from external dhcp server. successfully. |
| 1915 | 5. Repeat step 3 and 4 for 10 times for both subscribers. |
| 1916 | 6 Verify that subscribers should get same ips which are offered the first time from external dhcp server.. |
| 1917 | """ |
| 1918 | |
| 1919 | def test_two_subscriber_with_voltha_for_dhcpRelay_multiple_discover_for_one_subscriber(self): |
| 1920 | """ |
| 1921 | Test Method: |
| 1922 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1923 | 1. OLT and ONU is detected and validated. |
| 1924 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1925 | 3. Send dhcp request from two residential subscribers to external dhcp server. |
| 1926 | 4. Verify that subscribers had got ip from external dhcp server. successfully. |
| 1927 | 5. Repeat step 3 and 4 for 10 times for only one subscriber and ping to gateway from other subscriber. |
| 1928 | 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 |
| 1929 | """ |
| 1930 | |
| 1931 | def test_two_subscriber_with_voltha_for_dhcpRelay_discover_desired_ip_address_for_one_subscriber(self): |
| 1932 | """ |
| 1933 | Test Method: |
| 1934 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1935 | 1. OLT and ONU is detected and validated. |
| 1936 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1937 | 3. Send dhcp request from one residential subscriber to external dhcp server. |
| 1938 | 3. Send dhcp request with desired ip from other residential subscriber to external dhcp server. |
| 1939 | 4. Verify that subscribers had got different ips (one subscriber desired ip and other subscriber random ip) from external dhcp server. successfully. |
| 1940 | """ |
| 1941 | |
| 1942 | def test_two_subscriber_with_voltha_for_dhcpRelay_discover_in_range_and_out_of_range_from_dhcp_pool_ip_addresses(self): |
| 1943 | """ |
| 1944 | Test Method: |
| 1945 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1946 | 1. OLT and ONU is detected and validated. |
| 1947 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1948 | 3. Send dhcp request with desired wihtin dhcp pool ip from one residential subscriber to external dhcp server. |
| 1949 | 3. Send dhcp request with desired without in dhcp pool ip from other residential subscriber to external dhcp server. |
| 1950 | 4. Verify that subscribers had got different ips (both subscriber got random ips within dhcp pool) from external dhcp server. successfully. |
| 1951 | """ |
| 1952 | |
| 1953 | def test_two_subscriber_with_voltha_for_dhcpRelay_disable_onu_port_for_one_subscriber(self): |
| 1954 | """ |
| 1955 | Test Method: |
| 1956 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1957 | 1. OLT and ONU is detected and validated. |
| 1958 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1959 | 3. Send dhcp request from two residential subscribers to external dhcp server. |
| 1960 | 4. Verify that subscribers had got ip from external dhcp server. successfully. |
| 1961 | 5. Disable onu port on which access one subscriber and ping to gateway from other subscriber. |
| 1962 | 6. Repeat step 3 and 4 for one subscriber where uni port is down. |
| 1963 | 7. Verify that subscriber should not get ip from external dhcp server. and other subscriber ping to gateway should not failed. |
| 1964 | """ |
| 1965 | |
| 1966 | def test_two_subscriber_with_voltha_for_dhcpRelay_toggle_onu_port_for_one_subscriber(self): |
| 1967 | """ |
| 1968 | Test Method: |
| 1969 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1970 | 1. OLT and ONU is detected and validated. |
| 1971 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1972 | 3. Send dhcp request from two residential subscribers to external dhcp server. |
| 1973 | 4. Verify that subscribers had got ip from external dhcp server. successfully. |
| 1974 | 5. Disable onu port on which access one subscriber and ping to gateway from other subscriber. |
| 1975 | 6. Repeat step 3 and 4 for one subscriber where uni port is down. |
| 1976 | 7. Verify that subscriber should not get ip from external dhcp server. and other subscriber ping to gateway should not failed. |
| 1977 | 8. Enable onu port on which was disable at step 5 and ping to gateway from other subscriber. |
| 1978 | 9. Repeat step 3 and 4 for one subscriber where uni port is up now. |
| 1979 | 10. Verify that subscriber should get ip from external dhcp server. and other subscriber ping to gateway should not failed. |
| 1980 | """ |
| 1981 | |
| 1982 | def test_two_subscriber_with_voltha_for_dhcpRelay_disable_olt_detected_in_voltha(self): |
| 1983 | """ |
| 1984 | Test Method: |
| 1985 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1986 | 1. OLT and ONU is detected and validated. |
| 1987 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1988 | 3. Send dhcp request from two residential subscribers to external dhcp server. |
| 1989 | 4. Verify that subscribers had got ip from external dhcp server. successfully. |
| 1990 | 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber. |
| 1991 | 6. Disable the olt device which is detected in voltha. |
| 1992 | 7. Verify that subscriber should not get ip from external dhcp server. and other subscriber ping to gateway should failed. |
| 1993 | """ |
| 1994 | |
| 1995 | def test_two_subscriber_with_voltha_for_dhcpRelay_toggle_olt_detected_in_voltha(self): |
| 1996 | """ |
| 1997 | Test Method: |
| 1998 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1999 | 1. OLT and ONU is detected and validated. |
| 2000 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 2001 | 3. Send dhcp request from two residential subscribers to external dhcp server. |
| 2002 | 4. Verify that subscribers had got ip from external dhcp server. successfully. |
| 2003 | 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber. |
| 2004 | 6. Disable the olt device which is detected in voltha. |
| 2005 | 7. Verify that subscriber should not get ip from external dhcp server. and other subscriber ping to gateway should failed. |
| 2006 | 8. Enable the olt device which is detected in voltha. |
| 2007 | 9. Verify that subscriber should get ip from external dhcp server. and other subscriber ping to gateway should not failed. |
| 2008 | """ |
| 2009 | |
| 2010 | def test_two_subscriber_with_voltha_for_dhcpRelay_pause_olt_detected_in_voltha(self): |
| 2011 | """ |
| 2012 | Test Method: |
| 2013 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 2014 | 1. OLT and ONU is detected and validated. |
| 2015 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 2016 | 3. Send dhcp request from two residential subscribers to external dhcp server. |
| 2017 | 4. Verify that subscribers had got ip from external dhcp server. successfully. |
| 2018 | 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber. |
| 2019 | 6. Pause the olt device which is detected in voltha. |
| 2020 | 7. Verify that subscriber should not get ip from external dhcp server. and other subscriber ping to gateway should failed. |
| 2021 | """ |