blob: 1f9aafec8db2aa64143459d03c3940124a7a6103 [file] [log] [blame]
Chetan Gaonker52418832017-01-26 23:03:13 +00001#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 Karthickd0fdf3b2017-03-21 16:54:22 -070015import time
16import os
A.R Karthick282f0d32017-03-28 16:43:59 -070017import sys
18import json
Chetan Gaonker52418832017-01-26 23:03:13 +000019from nose.tools import *
A.R Karthick33cfdbe2017-03-17 18:03:48 -070020from CordTestUtils import *
Chetan Gaonker52418832017-01-26 23:03:13 +000021from OltConfig import OltConfig
Chetan Gaonker52418832017-01-26 23:03:13 +000022from onosclidriver import OnosCliDriver
A.R Karthick9ccd0d02017-03-16 17:11:08 -070023from SSHTestAgent import SSHTestAgent
Chetan Gaonker52418832017-01-26 23:03:13 +000024from CordLogger import CordLogger
A R Karthickd0fdf3b2017-03-21 16:54:22 -070025from VSGAccess import VSGAccess
A R Karthick933f5b52017-03-27 15:27:16 -070026from CordTestUtils import log_test as log
A.R Karthick282f0d32017-03-28 16:43:59 -070027
Chetan Gaonker52418832017-01-26 23:03:13 +000028log.setLevel('INFO')
29
30class vsg_exchange(CordLogger):
31 ONOS_INSTANCES = 3
32 V_INF1 = 'veth0'
33 device_id = 'of:' + get_mac()
Chetan Gaonker52418832017-01-26 23:03:13 +000034 TEST_IP = '8.8.8.8'
35 HOST = "10.1.0.1"
36 USER = "vagrant"
37 PASS = "vagrant"
A R Karthick63751492017-03-22 09:28:01 -070038 head_node = os.getenv('HEAD_NODE', 'prod')
A.R Karthick9ccd0d02017-03-16 17:11:08 -070039 HEAD_NODE = head_node + '.cord.lab' if len(head_node.split('.')) == 1 else head_node
A R Karthick03f40aa2017-03-20 19:33:55 -070040 test_path = os.path.dirname(os.path.realpath(__file__))
41 olt_conf_file = os.path.join(test_path, '..', 'setup/olt_config.json')
A.R Karthick282f0d32017-03-28 16:43:59 -070042 restApiXos = None
43 subscriber_account_num_base = 200
44
45 @classmethod
46 def setUpCordApi(cls):
47 our_path = os.path.dirname(os.path.realpath(__file__))
48 cord_api_path = os.path.join(our_path, '..', 'cord-api')
49 framework_path = os.path.join(cord_api_path, 'Framework')
50 utils_path = os.path.join(framework_path, 'utils')
51 data_path = os.path.join(cord_api_path, 'Tests', 'data')
52 subscriber_cfg = os.path.join(data_path, 'Subscriber.json')
53 volt_tenant_cfg = os.path.join(data_path, 'VoltTenant.json')
54
55 with open(subscriber_cfg) as f:
56 subscriber_data = json.load(f)
57 subscriber_info = subscriber_data['SubscriberInfo']
58 account_num = cls.subscriber_account_num_base
59 for subscriber in subscriber_info:
60 subscriber['identity']['account_num'] = str(account_num)
61 account_num += 1
62 cls.subscriber_info = subscriber_info
63
64 with open(volt_tenant_cfg) as f:
65 volt_tenant_data = json.load(f)
66 volt_subscriber_info = volt_tenant_data['voltSubscriberInfo']
67 assert_equal(len(volt_subscriber_info), len(cls.subscriber_info))
68 account_num = cls.subscriber_account_num_base
69 for volt_subscriber in volt_subscriber_info:
70 volt_subscriber['account_num'] = account_num
71 account_num += 1
72 cls.volt_subscriber_info = volt_subscriber_info
73
74 sys.path.append(utils_path)
75 sys.path.append(framework_path)
76 from restApi import restApi
77 restApiXos = restApi()
78 restApiXos.controllerIP = cls.HEAD_NODE
79 cls.restApiXos = restApiXos
Chetan Gaonker52418832017-01-26 23:03:13 +000080
A.R Karthick33cfdbe2017-03-17 18:03:48 -070081 @classmethod
82 def setUpClass(cls):
83 cls.controllers = get_controllers()
84 cls.controller = cls.controllers[0]
85 cls.cli = None
A R Karthick03f40aa2017-03-20 19:33:55 -070086 cls.olt = OltConfig(olt_conf_file = cls.olt_conf_file)
87 cls.vcpes = cls.olt.get_vcpes()
88 cls.vcpes_dhcp = cls.olt.get_vcpes_by_type('dhcp')
89 vcpe_dhcp = None
90 vcpe_dhcp_stag = None
91 vcpe_container = None
92 #cache the first dhcp vcpe in the class for quick testing
93 if cls.vcpes_dhcp:
94 vcpe_container = 'vcpe-{}-{}'.format(cls.vcpes_dhcp[0]['s_tag'], cls.vcpes_dhcp[0]['c_tag'])
95 vcpe_dhcp = 'vcpe0.{}.{}'.format(cls.vcpes_dhcp[0]['s_tag'], cls.vcpes_dhcp[0]['c_tag'])
96 vcpe_dhcp_stag = 'vcpe0.{}'.format(cls.vcpes_dhcp[0]['s_tag'])
97 cls.vcpe_container = vcpe_container
98 cls.vcpe_dhcp = vcpe_dhcp
99 cls.vcpe_dhcp_stag = vcpe_dhcp_stag
A R Karthickd0fdf3b2017-03-21 16:54:22 -0700100 VSGAccess.setUp()
A.R Karthick282f0d32017-03-28 16:43:59 -0700101 cls.setUpCordApi()
Chetan Gaonker52418832017-01-26 23:03:13 +0000102
A.R Karthick33cfdbe2017-03-17 18:03:48 -0700103 @classmethod
104 def tearDownClass(cls):
A R Karthickd0fdf3b2017-03-21 16:54:22 -0700105 VSGAccess.tearDown()
Chetan Gaonker52418832017-01-26 23:03:13 +0000106
Chetan Gaonker52418832017-01-26 23:03:13 +0000107 def cliEnter(self, controller = None):
108 retries = 0
109 while retries < 30:
110 self.cli = OnosCliDriver(controller = controller, connect = True)
111 if self.cli.handle:
112 break
113 else:
114 retries += 1
115 time.sleep(2)
116
117 def cliExit(self):
118 self.cli.disconnect()
119
120 def onos_shutdown(self, controller = None):
121 status = True
122 self.cliEnter(controller = controller)
123 try:
124 self.cli.shutdown(timeout = 10)
125 except:
126 log.info('Graceful shutdown of ONOS failed for controller: %s' %controller)
127 status = False
128
129 self.cliExit()
130 return status
131
A.R Karthick9ccd0d02017-03-16 17:11:08 -0700132 def log_set(self, level = None, app = 'org.onosproject'):
133 CordLogger.logSet(level = level, app = app, controllers = self.controllers, forced = True)
Chetan Gaonker52418832017-01-26 23:03:13 +0000134
A R Karthick63751492017-03-22 09:28:01 -0700135 def test_vsg_health(self):
A R Karthickd0fdf3b2017-03-21 16:54:22 -0700136 status = VSGAccess.health_check()
137 assert_equal(status, True)
Chetan Gaonker52418832017-01-26 23:03:13 +0000138
A R Karthick63751492017-03-22 09:28:01 -0700139 def test_vsg_for_vcpe(self):
A R Karthickd0fdf3b2017-03-21 16:54:22 -0700140 vsgs = VSGAccess.get_vsgs()
141 compute_nodes = VSGAccess.get_compute_nodes()
A.R Karthick9ccd0d02017-03-16 17:11:08 -0700142 assert_not_equal(len(vsgs), 0)
143 assert_not_equal(len(compute_nodes), 0)
Chetan Gaonker52418832017-01-26 23:03:13 +0000144
A R Karthick63751492017-03-22 09:28:01 -0700145 def test_vsg_for_login(self):
A R Karthickd0fdf3b2017-03-21 16:54:22 -0700146 vsgs = VSGAccess.get_vsgs()
147 vsg_access_status = map(lambda vsg: vsg.check_access(), vsgs)
A.R Karthick33cfdbe2017-03-17 18:03:48 -0700148 status = filter(lambda st: st == False, vsg_access_status)
149 assert_equal(len(status), 0)
150
A R Karthick63751492017-03-22 09:28:01 -0700151 def test_vsg_for_default_route_through_testclient(self):
152 ssh_agent = SSHTestAgent(host = self.HEAD_NODE, user = self.USER, password = self.PASS)
153 cmd = "sudo lxc exec testclient -- route | grep default"
154 status, output = ssh_agent.run_cmd(cmd)
155 assert_equal(status, True)
156
157 def test_vsg_for_external_connectivity_through_testclient(self):
158 ssh_agent = SSHTestAgent(host = self.HEAD_NODE, user = self.USER, password = self.PASS)
159 cmd = "lxc exec testclient -- ping -c 3 8.8.8.8"
160 status, output = ssh_agent.run_cmd(cmd)
161 assert_equal( status, True)
162
163 def test_vsg_for_external_connectivity(self):
A R Karthick03f40aa2017-03-20 19:33:55 -0700164 vcpe = self.vcpe_dhcp
A.R Karthick33cfdbe2017-03-17 18:03:48 -0700165 mgmt = 'eth0'
Anil Kumar Sanka87115b02017-03-14 17:46:47 +0000166 host = '8.8.8.8'
167 self.success = False
A R Karthick03f40aa2017-03-20 19:33:55 -0700168 assert_not_equal(vcpe, None)
A R Karthickd0fdf3b2017-03-21 16:54:22 -0700169 vcpe_ip = VSGAccess.vcpe_get_dhcp(vcpe, mgmt = mgmt)
A.R Karthick33cfdbe2017-03-17 18:03:48 -0700170 assert_not_equal(vcpe_ip, None)
171 log.info('Got DHCP IP %s for %s' %(vcpe_ip, vcpe))
172 log.info('Sending icmp echo requests to external network 8.8.8.8')
173 st, _ = getstatusoutput('ping -c 3 8.8.8.8')
A R Karthickd0fdf3b2017-03-21 16:54:22 -0700174 VSGAccess.restore_interface_config(mgmt, vcpe = vcpe)
A.R Karthick33cfdbe2017-03-17 18:03:48 -0700175 assert_equal(st, 0)
Chetan Gaonker52418832017-01-26 23:03:13 +0000176
A R Karthick63751492017-03-22 09:28:01 -0700177 def test_vsg_for_external_connectivity_to_google(self):
Anil Kumar Sanka87115b02017-03-14 17:46:47 +0000178 host = 'www.google.com'
A R Karthick03f40aa2017-03-20 19:33:55 -0700179 vcpe = self.vcpe_dhcp
A.R Karthick33cfdbe2017-03-17 18:03:48 -0700180 mgmt = 'eth0'
A R Karthick03f40aa2017-03-20 19:33:55 -0700181 assert_not_equal(vcpe, None)
A R Karthickd0fdf3b2017-03-21 16:54:22 -0700182 vcpe_ip = VSGAccess.vcpe_get_dhcp(vcpe, mgmt = mgmt)
A.R Karthick33cfdbe2017-03-17 18:03:48 -0700183 assert_not_equal(vcpe_ip, None)
184 log.info('Got DHCP IP %s for %s' %(vcpe_ip, vcpe))
185 log.info('Sending icmp ping requests to %s' %host)
186 st, _ = getstatusoutput('ping -c 1 {}'.format(host))
A R Karthickd0fdf3b2017-03-21 16:54:22 -0700187 VSGAccess.restore_interface_config(mgmt, vcpe = vcpe)
A.R Karthick33cfdbe2017-03-17 18:03:48 -0700188 assert_equal(st, 0)
Anil Kumar Sanka87115b02017-03-14 17:46:47 +0000189
A R Karthick63751492017-03-22 09:28:01 -0700190 def test_vsg_for_external_connectivity_to_invalid_host(self):
Anil Kumar Sanka87115b02017-03-14 17:46:47 +0000191 host = 'www.goglee.com'
A R Karthick03f40aa2017-03-20 19:33:55 -0700192 vcpe = self.vcpe_dhcp
A.R Karthick33cfdbe2017-03-17 18:03:48 -0700193 mgmt = 'eth0'
A R Karthick03f40aa2017-03-20 19:33:55 -0700194 assert_not_equal(vcpe, None)
A R Karthickd0fdf3b2017-03-21 16:54:22 -0700195 vcpe_ip = VSGAccess.vcpe_get_dhcp(vcpe, mgmt = mgmt)
A.R Karthick33cfdbe2017-03-17 18:03:48 -0700196 assert_not_equal(vcpe_ip, None)
197 log.info('Got DHCP IP %s for %s' %(vcpe_ip, vcpe))
198 log.info('Sending icmp ping requests to non existent host %s' %host)
199 st, _ = getstatusoutput('ping -c 1 {}'.format(host))
A R Karthickd0fdf3b2017-03-21 16:54:22 -0700200 VSGAccess.restore_interface_config(mgmt, vcpe = vcpe)
A.R Karthick33cfdbe2017-03-17 18:03:48 -0700201 assert_not_equal(st, 0)
Anil Kumar Sanka87115b02017-03-14 17:46:47 +0000202
A R Karthick63751492017-03-22 09:28:01 -0700203 def test_vsg_for_external_connectivity_with_ttl_1(self):
Anil Kumar Sanka87115b02017-03-14 17:46:47 +0000204 host = '8.8.8.8'
A R Karthick03f40aa2017-03-20 19:33:55 -0700205 vcpe = self.vcpe_dhcp
A.R Karthick33cfdbe2017-03-17 18:03:48 -0700206 mgmt = 'eth0'
A R Karthick03f40aa2017-03-20 19:33:55 -0700207 assert_not_equal(vcpe, None)
A R Karthickd0fdf3b2017-03-21 16:54:22 -0700208 vcpe_ip = VSGAccess.vcpe_get_dhcp(vcpe, mgmt = mgmt)
A.R Karthick33cfdbe2017-03-17 18:03:48 -0700209 assert_not_equal(vcpe_ip, None)
210 log.info('Got DHCP IP %s for %s' %(vcpe_ip, vcpe))
211 log.info('Sending icmp ping requests to host %s with ttl 1' %host)
212 st, _ = getstatusoutput('ping -c 1 -t 1 {}'.format(host))
A R Karthickd0fdf3b2017-03-21 16:54:22 -0700213 VSGAccess.restore_interface_config(mgmt, vcpe = vcpe)
A.R Karthick33cfdbe2017-03-17 18:03:48 -0700214 assert_not_equal(st, 0)
Anil Kumar Sanka87115b02017-03-14 17:46:47 +0000215
A R Karthick63751492017-03-22 09:28:01 -0700216 def test_vsg_for_external_connectivity_with_wan_interface_toggle_in_vcpe(self):
Anil Kumar Sanka87115b02017-03-14 17:46:47 +0000217 host = '8.8.8.8'
A R Karthick03f40aa2017-03-20 19:33:55 -0700218 mgmt = 'eth0'
219 vcpe = self.vcpe_container
220 assert_not_equal(vcpe, None)
221 assert_not_equal(self.vcpe_dhcp, None)
222 #first get dhcp on the vcpe interface
A R Karthickd0fdf3b2017-03-21 16:54:22 -0700223 vcpe_ip = VSGAccess.vcpe_get_dhcp(self.vcpe_dhcp, mgmt = mgmt)
A R Karthick03f40aa2017-03-20 19:33:55 -0700224 assert_not_equal(vcpe_ip, None)
225 log.info('Got DHCP IP %s for %s' %(vcpe_ip, self.vcpe_dhcp))
226 log.info('Sending ICMP pings to host %s' %(host))
227 st, _ = getstatusoutput('ping -c 1 {}'.format(host))
228 if st != 0:
A R Karthickd0fdf3b2017-03-21 16:54:22 -0700229 VSGAccess.restore_interface_config(mgmt, vcpe = self.vcpe_dhcp)
A R Karthick03f40aa2017-03-20 19:33:55 -0700230 assert_equal(st, 0)
231 #bring down the wan interface and check again
A R Karthickd0fdf3b2017-03-21 16:54:22 -0700232 st = VSGAccess.vcpe_wan_down(vcpe)
A R Karthick03f40aa2017-03-20 19:33:55 -0700233 if st is False:
A R Karthickd0fdf3b2017-03-21 16:54:22 -0700234 VSGAccess.restore_interface_config(mgmt, vcpe = self.vcpe_dhcp)
A R Karthick03f40aa2017-03-20 19:33:55 -0700235 assert_equal(st, True)
236 st, _ = getstatusoutput('ping -c 1 {}'.format(host))
237 if st == 0:
A R Karthickd0fdf3b2017-03-21 16:54:22 -0700238 VSGAccess.restore_interface_config(mgmt, vcpe = self.vcpe_dhcp)
A R Karthick03f40aa2017-03-20 19:33:55 -0700239 assert_not_equal(st, 0)
A R Karthickd0fdf3b2017-03-21 16:54:22 -0700240 st = VSGAccess.vcpe_wan_up(vcpe)
A R Karthick03f40aa2017-03-20 19:33:55 -0700241 if st is False:
A R Karthickd0fdf3b2017-03-21 16:54:22 -0700242 VSGAccess.restore_interface_config(mgmt, vcpe = self.vcpe_dhcp)
A R Karthick03f40aa2017-03-20 19:33:55 -0700243 assert_equal(st, True)
244 st, _ = getstatusoutput('ping -c 1 {}'.format(host))
A R Karthickd0fdf3b2017-03-21 16:54:22 -0700245 VSGAccess.restore_interface_config(mgmt, vcpe = self.vcpe_dhcp)
A R Karthick03f40aa2017-03-20 19:33:55 -0700246 assert_equal(st, 0)
Anil Kumar Sanka87115b02017-03-14 17:46:47 +0000247
A R Karthick63751492017-03-22 09:28:01 -0700248 def test_vsg_for_external_connectivity_with_lan_interface_toggle_in_vcpe(self):
Anil Kumar Sanka87115b02017-03-14 17:46:47 +0000249 host = '8.8.8.8'
A R Karthick03f40aa2017-03-20 19:33:55 -0700250 mgmt = 'eth0'
251 vcpe = self.vcpe_container
252 assert_not_equal(vcpe, None)
253 assert_not_equal(self.vcpe_dhcp, None)
254 #first get dhcp on the vcpe interface
A R Karthickd0fdf3b2017-03-21 16:54:22 -0700255 vcpe_ip = VSGAccess.vcpe_get_dhcp(self.vcpe_dhcp, mgmt = mgmt)
A R Karthick03f40aa2017-03-20 19:33:55 -0700256 assert_not_equal(vcpe_ip, None)
257 log.info('Got DHCP IP %s for %s' %(vcpe_ip, self.vcpe_dhcp))
258 log.info('Sending ICMP pings to host %s' %(host))
259 st, _ = getstatusoutput('ping -c 1 {}'.format(host))
260 if st != 0:
A R Karthickd0fdf3b2017-03-21 16:54:22 -0700261 VSGAccess.restore_interface_config(mgmt, vcpe = self.vcpe_dhcp)
A R Karthick03f40aa2017-03-20 19:33:55 -0700262 assert_equal(st, 0)
263 #bring down the lan interface and check again
A R Karthickd0fdf3b2017-03-21 16:54:22 -0700264 st = VSGAccess.vcpe_lan_down(vcpe)
A R Karthick03f40aa2017-03-20 19:33:55 -0700265 if st is False:
A R Karthickd0fdf3b2017-03-21 16:54:22 -0700266 VSGAccess.restore_interface_config(mgmt, vcpe = self.vcpe_dhcp)
A R Karthick03f40aa2017-03-20 19:33:55 -0700267 assert_equal(st, True)
268 st, _ = getstatusoutput('ping -c 1 {}'.format(host))
269 if st == 0:
A R Karthickd0fdf3b2017-03-21 16:54:22 -0700270 VSGAccess.restore_interface_config(mgmt, vcpe = self.vcpe_dhcp)
A R Karthick03f40aa2017-03-20 19:33:55 -0700271 assert_not_equal(st, 0)
A R Karthickd0fdf3b2017-03-21 16:54:22 -0700272 st = VSGAccess.vcpe_lan_up(vcpe)
A R Karthick03f40aa2017-03-20 19:33:55 -0700273 if st is False:
A R Karthickd0fdf3b2017-03-21 16:54:22 -0700274 VSGAccess.restore_interface_config(mgmt, vcpe = self.vcpe_dhcp)
A R Karthick03f40aa2017-03-20 19:33:55 -0700275 assert_equal(st, True)
276 st, _ = getstatusoutput('ping -c 1 {}'.format(host))
A R Karthickd0fdf3b2017-03-21 16:54:22 -0700277 VSGAccess.restore_interface_config(mgmt, vcpe = self.vcpe_dhcp)
A R Karthick03f40aa2017-03-20 19:33:55 -0700278 assert_equal(st, 0)
Chetan Gaonker52418832017-01-26 23:03:13 +0000279
Anil Kumar Sankad47023a2017-03-29 21:11:09 +0000280 def test_vsg_firewall_with_deny_destination_ip(self, vcpe=None):
281 host = '8.8.8.8'
282 if not vcpe:
283 vcpe = self.vcpe_container
284 vsg = VSGAccess.get_vcpe_vsg(vcpe)
285 st, _ = getstatusoutput('ping -c 1 {}'.format(host))
286 assert_equal(st, False)
287 try:
288 st, _ = vsg.run_cmd('sudo docker exec {} iptables -I FORWARD -d {} -j DROP'.format(vcpe,host))
289 st, _ = getstatusoutput('ping -c 1 {}'.format(host))
290 assert_equal(st, True)
291 finally:
292 vsg.run_cmd('sudo docker exec {} iptables -F'.format(vcpe))
293 vsg.run_cmd('sudo docker exec {} iptables -X'.format(vcpe))
294
295 def test_vsg_firewall_with_rule_add_and_delete_dest_ip(self, vcpe=None):
296 host = '8.8.8.8'
297 if not vcpe:
298 vcpe = self.vcpe_container
299 vsg = VSGAccess.get_vcpe_vsg(vcpe)
300 st, _ = getstatusoutput('ping -c 1 {}'.format(host))
301 assert_equal(st, False)
302 try:
303 st,output = vsg.run_cmd('sudo docker exec {} iptables -I FORWARD -d {} -j DROP'.format(vcpe,host))
304 st, _ = getstatusoutput('ping -c 1 {}'.format(host))
305 assert_equal(st, True)
306 st,_ = vsg.run_cmd('sudo docker exec {} iptables -D FORWARD -d {} -j DROP'.format(vcpe,host))
307 st, _ = getstatusoutput('ping -c 1 {}'.format(host))
308 assert_equal(st,False)
309 finally:
310 vsg.run_cmd('sudo docker exec {} iptables -F'.format(vcpe))
311 vsg.run_cmd('sudo docker exec {} iptables -X'.format(vcpe))
312
313 def test_vsg_firewall_verifying_reachability_for_non_blocked_dest_ip(self, vcpe=None):
314 host1 = '8.8.8.8'
315 host2 = '204.79.197.203'
316 if not vcpe:
317 vcpe = self.vcpe_container
318 vsg = VSGAccess.get_vcpe_vsg(vcpe)
319 st, _ = getstatusoutput('ping -c 1 {}'.format(host1))
320 assert_equal(st, False)
321 try:
322 st, _ = vsg.run_cmd('sudo docker exec {} iptables -I FORWARD -d {} -j DROP'.format(vcpe,host1))
323 st, _ = getstatusoutput('ping -c 1 {}'.format(host1))
324 assert_equal(st, True)
325 st, _ = getstatusoutput('ping -c 1 {}'.format(host2))
326 assert_equal(st,False)
327 finally:
328 vsg.run_cmd('sudo docker exec {} iptables -F'.format(vcpe))
329 vsg.run_cmd('sudo docker exec {} iptables -X'.format(vcpe))
330
331 def test_vsg_firewall_appending_rules_with_deny_dest_ip(self, vcpe=None):
332 host1 = '8.8.8.8'
333 host2 = '204.79.197.203'
334 if not vcpe:
335 vcpe = self.vcpe_container
336 vsg = VSGAccess.get_vcpe_vsg(vcpe)
337 st, _ = getstatusoutput('ping -c 1 {}'.format(host1))
338 assert_equal(st, False)
339 try:
340 st,output = vsg.run_cmd('sudo docker exec {} iptables -I FORWARD -d {} -j DROP'.format(vcpe,host1))
341 st, _ = getstatusoutput('ping -c 1 {}'.format(host1))
342 assert_equal(st, True)
343 st, _ = getstatusoutput('ping -c 1 {}'.format(host2))
344 assert_equal(st, False)
345 st, _ = vsg.run_cmd('sudo docker exec {} iptables -I FORWARD -d {} -j DROP'.format(vcpe,host2))
346 st, _ = getstatusoutput('ping -c 1 {}'.format(host2))
347 assert_equal(st,True)
348 finally:
349 vsg.run_cmd('sudo docker exec {} iptables -F'.format(vcpe))
350 vsg.run_cmd('sudo docker exec {} iptables -X'.format(vcpe))
351
352 def test_vsg_firewall_removing_one_rule_denying_dest_ip(self, vcpe=None):
353 host1 = '8.8.8.8'
354 host2 = '204.79.197.203'
355 if not vcpe:
356 vcpe = self.vcpe_container
357 vsg = VSGAccess.get_vcpe_vsg(vcpe)
358 st, _ = getstatusoutput('ping -c 1 {}'.format(host1))
359 assert_equal(st, False)
360 try:
361 st,output = vsg.run_cmd('sudo docker exec {} iptables -I FORWARD -d {} -j DROP'.format(vcpe,host1))
362 st,output = vsg.run_cmd('sudo docker exec {} iptables -I FORWARD -d {} -j DROP'.format(vcpe,host2))
363 st, _ = getstatusoutput('ping -c 1 {}'.format(host1))
364 assert_equal(st, True)
365 st, _ = getstatusoutput('ping -c 1 {}'.format(host2))
366 assert_equal(st,True)
367 st,output = vsg.run_cmd('sudo docker exec {} iptables -D FORWARD -d {} -j DROP'.format(vcpe,host2))
368 st, _ = getstatusoutput('ping -c 1 {}'.format(host2))
369 assert_equal(st,False)
370 finally:
371 vsg.run_cmd('sudo docker exec {} iptables -F'.format(vcpe))
372 vsg.run_cmd('sudo docker exec {} iptables -X'.format(vcpe))
373
374 def test_vsg_firewall_changing_rule_id_deny_dest_ip(self, vcpe=None):
375 host = '8.8.8.8'
376 if not vcpe:
377 vcpe = self.vcpe_container
378 vsg = VSGAccess.get_vcpe_vsg(vcpe)
379 st, _ = getstatusoutput('ping -c 1 {}'.format(host))
380 assert_equal(st, False)
381 try:
382 st,output = vsg.run_cmd('sudo docker exec {} iptables -I FORWARD -d {} -j DROP'.format(vcpe,host))
383 st, _ = getstatusoutput('ping -c 1 {}'.format(host))
384 assert_equal(st, True)
385 st,output = vsg.run_cmd('sudo docker exec {} iptables -I FORWARD -j ACCEPT 2'.format(vcpe))
386 st,output = vsg.run_cmd('sudo docker exec {} iptables -A FORWARD 2 -d {} -j DROP '.format(vcpe,host))
387 st, _ = getstatusoutput('ping -c 1 {}'.format(host))
388 assert_equal(st,False)
389 finally:
390 vsg.run_cmd('sudo docker exec {} iptables -F'.format(vcpe))
391 vsg.run_cmd('sudo docker exec {} iptables -X'.format(vcpe))
392
393 def test_vsg_firewall_changing_deny_rule_to_accept_dest_ip(self, vcpe=None):
394 host1 = '8.8.8.8'
395 host2 = '204.79.197.203'
396 if not vcpe:
397 vcpe = self.vcpe_container
398 vsg = VSGAccess.get_vcpe_vsg(vcpe)
399 st, _ = getstatusoutput('ping -c 1 {}'.format(host))
400 assert_equal(st, False)
401 try:
402 st,output = vsg.run_cmd('sudo docker exec {} iptables -I FORWARD -d {} -j DROP'.format(vcpe,host))
403 st, _ = getstatusoutput('ping -c 1 {}'.format(host))
404 assert_equal(st, True)
405 st,output = vsg.run_cmd('sudo docker exec {} iptables -A FORWARD -d {} -j ACCEPT 1'.format(vcpe,host))
406 st, _ = getstatusoutput('ping -c 1 {}'.format(host))
407 assert_equal(st,False)
408 finally:
409 vsg.run_cmd('sudo docker exec {} iptables -F'.format(vcpe))
410 vsg.run_cmd('sudo docker exec {} iptables -X'.format(vcpe))
411
412 def test_vsg_firewall_denying_destination_network(self, vcpe=None):
413 network = '206.190.36.44/28'
414 host1 = '204.79.197.46'
415 host2 = '204.79.197.51'
416 if not vcpe:
417 vcpe = self.vcpe_container
418 vsg = VSGAccess.get_vcpe_vsg(vcpe)
419 st, _ = getstatusoutput('ping -c 1 {}'.format(host1))
420 assert_equal(st, False)
421 try:
422 st,output = vsg.run_cmd('sudo docker exec {} iptables -I FORWARD -d {} -j DROP'.format(vcpe,network))
423 st, _ = getstatusoutput('ping -c 1 {}'.format(host1))
424 assert_equal(st, True)
425 st, _ = getstatusoutput('ping -c 1 {}'.format(host2))
426 assert_equal(st,False)
427 finally:
428 vsg.run_cmd('sudo docker exec {} iptables -F'.format(vcpe))
429
430 def test_vsg_firewall_denying_destination_network_subnet_modification(self, vcpe=None):
431 network1 = '206.190.36.44/28'
432 network2 = '206.190.36.44/26'
433 host1 = '204.79.197.46'
434 host2 = '204.79.197.51'
435 host2 = '204.79.197.63'
436 if not vcpe:
437 vcpe = self.vcpe_container
438 vsg = VSGAccess.get_vcpe_vsg(vcpe)
439 st, _ = getstatusoutput('ping -c 1 {}'.format(host1))
440 assert_equal(st, False)
441 try:
442 st,output = vsg.run_cmd('sudo docker exec {} iptables -I FORWARD -d {} -j DROP'.format(vcpe,network1))
443 st, _ = getstatusoutput('ping -c 1 {}'.format(host1))
444 assert_equal(st, True)
445 st, _ = getstatusoutput('ping -c 1 {}'.format(host2))
446 assert_equal(st,False)
447 st,output = vsg.run_cmd('sudo docker exec {} iptables -A FORWARD -d {} -j DROP'.format(vcpe,network2))
448 st, _ = getstatusoutput('ping -c 1 {}'.format(host1))
449 assert_equal(st, True)
450 st, _ = getstatusoutput('ping -c 1 {}'.format(host2))
451 assert_equal(st, True)
452 st, _ = getstatusoutput('ping -c 1 {}'.format(host3))
453 assert_equal(st, False)
454 finally:
455 vsg.run_cmd('sudo docker exec {} iptables -F'.format(vcpe))
456
457 def test_vsg_firewall_with_deny_source_ip(self, vcpe=None):
458 host = '8.8.8.8'
459 source_ip = self.vcpe_dhcp
460 if not vcpe:
461 vcpe = self.vcpe_container
462 vsg = VSGAccess.get_vcpe_vsg(vcpe)
463 st, _ = getstatusoutput('ping -c 1 {}'.format(host))
464 assert_equal(st, False)
465 try:
466 st, _ = vsg.run_cmd('sudo docker exec {} iptables -I FORWARD -s {} -j DROP'.format(vcpe,source_ip))
467 st, _ = getstatusoutput('ping -c 1 {}'.format(host))
468 assert_equal(st, True)
469 finally:
470 vsg.run_cmd('sudo docker exec {} iptables -F'.format(vcpe))
471
472 def test_vsg_firewall_rule_with_add_and_delete_deny_source_ip(self, vcpe=None):
473 host = '8.8.8.8'
474 source_ip = self.vcpe_dhcp
475 if not vcpe:
476 vcpe = self.vcpe_container
477 vsg = VSGAccess.get_vcpe_vsg(vcpe)
478 st, _ = getstatusoutput('ping -c 1 {}'.format(host))
479 assert_equal(st, False)
480 try:
481 st, _ = vsg.run_cmd('sudo docker exec {} iptables -I FORWARD -s {} -j DROP'.format(vcpe,source_ip))
482 st, _ = getstatusoutput('ping -c 1 {}'.format(host))
483 assert_equal(st, True)
484 st, _ = vsg.run_cmd('sudo docker exec {} iptables -D FORWARD -s {} -j DROP'.format(vcpe,source_ip))
485 st, _ = getstatusoutput('ping -c 1 {}'.format(host))
486 assert_equal(st, False)
487 finally:
488 vsg.run_cmd('sudo docker exec {} iptables -F'.format(vcpe))
489
490 def test_vsg_firewall_rule_with_deny_icmp_protocol_echo_requests_type(self, vcpe=None):
491 host = '8.8.8.8'
492 if not vcpe:
493 vcpe = self.vcpe_container
494 vsg = VSGAccess.get_vcpe_vsg(vcpe)
495 st, _ = getstatusoutput('ping -c 1 {}'.format(host))
496 assert_equal(st, False)
497 try:
498 st,output = vsg.run_cmd('sudo docker exec {} iptables -I FORWARD -p icmp --icmp-type echo-request -j DROP'.format(vcpe))
499 st, _ = getstatusoutput('ping -c 1 {}'.format(host))
500 assert_equal(st, True)
501 st,output = vsg.run_cmd('sudo docker exec {} iptables -D FORWARD -p icmp --icmp-type echo-request -j DROP'.format(vcpe))
502 st, _ = getstatusoutput('ping -c 1 {}'.format(host))
503 assert_equal(st, False)
504 finally:
505 vsg.run_cmd('sudo docker exec {} iptables -F'.format(vcpe))
506 vsg.run_cmd('sudo docker exec {} iptables -X'.format(vcpe))
507
508 def test_vsg_firewall_rule_with_deny_icmp_protocol_echo_reply_type(self, vcpe=None):
509 host = '8.8.8.8'
510 if not vcpe:
511 vcpe = self.vcpe_container
512 vsg = VSGAccess.get_vcpe_vsg(vcpe)
513 st, _ = getstatusoutput('ping -c 1 {}'.format('8.8.8.8'))
514 assert_equal(st, False)
515 try:
516 st,output = vsg.run_cmd('sudo docker exec {} iptables -I FORWARD -p icmp --icmp-type echo-reply -j DROP'.format(vcpe))
517 st, _ = getstatusoutput('ping -c 1 {}'.format(host))
518 assert_equal(st, True)
519 st,output = vsg.run_cmd('sudo docker exec {} iptables -D FORWARD -p icmp --icmp-type echo-reply -j DROP'.format(vcpe))
520 st, _ = getstatusoutput('ping -c 1 {}'.format(host))
521 assert_equal(st,False)
522 finally:
523 st, _ = vsg.run_cmd('sudo docker exec {} iptables -X'.format(vcpe))
524 st, _ = vsg.run_cmd('sudo docker exec {} iptables -F'.format(vcpe))
525
526 def test_vsg_firewall_changing_deny_rule_to_accept_rule_with_icmp_protocol_echo_requests_type(self, vcpe=None):
527 host = '8.8.8.8'
528 if not vcpe:
529 vcpe = self.vcpe_container
530 vsg = VSGAccess.get_vcpe_vsg(vcpe)
531 st, _ = getstatusoutput('ping -c 1 {}'.format(host))
532 assert_equal(st, False)
533 try:
534 st, _ = vsg.run_cmd('sudo docker exec {} iptables -I FORWARD 1 -p icmp --icmp-type echo-request -j DROP'.format(vcpe))
535 st, _ = getstatusoutput('ping -c 1 {}'.format(host))
536 assert_equal(st, True)
537 st, _ = vsg.run_cmd('sudo docker exec {} iptables -I FORWARD 1 -p icmp --icmp-type echo-request -j ACCEPT'.format(vcpe))
538 st, _ = getstatusoutput('ping -c 1 {}'.format(host))
539 assert_equal(st,False)
540 finally:
541 st, _ = vsg.run_cmd('sudo docker exec {} iptables -X'.format(vcpe))
542 st, _ = vsg.run_cmd('sudo docker exec {} iptables -F'.format(vcpe))
543
544 def test_vsg_firewall_changing_deny_rule_to_accept_rule_with_icmp_protocol_echo_reply_type(self, vcpe=None):
545 host = '8.8.8.8'
546 if not vcpe:
547 vcpe = self.vcpe_container
548 vsg = VSGAccess.get_vcpe_vsg(vcpe)
549 st, out1 = getstatusoutput('ping -c 1 {}'.format(host))
550 assert_equal(st, False)
551 try:
552 st,output = vsg.run_cmd('sudo docker exec {} iptables -I FORWARD 1 -p icmp --icmp-type echo-reply -j DROP'.format(vcpe))
553 st,_ = getstatusoutput('ping -c 1 {}'.format(host))
554 assert_equal(st, True)
555 st,output = vsg.run_cmd('sudo docker exec {} iptables -I FORWARD 1 -p icmp --icmp-type echo-reply -j ACCEPT'.format(vcpe))
556 st, _ = getstatusoutput('ping -c 1 {}'.format(host))
557 assert_equal(st,False)
558 finally:
559 st, _ = vsg.run_cmd('sudo docker exec {} iptables -X'.format(vcpe))
560 st, _ = vsg.run_cmd('sudo docker exec {} iptables -F'.format(vcpe))
561
562 def test_vsg_firewall_for_deny_icmp_protocol(self, vcpe=None):
563 host = '8.8.8.8'
564 if not vcpe:
565 vcpe = self.vcpe_container
566 vsg = VSGAccess.get_vcpe_vsg(vcpe)
567 st, _ = getstatusoutput('ping -c 1 {}'.format(host))
568 assert_equal(st, False)
569 try:
570 st,output = vsg.run_cmd('sudo docker exec {} iptables -I FORWARD -p icmp -j DROP'.format(vcpe))
571 st,_ = getstatusoutput('ping -c 1 {}'.format(host))
572 assert_equal(st, True)
573 st,output = vsg.run_cmd('sudo docker exec {} iptables -D FORWARD -p icmp -j DROP'.format(vcpe))
574 st, _ = getstatusoutput('ping -c 1 {}'.format(host))
575 assert_equal(st,False)
576 finally:
577 st, _ = vsg.run_cmd('sudo docker exec {} iptables -X'.format(vcpe))
578 st, _ = vsg.run_cmd('sudo docker exec {} iptables -F'.format(vcpe))
579
580 def test_vsg_firewall_rule_deny_icmp_protocol_and_destination_ip(self, vcpe=None):
581 host = '8.8.8.8'
582 if not vcpe:
583 vcpe = self.vcpe_container
584 vsg = VSGAccess.get_vcpe_vsg(vcpe)
585 st, _ = getstatusoutput('ping -c 1 {}'.format(host))
586 assert_equal(st, False)
587 try:
588 st,output = vsg.run_cmd('sudo docker exec {} iptables -I FORWARD -d {} -j DROP'.format(vcpe,host))
589 st,_ = getstatusoutput('ping -c 1 {}'.format(host))
590 assert_equal(st, True)
591 st,output = vsg.run_cmd('sudo docker exec {} iptables -I FORWARD -p icmp -j DROP'.format(vcpe))
592 assert_equal(st, True)
593 st,output = vsg.run_cmd('sudo docker exec {} iptables -D FORWARD -d {} -j DROP'.format(vcpe,host))
594 assert_equal(st, True)
595 st,output = vsg.run_cmd('sudo docker exec {} iptables -D FORWARD -p icmp -j DROP'.format(vcpe))
596 st, _ = getstatusoutput('ping -c 1 {}'.format(host))
597 assert_equal(st,False)
598 finally:
599 st, _ = vsg.run_cmd('sudo docker exec {} iptables -X'.format(vcpe))
600 st, _ = vsg.run_cmd('sudo docker exec {} iptables -F'.format(vcpe))
601
602 def test_vsg_firewall_flushing_all_configured_rules(self, vcpe=None):
603 host = '8.8.8.8'
604 if not vcpe:
605 vcpe = self.vcpe_container
606 vsg = VSGAccess.get_vcpe_vsg(vcpe)
607 st, _ = getstatusoutput('ping -c 1 {}'.format(host))
608 assert_equal(st, False)
609 try:
610 st,output = vsg.run_cmd('sudo docker exec {} iptables -I FORWARD -d {} -j DROP'.format(vcpe,host))
611 st,_ = getstatusoutput('ping -c 1 {}'.format(host))
612 assert_equal(st, True)
613 st,output = vsg.run_cmd('sudo docker exec {} iptables -I FORWARD -p icmp -j DROP'.format(vcpe))
614 st,_ = getstatusoutput('ping -c 1 {}'.format(host))
615 assert_equal(st, True)
616 st,output = vsg.run_cmd('sudo docker exec {} iptables -F'.format(vcpe))
617 st,_ = getstatusoutput('ping -c 1 {}'.format(host))
618 assert_equal(st, False)
619 finally:
620 st, _ = vsg.run_cmd('sudo docker exec {} iptables -X'.format(vcpe))
621 st, _ = vsg.run_cmd('sudo docker exec {} iptables -F'.format(vcpe))
622
A.R Karthick282f0d32017-03-28 16:43:59 -0700623 def test_vsg_xos_subscriber(self):
624 subscriber_info = self.subscriber_info[0]
625 volt_subscriber_info = self.volt_subscriber_info[0]
626 result = self.restApiXos.ApiPost('TENANT_SUBSCRIBER', subscriber_info)
627 assert_equal(result, True)
628 result = self.restApiXos.ApiGet('TENANT_SUBSCRIBER')
629 assert_not_equal(result, None)
630 subId = self.restApiXos.getSubscriberId(result, volt_subscriber_info['account_num'])
631 assert_not_equal(subId, '0')
632 log.info('Subscriber ID for account num %d = %s' %(volt_subscriber_info['account_num'], subId))
633 volt_tenant = volt_subscriber_info['voltTenant']
634 #update the subscriber id in the tenant info before making the rest
635 volt_tenant['subscriber'] = subId
636 result = self.restApiXos.ApiPost('TENANT_VOLT', volt_tenant)
637 assert_equal(result, True)
638
Anil Kumar Sanka1213d4c2017-02-23 22:50:48 +0000639 def test_vsg_for_ping_from_vsg_to_external_network(self):
640 """
641 Algo:
642 1.Create a vSG VM in compute node
643 2.Ensure VM created properly
644 3.Verify login to VM success
645 4.Do ping to external network from vSG VM
646 5.Verify that ping gets success
647 6.Verify ping success flows added in OvS
648 """
A R Karthick63751492017-03-22 09:28:01 -0700649
Anil Kumar Sanka1213d4c2017-02-23 22:50:48 +0000650 def test_vsg_for_ping_from_vcpe_to_external_network(self):
651 """
652 Algo:
653 1.Create a vSG VM in compute node
654 2.Create a vCPE container inside VM
655 3.Verify both VM and Container created properly
656 4.Verify login to vCPE container success
657 5.Do ping to external network from vCPE container
658 6.Verify that ping gets success
659 7.Verify ping success flows added in OvS
660 """
661
Chetan Gaonker52418832017-01-26 23:03:13 +0000662 def test_vsg_for_dns_service(self):
Anil Kumar Sanka1213d4c2017-02-23 22:50:48 +0000663 """
664 Algo:
665 1. Create a test client in Prod VM
666 2. Create a vCPE container in vSG VM inside compute Node
667 3. Ensure vSG VM and vCPE container created properly
668 4. Enable dns service in vCPE ( if not by default )
669 5. Send ping request from test client to valid domain address say, 'www.google'com
670 6. Verify that dns should resolve ping should success
671 7. Now send ping request to invalid domain address say 'www.invalidaddress'.com'
672 8. Verify that dns resolve should fail and hence ping
673 """
A R Karthick63751492017-03-22 09:28:01 -0700674
Anil Kumar Sanka1213d4c2017-02-23 22:50:48 +0000675 def test_vsg_for_10_subscribers_for_same_service(self):
676 """
677 Algo:
678 1.Create a vSG VM in compute node
679 2.Create 10 vCPE containers for 10 subscribers, in vSG VM
680 3.Ensure vSG VM and vCPE container created properly
681 4.From each of the subscriber, with same s-tag and different c-tag, send a ping to valid external public IP
682 5.Verify that ping success for all 10 subscribers
683 """
A R Karthick63751492017-03-22 09:28:01 -0700684
Anil Kumar Sanka1213d4c2017-02-23 22:50:48 +0000685 def test_vsg_for_10_subscribers_for_same_service_ping_invalid_ip(self):
686 """
687 Algo:
688 1.Create a vSG VM in compute Node
689 2.Create 10 vCPE containers for 10 subscribers, in vSG VM
690 3.Ensure vSG VM and vCPE container created properly
691 4.From each of the subscriber, with same s-tag and different c-tag, send a ping to invalid IP
692 5.Verify that ping fails for all 10 subscribers
693 """
A R Karthick63751492017-03-22 09:28:01 -0700694
Anil Kumar Sanka1213d4c2017-02-23 22:50:48 +0000695 def test_vsg_for_10_subscribers_for_same_service_ping_valid_and_invalid_ip(self):
696 """
697 Algo:
698 1.Create a vSG VM in VM
699 2.Create 10 vCPE containers for 10 subscribers, in vSG VM
700 3.Ensure vSG VM and vCPE container created properly
701 4.From first 5 subscribers, with same s-tag and different c-tag, send a ping to valid IP
702 5.Verify that ping success for all 5 subscribers
703 6.From next 5 subscribers, with same s-tag and different c-tag, send a ping to invalid IP
704 7.Verify that ping fails for all 5 subscribers
705 """
A R Karthick63751492017-03-22 09:28:01 -0700706
Anil Kumar Sanka1213d4c2017-02-23 22:50:48 +0000707 def test_vsg_for_100_subscribers_for_same_service(self):
708 """
709 Algo:
710 1.Create a vSG VM in compute node
711 2.Create 100 vCPE containers for 100 subscribers, in vSG VM
712 3.Ensure vSG VM and vCPE container created properly
713 4.From each of the subscriber, with same s-tag and different c-tag, send a ping to valid external public IP
714 5.Verify that ping success for all 100 subscribers
715 """
A R Karthick63751492017-03-22 09:28:01 -0700716
Anil Kumar Sanka1213d4c2017-02-23 22:50:48 +0000717 def test_vsg_for_100_subscribers_for_same_service_ping_invalid_ip(self):
718 """
719 Algo:
720 1.Create a vSG VM in compute Node
721 2.Create 10 vCPE containers for 100 subscribers, in vSG VM
722 3.Ensure vSG VM and vCPE container created properly
723 4.From each of the subscriber, with same s-tag and different c-tag, send a ping to invalid IP
724 5.Verify that ping fails for all 100 subscribers
725 """
A R Karthick63751492017-03-22 09:28:01 -0700726
Anil Kumar Sanka1213d4c2017-02-23 22:50:48 +0000727 def test_vsg_for_100_subscribers_for_same_service_ping_valid_and_invalid_ip(self):
728 """
729 Algo:
730 1.Create a vSG VM in VM
731 2.Create 10 vCPE containers for 100 subscribers, in vSG VM
732 3.Ensure vSG VM and vCPE container created properly
733 4.From first 5 subscribers, with same s-tag and different c-tag, send a ping to valid IP
734 5.Verify that ping success for all 5 subscribers
735 6.From next 5 subscribers, with same s-tag and different c-tag, send a ping to invalid IP
736 7.Verify that ping fails for all 5 subscribers
737 """
A R Karthick63751492017-03-22 09:28:01 -0700738
Anil Kumar Sanka1213d4c2017-02-23 22:50:48 +0000739 def test_vsg_for_packet_received_with_invalid_ip_fields(self):
740 """
741 Algo:
742 1.Create a vSG VM in compute node
743 2.Create a vCPE container in vSG VM
744 3.Ensure vSG VM and vCPE container created properly
745 4.From subscriber, send a ping packet with invalid ip fields
746 5.Verify that vSG drops the packet
747 6.Verify ping fails
748 """
A R Karthick63751492017-03-22 09:28:01 -0700749
Anil Kumar Sanka1213d4c2017-02-23 22:50:48 +0000750 def test_vsg_for_packet_received_with_invalid_mac_fields(self):
751 """
752 Algo:
753 1.Create a vSG VM in compute node
754 2.Create a vCPE container in vSG VM
755 3.Ensure vSG VM and vCPE container created properly
756 4.From subscriber, send a ping packet with invalid mac fields
757 5.Verify that vSG drops the packet
758 6.Verify ping fails
759 """
A R Karthick63751492017-03-22 09:28:01 -0700760
Anil Kumar Sanka1213d4c2017-02-23 22:50:48 +0000761 def test_vsg_for_vlan_id_mismatch_in_stag(self):
762 """
763 Algo:
764 1.Create a vSG VM in compute Node
765 2.Create a vCPE container in vSG VM
766 3.Ensure vSG VM and vCPE container created properly
767 4.Send a ping request to external valid IP from subscriber, with incorrect vlan id in s-tag and valid c-tag
768 5.Verify that ping fails as the packet drops at VM entry
769 6.Repeat step 4 with correct s-tag
770 7.Verify that ping success
771 """
A R Karthick63751492017-03-22 09:28:01 -0700772
Anil Kumar Sanka1213d4c2017-02-23 22:50:48 +0000773 def test_vsg_for_vlan_id_mismatch_in_ctag(self):
774 """
775 Algo:
776 1.Create a vSG VM in compute node
777 2.Create a vCPE container in vSG VM
778 3.Ensure vSG VM and vCPE container created properly
779 4.Send a ping request to external valid IP from subscriber, with valid s-tag and incorrect vlan id in c-tag
780 5.Verify that ping fails as the packet drops at vCPE container entry
781 6.Repeat step 4 with valid s-tag and c-tag
782 7.Verify that ping success
783 """
A R Karthick63751492017-03-22 09:28:01 -0700784
Anil Kumar Sanka1213d4c2017-02-23 22:50:48 +0000785 def test_vsg_for_matching_and_mismatching_vlan_id_in_stag(self):
786 """
787 Algo:
788 1.Create two vSG VMs in compute node
789 2.Create a vCPE container in each vSG VM
790 3.Ensure vSG VM and vCPE container created properly
791 4.From subscriber one, send ping request with valid s and c tags
792 5.From subscriber two, send ping request with vlan id mismatch in s-tag and valid c tags
793 6.Verify that ping success for only subscriber one and fails for two.
794 """
A R Karthick63751492017-03-22 09:28:01 -0700795
Anil Kumar Sanka1213d4c2017-02-23 22:50:48 +0000796 def test_vsg_for_matching_and_mismatching_vlan_id_in_ctag(self):
797 """
798 Algo:
799 1.Create a vSG VM in compute node
800 2.Create two vCPE containers in vSG VM
801 3.Ensure vSG VM and vCPE container created properly
802 4.From subscriber one, send ping request with valid s and c tags
803 5.From subscriber two, send ping request with valid s-tag and vlan id mismatch in c-tag
804 6.Verify that ping success for only subscriber one and fails for two
805 """
A R Karthick63751492017-03-22 09:28:01 -0700806
Anil Kumar Sanka1213d4c2017-02-23 22:50:48 +0000807 def test_vsg_for_out_of_range_vlanid_in_ctag(self):
808 """
809 Algo:
810 1.Create a vSG VM in compute node
811 2.Create a vCPE container in vSG VM
812 3.Ensure vSG VM and vCPE container created properly
813 4.From subscriber, send ping request with valid stag and vlan id in c-tag is an out of range value ( like 0,4097 )
814 4.Verify that ping fails as the ping packets drops at vCPE container entry
815 """
A R Karthick63751492017-03-22 09:28:01 -0700816
Anil Kumar Sanka1213d4c2017-02-23 22:50:48 +0000817 def test_vsg_for_out_of_range_vlanid_in_stag(self):
818 """
819 Algo:
820 1.Create a vSG VM in compute node
821 2.Create a vCPE container in vSG VM
822 3.Ensure vSG VM and vCPE container created properly
823 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
824 4.Verify that ping fails as the ping packets drops at vSG VM entry
825 """
A R Karthick63751492017-03-22 09:28:01 -0700826
Anil Kumar Sanka1213d4c2017-02-23 22:50:48 +0000827 def test_vsg_without_creating_vcpe_instance(self):
828 """
829 Algo:
830 1.Create a vSG VM in compute Node
831 2.Ensure vSG VM created properly
832 3.Do not create vCPE container inside vSG VM
833 4.From a subscriber, send ping to external valid IP
834 5.Verify that ping fails as the ping packet drops at vSG VM entry itself.
835 """
A R Karthick63751492017-03-22 09:28:01 -0700836
Anil Kumar Sanka1213d4c2017-02-23 22:50:48 +0000837 def test_vsg_for_remove_vcpe_instance(self):
838 """
839 Algo:
840 1.Create a vSG VM in compute node
841 2.Create a vCPE container in vSG VM
842 3.Ensure vSG VM and vCPE container created properly
843 4.From subscriber, send ping request with valid s-tag and c-tag
844 5.Verify that ping success
845 6.Verify ping success flows in OvS switch in compute node
846 7.Now remove the vCPE container in vSG VM
847 8.Ensure that the container removed properly
848 9.Repeat step 4
849 10.Verify that now, ping fails
850 """
A R Karthick63751492017-03-22 09:28:01 -0700851
Anil Kumar Sanka1213d4c2017-02-23 22:50:48 +0000852 def test_vsg_for_restart_vcpe_instance(self):
853 """
854 Algo:
855 1.Create a vSG VM in compute node
856 2.Create a vCPE container in vSG VM
857 3.Ensure vSG VM and vCPE container created properly
858 4.From subscriber, send ping request with valid s-tag and c-tag
859 5.Verify that ping success
860 6.Verify ping success flows in OvS switch in compute node
861 7.Now restart the vCPE container in vSG VM
862 8.Ensure that the container came up after restart
863 9.Repeat step 4
864 10.Verify that now,ping gets success and flows added in OvS
865 """
A R Karthick63751492017-03-22 09:28:01 -0700866
Anil Kumar Sanka1213d4c2017-02-23 22:50:48 +0000867 def test_vsg_for_restart_vsg_vm(self):
868 """
869 Algo:
870 1.Create a vSG VM in compute node
871 2.Create a vCPE container in vSG VM
872 3.Ensure vSG VM and vCPE container created properly
873 4.From subscriber, send ping request with valid s-tag and c-tag
874 5.Verify that ping success
875 6.Verify ping success flows in OvS switch in compute node
876 7.Now restart the vSG VM
877 8.Ensure that the vSG comes up properly after restart
878 9.Verify that vCPE container comes up after vSG restart
879 10.Repeat step 4
880 11.Verify that now,ping gets success and flows added in OvS
881 """
A R Karthick63751492017-03-22 09:28:01 -0700882
Anil Kumar Sanka1213d4c2017-02-23 22:50:48 +0000883 def test_vsg_for_pause_vcpe_instance(self):
884 """
885 Algo:
886 1.Create a vSG VM in compute node
887 2.Create a vCPE container in vSG VM
888 3.Ensure vSG VM and vCPE container created properly
889 4.From subscriber, send ping request with valid s-tag and c-tag
890 5.Verify that ping success
891 6.Verify ping success flows in OvS switch in compute node
892 7.Now pause vCPE container in vSG VM for a while
893 8.Ensure that the container state is pause
894 9.Repeat step 4
895 10.Verify that now,ping fails now and verify flows in OvS
896 11.Now resume the container
897 12.Now repeat step 4 again
898 13.Verify that now, ping gets success
899 14.Verify ping success flows in OvS
900 """
A R Karthick63751492017-03-22 09:28:01 -0700901
Anil Kumar Sanka1213d4c2017-02-23 22:50:48 +0000902 def test_vsg_for_extract_all_compute_stats_from_all_vcpe_containers(self):
903 """
904 Algo:
905 1.Create a vSG VM in compute node
906 2.Create 10 vCPE containers in VM
907 3.Ensure vSG VM and vCPE containers created properly
908 4.Login to all vCPE containers
909 4.Get all compute stats from all vCPE containers
910 5.Verify the stats # verification method need to add
911 """
A R Karthick63751492017-03-22 09:28:01 -0700912
Anil Kumar Sanka1213d4c2017-02-23 22:50:48 +0000913 def test_vsg_for_extract_dns_stats_from_all_vcpe_containers(self):
914 """
915 Algo:
916 1.Create a vSG VM in compute node
917 2.Create 10 vCPE containers in VM
918 3.Ensure vSG VM and vCPE containers created properly
919 4.From 10 subscribers, send ping to valid and invalid dns hosts
920 5.Verify dns resolves and ping success for valid dns hosts
921 6.Verify ping fails for invalid dns hosts
922 7.Verify dns host name resolve flows in OvS
923 8.Login to all 10 vCPE containers
924 9.Extract all dns stats
925 10.Verify dns stats for queries sent, queries received for dns host resolve success and failed scenarios
926 """
A R Karthick63751492017-03-22 09:28:01 -0700927
Anil Kumar Sanka1213d4c2017-02-23 22:50:48 +0000928 def test_vsg_for_subscriber_access_two_vsg_services(self):
929 """
930 # Intention is to verify if subscriber can reach internet via two vSG VMs
931 Algo:
932 1.Create two vSG VMs for two services in compute node
933 2.Create one vCPE container in each VM for one subscriber
934 3.Ensure VMs and containers created properly
935 4.From subscriber end, send ping to public IP with stag corresponds to vSG-1 VM and ctag
936 5.Verify ping gets success
937 6.Verify ping success flows in OvS
938 7.Now repeat step 4 with stag corresponds to vSG-2 VM
939 8.Verify that ping again success
940 9.Verify ping success flows in OvS
941 """
A R Karthick63751492017-03-22 09:28:01 -0700942
Anil Kumar Sanka1213d4c2017-02-23 22:50:48 +0000943 def test_vsg_for_subscriber_access_service2_if_service1_goes_down(self):
944 """
945 # Intention is to verify if subscriber can reach internet via vSG2 if vSG1 goes down
946 Algo:
947 1.Create two vSG VMs for two services in compute node
948 2.Create one vCPE container in each VM for one subscriber
949 3.Ensure VMs and containers created properly
950 4.From subscriber end, send ping to public IP with stag corresponds to vSG-1 VM and ctag
951 5.Verify ping gets success
952 6.Verify ping success flows in OvS
953 7.Down the vSG-1 VM
954 8.Now repeat step 4
955 9.Verify that ping fails as vSG-1 is down
956 10.Repeat step 4 with stag corresponding to vSG-2
957 9.Verify ping success and flows added in OvS
958 """
A R Karthick63751492017-03-22 09:28:01 -0700959
Anil Kumar Sanka1213d4c2017-02-23 22:50:48 +0000960 def test_vsg_for_subscriber_access_service2_if_service1_goes_restart(self):
961 """
962 # Intention is to verify if subscriber can reach internet via vSG2 if vSG1 restarts
963 Algo:
964 1.Create two vSG VMs for two services in compute node
965 2.Create one vCPE container in each VM for one subscriber
966 3.Ensure VMs and containers created properly
967 4.From subscriber end, send ping to public IP with stag corresponds to vSG-1 VM and ctag
968 5.Verify ping gets success
969 6.Verify ping success flows added in OvS
970 7.Now restart vSG-1 VM
971 8.Now repeat step 4 while vSG-1 VM restarts
972 9.Verify that ping fails as vSG-1 is restarting
973 10.Repeat step 4 with stag corresponding to vSG-2 while vSG-1 VM restarts
974 11.Verify ping success and flows added in OvS
975 """
A R Karthick63751492017-03-22 09:28:01 -0700976
Anil Kumar Sanka1213d4c2017-02-23 22:50:48 +0000977 def test_vsg_for_multiple_vcpes_in_vsg_vm_with_one_vcpe_goes_down(self):
978 """
979 # Intention is to verify if subscriber can reach internet via vSG2 if vSG1 goes down
980 Algo:
981 1.Create a vSG VM in compute node
982 2.Create two vCPE containers corresponds to two subscribers in vSG VM
983 3.Ensure VM and containers created properly
984 4.From subscriber-1 end, send ping to public IP with ctag corresponds to vCPE-1 and stag
985 5.Verify ping gets success
986 6.Verify ping success flows added in OvS
987 7.Now stop vCPE-1 container
988 8.Now repeat step 4
989 9.Verify that ping fails as vCPE-1 container is down
990 10.Repeat step 4 with ctag corresponding to vCPE-2 container
991 11.Verify ping success and flows added in OvS
992 """
A R Karthick63751492017-03-22 09:28:01 -0700993
Anil Kumar Sanka1213d4c2017-02-23 22:50:48 +0000994 def test_vsg_for_multiple_vcpes_in_vsg_vm_with_one_vcpe_restart(self):
995 """
996 # Intention is to verify if subscriber can reach internet via vSG2 if vSG1 restarts
997 Algo:
998 1.Create a vSG VM in compute node
999 2.Create two vCPE containers corresponds to two subscribers in vSG VM
1000 3.Ensure VM and containers created properly
1001 4.From subscriber-1 end, send ping to public IP with ctag corresponds to vCPE-1 and stag
1002 5.Verify ping gets success
1003 6.Verify ping success flows added in OvS
1004 7.Now restart vCPE-1 container
1005 8.Now repeat step 4 while vCPE-1 restarts
1006 9.Verify that ping fails as vCPE-1 container is restarts
1007 10.Repeat step 4 with ctag corresponding to vCPE-2 container while vCPE-1 restarts
1008 11..Verify ping success and flows added in OvS
1009 """
A R Karthick63751492017-03-22 09:28:01 -07001010
Anil Kumar Sanka1213d4c2017-02-23 22:50:48 +00001011 def test_vsg_for_multiple_vcpes_in_vsg_vm_with_one_vcpe_pause(self):
1012 """
1013 # Intention is to verify if subscriber can reach internet via vSG2 if vSG1 paused
1014 Algo:
1015 1.Create a vSG VM in compute node
1016 2.Create two vCPE containers corresponds to two subscribers in vSG VM
1017 3.Ensure VM and containers created properly
1018 4.From subscriber-1 end, send ping to public IP with ctag corresponds to vCPE-1 and stag
1019 5.Verify ping gets success
1020 6.Verify ping success flows added in OvS
1021 7.Now pause vCPE-1 container
1022 8.Now repeat step 4 while vCPE-1 in pause state
1023 9.Verify that ping fails as vCPE-1 container in pause state
1024 10.Repeat step 4 with ctag corresponding to vCPE-2 container while vCPE-1 in pause state
1025 11.Verify ping success and flows added in OvS
1026 """
1027 def test_vsg_for_multiple_vcpes_in_vsg_vm_with_one_vcpe_removed(self):
1028 """
1029 # Intention is to verify if subscriber can reach internet via vSG2 if vSG1 removed
1030 Algo:
1031 1.Create a vSG VM in compute node
1032 2.Create two vCPE containers corresponds to two subscribers in vSG VM
1033 3.Ensure VM and containers created properly
1034 4.From subscriber-1 end, send ping to public IP with ctag corresponds to vCPE-1 and stag
1035 5.Verify ping gets success
1036 6.Verify ping success flows added in OvS
1037 7.Now remove vCPE-1 container
1038 8.Now repeat step 4
1039 9.Verify that ping fails as vCPE-1 container removed
1040 10.Repeat step 4 with ctag corresponding to vCPE-2 container
1041 11.Verify ping success and flows added in OvS
1042 """
A R Karthick63751492017-03-22 09:28:01 -07001043
Anil Kumar Sanka1213d4c2017-02-23 22:50:48 +00001044 def test_vsg_for_vcpe_instance_removed_and_added_again(self):
1045 """
1046 Algo:
1047 1.Create a vSG VM in compute node
1048 2.Create a vCPE container in vSG VM
1049 3.Ensure VM and containers created properly
1050 4.From subscriber end, send ping to public IP
1051 5.Verify ping gets success
1052 6.Verify ping success flows added in OvS
1053 7.Now remove vCPE container in vSG VM
1054 8.Now repeat step 4
1055 9.Verify that ping fails as vCPE container removed
1056 10.Create the vCPE container again for the same subscriber
1057 11.Ensure that vCPE created now
1058 12.Now repeat step 4
1059 13.Verify ping success and flows added in OvS
1060 """
A R Karthick63751492017-03-22 09:28:01 -07001061
Anil Kumar Sanka1213d4c2017-02-23 22:50:48 +00001062 def test_vsg_for_vsg_vm_removed_and_added_again(self):
1063 """
1064 Algo:
1065 1.Create a vSG VM in compute node
1066 2.Create a vCPE container in vSG VM
1067 3.Ensure VM and containers created properly
1068 4.From subscriber end, send ping to public IP
1069 5.Verify ping gets success
1070 6.Verify ping success flows added in OvS
1071 7.Now remove vSG VM
1072 8.Now repeat step 4
1073 9.Verify that ping fails as vSG VM not exists
1074 10.Create the vSG VM and vCPE container in VM again
1075 11.Ensure that vSG and vCPE created
1076 12.Now repeat step 4
1077 13.Verify ping success and flows added in OvS
1078 """
1079
1080 #Test vSG - Subscriber Configuration
1081 def test_vsg_for_configuring_new_subscriber_in_vcpe(self):
1082 """
1083 Algo:
1084 1.Create a vSG VM in compute node
1085 2.Create a vCPE container in vSG VM
1086 3.Ensure VM and containers created properly
1087 4.Configure a subscriber in XOS and assign a service id
1088 5.Set the admin privileges to the subscriber
1089 6.Verify subscriber configuration is success
1090 """
1091 def test_vsg_for_adding_subscriber_devices_in_vcpe(self):
1092 """
1093 Algo:
1094 1.Create a vSG VM in compute node
1095 2.Create a vCPE container in vSG VM
1096 3.Ensure VM and containers created properly
1097 4.Configure a subscriber in XOS and assign a service id
1098 5.Verify subscriber successfully configured in vCPE
1099 6.Now add devices( Mac addresses ) under the subscriber admin group
1100 7.Verify all devices ( Macs ) added successfully
1101 """
1102 def test_vsg_for_removing_subscriber_devices_in_vcpe(self):
1103 """
1104 Algo:
1105 1.Create a vSG VM in compute node
1106 2.Create a vCPE container in vSG VM
1107 3.Ensure VM and containers created properly
1108 4.Configure a subscriber in XOS and assign a service id
1109 5.Verify subscriber successfully configured
1110 6.Now add devices( Mac addresses ) under the subscriber admin group
1111 7.Verify all devices ( Macs ) added successfully
1112 8.Now remove All the added devices in XOS
1113 9.Verify all the devices removed
1114 """
1115 def test_vsg_for_modify_subscriber_devices_in_vcpe(self):
1116 """
1117 Algo:
1118 1.Create a vSG VM in compute node
1119 2.Create a vCPE container in vSG VM
1120 3.Ensure VM and containers created properly
1121 4.Configure a user in XOS and assign a service id
1122 5.Verify subscriber successfully configured in vCPE.
1123 6.Now add devices( Mac addresses ) under the subscriber admin group
1124 7.Verify all devices ( Macs ) added successfully
1125 8.Now remove few devices in XOS
1126 9.Verify devices removed successfully
1127 10.Now add few additional devices in XOS under the same subscriber admin group
1128 11.Verify newly added devices successfully added
1129 """
1130 def test_vsg_for_vcpe_login_fails_with_incorrect_subscriber_credentials(self):
1131 """
1132 Algo:
1133 1.Create a vSG VM in compute node
1134 2.Create a vCPE container in vSG VM
1135 3.Ensure VM and containers created properly
1136 4.Configure a subscriber in XOS and assign a service id
1137 5.Verify subscriber successfully configured
1138 6.Now add devices( Mac addresses ) under the subscriber admin group
1139 7.Verify all devices ( Macs ) added successfully
1140 8.Login vCPE with credentials with which subscriber configured
1141 9.Verify subscriber successfully logged in
1142 10.Logout and login again with incorrect credentials ( either user name or password )
1143 11.Verify login attempt to vCPE fails wtih incorrect credentials
1144 """
1145 def test_vsg_for_subscriber_configuration_in_vcpe_retain_after_vcpe_restart(self):
1146 """
1147 Algo:
1148 1.Create a vSG VM in compute node
1149 2.Create a vCPE container in vSG VM
1150 3.Ensure VM and containers created properly
1151 4.Configure a subscriber in XOS and assign a service id
1152 5.Verify subscriber successfully configured
1153 6.Now add devices( Mac addresses ) under the subscriber admin group
1154 7.Verify all devices ( Macs ) added successfully
1155 8.Restart vCPE ( locate backup config path while restart )
1156 9.Verify subscriber details in vCPE after restart should be same as before the restart
1157 """
1158 def test_vsg_for_create_multiple_vcpe_instances_and_configure_subscriber_in_each_instance(self):
1159 """
1160 Algo:
1161 1.Create a vSG VM in compute node
1162 2.Create 2 vCPE containers in vSG VM
1163 3.Ensure VM and containers created properly
1164 4.Configure a subscriber in XOS for each vCPE instance and assign a service id
1165 5.Verify subscribers successfully configured
1166 6.Now login vCPE-2 with subscriber-1 credentials
1167 7.Verify login fails
1168 8.Now login vCPE-1 with subscriber-2 credentials
1169 9.Verify login fails
1170 10.Now login vCPE-1 with subscriber-1 and vCPE-2 with subscriber-2 credentials
1171 11.Verify that both the subscribers able to login to their respective vCPE containers
1172 """
1173 def test_vsg_for_same_subscriber_can_be_configured_for_multiple_services(self):
1174 """
1175 Algo:
1176 1.Create 2 vSG VMs in compute node
1177 2.Create a vCPE container in each vSG VM
1178 3.Ensure VMs and containers created properly
1179 4.Configure same subscriber in XOS for each vCPE instance and assign a service id
1180 5.Verify subscriber successfully configured
1181 6.Now login vCPE-1 with subscriber credentials
1182 7.Verify login success
1183 8.Now login vCPE-2 with the same subscriber credentials
1184 9.Verify login success
1185 """
1186
1187 #Test Example Service
1188 def test_vsg_for_subcriber_avail_example_service_running_in_apache_server(self):
1189 """
1190 Algo:
1191 1.Create a vSG VM in compute node
1192 2.Create a vCPE container in each vSG VM
1193 3.Ensure VM and container created properly
1194 4.Configure a subscriber in XOS for the vCPE instance and assign a service id
1195 5.On-board an example service into cord pod
1196 6.Create a VM in compute node and run the example service ( Apache server )
1197 7.Configure the example service with service specific and subscriber specific messages
1198 8.Verify example service on-boarded successfully
1199 9.Verify example service running in VM
1200 10.Run a curl command from subscriber to reach example service
1201 11.Verify subscriber can successfully reach example service via vSG
1202 12.Verify that service specific and subscriber specific messages
1203 """
1204 def test_vsg_for_subcriber_avail_example_service_running_in_apache_server_after_service_restart(self):
1205 """
1206 Algo:
1207 1.Create a vSG VM in compute node
1208 2.Create a vCPE container in each vSG VM
1209 3.Ensure VM and container created properly
1210 4.Configure a subscriber in XOS for the vCPE instance and assign a service id
1211 5.On-board an example service into cord pod
1212 6.Create a VM in compute node and run the example service ( Apache server )
1213 7.Configure the example service with service specific and subscriber specific messages
1214 8.Verify example service on-boarded successfully
1215 9.Verify example service running in VM
1216 10.Run a curl command from subscriber to reach example service
1217 11.Verify subscriber can successfully reach example service via vSG
1218 12.Verify that service specific and subscriber specific messages
1219 13.Restart example service running in VM
1220 14.Repeat step 10
1221 15.Verify the same results as mentioned in steps 11, 12
1222 """
1223
1224 #vCPE Firewall Functionality
1225 def test_vsg_firewall_for_creating_acl_rule_based_on_source_ip(self):
1226 """
1227 Algo:
1228 1.Create a vSG VM in compute node
1229 2.Create vCPE container in the VM
1230 3.Ensure vSG VM and vCPE container created properly
1231 4.Configure ac acl rule in vCPE to deny IP traffic from a source IP
1232 5.Bound the acl rule to WAN interface of vCPE
1233 6.Verify configuration in vCPE is success
1234 8.Verify flows added in OvS
1235 """
1236 def test_vsg_firewall_for_creating_acl_rule_based_on_destination_ip(self):
1237 """
1238 Algo:
1239 1.Create a vSG VM in compute node
1240 2.Create vCPE container in the VM
1241 3.Ensure vSG VM and vCPE container created properly
1242 4.Configure ac acl rule in vCPE to deny IP traffic to a destination ip
1243 5.Bound the acl rule to WAN interface of vCPE
1244 6.Verify configuration in vCPE is success
1245 8.Verify flows added in OvS
1246 """
1247 def test_vsg_firewall_for_acl_deny_rule_based_on_source_ip_traffic(self):
1248 """
1249 Algo:
1250 1.Create a vSG VM in compute node
1251 2.Create vCPE container in the VM
1252 3.Ensure vSG VM and vCPE container created properly
1253 4.Configure ac acl rule in vCPE to deny IP traffic from a source IP
1254 5.Bound the acl rule to WAN interface of vCPE
1255 6.From subscriber, send ping to the denied IP address
1256 7.Verify that ping fails as vCPE denies ping response
1257 8.Verify flows added in OvS
1258 """
1259 def test_vsg_firewall_for_acl_deny_rule_based_on_destination_ip_traffic(self):
1260 """
1261 Algo:
1262 1.Create a vSG VM in compute node
1263 2.Create vCPE container in the VM
1264 3.Ensure vSG VM and vCPE container created properly
1265 4.Configure ac acl rule in vCPE to deny IP traffic to a destination IP
1266 5.Bound the acl rule to WAN interface of vCPE
1267 6.From subscriber, send ping to the denied IP address
1268 7.Verify that ping fails as vCPE drops the ping request at WAN interface
1269 8.Verify flows added in OvS
1270 """
Chetan Gaonker52418832017-01-26 23:03:13 +00001271
1272 def test_vsg_dnsmasq(self):
1273 pass
1274
1275 def test_vsg_with_external_parental_control_family_shield_for_filter(self):
1276 pass
1277
1278 def test_vsg_with_external_parental_control_with_answerx(self):
1279 pass
1280
1281 def test_vsg_for_subscriber_upstream_bandwidth(self):
1282 pass
1283
1284 def test_vsg_for_subscriber_downstream_bandwidth(self):
1285 pass
1286
1287 def test_vsg_for_diagnostic_run_of_traceroute(self):
1288 pass
1289
1290 def test_vsg_for_diagnostic_run_of_tcpdump(self):
1291 pass
1292
1293 def test_vsg_for_iptable_rules(self):
1294 pass
1295
1296 def test_vsg_for_iptables_with_neutron(self):
1297 pass