Chetan Gaonker | 5241883 | 2017-01-26 23:03:13 +0000 | [diff] [blame] | 1 | #copyright 2016-present Ciena Corporation |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | # |
A R Karthick | d0fdf3b | 2017-03-21 16:54:22 -0700 | [diff] [blame] | 15 | import time |
| 16 | import os |
Chetan Gaonker | 5241883 | 2017-01-26 23:03:13 +0000 | [diff] [blame] | 17 | from nose.tools import * |
| 18 | from scapy.all import * |
A.R Karthick | 33cfdbe | 2017-03-17 18:03:48 -0700 | [diff] [blame] | 19 | from CordTestUtils import * |
Chetan Gaonker | 5241883 | 2017-01-26 23:03:13 +0000 | [diff] [blame] | 20 | from OltConfig import OltConfig |
Chetan Gaonker | 5241883 | 2017-01-26 23:03:13 +0000 | [diff] [blame] | 21 | from onosclidriver import OnosCliDriver |
A.R Karthick | 9ccd0d0 | 2017-03-16 17:11:08 -0700 | [diff] [blame] | 22 | from SSHTestAgent import SSHTestAgent |
Chetan Gaonker | 5241883 | 2017-01-26 23:03:13 +0000 | [diff] [blame] | 23 | from CordLogger import CordLogger |
A R Karthick | d0fdf3b | 2017-03-21 16:54:22 -0700 | [diff] [blame] | 24 | from VSGAccess import VSGAccess |
| 25 | |
Chetan Gaonker | 5241883 | 2017-01-26 23:03:13 +0000 | [diff] [blame] | 26 | log.setLevel('INFO') |
| 27 | |
| 28 | class vsg_exchange(CordLogger): |
| 29 | ONOS_INSTANCES = 3 |
| 30 | V_INF1 = 'veth0' |
| 31 | device_id = 'of:' + get_mac() |
Chetan Gaonker | 5241883 | 2017-01-26 23:03:13 +0000 | [diff] [blame] | 32 | TEST_IP = '8.8.8.8' |
| 33 | HOST = "10.1.0.1" |
| 34 | USER = "vagrant" |
| 35 | PASS = "vagrant" |
A.R Karthick | 9ccd0d0 | 2017-03-16 17:11:08 -0700 | [diff] [blame] | 36 | head_node = os.environ['HEAD_NODE'] |
| 37 | HEAD_NODE = head_node + '.cord.lab' if len(head_node.split('.')) == 1 else head_node |
A R Karthick | 03f40aa | 2017-03-20 19:33:55 -0700 | [diff] [blame] | 38 | test_path = os.path.dirname(os.path.realpath(__file__)) |
| 39 | olt_conf_file = os.path.join(test_path, '..', 'setup/olt_config.json') |
Chetan Gaonker | 5241883 | 2017-01-26 23:03:13 +0000 | [diff] [blame] | 40 | |
A.R Karthick | 33cfdbe | 2017-03-17 18:03:48 -0700 | [diff] [blame] | 41 | @classmethod |
| 42 | def setUpClass(cls): |
| 43 | cls.controllers = get_controllers() |
| 44 | cls.controller = cls.controllers[0] |
| 45 | cls.cli = None |
A R Karthick | 03f40aa | 2017-03-20 19:33:55 -0700 | [diff] [blame] | 46 | cls.olt = OltConfig(olt_conf_file = cls.olt_conf_file) |
| 47 | cls.vcpes = cls.olt.get_vcpes() |
| 48 | cls.vcpes_dhcp = cls.olt.get_vcpes_by_type('dhcp') |
| 49 | vcpe_dhcp = None |
| 50 | vcpe_dhcp_stag = None |
| 51 | vcpe_container = None |
| 52 | #cache the first dhcp vcpe in the class for quick testing |
| 53 | if cls.vcpes_dhcp: |
| 54 | vcpe_container = 'vcpe-{}-{}'.format(cls.vcpes_dhcp[0]['s_tag'], cls.vcpes_dhcp[0]['c_tag']) |
| 55 | vcpe_dhcp = 'vcpe0.{}.{}'.format(cls.vcpes_dhcp[0]['s_tag'], cls.vcpes_dhcp[0]['c_tag']) |
| 56 | vcpe_dhcp_stag = 'vcpe0.{}'.format(cls.vcpes_dhcp[0]['s_tag']) |
| 57 | cls.vcpe_container = vcpe_container |
| 58 | cls.vcpe_dhcp = vcpe_dhcp |
| 59 | cls.vcpe_dhcp_stag = vcpe_dhcp_stag |
A R Karthick | d0fdf3b | 2017-03-21 16:54:22 -0700 | [diff] [blame] | 60 | VSGAccess.setUp() |
Chetan Gaonker | 5241883 | 2017-01-26 23:03:13 +0000 | [diff] [blame] | 61 | |
A.R Karthick | 33cfdbe | 2017-03-17 18:03:48 -0700 | [diff] [blame] | 62 | @classmethod |
| 63 | def tearDownClass(cls): |
A R Karthick | d0fdf3b | 2017-03-21 16:54:22 -0700 | [diff] [blame] | 64 | VSGAccess.tearDown() |
Chetan Gaonker | 5241883 | 2017-01-26 23:03:13 +0000 | [diff] [blame] | 65 | |
Chetan Gaonker | 5241883 | 2017-01-26 23:03:13 +0000 | [diff] [blame] | 66 | def cliEnter(self, controller = None): |
| 67 | retries = 0 |
| 68 | while retries < 30: |
| 69 | self.cli = OnosCliDriver(controller = controller, connect = True) |
| 70 | if self.cli.handle: |
| 71 | break |
| 72 | else: |
| 73 | retries += 1 |
| 74 | time.sleep(2) |
| 75 | |
| 76 | def cliExit(self): |
| 77 | self.cli.disconnect() |
| 78 | |
| 79 | def onos_shutdown(self, controller = None): |
| 80 | status = True |
| 81 | self.cliEnter(controller = controller) |
| 82 | try: |
| 83 | self.cli.shutdown(timeout = 10) |
| 84 | except: |
| 85 | log.info('Graceful shutdown of ONOS failed for controller: %s' %controller) |
| 86 | status = False |
| 87 | |
| 88 | self.cliExit() |
| 89 | return status |
| 90 | |
A.R Karthick | 9ccd0d0 | 2017-03-16 17:11:08 -0700 | [diff] [blame] | 91 | def log_set(self, level = None, app = 'org.onosproject'): |
| 92 | CordLogger.logSet(level = level, app = app, controllers = self.controllers, forced = True) |
Chetan Gaonker | 5241883 | 2017-01-26 23:03:13 +0000 | [diff] [blame] | 93 | |
Chetan Gaonker | 5241883 | 2017-01-26 23:03:13 +0000 | [diff] [blame] | 94 | def test_vsg_vm(self): |
A R Karthick | d0fdf3b | 2017-03-21 16:54:22 -0700 | [diff] [blame] | 95 | status = VSGAccess.health_check() |
| 96 | assert_equal(status, True) |
Chetan Gaonker | 5241883 | 2017-01-26 23:03:13 +0000 | [diff] [blame] | 97 | |
| 98 | def test_vsg_for_default_route_to_vsg_vm(self): |
A.R Karthick | 9ccd0d0 | 2017-03-16 17:11:08 -0700 | [diff] [blame] | 99 | ssh_agent = SSHTestAgent(host = self.HEAD_NODE, user = self.USER, password = self.PASS) |
Chetan Gaonker | 5241883 | 2017-01-26 23:03:13 +0000 | [diff] [blame] | 100 | cmd = "sudo lxc exec testclient -- route | grep default" |
A.R Karthick | 9ccd0d0 | 2017-03-16 17:11:08 -0700 | [diff] [blame] | 101 | status, output = ssh_agent.run_cmd(cmd) |
| 102 | assert_equal(status, True) |
Chetan Gaonker | 5241883 | 2017-01-26 23:03:13 +0000 | [diff] [blame] | 103 | |
| 104 | def test_vsg_vm_for_vcpe(self): |
A R Karthick | d0fdf3b | 2017-03-21 16:54:22 -0700 | [diff] [blame] | 105 | vsgs = VSGAccess.get_vsgs() |
| 106 | compute_nodes = VSGAccess.get_compute_nodes() |
A.R Karthick | 9ccd0d0 | 2017-03-16 17:11:08 -0700 | [diff] [blame] | 107 | assert_not_equal(len(vsgs), 0) |
| 108 | assert_not_equal(len(compute_nodes), 0) |
Chetan Gaonker | 5241883 | 2017-01-26 23:03:13 +0000 | [diff] [blame] | 109 | |
| 110 | def test_vsg_for_external_connectivity(self): |
A.R Karthick | 9ccd0d0 | 2017-03-16 17:11:08 -0700 | [diff] [blame] | 111 | ssh_agent = SSHTestAgent(host = self.HEAD_NODE, user = self.USER, password = self.PASS) |
Chetan Gaonker | 5241883 | 2017-01-26 23:03:13 +0000 | [diff] [blame] | 112 | cmd = "lxc exec testclient -- ping -c 3 8.8.8.8" |
A.R Karthick | 9ccd0d0 | 2017-03-16 17:11:08 -0700 | [diff] [blame] | 113 | status, output = ssh_agent.run_cmd(cmd) |
| 114 | assert_equal( status, True) |
Chetan Gaonker | 5241883 | 2017-01-26 23:03:13 +0000 | [diff] [blame] | 115 | |
Anil Kumar Sanka | 87115b0 | 2017-03-14 17:46:47 +0000 | [diff] [blame] | 116 | def test_vsg_vm_for_login_to_vsg(self): |
A R Karthick | d0fdf3b | 2017-03-21 16:54:22 -0700 | [diff] [blame] | 117 | vsgs = VSGAccess.get_vsgs() |
| 118 | vsg_access_status = map(lambda vsg: vsg.check_access(), vsgs) |
A.R Karthick | 33cfdbe | 2017-03-17 18:03:48 -0700 | [diff] [blame] | 119 | status = filter(lambda st: st == False, vsg_access_status) |
| 120 | assert_equal(len(status), 0) |
| 121 | |
Chetan Gaonker | 1b564fe | 2017-03-21 19:19:12 +0000 | [diff] [blame] | 122 | def test_vsg_external_connectivity_sending_icmp_echo_requests(self): |
A R Karthick | 03f40aa | 2017-03-20 19:33:55 -0700 | [diff] [blame] | 123 | vcpe = self.vcpe_dhcp |
A.R Karthick | 33cfdbe | 2017-03-17 18:03:48 -0700 | [diff] [blame] | 124 | mgmt = 'eth0' |
Anil Kumar Sanka | 87115b0 | 2017-03-14 17:46:47 +0000 | [diff] [blame] | 125 | host = '8.8.8.8' |
| 126 | self.success = False |
A R Karthick | 03f40aa | 2017-03-20 19:33:55 -0700 | [diff] [blame] | 127 | assert_not_equal(vcpe, None) |
A R Karthick | d0fdf3b | 2017-03-21 16:54:22 -0700 | [diff] [blame] | 128 | vcpe_ip = VSGAccess.vcpe_get_dhcp(vcpe, mgmt = mgmt) |
A.R Karthick | 33cfdbe | 2017-03-17 18:03:48 -0700 | [diff] [blame] | 129 | assert_not_equal(vcpe_ip, None) |
| 130 | log.info('Got DHCP IP %s for %s' %(vcpe_ip, vcpe)) |
| 131 | log.info('Sending icmp echo requests to external network 8.8.8.8') |
| 132 | st, _ = getstatusoutput('ping -c 3 8.8.8.8') |
A R Karthick | d0fdf3b | 2017-03-21 16:54:22 -0700 | [diff] [blame] | 133 | VSGAccess.restore_interface_config(mgmt, vcpe = vcpe) |
A.R Karthick | 33cfdbe | 2017-03-17 18:03:48 -0700 | [diff] [blame] | 134 | assert_equal(st, 0) |
Chetan Gaonker | 5241883 | 2017-01-26 23:03:13 +0000 | [diff] [blame] | 135 | |
Anil Kumar Sanka | 87115b0 | 2017-03-14 17:46:47 +0000 | [diff] [blame] | 136 | def test_vsg_external_connectivity_pinging_to_google(self): |
| 137 | host = 'www.google.com' |
A R Karthick | 03f40aa | 2017-03-20 19:33:55 -0700 | [diff] [blame] | 138 | vcpe = self.vcpe_dhcp |
A.R Karthick | 33cfdbe | 2017-03-17 18:03:48 -0700 | [diff] [blame] | 139 | mgmt = 'eth0' |
A R Karthick | 03f40aa | 2017-03-20 19:33:55 -0700 | [diff] [blame] | 140 | assert_not_equal(vcpe, None) |
A R Karthick | d0fdf3b | 2017-03-21 16:54:22 -0700 | [diff] [blame] | 141 | vcpe_ip = VSGAccess.vcpe_get_dhcp(vcpe, mgmt = mgmt) |
A.R Karthick | 33cfdbe | 2017-03-17 18:03:48 -0700 | [diff] [blame] | 142 | assert_not_equal(vcpe_ip, None) |
| 143 | log.info('Got DHCP IP %s for %s' %(vcpe_ip, vcpe)) |
| 144 | log.info('Sending icmp ping requests to %s' %host) |
| 145 | st, _ = getstatusoutput('ping -c 1 {}'.format(host)) |
A R Karthick | d0fdf3b | 2017-03-21 16:54:22 -0700 | [diff] [blame] | 146 | VSGAccess.restore_interface_config(mgmt, vcpe = vcpe) |
A.R Karthick | 33cfdbe | 2017-03-17 18:03:48 -0700 | [diff] [blame] | 147 | assert_equal(st, 0) |
Anil Kumar Sanka | 87115b0 | 2017-03-14 17:46:47 +0000 | [diff] [blame] | 148 | |
| 149 | def test_vsg_external_connectivity_pinging_to_non_existing_website(self): |
| 150 | host = 'www.goglee.com' |
A R Karthick | 03f40aa | 2017-03-20 19:33:55 -0700 | [diff] [blame] | 151 | vcpe = self.vcpe_dhcp |
A.R Karthick | 33cfdbe | 2017-03-17 18:03:48 -0700 | [diff] [blame] | 152 | mgmt = 'eth0' |
A R Karthick | 03f40aa | 2017-03-20 19:33:55 -0700 | [diff] [blame] | 153 | assert_not_equal(vcpe, None) |
A R Karthick | d0fdf3b | 2017-03-21 16:54:22 -0700 | [diff] [blame] | 154 | vcpe_ip = VSGAccess.vcpe_get_dhcp(vcpe, mgmt = mgmt) |
A.R Karthick | 33cfdbe | 2017-03-17 18:03:48 -0700 | [diff] [blame] | 155 | assert_not_equal(vcpe_ip, None) |
| 156 | log.info('Got DHCP IP %s for %s' %(vcpe_ip, vcpe)) |
| 157 | log.info('Sending icmp ping requests to non existent host %s' %host) |
| 158 | st, _ = getstatusoutput('ping -c 1 {}'.format(host)) |
A R Karthick | d0fdf3b | 2017-03-21 16:54:22 -0700 | [diff] [blame] | 159 | VSGAccess.restore_interface_config(mgmt, vcpe = vcpe) |
A.R Karthick | 33cfdbe | 2017-03-17 18:03:48 -0700 | [diff] [blame] | 160 | assert_not_equal(st, 0) |
Anil Kumar Sanka | 87115b0 | 2017-03-14 17:46:47 +0000 | [diff] [blame] | 161 | |
| 162 | def test_vsg_external_connectivity_ping_to_google_with_ttl_1(self): |
| 163 | host = '8.8.8.8' |
A R Karthick | 03f40aa | 2017-03-20 19:33:55 -0700 | [diff] [blame] | 164 | vcpe = self.vcpe_dhcp |
A.R Karthick | 33cfdbe | 2017-03-17 18:03:48 -0700 | [diff] [blame] | 165 | mgmt = 'eth0' |
A R Karthick | 03f40aa | 2017-03-20 19:33:55 -0700 | [diff] [blame] | 166 | assert_not_equal(vcpe, None) |
A R Karthick | d0fdf3b | 2017-03-21 16:54:22 -0700 | [diff] [blame] | 167 | vcpe_ip = VSGAccess.vcpe_get_dhcp(vcpe, mgmt = mgmt) |
A.R Karthick | 33cfdbe | 2017-03-17 18:03:48 -0700 | [diff] [blame] | 168 | assert_not_equal(vcpe_ip, None) |
| 169 | log.info('Got DHCP IP %s for %s' %(vcpe_ip, vcpe)) |
| 170 | log.info('Sending icmp ping requests to host %s with ttl 1' %host) |
| 171 | st, _ = getstatusoutput('ping -c 1 -t 1 {}'.format(host)) |
A R Karthick | d0fdf3b | 2017-03-21 16:54:22 -0700 | [diff] [blame] | 172 | VSGAccess.restore_interface_config(mgmt, vcpe = vcpe) |
A.R Karthick | 33cfdbe | 2017-03-17 18:03:48 -0700 | [diff] [blame] | 173 | assert_not_equal(st, 0) |
Anil Kumar Sanka | 87115b0 | 2017-03-14 17:46:47 +0000 | [diff] [blame] | 174 | |
Chetan Gaonker | 1b564fe | 2017-03-21 19:19:12 +0000 | [diff] [blame] | 175 | def test_vsg_for_external_connectivity_with_wan_interface_toggle_in_vcpe_container(self): |
Anil Kumar Sanka | 87115b0 | 2017-03-14 17:46:47 +0000 | [diff] [blame] | 176 | host = '8.8.8.8' |
A R Karthick | 03f40aa | 2017-03-20 19:33:55 -0700 | [diff] [blame] | 177 | mgmt = 'eth0' |
| 178 | vcpe = self.vcpe_container |
| 179 | assert_not_equal(vcpe, None) |
| 180 | assert_not_equal(self.vcpe_dhcp, None) |
| 181 | #first get dhcp on the vcpe interface |
A R Karthick | d0fdf3b | 2017-03-21 16:54:22 -0700 | [diff] [blame] | 182 | vcpe_ip = VSGAccess.vcpe_get_dhcp(self.vcpe_dhcp, mgmt = mgmt) |
A R Karthick | 03f40aa | 2017-03-20 19:33:55 -0700 | [diff] [blame] | 183 | assert_not_equal(vcpe_ip, None) |
| 184 | log.info('Got DHCP IP %s for %s' %(vcpe_ip, self.vcpe_dhcp)) |
| 185 | log.info('Sending ICMP pings to host %s' %(host)) |
| 186 | st, _ = getstatusoutput('ping -c 1 {}'.format(host)) |
| 187 | if st != 0: |
A R Karthick | d0fdf3b | 2017-03-21 16:54:22 -0700 | [diff] [blame] | 188 | VSGAccess.restore_interface_config(mgmt, vcpe = self.vcpe_dhcp) |
A R Karthick | 03f40aa | 2017-03-20 19:33:55 -0700 | [diff] [blame] | 189 | assert_equal(st, 0) |
| 190 | #bring down the wan interface and check again |
A R Karthick | d0fdf3b | 2017-03-21 16:54:22 -0700 | [diff] [blame] | 191 | st = VSGAccess.vcpe_wan_down(vcpe) |
A R Karthick | 03f40aa | 2017-03-20 19:33:55 -0700 | [diff] [blame] | 192 | if st is False: |
A R Karthick | d0fdf3b | 2017-03-21 16:54:22 -0700 | [diff] [blame] | 193 | VSGAccess.restore_interface_config(mgmt, vcpe = self.vcpe_dhcp) |
A R Karthick | 03f40aa | 2017-03-20 19:33:55 -0700 | [diff] [blame] | 194 | assert_equal(st, True) |
| 195 | st, _ = getstatusoutput('ping -c 1 {}'.format(host)) |
| 196 | if st == 0: |
A R Karthick | d0fdf3b | 2017-03-21 16:54:22 -0700 | [diff] [blame] | 197 | VSGAccess.restore_interface_config(mgmt, vcpe = self.vcpe_dhcp) |
A R Karthick | 03f40aa | 2017-03-20 19:33:55 -0700 | [diff] [blame] | 198 | assert_not_equal(st, 0) |
A R Karthick | d0fdf3b | 2017-03-21 16:54:22 -0700 | [diff] [blame] | 199 | st = VSGAccess.vcpe_wan_up(vcpe) |
A R Karthick | 03f40aa | 2017-03-20 19:33:55 -0700 | [diff] [blame] | 200 | if st is False: |
A R Karthick | d0fdf3b | 2017-03-21 16:54:22 -0700 | [diff] [blame] | 201 | VSGAccess.restore_interface_config(mgmt, vcpe = self.vcpe_dhcp) |
A R Karthick | 03f40aa | 2017-03-20 19:33:55 -0700 | [diff] [blame] | 202 | assert_equal(st, True) |
| 203 | st, _ = getstatusoutput('ping -c 1 {}'.format(host)) |
A R Karthick | d0fdf3b | 2017-03-21 16:54:22 -0700 | [diff] [blame] | 204 | VSGAccess.restore_interface_config(mgmt, vcpe = self.vcpe_dhcp) |
A R Karthick | 03f40aa | 2017-03-20 19:33:55 -0700 | [diff] [blame] | 205 | assert_equal(st, 0) |
Anil Kumar Sanka | 87115b0 | 2017-03-14 17:46:47 +0000 | [diff] [blame] | 206 | |
Chetan Gaonker | 1b564fe | 2017-03-21 19:19:12 +0000 | [diff] [blame] | 207 | def test_vsg_for_external_connectivity_with_lan_interface_toggle_in_vcpe_container(self): |
Anil Kumar Sanka | 87115b0 | 2017-03-14 17:46:47 +0000 | [diff] [blame] | 208 | host = '8.8.8.8' |
A R Karthick | 03f40aa | 2017-03-20 19:33:55 -0700 | [diff] [blame] | 209 | mgmt = 'eth0' |
| 210 | vcpe = self.vcpe_container |
| 211 | assert_not_equal(vcpe, None) |
| 212 | assert_not_equal(self.vcpe_dhcp, None) |
| 213 | #first get dhcp on the vcpe interface |
A R Karthick | d0fdf3b | 2017-03-21 16:54:22 -0700 | [diff] [blame] | 214 | vcpe_ip = VSGAccess.vcpe_get_dhcp(self.vcpe_dhcp, mgmt = mgmt) |
A R Karthick | 03f40aa | 2017-03-20 19:33:55 -0700 | [diff] [blame] | 215 | assert_not_equal(vcpe_ip, None) |
| 216 | log.info('Got DHCP IP %s for %s' %(vcpe_ip, self.vcpe_dhcp)) |
| 217 | log.info('Sending ICMP pings to host %s' %(host)) |
| 218 | st, _ = getstatusoutput('ping -c 1 {}'.format(host)) |
| 219 | if st != 0: |
A R Karthick | d0fdf3b | 2017-03-21 16:54:22 -0700 | [diff] [blame] | 220 | VSGAccess.restore_interface_config(mgmt, vcpe = self.vcpe_dhcp) |
A R Karthick | 03f40aa | 2017-03-20 19:33:55 -0700 | [diff] [blame] | 221 | assert_equal(st, 0) |
| 222 | #bring down the lan interface and check again |
A R Karthick | d0fdf3b | 2017-03-21 16:54:22 -0700 | [diff] [blame] | 223 | st = VSGAccess.vcpe_lan_down(vcpe) |
A R Karthick | 03f40aa | 2017-03-20 19:33:55 -0700 | [diff] [blame] | 224 | if st is False: |
A R Karthick | d0fdf3b | 2017-03-21 16:54:22 -0700 | [diff] [blame] | 225 | VSGAccess.restore_interface_config(mgmt, vcpe = self.vcpe_dhcp) |
A R Karthick | 03f40aa | 2017-03-20 19:33:55 -0700 | [diff] [blame] | 226 | assert_equal(st, True) |
| 227 | st, _ = getstatusoutput('ping -c 1 {}'.format(host)) |
| 228 | if st == 0: |
A R Karthick | d0fdf3b | 2017-03-21 16:54:22 -0700 | [diff] [blame] | 229 | VSGAccess.restore_interface_config(mgmt, vcpe = self.vcpe_dhcp) |
A R Karthick | 03f40aa | 2017-03-20 19:33:55 -0700 | [diff] [blame] | 230 | assert_not_equal(st, 0) |
A R Karthick | d0fdf3b | 2017-03-21 16:54:22 -0700 | [diff] [blame] | 231 | st = VSGAccess.vcpe_lan_up(vcpe) |
A R Karthick | 03f40aa | 2017-03-20 19:33:55 -0700 | [diff] [blame] | 232 | if st is False: |
A R Karthick | d0fdf3b | 2017-03-21 16:54:22 -0700 | [diff] [blame] | 233 | VSGAccess.restore_interface_config(mgmt, vcpe = self.vcpe_dhcp) |
A R Karthick | 03f40aa | 2017-03-20 19:33:55 -0700 | [diff] [blame] | 234 | assert_equal(st, True) |
| 235 | st, _ = getstatusoutput('ping -c 1 {}'.format(host)) |
A R Karthick | d0fdf3b | 2017-03-21 16:54:22 -0700 | [diff] [blame] | 236 | VSGAccess.restore_interface_config(mgmt, vcpe = self.vcpe_dhcp) |
A R Karthick | 03f40aa | 2017-03-20 19:33:55 -0700 | [diff] [blame] | 237 | assert_equal(st, 0) |
Chetan Gaonker | 5241883 | 2017-01-26 23:03:13 +0000 | [diff] [blame] | 238 | |
Anil Kumar Sanka | 1213d4c | 2017-02-23 22:50:48 +0000 | [diff] [blame] | 239 | def test_vsg_for_ping_from_vsg_to_external_network(self): |
| 240 | """ |
| 241 | Algo: |
| 242 | 1.Create a vSG VM in compute node |
| 243 | 2.Ensure VM created properly |
| 244 | 3.Verify login to VM success |
| 245 | 4.Do ping to external network from vSG VM |
| 246 | 5.Verify that ping gets success |
| 247 | 6.Verify ping success flows added in OvS |
| 248 | """ |
| 249 | def test_vsg_for_ping_from_vcpe_to_external_network(self): |
| 250 | """ |
| 251 | Algo: |
| 252 | 1.Create a vSG VM in compute node |
| 253 | 2.Create a vCPE container inside VM |
| 254 | 3.Verify both VM and Container created properly |
| 255 | 4.Verify login to vCPE container success |
| 256 | 5.Do ping to external network from vCPE container |
| 257 | 6.Verify that ping gets success |
| 258 | 7.Verify ping success flows added in OvS |
| 259 | """ |
| 260 | |
Chetan Gaonker | 5241883 | 2017-01-26 23:03:13 +0000 | [diff] [blame] | 261 | def test_vsg_for_dns_service(self): |
Anil Kumar Sanka | 1213d4c | 2017-02-23 22:50:48 +0000 | [diff] [blame] | 262 | """ |
| 263 | Algo: |
| 264 | 1. Create a test client in Prod VM |
| 265 | 2. Create a vCPE container in vSG VM inside compute Node |
| 266 | 3. Ensure vSG VM and vCPE container created properly |
| 267 | 4. Enable dns service in vCPE ( if not by default ) |
| 268 | 5. Send ping request from test client to valid domain address say, 'www.google'com |
| 269 | 6. Verify that dns should resolve ping should success |
| 270 | 7. Now send ping request to invalid domain address say 'www.invalidaddress'.com' |
| 271 | 8. Verify that dns resolve should fail and hence ping |
| 272 | """ |
| 273 | def test_vsg_for_10_subscribers_for_same_service(self): |
| 274 | """ |
| 275 | Algo: |
| 276 | 1.Create a vSG VM in compute node |
| 277 | 2.Create 10 vCPE containers for 10 subscribers, in vSG VM |
| 278 | 3.Ensure vSG VM and vCPE container created properly |
| 279 | 4.From each of the subscriber, with same s-tag and different c-tag, send a ping to valid external public IP |
| 280 | 5.Verify that ping success for all 10 subscribers |
| 281 | """ |
| 282 | def test_vsg_for_10_subscribers_for_same_service_ping_invalid_ip(self): |
| 283 | """ |
| 284 | Algo: |
| 285 | 1.Create a vSG VM in compute Node |
| 286 | 2.Create 10 vCPE containers for 10 subscribers, in vSG VM |
| 287 | 3.Ensure vSG VM and vCPE container created properly |
| 288 | 4.From each of the subscriber, with same s-tag and different c-tag, send a ping to invalid IP |
| 289 | 5.Verify that ping fails for all 10 subscribers |
| 290 | """ |
| 291 | def test_vsg_for_10_subscribers_for_same_service_ping_valid_and_invalid_ip(self): |
| 292 | """ |
| 293 | Algo: |
| 294 | 1.Create a vSG VM in VM |
| 295 | 2.Create 10 vCPE containers for 10 subscribers, in vSG VM |
| 296 | 3.Ensure vSG VM and vCPE container created properly |
| 297 | 4.From first 5 subscribers, with same s-tag and different c-tag, send a ping to valid IP |
| 298 | 5.Verify that ping success for all 5 subscribers |
| 299 | 6.From next 5 subscribers, with same s-tag and different c-tag, send a ping to invalid IP |
| 300 | 7.Verify that ping fails for all 5 subscribers |
| 301 | """ |
| 302 | def test_vsg_for_100_subscribers_for_same_service(self): |
| 303 | """ |
| 304 | Algo: |
| 305 | 1.Create a vSG VM in compute node |
| 306 | 2.Create 100 vCPE containers for 100 subscribers, in vSG VM |
| 307 | 3.Ensure vSG VM and vCPE container created properly |
| 308 | 4.From each of the subscriber, with same s-tag and different c-tag, send a ping to valid external public IP |
| 309 | 5.Verify that ping success for all 100 subscribers |
| 310 | """ |
| 311 | def test_vsg_for_100_subscribers_for_same_service_ping_invalid_ip(self): |
| 312 | """ |
| 313 | Algo: |
| 314 | 1.Create a vSG VM in compute Node |
| 315 | 2.Create 10 vCPE containers for 100 subscribers, in vSG VM |
| 316 | 3.Ensure vSG VM and vCPE container created properly |
| 317 | 4.From each of the subscriber, with same s-tag and different c-tag, send a ping to invalid IP |
| 318 | 5.Verify that ping fails for all 100 subscribers |
| 319 | """ |
| 320 | def test_vsg_for_100_subscribers_for_same_service_ping_valid_and_invalid_ip(self): |
| 321 | """ |
| 322 | Algo: |
| 323 | 1.Create a vSG VM in VM |
| 324 | 2.Create 10 vCPE containers for 100 subscribers, in vSG VM |
| 325 | 3.Ensure vSG VM and vCPE container created properly |
| 326 | 4.From first 5 subscribers, with same s-tag and different c-tag, send a ping to valid IP |
| 327 | 5.Verify that ping success for all 5 subscribers |
| 328 | 6.From next 5 subscribers, with same s-tag and different c-tag, send a ping to invalid IP |
| 329 | 7.Verify that ping fails for all 5 subscribers |
| 330 | """ |
| 331 | def test_vsg_for_packet_received_with_invalid_ip_fields(self): |
| 332 | """ |
| 333 | Algo: |
| 334 | 1.Create a vSG VM in compute node |
| 335 | 2.Create a vCPE container in vSG VM |
| 336 | 3.Ensure vSG VM and vCPE container created properly |
| 337 | 4.From subscriber, send a ping packet with invalid ip fields |
| 338 | 5.Verify that vSG drops the packet |
| 339 | 6.Verify ping fails |
| 340 | """ |
| 341 | def test_vsg_for_packet_received_with_invalid_mac_fields(self): |
| 342 | """ |
| 343 | Algo: |
| 344 | 1.Create a vSG VM in compute node |
| 345 | 2.Create a vCPE container in vSG VM |
| 346 | 3.Ensure vSG VM and vCPE container created properly |
| 347 | 4.From subscriber, send a ping packet with invalid mac fields |
| 348 | 5.Verify that vSG drops the packet |
| 349 | 6.Verify ping fails |
| 350 | """ |
| 351 | def test_vsg_for_vlan_id_mismatch_in_stag(self): |
| 352 | """ |
| 353 | Algo: |
| 354 | 1.Create a vSG VM in compute Node |
| 355 | 2.Create a vCPE container in vSG VM |
| 356 | 3.Ensure vSG VM and vCPE container created properly |
| 357 | 4.Send a ping request to external valid IP from subscriber, with incorrect vlan id in s-tag and valid c-tag |
| 358 | 5.Verify that ping fails as the packet drops at VM entry |
| 359 | 6.Repeat step 4 with correct s-tag |
| 360 | 7.Verify that ping success |
| 361 | """ |
| 362 | def test_vsg_for_vlan_id_mismatch_in_ctag(self): |
| 363 | """ |
| 364 | Algo: |
| 365 | 1.Create a vSG VM in compute node |
| 366 | 2.Create a vCPE container in vSG VM |
| 367 | 3.Ensure vSG VM and vCPE container created properly |
| 368 | 4.Send a ping request to external valid IP from subscriber, with valid s-tag and incorrect vlan id in c-tag |
| 369 | 5.Verify that ping fails as the packet drops at vCPE container entry |
| 370 | 6.Repeat step 4 with valid s-tag and c-tag |
| 371 | 7.Verify that ping success |
| 372 | """ |
| 373 | def test_vsg_for_matching_and_mismatching_vlan_id_in_stag(self): |
| 374 | """ |
| 375 | Algo: |
| 376 | 1.Create two vSG VMs in compute node |
| 377 | 2.Create a vCPE container in each vSG VM |
| 378 | 3.Ensure vSG VM and vCPE container created properly |
| 379 | 4.From subscriber one, send ping request with valid s and c tags |
| 380 | 5.From subscriber two, send ping request with vlan id mismatch in s-tag and valid c tags |
| 381 | 6.Verify that ping success for only subscriber one and fails for two. |
| 382 | """ |
| 383 | def test_vsg_for_matching_and_mismatching_vlan_id_in_ctag(self): |
| 384 | """ |
| 385 | Algo: |
| 386 | 1.Create a vSG VM in compute node |
| 387 | 2.Create two vCPE containers in vSG VM |
| 388 | 3.Ensure vSG VM and vCPE container created properly |
| 389 | 4.From subscriber one, send ping request with valid s and c tags |
| 390 | 5.From subscriber two, send ping request with valid s-tag and vlan id mismatch in c-tag |
| 391 | 6.Verify that ping success for only subscriber one and fails for two |
| 392 | """ |
| 393 | def test_vsg_for_out_of_range_vlanid_in_ctag(self): |
| 394 | """ |
| 395 | Algo: |
| 396 | 1.Create a vSG VM in compute node |
| 397 | 2.Create a vCPE container in vSG VM |
| 398 | 3.Ensure vSG VM and vCPE container created properly |
| 399 | 4.From subscriber, send ping request with valid stag and vlan id in c-tag is an out of range value ( like 0,4097 ) |
| 400 | 4.Verify that ping fails as the ping packets drops at vCPE container entry |
| 401 | """ |
| 402 | def test_vsg_for_out_of_range_vlanid_in_stag(self): |
| 403 | """ |
| 404 | Algo: |
| 405 | 1.Create a vSG VM in compute node |
| 406 | 2.Create a vCPE container in vSG VM |
| 407 | 3.Ensure vSG VM and vCPE container created properly |
| 408 | 2.From subscriber, send ping request with vlan id in s-tag is an out of range value ( like 0,4097 ), with valid c-tag |
| 409 | 4.Verify that ping fails as the ping packets drops at vSG VM entry |
| 410 | """ |
| 411 | def test_vsg_without_creating_vcpe_instance(self): |
| 412 | """ |
| 413 | Algo: |
| 414 | 1.Create a vSG VM in compute Node |
| 415 | 2.Ensure vSG VM created properly |
| 416 | 3.Do not create vCPE container inside vSG VM |
| 417 | 4.From a subscriber, send ping to external valid IP |
| 418 | 5.Verify that ping fails as the ping packet drops at vSG VM entry itself. |
| 419 | """ |
| 420 | def test_vsg_for_remove_vcpe_instance(self): |
| 421 | """ |
| 422 | Algo: |
| 423 | 1.Create a vSG VM in compute node |
| 424 | 2.Create a vCPE container in vSG VM |
| 425 | 3.Ensure vSG VM and vCPE container created properly |
| 426 | 4.From subscriber, send ping request with valid s-tag and c-tag |
| 427 | 5.Verify that ping success |
| 428 | 6.Verify ping success flows in OvS switch in compute node |
| 429 | 7.Now remove the vCPE container in vSG VM |
| 430 | 8.Ensure that the container removed properly |
| 431 | 9.Repeat step 4 |
| 432 | 10.Verify that now, ping fails |
| 433 | """ |
| 434 | def test_vsg_for_restart_vcpe_instance(self): |
| 435 | """ |
| 436 | Algo: |
| 437 | 1.Create a vSG VM in compute node |
| 438 | 2.Create a vCPE container in vSG VM |
| 439 | 3.Ensure vSG VM and vCPE container created properly |
| 440 | 4.From subscriber, send ping request with valid s-tag and c-tag |
| 441 | 5.Verify that ping success |
| 442 | 6.Verify ping success flows in OvS switch in compute node |
| 443 | 7.Now restart the vCPE container in vSG VM |
| 444 | 8.Ensure that the container came up after restart |
| 445 | 9.Repeat step 4 |
| 446 | 10.Verify that now,ping gets success and flows added in OvS |
| 447 | """ |
| 448 | def test_vsg_for_restart_vsg_vm(self): |
| 449 | """ |
| 450 | Algo: |
| 451 | 1.Create a vSG VM in compute node |
| 452 | 2.Create a vCPE container in vSG VM |
| 453 | 3.Ensure vSG VM and vCPE container created properly |
| 454 | 4.From subscriber, send ping request with valid s-tag and c-tag |
| 455 | 5.Verify that ping success |
| 456 | 6.Verify ping success flows in OvS switch in compute node |
| 457 | 7.Now restart the vSG VM |
| 458 | 8.Ensure that the vSG comes up properly after restart |
| 459 | 9.Verify that vCPE container comes up after vSG restart |
| 460 | 10.Repeat step 4 |
| 461 | 11.Verify that now,ping gets success and flows added in OvS |
| 462 | """ |
| 463 | def test_vsg_for_pause_vcpe_instance(self): |
| 464 | """ |
| 465 | Algo: |
| 466 | 1.Create a vSG VM in compute node |
| 467 | 2.Create a vCPE container in vSG VM |
| 468 | 3.Ensure vSG VM and vCPE container created properly |
| 469 | 4.From subscriber, send ping request with valid s-tag and c-tag |
| 470 | 5.Verify that ping success |
| 471 | 6.Verify ping success flows in OvS switch in compute node |
| 472 | 7.Now pause vCPE container in vSG VM for a while |
| 473 | 8.Ensure that the container state is pause |
| 474 | 9.Repeat step 4 |
| 475 | 10.Verify that now,ping fails now and verify flows in OvS |
| 476 | 11.Now resume the container |
| 477 | 12.Now repeat step 4 again |
| 478 | 13.Verify that now, ping gets success |
| 479 | 14.Verify ping success flows in OvS |
| 480 | """ |
| 481 | def test_vsg_for_extract_all_compute_stats_from_all_vcpe_containers(self): |
| 482 | """ |
| 483 | Algo: |
| 484 | 1.Create a vSG VM in compute node |
| 485 | 2.Create 10 vCPE containers in VM |
| 486 | 3.Ensure vSG VM and vCPE containers created properly |
| 487 | 4.Login to all vCPE containers |
| 488 | 4.Get all compute stats from all vCPE containers |
| 489 | 5.Verify the stats # verification method need to add |
| 490 | """ |
| 491 | def test_vsg_for_extract_dns_stats_from_all_vcpe_containers(self): |
| 492 | """ |
| 493 | Algo: |
| 494 | 1.Create a vSG VM in compute node |
| 495 | 2.Create 10 vCPE containers in VM |
| 496 | 3.Ensure vSG VM and vCPE containers created properly |
| 497 | 4.From 10 subscribers, send ping to valid and invalid dns hosts |
| 498 | 5.Verify dns resolves and ping success for valid dns hosts |
| 499 | 6.Verify ping fails for invalid dns hosts |
| 500 | 7.Verify dns host name resolve flows in OvS |
| 501 | 8.Login to all 10 vCPE containers |
| 502 | 9.Extract all dns stats |
| 503 | 10.Verify dns stats for queries sent, queries received for dns host resolve success and failed scenarios |
| 504 | """ |
| 505 | def test_vsg_for_subscriber_access_two_vsg_services(self): |
| 506 | """ |
| 507 | # Intention is to verify if subscriber can reach internet via two vSG VMs |
| 508 | Algo: |
| 509 | 1.Create two vSG VMs for two services in compute node |
| 510 | 2.Create one vCPE container in each VM for one subscriber |
| 511 | 3.Ensure VMs and containers created properly |
| 512 | 4.From subscriber end, send ping to public IP with stag corresponds to vSG-1 VM and ctag |
| 513 | 5.Verify ping gets success |
| 514 | 6.Verify ping success flows in OvS |
| 515 | 7.Now repeat step 4 with stag corresponds to vSG-2 VM |
| 516 | 8.Verify that ping again success |
| 517 | 9.Verify ping success flows in OvS |
| 518 | """ |
| 519 | def test_vsg_for_subscriber_access_service2_if_service1_goes_down(self): |
| 520 | """ |
| 521 | # Intention is to verify if subscriber can reach internet via vSG2 if vSG1 goes down |
| 522 | Algo: |
| 523 | 1.Create two vSG VMs for two services in compute node |
| 524 | 2.Create one vCPE container in each VM for one subscriber |
| 525 | 3.Ensure VMs and containers created properly |
| 526 | 4.From subscriber end, send ping to public IP with stag corresponds to vSG-1 VM and ctag |
| 527 | 5.Verify ping gets success |
| 528 | 6.Verify ping success flows in OvS |
| 529 | 7.Down the vSG-1 VM |
| 530 | 8.Now repeat step 4 |
| 531 | 9.Verify that ping fails as vSG-1 is down |
| 532 | 10.Repeat step 4 with stag corresponding to vSG-2 |
| 533 | 9.Verify ping success and flows added in OvS |
| 534 | """ |
| 535 | def test_vsg_for_subscriber_access_service2_if_service1_goes_restart(self): |
| 536 | """ |
| 537 | # Intention is to verify if subscriber can reach internet via vSG2 if vSG1 restarts |
| 538 | Algo: |
| 539 | 1.Create two vSG VMs for two services in compute node |
| 540 | 2.Create one vCPE container in each VM for one subscriber |
| 541 | 3.Ensure VMs and containers created properly |
| 542 | 4.From subscriber end, send ping to public IP with stag corresponds to vSG-1 VM and ctag |
| 543 | 5.Verify ping gets success |
| 544 | 6.Verify ping success flows added in OvS |
| 545 | 7.Now restart vSG-1 VM |
| 546 | 8.Now repeat step 4 while vSG-1 VM restarts |
| 547 | 9.Verify that ping fails as vSG-1 is restarting |
| 548 | 10.Repeat step 4 with stag corresponding to vSG-2 while vSG-1 VM restarts |
| 549 | 11.Verify ping success and flows added in OvS |
| 550 | """ |
| 551 | def test_vsg_for_multiple_vcpes_in_vsg_vm_with_one_vcpe_goes_down(self): |
| 552 | """ |
| 553 | # Intention is to verify if subscriber can reach internet via vSG2 if vSG1 goes down |
| 554 | Algo: |
| 555 | 1.Create a vSG VM in compute node |
| 556 | 2.Create two vCPE containers corresponds to two subscribers in vSG VM |
| 557 | 3.Ensure VM and containers created properly |
| 558 | 4.From subscriber-1 end, send ping to public IP with ctag corresponds to vCPE-1 and stag |
| 559 | 5.Verify ping gets success |
| 560 | 6.Verify ping success flows added in OvS |
| 561 | 7.Now stop vCPE-1 container |
| 562 | 8.Now repeat step 4 |
| 563 | 9.Verify that ping fails as vCPE-1 container is down |
| 564 | 10.Repeat step 4 with ctag corresponding to vCPE-2 container |
| 565 | 11.Verify ping success and flows added in OvS |
| 566 | """ |
| 567 | def test_vsg_for_multiple_vcpes_in_vsg_vm_with_one_vcpe_restart(self): |
| 568 | """ |
| 569 | # Intention is to verify if subscriber can reach internet via vSG2 if vSG1 restarts |
| 570 | Algo: |
| 571 | 1.Create a vSG VM in compute node |
| 572 | 2.Create two vCPE containers corresponds to two subscribers in vSG VM |
| 573 | 3.Ensure VM and containers created properly |
| 574 | 4.From subscriber-1 end, send ping to public IP with ctag corresponds to vCPE-1 and stag |
| 575 | 5.Verify ping gets success |
| 576 | 6.Verify ping success flows added in OvS |
| 577 | 7.Now restart vCPE-1 container |
| 578 | 8.Now repeat step 4 while vCPE-1 restarts |
| 579 | 9.Verify that ping fails as vCPE-1 container is restarts |
| 580 | 10.Repeat step 4 with ctag corresponding to vCPE-2 container while vCPE-1 restarts |
| 581 | 11..Verify ping success and flows added in OvS |
| 582 | """ |
| 583 | def test_vsg_for_multiple_vcpes_in_vsg_vm_with_one_vcpe_pause(self): |
| 584 | """ |
| 585 | # Intention is to verify if subscriber can reach internet via vSG2 if vSG1 paused |
| 586 | Algo: |
| 587 | 1.Create a vSG VM in compute node |
| 588 | 2.Create two vCPE containers corresponds to two subscribers in vSG VM |
| 589 | 3.Ensure VM and containers created properly |
| 590 | 4.From subscriber-1 end, send ping to public IP with ctag corresponds to vCPE-1 and stag |
| 591 | 5.Verify ping gets success |
| 592 | 6.Verify ping success flows added in OvS |
| 593 | 7.Now pause vCPE-1 container |
| 594 | 8.Now repeat step 4 while vCPE-1 in pause state |
| 595 | 9.Verify that ping fails as vCPE-1 container in pause state |
| 596 | 10.Repeat step 4 with ctag corresponding to vCPE-2 container while vCPE-1 in pause state |
| 597 | 11.Verify ping success and flows added in OvS |
| 598 | """ |
| 599 | def test_vsg_for_multiple_vcpes_in_vsg_vm_with_one_vcpe_removed(self): |
| 600 | """ |
| 601 | # Intention is to verify if subscriber can reach internet via vSG2 if vSG1 removed |
| 602 | Algo: |
| 603 | 1.Create a vSG VM in compute node |
| 604 | 2.Create two vCPE containers corresponds to two subscribers in vSG VM |
| 605 | 3.Ensure VM and containers created properly |
| 606 | 4.From subscriber-1 end, send ping to public IP with ctag corresponds to vCPE-1 and stag |
| 607 | 5.Verify ping gets success |
| 608 | 6.Verify ping success flows added in OvS |
| 609 | 7.Now remove vCPE-1 container |
| 610 | 8.Now repeat step 4 |
| 611 | 9.Verify that ping fails as vCPE-1 container removed |
| 612 | 10.Repeat step 4 with ctag corresponding to vCPE-2 container |
| 613 | 11.Verify ping success and flows added in OvS |
| 614 | """ |
| 615 | def test_vsg_for_vcpe_instance_removed_and_added_again(self): |
| 616 | """ |
| 617 | Algo: |
| 618 | 1.Create a vSG VM in compute node |
| 619 | 2.Create a vCPE container in vSG VM |
| 620 | 3.Ensure VM and containers created properly |
| 621 | 4.From subscriber end, send ping to public IP |
| 622 | 5.Verify ping gets success |
| 623 | 6.Verify ping success flows added in OvS |
| 624 | 7.Now remove vCPE container in vSG VM |
| 625 | 8.Now repeat step 4 |
| 626 | 9.Verify that ping fails as vCPE container removed |
| 627 | 10.Create the vCPE container again for the same subscriber |
| 628 | 11.Ensure that vCPE created now |
| 629 | 12.Now repeat step 4 |
| 630 | 13.Verify ping success and flows added in OvS |
| 631 | """ |
| 632 | def test_vsg_for_vsg_vm_removed_and_added_again(self): |
| 633 | """ |
| 634 | Algo: |
| 635 | 1.Create a vSG VM in compute node |
| 636 | 2.Create a vCPE container in vSG VM |
| 637 | 3.Ensure VM and containers created properly |
| 638 | 4.From subscriber end, send ping to public IP |
| 639 | 5.Verify ping gets success |
| 640 | 6.Verify ping success flows added in OvS |
| 641 | 7.Now remove vSG VM |
| 642 | 8.Now repeat step 4 |
| 643 | 9.Verify that ping fails as vSG VM not exists |
| 644 | 10.Create the vSG VM and vCPE container in VM again |
| 645 | 11.Ensure that vSG and vCPE created |
| 646 | 12.Now repeat step 4 |
| 647 | 13.Verify ping success and flows added in OvS |
| 648 | """ |
| 649 | |
| 650 | #Test vSG - Subscriber Configuration |
| 651 | def test_vsg_for_configuring_new_subscriber_in_vcpe(self): |
| 652 | """ |
| 653 | Algo: |
| 654 | 1.Create a vSG VM in compute node |
| 655 | 2.Create a vCPE container in vSG VM |
| 656 | 3.Ensure VM and containers created properly |
| 657 | 4.Configure a subscriber in XOS and assign a service id |
| 658 | 5.Set the admin privileges to the subscriber |
| 659 | 6.Verify subscriber configuration is success |
| 660 | """ |
| 661 | def test_vsg_for_adding_subscriber_devices_in_vcpe(self): |
| 662 | """ |
| 663 | Algo: |
| 664 | 1.Create a vSG VM in compute node |
| 665 | 2.Create a vCPE container in vSG VM |
| 666 | 3.Ensure VM and containers created properly |
| 667 | 4.Configure a subscriber in XOS and assign a service id |
| 668 | 5.Verify subscriber successfully configured in vCPE |
| 669 | 6.Now add devices( Mac addresses ) under the subscriber admin group |
| 670 | 7.Verify all devices ( Macs ) added successfully |
| 671 | """ |
| 672 | def test_vsg_for_removing_subscriber_devices_in_vcpe(self): |
| 673 | """ |
| 674 | Algo: |
| 675 | 1.Create a vSG VM in compute node |
| 676 | 2.Create a vCPE container in vSG VM |
| 677 | 3.Ensure VM and containers created properly |
| 678 | 4.Configure a subscriber in XOS and assign a service id |
| 679 | 5.Verify subscriber successfully configured |
| 680 | 6.Now add devices( Mac addresses ) under the subscriber admin group |
| 681 | 7.Verify all devices ( Macs ) added successfully |
| 682 | 8.Now remove All the added devices in XOS |
| 683 | 9.Verify all the devices removed |
| 684 | """ |
| 685 | def test_vsg_for_modify_subscriber_devices_in_vcpe(self): |
| 686 | """ |
| 687 | Algo: |
| 688 | 1.Create a vSG VM in compute node |
| 689 | 2.Create a vCPE container in vSG VM |
| 690 | 3.Ensure VM and containers created properly |
| 691 | 4.Configure a user in XOS and assign a service id |
| 692 | 5.Verify subscriber successfully configured in vCPE. |
| 693 | 6.Now add devices( Mac addresses ) under the subscriber admin group |
| 694 | 7.Verify all devices ( Macs ) added successfully |
| 695 | 8.Now remove few devices in XOS |
| 696 | 9.Verify devices removed successfully |
| 697 | 10.Now add few additional devices in XOS under the same subscriber admin group |
| 698 | 11.Verify newly added devices successfully added |
| 699 | """ |
| 700 | def test_vsg_for_vcpe_login_fails_with_incorrect_subscriber_credentials(self): |
| 701 | """ |
| 702 | Algo: |
| 703 | 1.Create a vSG VM in compute node |
| 704 | 2.Create a vCPE container in vSG VM |
| 705 | 3.Ensure VM and containers created properly |
| 706 | 4.Configure a subscriber in XOS and assign a service id |
| 707 | 5.Verify subscriber successfully configured |
| 708 | 6.Now add devices( Mac addresses ) under the subscriber admin group |
| 709 | 7.Verify all devices ( Macs ) added successfully |
| 710 | 8.Login vCPE with credentials with which subscriber configured |
| 711 | 9.Verify subscriber successfully logged in |
| 712 | 10.Logout and login again with incorrect credentials ( either user name or password ) |
| 713 | 11.Verify login attempt to vCPE fails wtih incorrect credentials |
| 714 | """ |
| 715 | def test_vsg_for_subscriber_configuration_in_vcpe_retain_after_vcpe_restart(self): |
| 716 | """ |
| 717 | Algo: |
| 718 | 1.Create a vSG VM in compute node |
| 719 | 2.Create a vCPE container in vSG VM |
| 720 | 3.Ensure VM and containers created properly |
| 721 | 4.Configure a subscriber in XOS and assign a service id |
| 722 | 5.Verify subscriber successfully configured |
| 723 | 6.Now add devices( Mac addresses ) under the subscriber admin group |
| 724 | 7.Verify all devices ( Macs ) added successfully |
| 725 | 8.Restart vCPE ( locate backup config path while restart ) |
| 726 | 9.Verify subscriber details in vCPE after restart should be same as before the restart |
| 727 | """ |
| 728 | def test_vsg_for_create_multiple_vcpe_instances_and_configure_subscriber_in_each_instance(self): |
| 729 | """ |
| 730 | Algo: |
| 731 | 1.Create a vSG VM in compute node |
| 732 | 2.Create 2 vCPE containers in vSG VM |
| 733 | 3.Ensure VM and containers created properly |
| 734 | 4.Configure a subscriber in XOS for each vCPE instance and assign a service id |
| 735 | 5.Verify subscribers successfully configured |
| 736 | 6.Now login vCPE-2 with subscriber-1 credentials |
| 737 | 7.Verify login fails |
| 738 | 8.Now login vCPE-1 with subscriber-2 credentials |
| 739 | 9.Verify login fails |
| 740 | 10.Now login vCPE-1 with subscriber-1 and vCPE-2 with subscriber-2 credentials |
| 741 | 11.Verify that both the subscribers able to login to their respective vCPE containers |
| 742 | """ |
| 743 | def test_vsg_for_same_subscriber_can_be_configured_for_multiple_services(self): |
| 744 | """ |
| 745 | Algo: |
| 746 | 1.Create 2 vSG VMs in compute node |
| 747 | 2.Create a vCPE container in each vSG VM |
| 748 | 3.Ensure VMs and containers created properly |
| 749 | 4.Configure same subscriber in XOS for each vCPE instance and assign a service id |
| 750 | 5.Verify subscriber successfully configured |
| 751 | 6.Now login vCPE-1 with subscriber credentials |
| 752 | 7.Verify login success |
| 753 | 8.Now login vCPE-2 with the same subscriber credentials |
| 754 | 9.Verify login success |
| 755 | """ |
| 756 | |
| 757 | #Test Example Service |
| 758 | def test_vsg_for_subcriber_avail_example_service_running_in_apache_server(self): |
| 759 | """ |
| 760 | Algo: |
| 761 | 1.Create a vSG VM in compute node |
| 762 | 2.Create a vCPE container in each vSG VM |
| 763 | 3.Ensure VM and container created properly |
| 764 | 4.Configure a subscriber in XOS for the vCPE instance and assign a service id |
| 765 | 5.On-board an example service into cord pod |
| 766 | 6.Create a VM in compute node and run the example service ( Apache server ) |
| 767 | 7.Configure the example service with service specific and subscriber specific messages |
| 768 | 8.Verify example service on-boarded successfully |
| 769 | 9.Verify example service running in VM |
| 770 | 10.Run a curl command from subscriber to reach example service |
| 771 | 11.Verify subscriber can successfully reach example service via vSG |
| 772 | 12.Verify that service specific and subscriber specific messages |
| 773 | """ |
| 774 | def test_vsg_for_subcriber_avail_example_service_running_in_apache_server_after_service_restart(self): |
| 775 | """ |
| 776 | Algo: |
| 777 | 1.Create a vSG VM in compute node |
| 778 | 2.Create a vCPE container in each vSG VM |
| 779 | 3.Ensure VM and container created properly |
| 780 | 4.Configure a subscriber in XOS for the vCPE instance and assign a service id |
| 781 | 5.On-board an example service into cord pod |
| 782 | 6.Create a VM in compute node and run the example service ( Apache server ) |
| 783 | 7.Configure the example service with service specific and subscriber specific messages |
| 784 | 8.Verify example service on-boarded successfully |
| 785 | 9.Verify example service running in VM |
| 786 | 10.Run a curl command from subscriber to reach example service |
| 787 | 11.Verify subscriber can successfully reach example service via vSG |
| 788 | 12.Verify that service specific and subscriber specific messages |
| 789 | 13.Restart example service running in VM |
| 790 | 14.Repeat step 10 |
| 791 | 15.Verify the same results as mentioned in steps 11, 12 |
| 792 | """ |
| 793 | |
| 794 | #vCPE Firewall Functionality |
| 795 | def test_vsg_firewall_for_creating_acl_rule_based_on_source_ip(self): |
| 796 | """ |
| 797 | Algo: |
| 798 | 1.Create a vSG VM in compute node |
| 799 | 2.Create vCPE container in the VM |
| 800 | 3.Ensure vSG VM and vCPE container created properly |
| 801 | 4.Configure ac acl rule in vCPE to deny IP traffic from a source IP |
| 802 | 5.Bound the acl rule to WAN interface of vCPE |
| 803 | 6.Verify configuration in vCPE is success |
| 804 | 8.Verify flows added in OvS |
| 805 | """ |
| 806 | def test_vsg_firewall_for_creating_acl_rule_based_on_destination_ip(self): |
| 807 | """ |
| 808 | Algo: |
| 809 | 1.Create a vSG VM in compute node |
| 810 | 2.Create vCPE container in the VM |
| 811 | 3.Ensure vSG VM and vCPE container created properly |
| 812 | 4.Configure ac acl rule in vCPE to deny IP traffic to a destination ip |
| 813 | 5.Bound the acl rule to WAN interface of vCPE |
| 814 | 6.Verify configuration in vCPE is success |
| 815 | 8.Verify flows added in OvS |
| 816 | """ |
| 817 | def test_vsg_firewall_for_acl_deny_rule_based_on_source_ip_traffic(self): |
| 818 | """ |
| 819 | Algo: |
| 820 | 1.Create a vSG VM in compute node |
| 821 | 2.Create vCPE container in the VM |
| 822 | 3.Ensure vSG VM and vCPE container created properly |
| 823 | 4.Configure ac acl rule in vCPE to deny IP traffic from a source IP |
| 824 | 5.Bound the acl rule to WAN interface of vCPE |
| 825 | 6.From subscriber, send ping to the denied IP address |
| 826 | 7.Verify that ping fails as vCPE denies ping response |
| 827 | 8.Verify flows added in OvS |
| 828 | """ |
| 829 | def test_vsg_firewall_for_acl_deny_rule_based_on_destination_ip_traffic(self): |
| 830 | """ |
| 831 | Algo: |
| 832 | 1.Create a vSG VM in compute node |
| 833 | 2.Create vCPE container in the VM |
| 834 | 3.Ensure vSG VM and vCPE container created properly |
| 835 | 4.Configure ac acl rule in vCPE to deny IP traffic to a destination IP |
| 836 | 5.Bound the acl rule to WAN interface of vCPE |
| 837 | 6.From subscriber, send ping to the denied IP address |
| 838 | 7.Verify that ping fails as vCPE drops the ping request at WAN interface |
| 839 | 8.Verify flows added in OvS |
| 840 | """ |
Chetan Gaonker | 5241883 | 2017-01-26 23:03:13 +0000 | [diff] [blame] | 841 | |
| 842 | def test_vsg_dnsmasq(self): |
| 843 | pass |
| 844 | |
| 845 | def test_vsg_with_external_parental_control_family_shield_for_filter(self): |
| 846 | pass |
| 847 | |
| 848 | def test_vsg_with_external_parental_control_with_answerx(self): |
| 849 | pass |
| 850 | |
| 851 | def test_vsg_for_subscriber_upstream_bandwidth(self): |
| 852 | pass |
| 853 | |
| 854 | def test_vsg_for_subscriber_downstream_bandwidth(self): |
| 855 | pass |
| 856 | |
| 857 | def test_vsg_for_diagnostic_run_of_traceroute(self): |
| 858 | pass |
| 859 | |
| 860 | def test_vsg_for_diagnostic_run_of_tcpdump(self): |
| 861 | pass |
| 862 | |
| 863 | def test_vsg_for_iptable_rules(self): |
| 864 | pass |
| 865 | |
| 866 | def test_vsg_for_iptables_with_neutron(self): |
| 867 | pass |