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 |
| 20 | from OnosCtrl import OnosCtrl |
| 21 | from CordLogger import CordLogger |
| 22 | from scapy.all import * |
| 23 | from scapy_ssl_tls.ssl_tls import * |
| 24 | from scapy_ssl_tls.ssl_tls_crypto import * |
| 25 | 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] | 26 | from CordContainer import Onos |
A R Karthick | 35495c3 | 2017-05-11 14:58:32 -0700 | [diff] [blame] | 27 | |
| 28 | class voltha_exchange(unittest.TestCase): |
| 29 | |
| 30 | OLT_TYPE = 'tibit_olt' |
| 31 | OLT_MAC = '00:0c:e2:31:12:00' |
| 32 | VOLTHA_HOST = 'localhost' |
| 33 | VOLTHA_REST_PORT = 8881 |
| 34 | voltha = None |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 35 | apps = ('org.opencord.aaa', 'org.onosproject.dhcp') |
| 36 | olt_apps = () #'org.opencord.cordmcast') |
| 37 | vtn_app = 'org.opencord.vtn' |
| 38 | table_app = 'org.ciena.cordigmp' |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 39 | test_path = os.path.dirname(os.path.realpath(__file__)) |
| 40 | 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] | 41 | 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] | 42 | 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] | 43 | olt_app_name = 'org.onosproject.olt' |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 44 | #onos_config_path = os.path.join(test_path, '..', 'setup/onos-config') |
| 45 | olt_conf_file = os.getenv('OLT_CONFIG_FILE', os.path.join(test_path, '..', 'setup/olt_config.json')) |
| 46 | onos_restartable = bool(int(os.getenv('ONOS_RESTART', 0))) |
| 47 | VOLTHA_ENABLED = True |
| 48 | INTF_TX_DEFAULT = 'veth2' |
| 49 | INTF_RX_DEFAULT = 'veth0' |
| 50 | TESTCASE_TIMEOUT = 300 |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 51 | # VOLTHA_CONFIG_FAKE = True |
| 52 | VOLTHA_CONFIG_FAKE = False |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 53 | VOLTHA_UPLINK_VLAN_MAP = { 'of:0000000000000001' : '222' } |
| 54 | VOLTHA_ONU_UNI_PORT = 'veth0' |
| 55 | |
| 56 | CLIENT_CERT = """-----BEGIN CERTIFICATE----- |
| 57 | MIICuDCCAiGgAwIBAgIBAjANBgkqhkiG9w0BAQUFADCBizELMAkGA1UEBhMCVVMx |
| 58 | CzAJBgNVBAgTAkNBMRIwEAYDVQQHEwlTb21ld2hlcmUxEzARBgNVBAoTCkNpZW5h |
| 59 | IEluYy4xHjAcBgkqhkiG9w0BCQEWD2FkbWluQGNpZW5hLmNvbTEmMCQGA1UEAxMd |
| 60 | RXhhbXBsZSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMTYwNjA2MjExMjI3WhcN |
| 61 | MTcwNjAxMjExMjI3WjBnMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExEzARBgNV |
| 62 | BAoTCkNpZW5hIEluYy4xFzAVBgNVBAMUDnVzZXJAY2llbmEuY29tMR0wGwYJKoZI |
| 63 | hvcNAQkBFg51c2VyQGNpZW5hLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkC |
| 64 | gYEAwvXiSzb9LZ6c7uNziUfKvoHO7wu/uiFC5YUpXbmVGuGZizbVrny0xnR85Dfe |
| 65 | +9R4diansfDhIhzOUl1XjN3YDeSS9OeF5YWNNE8XDhlz2d3rVzaN6hIhdotBkUjg |
| 66 | rUewjTg5OFR31QEyG3v8xR3CLgiE9xQELjZbSA07pD79zuUCAwEAAaNPME0wEwYD |
| 67 | VR0lBAwwCgYIKwYBBQUHAwIwNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL3d3dy5l |
| 68 | eGFtcGxlLmNvbS9leGFtcGxlX2NhLmNybDANBgkqhkiG9w0BAQUFAAOBgQDAjkrY |
| 69 | 6tDChmKbvr8w6Du/t8vHjTCoCIocHTN0qzWOeb1YsAGX89+TrWIuO1dFyYd+Z0KC |
| 70 | PDKB5j/ygml9Na+AklSYAVJIjvlzXKZrOaPmhZqDufi+rXWti/utVqY4VMW2+HKC |
| 71 | nXp37qWeuFLGyR1519Y1d6F/5XzqmvbwURuEug== |
| 72 | -----END CERTIFICATE-----""" |
| 73 | |
| 74 | CLIENT_CERT_INVALID = '''-----BEGIN CERTIFICATE----- |
| 75 | MIIDvTCCAqWgAwIBAgIBAjANBgkqhkiG9w0BAQUFADCBizELMAkGA1UEBhMCVVMx |
| 76 | CzAJBgNVBAgTAkNBMRIwEAYDVQQHEwlTb21ld2hlcmUxEzARBgNVBAoTCkNpZW5h |
| 77 | IEluYy4xHjAcBgkqhkiG9w0BCQEWD2FkbWluQGNpZW5hLmNvbTEmMCQGA1UEAxMd |
| 78 | RXhhbXBsZSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMTYwMzExMTg1MzM2WhcN |
| 79 | MTcwMzA2MTg1MzM2WjBnMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExEzARBgNV |
| 80 | BAoTCkNpZW5hIEluYy4xFzAVBgNVBAMUDnVzZXJAY2llbmEuY29tMR0wGwYJKoZI |
| 81 | hvcNAQkBFg51c2VyQGNpZW5hLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC |
| 82 | AQoCggEBAOxemcBsPn9tZsCa5o2JA6sQDC7A6JgCNXXl2VFzKLNNvB9PS6D7ZBsQ |
| 83 | 5An0zEDMNzi51q7lnrYg1XyiE4S8FzMGAFr94RlGMQJUbRD9V/oqszMX4k++iAOK |
| 84 | tIA1gr3x7Zi+0tkjVSVzXTmgNnhChAamdMsjYUG5+CY9WAicXyy+VEV3zTphZZDR |
| 85 | OjcjEp4m/TSXVPYPgYDXI40YZKX5BdvqykWtT/tIgZb48RS1NPyN/XkCYzl3bv21 |
| 86 | qx7Mc0fcEbsJBIIRYTUkfxnsilcnmLxSYO+p+DZ9uBLBzcQt+4Rd5pLSfi21WM39 |
| 87 | 2Z2oOi3vs/OYAPAqgmi2JWOv3mePa/8CAwEAAaNPME0wEwYDVR0lBAwwCgYIKwYB |
| 88 | BQUHAwIwNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL3d3dy5leGFtcGxlLmNvbS9l |
| 89 | eGFtcGxlX2NhLmNybDANBgkqhkiG9w0BAQUFAAOCAQEALBzMPDTIB6sLyPl0T6JV |
| 90 | MjOkyldAVhXWiQsTjaGQGJUUe1cmUJyZbUZEc13MygXMPOM4x7z6VpXGuq1c/Vxn |
| 91 | VzQ2fNnbJcIAHi/7G8W5/SQfPesIVDsHTEc4ZspPi5jlS/MVX3HOC+BDbOjdbwqP |
| 92 | RX0JEr+uOyhjO+lRxG8ilMRACoBUbw1eDuVDoEBgErSUC44pq5ioDw2xelc+Y6hQ |
| 93 | dmtYwfY0DbvwxHtA495frLyPcastDiT/zre7NL51MyUDPjjYjghNQEwvu66IKbQ3 |
| 94 | T1tJBrgI7/WI+dqhKBFolKGKTDWIHsZXQvZ1snGu/FRYzg1l+R/jT8cRB9BDwhUt |
| 95 | yg== |
| 96 | -----END CERTIFICATE-----''' |
A R Karthick | 35495c3 | 2017-05-11 14:58:32 -0700 | [diff] [blame] | 97 | |
A.R Karthick | 3493a57 | 2017-06-07 18:28:10 -0700 | [diff] [blame] | 98 | @classmethod |
| 99 | def update_apps_version(cls): |
| 100 | version = Onos.getVersion() |
| 101 | major = int(version.split('.')[0]) |
| 102 | minor = int(version.split('.')[1]) |
| 103 | cordigmp_app_version = '2.0-SNAPSHOT' |
| 104 | olt_app_version = '1.2-SNAPSHOT' |
| 105 | if major > 1: |
| 106 | cordigmp_app_version = '3.0-SNAPSHOT' |
| 107 | olt_app_version = '2.0-SNAPSHOT' |
| 108 | elif major == 1: |
| 109 | if minor > 10: |
| 110 | cordigmp_app_version = '3.0-SNAPSHOT' |
| 111 | olt_app_version = '2.0-SNAPSHOT' |
| 112 | elif minor <= 8: |
| 113 | olt_app_version = '1.1-SNAPSHOT' |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 114 | cls.app_file = os.path.join(cls.test_path, '..', 'apps/ciena-cordigmp-{}.oar'.format(cordigmp_app_version)) |
| 115 | cls.table_app_file = os.path.join(cls.test_path, '..', 'apps/ciena-cordigmp-multitable-{}.oar'.format(cordigmp_app_version)) |
| 116 | cls.olt_app_file = os.path.join(cls.test_path, '..', 'apps/olt-app-{}.oar'.format(olt_app_version)) |
| 117 | |
A R Karthick | 35495c3 | 2017-05-11 14:58:32 -0700 | [diff] [blame] | 118 | @classmethod |
A.R Karthick | f874d03 | 2017-06-07 18:47:51 -0700 | [diff] [blame] | 119 | def onos_load_config(cls, app, config): |
| 120 | status, code = OnosCtrl.config(config) |
| 121 | if status is False: |
| 122 | log_test.info('JSON config request for app %s returned status %d' %(app, code)) |
| 123 | assert_equal(status, True) |
| 124 | time.sleep(2) |
| 125 | |
| 126 | @classmethod |
| 127 | def onos_aaa_load(cls): |
| 128 | aaa_dict = {'apps' : { 'org.opencord.aaa' : { 'AAA' : { 'radiusSecret': 'radius_password', |
| 129 | 'radiusIp': '172.17.0.2' } } } } |
| 130 | radius_ip = os.getenv('ONOS_AAA_IP') or '172.17.0.2' |
| 131 | aaa_dict['apps']['org.opencord.aaa']['AAA']['radiusIp'] = radius_ip |
| 132 | cls.onos_load_config('org.opencord.aaa', aaa_dict) |
| 133 | |
| 134 | @classmethod |
A R Karthick | 35495c3 | 2017-05-11 14:58:32 -0700 | [diff] [blame] | 135 | def setUpClass(cls): |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 136 | cls.update_apps_version() |
A R Karthick | 35495c3 | 2017-05-11 14:58:32 -0700 | [diff] [blame] | 137 | 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] | 138 | cls.install_app_table() |
| 139 | cls.olt = OltConfig(olt_conf_file = cls.olt_conf_file) |
| 140 | cls.port_map, cls.port_list = cls.olt.olt_port_map() |
| 141 | cls.switches = cls.port_map['switches'] |
| 142 | cls.num_ports = cls.port_map['num_ports'] |
| 143 | if cls.num_ports > 1: |
| 144 | cls.num_ports -= 1 ##account for the tx port |
| 145 | cls.activate_apps(cls.apps + cls.olt_apps) |
A.R Karthick | f874d03 | 2017-06-07 18:47:51 -0700 | [diff] [blame] | 146 | cls.onos_aaa_load() |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 147 | |
A.R Karthick | 3493a57 | 2017-06-07 18:28:10 -0700 | [diff] [blame] | 148 | @classmethod |
| 149 | def tearDownClass(cls): |
| 150 | '''Deactivate the olt apps and restart OVS back''' |
| 151 | apps = cls.olt_apps + ( cls.table_app,) |
| 152 | for app in apps: |
| 153 | onos_ctrl = OnosCtrl(app) |
| 154 | onos_ctrl.deactivate() |
| 155 | cls.install_app_igmp() |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 156 | |
A.R Karthick | 3493a57 | 2017-06-07 18:28:10 -0700 | [diff] [blame] | 157 | @classmethod |
| 158 | def install_app_igmp(cls): |
| 159 | ##Uninstall the table app on class exit |
| 160 | OnosCtrl.uninstall_app(cls.table_app) |
| 161 | time.sleep(2) |
| 162 | log_test.info('Installing back the cord igmp app %s for subscriber test on exit' %(cls.app_file)) |
| 163 | OnosCtrl.install_app(cls.app_file) |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 164 | |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 165 | def remove_olt(self, switch_map): |
| 166 | controller = get_controller() |
| 167 | auth = ('karaf', 'karaf') |
| 168 | #remove subscriber for every port on all the voltha devices |
| 169 | for device, device_map in switch_map.iteritems(): |
| 170 | uni_ports = device_map['ports'] |
| 171 | uplink_vlan = device_map['uplink_vlan'] |
| 172 | for port in uni_ports: |
| 173 | rest_url = 'http://{}:8181/onos/olt/oltapp/{}/{}'.format(controller, |
| 174 | device, |
| 175 | port) |
| 176 | resp = requests.delete(rest_url, auth = auth) |
| 177 | if resp.status_code not in [204, 202, 200]: |
| 178 | log_test.error('Error deleting subscriber for device %s on port %s' %(device, port)) |
| 179 | else: |
| 180 | log_test.info('Deleted subscriber for device %s on port %s' %(device, port)) |
| 181 | OnosCtrl.uninstall_app(self.olt_app_file) |
| 182 | |
| 183 | def config_olt(self, switch_map): |
| 184 | controller = get_controller() |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 185 | auth = ('karaf', 'karaf') |
| 186 | #configure subscriber for every port on all the voltha devices |
| 187 | for device, device_map in switch_map.iteritems(): |
| 188 | uni_ports = device_map['ports'] |
| 189 | uplink_vlan = device_map['uplink_vlan'] |
| 190 | for port in uni_ports: |
| 191 | vlan = port |
| 192 | rest_url = 'http://{}:8181/onos/olt/oltapp/{}/{}/{}'.format(controller, |
| 193 | device, |
| 194 | port, |
| 195 | vlan) |
| 196 | resp = requests.post(rest_url, auth = auth) |
| 197 | #assert_equal(resp.ok, True) |
| 198 | |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 199 | def voltha_uni_port_toggle(self, uni_port = None): |
| 200 | ## Admin state of port is down and up |
| 201 | if not uni_port: |
| 202 | uni_port = self.INTF_RX_DEFAULT |
| 203 | cmd = 'ifconfig {} down'.format(uni_port) |
| 204 | os.system(cmd) |
| 205 | log_test.info('Admin state of uni_port is down') |
| 206 | time.sleep(30) |
| 207 | cmd = 'ifconfig {} up'.format(uni_port) |
| 208 | os.system(cmd) |
| 209 | log_test.info('Admin state of uni_port is up now') |
| 210 | time.sleep(30) |
| 211 | return |
| 212 | |
| 213 | |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 214 | @classmethod |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 215 | def install_app_table(cls): |
| 216 | ##Uninstall the existing app if any |
| 217 | OnosCtrl.uninstall_app(cls.table_app) |
| 218 | time.sleep(2) |
| 219 | log_test.info('Installing the multi table app %s for subscriber test' %(cls.table_app_file)) |
| 220 | OnosCtrl.install_app(cls.table_app_file) |
| 221 | time.sleep(3) |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 222 | |
| 223 | @classmethod |
| 224 | def activate_apps(cls, apps): |
| 225 | for app in apps: |
| 226 | onos_ctrl = OnosCtrl(app) |
| 227 | status, _ = onos_ctrl.activate() |
| 228 | assert_equal(status, True) |
| 229 | time.sleep(2) |
| 230 | |
| 231 | def tls_flow_check(self, olt_uni_port, cert_info = None): |
| 232 | def tls_fail_cb(): |
| 233 | log_test.info('TLS verification failed') |
| 234 | if cert_info is None: |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 235 | tls = TLSAuthTest(fail_cb = tls_fail_cb, intf = olt_uni_port) |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 236 | log_test.info('Running subscriber %s tls auth test with valid TLS certificate' %olt_uni_port) |
| 237 | tls.runTest() |
| 238 | assert_equal(tls.failTest, False) |
| 239 | if cert_info == "no_cert": |
| 240 | tls = TLSAuthTest(fail_cb = tls_fail_cb, intf = olt_uni_port, client_cert = '') |
| 241 | log_test.info('Running subscriber %s tls auth test with no TLS certificate' %olt_uni_port) |
| 242 | tls.runTest() |
| 243 | assert_equal(tls.failTest, True) |
| 244 | if cert_info == "invalid_cert": |
| 245 | tls = TLSAuthTest(fail_cb = tls_fail_cb, intf = olt_uni_port, client_cert = self.CLIENT_CERT_INVALID) |
| 246 | log_test.info('Running subscriber %s tls auth test with invalid TLS certificate' %olt_uni_port) |
| 247 | tls.runTest() |
| 248 | assert_equal(tls.failTest, True) |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 249 | if cert_info == "app_deactivate" or cert_info == "restart_radius" or cert_info == "disable_olt_device" or \ |
| 250 | cert_info == "uni_port_admin_down" or cert_info == "restart_olt_device" or cert_info == "restart_olt_device": |
| 251 | tls = TLSAuthTest(fail_cb = tls_fail_cb, intf = olt_uni_port, client_cert = self.CLIENT_CERT_INVALID) |
| 252 | log_test.info('Running subscriber %s tls auth test with %s' %(olt_uni_port,cert_info)) |
| 253 | tls.runTest() |
| 254 | assert_equal(tls.failTest, True) |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 255 | self.test_status = True |
| 256 | return self.test_status |
A R Karthick | 35495c3 | 2017-05-11 14:58:32 -0700 | [diff] [blame] | 257 | |
A.R Karthick | 8a507cf | 2017-06-02 18:44:49 -0700 | [diff] [blame] | 258 | def test_olt_enable_disable(self): |
A R Karthick | 35495c3 | 2017-05-11 14:58:32 -0700 | [diff] [blame] | 259 | 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] | 260 | device_id, status = self.voltha.enable_device(self.OLT_TYPE, self.OLT_MAC) |
| 261 | assert_not_equal(device_id, None) |
| 262 | try: |
| 263 | assert_equal(status, True) |
| 264 | time.sleep(10) |
| 265 | finally: |
| 266 | self.voltha.disable_device(device_id, delete = True) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 267 | |
A.R Karthick | 8a507cf | 2017-06-02 18:44:49 -0700 | [diff] [blame] | 268 | def test_ponsim_enable_disable(self): |
A.R Karthick | 8b9c5f1 | 2017-05-30 17:47:08 -0700 | [diff] [blame] | 269 | log_test.info('Enabling ponsim_olt') |
| 270 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
A.R Karthick | 8a507cf | 2017-06-02 18:44:49 -0700 | [diff] [blame] | 271 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 272 | assert_not_equal(device_id, None) |
| 273 | try: |
| 274 | assert_equal(status, True) |
| 275 | time.sleep(10) |
| 276 | finally: |
| 277 | self.voltha.disable_device(device_id, delete = True) |
A.R Karthick | 8b9c5f1 | 2017-05-30 17:47:08 -0700 | [diff] [blame] | 278 | |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 279 | def test_subscriber_with_voltha_for_eap_tls_authentication(self): |
| 280 | """ |
| 281 | Test Method: |
| 282 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 283 | 1. OLT and ONU is detected and validated. |
| 284 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 285 | 3. Issue auth request packets from CORD TESTER voltha test module acting as a subscriber.. |
| 286 | 4. Validate that eap tls valid auth packets are being exchanged between subscriber, onos and freeradius. |
| 287 | 5. Verify that subscriber is authenticated successfully. |
| 288 | """ |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 289 | log_test.info('Enabling ponsim_olt') |
| 290 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 291 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 292 | assert_not_equal(device_id, None) |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 293 | if status == False: |
| 294 | self.voltha.disable_device(device_id, delete = True) |
| 295 | assert_equal(status, True) |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 296 | time.sleep(10) |
| 297 | switch_map = None |
| 298 | olt_configured = False |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 299 | voltha = VolthaCtrl(self.VOLTHA_HOST, |
| 300 | rest_port = self.VOLTHA_REST_PORT, |
| 301 | uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP) |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 302 | try: |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 303 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 304 | if not switch_map: |
| 305 | log_test.info('No voltha devices found') |
| 306 | return |
| 307 | log_test.info('Installing OLT app') |
| 308 | OnosCtrl.install_app(self.olt_app_file) |
| 309 | time.sleep(5) |
| 310 | log_test.info('Adding subscribers through OLT app') |
| 311 | self.config_olt(switch_map) |
| 312 | olt_configured = True |
| 313 | time.sleep(5) |
| 314 | auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT) |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 315 | assert_equal(auth_status, True) |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 316 | finally: |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 317 | if switch_map is not None: |
| 318 | if olt_configured is True: |
| 319 | self.remove_olt(switch_map) |
| 320 | self.voltha.disable_device(device_id, delete = True) |
| 321 | time.sleep(10) |
| 322 | OnosCtrl.uninstall_app(self.olt_app_name) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 323 | |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 324 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 325 | def test_subscriber_with_voltha_for_eap_tls_authentication_failure(self): |
| 326 | """ |
| 327 | Test Method: |
| 328 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 329 | 1. OLT and ONU is detected and validated. |
| 330 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 331 | 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 332 | 4. Validate that eap tls without cert auth packet is being exchanged between subscriber, onos and freeradius. |
| 333 | 5. Verify that subscriber authentication is unsuccessful.. |
| 334 | """ |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 335 | df = defer.Deferred() |
| 336 | def tls_flow_check_with_no_cert_scenario(df): |
| 337 | log_test.info('Enabling ponsim_olt') |
| 338 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 339 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 340 | assert_not_equal(device_id, None) |
| 341 | voltha = VolthaCtrl(self.VOLTHA_HOST, |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 342 | rest_port = self.VOLTHA_REST_PORT, |
| 343 | uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP) |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 344 | time.sleep(10) |
| 345 | switch_map = None |
| 346 | olt_configured = False |
| 347 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 348 | log_test.info('Installing OLT app') |
| 349 | OnosCtrl.install_app(self.olt_app_file) |
| 350 | time.sleep(5) |
| 351 | log_test.info('Adding subscribers through OLT app') |
| 352 | self.config_olt(switch_map) |
| 353 | olt_configured = True |
| 354 | time.sleep(5) |
| 355 | auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT, cert_info = "no_cert") |
| 356 | try: |
| 357 | assert_equal(auth_status, True) |
| 358 | assert_equal(status, True) |
| 359 | time.sleep(10) |
| 360 | finally: |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 361 | self.remove_olt(switch_map) |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 362 | self.voltha.disable_device(device_id, delete = True) |
| 363 | df.callback(0) |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 364 | |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 365 | reactor.callLater(0, tls_flow_check_with_no_cert_scenario, df) |
| 366 | return df |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 367 | |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 368 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 369 | def test_subscriber_with_voltha_for_eap_tls_authentication_using_invalid_cert(self): |
| 370 | """ |
| 371 | Test Method: |
| 372 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 373 | 1. OLT and ONU is detected and validated. |
| 374 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 375 | 3. Issue tls auth packets and exchange invalid cert from CORD TESTER voltha test module acting as a subscriber.. |
| 376 | 4. Validate that eap tls with invalid cert auth packet is being exchanged between subscriber, onos and freeradius. |
| 377 | 5. Verify that subscriber authentication is unsuccessful.. |
| 378 | """ |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 379 | df = defer.Deferred() |
| 380 | def tls_flow_check_with_invalid_cert_scenario(df): |
| 381 | log_test.info('Enabling ponsim_olt') |
| 382 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 383 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 384 | assert_not_equal(device_id, None) |
| 385 | voltha = VolthaCtrl(self.VOLTHA_HOST, |
| 386 | rest_port = self.VOLTHA_REST_PORT, |
| 387 | uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP) |
| 388 | time.sleep(10) |
| 389 | switch_map = None |
| 390 | olt_configured = False |
| 391 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 392 | log_test.info('Installing OLT app') |
| 393 | OnosCtrl.install_app(self.olt_app_file) |
| 394 | time.sleep(5) |
| 395 | log_test.info('Adding subscribers through OLT app') |
| 396 | self.config_olt(switch_map) |
| 397 | olt_configured = True |
| 398 | time.sleep(5) |
| 399 | auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT, cert_info = "invalid_cert") |
| 400 | try: |
| 401 | assert_equal(auth_status, True) |
| 402 | assert_equal(status, True) |
| 403 | time.sleep(10) |
| 404 | finally: |
A.R Karthick | b9eab5a | 2017-06-07 16:03:51 -0700 | [diff] [blame] | 405 | self.remove_olt(switch_map) |
Thangavelu K S | 77c8c0c | 2017-06-07 18:04:21 +0000 | [diff] [blame] | 406 | self.voltha.disable_device(device_id, delete = True) |
| 407 | df.callback(0) |
| 408 | reactor.callLater(0, tls_flow_check_with_invalid_cert_scenario, df) |
| 409 | return df |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 410 | |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 411 | @deferred(TESTCASE_TIMEOUT) |
| 412 | def test_subscriber_with_voltha_for_multiple_invalid_authentication_attempts(self): |
| 413 | """ |
| 414 | Test Method: |
| 415 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 416 | 1. OLT and ONU is detected and validated. |
| 417 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 418 | 3. Issue tls auth packets and exchange invalid cert from CORD TESTER voltha test module acting as a subscriber for multiple times. |
| 419 | 4. Validate that eap tls with invalid cert auth packet is being exchanged between subscriber, onos and freeradius. |
| 420 | 5. Verify that subscriber authentication is unsuccessful.. |
| 421 | """ |
| 422 | df = defer.Deferred() |
| 423 | def tls_flow_check_with_no_cert_scenario(df): |
| 424 | log_test.info('Enabling ponsim_olt') |
| 425 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 426 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 427 | assert_not_equal(device_id, None) |
| 428 | voltha = VolthaCtrl(self.VOLTHA_HOST, |
| 429 | rest_port = self.VOLTHA_REST_PORT, |
| 430 | uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP) |
| 431 | time.sleep(10) |
| 432 | switch_map = None |
| 433 | olt_configured = False |
| 434 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 435 | log_test.info('Installing OLT app') |
| 436 | OnosCtrl.install_app(self.olt_app_file) |
| 437 | time.sleep(5) |
| 438 | log_test.info('Adding subscribers through OLT app') |
| 439 | self.config_olt(switch_map) |
| 440 | olt_configured = True |
| 441 | time.sleep(5) |
| 442 | auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT, cert_info = "invalid_cert") |
| 443 | auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT, cert_info = "invalid_cert") |
| 444 | auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT, cert_info = "no_cert") |
| 445 | auth_status = self.tls_flow_check(self.INTF_RX_DEFAULT, cert_info = "invalid_cert") |
| 446 | try: |
| 447 | assert_equal(auth_status, True) |
| 448 | assert_equal(status, True) |
| 449 | time.sleep(10) |
| 450 | finally: |
| 451 | self.voltha.disable_device(device_id, delete = True) |
| 452 | df.callback(0) |
| 453 | reactor.callLater(0, tls_flow_check_with_no_cert_scenario, df) |
| 454 | return df |
| 455 | |
| 456 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 457 | def test_subscriber_with_voltha_for_eap_tls_authentication_with_aaa_app_deactivation(self): |
| 458 | """ |
| 459 | Test Method: |
| 460 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 461 | 1. OLT and ONU is detected and validated. |
| 462 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 463 | 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 464 | 4. Validate that eap tls without sending client hello, it's not being exchanged between client, onos and freeradius. |
| 465 | 5. Verify that subscriber authentication is unsuccessful.. |
| 466 | """ |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 467 | df = defer.Deferred() |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 468 | def tls_flow_check_deactivating_app(df): |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 469 | aaa_app = ["org.opencord.aaa"] |
| 470 | log_test.info('Enabling ponsim_olt') |
| 471 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 472 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 473 | assert_not_equal(device_id, None) |
| 474 | voltha = VolthaCtrl(self.VOLTHA_HOST, |
| 475 | rest_port = self.VOLTHA_REST_PORT, |
| 476 | uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP) |
| 477 | time.sleep(10) |
| 478 | switch_map = None |
| 479 | olt_configured = False |
| 480 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 481 | log_test.info('Installing OLT app') |
| 482 | OnosCtrl.install_app(self.olt_app_file) |
| 483 | time.sleep(5) |
| 484 | log_test.info('Adding subscribers through OLT app') |
| 485 | self.config_olt(switch_map) |
| 486 | olt_configured = True |
| 487 | time.sleep(5) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 488 | |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 489 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT,"app_deactivate",)) |
| 490 | thread2 = threading.Thread(target = self.deactivate_apps, args = (aaa_app,)) |
| 491 | thread1.start() |
| 492 | time.sleep(randint(1,2)) |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 493 | 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] | 494 | thread2.start() |
| 495 | time.sleep(10) |
| 496 | thread1.join() |
| 497 | thread2.join() |
| 498 | try: |
| 499 | # assert_equal(status, True) |
| 500 | time.sleep(10) |
| 501 | finally: |
| 502 | self.voltha.disable_device(device_id, delete = True) |
| 503 | df.callback(0) |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 504 | reactor.callLater(0, tls_flow_check_deactivating_app, df) |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 505 | return df |
| 506 | |
| 507 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 508 | def test_subscriber_with_voltha_for_eap_tls_authentication_restarting_radius_server(self): |
| 509 | """ |
| 510 | Test Method: |
| 511 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 512 | 1. OLT and ONU is detected and validated. |
| 513 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 514 | 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 515 | 4. Validate that eap tls with restart of radius server and packets are being exchanged between subscriber, onos and freeradius. |
| 516 | 5. Verify that subscriber authentication is unsuccessful.. |
| 517 | """ |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 518 | df = defer.Deferred() |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 519 | def tls_flow_check_restarting_radius(df): |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 520 | aaa_app = ["org.opencord.aaa"] |
| 521 | log_test.info('Enabling ponsim_olt') |
| 522 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 523 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 524 | assert_not_equal(device_id, None) |
| 525 | voltha = VolthaCtrl(self.VOLTHA_HOST, |
| 526 | rest_port = self.VOLTHA_REST_PORT, |
| 527 | uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP) |
| 528 | time.sleep(10) |
| 529 | switch_map = None |
| 530 | olt_configured = False |
| 531 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 532 | log_test.info('Installing OLT app') |
| 533 | OnosCtrl.install_app(self.olt_app_file) |
| 534 | time.sleep(5) |
| 535 | log_test.info('Adding subscribers through OLT app') |
| 536 | self.config_olt(switch_map) |
| 537 | olt_configured = True |
| 538 | time.sleep(5) |
| 539 | |
| 540 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT,"restart_radius")) |
| 541 | thread2 = threading.Thread(target = cord_test_radius_restart) |
| 542 | thread1.start() |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 543 | time.sleep(randint(1,2)) |
| 544 | 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] | 545 | thread2.start() |
| 546 | time.sleep(10) |
| 547 | thread1.join() |
| 548 | thread2.join() |
| 549 | try: |
| 550 | # assert_equal(status, True) |
| 551 | time.sleep(10) |
| 552 | finally: |
| 553 | self.voltha.disable_device(device_id, delete = True) |
| 554 | df.callback(0) |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 555 | reactor.callLater(0, tls_flow_check_restarting_radius, df) |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 556 | return df |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 557 | |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 558 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 559 | def test_subscriber_with_voltha_for_eap_tls_authentication_with_disabled_olt(self): |
| 560 | """ |
| 561 | Test Method: |
| 562 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 563 | 1. OLT and ONU is detected and validated. |
| 564 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 565 | 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 566 | 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius. |
| 567 | 6. Verify that subscriber authenticated successfully. |
| 568 | 7. Disable olt which is seen in voltha and issue tls auth packets from subscriber. |
| 569 | 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius. |
| 570 | 9. Verify that subscriber authentication is unsuccessful.. |
| 571 | """ |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 572 | df = defer.Deferred() |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 573 | def tls_flow_check_operating_olt_state(df): |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 574 | aaa_app = ["org.opencord.aaa"] |
| 575 | log_test.info('Enabling ponsim_olt') |
| 576 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 577 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 578 | assert_not_equal(device_id, None) |
| 579 | voltha = VolthaCtrl(self.VOLTHA_HOST, |
| 580 | rest_port = self.VOLTHA_REST_PORT, |
| 581 | uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP) |
| 582 | time.sleep(10) |
| 583 | switch_map = None |
| 584 | olt_configured = False |
| 585 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 586 | log_test.info('Installing OLT app') |
| 587 | OnosCtrl.install_app(self.olt_app_file) |
| 588 | time.sleep(5) |
| 589 | log_test.info('Adding subscribers through OLT app') |
| 590 | self.config_olt(switch_map) |
| 591 | olt_configured = True |
| 592 | time.sleep(5) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 593 | |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 594 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT, "disable_olt_device",)) |
| 595 | thread2 = threading.Thread(target = self.voltha.disable_device, args = (device_id,)) |
| 596 | thread1.start() |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 597 | time.sleep(randint(1,2)) |
| 598 | 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] | 599 | thread2.start() |
| 600 | time.sleep(10) |
| 601 | thread1.join() |
| 602 | thread2.join() |
| 603 | try: |
| 604 | # assert_equal(status, True) |
| 605 | time.sleep(10) |
| 606 | finally: |
| 607 | self.voltha.disable_device(device_id, delete = True) |
| 608 | df.callback(0) |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 609 | reactor.callLater(0, tls_flow_check_operating_olt_state, df) |
Thangavelu K S | 0d745c8 | 2017-06-09 21:56:08 +0000 | [diff] [blame] | 610 | return df |
| 611 | |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 612 | @deferred(TESTCASE_TIMEOUT) |
| 613 | 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] | 614 | """ |
| 615 | Test Method: |
| 616 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 617 | 1. OLT and ONU is detected and validated. |
| 618 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 619 | 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 620 | 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius. |
| 621 | 6. Verify that subscriber authenticated successfully. |
| 622 | 7. Disable uni port which is seen in voltha and issue tls auth packets from subscriber. |
| 623 | 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius. |
| 624 | 9. Verify that subscriber authentication is unsuccessful.. |
| 625 | """ |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 626 | df = defer.Deferred() |
| 627 | def tls_flow_check_operating_olt_state(df): |
| 628 | aaa_app = ["org.opencord.aaa"] |
| 629 | log_test.info('Enabling ponsim_olt') |
| 630 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 631 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 632 | assert_not_equal(device_id, None) |
| 633 | voltha = VolthaCtrl(self.VOLTHA_HOST, |
| 634 | rest_port = self.VOLTHA_REST_PORT, |
| 635 | uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP) |
| 636 | time.sleep(10) |
| 637 | switch_map = None |
| 638 | olt_configured = False |
| 639 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 640 | log_test.info('Installing OLT app') |
| 641 | OnosCtrl.install_app(self.olt_app_file) |
| 642 | time.sleep(5) |
| 643 | log_test.info('Adding subscribers through OLT app') |
| 644 | self.config_olt(switch_map) |
| 645 | olt_configured = True |
| 646 | time.sleep(5) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 647 | |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 648 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT, "uni_port_admin_down",)) |
| 649 | thread2 = threading.Thread(target = self.voltha_uni_port_toggle) |
| 650 | thread1.start() |
| 651 | time.sleep(randint(1,2)) |
| 652 | log_test.info('Admin state of uni port is down and up after delay of 30 sec during tls auth flow check on voltha') |
| 653 | thread2.start() |
| 654 | time.sleep(10) |
| 655 | thread1.join() |
| 656 | thread2.join() |
| 657 | try: |
| 658 | # assert_equal(status, True) |
| 659 | time.sleep(10) |
| 660 | finally: |
| 661 | self.voltha.disable_device(device_id, delete = True) |
| 662 | df.callback(0) |
| 663 | reactor.callLater(0, tls_flow_check_operating_olt_state, df) |
| 664 | return df |
| 665 | |
| 666 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 667 | def test_subscriber_with_voltha_for_eap_tls_authentication_restarting_olt(self): |
| 668 | """ |
| 669 | Test Method: |
| 670 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 671 | 1. OLT and ONU is detected and validated. |
| 672 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 673 | 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 674 | 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius. |
| 675 | 6. Verify that subscriber authenticated successfully. |
| 676 | 7. Restart olt which is seen in voltha and issue tls auth packets from subscriber. |
| 677 | 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius. |
| 678 | 9. Verify that subscriber authentication is unsuccessful.. |
| 679 | """ |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 680 | df = defer.Deferred() |
| 681 | def tls_flow_check_operating_olt_state(df): |
| 682 | aaa_app = ["org.opencord.aaa"] |
| 683 | log_test.info('Enabling ponsim_olt') |
| 684 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 685 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 686 | assert_not_equal(device_id, None) |
| 687 | voltha = VolthaCtrl(self.VOLTHA_HOST, |
| 688 | rest_port = self.VOLTHA_REST_PORT, |
| 689 | uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP) |
| 690 | time.sleep(10) |
| 691 | switch_map = None |
| 692 | olt_configured = False |
| 693 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 694 | log_test.info('Installing OLT app') |
| 695 | OnosCtrl.install_app(self.olt_app_file) |
| 696 | time.sleep(5) |
| 697 | log_test.info('Adding subscribers through OLT app') |
| 698 | self.config_olt(switch_map) |
| 699 | olt_configured = True |
| 700 | time.sleep(5) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 701 | |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 702 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT, "restart_olt_device",)) |
| 703 | thread2 = threading.Thread(target = self.voltha.restart_device, args = (device_id,)) |
| 704 | thread1.start() |
| 705 | time.sleep(randint(1,2)) |
| 706 | log_test.info('Restart the ponsim olt device during tls auth flow check on voltha') |
| 707 | thread2.start() |
| 708 | time.sleep(10) |
| 709 | thread1.join() |
| 710 | thread2.join() |
| 711 | try: |
| 712 | # assert_equal(status, True) |
| 713 | time.sleep(10) |
| 714 | finally: |
| 715 | self.voltha.disable_device(device_id, delete = True) |
| 716 | df.callback(0) |
| 717 | reactor.callLater(0, tls_flow_check_operating_olt_state, df) |
| 718 | return df |
| 719 | |
| 720 | @deferred(TESTCASE_TIMEOUT) |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 721 | def test_subscriber_with_voltha_for_eap_tls_authentication_restarting_onu(self): |
| 722 | """ |
| 723 | Test Method: |
| 724 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 725 | 1. OLT and ONU is detected and validated. |
| 726 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 727 | 3. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 728 | 5. Validate that eap tls packets are being exchanged between subscriber, onos and freeradius. |
| 729 | 6. Verify that subscriber authenticated successfully. |
| 730 | 7. Restart onu which is seen in voltha and issue tls auth packets from subscriber. |
| 731 | 8. Validate that eap tls packets are not being exchanged between subscriber, onos and freeradius. |
| 732 | 9. Verify that subscriber authentication is unsuccessful.. |
| 733 | """ |
Thangavelu K S | b6fc1b5 | 2017-06-12 17:46:10 +0000 | [diff] [blame] | 734 | df = defer.Deferred() |
| 735 | def tls_flow_check_operating_olt_state(df): |
| 736 | aaa_app = ["org.opencord.aaa"] |
| 737 | log_test.info('Enabling ponsim_olt') |
| 738 | ponsim_address = '{}:50060'.format(self.VOLTHA_HOST) |
| 739 | device_id, status = self.voltha.enable_device('ponsim_olt', address = ponsim_address) |
| 740 | devices_list = self.voltha.get_devices() |
| 741 | onu_device_id = devices_list['items'][1]['id'] |
| 742 | assert_not_equal(device_id, None) |
| 743 | voltha = VolthaCtrl(self.VOLTHA_HOST, |
| 744 | rest_port = self.VOLTHA_REST_PORT, |
| 745 | uplink_vlan_map = self.VOLTHA_UPLINK_VLAN_MAP) |
| 746 | time.sleep(10) |
| 747 | switch_map = None |
| 748 | olt_configured = False |
| 749 | switch_map = voltha.config(fake = self.VOLTHA_CONFIG_FAKE) |
| 750 | log_test.info('Installing OLT app') |
| 751 | OnosCtrl.install_app(self.olt_app_file) |
| 752 | time.sleep(5) |
| 753 | log_test.info('Adding subscribers through OLT app') |
| 754 | self.config_olt(switch_map) |
| 755 | olt_configured = True |
| 756 | time.sleep(5) |
| 757 | devices_list = self.voltha.get_devices() |
| 758 | thread1 = threading.Thread(target = self.tls_flow_check, args = (self.INTF_RX_DEFAULT, "restart_onu_device",)) |
| 759 | thread2 = threading.Thread(target = self.voltha.restart_device, args = (onu_device_id,)) |
| 760 | thread1.start() |
| 761 | time.sleep(randint(1,2)) |
| 762 | log_test.info('Restart the ponsim oon device during tls auth flow check on voltha') |
| 763 | thread2.start() |
| 764 | time.sleep(10) |
| 765 | thread1.join() |
| 766 | thread2.join() |
| 767 | try: |
| 768 | # assert_equal(status, True) |
| 769 | time.sleep(10) |
| 770 | finally: |
| 771 | self.voltha.disable_device(device_id, delete = True) |
| 772 | df.callback(0) |
| 773 | reactor.callLater(0, tls_flow_check_operating_olt_state, df) |
| 774 | return df |
Thangavelu K S | 008f38e | 2017-05-15 19:36:55 +0000 | [diff] [blame] | 775 | |
| 776 | def test_two_subscribers_with_voltha_for_eap_tls_authentication(self): |
| 777 | """ |
| 778 | Test Method: |
| 779 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 780 | 1. OLT is detected and ONU ports(nni and 2 uni's) are being seen. |
| 781 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 782 | 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 783 | 4. Validate that eap tls valid auth packets are being exchanged between two subscriber, onos and freeradius. |
| 784 | 5. Verify that two subscribers are authenticated successfully. |
| 785 | """ |
| 786 | |
| 787 | def test_two_subscribers_with_voltha_for_eap_tls_authentication_using_same_certificates(self): |
| 788 | """ |
| 789 | Test Method: |
| 790 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 791 | 1. OLT is detected and ONU ports(nni and 2 uni's) are being seen. |
| 792 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 793 | 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 794 | 4. Validate that two valid certificates are being exchanged between two subscriber, onos and freeradius. |
| 795 | 5. Verify that two subscribers are not authenticated. |
| 796 | """ |
| 797 | |
| 798 | def test_two_subscribers_with_voltha_for_eap_tls_authentication_initiating_invalid_tls_packets_for_one_subscriber(self): |
| 799 | """ |
| 800 | Test Method: |
| 801 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 802 | 1. OLT is detected and ONU ports(nni and 2 uni's) are being seen. |
| 803 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 804 | 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 805 | 4. Validate that eap tls valid auth packets are being exchanged between valid subscriber, onos and freeradius. |
| 806 | 5. Validate that eap tls valid auth packets are being exchanged between invalid client, onos and freeradius. |
| 807 | 6. Verify that valid subscriber authenticated successfully. |
| 808 | 7. Verify that invalid subscriber are not authenticated successfully. |
| 809 | """ |
| 810 | |
| 811 | def test_two_subscribers_with_voltha_for_eap_tls_authentication_initiating_invalid_cert_for_one_subscriber(self): |
| 812 | """ |
| 813 | Test Method: |
| 814 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 815 | 1. OLT is detected and ONU ports(nni and 2 uni's) are being seen. |
| 816 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 817 | 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 818 | 4. Validate that eap tls valid auth packets are being exchanged between valid subscriber, onos and freeradius. |
| 819 | 5. Validate that eap tls invalid cert auth packets are being exchanged between invalid subscriber, onos and freeradius. |
| 820 | 6. Verify that valid subscriber authenticated successfully. |
| 821 | 7. Verify that invalid subscriber are not authenticated successfully. |
| 822 | """ |
| 823 | |
| 824 | def test_two_subscribers_with_voltha_for_eap_tls_authentication_with_one_uni_port_disabled(self): |
| 825 | """ |
| 826 | Test Method: |
| 827 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 828 | 1. OLT and ONU is detected and validated. |
| 829 | 2. Bring up freeradius server container using CORD TESTER and make sure that ONOS have connectivity to freeradius server. |
| 830 | 3. Bring up two Residential subscribers from cord-tester and issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 831 | 5. Validate that eap tls packets are being exchanged between two subscriber, onos and freeradius. |
| 832 | 6. Verify that subscriber authenticated successfully. |
| 833 | 7. Disable one of the uni port which is seen in voltha and issue tls auth packets from subscriber. |
| 834 | 8. Validate that eap tls packets are not being exchanged between one subscriber, onos and freeradius. |
| 835 | 9. Verify that subscriber authentication is unsuccessful.. |
| 836 | 10. Verify that other subscriber authenticated successfully. |
| 837 | """ |
| 838 | |
| 839 | def test_subscriber_with_voltha_for_dhcp_request(self): |
| 840 | """ |
| 841 | Test Method: |
| 842 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 843 | 1. OLT and ONU is detected and validated. |
| 844 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 845 | 3. Send dhcp request from residential subscrber to dhcp server which is running as onos app. |
| 846 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 847 | """ |
| 848 | |
| 849 | def test_subscriber_with_voltha_for_dhcp_request_with_invalid_broadcast_source_mac(self): |
| 850 | """ |
| 851 | Test Method: |
| 852 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 853 | 1. OLT and ONU is detected and validated. |
| 854 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 855 | 3. Send dhcp request with invalid source mac broadcast from residential subscrber to dhcp server which is running as onos app. |
| 856 | 4. Verify that subscriber should not get ip from dhcp server. |
| 857 | """ |
| 858 | |
| 859 | def test_subscriber_with_voltha_for_dhcp_request_with_invalid_multicast_source_mac(self): |
| 860 | """ |
| 861 | Test Method: |
| 862 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 863 | 1. OLT and ONU is detected and validated. |
| 864 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 865 | 3. Send dhcp request with invalid source mac multicast from residential subscrber to dhcp server which is running as onos app. |
| 866 | 4. Verify that subscriber should not get ip from dhcp server. |
| 867 | """ |
| 868 | |
| 869 | def test_subscriber_with_voltha_for_dhcp_request_with_invalid_source_mac(self): |
| 870 | """ |
| 871 | Test Method: |
| 872 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 873 | 1. OLT and ONU is detected and validated. |
| 874 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 875 | 3. Send dhcp request with invalid source mac zero from residential subscrber to dhcp server which is running as onos app. |
| 876 | 4. Verify that subscriber should not get ip from dhcp server. |
| 877 | """ |
| 878 | |
| 879 | def test_subscriber_with_voltha_for_dhcp_request_and_release(self): |
| 880 | """ |
| 881 | Test Method: |
| 882 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 883 | 1. OLT and ONU is detected and validated. |
| 884 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 885 | 3. Send dhcp request from residential subscrber to dhcp server which is running as onos app. |
| 886 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 887 | 5. Send dhcp release from residential subscrber to dhcp server which is running as onos app. |
| 888 | 6 Verify that subscriber should not get ip from dhcp server, ping to gateway. |
| 889 | """ |
| 890 | |
A.R Karthick | 57fa937 | 2017-05-24 12:47:03 -0700 | [diff] [blame] | 891 | def test_subscriber_with_voltha_for_dhcp_starvation_positive_scenario(self): |
Thangavelu K S | 057b7d2 | 2017-05-16 22:03:22 +0000 | [diff] [blame] | 892 | """ |
| 893 | Test Method: |
| 894 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 895 | 1. OLT and ONU is detected and validated. |
| 896 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 897 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 898 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 899 | 5. Repeat step 3 and 4 for 10 times. |
| 900 | 6 Verify that subscriber should get ip from dhcp server. |
| 901 | """ |
| 902 | |
| 903 | def test_subscriber_with_voltha_for_dhcp_starvation_negative_scenario(self): |
| 904 | """ |
| 905 | Test Method: |
| 906 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 907 | 1. OLT and ONU is detected and validated. |
| 908 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 909 | 3. Send dhcp request from residential subscriber without of pool ip to dhcp server which is running as onos app. |
| 910 | 4. Verify that subscriber should not get ip from dhcp server. |
| 911 | 5. Repeat steps 3 and 4 for 10 times. |
| 912 | 6 Verify that subscriber should not get ip from dhcp server. |
| 913 | """ |
| 914 | def test_subscriber_with_voltha_for_dhcp_sending_multiple_discover(self): |
| 915 | """ |
| 916 | Test Method: |
| 917 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 918 | 1. OLT and ONU is detected and validated. |
| 919 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 920 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 921 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 922 | 5. Repeat step 3 for 50 times. |
| 923 | 6 Verify that subscriber should get same ip which was received from 1st discover from dhcp server. |
| 924 | """ |
| 925 | def test_subscriber_with_voltha_for_dhcp_sending_multiple_request(self): |
| 926 | """ |
| 927 | Test Method: |
| 928 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 929 | 1. OLT and ONU is detected and validated. |
| 930 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 931 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 932 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 933 | 5. Send DHCP request to dhcp server which is running as onos app. |
| 934 | 6. Repeat step 5 for 50 times. |
| 935 | 7. Verify that subscriber should get same ip which was received from 1st discover from dhcp server. |
| 936 | """ |
| 937 | |
| 938 | def test_subscriber_with_voltha_for_dhcp_requesting_desired_ip_address(self): |
| 939 | """ |
| 940 | Test Method: |
| 941 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 942 | 1. OLT and ONU is detected and validated. |
| 943 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 944 | 3. Send dhcp request with desired ip address from residential subscriber to dhcp server which is running as onos app. |
| 945 | 4. Verify that subscriber get ip which was requested in step 3 from dhcp server successfully. |
| 946 | """ |
| 947 | |
| 948 | def test_subscriber_with_voltha_for_dhcp_requesting_desired_out_pool_ip_address(self): |
| 949 | """ |
| 950 | Test Method: |
| 951 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 952 | 1. OLT and ONU is detected and validated. |
| 953 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 954 | 3. Send dhcp request with desired out of pool ip address from residential subscriber to dhcp server which is running as onos app. |
| 955 | 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. |
| 956 | """ |
| 957 | def test_subscriber_with_voltha_for_dhcp_deactivate_dhcp_app_in_onos(self): |
| 958 | """ |
| 959 | Test Method: |
| 960 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 961 | 1. OLT and ONU is detected and validated. |
| 962 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 963 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 964 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 965 | 5. Deactivate dhcp server app in onos. |
| 966 | 6. Repeat step 3. |
| 967 | 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway. |
| 968 | """ |
| 969 | def test_subscriber_with_voltha_for_dhcp_renew_time(self): |
| 970 | """ |
| 971 | Test Method: |
| 972 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 973 | 1. OLT and ONU is detected and validated. |
| 974 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 975 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 976 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 977 | 5. Send dhcp renew packet to dhcp server which is running as onos app. |
| 978 | 6. Repeat step 4. |
| 979 | """ |
| 980 | def test_subscriber_with_voltha_for_dhcp_rebind_time(self): |
| 981 | """ |
| 982 | Test Method: |
| 983 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 984 | 1. OLT and ONU is detected and validated. |
| 985 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 986 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 987 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 988 | 5. Send dhcp rebind packet to dhcp server which is running as onos app. |
| 989 | 6. Repeat step 4. |
| 990 | """ |
| 991 | def test_subscriber_with_voltha_for_dhcp_disable_olt_in_voltha(self): |
| 992 | """ |
| 993 | Test Method: |
| 994 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 995 | 1. OLT and ONU is detected and validated. |
| 996 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 997 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 998 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 999 | 5. Disable olt devices which is being detected in voltha CLI. |
| 1000 | 6. Repeat step 3. |
| 1001 | 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway. |
| 1002 | """ |
| 1003 | def test_subscriber_with_voltha_for_dhcp_disable_enable_olt_in_voltha(self): |
| 1004 | """ |
| 1005 | Test Method: |
| 1006 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1007 | 1. OLT and ONU is detected and validated. |
| 1008 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1009 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 1010 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 1011 | 5. Disable olt devices which is being detected in voltha CLI. |
| 1012 | 6. Repeat step 3. |
| 1013 | 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway. |
| 1014 | 8. Enable olt devices which is being detected in voltha CLI. |
| 1015 | 9. Repeat steps 3 and 4. |
| 1016 | """ |
| 1017 | def test_subscriber_with_voltha_for_dhcp_disable_onu_port_in_voltha(self): |
| 1018 | """ |
| 1019 | Test Method: |
| 1020 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1021 | 1. OLT and ONU is detected and validated. |
| 1022 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1023 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 1024 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 1025 | 5. Disable onu port which is being detected in voltha CLI. |
| 1026 | 6. Repeat step 3. |
| 1027 | 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway. |
| 1028 | """ |
| 1029 | def test_subscriber_with_voltha_for_dhcp_disable_enable_onu_port_in_voltha(self): |
| 1030 | """ |
| 1031 | Test Method: |
| 1032 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1033 | 1. OLT and ONU is detected and validated. |
| 1034 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1035 | 3. Send dhcp request from residential subscriber to dhcp server which is running as onos app. |
| 1036 | 4. Verify that subscriber get ip from dhcp server successfully. |
| 1037 | 5. Disable onu port which is being detected in voltha CLI. |
| 1038 | 6. Repeat step 3. |
| 1039 | 7. Verify that subscriber should not get ip from dhcp server, and ping to gateway. |
| 1040 | 8. Enable onu port which is being detected in voltha CLI. |
| 1041 | 9. Repeat steps 3 and 4. |
| 1042 | """ |
| 1043 | |
| 1044 | def test_two_subscriber_with_voltha_for_dhcp_discover(self): |
| 1045 | """ |
| 1046 | Test Method: |
| 1047 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1048 | 1. OLT and ONU is detected and validated. |
| 1049 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1050 | 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app. |
| 1051 | 4. Verify that subscribers had got different ips from dhcp server successfully. |
| 1052 | """ |
| 1053 | |
| 1054 | def test_two_subscriber_with_voltha_for_dhcp_multiple_discover(self): |
| 1055 | """ |
| 1056 | Test Method: |
| 1057 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1058 | 1. OLT and ONU is detected and validated. |
| 1059 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1060 | 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app. |
| 1061 | 4. Verify that subscribers had got ip from dhcp server successfully. |
| 1062 | 5. Repeat step 3 and 4 for 10 times for both subscribers. |
| 1063 | 6 Verify that subscribers should get same ips which are offered the first time from dhcp server. |
| 1064 | """ |
| 1065 | def test_two_subscriber_with_voltha_for_dhcp_multiple_discover_for_one_subscriber(self): |
| 1066 | """ |
| 1067 | Test Method: |
| 1068 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1069 | 1. OLT and ONU is detected and validated. |
| 1070 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1071 | 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app. |
| 1072 | 4. Verify that subscribers had got ip from dhcp server successfully. |
| 1073 | 5. Repeat step 3 and 4 for 10 times for only one subscriber and ping to gateway from other subscriber. |
| 1074 | 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 |
| 1075 | """ |
| 1076 | def test_two_subscriber_with_voltha_for_dhcp_discover_desired_ip_address_for_one_subscriber(self): |
| 1077 | """ |
| 1078 | Test Method: |
| 1079 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1080 | 1. OLT and ONU is detected and validated. |
| 1081 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1082 | 3. Send dhcp request from one residential subscriber to dhcp server which is running as onos app. |
| 1083 | 3. Send dhcp request with desired ip from other residential subscriber to dhcp server which is running as onos app. |
| 1084 | 4. Verify that subscribers had got different ips (one subscriber desired ip and other subscriber random ip) from dhcp server successfully. |
| 1085 | """ |
| 1086 | def test_two_subscriber_with_voltha_for_dhcp_discover_within_and_wothout_dhcp_pool_ip_addresses(self): |
| 1087 | """ |
| 1088 | Test Method: |
| 1089 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1090 | 1. OLT and ONU is detected and validated. |
| 1091 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1092 | 3. Send dhcp request with desired wihtin dhcp pool ip from one residential subscriber to dhcp server which is running as onos app. |
| 1093 | 3. Send dhcp request with desired without in dhcp pool ip from other residential subscriber to dhcp server which is running as onos app. |
| 1094 | 4. Verify that subscribers had got different ips (both subscriber got random ips within dhcp pool) from dhcp server successfully. |
| 1095 | """ |
| 1096 | def test_two_subscriber_with_voltha_for_dhcp_disable_onu_port_for_one_subscriber(self): |
| 1097 | """ |
| 1098 | Test Method: |
| 1099 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1100 | 1. OLT and ONU is detected and validated. |
| 1101 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1102 | 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app. |
| 1103 | 4. Verify that subscribers had got ip from dhcp server successfully. |
| 1104 | 5. Disable onu port on which access one subscriber and ping to gateway from other subscriber. |
| 1105 | 6. Repeat step 3 and 4 for one subscriber where uni port is down. |
| 1106 | 7. Verify that subscriber should not get ip from dhcp server and other subscriber ping to gateway should not failed. |
| 1107 | """ |
| 1108 | def test_two_subscriber_with_voltha_for_dhcp_disable_enable_onu_port_for_one_subscriber(self): |
| 1109 | """ |
| 1110 | Test Method: |
| 1111 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1112 | 1. OLT and ONU is detected and validated. |
| 1113 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1114 | 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app. |
| 1115 | 4. Verify that subscribers had got ip from dhcp server successfully. |
| 1116 | 5. Disable onu port on which access one subscriber and ping to gateway from other subscriber. |
| 1117 | 6. Repeat step 3 and 4 for one subscriber where uni port is down. |
| 1118 | 7. Verify that subscriber should not get ip from dhcp server and other subscriber ping to gateway should not failed. |
| 1119 | 8. Enable onu port on which was disable at step 5 and ping to gateway from other subscriber. |
| 1120 | 9. Repeat step 3 and 4 for one subscriber where uni port is up now. |
| 1121 | 10. Verify that subscriber should get ip from dhcp server and other subscriber ping to gateway should not failed. |
| 1122 | """ |
| 1123 | def test_two_subscriber_with_voltha_for_dhcp_disable_olt_detected_in_voltha(self): |
| 1124 | """ |
| 1125 | Test Method: |
| 1126 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1127 | 1. OLT and ONU is detected and validated. |
| 1128 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1129 | 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app. |
| 1130 | 4. Verify that subscribers had got ip from dhcp server successfully. |
| 1131 | 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber. |
| 1132 | 6. Disable the olt device which is detected in voltha. |
| 1133 | 7. Verify that subscriber should not get ip from dhcp server and other subscriber ping to gateway should failed. |
| 1134 | """ |
| 1135 | def test_two_subscriber_with_voltha_for_dhcp_disable_enable_olt_detected_in_voltha(self): |
| 1136 | """ |
| 1137 | Test Method: |
| 1138 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1139 | 1. OLT and ONU is detected and validated. |
| 1140 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1141 | 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app. |
| 1142 | 4. Verify that subscribers had got ip from dhcp server successfully. |
| 1143 | 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber. |
| 1144 | 6. Disable the olt device which is detected in voltha. |
| 1145 | 7. Verify that subscriber should not get ip from dhcp server and other subscriber ping to gateway should failed. |
| 1146 | 8. Enable the olt device which is detected in voltha. |
| 1147 | 9. Verify that subscriber should get ip from dhcp server and other subscriber ping to gateway should not failed. |
| 1148 | """ |
| 1149 | def test_two_subscriber_with_voltha_for_dhcp_pause_olt_detected_in_voltha(self): |
| 1150 | """ |
| 1151 | Test Method: |
| 1152 | 0. Make sure that voltha is up and running on CORD-POD setup. |
| 1153 | 1. OLT and ONU is detected and validated. |
| 1154 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1155 | 3. Send dhcp request from two residential subscribers to dhcp server which is running as onos app. |
| 1156 | 4. Verify that subscribers had got ip from dhcp server successfully. |
| 1157 | 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber. |
| 1158 | 6. Pause the olt device which is detected in voltha. |
| 1159 | 7. Verify that subscriber should not get ip from dhcp server and other subscriber ping to gateway should failed. |
| 1160 | """ |
| 1161 | def test_subscriber_with_voltha_for_dhcpRelay_dhcp_request(self): |
| 1162 | """ |
| 1163 | Test Method: |
| 1164 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1165 | 1. OLT and ONU is detected and validated. |
| 1166 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1167 | 3. Send dhcp request from residential subscrber to external dhcp server. |
| 1168 | 4. Verify that subscriber get ip from external dhcp server successfully. |
| 1169 | """ |
| 1170 | |
| 1171 | def test_subscriber_with_voltha_for_dhcpRelay_dhcp_request_with_invalid_broadcast_source_mac(self): |
| 1172 | """ |
| 1173 | Test Method: |
| 1174 | 0. Make sure that voltha and external dhcp server are is up and running on CORD-POD setup. |
| 1175 | 1. OLT and ONU is detected and validated. |
| 1176 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1177 | 3. Send dhcp request with invalid source mac broadcast from residential subscrber to external dhcp server. |
| 1178 | 4. Verify that subscriber should not get ip from external dhcp server. |
| 1179 | """ |
| 1180 | |
| 1181 | def test_subscriber_with_voltha_for_dhcpRelay_dhcp_request_with_invalid_multicast_source_mac(self): |
| 1182 | """ |
| 1183 | Test Method: |
| 1184 | 0. Make sure that voltha and external dhcp server are is up and running on CORD-POD setup. |
| 1185 | 1. OLT and ONU is detected and validated. |
| 1186 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1187 | 3. Send dhcp request with invalid source mac multicast from residential subscrber to external dhcp server. |
| 1188 | 4. Verify that subscriber should not get ip from external dhcp server. |
| 1189 | """ |
| 1190 | |
| 1191 | def test_subscriber_with_voltha_for_dhcpRelay_dhcp_request_with_invalid_source_mac(self): |
| 1192 | """ |
| 1193 | Test Method: |
| 1194 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1195 | 1. OLT and ONU is detected and validated. |
| 1196 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1197 | 3. Send dhcp request with invalid source mac zero from residential subscrber to external dhcp server. |
| 1198 | 4. Verify that subscriber should not get ip from external dhcp server. |
| 1199 | """ |
| 1200 | |
| 1201 | def test_subscriber_with_voltha_for_dhcpRelay_dhcp_request_and_release(self): |
| 1202 | """ |
| 1203 | Test Method: |
| 1204 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1205 | 1. OLT and ONU is detected and validated. |
| 1206 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1207 | 3. Send dhcp request from residential subscrber to external dhcp server. |
| 1208 | 4. Verify that subscriber get ip from external dhcp server successfully. |
| 1209 | 5. Send dhcp release from residential subscrber to external dhcp server. |
| 1210 | 6 Verify that subscriber should not get ip from external dhcp server, ping to gateway. |
| 1211 | """ |
| 1212 | |
| 1213 | def test_subscriber_with_voltha_for_dhcpRelay_starvation(self): |
| 1214 | """ |
| 1215 | Test Method: |
| 1216 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1217 | 1. OLT and ONU is detected and validated. |
| 1218 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1219 | 3. Send dhcp request from residential subscriber to external dhcp server. |
| 1220 | 4. Verify that subscriber get ip from external dhcp server. successfully. |
| 1221 | 5. Repeat step 3 and 4 for 10 times. |
| 1222 | 6 Verify that subscriber should get ip from external dhcp server.. |
| 1223 | """ |
| 1224 | |
| 1225 | def test_subscriber_with_voltha_for_dhcpRelay_starvation_negative_scenario(self): |
| 1226 | """ |
| 1227 | Test Method: |
| 1228 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1229 | 1. OLT and ONU is detected and validated. |
| 1230 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1231 | 3. Send dhcp request from residential subscriber without of pool ip to external dhcp server. |
| 1232 | 4. Verify that subscriber should not get ip from external dhcp server.. |
| 1233 | 5. Repeat steps 3 and 4 for 10 times. |
| 1234 | 6 Verify that subscriber should not get ip from external dhcp server.. |
| 1235 | """ |
| 1236 | def test_subscriber_with_voltha_for_dhcpRelay_sending_multiple_discover(self): |
| 1237 | """ |
| 1238 | Test Method: |
| 1239 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1240 | 1. OLT and ONU is detected and validated. |
| 1241 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1242 | 3. Send dhcp request from residential subscriber to external dhcp server. |
| 1243 | 4. Verify that subscriber get ip from external dhcp server. successfully. |
| 1244 | 5. Repeat step 3 for 50 times. |
| 1245 | 6 Verify that subscriber should get same ip which was received from 1st discover from external dhcp server.. |
| 1246 | """ |
| 1247 | def test_subscriber_with_voltha_for_dhcpRelay_sending_multiple_request(self): |
| 1248 | """ |
| 1249 | Test Method: |
| 1250 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1251 | 1. OLT and ONU is detected and validated. |
| 1252 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1253 | 3. Send dhcp request from residential subscriber to external dhcp server. |
| 1254 | 4. Verify that subscriber get ip from external dhcp server. successfully. |
| 1255 | 5. Send DHCP request to external dhcp server. |
| 1256 | 6. Repeat step 5 for 50 times. |
| 1257 | 7. Verify that subscriber should get same ip which was received from 1st discover from external dhcp server.. |
| 1258 | """ |
| 1259 | |
| 1260 | def test_subscriber_with_voltha_for_dhcpRelay_requesting_desired_ip_address(self): |
| 1261 | """ |
| 1262 | Test Method: |
| 1263 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1264 | 1. OLT and ONU is detected and validated. |
| 1265 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1266 | 3. Send dhcp request with desired ip address from residential subscriber to external dhcp server. |
| 1267 | 4. Verify that subscriber get ip which was requested in step 3 from external dhcp server. successfully. |
| 1268 | """ |
| 1269 | |
| 1270 | def test_subscriber_with_voltha_for_dhcpRelay_requesting_desired_out_of_pool_ip_address(self): |
| 1271 | """ |
| 1272 | Test Method: |
| 1273 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1274 | 1. OLT and ONU is detected and validated. |
| 1275 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1276 | 3. Send dhcp request with desired out of pool ip address from residential subscriber to external dhcp server. |
| 1277 | 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. |
| 1278 | """ |
| 1279 | |
| 1280 | def test_subscriber_with_voltha_for_dhcpRelay_deactivating_dhcpRelay_app_in_onos(self): |
| 1281 | """ |
| 1282 | Test Method: |
| 1283 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1284 | 1. OLT and ONU is detected and validated. |
| 1285 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1286 | 3. Send dhcp request from residential subscriber to external dhcp server. |
| 1287 | 4. Verify that subscriber get ip from external dhcp server. successfully. |
| 1288 | 5. Deactivate dhcp server app in onos. |
| 1289 | 6. Repeat step 3. |
| 1290 | 7. Verify that subscriber should not get ip from external dhcp server., and ping to gateway. |
| 1291 | """ |
| 1292 | |
| 1293 | def test_subscriber_with_voltha_for_dhcpRelay_renew_time(self): |
| 1294 | """ |
| 1295 | Test Method: |
| 1296 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1297 | 1. OLT and ONU is detected and validated. |
| 1298 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1299 | 3. Send dhcp request from residential subscriber to external dhcp server. |
| 1300 | 4. Verify that subscriber get ip from external dhcp server. successfully. |
| 1301 | 5. Send dhcp renew packet to external dhcp server. |
| 1302 | 6. Repeat step 4. |
| 1303 | """ |
| 1304 | |
| 1305 | def test_subscriber_with_voltha_for_dhcpRelay_rebind_time(self): |
| 1306 | """ |
| 1307 | Test Method: |
| 1308 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1309 | 1. OLT and ONU is detected and validated. |
| 1310 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1311 | 3. Send dhcp request from residential subscriber to external dhcp server. |
| 1312 | 4. Verify that subscriber get ip from external dhcp server. successfully. |
| 1313 | 5. Send dhcp rebind packet to external dhcp server. |
| 1314 | 6. Repeat step 4. |
| 1315 | """ |
| 1316 | |
| 1317 | def test_subscriber_with_voltha_for_dhcpRelay_disable_olt_in_voltha(self): |
| 1318 | """ |
| 1319 | Test Method: |
| 1320 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1321 | 1. OLT and ONU is detected and validated. |
| 1322 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1323 | 3. Send dhcp request from residential subscriber to external dhcp server. |
| 1324 | 4. Verify that subscriber get ip from external dhcp server. successfully. |
| 1325 | 5. Disable olt devices which is being detected in voltha CLI. |
| 1326 | 6. Repeat step 3. |
| 1327 | 7. Verify that subscriber should not get ip from external dhcp server., and ping to gateway. |
| 1328 | """ |
| 1329 | |
| 1330 | def test_subscriber_with_voltha_for_dhcpRelay_toggling_olt_in_voltha(self): |
| 1331 | """ |
| 1332 | Test Method: |
| 1333 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1334 | 1. OLT and ONU is detected and validated. |
| 1335 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1336 | 3. Send dhcp request from residential subscriber to external dhcp server. |
| 1337 | 4. Verify that subscriber get ip from external dhcp server. successfully. |
| 1338 | 5. Disable olt devices which is being detected in voltha CLI. |
| 1339 | 6. Repeat step 3. |
| 1340 | 7. Verify that subscriber should not get ip from external dhcp server., and ping to gateway. |
| 1341 | 8. Enable olt devices which is being detected in voltha CLI. |
| 1342 | 9. Repeat steps 3 and 4. |
| 1343 | """ |
| 1344 | |
| 1345 | def test_subscriber_with_voltha_for_dhcpRelay_disable_onu_port_in_voltha(self): |
| 1346 | """ |
| 1347 | Test Method: |
| 1348 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1349 | 1. OLT and ONU is detected and validated. |
| 1350 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1351 | 3. Send dhcp request from residential subscriber to external dhcp server. |
| 1352 | 4. Verify that subscriber get ip from external dhcp server. successfully. |
| 1353 | 5. Disable onu port which is being detected in voltha CLI. |
| 1354 | 6. Repeat step 3. |
| 1355 | 7. Verify that subscriber should not get ip from external dhcp server., and ping to gateway. |
| 1356 | """ |
| 1357 | |
| 1358 | def test_subscriber_with_voltha_for_dhcpRelay_disable_enable_onu_port_in_voltha(self): |
| 1359 | """ |
| 1360 | Test Method: |
| 1361 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1362 | 1. OLT and ONU is detected and validated. |
| 1363 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1364 | 3. Send dhcp request from residential subscriber to external dhcp server. |
| 1365 | 4. Verify that subscriber get ip from external dhcp server. successfully. |
| 1366 | 5. Disable onu port which is being detected in voltha CLI. |
| 1367 | 6. Repeat step 3. |
| 1368 | 7. Verify that subscriber should not get ip from external dhcp server., and ping to gateway. |
| 1369 | 8. Enable onu port which is being detected in voltha CLI. |
| 1370 | 9. Repeat steps 3 and 4. |
| 1371 | """ |
| 1372 | |
| 1373 | def test_two_subscriber_with_voltha_for_dhcpRelay_discover(self): |
| 1374 | """ |
| 1375 | Test Method: |
| 1376 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1377 | 1. OLT and ONU is detected and validated. |
| 1378 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1379 | 3. Send dhcp request from two residential subscribers to external dhcp server. |
| 1380 | 4. Verify that subscribers had got different ips from external dhcp server. successfully. |
| 1381 | """ |
| 1382 | |
| 1383 | def test_two_subscriber_with_voltha_for_dhcpRelay_multiple_discover(self): |
| 1384 | """ |
| 1385 | Test Method: |
| 1386 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1387 | 1. OLT and ONU is detected and validated. |
| 1388 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1389 | 3. Send dhcp request from two residential subscribers to external dhcp server. |
| 1390 | 4. Verify that subscribers had got ip from external dhcp server. successfully. |
| 1391 | 5. Repeat step 3 and 4 for 10 times for both subscribers. |
| 1392 | 6 Verify that subscribers should get same ips which are offered the first time from external dhcp server.. |
| 1393 | """ |
| 1394 | |
| 1395 | def test_two_subscriber_with_voltha_for_dhcpRelay_multiple_discover_for_one_subscriber(self): |
| 1396 | """ |
| 1397 | Test Method: |
| 1398 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1399 | 1. OLT and ONU is detected and validated. |
| 1400 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1401 | 3. Send dhcp request from two residential subscribers to external dhcp server. |
| 1402 | 4. Verify that subscribers had got ip from external dhcp server. successfully. |
| 1403 | 5. Repeat step 3 and 4 for 10 times for only one subscriber and ping to gateway from other subscriber. |
| 1404 | 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 |
| 1405 | """ |
| 1406 | |
| 1407 | def test_two_subscriber_with_voltha_for_dhcpRelay_discover_desired_ip_address_for_one_subscriber(self): |
| 1408 | """ |
| 1409 | Test Method: |
| 1410 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1411 | 1. OLT and ONU is detected and validated. |
| 1412 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1413 | 3. Send dhcp request from one residential subscriber to external dhcp server. |
| 1414 | 3. Send dhcp request with desired ip from other residential subscriber to external dhcp server. |
| 1415 | 4. Verify that subscribers had got different ips (one subscriber desired ip and other subscriber random ip) from external dhcp server. successfully. |
| 1416 | """ |
| 1417 | |
| 1418 | def test_two_subscriber_with_voltha_for_dhcpRelay_discover_in_range_and_out_of_range_from_dhcp_pool_ip_addresses(self): |
| 1419 | """ |
| 1420 | Test Method: |
| 1421 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1422 | 1. OLT and ONU is detected and validated. |
| 1423 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1424 | 3. Send dhcp request with desired wihtin dhcp pool ip from one residential subscriber to external dhcp server. |
| 1425 | 3. Send dhcp request with desired without in dhcp pool ip from other residential subscriber to external dhcp server. |
| 1426 | 4. Verify that subscribers had got different ips (both subscriber got random ips within dhcp pool) from external dhcp server. successfully. |
| 1427 | """ |
| 1428 | |
| 1429 | def test_two_subscriber_with_voltha_for_dhcpRelay_disable_onu_port_for_one_subscriber(self): |
| 1430 | """ |
| 1431 | Test Method: |
| 1432 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1433 | 1. OLT and ONU is detected and validated. |
| 1434 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1435 | 3. Send dhcp request from two residential subscribers to external dhcp server. |
| 1436 | 4. Verify that subscribers had got ip from external dhcp server. successfully. |
| 1437 | 5. Disable onu port on which access one subscriber and ping to gateway from other subscriber. |
| 1438 | 6. Repeat step 3 and 4 for one subscriber where uni port is down. |
| 1439 | 7. Verify that subscriber should not get ip from external dhcp server. and other subscriber ping to gateway should not failed. |
| 1440 | """ |
| 1441 | |
| 1442 | def test_two_subscriber_with_voltha_for_dhcpRelay_toggle_onu_port_for_one_subscriber(self): |
| 1443 | """ |
| 1444 | Test Method: |
| 1445 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1446 | 1. OLT and ONU is detected and validated. |
| 1447 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1448 | 3. Send dhcp request from two residential subscribers to external dhcp server. |
| 1449 | 4. Verify that subscribers had got ip from external dhcp server. successfully. |
| 1450 | 5. Disable onu port on which access one subscriber and ping to gateway from other subscriber. |
| 1451 | 6. Repeat step 3 and 4 for one subscriber where uni port is down. |
| 1452 | 7. Verify that subscriber should not get ip from external dhcp server. and other subscriber ping to gateway should not failed. |
| 1453 | 8. Enable onu port on which was disable at step 5 and ping to gateway from other subscriber. |
| 1454 | 9. Repeat step 3 and 4 for one subscriber where uni port is up now. |
| 1455 | 10. Verify that subscriber should get ip from external dhcp server. and other subscriber ping to gateway should not failed. |
| 1456 | """ |
| 1457 | |
| 1458 | def test_two_subscriber_with_voltha_for_dhcpRelay_disable_olt_detected_in_voltha(self): |
| 1459 | """ |
| 1460 | Test Method: |
| 1461 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1462 | 1. OLT and ONU is detected and validated. |
| 1463 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1464 | 3. Send dhcp request from two residential subscribers to external dhcp server. |
| 1465 | 4. Verify that subscribers had got ip from external dhcp server. successfully. |
| 1466 | 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber. |
| 1467 | 6. Disable the olt device which is detected in voltha. |
| 1468 | 7. Verify that subscriber should not get ip from external dhcp server. and other subscriber ping to gateway should failed. |
| 1469 | """ |
| 1470 | |
| 1471 | def test_two_subscriber_with_voltha_for_dhcpRelay_toggle_olt_detected_in_voltha(self): |
| 1472 | """ |
| 1473 | Test Method: |
| 1474 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1475 | 1. OLT and ONU is detected and validated. |
| 1476 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1477 | 3. Send dhcp request from two residential subscribers to external dhcp server. |
| 1478 | 4. Verify that subscribers had got ip from external dhcp server. successfully. |
| 1479 | 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber. |
| 1480 | 6. Disable the olt device which is detected in voltha. |
| 1481 | 7. Verify that subscriber should not get ip from external dhcp server. and other subscriber ping to gateway should failed. |
| 1482 | 8. Enable the olt device which is detected in voltha. |
| 1483 | 9. Verify that subscriber should get ip from external dhcp server. and other subscriber ping to gateway should not failed. |
| 1484 | """ |
| 1485 | |
| 1486 | def test_two_subscriber_with_voltha_for_dhcpRelay_pause_olt_detected_in_voltha(self): |
| 1487 | """ |
| 1488 | Test Method: |
| 1489 | 0. Make sure that voltha and external dhcp server are up and running on CORD-POD setup. |
| 1490 | 1. OLT and ONU is detected and validated. |
| 1491 | 2. Issue tls auth packets from CORD TESTER voltha test module acting as a subscriber.. |
| 1492 | 3. Send dhcp request from two residential subscribers to external dhcp server. |
| 1493 | 4. Verify that subscribers had got ip from external dhcp server. successfully. |
| 1494 | 5. Start pinging continuously from one subscriber and repeat steps 3 and 4 for other subscriber. |
| 1495 | 6. Pause the olt device which is detected in voltha. |
| 1496 | 7. Verify that subscriber should not get ip from external dhcp server. and other subscriber ping to gateway should failed. |
| 1497 | """ |