blob: 22d6b2543b28562dac39ba0057593814809e9b0b [file] [log] [blame]
ChetanGaonker901727c2016-11-29 14:05:03 -08001#
2# Copyright 2016-present Ciena Corporation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16import unittest
17import os,sys
ChetanGaonker901727c2016-11-29 14:05:03 -080018import keystoneclient.v2_0.client as ksclient
19import keystoneclient.apiclient.exceptions
20import neutronclient.v2_0.client as nclient
21import neutronclient.common.exceptions
Chetan Gaonker09b77ae2017-03-08 01:44:25 +000022import novaclient.v1_1.client as novaclient
ChetanGaonker901727c2016-11-29 14:05:03 -080023from multiprocessing import Pool
ChetanGaonkeraaea6b62016-12-16 17:06:39 -080024from neutronclient.v2_0 import client as neutron_client
Chetan Gaonker09b77ae2017-03-08 01:44:25 +000025import neutronclient.v2_0.client as neutronclient
ChetanGaonker901727c2016-11-29 14:05:03 -080026from nose.tools import assert_equal
ChetanGaonkeraaea6b62016-12-16 17:06:39 -080027from OnosCtrl import OnosCtrl, get_mac
ChetanGaonker901727c2016-11-29 14:05:03 -080028from CordLogger import CordLogger
A.R Karthickd4eed642017-03-09 14:40:52 -080029from TestManifest import TestManifest
Chetan Gaonker09b77ae2017-03-08 01:44:25 +000030from scapy.all import *
31import requests
ChetanGaonkeraaea6b62016-12-16 17:06:39 -080032import time
Chetan Gaonker3c8ae682017-02-18 00:50:45 +000033import py_compile
Chetan Gaonker09b77ae2017-03-08 01:44:25 +000034import json
ChetanGaonker901727c2016-11-29 14:05:03 -080035
ChetanGaonker71fe0302016-12-19 17:45:44 -080036PROTO_NAME_TCP = 'tcp'
37PROTO_NAME_ICMP = 'icmp'
38IPv4 = 'IPv4'
39
40OS_USERNAME = 'admin'
Chetan Gaonker0fb91c92017-02-07 01:52:18 +000041OS_PASSWORD = 'VeryLongKeystoneAdminPassword'
ChetanGaonker71fe0302016-12-19 17:45:44 -080042OS_TENANT = 'admin'
Chetan Gaonker0fb91c92017-02-07 01:52:18 +000043OS_AUTH_URL = 'https://keystone.cord.lab:5000/v2.0'
44OS_SERVICE_ENDPOINT = 'https://keystone.cord.lab:5000/v2.0/'
Chetan Gaonker1f422af2017-01-13 21:59:16 +000045VM_BOOT_TIMEOUT = 100
46VM_DELETE_TIMEOUT = 100
47
ChetanGaonker71fe0302016-12-19 17:45:44 -080048
49#VM SSH CREDENTIALS
50VM_USERNAME = 'ubuntu'
51VM_PASSWORD = 'ubuntu'
52
53TENANT_PREFIX = 'test-'
54VM_PREFIX = 'test-'
55NETWORK_PREFIX = 'test-'
56CIDR_PREFIX = '192.168'
57
Chetan Gaonker1c387cf2017-02-22 02:21:43 +000058class vtn_validation_utils:
59
A.R Karthickd4eed642017-03-09 14:40:52 -080060 endpoint = '172.17.0.5'
61 version = ''
62 vtn_app = 'org.opencord.vtn'
63
Chetan Gaonker1c387cf2017-02-22 02:21:43 +000064 def __init__(self, version):
65 self.version = version
A.R Karthickd4eed642017-03-09 14:40:52 -080066 self.manifest = None
67 self.vtn_enabled = False
68 manifest = os.getenv('MANIFEST', None)
69 if manifest:
70 self.manifest = TestManifest(manifest = manifest)
71 self.endpoint = self.manifest.onos_ip
72 self.vtn_enabled = self.manifest.synchronizer == 'vtn'
Chetan Gaonker1c387cf2017-02-22 02:21:43 +000073
A.R Karthickd4eed642017-03-09 14:40:52 -080074 self.app_ctrl = OnosCtrl(self.vtn_app, controller = self.endpoint)
Chetan Gaonker1c387cf2017-02-22 02:21:43 +000075
A.R Karthickd4eed642017-03-09 14:40:52 -080076 def getDevices(self):
77 return OnosCtrl.get_devices(controller = self.endpoint)
Chetan Gaonker1c387cf2017-02-22 02:21:43 +000078
A.R Karthickd4eed642017-03-09 14:40:52 -080079 def getLinks(self):
80 return OnosCtrl.get_links(controller = self.endpoint)
Chetan Gaonker1c387cf2017-02-22 02:21:43 +000081
A.R Karthickd4eed642017-03-09 14:40:52 -080082 def getDevicePorts(self, switch_id):
83 return OnosCtrl.get_ports_device(switch_id, controller = self.endpoint)
Chetan Gaonker1c387cf2017-02-22 02:21:43 +000084
A.R Karthickd4eed642017-03-09 14:40:52 -080085 def activateVTNApp(self):
86 return self.app_ctrl.activate()
87
88 def deactivateVTNApp(self):
89 return self.app_ctrl.deactivate()
Chetan Gaonker1c387cf2017-02-22 02:21:43 +000090
ChetanGaonker901727c2016-11-29 14:05:03 -080091class cordvtn_exchange(CordLogger):
92
ChetanGaonkeraaea6b62016-12-16 17:06:39 -080093 app_cordvtn = 'org.opencord.vtn'
94 test_path = os.path.dirname(os.path.realpath(__file__))
95 cordvtn_dir = os.path.join(test_path, '..', 'setup')
96 cordvtn_conf_file = os.path.join(test_path, '..', '../cordvtn/network_cfg.json')
ChetanGaonker901727c2016-11-29 14:05:03 -080097
98 @classmethod
99 def setUpClass(cls):
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800100 ''' Activate the cordvtn app'''
ChetanGaonker901727c2016-11-29 14:05:03 -0800101 time.sleep(3)
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800102 cls.onos_ctrl = OnosCtrl(cls.app_cordvtn)
103 status, _ = cls.onos_ctrl.activate()
Chetan Gaonker09b77ae2017-03-08 01:44:25 +0000104 assert_equal(status, True)
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800105 time.sleep(3)
106 cls.cordvtn_setup()
ChetanGaonker901727c2016-11-29 14:05:03 -0800107
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800108 @classmethod
109 def tearDownClass(cls):
ChetanGaonker901727c2016-11-29 14:05:03 -0800110 '''Deactivate the cord vtn app'''
Chetan Gaonker09b77ae2017-03-08 01:44:25 +0000111 #cls.onos_ctrl.deactivate()
112 #cls.cord_vtn_cleanup()
ChetanGaonker901727c2016-11-29 14:05:03 -0800113
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800114 @classmethod
115 def cordvtn_setup(cls):
116 pass
117
118 @classmethod
119 def cord_vtn_cleanup(cls):
120 ##reset the ONOS port configuration back to default
Chetan Gaonker09b77ae2017-03-08 01:44:25 +0000121 pass
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800122
123 @classmethod
124 def onos_load_config(cls, cordvtn_conf_file):
125 status, code = OnosCtrl.config(cordvtn_conf_file)
ChetanGaonker901727c2016-11-29 14:05:03 -0800126 if status is False:
127 log.info('JSON request returned status %d' %code)
128 assert_equal(status, True)
129 time.sleep(3)
130
Chetan Gaonker09b77ae2017-03-08 01:44:25 +0000131 def get_neutron_credentials(self):
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800132 n = {}
133 n['username'] = os.environ['OS_USERNAME']
134 n['password'] = os.environ['OS_PASSWORD']
135 n['auth_url'] = os.environ['OS_AUTH_URL']
136 n['tenant_name'] = os.environ['OS_TENANT_NAME']
Chetan Gaonker80e06152017-03-07 01:07:19 +0000137 n['ca_cert'] = os.environ['REQUESTS_CA_BUNDLE']
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800138 return n
139
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800140 def create_network(i):
141 neutron_credentials = get_neutron_credentials()
142 neutron = neutron_client.Client(**neutron_credentials)
143 json = {'network': {'name': 'network-' + str(i),
144 'admin_state_up': True}}
145 while True:
146 try:
Chetan Gaonker3c8ae682017-02-18 00:50:45 +0000147 net = neutron.create_network(body=json)
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800148 print '\nnetwork-' + str(i) + ' created'
Chetan Gaonker3c8ae682017-02-18 00:50:45 +0000149 return net
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800150 except Exception as e:
151 print e
152 continue
153
ChetanGaonker901727c2016-11-29 14:05:03 -0800154 def create_tenant(tenant_name):
155 new_tenant = keystone.tenants.create(tenant_name=tenant_name,
156 description="CORD Tenant \
157 created",
158 enabled=True)
159 tenant_id = new_tenant.id
160 tenant_status = True
161 user_data = []
162 for j in range(2):
163 j += 1
164 user_name = tenant_name + '-user-' + str(j)
165 user_data.append(create_user(user_name, tenant_id))
166
167 print " Tenant and User Created"
168
169 tenant_data = {'tenant_name': tenant_name,
170 'tenant_id': tenant_id,
171 'status': tenant_status}
172 return tenant_data
173
174 def create_user(user_name, tenant_id):
175 new_user = keystone.users.create(name=user_name,
176 password="ubuntu",
177 tenant_id=tenant_id)
178 print(' - Created User %s' % user_name)
179 keystone.roles.add_user_role(new_user, member_role, tenant_id)
180 if assign_admin:
181 admin_user = keystone.users.find(name='admin')
182 admin_role = keystone.roles.find(name='admin')
183 keystone.roles.add_user_role(admin_user, admin_role, tenant_id)
184 user_data = {'name': new_user.name,
185 'id': new_user.id}
186 return user_data
187
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800188 def create_port( router_id, network_id):
189 credentials = get_credentials()
190 neutron = client.Client(**credentials)
191 router = neutron.show_router(router_id)
192
193 value = {'port':{
194 'admin_state_up':True,
195 'device_id': router_id,
196 'name': 'port1',
197 'network_id':network_id,
198 }}
199 response = neutron.create_port(body=value)
200
ChetanGaonker71fe0302016-12-19 17:45:44 -0800201 def router_create(self, name):
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800202 external_network = None
203 for network in self.neutron.list_networks()["networks"]:
204 if network.get("router:external"):
205 external_network = network
206 break
207
208 if not external_network:
209 raise Exception("Alarm! Can not to find external network")
210
211 gw_info = {
212 "network_id": external_network["id"],
213 "enable_snat": True
214 }
215 router_info = {
216 "router": {
217 "name": name,
218 "external_gateway_info": gw_info,
219 "tenant_id": self.tenant_id
220 }
221 }
ChetanGaonker71fe0302016-12-19 17:45:44 -0800222 router = self.neutron.router_create(router_info)['router']
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800223 return router
224
ChetanGaonker901727c2016-11-29 14:05:03 -0800225 def delete_tenant(tenant_name):
226 tenant = keystone.tenants.find(name=tenant_name)
227 for j in range(2):
228 j += 1
229 user_name = tenant_name + '-user-' + str(j)
230 delete_user(user_name, tenant.id)
231 tenant.delete()
232 print(' - Deleted Tenant %s ' % tenant_name)
233 return True
234
235 def delete_user(user_name, tenant_id):
236 user = keystone.users.find(name=user_name)
237 user.delete()
238
239 print(' - Deleted User %s' % user_name)
240 return True
241
ChetanGaonker71fe0302016-12-19 17:45:44 -0800242 def set_environment(tenants_num=0, networks_per_tenant=1, vms_per_network=2):
Chetan Gaonker09b77ae2017-03-08 01:44:25 +0000243 octet = 115
244 vm_inc = 11
245 image = nova_connection.images.get(IMAGE_ID)
246 flavor = nova_connection.flavors.get(FLAVOR_ID)
ChetanGaonker71fe0302016-12-19 17:45:44 -0800247
Chetan Gaonker09b77ae2017-03-08 01:44:25 +0000248 admin_user_id = keystone_connection.users.find(name=OS_USERNAME).id
249 member_role_id = keystone_connection.roles.find(name='Member').id
250 for num_tenant in range(1, tenants_num+1):
251 tenant = keystone_connection.tenants.create('%stenant%s' % (TENANT_PREFIX, num_tenant))
252 keystone_connection.roles.add_user_role(admin_user_id, member_role_id, tenant=tenant.id)
253 for num_network in range(networks_per_tenant):
254 network_json = {'name': '%snet%s' % (NETWORK_PREFIX, num_tenant*10+num_network),
255 'admin_state_up': True,
256 'tenant_id': tenant.id}
257 network = neutron_connection.create_network({'network': network_json})
258 subnet_json = {'name': '%ssubnet%s' % (NETWORK_PREFIX, num_tenant*10+num_network),
259 'network_id': network['network']['id'],
260 'tenant_id': tenant.id,
261 'enable_dhcp': True,
262 'cidr': '%s.%s.0/24' % (CIDR_PREFIX, octet), 'ip_version': 4}
263 octet += 1
264 subnet = neutron_connection.create_subnet({'subnet': subnet_json})
265 router_json = {'name': '%srouter%s' % (NETWORK_PREFIX, num_tenant*10+num_network),
266 'tenant_id': tenant.id}
267 router = neutron_connection.router_create({'router': router_json})
268 port = neutron_connection.add_interface_router(router['router']['id'], {'subnet_id': subnet['subnet']['id']})
269 for num_vm in range(vms_per_network):
270 tenant_nova_connection = novacli.Client(OS_USERNAME, OS_PASSWORD, tenant.name, OS_AUTH_URL)
271 m = tenant_nova_connection.servers.create('%svm%s' % (VM_PREFIX, vm_inc), image, flavor, nics=[{'net-id': network['network']['id']}, {'net-id': MGMT_NET}])
272 vm_inc += 1
ChetanGaonker71fe0302016-12-19 17:45:44 -0800273
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800274 def verify_neutron_crud():
275 x = os.system("neutron_test.sh")
276 return x
ChetanGaonker901727c2016-11-29 14:05:03 -0800277
Author Name91eaeba2017-01-05 13:41:45 -0800278 def list_floatingips( **kwargs):
279 creds = get_neutron_credentials()
280 neutron = client.Client(**creds)
281 return neutron.list_floatingips(**kwargs)['floatingips']
282
283 def list_security_groups( **kwargs):
284 creds = get_neutron_credentials()
285 neutron = client.Client(**creds)
286 return neutron.list_security_groups(**kwargs)['security_groups']
287
288 def list_subnets( **kwargs):
289 creds = get_neutron_credentials()
290 neutron = client.Client(**creds)
291 return neutron.list_subnets(**kwargs)['subnets']
292
293 def list_networks( **kwargs):
294 creds = get_neutron_credentials()
295 neutron = client.Client(**creds)
296 return neutron.list_networks(**kwargs)['networks']
297
298 def list_ports( **kwargs):
299 creds = get_neutron_credentials()
300 neutron = client.Client(**creds)
301 return neutron.list_ports(**kwargs)['ports']
302
303 def list_routers( **kwargs):
304 creds = get_neutron_credentials()
305 neutron = client.Client(**creds)
306 return neutron.list_routers(**kwargs)['routers']
307
308 def update_floatingip( fip, port_id=None):
309 creds = get_neutron_credentials()
310 neutron = client.Client(**creds)
311 neutron.update_floatingip(fip, {"floatingip":
312 {"port_id": port_id}})
313
314 def update_subnet( subnet_id, **subnet_params):
315 creds = get_neutron_credentials()
316 neutron = client.Client(**creds)
317 neutron.update_subnet(subnet_id, {'subnet': subnet_params})
318
319 def update_router( router_id, **router_params):
320 creds = get_neutron_credentials()
321 neutron = client.Client(**creds)
322 neutron.update_router(router_id, {'router': router_params})
323
324 def router_gateway_set( router_id, external_gateway):
325 creds = get_neutron_credentials()
326 neutron = client.Client(**creds)
327 neutron.update_router(
328 router_id, {'router': {'external_gateway_info':
329 {'network_id': external_gateway}}})
330
331 def router_gateway_clear( router_id):
332 creds = get_neutron_credentials()
333 neutron = client.Client(**creds)
334 neutron.update_router(
335 router_id, {'router': {'external_gateway_info': None}})
336
337 def router_add_interface( router_id, subnet_id):
338 creds = get_neutron_credentials()
339 neutron = client.Client(**creds)
340 neutron.add_interface_router(router_id, {'subnet_id': subnet_id})
341
342 def router_rem_interface( router_id, subnet_id):
343 creds = get_neutron_credentials()
344 neutron = client.Client(**creds)
345 neutron.remove_interface_router(
346 router_id, {'subnet_id': subnet_id})
347
348 def create_floatingip( **floatingip_params):
349 creds = get_neutron_credentials()
350 neutron = client.Client(**creds)
351 response = neutron.create_floatingip(
352 {'floatingip': floatingip_params})
353 if 'floatingip' in response and 'id' in response['floatingip']:
354 return response['floatingip']['id']
355
Chetan Gaonker1f422af2017-01-13 21:59:16 +0000356 def make_iperf_pair(server, client, **kwargs):
357 ssh = SSHClient()
358 ssh.set_missing_host_key_policy(MissingHostKeyPolicy())
359
360 ssh.connect(server, username=VM_USERNAME, password=VM_PASSWORD)
361 ssh.exec_command('/usr/local/bin/iperf3 -s -D')
362
363 ssh.connect(client, username=VM_USERNAME, password=VM_PASSWORD)
364 stdin, stdout, stderr = ssh.exec_command('/usr/local/bin/iperf3 -c %s -J' % server)
365
366 rawdata = stdout.read()
367 data = json.loads(rawdata.translate(None,'\t').translate(None,'\n'))
368
369 return data
370
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000371 def connect_ssh(os_ip, private_key_file=None, user='ubuntu'):
372 key = ssh.RSAKey.from_private_key_file(private_key_file)
373 client = ssh.SSHClient()
374 client.set_missing_host_key_policy(ssh.WarningPolicy())
375 client.connect(ip, username=user, pkey=key, timeout=5)
376 return client
Chetan Gaonker1f422af2017-01-13 21:59:16 +0000377
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000378 def validate_vtn_flows(switch):
379 egress = 1
380 ingress = 2
381 egress_map = { 'ether': '00:00:00:00:00:03', 'ip': '192.168.30.1' }
382 ingress_map = { 'ether': '00:00:00:00:00:04', 'ip': '192.168.40.1' }
383 device_id = 'of:{}'.format(get_mac(switch))
384 flow_id = flow.findFlow(device_id, IN_PORT = ('port', ingress),
385 ETH_TYPE = ('ethType','0x800'), IPV4_SRC = ('ip', ingress_map['ip']+'/32'),
386 IPV4_DST = ('ip', egress_map['ip']+'/32'))
387 if flow_id:
388 return True
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800389
Chetan Gaonker3c8ae682017-02-18 00:50:45 +0000390 def cordvtn_config_load(self, config = None):
391 if config:
392 for k in config.keys():
393 if cordvtn_config.has_key(k):
394 cordvtn_config[k] = config[k]
395 self.onos_load_config(self.cordvtn_dict)
396
Chetan Gaonker09b77ae2017-03-08 01:44:25 +0000397 def search_value(self, d, pat):
Thangavelu K Sa2f5ac02017-03-13 18:29:00 +0000398 match = False
Chetan Gaonker3c8ae682017-02-18 00:50:45 +0000399 for k, v in d.items():
400 if isinstance(v, dict):
Thangavelu K Sa2f5ac02017-03-13 18:29:00 +0000401 match = self.search_value(v, pat)
402 elif type(v) is list:
403 for i in range(len(v)):
404 if type(v[i]) is dict:
405 match = self.search_value(v[i], pat)
406 else:
407 if v == pat:
408 match == True
409 return True
410 elif v == pat:
411 match == True
412 return True
413 return match
414
415 def test_cordvtn_neutron_network_creation_and_validation_on_neutron_openstack(self):
416 """
417 Algo:
418 0. Create Test-Net,
419 1. Load cordvtn config, vtn-cfg-1.json to cord-onos
420 2. Run sync command for cordvtn
421 3. Do GET Rest API and validate creation of network
422 4. Validate network synch with created network in cord-onos
423 """
424 creds = self.get_neutron_credentials()
425 neutron = neutronclient.Client(**creds)
426 body_example = {"network":{"name": "Net-1","admin_state_up":True}}
427 net = neutron.create_network(body=body_example)
428 networks = neutron.list_networks(name='Net-1')
429 vtn_util = vtn_validation_utils('')
430 data = networks
431 result = self.search_value(data, "Net-1")
432 assert_equal(result, True)
433
434 def test_cordvtn_neutron_network_creation_and_validation_on_onos(self):
435 """
436 Algo:
437 0. Create Test-Net,
438 1. Load cordvtn config, vtn-cfg-1.json to cord-onos
439 2. Run sync command for cordvtn
440 3. Do GET Rest API and validate creation of network
441 4. Validate network synch with created network in cord-onos
442 """
443 creds = self.get_neutron_credentials()
444 neutron = neutronclient.Client(**creds)
445 body_example = {"network":{"name": "Net-1","admin_state_up":True}}
446 net = neutron.create_network(body=body_example)
447 networks = neutron.list_networks(name='Net-1')
448 vtn_util = vtn_validation_utils('')
449 url = "http://{0}:8181/onos/cordvtn/serviceNetworks".format(vtn_util.endpoint)
450 auth = ('karaf','karaf')
451
452 resp = requests.get(url=url, auth=auth)
453 data = json.loads(resp.text)
454 result = self.search_value(data, "Net-1")
455 assert_equal(result, True)
456
457 def test_cordvtn_neutron_network_delete_and_validation_on_neutron_openstack(self):
458
459 """
460 Algo:
461 0. Create Test-Net,
462 1. Load cordvtn config, vtn-cfg-1.json to cord-onos
463 2. Run sync command for cordvtn
464 3. Do GET Rest API and validate creation of network
465 4. Validate network synch with created network in cord-onos
466 """
467 creds = self.get_neutron_credentials()
468 neutron = neutronclient.Client(**creds)
469 body_example = {"network":{"name": "Net-1","admin_state_up":False}}
470 net = neutron.delete_network("Net-1")
471 networks = neutron.list_networks(name='Net-1')
472 vtn_util = vtn_validation_utils('')
473 data = networks
474 result = self.search_value(data, "Net-1")
475 assert_equal(result, True)
Chetan Gaonker3c8ae682017-02-18 00:50:45 +0000476
477 def test_cordvtn_neutron_network_sync(self):
478 """
479 Algo:
480 0. Create Test-Net,
481 1. Load cordvtn config, vtn-cfg-1.json to cord-onos
482 2. Run sync command for cordvtn
483 3. Do GET Rest API and validate creation of network
484 4. Validate network synch with created network in cord-onos
485 """
Chetan Gaonker09b77ae2017-03-08 01:44:25 +0000486 creds = self.get_neutron_credentials()
Chetan Gaonker3c8ae682017-02-18 00:50:45 +0000487 neutron = neutronclient.Client(**creds)
Chetan Gaonker09b77ae2017-03-08 01:44:25 +0000488 body_example = {"network":{"name": "Test-Net-1","admin_state_up":True}}
Chetan Gaonker3c8ae682017-02-18 00:50:45 +0000489 net = neutron.create_network(body=body_example)
Chetan Gaonker09b77ae2017-03-08 01:44:25 +0000490 url = "http://172.19.0.2:8181/onos/cordvtn/serviceNetworks"
Chetan Gaonker3c8ae682017-02-18 00:50:45 +0000491 auth = ('karaf','karaf')
492
493 resp = requests.get(url=url, auth=auth)
494 data = json.loads(resp.text)
Chetan Gaonker09b77ae2017-03-08 01:44:25 +0000495 print data
496 result = self.search_value(data, "Test-Net-1")
Chetan Gaonker3c8ae682017-02-18 00:50:45 +0000497 assert_equal(result, True)
498
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800499 def test_cordvtn_basic_tenant(self):
500 onos_load_config()
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800501
ChetanGaonker71fe0302016-12-19 17:45:44 -0800502 tenant_1= create_tenant("CORD_Subscriber_Test_Tenant_1")
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000503 if tenant1 != 0:
ChetanGaonker71fe0302016-12-19 17:45:44 -0800504 print "Creation of CORD Subscriber Test Tenant 1"
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800505
ChetanGaonker71fe0302016-12-19 17:45:44 -0800506 tenant_2 = create_tenant("CORD_Subscriber_Test_Tenant_2")
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000507 if tenant2 != 0:
ChetanGaonker71fe0302016-12-19 17:45:44 -0800508 print "Creation of CORD Subscriber Test Tenant 2"
509
510 create_net(tenant_1,"a1")
511 create_subnet(tenant_1,"a1","as1","10.0.1.0/24")
512
513 create_net(tenant_2,"a2")
514 create_subnet(tenant_2,"a2","as1","10.0.2.0/24")
515
516 netid_1 = get_id(tenant_1,"net","a1")
517 netid_2 = get_id(tenant_2,"net","a2")
518
519 nova_boot(tenant_1,"vm1",netid=netid)
520 nova_boot(tenant_2,"vm1",netid=netid)
521
522 nova_wait_boot(tenant_1,"vm1", "ACTIVE")
523 nova_wait_boot(tenant_2,"vm1", "ACTIVE")
524
525 router_create(tenant_1,"r1")
526 router_interface_add(tenant_1,"r1","as1")
527 router_create(tenant_2,"r1")
528 router_interface_add(tenant_2,"r1","as1")
529
530 create_net(tenant_1,"x1","","--router:external=True")
531 create_net(tenant_2,"x1","","--router:external=True")
532
533 router_gateway_set(tenant_1,"r1","x1")
534 router_gateway_set(tenant_2,"r1","x1")
535
536 subnetid_1 = get_id(tenant_1,"subnet","as1")
537 subnetid_2 = get_id(tenant_2,"subnet","as1")
538 port_create(tenant_1,"p1","a1","10.0.1.100",subnetid_1)
539 port_create(tenant_2,"p1","a1","10.0.1.100",subnetid_2)
540
541 port_id_1 = get_id(tenant_1,"port","p1")
542 port_id_2 = get_id(tenant_2,"port","p1")
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000543 status = validate_vtn_flows()
544 assert_equal(status, True)
ChetanGaonker71fe0302016-12-19 17:45:44 -0800545
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000546 def test_cordvtn_for_creation_of_network(self):
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800547 onos_load_config()
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800548
549 ret1 = create_tenant(netA)
550 if ret1 != 0:
551 print "Creation of Tenant netA Failed"
552
553 ret2 = create_tenant(netB)
554 if ret2 != 0:
555 print "Creation of Tenant netB Failed"
ChetanGaonkerd65b7612016-12-07 01:01:20 -0800556 network = {'name': self.network_name, 'admin_state_up': True}
557 self.neutron.create_network({'network':network})
558 log.info("Created network:{0}".format(self.network_name))
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000559 status = validate_vtn_flows()
560 assert_equal(status, True)
ChetanGaonkerd65b7612016-12-07 01:01:20 -0800561
562 def test_cordvtn_to_create_net_work_with_subnet(self):
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800563 onos_load_config()
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800564
565 ret1 = create_tenant(netA)
566 if ret1 != 0:
567 print "Creation of Tenant netA Failed"
568
569 ret2 = create_tenant(netB)
570 if ret2 != 0:
571 print "Creation of Tenant netB Failed"
ChetanGaonkerd65b7612016-12-07 01:01:20 -0800572 network_name = self.network_name
573 network = {'name': network_name, 'admin_state_up': True}
574 network_info = self.neutron.create_network({'network':network})
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800575 network_id = network_info['network']['id']
ChetanGaonkerd65b7612016-12-07 01:01:20 -0800576
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800577 log.info("Created network:{0}".format(network_id))
ChetanGaonkerd65b7612016-12-07 01:01:20 -0800578 self.network_ids.append(network_id)
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800579 subnet_count = 1
580 for cidr in self.subnet_cidrs:
ChetanGaonkerd65b7612016-12-07 01:01:20 -0800581 gateway_ip = str(list(cidr)[1])
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800582 subnet = {"network_id": network_id, "ip_version":4,
583 "cidr":str(cidr), "enable_dhcp":True,
584 "host_routes":[{"destination":"0.0.0.0/0", "nexthop":gateway_ip}]
585 }
ChetanGaonkerd65b7612016-12-07 01:01:20 -0800586 subnet = {"name":"subnet-"+str(subnet_count), "network_id": network_id, "ip_version":4, "cidr":str(cidr), "enable_dhcp":True}
587 print subnet
588 self.neutron.create_subnet({'subnet':subnet})
589 log.info("Created subnet:{0}".format(str(cidr)))
590 if not self.number_of_subnet - 1:
591 break
592 self.number_of_subnet -= 1
593 subnet_count += 1
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000594 status = validate_vtn_flows()
595 assert_equal(status, True)
ChetanGaonkerd65b7612016-12-07 01:01:20 -0800596
597 def test_cordvtn_subnet_limit(self):
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800598 onos_load_config()
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800599
600 ret1 = create_tenant(netA)
601 if ret1 != 0:
602 print "Creation of Tenant netA Failed"
603
604 ret2 = create_tenant(netB)
605 if ret2 != 0:
606 print "Creation of Tenant netB Failed"
ChetanGaonkerd65b7612016-12-07 01:01:20 -0800607 network_name = uuid.uuid4().get_hex()
608 network = {'name': network_name, 'admin_state_up': True}
609 network_info = self.neutron.create_network({'network':network})
610 log.info("Created network:{0}".format(network_name))
611 network_id = network_info['network']['id']
612 self.network_ids.append(network_id)
613 subnet_cidrs = ['11.2.2.0/29', '11.2.2.8/29']
614 for cidr in subnet_cidrs:
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800615 subnet = {"network_id": network_id, "ip_version":4, "cidr": cidr}
616 subnet_info = self.neutron.create_subnet({'subnet':subnet})
617 subnet_id = subnet_info['subnet']['id']
618 log.info("Created subnet:{0}".format(cidr))
ChetanGaonkerd65b7612016-12-07 01:01:20 -0800619 while True:
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800620 port = {"network_id": network_id, "admin_state_up": True}
621 port_info = self.neutron.create_port({'port':port})
622 port_id = port_info['port']['id']
623 self.port_ids.append(port_id)
624 log.info("Created Port:{0}".format(port_info['port']['id']))
625 if not self.quota_limit:
ChetanGaonkerd65b7612016-12-07 01:01:20 -0800626 break
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800627 self.quota_limit -= 1
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000628 status = validate_vtn_flows()
629 assert_equal(status, True)
ChetanGaonkerd65b7612016-12-07 01:01:20 -0800630
631 def test_cordvtn_floatingip_limit(self):
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800632 onos_load_config()
ChetanGaonkerd65b7612016-12-07 01:01:20 -0800633
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800634 ret1 = create_tenant(netA)
635 if ret1 != 0:
636 print "Creation of Tenant netA Failed"
637
638 ret2 = create_tenant(netB)
639 if ret2 != 0:
640 print "Creation of Tenant netB Failed"
641 while True:
642 floatingip = {"floating_network_id": self.floating_nw_id}
643 fip_info = self.neutron.create_floatingip({'floatingip':floatingip})
644 fip_id = fip_info['floatingip']['id']
645 log.info("Created Floating IP:{0}".format(fip_id))
646 self.fip_ids.append(fip_id)
647 if not self.quota_limit:
648 break
649 self.quota_limit -= 1
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000650 status = validate_vtn_flows()
651 assert_equal(status, True)
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800652
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000653 def test_cordvtn_for_10_neutron_networks(self):
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800654 onos_load_config()
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800655
656 ret1 = create_tenant(netA)
657 if ret1 != 0:
658 print "Creation of Tenant netA Failed"
659
660 ret2 = create_tenant(netB)
661 if ret2 != 0:
662 print "Creation of Tenant netB Failed"
663 pool = Pool(processes=10)
664 ret = os.system("neutron quote-update --network 15")
665 if ret1 != 0:
666 print "Neutron network install failed"
667 for i in range(1, 11):
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000668 pool.apply_async(create_network, (i, ))
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800669
670 pool.close()
671 pool.join()
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000672 status = validate_vtn_flows()
673 assert_equal(status, True)
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800674
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000675 def test_cordvtn_for_100_neutron_networks(self):
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800676 onos_load_config()
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800677
678 ret1 = create_tenant(netA)
679 if ret1 != 0:
680 print "Creation of Tenant netA Failed"
681
682 ret2 = create_tenant(netB)
683 if ret2 != 0:
684 print "Creation of Tenant netB Failed"
685 pool = Pool(processes=10)
686
687 ret = os.system("neutron quote-update --network 105")
688 if ret1 != 0:
689 print "Neutron network install failed"
690 for i in range(1, 101):
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000691 pool.apply_async(create_network, (i, ))
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800692
693 pool.close()
694 pool.join()
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000695 status = validate_vtn_flows()
696 assert_equal(status, True)
697
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000698 def test_cordvtn_creating_virtual_private_network(self):
699 """
700 Algo:
701 1) Validate that required openstack service is up and running.
702 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
703 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network.
704 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
705 4) Verify that NetA is being created and validate IP in nova list command.
706 5) Verify that flow is being added in ovs-switch in compute-node.
707 6) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
708 """
709 pass
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000710
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000711 def test_cordvtn_creating_virtual_public_network(self):
712 """
713 Algo:
714 1) Validate that required openstack service is up and running.
715 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
716 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as public network.
717 (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24).
718 4) Verify that NetA is being created and validate IP in nova list command.
719 5) Verify that flow is being added in ovs-switch in compute-node.
720 6) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
721 """
722 pass
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000723
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000724 def test_cordvtn_creating_virtual_local_management_network(self):
725 """
726 Algo:
727 1) Validate that required openstack service is up and running.
728 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
729 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
730 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
731 4) Verify that NetA is being created and validate IP in nova list command.
732 5) Verify that flow is being added in ovs-switch in compute-node.
733 6) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
734 """
735 pass
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000736
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000737 def test_cordvtn_creating_virtual_vlan_connectivity_network(self):
738 """
739 Algo:
740 1) Validate that required openstack service is up and running.
741 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
742 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a vlan port-create.
743 (neutron port-create net-A-private --name stag-100).
744 4) Verify that NetA is being created and validate IP in nova list command.
745 5) Verify that flow is being added in ovs-switch in compute-node.
746 6) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
747 """
748 pass
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000749
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000750 def test_cordvtn_creating_virtual_floating_IP_with_vlan_connectivity_network(self):
751 """
752 Algo:
753 1) Validate that required openstack service is up and running.
754 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
755 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a floating ip and vlan port-create.
756 (neutron port-create net-A-private --name stag-500).
757 4) Verify that NetA is being created and validate IP in nova list command.
758 5) Verify that flow is being added in ovs-switch in compute-node.
759 6) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
760 """
761 pass
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000762
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000763 def test_cordvtn_creating_virtual_private_network_and_boot_image(self):
764 """
765 Algo:
766 1) Validate that required openstack service is up and running.
767 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
768 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network.
769 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
770 4) Now boot image in the same created network using nova boot image command (example given below :-
771 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
772 5) Wait till VM boots up and starts running.
773 6) Verify that a VM is launched and running by using novaclient python API.
774 7) Verify that flow is being added in ovs-switch in compute-node.
775 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
776 9) Verify that cord-onos pushed flows to OVS switch.
777 """
778 pass
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000779
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000780 def test_cordvtn_creating_virtual_public_network_and_boot_image(self):
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000781
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000782 """
783 Algo:
784 1) Validate that required openstack service is up and running.
785 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
786 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as public network.
787 (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24).
788 4) Now boot image in the same created network using nova boot image command (example given below :-
789 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
790 5) Wait till VM boots up and starts running.
791 6) Verify that a VM is launched and running by using novaclient python API.
792 7) Verify that flow is being added in ovs-switch in compute-node.
793 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
794 9) Verify that cord-onos pushed flows to OVS switch.
795 """
796 pass
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000797
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000798 def test_cordvtn_creating_virtual_local_management_network_and_boot_image(self):
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000799
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000800 """
801 Algo:
802 1) Validate that required openstack service is up and running.
803 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
804 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
805 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
806 4) Now boot image in the same created network using nova boot image command (example given below :-
807 nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
808 5) Wait till VM boots up and starts running.
809 6) Verify that a VM is launched and running by using novaclient python API.
810 7) Verify that flow is being added in ovs-switch in compute-node.
811 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
812 9) Verify that cord-onos pushed flows to OVS switch.
813 """
814 pass
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000815
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000816 def test_cordvtn_creating_virtual_vlan_connectivity_network_and_boot_image(self):
817 """
818 Algo:
819 1) Validate that required openstack service is up and running.
820 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
821 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a vlan port-create.
822 (neutron port-create net-A-private --name stag-100).
823 4) Now boot image in the same created network using nova boot image command (example given below :-
824 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
825 5) Wait till VM boots up and starts running.
826 6) Verify that a VM is launched and running by using novaclient python API.
827 7) Verify that flow is being added in ovs-switch in compute-node.
828 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
829 9) Verify that cord-onos pushed flows to OVS switch.
830 """
831 pass
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000832
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000833 def test_cordvtn_creating_virtual_floating_IP_with_vlan_connectivity_network_and_boot_image(self):
834 """
835 Algo:
836 1) Validate that required openstack service is up and running.
837 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
838 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a floating ip and vlan port-create.
839 (neutron port-create net-A-private --name stag-500).
840 4) Now boot image in the same created network using nova boot image command (example given below :-
841 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
842 5) Wait till VM boots up and starts running.
843 6) Verify that a VM is launched and running by using novaclient python API.
844 7) Verify that flow is being added in ovs-switch in compute-node.
845 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
846 9) Verify that cord-onos pushed flows to OVS switch.
847 """
848 pass
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000849
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000850 def test_cordvtn_creating_virtual_private_network_and_boot_2_images_in_same_service(self):
851 """
852 Algo:
853 1) Validate that required openstack service is up and running.
854 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
855 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network.
856 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
857 4) Now boot 2 images in the same created network using nova boot image command (example given below :-
858 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
859 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-02
860 5) Wait till VMs boot up and running.
861 6) Verify that two VMs are launched and running by using novaclient python API.
862 7) Verify that flow is being added in ovs-switch in compute-node.
863 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
864 9) Verify that cord-onos pushed flows to OVS switch.
865 """
866 pass
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000867
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000868 def test_cordvtn_creating_virtual_public_network_and_boot_2_images_in_same_service(self):
869 """
870 Algo:
871 1) Validate that required openstack service is up and running.
872 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
873 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as public network.
874 (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24).
875 4) Now boot 2 images in the same created network using nova boot image command (example given below :-
876 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
877 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-02
878 5) Wait till VMs boot up and running.
879 6) Verify that two VMs are launched and running by using novaclient python API.
880 7) Verify that flow is being added in ovs-switch in compute-node.
881 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
882 9) Verify that cord-onos pushed flows to OVS switch.
883 """
884 pass
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000885
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000886 def test_cordvtn_creating_virtual_local_management_network_and_boot_2_images_in_same_service(self):
887 """
888 Algo:
889 1) Validate that required openstack service is up and running.
890 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
891 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
892 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
893 4) Now boot two images in the same created network using nova boot image command (example given below :-
894 nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
895 nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-02
896 5) Wait till VMs boot up and running.
897 6) Verify that two VMs are launched and running by using novaclient python API.
898 7) Verify that flow is being added in ovs-switch in compute-node.
899 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
900 9) Verify that cord-onos pushed flows to OVS switch.
901 """
902 pass
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000903
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000904 def test_cordvtn_creating_virtual_vlan_connectivity_network_and_boot_2_images_in_same_service(self):
905 """
906 Algo:
907 1) Validate that required openstack service is up and running.
908 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
909 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a vlan port-create.
910 (neutron port-create net-A-private --name stag-100).
911 4) Now boot two images in the same created network using nova boot image command (example given below :-
912 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
913 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
914 5) Wait till VMs boot up and running.
915 6) Verify that two VMs are launched and running by using novaclient python API.
916 7) Verify that flow is being added in ovs-switch in compute-node.
917 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
918 9) Verify that cord-onos pushed flows to OVS switch.
919 """
920 pass
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000921
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000922 def test_cordvtn_creating_virtual_floating_IP_with_vlan_connectivity_network_and_boot_2_images_in_same_service(self):
923 """
924 Algo:
925 1) Validate that required openstack service is up and running.
926 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
927 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a floating ip and vlan port-create.
928 (neutron port-create net-A-private --name stag-500).
929 4) Now boot two images in the same created network using nova boot image command (example given below :-
930 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
931 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-02
932 5) Wait till VMs boot up and running.
933 6) Verify that two VMs are launched and running by using novaclient python API.
934 7) Verify that flow is being added in ovs-switch in compute-node.
935 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
936 9) Verify that cord-onos pushed flows to OVS switch.
937 """
938 pass
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800939
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000940 def test_cordvtn_creating_virtual_private_network_and_boot_2_images_in_same_service_connectivity(self):
941 """
942 Algo:
943 1) Validate that required openstack service is up and running.
944 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
945 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network.
946 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
947 4) Now boot 2 images in the same created network using nova boot image command (example given below :-
948 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
949 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-02
950 5) Wait till VMs boot up and running.
951 6) Verify that two VMs are launched and running by using novaclient python API.
952 7) Now ping to the VM from other VM which are launched in same network
953 8) verify that ping is successful
954 9) Verify that flow is being added in ovs-switch in compute-node.
955 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
956 11) Verify that cord-onos pushed flows to OVS switch.
957 """
958 pass
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800959
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000960 def test_cordvtn_creating_virtual_public_network_and_boot_2_images_in_same_service_connectivity_negative_scenario(self):
961 """
962 Algo:
963 1) Validate that required openstack service is up and running.
964 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
965 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as public network.
966 (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24).
967 4) Now boot 2 images in the same created network using nova boot image command (example given below :-
968 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
969 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-02
970 5) Wait till VMs boot up and running.
971 6) Verify that two VMs are launched and running by using novaclient python API.
972 7) Now ping to the VM from other VM which are launched in same network
973 8) verify that ping is not successful
974 9) Verify that flow is being added in ovs-switch in compute-node.
975 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
976 11) Verify that cord-onos pushed flows to OVS switch.
977 """
978 pass
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800979
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000980 def test_cordvtn_creating_virtual_local_management_network_and_boot_2_images_in_same_service_connectivity_negative_scenario(self):
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800981
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000982 """
983 Algo:
984 1) Validate that required openstack service is up and running.
985 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
986 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
987 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
988 4) Now boot two images in the same created network using nova boot image command (example given below :-
989 nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
990 nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-02
991 5) Wait till VMs boot up and running.
992 6) Verify that two VMs are launched and running by using novaclient python API.
993 7) Now ping to the VM from other VM which are launched in same network
994 8) verify that ping is not successful
995 9) Verify that flow is being added in ovs-switch in compute-node.
996 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
997 11) Verify that cord-onos pushed flows to OVS switch.
998 """
999 pass
ChetanGaonkeraaea6b62016-12-16 17:06:39 -08001000
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001001 def test_cordvtn_creating_virtual_vlan_connectivity_network_and_boot_2_images_in_same_service_connectivity_negative_scenario(self):
ChetanGaonkeraaea6b62016-12-16 17:06:39 -08001002
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001003 """
1004 Algo:
1005 1) Validate that required openstack service is up and running.
1006 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1007 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a vlan port-create.
1008 (neutron port-create net-A-private --name stag-100).
1009 4) Now boot two images in the same created network using nova boot image command (example given below :-
1010 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
1011 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
1012 5) Wait till VMs boot up and running.
1013 6) Verify that two VMs are launched and running by using novaclient python API.
1014 7) Now ping to the VM from other VM which are launched in same network
1015 8) verify that ping is not successful
1016 9) Verify that flow is being added in ovs-switch in compute-node.
1017 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1018 11) Verify that cord-onos pushed flows to OVS switch.
1019 """
1020 pass
ChetanGaonkeraaea6b62016-12-16 17:06:39 -08001021
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001022 def test_cordvtn_creating_virtual_floating_IP_with_vlan_connectivity_network_and_boot_2_images_in_same_service_connectivity_negative_scenario(self):
1023 """
1024 Algo:
1025 1) Validate that required openstack service is up and running.
1026 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1027 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a floating ip and vlan port-create.
1028 (neutron port-create net-A-private --name stag-500).
1029 4) Now boot two images in the same created network using nova boot image command (example given below :-
1030 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
1031 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-02
1032 5) Wait till VMs boot up and running.
1033 6) Verify that two VMs are launched and running by using novaclient python API.
1034 7) Now ping to the VM from other VM which are launched in same network
1035 8) verify that ping is not successful
1036 9) Verify that flow is being added in ovs-switch in compute-node.
1037 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1038 11) Verify that cord-onos pushed flows to OVS switch.
1039 """
1040 pass
ChetanGaonkeraaea6b62016-12-16 17:06:39 -08001041
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001042 def test_cordvtn_creating_virtual_private_network_and_boot_image_connectivity_negative_scenario(self):
1043 """
1044 Algo:
1045 1) Validate that required openstack service is up and running.
1046 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1047 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network.
1048 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
1049 4) Now boot image in the same created network using nova boot image command (example given below :-
1050 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1051 5) Wait till VM boots up and starts running.
1052 6) Verify that a VM is launched and running by using novaclient python API.
1053 7) Now ping to the VM from outside network which are internet network (global ping)
1054 8) verify that ping is not successful
1055 9) Verify that flow is being added in ovs-switch in compute-node.
1056 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1057 11) Verify that cord-onos pushed flows to OVS switch.
1058 """
1059 pass
ChetanGaonkeraaea6b62016-12-16 17:06:39 -08001060
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001061 def test_cordvtn_creating_virtual_public_network_and_boot_image_connectivity(self):
1062 """
1063 Algo:
1064 1) Validate that required openstack service is up and running.
1065 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1066 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as public network.
1067 (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24).
1068 4) Now boot image in the same created network using nova boot image command (example given below :-
1069 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1070 5) Wait till VM boots up and starts running.
1071 6) Verify that a VM is launched and running by using novaclient python API.
1072 7) Now ping to the VM from outside network which are internet network (global ping)
1073 8) verify that ping is successful
1074 9) Verify that flow is being added in ovs-switch in compute-node.
1075 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1076 11) Verify that cord-onos pushed flows to OVS switch.
1077 """
1078 pass
ChetanGaonkeraaea6b62016-12-16 17:06:39 -08001079
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001080 def test_cordvtn_creating_virtual_local_management_network_and_boot_image_connectivity_negative_scenario(self):
1081 """
1082 Algo:
1083 1) Validate that required openstack service is up and running.
1084 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1085 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
1086 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
1087 4) Now boot image in the same created network using nova boot image command (example given below :-
1088 nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1089 5) Wait till VM boots up and starts running.
1090 6) Verify that a VM is launched and running by using novaclient python API.
1091 7) Now ping to the VM from outside network which are internet network (global ping)
1092 8) verify that ping is not successful
1093 9) Verify that flow is being added in ovs-switch in compute-node.
1094 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1095 11) Verify that cord-onos pushed flows to OVS switch.
1096 """
1097 pass
ChetanGaonkeraaea6b62016-12-16 17:06:39 -08001098
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001099 def test_cordvtn_creating_virtual_vlan_connectivity_network_and_boot_image_connectivity_negative_scenario(self):
1100 """
1101 Algo:
1102 1) Validate that required openstack service is up and running.
1103 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1104 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a vlan port-create.
1105 (neutron port-create net-A-private --name stag-100).
1106 4) Now boot image in the same created network using nova boot image command (example given below :-
1107 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
1108 5) Wait till VM boots up and starts running.
1109 6) Verify that a VM is launched and running by using novaclient python API.
1110 7) Now ping to the VM from outside network which are internet network (global ping)
1111 8) verify that ping is not successful
1112 9) Verify that flow is being added in ovs-switch in compute-node.
1113 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1114 11) Verify that cord-onos pushed flows to OVS switch.
1115 """
1116 pass
ChetanGaonkeraaea6b62016-12-16 17:06:39 -08001117
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001118 def test_cordvtn_creating_virtual_floating_IP_with_vlan_connectivity_network_and_boot_image_connectivity_negative_scenario(self):
1119 """
1120 Algo:
1121 1) Validate that required openstack service is up and running.
1122 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1123 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a floating ip and vlan port-create.
1124 (neutron port-create net-A-private --name stag-500).
1125 4) Now boot image in the same created network using nova boot image command (example given below :-
1126 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
1127 5) Wait till VM boots up and starts running.
1128 6) Verify that a VM is launched and running by using novaclient python API.
1129 7) Now ping to the VM from outside network which are internet network (global ping)
1130 8) verify that ping is not successful
1131 9) Verify that flow is being added in ovs-switch in compute-node.
1132 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1133 11) Verify that cord-onos pushed flows to OVS switch.
1134 """
1135 pass
ChetanGaonkeraaea6b62016-12-16 17:06:39 -08001136
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001137 def test_cordvtn_creating_virtual_private_network_and_boot_image_connectivity_negative_scenario(self):
1138 """
1139 Algo:
1140 1) Validate that required openstack service is up and running.
1141 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1142 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network.
1143 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
1144 4) Now boot image in the same created network using nova boot image command (example given below :-
1145 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1146 5) Wait till VM boots up and starts running.
1147 6) Verify that a VM is launched and running by using novaclient python API.
1148 7) Now ping to the VM from compute node network which are launched a VM.
1149 8) verify that ping is not successful
1150 9) Verify that flow is being added in ovs-switch in compute-node.
1151 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1152 11) Verify that cord-onos pushed flows to OVS switch.
1153 """
1154 pass
ChetanGaonkeraaea6b62016-12-16 17:06:39 -08001155
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001156 def test_cordvtn_creating_virtual_public_network_and_boot_image_connectivity_negative_scenario(self):
1157 """
1158 Algo:
1159 1) Validate that required openstack service is up and running.
1160 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1161 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as public network.
1162 (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24).
1163 4) Now boot image in the same created network using nova boot image command (example given below :-
1164 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1165 5) Wait till VM boots up and starts running.
1166 6) Verify that a VM is launched and running by using novaclient python API.
1167 7) Now ping to the VM from compute node network which are launched a VM.
1168 8) verify that ping is not successful
1169 9) Verify that flow is being added in ovs-switch in compute-node.
1170 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1171 11) Verify that cord-onos pushed flows to OVS switch.
1172 """
1173 pass
ChetanGaonkeraaea6b62016-12-16 17:06:39 -08001174
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001175 def test_cordvtn_creating_virtual_local_management_network_and_boot_image_connectivity(self):
1176 """
1177 Algo:
1178 1) Validate that required openstack service is up and running.
1179 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1180 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
1181 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
1182 4) Now boot image in the same created network using nova boot image command (example given below :-
1183 nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1184 5) Wait till VM boots up and starts running.
1185 6) Verify that a VM is launched and running by using novaclient python API.
1186 7) Now ping to the VM from compute node network which are launched a VM.
1187 8) verify that ping is successful
1188 9) Verify that flow is being added in ovs-switch in compute-node.
1189 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1190 11) Verify that cord-onos pushed flows to OVS switch.
1191 """
1192 pass
ChetanGaonkeraaea6b62016-12-16 17:06:39 -08001193
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001194 def test_cordvtn_creating_virtual_vlan_connectivity_network_and_boot_image_connectivity_negative_scenario(self):
1195 """
1196 Algo:
1197 1) Validate that required openstack service is up and running.
1198 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1199 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a vlan port-create.
1200 (neutron port-create net-A-private --name stag-100).
1201 4) Now boot image in the same created network using nova boot image command (example given below :-
1202 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
1203 5) Wait till VM boots up and starts running.
1204 6) Verify that a VM is launched and running by using novaclient python API.
1205 7) Now ping to the VM from compute node network which are launched a VM.
1206 8) verify that ping is not successful
1207 9) Verify that flow is being added in ovs-switch in compute-node.
1208 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1209 11) Verify that cord-onos pushed flows to OVS switch.
1210 """
1211 pass
ChetanGaonkeraaea6b62016-12-16 17:06:39 -08001212
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001213 def test_cordvtn_creating_virtual_floating_IP_with_vlan_connectivity_network_and_boot_image_connectivity_negative_scenario(self):
1214 """
1215 Algo:
1216 1) Validate that required openstack service is up and running.
1217 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1218 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a floating ip and vlan port-create.
1219 (neutron port-create net-A-private --name stag-500).
1220 4) Now boot image in the same created network using nova boot image command (example given below :-
1221 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
1222 5) Wait till VM boots up and starts running.
1223 6) Verify that a VM is launched and running by using novaclient python API.
1224 7) Now ping to the VM from compute node network which are launched a VM.
1225 8) verify that ping is not successful
1226 9) Verify that flow is being added in ovs-switch in compute-node.
1227 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1228 11) Verify that cord-onos pushed flows to OVS switch.
1229 """
1230 pass
ChetanGaonkeraaea6b62016-12-16 17:06:39 -08001231
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001232 def test_cordvtn_creating_virtual_vlan_interface_private_network_and_boot_image_connectivity_negative_scenario(self):
ChetanGaonkeraaea6b62016-12-16 17:06:39 -08001233
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001234 """
1235 Algo:
1236 1) Validate that required openstack service is up and running.
1237 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1238 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network.
1239 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
1240 4) Now boot image in the same created network using nova boot image command (example given below :-
1241 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1242 5) Wait till VM boots up and starts running.
1243 6) Verify that a VM is launched and running by using novaclient python API.
1244 7) Create a virtual interface with vlan tag and private ip on VM.
1245 8) Create a same virtual interface with valn tag and private ip on head node.
1246 9) Now ping to the VM from head node network which are launched a openstack service.
1247 10) verify that ping is successful
1248 11) Verify that flow is being added in ovs-switch in compute-node.
1249 12) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1250 13) Verify that cord-onos pushed flows to OVS switch.
1251 """
1252 pass
ChetanGaonkeraaea6b62016-12-16 17:06:39 -08001253
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001254 def test_cordvtn_creating_virtual_vlan_interface_public_network_and_boot_image_connectivity_negative_scenario(self):
ChetanGaonker901727c2016-11-29 14:05:03 -08001255
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001256 """
1257 Algo:
1258 1) Validate that required openstack service is up and running.
1259 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1260 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as public network.
1261 (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24).
1262 4) Now boot image in the same created network using nova boot image command (example given below :-
1263 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1264 5) Wait till VM boots up and starts running.
1265 6) Verify that a VM is launched and running by using novaclient python API.
1266 7) Create a virtual interface with vlan tag and public ip on VM.
1267 8) Create a same virtual interface with valn tag and any pulic ip on head node.
1268 9) Now ping to the VM from head node network which are launched a openstack service.
1269 10) verify that ping is successful
1270 11) Verify that flow is being added in ovs-switch in compute-node.
1271 12) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1272 13) Verify that cord-onos pushed flows to OVS switch.
1273 """
1274 pass
ChetanGaonker901727c2016-11-29 14:05:03 -08001275
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001276 def test_cordvtn_creating_virtual_vlan_interface_local_management_network_and_boot_image_connectivity(self):
ChetanGaonker901727c2016-11-29 14:05:03 -08001277
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001278 """
1279 Algo:
1280 1) Validate that required openstack service is up and running.
1281 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1282 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
1283 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
1284 4) Now boot image in the same created network using nova boot image command (example given below :-
1285 nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1286 5) Wait till VM boots up and starts running.
1287 6) Verify that a VM is launched and running by using novaclient python API.
1288 7) Create a virtual interface with vlan tag and local management ip on VM.
1289 8) Create a same virtual interface with valn tag and any local management ip on head node.
1290 9) Now ping to the VM from head node network which are launched a openstack service.
1291 10) verify that ping is successful
1292 11) Verify that flow is being added in ovs-switch in compute-node.
1293 12) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1294 13) Verify that cord-onos pushed flows to OVS switch.
1295 """
1296 pass
ChetanGaonker901727c2016-11-29 14:05:03 -08001297
ChetanGaonker901727c2016-11-29 14:05:03 -08001298
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001299 def test_cordvtn_creating_virtual_vlan_interface_floating_private_network_and_boot_image_connectivity_negative_scenario(self):
ChetanGaonker901727c2016-11-29 14:05:03 -08001300
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001301 """
1302 Algo:
1303 1) Validate that required openstack service is up and running.
1304 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1305 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network.
1306 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
1307 4) Now boot image in the same created network using nova boot image command (example given below :-
1308 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1309 5) Wait till VM boots up and starts running.
1310 6) Verify that a VM is launched and running by using novaclient python API.
1311 7) Create a virtual interface with vlan tag and private floating ip on VM.
1312 8) Create a same virtual interface with valn tag and private floating ip on head node.
1313 9) Now ping to the VM from head node network which are launched a openstack service.
1314 10) verify that ping is successful
1315 11) Verify that flow is being added in ovs-switch in compute-node.
1316 12) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1317 13) Verify that cord-onos pushed flows to OVS switch.
1318 """
1319 pass
ChetanGaonker901727c2016-11-29 14:05:03 -08001320
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001321 def test_cordvtn_creating_virtual_vlan_interface_floating_public_network_and_boot_image_connectivity_negative_scenario(self):
ChetanGaonker901727c2016-11-29 14:05:03 -08001322
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001323 """
1324 Algo:
1325 1) Validate that required openstack service is up and running.
1326 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1327 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as public network.
1328 (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24).
1329 4) Now boot image in the same created network using nova boot image command (example given below :-
1330 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1331 5) Wait till VM boots up and starts running.
1332 6) Verify that a VM is launched and running by using novaclient python API.
1333 7) Create a virtual interface with vlan tag and public floating ip on VM.
1334 8) Create a same virtual interface with valn tag and any pulic floating ip on head node.
1335 9) Now ping to the VM from head node network which are launched a openstack service.
1336 10) verify that ping is successful
1337 11) Verify that flow is being added in ovs-switch in compute-node.
1338 12) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1339 13) Verify that cord-onos pushed flows to OVS switch.
1340 """
1341 pass
ChetanGaonker901727c2016-11-29 14:05:03 -08001342
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001343 def test_cordvtn_creating_virtual_vlan_interface_floating_local_management_network_and_boot_image_connectivity(self):
ChetanGaonker901727c2016-11-29 14:05:03 -08001344
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001345 """
1346 Algo:
1347 1) Validate that required openstack service is up and running.
1348 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1349 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
1350 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
1351 4) Now boot image in the same created network using nova boot image command (example given below :-
1352 nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1353 5) Wait till VM boots up and starts running.
1354 6) Verify that a VM is launched and running by using novaclient python API.
1355 7) Create a virtual interface with vlan tag and local management floating ip on VM.
1356 8) Create a same virtual interface with valn tag and any local management floating ip on head node.
1357 9) Now ping to the VM from head node network which are launched a openstack service.
1358 10) verify that ping is successful
1359 11) Verify that flow is being added in ovs-switch in compute-node.
1360 12) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1361 13) Verify that cord-onos pushed flows to OVS switch.
1362 """
1363 pass
ChetanGaonker901727c2016-11-29 14:05:03 -08001364
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001365 def test_cordvtn_creating_one_virtual_public_and_a_private_network_and_boot_2_images_in_same_service_connectivity_negative_scenario(self):
ChetanGaonkeraaea6b62016-12-16 17:06:39 -08001366
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001367 """
1368 Algo:
1369 1) Validate that required openstack service is up and running.
1370 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1371 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as public network.
1372 (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24).
1373 4) Now boot 2 images in the same created network using nova boot image command (example given below :-
1374 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1375 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-02
1376 5) Wait till VMs boot up and running.
1377 6) Verify that two VMs are launched and running by using novaclient python API.
1378 7) Now ping to the VM from other VM which are launched in the private network
1379 8) verify that ping is not successful
1380 9) Verify that flow is being added in ovs-switch in compute-node.
1381 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1382 11) Verify that cord-onos pushed flows to OVS switch.
1383 """
1384 pass
ChetanGaonker901727c2016-11-29 14:05:03 -08001385
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001386 def test_cordvtn_creating_one_virtual_local_management_and_a_private_network_and_boot_2_images_in_same_service_connectivity_negative_scenario(self):
ChetanGaonker901727c2016-11-29 14:05:03 -08001387
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001388 """
1389 Algo:
1390 1) Validate that required openstack service is up and running.
1391 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1392 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
1393 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
1394 4) Now boot two images in the same created network using nova boot image command (example given below :-
1395 nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1396 nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-02
1397 5) Wait till VMs boot up and running.
1398 6) Verify that two VMs are launched and running by using novaclient python API.
1399 7) Now ping to the VM from other VM which are launched in the private network
1400 8) verify that ping is not successful
1401 9) Verify that flow is being added in ovs-switch in compute-node.
1402 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1403 11) Verify that cord-onos pushed flows to OVS switch.
1404 """
1405 pass
ChetanGaonkeraaea6b62016-12-16 17:06:39 -08001406
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001407 def test_cordvtn_creating_one_virtual_vlan_connectivity_and_a_private_network_and_boot_2_images_in_same_service_connectivity_negative_scenario(self):
ChetanGaonkeraaea6b62016-12-16 17:06:39 -08001408
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001409 """
1410 Algo:
1411 1) Validate that required openstack service is up and running.
1412 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1413 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a vlan port-create.
1414 (neutron port-create net-A-private --name stag-100).
1415 4) Now boot two images in the same created network using nova boot image command (example given below :-
1416 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
1417 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
1418 5) Wait till VMs boot up and running.
1419 6) Verify that two VMs are launched and running by using novaclient python API.
1420 7) Now ping to the VM from other VM which are launched in the private network
1421 8) verify that ping is not successful
1422 9) Verify that flow is being added in ovs-switch in compute-node.
1423 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1424 11) Verify that cord-onos pushed flows to OVS switch.
1425 """
1426 pass
1427
1428 def test_cordvtn_creating_one_virtual_floating_IP_with_vlan_connectivity_and_a_private_network_and_boot_2_images_in_same_service_connectivity_negative_scenario(self):
1429
1430 """
1431 Algo:
1432 1) Validate that required openstack service is up and running.
1433 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1434 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a floating ip and vlan port-create.
1435 (neutron port-create net-A-private --name stag-500).
1436 4) Now boot two images in the same created network using nova boot image command (example given below :-
1437 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
1438 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-02
1439 5) Wait till VMs boot up and running.
1440 6) Verify that two VMs are launched and running by using novaclient python API.
1441 7) Now ping to the VM from other VM which are launched in the private network
1442 8) verify that ping is not successful
1443 9) Verify that flow is being added in ovs-switch in compute-node.
1444 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1445 11) Verify that cord-onos pushed flows to OVS switch.
1446 """
1447 pass
1448
1449 def test_cordvtn_creating_one_virtual_local_management_other_public_network_and_boot_2_images_in_same_service_connectivity_negative_scenario(self):
1450
1451 """
1452 Algo:
1453 1) Validate that required openstack service is up and running.
1454 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1455 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
1456 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
1457 4) Now boot two images in the same created network using nova boot image command (example given below :-
1458 nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1459 nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-02
1460 5) Wait till VMs boot up and running.
1461 6) Verify that two VMs are launched and running by using novaclient python API.
1462 7) Now ping to the VM from other VM which are launched in the public network
1463 8) verify that ping is not successful
1464 9) Verify that flow is being added in ovs-switch in compute-node.
1465 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1466 11) Verify that cord-onos pushed flows to OVS switch.
1467 """
1468 pass
1469
1470 def test_cordvtn_creating_one_virtual_vlan_connectivity_and_a_private_network_and_boot_2_images_in_same_service_connectivity_negative_scenario(self):
1471
1472 """
1473 Algo:
1474 1) Validate that required openstack service is up and running.
1475 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1476 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a vlan port-create.
1477 (neutron port-create net-A-private --name stag-100).
1478 4) Now boot two images in the same created network using nova boot image command (example given below :-
1479 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
1480 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
1481 5) Wait till VMs boot up and running.
1482 6) Verify that two VMs are launched and running by using novaclient python API.
1483 7) Now ping to the VM from other VM which are launched in the public network
1484 8) verify that ping is not successful
1485 9) Verify that flow is being added in ovs-switch in compute-node.
1486 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1487 11) Verify that cord-onos pushed flows to OVS switch.
1488 """
1489 pass
1490
1491 def test_cordvtn_creating_one_virtual_floating_IP_with_vlan_connectivity_and_a_private_network_and_boot_2_images_in_same_service_connectivity_negative_scenario(self):
1492
1493 """
1494 Algo:
1495 1) Validate that required openstack service is up and running.
1496 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1497 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a floating ip and vlan port-create.
1498 (neutron port-create net-A-private --name stag-500).
1499 4) Now boot two images in the same created network using nova boot image command (example given below :-
1500 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
1501 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-02
1502 5) Wait till VMs boot up and running.
1503 6) Verify that two VMs are launched and running by using novaclient python API.
1504 7) Now ping to the VM from other VM which are launched in the public network
1505 8) verify that ping is not successful
1506 9) Verify that flow is being added in ovs-switch in compute-node.
1507 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1508 11) Verify that cord-onos pushed flows to OVS switch.
1509 """
1510 pass
1511
1512 def test_cordvtn_creating_one_virtual_vlan_connectivity_other_local_management_network_and_boot_2_images_in_same_service_connectivity_negative_scenario(self):
1513
1514 """
1515 Algo:
1516 1) Validate that required openstack service is up and running.
1517 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1518 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a vlan port-create.
1519 (neutron port-create net-A-private --name stag-100).
1520 4) Now boot two images in the same created network using nova boot image command (example given below :-
1521 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
1522 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
1523 5) Wait till VMs boot up and running.
1524 6) Verify that two VMs are launched and running by using novaclient python API.
1525 7) Now ping to the VM from other VM which are launched in the public network
1526 8) verify that ping is not successful
1527 9) Verify that flow is being added in ovs-switch in compute-node.
1528 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1529 11) Verify that cord-onos pushed flows to OVS switch.
1530 """
1531 pass
1532
1533 def test_cordvtn_creating_one_virtual_floating_IP_with_vlan_connectivity_other_local_management_network_and_boot_2_images_in_same_service_connectivity_negative_scenario(self):
1534
1535 """
1536 Algo:
1537 1) Validate that required openstack service is up and running.
1538 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1539 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a floating ip and vlan port-create.
1540 (neutron port-create net-A-private --name stag-500).
1541 4) Now boot two images in the same created network using nova boot image command (example given below :-
1542 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
1543 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-02
1544 5) Wait till VMs boot up and running.
1545 6) Verify that two VMs are launched and running by using novaclient python API.
1546 7) Now ping to the VM from other VM which are launched in the public network
1547 8) verify that ping is not successful
1548 9) Verify that flow is being added in ovs-switch in compute-node.
1549 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1550 11) Verify that cord-onos pushed flows to OVS switch.
1551 """
1552 pass
1553
1554 def test_cordvtn_creating_one_virtual_floating_IP_with_vlan_connectivity_other_virtual_vlan_network_and_boot_2_images_in_same_service_connectivity_negative_scenario(self):
1555
1556 """
1557 Algo:
1558 1) Validate that required openstack service is up and running.
1559 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1560 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a floating ip and vlan port-create.
1561 (neutron port-create net-A-private --name stag-500).
1562 4) Now boot two images in the same created network using nova boot image command (example given below :-
1563 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
1564 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-02
1565 5) Wait till VMs boot up and running.
1566 6) Verify that two VMs are launched and running by using novaclient python API.
1567 7) Now ping to the VM from other VM which are launched in the public network
1568 8) verify that ping is not successful
1569 9) Verify that flow is being added in ovs-switch in compute-node.
1570 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1571 11) Verify that cord-onos pushed flows to OVS switch.
1572 """
1573 pass
1574
1575 def test_cordvtn_creating_virtual_public_network_and_boot_2_images_with_invalid_public_field_of_onos_network_cfg_json_in_same_service(self):
1576 """
1577 Algo:
1578 1) Validate that required openstack service is up and running.
1579 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1580 3) Push network_cfg.json config file to onos with an invalid public gateway ip in network_cfg.json file.
1581 4) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as public network.
1582 (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24).
1583 5) Now boot 2 images in the same created network using nova boot image command (example given below :-
1584 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1585 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-02
1586 6) Wait till VMs boot up and running.
1587 7) Verify that two VMs are launched and running by using novaclient python API.
1588 8) Verify that flow is being added in ovs-switch in compute-node.
1589 9) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1590 10) Verify that cord-onos pushed flows to OVS switch.
1591 11) Verify ping from VM to public gateway which is send to ONOS through rest API in network_cfg.json file.
1592 12) 11th step should be failed due to we are passing invalid public IP as gatway and we have not seen any flows in OVS for it.
1593 13) Now ping one VM to other VM it should not ping again even it in the same service.
1594 """
1595 pass
1596
1597 def test_cordvtn_creating_virtual_local_management_network_and_boot_image_with_invalid_localManagementIp_field_of_onos_network_cfg_json(self):
1598
1599 """
1600 Algo:
1601 1) Validate that required openstack service is up and running.
1602 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1603 3) Push network_cfg.json config file to onos with an invalid localManagement ip in network_cfg.json file.
1604 4) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
1605 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
1606 5) Now boot image in the same created network using nova boot image command (example given below :-
1607 nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1608 6) Wait till VM boots up and starts running.
1609 7) Verify that a VM is launched and running by using novaclient python API.
1610 8) Verify that flow is being added in ovs-switch in compute-node.
1611 9) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1612 10) Verify that cord-onos pushed flows to OVS switch.
1613 11) Verify ping from VM to local management ip which is send to ONOS through rest API in network_cfg.json file.
1614 12) 11th step should be failed due to we are passing invalid local management IP and we have not seen any flows in OVS for it.
1615 """
1616 pass
1617
1618 def test_cordvtn_creating_virtual_private_network_and_boot_image_with_invalid_OVSDB_port_field_of_onos_network_cfg_json(self):
1619 """
1620 Algo:
1621 1) Validate that required openstack service is up and running.
1622 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1623 3) Push network_cfg.json config file to onos with an invalid ovsdb port in network_cfg.json file.
1624 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network.
1625 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
1626 4) Now boot image in the same created network using nova boot image command (example given below :-
1627 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1628 5) Wait till VM boots up and starts running.
1629 6) Verify that a VM is launched and running by using novaclient python API.
1630 7) Verify that flows are being added in ovs-switch in compute-node.
1631 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1632 9) Verify that cord-onos did not push any flows to OVS switch.
1633 """
1634 pass
1635
1636 def test_cordvtn_creating_virtual_private_network_and_boot_image_with_invalid_OpenStack_details_in_onos_network_cfg_json(self):
1637 """
1638 Algo:
1639 1) Validate that required openstack service is up and running.
1640 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1641 3) Push network_cfg.json config file to onos with an invalid openstack in network_cfg.json file.
1642 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network.
1643 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
1644 4) Now boot image in the same created network using nova boot image command (example given below :-
1645 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1646 5) Wait till VM boots up and starts running.
1647 6) Verify that a VM is launched and running by using novaclient python API.
1648 7) Verify that no flows are being added in ovs-switch in compute-node.
1649 8) Verify that onos-ml2 plugin is not being received a message from openstack service neutron.
1650 9) Verify that cord-onos did not push any flows to OVS switch.
1651 """
1652 pass
1653
1654 def test_cordvtn_creating_virtual_private_network_and_boot_image_with_invalid_compute_node_details_in_onos_network_cfg_json(self):
1655 """
1656 Algo:
1657 1) Validate that required openstack service is up and running.
1658 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1659 3) Push network_cfg.json config file to onos with an invalid compute node details in network_cfg.json file.
1660 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network.
1661 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
1662 4) Now boot image in the same created network using nova boot image command (example given below :-
1663 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1664 5) Wait till VM boots up and starts running.
1665 6) Verify that a VM is launched and running by using novaclient python API.
1666 7) Verify that no flows are being added in ovs-switch in compute-node.
1667 8) Verify that onos-ml2 plugin is not being received a message from openstack service neutron.
1668 9) Verify that cord-onos did not push any flows to OVS switch.
1669 """
1670 pass
1671
1672
1673 def test_cordvtn_creating_two_virtual_private_networks_and_boot_images_in_different_services_connectivity(self):
1674 """
1675 Algo:
1676 1) Validate that required openstack service is up and running.
1677 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1678 3) From CORD-Test container, use python-neutron client and create two networks with name - NetA and NetB with an IP as private network.
1679 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
1680 (neutron net-create net-B-private, neutron subnet-create net-B-private 10.1.0.0/24).
1681 4) Now boot 2 images in the same created network using nova boot image command (example given below :-
1682 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1683 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-B-vm-01
1684 5) Wait till VMs boot up and running.
1685 6) Verify that two VMs are launched and running by using novaclient python API.
1686 7) Verify that flow is being added in ovs-switch in compute-node.
1687 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1688 9) Verify that cord-onos pushed flows to OVS switch.
1689 10) Now ping from VM which is Net-A to other VM which is in Net-B, should not ping.
1690 11) Verify that no flows are being added in the OVS switch.
1691 """
1692 pass
1693
1694 def test_cordvtn_creating_two_virtual_public_networks_and_boot_images_in_different_service_connectivity(self):
1695 """
1696 Algo:
1697 1) Validate that required openstack service is up and running.
1698 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1699 3) From CORD-Test container, use python-neutron client and create two networks with name - NetA and NetB with an IP as public network.
1700 (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24).
1701 (neutron net-create net-A-public, neutron subnet-create net-B-public 198.1.0.0/24).
1702 4) Now boot 2 images in the same created network using nova boot image command (example given below :-
1703 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1704 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-B-vm-01
1705 5) Wait till VMs boot up and running.
1706 6) Verify that two VMs are launched and running by using novaclient python API.
1707 7) Verify that flow is being added in ovs-switch in compute-node.
1708 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1709 9) Verify that cord-onos pushed flows to OVS switch.
1710 10) Now ping from VM which is Net-A to other VM which is in Net-B, should not ping.
1711 11) Verify that no flows are being added in the OVS switch.
1712 """
1713 pass
1714
1715 def test_cordvtn_creating_two_virtual_local_management_networks_and_boot_images_in_different_service_connectivity(self):
1716 """
1717 Algo:
1718 1) Validate that required openstack service is up and running.
1719 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1720 3) From CORD-Test container, use python-neutron client and create two networks with name - NetA and NetB with an IP as local management network.
1721 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
1722 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.28.0.0/24 -gateway 172.28.0.1).
1723 4) Now boot two images in the same created network using nova boot image command (example given below :-
1724 nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1725 nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-B-vm-01
1726 5) Wait till VMs boot up and running.
1727 6) Verify that two VMs are launched and running by using novaclient python API.
1728 7) Verify that flow is being added in ovs-switch in compute-node.
1729 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1730 9) Verify that cord-onos pushed flows to OVS switch.
1731 10) Now ping from VM which is Net-A to other VM which is in Net-B, should not ping.
1732 11) Verify that no flows are being added in the OVS switch.
1733 """
1734 pass
1735
1736 def test_cordvtn_creating_two_virtual_vlan_connectivity_networks_and_boot_images_in_different_service_connectivity(self):
1737 """
1738 Algo:
1739 1) Validate that required openstack service is up and running.
1740 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1741 3) From CORD-Test container, use python-neutron client and create two networks with name - NetA and NetB with a vlan port-create.
1742 (neutron port-create net-A-private --name stag-100).
1743 (neutron port-create net-B-private --name stag-200).
1744 4) Now boot two images in the same created network using nova boot image command (example given below :-
1745 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
1746 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg1-01
1747 5) Wait till VMs boot up and running.
1748 6) Verify that two VMs are launched and running by using novaclient python API.
1749 7) Verify that flow is being added in ovs-switch in compute-node.
1750 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1751 9) Verify that cord-onos pushed flows to OVS switch.
1752 10) Now ping from VM which is Net-A to other VM which is in Net-B, should not ping.
1753 11) Verify that no flows are being added in the OVS switch.
1754 """
1755 pass
1756 def test_cordvtn_creating_two_virtual_floating_IP_with_vlan_connectivity_networks_and_boot_images_in_different_service_connectivity(self):
1757 """
1758 Algo:
1759 1) Validate that required openstack service is up and running.
1760 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1761 3) From CORD-Test container, use python-neutron client and create two networks with name - NetA and NetB with a floating ip and vlan port-create.
1762 (neutron port-create net-A-private --name stag-500).
1763 (neutron port-create net-B-private --name stag-500).
1764 4) Now boot two images in the same created network using nova boot image command (example given below :-
1765 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
1766 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-02
1767 5) Wait till VMs boot up and running.
1768 6) Verify that two VMs are launched and running by using novaclient python API.
1769 7) Verify that flow is being added in ovs-switch in compute-node.
1770 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1771 9) Verify that cord-onos pushed flows to OVS switch.
1772 10) Now ping from VM which is Net-A to other VM which is in Net-B, should not ping.
1773 11) Verify that no flows are being added in the OVS switch.
1774 """
1775 pass
1776
1777 def test_cordvtn_creating_two_virtual_private_networks_and_boot_images_for_services_dependency_with_out_xos_direct_access(self):
1778 """
1779 Algo:
1780 1) Validate that required openstack service is up and running.
1781 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1782 3) Push service dependency data.json file to onos to subscriber of other service.
1783 $ curl -X POST -H "Content-Type: application/json" -u onos:rocks -d @data.json http://$OC1:8181/onos/cordvtn/serviceNetworks
1784 4) From CORD-Test container, use python-neutron client and create two networks with name - NetA and NetBwith an IP as private network.
1785 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
1786 (neutron net-create net-B-private, neutron subnet-create net-B-private 10.1.0.0/24).
1787 5) Now boot 2 images in the same created network using nova boot image command (example given below :-
1788 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1789 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-B-vm-01
1790 6) Wait till VMs boot up and running.
1791 7) Verify that two VMs are launched and running by using novaclient python API.
1792 8) Verify that flow is being added in ovs-switch in compute-node.
1793 9) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1794 10) Verify that cord-onos pushed flows to OVS switch.
1795 11) Now ping from VM which is Net-A to other VM which is in Net-B, should ping.
1796 12) Verify that flows are being added in the OVS switch.
1797 """
1798 pass
1799
1800 def test_cordvtn_creating_two_virtual_private_networks_and_boot_images_for_services_dependency_with_out_xos_indirect_access(self):
1801 """
1802 Algo:
1803 1) Validate that required openstack service is up and running.
1804 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1805 3) Push service dependency data.json file to onos to subscriber of other service.
1806 $ curl -X POST -H "Content-Type: application/json" -u onos:rocks -d @data.json http://$OC1:8181/onos/cordvtn/serviceNetworks
1807 4) From CORD-Test container, use python-neutron client and create two networks with name - NetA and NetBwith an IP as private network.
1808 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
1809 (neutron net-create net-B-private, neutron subnet-create net-B-private 10.1.0.0/24).
1810 5) Now boot 2 images in the same created network using nova boot image command (example given below :-
1811 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1812 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-B-vm-01
1813 6) Wait till VMs boot up and running.
1814 7) Verify that two VMs are launched and running by using novaclient python API.
1815 8) Verify that flow is being added in ovs-switch in compute-node.
1816 9) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1817 10) Verify that cord-onos pushed flows to OVS switch.
1818 11) Now ping from VM which is Net-B to other VM which is in Net-A, capture packets on port for ICMP request packets.
1819 12) Verify that flows are being added in the OVS switch.
1820 """
1821 pass
1822
1823 def test_cordvtn_creating_two_virtual_private_networks_and_boot_images_remove_services_dependency_with_out_xos_direct_access(self):
1824 """
1825 Algo:
1826 1) Validate that required openstack service is up and running.
1827 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1828 3) Push service dependency data.json file to onos to subscriber of other service.
1829 $ curl -X POST -H "Content-Type: application/json" -u onos:rocks -d @data.json http://$OC1:8181/onos/cordvtn/serviceNetworks
1830 4) From CORD-Test container, use python-neutron client and create two networks with name - NetA and NetBwith an IP as private network.
1831 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
1832 (neutron net-create net-B-private, neutron subnet-create net-B-private 10.1.0.0/24).
1833 5) Now boot 2 images in the same created network using nova boot image command (example given below :-
1834 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1835 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-B-vm-01
1836 6) Wait till VMs boot up and running.
1837 7) Verify that two VMs are launched and running by using novaclient python API.
1838 8) Verify that flow is being added in ovs-switch in compute-node.
1839 9) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1840 10) Verify that cord-onos pushed flows to OVS switch.
1841 11) Now ping from VM which is Net-A to other VM which is in Net-B, should ping.
1842 12) Verify that flows are being added in the OVS switch.
1843 13) Push config data with outservice dependency in data.json file to onos to subscriber of other service.
1844 14) Now ping from VM which is Net-A to other VM which is in Net-B, should not ping.
1845 15) Verify that no flows are being added in the OVS switch.
1846 """
1847 pass
1848
1849 def test_cordvtn_creating_two_virtual_private_networks_and_boot_images_remove_services_dependency_with_out_xos_indirect_access(self):
1850 """
1851 Algo:
1852 1) Validate that required openstack service is up and running.
1853 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1854 3) Push service dependency data.json file to onos to subscriber of other service.
1855 $ curl -X POST -H "Content-Type: application/json" -u onos:rocks -d @data.json http://$OC1:8181/onos/cordvtn/serviceNetworks
1856 4) From CORD-Test container, use python-neutron client and create two networks with name - NetA and NetBwith an IP as private network.
1857 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
1858 (neutron net-create net-B-private, neutron subnet-create net-B-private 10.1.0.0/24).
1859 5) Now boot 2 images in the same created network using nova boot image command (example given below :-
1860 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1861 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-B-vm-01
1862 6) Wait till VMs boot up and running.
1863 7) Verify that two VMs are launched and running by using novaclient python API.
1864 8) Verify that flow is being added in ovs-switch in compute-node.
1865 9) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1866 10) Verify that cord-onos pushed flows to OVS switch.
1867 11) Now ping from VM which is Net-B to other VM which is in Net-A, capture packets on port for ICMP request packets.
1868 12) Verify that flows are being added in the OVS switch.
1869 13) Push config data with out service dependency in data.json file to onos to subscriber of other service.
1870 14) Now ping from VM which is Net-B to other VM which is in Net-A, should not see any ICMP request packets on port.
1871 15) Verify that no flows are being added in the OVS switch.
1872 """
1873 pass
1874
1875 def test_cordvtn_creating_two_virtual_private_networks_and_boot_images_for_services_dependency_with_xos_direct_access(self):
1876 """
1877 Algo:
1878 1) Validate that required openstack service is up and running.
1879 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1880 3) Validate that XOS is up and running.
1881 4) From CORD-Test container, use python-neutron client and create two networks with name - NetA and NetBwith an IP as private network.
1882 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
1883 (neutron net-create net-B-private, neutron subnet-create net-B-private 10.1.0.0/24).
1884 5) Now boot 2 images in the same created network using nova boot image command (example given below :-
1885 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1886 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-B-vm-01
1887 6) Wait till VMs boot up and running.
1888 7) Verify that two VMs are launched and running by using novaclient python API.
1889 8) Verify that flow is being added in ovs-switch in compute-node.
1890 9) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1891 10) Verify that cord-onos pushed flows to OVS switch.
1892 11) Now ping from VM which is Net-A to other VM which is in Net-B, should ping.
1893 12) Verify that flows are being added in the OVS switch.
1894 """
1895 pass
1896
1897 def test_cordvtn_creating_two_virtual_private_networks_and_boot_images_for_services_dependency_with_xos_indirect_access(self):
1898 """
1899 Algo:
1900 1) Validate that required openstack service is up and running.
1901 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1902 3) Validate that XOS is up and running.
1903 4) From CORD-Test container, use python-neutron client and create two networks with name - NetA and NetBwith an IP as private network.
1904 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
1905 (neutron net-create net-B-private, neutron subnet-create net-B-private 10.1.0.0/24).
1906 5) Now boot 2 images in the same created network using nova boot image command (example given below :-
1907 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1908 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-B-vm-01
1909 6) Wait till VMs boot up and running.
1910 7) Verify that two VMs are launched and running by using novaclient python API.
1911 8) Verify that flow is being added in ovs-switch in compute-node.
1912 9) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1913 10) Verify that cord-onos pushed flows to OVS switch.
1914 11) Now ping from VM which is Net-B to other VM which is in Net-A, should ping.
1915 12) Verify that flows are being added in the OVS switch.
1916 """
1917 pass
1918
1919 def test_cordvtn_with_access_agent_serviceType_and_vtn_location_field_network_cfg_connectivity_to_access_device(self):
1920 """
1921 Algo:
1922 1) Validate that required openstack service is up and running.
1923 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1924 3) Push access-agent additional network_cfg to ONOS and specify vtn-location field info must be access-agent container.
1925 4) Launch the access-agent and access-device containers and then restart openstack compute node.
1926 $ sudo docker run --privileged --cap-add=ALL -d --name access-agent -t ubuntu:14.04 /bin/bash
1927 5) Create each interface on br-int and br-mgmt using pipework on access-agent containers
1928 $ sudo ./pipework br-mgmt -i eth1 access-agent 10.10.10.20/24
1929 $ sudo ./pipework br-int -i eth2 access-agent 10.168.0.100/24 fa:00:00:00:00:11
1930 6) We ahve to stop ONOS service to test this
1931 onos-service stop
1932 sudo ovs-ofctl -O OpenFlow13 del-flows br-int "arp"
1933 7) Now attach to access-agent container and ping to access-device
1934 8) Verify that ping should be success and flows are being added in br-int.
1935 """
1936 pass
1937
1938 def test_cordvtn_with_access_agent_serviceType_and_vtn_location_field_in_network_cfg_connectivity_to_head_node(self):
1939 """
1940 Algo:
1941 1) Validate that required openstack service is up and running.
1942 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1943 3) Push access-agent additional network_cfg to ONOS and specify vtn-location field info must be access-agent container.
1944 4) Launch the access-agent and access-device containers and then restart openstack compute node.
1945 $ sudo docker run --privileged --cap-add=ALL -d --name access-agent -t ubuntu:14.04 /bin/bash
1946 5) Create each interface on br-int and br-mgmt using pipework on access-agent containers
1947 $ sudo ./pipework br-mgmt -i eth1 access-agent 10.10.10.20/24
1948 $ sudo ./pipework br-int -i eth2 access-agent 10.168.0.100/24 fa:00:00:00:00:11
1949 6) We ahve to stop ONOS service to test this
1950 onos-service stop
1951 sudo ovs-ofctl -O OpenFlow13 del-flows br-int "arp"
1952 7) Now attach to access-agent container and ping to head node
1953 8) Verify that ping should be success and flows are being added in br-int.
1954 """
1955 pass
1956
1957 def test_cordvtn_with_access_agent_serviceType_and_invalid_vtn_location_field_network_cfg_connectivity_to_access_device(self):
1958 """
1959 Algo:
1960 1) Validate that required openstack service is up and running.
1961 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1962 3) Push access-agent additional network_cfg to ONOS and specify vtn-location field info must not be access-agent container.
1963 4) Launch the access-agent and access-device containers and then restart openstack compute node.
1964 $ sudo docker run --privileged --cap-add=ALL -d --name access-agent -t ubuntu:14.04 /bin/bash
1965 5) Create each interface on br-int and br-mgmt using pipework on access-agent containers
1966 $ sudo ./pipework br-mgmt -i eth1 access-agent 10.10.10.20/24
1967 $ sudo ./pipework br-int -i eth2 access-agent 10.168.0.100/24 fa:00:00:00:00:11
1968 6) We ahve to stop ONOS service to test this
1969 onos-service stop
1970 sudo ovs-ofctl -O OpenFlow13 del-flows br-int "arp"
1971 7) Now attach to access-agent container and ping to access-device
1972 8) Verify that ping should not be success and no flows are being added in br-int.
1973 """
1974 pass
1975
1976 def test_cordvtn_with_access_agent_serviceType_and_invalid_vtn_location_field_in_network_cfg_connectivity_to_head_node(self):
1977 """
1978 Algo:
1979 1) Validate that required openstack service is up and running.
1980 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1981 3) Push access-agent additional network_cfg to ONOS and specify vtn-location field info must not be access-agent container.
1982 4) Launch the access-agent and access-device containers and then restart openstack compute node.
1983 $ sudo docker run --privileged --cap-add=ALL -d --name access-agent -t ubuntu:14.04 /bin/bash
1984 5) Create each interface on br-int and br-mgmt using pipework on access-agent containers
1985 $ sudo ./pipework br-mgmt -i eth1 access-agent 10.10.10.20/24
1986 $ sudo ./pipework br-int -i eth2 access-agent 10.168.0.100/24 fa:00:00:00:00:11
1987 6) We ahve to stop ONOS service to test this
1988 onos-service stop
1989 sudo ovs-ofctl -O OpenFlow13 del-flows br-int "arp"
1990 7) Now attach to access-agent container and ping to head node
1991 8) Verify that ping should not be success and no flows are being added in br-int.
1992 """
1993 pass
1994
1995 def test_cordvtn_creating_virtual_private_network_and_boot_2_images_in_same_service_connectivity_after_restarting_VMs(self):
1996 """
1997 Algo:
1998 1) Validate that required openstack service is up and running.
1999 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
2000 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network.
2001 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
2002 4) Now boot 2 images in the same created network using nova boot image command (example given below :-
2003 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
2004 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-02
2005 5) Wait till VMs boot up and running.
2006 6) Verify that two VMs are launched and running by using novaclient python API.
2007 7) Now ping to the VM from other VM which are launched in same network
2008 8) verify that ping is successful
2009 9) Verify that flow is being added in ovs-switch in compute-node.
2010 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
2011 11) Verify that cord-onos pushed flows to OVS switch.
2012 12) Restart both VMs in same service and repeat steps 7 to 11.
2013 """
2014 pass
2015
2016 def test_cordvtn_creating_virtual_private_network_and_boot_2_images_in_same_service_connectivity_after_restarting_cord_onos(self):
2017 """
2018 Algo:
2019 1) Validate that required openstack service is up and running.
2020 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
2021 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network.
2022 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
2023 4) Now boot 2 images in the same created network using nova boot image command (example given below :-
2024 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
2025 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-02
2026 5) Wait till VMs boot up and running.
2027 6) Verify that two VMs are launched and running by using novaclient python API.
2028 7) Now ping to the VM from other VM which are launched in same network
2029 8) verify that ping is successful
2030 9) Verify that flow is being added in ovs-switch in compute-node.
2031 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
2032 11) Verify that cord-onos pushed flows to OVS switch.
2033 12) Restart ONOS service and repeat steps 7 to 11.
2034 """
2035 pass
2036
2037 def test_cordvtn_creating_virtual_private_network_and_boot_2_images_in_same_service_connectivity_after_delete_any_VM_recreating_it(self):
2038 """
2039 Algo:
2040 1) Validate that required openstack service is up and running.
2041 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
2042 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network.
2043 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
2044 4) Now boot 2 images in the same created network using nova boot image command (example given below :-
2045 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
2046 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-02
2047 5) Wait till VMs boot up and running.
2048 6) Verify that two VMs are launched and running by using novaclient python API.
2049 7) Now ping to the VM from other VM which are launched in same network
2050 8) verify that ping is successful
2051 9) Verify that flow is being added in ovs-switch in compute-node.
2052 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
2053 11) Verify that cord-onos pushed flows to OVS switch.
2054 12) Delete a VM which was created earlier and repeat steps 4 to 11.
2055 """
2056 pass
2057
2058 def test_cordvtn_creating_virtual_private_network_and_boot_2_images_in_same_service_connectivity_after_delete_and_add_br_int_bridge(self):
2059 """
2060 Algo:
2061 1) Validate that required openstack service is up and running.
2062 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
2063 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network.
2064 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
2065 4) Now boot 2 images in the same created network using nova boot image command (example given below :-
2066 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
2067 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-02
2068 5) Wait till VMs boot up and running.
2069 6) Verify that two VMs are launched and running by using novaclient python API.
2070 7) Now ping to the VM from other VM which are launched in same network
2071 8) verify that ping is successful
2072 9) Verify that flow is being added in ovs-switch in compute-node.
2073 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
2074 11) Verify that cord-onos pushed flows to OVS switch.
2075 12) Delete a br_int bridge and repeat steps 7 to 11, (it should not ping)
2076 13) Add br_int bridge and repeat steps 7 to 11, (it should ping)
2077 """
2078 pass
2079
2080 def test_cordvtn_creating_virtual_public_network_and_boot_image_connectivity_after_restarting_VM(self):
2081
2082 """
2083 Algo:
2084 1) Validate that required openstack service is up and running.
2085 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
2086 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as public network.
2087 (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24).
2088 4) Now boot image in the same created network using nova boot image command (example given below :-
2089 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
2090 5) Wait till VM boots up and starts running.
2091 6) Verify that a VM is launched and running by using novaclient python API.
2092 7) Now ping to the VM from outside network which are internet network (global ping)
2093 8) verify that ping is successful
2094 9) Verify that flow is being added in ovs-switch in compute-node.
2095 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
2096 11) Verify that cord-onos pushed flows to OVS switch.
2097 12) Restart the VM in service and repeat steps 7 to 11.
2098
2099 """
2100 pass
2101
2102 def test_cordvtn_creating_virtual_public_network_and_boot_image_connectivity_after_restarting_cord_onos(self):
2103
2104 """
2105 Algo:
2106 1) Validate that required openstack service is up and running.
2107 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
2108 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as public network.
2109 (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24).
2110 4) Now boot image in the same created network using nova boot image command (example given below :-
2111 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
2112 5) Wait till VM boots up and starts running.
2113 6) Verify that a VM is launched and running by using novaclient python API.
2114 7) Now ping to the VM from outside network which are internet network (global ping)
2115 8) verify that ping is successful
2116 9) Verify that flow is being added in ovs-switch in compute-node.
2117 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
2118 11) Verify that cord-onos pushed flows to OVS switch.
2119 12) Restart onos service container and repeat steps 7 to 11.
2120
2121 """
2122 pass
2123
2124 def test_cordvtn_creating_virtual_public_network_and_boot_image_connectivity_after_delete_and_recreate_VM(self):
2125
2126 """
2127 Algo:
2128 1) Validate that required openstack service is up and running.
2129 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
2130 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as public network.
2131 (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24).
2132 4) Now boot image in the same created network using nova boot image command (example given below :-
2133 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
2134 5) Wait till VM boots up and starts running.
2135 6) Verify that a VM is launched and running by using novaclient python API.
2136 7) Now ping to the VM from outside network which are internet network (global ping)
2137 8) verify that ping is successful
2138 9) Verify that flow is being added in ovs-switch in compute-node.
2139 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
2140 11) Verify that cord-onos pushed flows to OVS switch.
2141 12) Delete and re-create a VM in the same service and repeat steps 7 to 11.
2142
2143 """
2144 pass
2145
2146 def test_cordvtn_creating_virtual_public_network_and_boot_image_connectivity_after_delete_and_add_br_int_bridge(self):
2147
2148 """
2149 Algo:
2150 1) Validate that required openstack service is up and running.
2151 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
2152 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as public network.
2153 (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24).
2154 4) Now boot image in the same created network using nova boot image command (example given below :-
2155 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
2156 5) Wait till VM boots up and starts running.
2157 6) Verify that a VM is launched and running by using novaclient python API.
2158 7) Now ping to the VM from outside network which are internet network (global ping)
2159 8) verify that ping is successful
2160 9) Verify that flow is being added in ovs-switch in compute-node.
2161 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
2162 11) Verify that cord-onos pushed flows to OVS switch.
2163 12) Delete a br_int bridge and repeat steps 7 to 11, (it should not ping)
2164 13) Add br_int bridge and repeat steps 7 to 11, (it should ping)
2165
2166 """
2167 pass
2168
2169 def test_cordvtn_creating_virtual_local_management_network_and_boot_image_connectivity_after_restarting_VM(self):
2170
2171 """
2172 Algo:
2173 1) Validate that required openstack service is up and running.
2174 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
2175 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
2176 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
2177 4) Now boot image in the same created network using nova boot image command (example given below :-
2178 nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
2179 5) Wait till VM boots up and starts running.
2180 6) Verify that a VM is launched and running by using novaclient python API.
2181 7) Now ping to the VM from compute node network which are launched a VM.
2182 8) verify that ping is successful
2183 9) Verify that flow is being added in ovs-switch in compute-node.
2184 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
2185 11) Verify that cord-onos pushed flows to OVS switch.
2186 12) Restart the VM in service and repeat steps 7 to 11.
2187 """
2188 pass
2189
2190 def test_cordvtn_creating_virtual_local_management_network_and_boot_image_connectivity_after_restarting_cord_onos(self):
2191
2192 """
2193 Algo:
2194 1) Validate that required openstack service is up and running.
2195 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
2196 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
2197 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
2198 4) Now boot image in the same created network using nova boot image command (example given below :-
2199 nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
2200 5) Wait till VM boots up and starts running.
2201 6) Verify that a VM is launched and running by using novaclient python API.
2202 7) Now ping to the VM from compute node network which are launched a VM.
2203 8) verify that ping is successful
2204 9) Verify that flow is being added in ovs-switch in compute-node.
2205 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
2206 11) Verify that cord-onos pushed flows to OVS switch.
2207 12) Restart the onos service and repeat steps 7 to 11.
2208 """
2209 pass
2210
2211 def test_cordvtn_creating_virtual_local_management_network_and_boot_image_connectivity_after_delete_and_recreate_VM(self):
2212
2213 """
2214 Algo:
2215 1) Validate that required openstack service is up and running.
2216 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
2217 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
2218 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
2219 4) Now boot image in the same created network using nova boot image command (example given below :-
2220 nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
2221 5) Wait till VM boots up and starts running.
2222 6) Verify that a VM is launched and running by using novaclient python API.
2223 7) Now ping to the VM from compute node network which are launched a VM.
2224 8) verify that ping is successful
2225 9) Verify that flow is being added in ovs-switch in compute-node.
2226 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
2227 11) Verify that cord-onos pushed flows to OVS switch.
2228 12) Delete and re-create a VM in the same service and repeat steps 7 to 11.
2229 """
2230 pass
2231
2232 def test_cordvtn_creating_virtual_local_management_network_and_boot_image_connectivity_after_delete_and_add_br_int_bridge(self):
2233
2234 """
2235 Algo:
2236 1) Validate that required openstack service is up and running.
2237 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
2238 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
2239 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
2240 4) Now boot image in the same created network using nova boot image command (example given below :-
2241 nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
2242 5) Wait till VM boots up and starts running.
2243 6) Verify that a VM is launched and running by using novaclient python API.
2244 7) Now ping to the VM from compute node network which are launched a VM.
2245 8) verify that ping is successful
2246 9) Verify that flow is being added in ovs-switch in compute-node.
2247 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
2248 11) Verify that cord-onos pushed flows to OVS switch.
2249 12) Delete a br_int bridge and repeat steps 7 to 11, (it should not ping)
2250 13) Add br_int bridge and repeat steps 7 to 11, (it should ping)
2251 """
2252 pass
2253
2254 def test_cordvtn_creating_virtual_vlan_interface_local_management_network_and_boot_image_connectivity_after_restarting_VM(self):
2255
2256 """
2257 Algo:
2258 1) Validate that required openstack service is up and running.
2259 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
2260 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
2261 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
2262 4) Now boot image in the same created network using nova boot image command (example given below :-
2263 nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
2264 5) Wait till VM boots up and starts running.
2265 6) Verify that a VM is launched and running by using novaclient python API.
2266 7) Create a virtual interface with vlan tag and local management ip on VM.
2267 8) Create a same virtual interface with valn tag and any local management ip on head node.
2268 9) Now ping to the VM from head node network which are launched a openstack service.
2269 10) verify that ping is successful
2270 11) Verify that flow is being added in ovs-switch in compute-node.
2271 12) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
2272 13) Verify that cord-onos pushed flows to OVS switch.
2273 14) Restart the VM in service and repeat steps 9 to 13.
2274
2275 """
2276 pass
2277
2278 def test_cordvtn_creating_virtual_vlan_interface_local_management_network_and_boot_image_connectivity_after_restarting_cord_onos(self):
2279
2280 """
2281 Algo:
2282 1) Validate that required openstack service is up and running.
2283 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
2284 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
2285 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
2286 4) Now boot image in the same created network using nova boot image command (example given below :-
2287 nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
2288 5) Wait till VM boots up and starts running.
2289 6) Verify that a VM is launched and running by using novaclient python API.
2290 7) Create a virtual interface with vlan tag and local management ip on VM.
2291 8) Create a same virtual interface with valn tag and any local management ip on head node.
2292 9) Now ping to the VM from head node network which are launched a openstack service.
2293 10) verify that ping is successful
2294 11) Verify that flow is being added in ovs-switch in compute-node.
2295 12) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
2296 13) Verify that cord-onos pushed flows to OVS switch.
2297 14) Restart the ONOS service and repeat steps 9 to 13.
2298
2299 """
2300 pass
2301
2302 def test_cordvtn_creating_virtual_vlan_interface_local_management_network_and_boot_image_connectivity_after_delete_and_recreate_VM(self):
2303
2304 """
2305 Algo:
2306 1) Validate that required openstack service is up and running.
2307 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
2308 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
2309 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
2310 4) Now boot image in the same created network using nova boot image command (example given below :-
2311 nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
2312 5) Wait till VM boots up and starts running.
2313 6) Verify that a VM is launched and running by using novaclient python API.
2314 7) Create a virtual interface with vlan tag and local management ip on VM.
2315 8) Create a same virtual interface with valn tag and any local management ip on head node.
2316 9) Now ping to the VM from head node network which are launched a openstack service.
2317 10) verify that ping is successful
2318 11) Verify that flow is being added in ovs-switch in compute-node.
2319 12) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
2320 13) Verify that cord-onos pushed flows to OVS switch.
2321 14) Delete and re-create a VM in service and repeat steps 9 to 13.
2322
2323 """
2324 pass
2325
2326 def test_cordvtn_creating_virtual_vlan_interface_local_management_network_and_boot_image_connectivity_after_delete_and_add_br_int_bridge(self):
2327
2328 """
2329 Algo:
2330 1) Validate that required openstack service is up and running.
2331 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
2332 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
2333 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
2334 4) Now boot image in the same created network using nova boot image command (example given below :-
2335 nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
2336 5) Wait till VM boots up and starts running.
2337 6) Verify that a VM is launched and running by using novaclient python API.
2338 7) Create a virtual interface with vlan tag and local management ip on VM.
2339 8) Create a same virtual interface with valn tag and any local management ip on head node.
2340 9) Now ping to the VM from head node network which are launched a openstack service.
2341 10) verify that ping is successful
2342 11) Verify that flow is being added in ovs-switch in compute-node.
2343 12) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
2344 13) Verify that cord-onos pushed flows to OVS switch.
2345 14) Delete a br_int bridge and repeat steps 9 to 13, (it should not ping)
2346 15) Add br_int bridge and repeat steps 9 to 13, (it should ping)
2347
2348 """
2349 pass
2350
2351 def test_cordvtn_creating_virtual_vlan_interface_floating_local_management_network_and_boot_image_connectivity_after_restarting_VM(self):
2352
2353 """
2354 Algo:
2355 1) Validate that required openstack service is up and running.
2356 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
2357 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
2358 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
2359 4) Now boot image in the same created network using nova boot image command (example given below :-
2360 nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
2361 5) Wait till VM boots up and starts running.
2362 6) Verify that a VM is launched and running by using novaclient python API.
2363 7) Create a virtual interface with vlan tag and local management floating ip on VM.
2364 8) Create a same virtual interface with valn tag and any local management floating ip on head node.
2365 9) Now ping to the VM from head node network which are launched a openstack service.
2366 10) verify that ping is successful
2367 11) Verify that flow is being added in ovs-switch in compute-node.
2368 12) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
2369 13) Verify that cord-onos pushed flows to OVS switch.
2370 14) Restart the VM in service and repeat steps 9 to 13.
2371 """
2372 pass
2373
2374 def test_cordvtn_creating_virtual_vlan_interface_floating_local_management_network_and_boot_image_connectivity_after_restarting_cord_onos(self):
2375
2376 """
2377 Algo:
2378 1) Validate that required openstack service is up and running.
2379 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
2380 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
2381 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
2382 4) Now boot image in the same created network using nova boot image command (example given below :-
2383 nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
2384 5) Wait till VM boots up and starts running.
2385 6) Verify that a VM is launched and running by using novaclient python API.
2386 7) Create a virtual interface with vlan tag and local management floating ip on VM.
2387 8) Create a same virtual interface with valn tag and any local management floating ip on head node.
2388 9) Now ping to the VM from head node network which are launched a openstack service.
2389 10) verify that ping is successful
2390 11) Verify that flow is being added in ovs-switch in compute-node.
2391 12) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
2392 13) Verify that cord-onos pushed flows to OVS switch.
2393 14) Restart the ONOS service and repeat steps 9 to 13.
2394 """
2395 pass
2396
2397 def test_cordvtn_creating_virtual_vlan_interface_floating_local_management_network_and_boot_image_connectivity_after_delete_and_recreate_VM(self):
2398 """
2399 Algo:
2400 1) Validate that required openstack service is up and running.
2401 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
2402 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
2403 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
2404 4) Now boot image in the same created network using nova boot image command (example given below :-
2405 nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
2406 5) Wait till VM boots up and starts running.
2407 6) Verify that a VM is launched and running by using novaclient python API.
2408 7) Create a virtual interface with vlan tag and local management floating ip on VM.
2409 8) Create a same virtual interface with valn tag and any local management floating ip on head node.
2410 9) Now ping to the VM from head node network which are launched a openstack service.
2411 10) verify that ping is successful
2412 11) Verify that flow is being added in ovs-switch in compute-node.
2413 12) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
2414 13) Verify that cord-onos pushed flows to OVS switch.
2415 14) Delete and re-create a VM in service and repeat steps 9 to 13.
2416 """
2417 pass
2418
2419 def test_cordvtn_creating_virtual_vlan_interface_floating_local_management_network_and_boot_image_connectivity_after_delete_and_add_br_int_bridge(self):
2420
2421 """
2422 Algo:
2423 1) Validate that required openstack service is up and running.
2424 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
2425 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
2426 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
2427 4) Now boot image in the same created network using nova boot image command (example given below :-
2428 nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
2429 5) Wait till VM boots up and starts running.
2430 6) Verify that a VM is launched and running by using novaclient python API.
2431 7) Create a virtual interface with vlan tag and local management floating ip on VM.
2432 8) Create a same virtual interface with valn tag and any local management floating ip on head node.
2433 9) Now ping to the VM from head node network which are launched a openstack service.
2434 10) verify that ping is successful
2435 11) Verify that flow is being added in ovs-switch in compute-node.
2436 12) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
2437 13) Verify that cord-onos pushed flows to OVS switch.
2438 14) Delete a br_int bridge and repeat steps 9 to 13, (it should not ping)
2439 15) Add br_int bridge and repeat steps 9 to 13, (it should ping)
2440 """
2441 pass