blob: aba0d4b89e0ac074f17ce50f0b0713b66981e76c [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 Gaonkera6e23a72017-03-14 01:27:49 +000030from OnosFlowCtrl import OnosFlowCtrl
Chetan Gaonker09b77ae2017-03-08 01:44:25 +000031from scapy.all import *
32import requests
ChetanGaonkeraaea6b62016-12-16 17:06:39 -080033import time
Chetan Gaonker3c8ae682017-02-18 00:50:45 +000034import py_compile
Chetan Gaonker09b77ae2017-03-08 01:44:25 +000035import json
ChetanGaonker901727c2016-11-29 14:05:03 -080036
ChetanGaonker71fe0302016-12-19 17:45:44 -080037PROTO_NAME_TCP = 'tcp'
38PROTO_NAME_ICMP = 'icmp'
39IPv4 = 'IPv4'
40
41OS_USERNAME = 'admin'
Chetan Gaonker0fb91c92017-02-07 01:52:18 +000042OS_PASSWORD = 'VeryLongKeystoneAdminPassword'
ChetanGaonker71fe0302016-12-19 17:45:44 -080043OS_TENANT = 'admin'
Chetan Gaonker0fb91c92017-02-07 01:52:18 +000044OS_AUTH_URL = 'https://keystone.cord.lab:5000/v2.0'
45OS_SERVICE_ENDPOINT = 'https://keystone.cord.lab:5000/v2.0/'
Chetan Gaonker1f422af2017-01-13 21:59:16 +000046VM_BOOT_TIMEOUT = 100
47VM_DELETE_TIMEOUT = 100
48
ChetanGaonker71fe0302016-12-19 17:45:44 -080049
50#VM SSH CREDENTIALS
51VM_USERNAME = 'ubuntu'
52VM_PASSWORD = 'ubuntu'
53
54TENANT_PREFIX = 'test-'
55VM_PREFIX = 'test-'
56NETWORK_PREFIX = 'test-'
57CIDR_PREFIX = '192.168'
58
Chetan Gaonker1c387cf2017-02-22 02:21:43 +000059class vtn_validation_utils:
60
A.R Karthickd4eed642017-03-09 14:40:52 -080061 endpoint = '172.17.0.5'
62 version = ''
63 vtn_app = 'org.opencord.vtn'
64
Chetan Gaonker1c387cf2017-02-22 02:21:43 +000065 def __init__(self, version):
66 self.version = version
A.R Karthickd4eed642017-03-09 14:40:52 -080067 self.manifest = None
68 self.vtn_enabled = False
69 manifest = os.getenv('MANIFEST', None)
70 if manifest:
71 self.manifest = TestManifest(manifest = manifest)
72 self.endpoint = self.manifest.onos_ip
73 self.vtn_enabled = self.manifest.synchronizer == 'vtn'
Chetan Gaonker1c387cf2017-02-22 02:21:43 +000074
A.R Karthickd4eed642017-03-09 14:40:52 -080075 self.app_ctrl = OnosCtrl(self.vtn_app, controller = self.endpoint)
Chetan Gaonker1c387cf2017-02-22 02:21:43 +000076
A.R Karthickd4eed642017-03-09 14:40:52 -080077 def getDevices(self):
78 return OnosCtrl.get_devices(controller = self.endpoint)
Chetan Gaonker1c387cf2017-02-22 02:21:43 +000079
A.R Karthickd4eed642017-03-09 14:40:52 -080080 def getLinks(self):
81 return OnosCtrl.get_links(controller = self.endpoint)
Chetan Gaonker1c387cf2017-02-22 02:21:43 +000082
A.R Karthickd4eed642017-03-09 14:40:52 -080083 def getDevicePorts(self, switch_id):
84 return OnosCtrl.get_ports_device(switch_id, controller = self.endpoint)
Chetan Gaonker1c387cf2017-02-22 02:21:43 +000085
A.R Karthickd4eed642017-03-09 14:40:52 -080086 def activateVTNApp(self):
87 return self.app_ctrl.activate()
88
89 def deactivateVTNApp(self):
90 return self.app_ctrl.deactivate()
Chetan Gaonker1c387cf2017-02-22 02:21:43 +000091
ChetanGaonker901727c2016-11-29 14:05:03 -080092class cordvtn_exchange(CordLogger):
93
ChetanGaonkeraaea6b62016-12-16 17:06:39 -080094 app_cordvtn = 'org.opencord.vtn'
95 test_path = os.path.dirname(os.path.realpath(__file__))
96 cordvtn_dir = os.path.join(test_path, '..', 'setup')
97 cordvtn_conf_file = os.path.join(test_path, '..', '../cordvtn/network_cfg.json')
ChetanGaonker901727c2016-11-29 14:05:03 -080098
99 @classmethod
100 def setUpClass(cls):
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800101 ''' Activate the cordvtn app'''
ChetanGaonker901727c2016-11-29 14:05:03 -0800102 time.sleep(3)
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800103 cls.onos_ctrl = OnosCtrl(cls.app_cordvtn)
104 status, _ = cls.onos_ctrl.activate()
Chetan Gaonker09b77ae2017-03-08 01:44:25 +0000105 assert_equal(status, True)
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800106 time.sleep(3)
107 cls.cordvtn_setup()
ChetanGaonker901727c2016-11-29 14:05:03 -0800108
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800109 @classmethod
110 def tearDownClass(cls):
ChetanGaonker901727c2016-11-29 14:05:03 -0800111 '''Deactivate the cord vtn app'''
Chetan Gaonker09b77ae2017-03-08 01:44:25 +0000112 #cls.onos_ctrl.deactivate()
113 #cls.cord_vtn_cleanup()
ChetanGaonker901727c2016-11-29 14:05:03 -0800114
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800115 @classmethod
116 def cordvtn_setup(cls):
117 pass
118
119 @classmethod
120 def cord_vtn_cleanup(cls):
121 ##reset the ONOS port configuration back to default
Chetan Gaonker09b77ae2017-03-08 01:44:25 +0000122 pass
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800123
124 @classmethod
125 def onos_load_config(cls, cordvtn_conf_file):
126 status, code = OnosCtrl.config(cordvtn_conf_file)
ChetanGaonker901727c2016-11-29 14:05:03 -0800127 if status is False:
128 log.info('JSON request returned status %d' %code)
129 assert_equal(status, True)
130 time.sleep(3)
131
Chetan Gaonker09b77ae2017-03-08 01:44:25 +0000132 def get_neutron_credentials(self):
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800133 n = {}
134 n['username'] = os.environ['OS_USERNAME']
135 n['password'] = os.environ['OS_PASSWORD']
136 n['auth_url'] = os.environ['OS_AUTH_URL']
137 n['tenant_name'] = os.environ['OS_TENANT_NAME']
Chetan Gaonker80e06152017-03-07 01:07:19 +0000138 n['ca_cert'] = os.environ['REQUESTS_CA_BUNDLE']
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800139 return n
140
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800141 def create_network(i):
142 neutron_credentials = get_neutron_credentials()
143 neutron = neutron_client.Client(**neutron_credentials)
144 json = {'network': {'name': 'network-' + str(i),
145 'admin_state_up': True}}
146 while True:
147 try:
Chetan Gaonker3c8ae682017-02-18 00:50:45 +0000148 net = neutron.create_network(body=json)
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800149 print '\nnetwork-' + str(i) + ' created'
Chetan Gaonker3c8ae682017-02-18 00:50:45 +0000150 return net
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800151 except Exception as e:
152 print e
153 continue
154
ChetanGaonker901727c2016-11-29 14:05:03 -0800155 def create_tenant(tenant_name):
156 new_tenant = keystone.tenants.create(tenant_name=tenant_name,
157 description="CORD Tenant \
158 created",
159 enabled=True)
160 tenant_id = new_tenant.id
161 tenant_status = True
162 user_data = []
163 for j in range(2):
164 j += 1
165 user_name = tenant_name + '-user-' + str(j)
166 user_data.append(create_user(user_name, tenant_id))
167
168 print " Tenant and User Created"
169
170 tenant_data = {'tenant_name': tenant_name,
171 'tenant_id': tenant_id,
172 'status': tenant_status}
173 return tenant_data
174
175 def create_user(user_name, tenant_id):
176 new_user = keystone.users.create(name=user_name,
177 password="ubuntu",
178 tenant_id=tenant_id)
179 print(' - Created User %s' % user_name)
180 keystone.roles.add_user_role(new_user, member_role, tenant_id)
181 if assign_admin:
182 admin_user = keystone.users.find(name='admin')
183 admin_role = keystone.roles.find(name='admin')
184 keystone.roles.add_user_role(admin_user, admin_role, tenant_id)
185 user_data = {'name': new_user.name,
186 'id': new_user.id}
187 return user_data
188
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800189 def create_port( router_id, network_id):
190 credentials = get_credentials()
191 neutron = client.Client(**credentials)
192 router = neutron.show_router(router_id)
193
194 value = {'port':{
195 'admin_state_up':True,
196 'device_id': router_id,
197 'name': 'port1',
198 'network_id':network_id,
199 }}
200 response = neutron.create_port(body=value)
201
ChetanGaonker71fe0302016-12-19 17:45:44 -0800202 def router_create(self, name):
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800203 external_network = None
204 for network in self.neutron.list_networks()["networks"]:
205 if network.get("router:external"):
206 external_network = network
207 break
208
209 if not external_network:
210 raise Exception("Alarm! Can not to find external network")
211
212 gw_info = {
213 "network_id": external_network["id"],
214 "enable_snat": True
215 }
216 router_info = {
217 "router": {
218 "name": name,
219 "external_gateway_info": gw_info,
220 "tenant_id": self.tenant_id
221 }
222 }
ChetanGaonker71fe0302016-12-19 17:45:44 -0800223 router = self.neutron.router_create(router_info)['router']
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800224 return router
225
ChetanGaonker901727c2016-11-29 14:05:03 -0800226 def delete_tenant(tenant_name):
227 tenant = keystone.tenants.find(name=tenant_name)
228 for j in range(2):
229 j += 1
230 user_name = tenant_name + '-user-' + str(j)
231 delete_user(user_name, tenant.id)
232 tenant.delete()
233 print(' - Deleted Tenant %s ' % tenant_name)
234 return True
235
236 def delete_user(user_name, tenant_id):
237 user = keystone.users.find(name=user_name)
238 user.delete()
239
240 print(' - Deleted User %s' % user_name)
241 return True
242
ChetanGaonker71fe0302016-12-19 17:45:44 -0800243 def set_environment(tenants_num=0, networks_per_tenant=1, vms_per_network=2):
Chetan Gaonker09b77ae2017-03-08 01:44:25 +0000244 octet = 115
245 vm_inc = 11
246 image = nova_connection.images.get(IMAGE_ID)
247 flavor = nova_connection.flavors.get(FLAVOR_ID)
ChetanGaonker71fe0302016-12-19 17:45:44 -0800248
Chetan Gaonker09b77ae2017-03-08 01:44:25 +0000249 admin_user_id = keystone_connection.users.find(name=OS_USERNAME).id
250 member_role_id = keystone_connection.roles.find(name='Member').id
251 for num_tenant in range(1, tenants_num+1):
252 tenant = keystone_connection.tenants.create('%stenant%s' % (TENANT_PREFIX, num_tenant))
253 keystone_connection.roles.add_user_role(admin_user_id, member_role_id, tenant=tenant.id)
254 for num_network in range(networks_per_tenant):
255 network_json = {'name': '%snet%s' % (NETWORK_PREFIX, num_tenant*10+num_network),
256 'admin_state_up': True,
257 'tenant_id': tenant.id}
258 network = neutron_connection.create_network({'network': network_json})
259 subnet_json = {'name': '%ssubnet%s' % (NETWORK_PREFIX, num_tenant*10+num_network),
260 'network_id': network['network']['id'],
261 'tenant_id': tenant.id,
262 'enable_dhcp': True,
263 'cidr': '%s.%s.0/24' % (CIDR_PREFIX, octet), 'ip_version': 4}
264 octet += 1
265 subnet = neutron_connection.create_subnet({'subnet': subnet_json})
266 router_json = {'name': '%srouter%s' % (NETWORK_PREFIX, num_tenant*10+num_network),
267 'tenant_id': tenant.id}
268 router = neutron_connection.router_create({'router': router_json})
269 port = neutron_connection.add_interface_router(router['router']['id'], {'subnet_id': subnet['subnet']['id']})
270 for num_vm in range(vms_per_network):
271 tenant_nova_connection = novacli.Client(OS_USERNAME, OS_PASSWORD, tenant.name, OS_AUTH_URL)
272 m = tenant_nova_connection.servers.create('%svm%s' % (VM_PREFIX, vm_inc), image, flavor, nics=[{'net-id': network['network']['id']}, {'net-id': MGMT_NET}])
273 vm_inc += 1
ChetanGaonker71fe0302016-12-19 17:45:44 -0800274
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800275 def verify_neutron_crud():
276 x = os.system("neutron_test.sh")
277 return x
ChetanGaonker901727c2016-11-29 14:05:03 -0800278
Author Name91eaeba2017-01-05 13:41:45 -0800279 def list_floatingips( **kwargs):
280 creds = get_neutron_credentials()
281 neutron = client.Client(**creds)
282 return neutron.list_floatingips(**kwargs)['floatingips']
283
284 def list_security_groups( **kwargs):
285 creds = get_neutron_credentials()
286 neutron = client.Client(**creds)
287 return neutron.list_security_groups(**kwargs)['security_groups']
288
289 def list_subnets( **kwargs):
290 creds = get_neutron_credentials()
291 neutron = client.Client(**creds)
292 return neutron.list_subnets(**kwargs)['subnets']
293
294 def list_networks( **kwargs):
295 creds = get_neutron_credentials()
296 neutron = client.Client(**creds)
297 return neutron.list_networks(**kwargs)['networks']
298
299 def list_ports( **kwargs):
300 creds = get_neutron_credentials()
301 neutron = client.Client(**creds)
302 return neutron.list_ports(**kwargs)['ports']
303
304 def list_routers( **kwargs):
305 creds = get_neutron_credentials()
306 neutron = client.Client(**creds)
307 return neutron.list_routers(**kwargs)['routers']
308
309 def update_floatingip( fip, port_id=None):
310 creds = get_neutron_credentials()
311 neutron = client.Client(**creds)
312 neutron.update_floatingip(fip, {"floatingip":
313 {"port_id": port_id}})
314
315 def update_subnet( subnet_id, **subnet_params):
316 creds = get_neutron_credentials()
317 neutron = client.Client(**creds)
318 neutron.update_subnet(subnet_id, {'subnet': subnet_params})
319
320 def update_router( router_id, **router_params):
321 creds = get_neutron_credentials()
322 neutron = client.Client(**creds)
323 neutron.update_router(router_id, {'router': router_params})
324
325 def router_gateway_set( router_id, external_gateway):
326 creds = get_neutron_credentials()
327 neutron = client.Client(**creds)
328 neutron.update_router(
329 router_id, {'router': {'external_gateway_info':
330 {'network_id': external_gateway}}})
331
332 def router_gateway_clear( router_id):
333 creds = get_neutron_credentials()
334 neutron = client.Client(**creds)
335 neutron.update_router(
336 router_id, {'router': {'external_gateway_info': None}})
337
338 def router_add_interface( router_id, subnet_id):
339 creds = get_neutron_credentials()
340 neutron = client.Client(**creds)
341 neutron.add_interface_router(router_id, {'subnet_id': subnet_id})
342
343 def router_rem_interface( router_id, subnet_id):
344 creds = get_neutron_credentials()
345 neutron = client.Client(**creds)
346 neutron.remove_interface_router(
347 router_id, {'subnet_id': subnet_id})
348
349 def create_floatingip( **floatingip_params):
350 creds = get_neutron_credentials()
351 neutron = client.Client(**creds)
352 response = neutron.create_floatingip(
353 {'floatingip': floatingip_params})
354 if 'floatingip' in response and 'id' in response['floatingip']:
355 return response['floatingip']['id']
356
Chetan Gaonker1f422af2017-01-13 21:59:16 +0000357 def make_iperf_pair(server, client, **kwargs):
358 ssh = SSHClient()
359 ssh.set_missing_host_key_policy(MissingHostKeyPolicy())
360
361 ssh.connect(server, username=VM_USERNAME, password=VM_PASSWORD)
362 ssh.exec_command('/usr/local/bin/iperf3 -s -D')
363
364 ssh.connect(client, username=VM_USERNAME, password=VM_PASSWORD)
365 stdin, stdout, stderr = ssh.exec_command('/usr/local/bin/iperf3 -c %s -J' % server)
366
367 rawdata = stdout.read()
368 data = json.loads(rawdata.translate(None,'\t').translate(None,'\n'))
369
370 return data
371
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000372 def connect_ssh(os_ip, private_key_file=None, user='ubuntu'):
373 key = ssh.RSAKey.from_private_key_file(private_key_file)
374 client = ssh.SSHClient()
375 client.set_missing_host_key_policy(ssh.WarningPolicy())
376 client.connect(ip, username=user, pkey=key, timeout=5)
377 return client
Chetan Gaonker1f422af2017-01-13 21:59:16 +0000378
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000379 def validate_vtn_flows(switch):
380 egress = 1
381 ingress = 2
382 egress_map = { 'ether': '00:00:00:00:00:03', 'ip': '192.168.30.1' }
383 ingress_map = { 'ether': '00:00:00:00:00:04', 'ip': '192.168.40.1' }
384 device_id = 'of:{}'.format(get_mac(switch))
Chetan Gaonkera6e23a72017-03-14 01:27:49 +0000385 ctlr = self.ctlr_ip.split(',')[0]
386 flow = OnosFlowCtrl(deviceId = device_id,
387 egressPort = egress,
388 ingressPort = ingress,
389 ethType = '0x800',
390 ipSrc = ('IPV4_SRC', ingress_map['ip']+'/32'),
391 ipDst = ('IPV4_DST', egress_map['ip']+'/32'),
392 controller = ctlr
393 )
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000394 flow_id = flow.findFlow(device_id, IN_PORT = ('port', ingress),
395 ETH_TYPE = ('ethType','0x800'), IPV4_SRC = ('ip', ingress_map['ip']+'/32'),
396 IPV4_DST = ('ip', egress_map['ip']+'/32'))
397 if flow_id:
398 return True
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800399
Chetan Gaonker3c8ae682017-02-18 00:50:45 +0000400 def cordvtn_config_load(self, config = None):
401 if config:
402 for k in config.keys():
403 if cordvtn_config.has_key(k):
404 cordvtn_config[k] = config[k]
405 self.onos_load_config(self.cordvtn_dict)
406
Chetan Gaonker09b77ae2017-03-08 01:44:25 +0000407 def search_value(self, d, pat):
Thangavelu K Sa2f5ac02017-03-13 18:29:00 +0000408 match = False
Chetan Gaonker3c8ae682017-02-18 00:50:45 +0000409 for k, v in d.items():
410 if isinstance(v, dict):
Thangavelu K Sa2f5ac02017-03-13 18:29:00 +0000411 match = self.search_value(v, pat)
412 elif type(v) is list:
413 for i in range(len(v)):
414 if type(v[i]) is dict:
415 match = self.search_value(v[i], pat)
416 else:
417 if v == pat:
418 match == True
419 return True
420 elif v == pat:
421 match == True
422 return True
423 return match
424
425 def test_cordvtn_neutron_network_creation_and_validation_on_neutron_openstack(self):
426 """
427 Algo:
428 0. Create Test-Net,
429 1. Load cordvtn config, vtn-cfg-1.json to cord-onos
430 2. Run sync command for cordvtn
431 3. Do GET Rest API and validate creation of network
432 4. Validate network synch with created network in cord-onos
433 """
434 creds = self.get_neutron_credentials()
435 neutron = neutronclient.Client(**creds)
436 body_example = {"network":{"name": "Net-1","admin_state_up":True}}
437 net = neutron.create_network(body=body_example)
438 networks = neutron.list_networks(name='Net-1')
439 vtn_util = vtn_validation_utils('')
440 data = networks
441 result = self.search_value(data, "Net-1")
442 assert_equal(result, True)
443
444 def test_cordvtn_neutron_network_creation_and_validation_on_onos(self):
445 """
446 Algo:
447 0. Create Test-Net,
448 1. Load cordvtn config, vtn-cfg-1.json to cord-onos
449 2. Run sync command for cordvtn
450 3. Do GET Rest API and validate creation of network
451 4. Validate network synch with created network in cord-onos
452 """
453 creds = self.get_neutron_credentials()
454 neutron = neutronclient.Client(**creds)
455 body_example = {"network":{"name": "Net-1","admin_state_up":True}}
456 net = neutron.create_network(body=body_example)
457 networks = neutron.list_networks(name='Net-1')
458 vtn_util = vtn_validation_utils('')
459 url = "http://{0}:8181/onos/cordvtn/serviceNetworks".format(vtn_util.endpoint)
460 auth = ('karaf','karaf')
461
462 resp = requests.get(url=url, auth=auth)
463 data = json.loads(resp.text)
464 result = self.search_value(data, "Net-1")
465 assert_equal(result, True)
466
467 def test_cordvtn_neutron_network_delete_and_validation_on_neutron_openstack(self):
468
469 """
470 Algo:
471 0. Create Test-Net,
472 1. Load cordvtn config, vtn-cfg-1.json to cord-onos
473 2. Run sync command for cordvtn
474 3. Do GET Rest API and validate creation of network
475 4. Validate network synch with created network in cord-onos
476 """
477 creds = self.get_neutron_credentials()
478 neutron = neutronclient.Client(**creds)
479 body_example = {"network":{"name": "Net-1","admin_state_up":False}}
480 net = neutron.delete_network("Net-1")
481 networks = neutron.list_networks(name='Net-1')
482 vtn_util = vtn_validation_utils('')
483 data = networks
484 result = self.search_value(data, "Net-1")
485 assert_equal(result, True)
Chetan Gaonker3c8ae682017-02-18 00:50:45 +0000486
487 def test_cordvtn_neutron_network_sync(self):
488 """
489 Algo:
490 0. Create Test-Net,
491 1. Load cordvtn config, vtn-cfg-1.json to cord-onos
492 2. Run sync command for cordvtn
493 3. Do GET Rest API and validate creation of network
494 4. Validate network synch with created network in cord-onos
495 """
Chetan Gaonker09b77ae2017-03-08 01:44:25 +0000496 creds = self.get_neutron_credentials()
Chetan Gaonker3c8ae682017-02-18 00:50:45 +0000497 neutron = neutronclient.Client(**creds)
Chetan Gaonker09b77ae2017-03-08 01:44:25 +0000498 body_example = {"network":{"name": "Test-Net-1","admin_state_up":True}}
Chetan Gaonker3c8ae682017-02-18 00:50:45 +0000499 net = neutron.create_network(body=body_example)
Chetan Gaonkera6e23a72017-03-14 01:27:49 +0000500 url = "http://{0}:8181/onos/cordvtn/serviceNetworks".format(vtn_util.endpoint)
501 auth = ('karaf','karaf')
502 body_create_subnet = {'subnets': [{'cidr': '192.168.199.0/24',
503 'ip_version': 4, 'network_id': network_id}]}
504
505 subnet = neutron.create_subnet(body=body_create_subnet)
506
507 resp = requests.get(url=url, auth=auth)
508 data = json.loads(resp.text)
509 result = self.search_value(data, "Test-Net-1")
510 assert_equal(result, True)
511
512 def test_cordvtn_neutron_port_sync(self):
513 """
514 Algo:
515 0. Create Test-Net,
516 1. Load cordvtn config, vtn-cfg-1.json to cord-onos
517 2. Run sync command for cordvtn
518 3. Do GET Rest API and validate creation of network
519 4. Validate network synch with created network in cord-onos
520 """
521 creds = self.get_neutron_credentials()
522 neutron = neutronclient.Client(**creds)
523 body_example = {"network":{"name": "Test-Net-1","admin_state_up":True}}
524 net = neutron.create_network(body=body_example)
525 network_id = net['network']['id']
526 device_id = 'of:{}'.format(get_mac(self.switch))
527 body_example = {'port': {'admin_state_up': True,'device_id':device_id, 'network_id':network_id}}
528 response = neutron.create_port(body=body_example)
529 url = "http://{0}:8181/onos/cordvtn/servicePorts".format(vtn_util.endpoint)
Chetan Gaonker3c8ae682017-02-18 00:50:45 +0000530 auth = ('karaf','karaf')
531
532 resp = requests.get(url=url, auth=auth)
533 data = json.loads(resp.text)
Chetan Gaonkera6e23a72017-03-14 01:27:49 +0000534 result = self.search_value(data, device_id)
Chetan Gaonker3c8ae682017-02-18 00:50:45 +0000535 assert_equal(result, True)
536
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800537 def test_cordvtn_basic_tenant(self):
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800538
ChetanGaonker71fe0302016-12-19 17:45:44 -0800539 tenant_1= create_tenant("CORD_Subscriber_Test_Tenant_1")
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000540 if tenant1 != 0:
ChetanGaonker71fe0302016-12-19 17:45:44 -0800541 print "Creation of CORD Subscriber Test Tenant 1"
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800542
ChetanGaonker71fe0302016-12-19 17:45:44 -0800543 tenant_2 = create_tenant("CORD_Subscriber_Test_Tenant_2")
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000544 if tenant2 != 0:
ChetanGaonker71fe0302016-12-19 17:45:44 -0800545 print "Creation of CORD Subscriber Test Tenant 2"
546
547 create_net(tenant_1,"a1")
548 create_subnet(tenant_1,"a1","as1","10.0.1.0/24")
549
550 create_net(tenant_2,"a2")
551 create_subnet(tenant_2,"a2","as1","10.0.2.0/24")
552
553 netid_1 = get_id(tenant_1,"net","a1")
554 netid_2 = get_id(tenant_2,"net","a2")
555
556 nova_boot(tenant_1,"vm1",netid=netid)
557 nova_boot(tenant_2,"vm1",netid=netid)
558
559 nova_wait_boot(tenant_1,"vm1", "ACTIVE")
560 nova_wait_boot(tenant_2,"vm1", "ACTIVE")
561
562 router_create(tenant_1,"r1")
563 router_interface_add(tenant_1,"r1","as1")
564 router_create(tenant_2,"r1")
565 router_interface_add(tenant_2,"r1","as1")
566
567 create_net(tenant_1,"x1","","--router:external=True")
568 create_net(tenant_2,"x1","","--router:external=True")
569
570 router_gateway_set(tenant_1,"r1","x1")
571 router_gateway_set(tenant_2,"r1","x1")
572
573 subnetid_1 = get_id(tenant_1,"subnet","as1")
574 subnetid_2 = get_id(tenant_2,"subnet","as1")
575 port_create(tenant_1,"p1","a1","10.0.1.100",subnetid_1)
576 port_create(tenant_2,"p1","a1","10.0.1.100",subnetid_2)
577
578 port_id_1 = get_id(tenant_1,"port","p1")
579 port_id_2 = get_id(tenant_2,"port","p1")
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000580 status = validate_vtn_flows()
581 assert_equal(status, True)
ChetanGaonker71fe0302016-12-19 17:45:44 -0800582
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000583 def test_cordvtn_for_creation_of_network(self):
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800584
585 ret1 = create_tenant(netA)
586 if ret1 != 0:
587 print "Creation of Tenant netA Failed"
588
589 ret2 = create_tenant(netB)
590 if ret2 != 0:
591 print "Creation of Tenant netB Failed"
ChetanGaonkerd65b7612016-12-07 01:01:20 -0800592 network = {'name': self.network_name, 'admin_state_up': True}
593 self.neutron.create_network({'network':network})
594 log.info("Created network:{0}".format(self.network_name))
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000595 status = validate_vtn_flows()
596 assert_equal(status, True)
ChetanGaonkerd65b7612016-12-07 01:01:20 -0800597
598 def test_cordvtn_to_create_net_work_with_subnet(self):
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 = self.network_name
608 network = {'name': network_name, 'admin_state_up': True}
609 network_info = self.neutron.create_network({'network':network})
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800610 network_id = network_info['network']['id']
ChetanGaonkerd65b7612016-12-07 01:01:20 -0800611
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800612 log.info("Created network:{0}".format(network_id))
ChetanGaonkerd65b7612016-12-07 01:01:20 -0800613 self.network_ids.append(network_id)
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800614 subnet_count = 1
615 for cidr in self.subnet_cidrs:
ChetanGaonkerd65b7612016-12-07 01:01:20 -0800616 gateway_ip = str(list(cidr)[1])
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800617 subnet = {"network_id": network_id, "ip_version":4,
618 "cidr":str(cidr), "enable_dhcp":True,
619 "host_routes":[{"destination":"0.0.0.0/0", "nexthop":gateway_ip}]
620 }
ChetanGaonkerd65b7612016-12-07 01:01:20 -0800621 subnet = {"name":"subnet-"+str(subnet_count), "network_id": network_id, "ip_version":4, "cidr":str(cidr), "enable_dhcp":True}
622 print subnet
623 self.neutron.create_subnet({'subnet':subnet})
624 log.info("Created subnet:{0}".format(str(cidr)))
625 if not self.number_of_subnet - 1:
626 break
627 self.number_of_subnet -= 1
628 subnet_count += 1
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000629 status = validate_vtn_flows()
630 assert_equal(status, True)
ChetanGaonkerd65b7612016-12-07 01:01:20 -0800631
632 def test_cordvtn_subnet_limit(self):
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800633 onos_load_config()
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800634
635 ret1 = create_tenant(netA)
636 if ret1 != 0:
637 print "Creation of Tenant netA Failed"
638
639 ret2 = create_tenant(netB)
640 if ret2 != 0:
641 print "Creation of Tenant netB Failed"
ChetanGaonkerd65b7612016-12-07 01:01:20 -0800642 network_name = uuid.uuid4().get_hex()
643 network = {'name': network_name, 'admin_state_up': True}
644 network_info = self.neutron.create_network({'network':network})
645 log.info("Created network:{0}".format(network_name))
646 network_id = network_info['network']['id']
647 self.network_ids.append(network_id)
648 subnet_cidrs = ['11.2.2.0/29', '11.2.2.8/29']
649 for cidr in subnet_cidrs:
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800650 subnet = {"network_id": network_id, "ip_version":4, "cidr": cidr}
651 subnet_info = self.neutron.create_subnet({'subnet':subnet})
652 subnet_id = subnet_info['subnet']['id']
653 log.info("Created subnet:{0}".format(cidr))
ChetanGaonkerd65b7612016-12-07 01:01:20 -0800654 while True:
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800655 port = {"network_id": network_id, "admin_state_up": True}
656 port_info = self.neutron.create_port({'port':port})
657 port_id = port_info['port']['id']
658 self.port_ids.append(port_id)
659 log.info("Created Port:{0}".format(port_info['port']['id']))
660 if not self.quota_limit:
ChetanGaonkerd65b7612016-12-07 01:01:20 -0800661 break
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800662 self.quota_limit -= 1
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000663 status = validate_vtn_flows()
664 assert_equal(status, True)
ChetanGaonkerd65b7612016-12-07 01:01:20 -0800665
666 def test_cordvtn_floatingip_limit(self):
ChetanGaonkerd65b7612016-12-07 01:01:20 -0800667
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800668 ret1 = create_tenant(netA)
669 if ret1 != 0:
670 print "Creation of Tenant netA Failed"
671
672 ret2 = create_tenant(netB)
673 if ret2 != 0:
674 print "Creation of Tenant netB Failed"
675 while True:
676 floatingip = {"floating_network_id": self.floating_nw_id}
677 fip_info = self.neutron.create_floatingip({'floatingip':floatingip})
678 fip_id = fip_info['floatingip']['id']
679 log.info("Created Floating IP:{0}".format(fip_id))
680 self.fip_ids.append(fip_id)
681 if not self.quota_limit:
682 break
683 self.quota_limit -= 1
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000684 status = validate_vtn_flows()
685 assert_equal(status, True)
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800686
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000687 def test_cordvtn_for_10_neutron_networks(self):
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800688
689 ret1 = create_tenant(netA)
690 if ret1 != 0:
691 print "Creation of Tenant netA Failed"
692
693 ret2 = create_tenant(netB)
694 if ret2 != 0:
695 print "Creation of Tenant netB Failed"
696 pool = Pool(processes=10)
697 ret = os.system("neutron quote-update --network 15")
698 if ret1 != 0:
699 print "Neutron network install failed"
700 for i in range(1, 11):
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000701 pool.apply_async(create_network, (i, ))
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800702
703 pool.close()
704 pool.join()
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000705 status = validate_vtn_flows()
706 assert_equal(status, True)
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800707
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000708 def test_cordvtn_for_100_neutron_networks(self):
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800709
710 ret1 = create_tenant(netA)
711 if ret1 != 0:
712 print "Creation of Tenant netA Failed"
713
714 ret2 = create_tenant(netB)
715 if ret2 != 0:
716 print "Creation of Tenant netB Failed"
717 pool = Pool(processes=10)
718
719 ret = os.system("neutron quote-update --network 105")
720 if ret1 != 0:
721 print "Neutron network install failed"
722 for i in range(1, 101):
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000723 pool.apply_async(create_network, (i, ))
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800724
725 pool.close()
726 pool.join()
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000727 status = validate_vtn_flows()
728 assert_equal(status, True)
729
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000730 def test_cordvtn_creating_virtual_private_network(self):
731 """
732 Algo:
733 1) Validate that required openstack service is up and running.
734 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
735 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network.
736 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
737 4) Verify that NetA is being created and validate IP in nova list command.
738 5) Verify that flow is being added in ovs-switch in compute-node.
739 6) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
740 """
741 pass
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000742
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000743 def test_cordvtn_creating_virtual_public_network(self):
744 """
745 Algo:
746 1) Validate that required openstack service is up and running.
747 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
748 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as public network.
749 (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24).
750 4) Verify that NetA is being created and validate IP in nova list command.
751 5) Verify that flow is being added in ovs-switch in compute-node.
752 6) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
753 """
754 pass
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000755
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000756 def test_cordvtn_creating_virtual_local_management_network(self):
757 """
758 Algo:
759 1) Validate that required openstack service is up and running.
760 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
761 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
762 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
763 4) Verify that NetA is being created and validate IP in nova list command.
764 5) Verify that flow is being added in ovs-switch in compute-node.
765 6) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
766 """
767 pass
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000768
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000769 def test_cordvtn_creating_virtual_vlan_connectivity_network(self):
770 """
771 Algo:
772 1) Validate that required openstack service is up and running.
773 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
774 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a vlan port-create.
775 (neutron port-create net-A-private --name stag-100).
776 4) Verify that NetA is being created and validate IP in nova list command.
777 5) Verify that flow is being added in ovs-switch in compute-node.
778 6) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
779 """
780 pass
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000781
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000782 def test_cordvtn_creating_virtual_floating_IP_with_vlan_connectivity_network(self):
783 """
784 Algo:
785 1) Validate that required openstack service is up and running.
786 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
787 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a floating ip and vlan port-create.
788 (neutron port-create net-A-private --name stag-500).
789 4) Verify that NetA is being created and validate IP in nova list command.
790 5) Verify that flow is being added in ovs-switch in compute-node.
791 6) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
792 """
793 pass
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000794
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000795 def test_cordvtn_creating_virtual_private_network_and_boot_image(self):
796 """
797 Algo:
798 1) Validate that required openstack service is up and running.
799 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
800 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network.
801 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
802 4) Now boot image in the same created network using nova boot image command (example given below :-
803 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
804 5) Wait till VM boots up and starts running.
805 6) Verify that a VM is launched and running by using novaclient python API.
806 7) Verify that flow is being added in ovs-switch in compute-node.
807 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
808 9) Verify that cord-onos pushed flows to OVS switch.
809 """
810 pass
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000811
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000812 def test_cordvtn_creating_virtual_public_network_and_boot_image(self):
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000813
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000814 """
815 Algo:
816 1) Validate that required openstack service is up and running.
817 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
818 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as public network.
819 (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24).
820 4) Now boot image in the same created network using nova boot image command (example given below :-
821 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
822 5) Wait till VM boots up and starts running.
823 6) Verify that a VM is launched and running by using novaclient python API.
824 7) Verify that flow is being added in ovs-switch in compute-node.
825 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
826 9) Verify that cord-onos pushed flows to OVS switch.
827 """
828 pass
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000829
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000830 def test_cordvtn_creating_virtual_local_management_network_and_boot_image(self):
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000831
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000832 """
833 Algo:
834 1) Validate that required openstack service is up and running.
835 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
836 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
837 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
838 4) Now boot image in the same created network using nova boot image command (example given below :-
839 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
840 5) Wait till VM boots up and starts running.
841 6) Verify that a VM is launched and running by using novaclient python API.
842 7) Verify that flow is being added in ovs-switch in compute-node.
843 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
844 9) Verify that cord-onos pushed flows to OVS switch.
845 """
846 pass
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000847
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000848 def test_cordvtn_creating_virtual_vlan_connectivity_network_and_boot_image(self):
849 """
850 Algo:
851 1) Validate that required openstack service is up and running.
852 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
853 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a vlan port-create.
854 (neutron port-create net-A-private --name stag-100).
855 4) Now boot image in the same created network using nova boot image command (example given below :-
856 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
857 5) Wait till VM boots up and starts running.
858 6) Verify that a VM is launched and running by using novaclient python API.
859 7) Verify that flow is being added in ovs-switch in compute-node.
860 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
861 9) Verify that cord-onos pushed flows to OVS switch.
862 """
863 pass
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000864
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000865 def test_cordvtn_creating_virtual_floating_IP_with_vlan_connectivity_network_and_boot_image(self):
866 """
867 Algo:
868 1) Validate that required openstack service is up and running.
869 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
870 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a floating ip and vlan port-create.
871 (neutron port-create net-A-private --name stag-500).
872 4) Now boot image in the same created network using nova boot image command (example given below :-
873 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
874 5) Wait till VM boots up and starts running.
875 6) Verify that a VM is launched and running by using novaclient python API.
876 7) Verify that flow is being added in ovs-switch in compute-node.
877 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
878 9) Verify that cord-onos pushed flows to OVS switch.
879 """
880 pass
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000881
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000882 def test_cordvtn_creating_virtual_private_network_and_boot_2_images_in_same_service(self):
883 """
884 Algo:
885 1) Validate that required openstack service is up and running.
886 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
887 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network.
888 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
889 4) Now boot 2 images in the same created network using nova boot image command (example given below :-
890 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
891 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-02
892 5) Wait till VMs boot up and running.
893 6) Verify that two VMs are launched and running by using novaclient python API.
894 7) Verify that flow is being added in ovs-switch in compute-node.
895 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
896 9) Verify that cord-onos pushed flows to OVS switch.
897 """
898 pass
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000899
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000900 def test_cordvtn_creating_virtual_public_network_and_boot_2_images_in_same_service(self):
901 """
902 Algo:
903 1) Validate that required openstack service is up and running.
904 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
905 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as public network.
906 (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24).
907 4) Now boot 2 images in the same created network using nova boot image command (example given below :-
908 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
909 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-02
910 5) Wait till VMs boot up and running.
911 6) Verify that two VMs are launched and running by using novaclient python API.
912 7) Verify that flow is being added in ovs-switch in compute-node.
913 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
914 9) Verify that cord-onos pushed flows to OVS switch.
915 """
916 pass
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000917
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000918 def test_cordvtn_creating_virtual_local_management_network_and_boot_2_images_in_same_service(self):
919 """
920 Algo:
921 1) Validate that required openstack service is up and running.
922 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
923 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
924 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
925 4) Now boot two images in the same created network using nova boot image command (example given below :-
926 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
927 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
928 5) Wait till VMs boot up and running.
929 6) Verify that two VMs are launched and running by using novaclient python API.
930 7) Verify that flow is being added in ovs-switch in compute-node.
931 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
932 9) Verify that cord-onos pushed flows to OVS switch.
933 """
934 pass
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000935
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000936 def test_cordvtn_creating_virtual_vlan_connectivity_network_and_boot_2_images_in_same_service(self):
937 """
938 Algo:
939 1) Validate that required openstack service is up and running.
940 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
941 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a vlan port-create.
942 (neutron port-create net-A-private --name stag-100).
943 4) Now boot two images in the same created network using nova boot image command (example given below :-
944 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
945 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
946 5) Wait till VMs boot up and running.
947 6) Verify that two VMs are launched and running by using novaclient python API.
948 7) Verify that flow is being added in ovs-switch in compute-node.
949 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
950 9) Verify that cord-onos pushed flows to OVS switch.
951 """
952 pass
Chetan Gaonker0fb91c92017-02-07 01:52:18 +0000953
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000954 def test_cordvtn_creating_virtual_floating_IP_with_vlan_connectivity_network_and_boot_2_images_in_same_service(self):
955 """
956 Algo:
957 1) Validate that required openstack service is up and running.
958 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
959 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a floating ip and vlan port-create.
960 (neutron port-create net-A-private --name stag-500).
961 4) Now boot two images in the same created network using nova boot image command (example given below :-
962 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
963 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-02
964 5) Wait till VMs boot up and running.
965 6) Verify that two VMs are launched and running by using novaclient python API.
966 7) Verify that flow is being added in ovs-switch in compute-node.
967 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
968 9) Verify that cord-onos pushed flows to OVS switch.
969 """
970 pass
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800971
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000972 def test_cordvtn_creating_virtual_private_network_and_boot_2_images_in_same_service_connectivity(self):
973 """
974 Algo:
975 1) Validate that required openstack service is up and running.
976 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
977 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network.
978 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
979 4) Now boot 2 images in the same created network using nova boot image command (example given below :-
980 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
981 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-02
982 5) Wait till VMs boot up and running.
983 6) Verify that two VMs are launched and running by using novaclient python API.
984 7) Now ping to the VM from other VM which are launched in same network
985 8) verify that ping is successful
986 9) Verify that flow is being added in ovs-switch in compute-node.
987 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
988 11) Verify that cord-onos pushed flows to OVS switch.
989 """
990 pass
ChetanGaonkeraaea6b62016-12-16 17:06:39 -0800991
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +0000992 def test_cordvtn_creating_virtual_public_network_and_boot_2_images_in_same_service_connectivity_negative_scenario(self):
993 """
994 Algo:
995 1) Validate that required openstack service is up and running.
996 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
997 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as public network.
998 (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24).
999 4) Now boot 2 images in the same created network using nova boot image command (example given below :-
1000 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1001 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-02
1002 5) Wait till VMs boot up and running.
1003 6) Verify that two VMs are launched and running by using novaclient python API.
1004 7) Now ping to the VM from other VM which are launched in same network
1005 8) verify that ping is not successful
1006 9) Verify that flow is being added in ovs-switch in compute-node.
1007 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1008 11) Verify that cord-onos pushed flows to OVS switch.
1009 """
1010 pass
ChetanGaonkeraaea6b62016-12-16 17:06:39 -08001011
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001012 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 -08001013
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001014 """
1015 Algo:
1016 1) Validate that required openstack service is up and running.
1017 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1018 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
1019 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
1020 4) Now boot two images in the same created network using nova boot image command (example given below :-
1021 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
1022 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
1023 5) Wait till VMs boot up and running.
1024 6) Verify that two VMs are launched and running by using novaclient python API.
1025 7) Now ping to the VM from other VM which are launched in same network
1026 8) verify that ping is not successful
1027 9) Verify that flow is being added in ovs-switch in compute-node.
1028 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1029 11) Verify that cord-onos pushed flows to OVS switch.
1030 """
1031 pass
ChetanGaonkeraaea6b62016-12-16 17:06:39 -08001032
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001033 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 -08001034
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001035 """
1036 Algo:
1037 1) Validate that required openstack service is up and running.
1038 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1039 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a vlan port-create.
1040 (neutron port-create net-A-private --name stag-100).
1041 4) Now boot two images in the same created network using nova boot image command (example given below :-
1042 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
1043 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
1044 5) Wait till VMs boot up and running.
1045 6) Verify that two VMs are launched and running by using novaclient python API.
1046 7) Now ping to the VM from other VM which are launched in same network
1047 8) verify that ping is not successful
1048 9) Verify that flow is being added in ovs-switch in compute-node.
1049 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1050 11) Verify that cord-onos pushed flows to OVS switch.
1051 """
1052 pass
ChetanGaonkeraaea6b62016-12-16 17:06:39 -08001053
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001054 def test_cordvtn_creating_virtual_floating_IP_with_vlan_connectivity_network_and_boot_2_images_in_same_service_connectivity_negative_scenario(self):
1055 """
1056 Algo:
1057 1) Validate that required openstack service is up and running.
1058 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1059 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a floating ip and vlan port-create.
1060 (neutron port-create net-A-private --name stag-500).
1061 4) Now boot two images in the same created network using nova boot image command (example given below :-
1062 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
1063 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-02
1064 5) Wait till VMs boot up and running.
1065 6) Verify that two VMs are launched and running by using novaclient python API.
1066 7) Now ping to the VM from other VM which are launched in same network
1067 8) verify that ping is not successful
1068 9) Verify that flow is being added in ovs-switch in compute-node.
1069 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1070 11) Verify that cord-onos pushed flows to OVS switch.
1071 """
1072 pass
ChetanGaonkeraaea6b62016-12-16 17:06:39 -08001073
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001074 def test_cordvtn_creating_virtual_private_network_and_boot_image_connectivity_negative_scenario(self):
1075 """
1076 Algo:
1077 1) Validate that required openstack service is up and running.
1078 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1079 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network.
1080 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
1081 4) Now boot image in the same created network using nova boot image command (example given below :-
1082 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1083 5) Wait till VM boots up and starts running.
1084 6) Verify that a VM is launched and running by using novaclient python API.
1085 7) Now ping to the VM from outside network which are internet network (global ping)
1086 8) verify that ping is not successful
1087 9) Verify that flow is being added in ovs-switch in compute-node.
1088 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1089 11) Verify that cord-onos pushed flows to OVS switch.
1090 """
1091 pass
ChetanGaonkeraaea6b62016-12-16 17:06:39 -08001092
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001093 def test_cordvtn_creating_virtual_public_network_and_boot_image_connectivity(self):
1094 """
1095 Algo:
1096 1) Validate that required openstack service is up and running.
1097 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1098 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as public network.
1099 (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24).
1100 4) Now boot image in the same created network using nova boot image command (example given below :-
1101 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1102 5) Wait till VM boots up and starts running.
1103 6) Verify that a VM is launched and running by using novaclient python API.
1104 7) Now ping to the VM from outside network which are internet network (global ping)
1105 8) verify that ping is successful
1106 9) Verify that flow is being added in ovs-switch in compute-node.
1107 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1108 11) Verify that cord-onos pushed flows to OVS switch.
1109 """
1110 pass
ChetanGaonkeraaea6b62016-12-16 17:06:39 -08001111
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001112 def test_cordvtn_creating_virtual_local_management_network_and_boot_image_connectivity_negative_scenario(self):
1113 """
1114 Algo:
1115 1) Validate that required openstack service is up and running.
1116 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1117 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
1118 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
1119 4) Now boot image in the same created network using nova boot image command (example given below :-
1120 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
1121 5) Wait till VM boots up and starts running.
1122 6) Verify that a VM is launched and running by using novaclient python API.
1123 7) Now ping to the VM from outside network which are internet network (global ping)
1124 8) verify that ping is not successful
1125 9) Verify that flow is being added in ovs-switch in compute-node.
1126 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1127 11) Verify that cord-onos pushed flows to OVS switch.
1128 """
1129 pass
ChetanGaonkeraaea6b62016-12-16 17:06:39 -08001130
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001131 def test_cordvtn_creating_virtual_vlan_connectivity_network_and_boot_image_connectivity_negative_scenario(self):
1132 """
1133 Algo:
1134 1) Validate that required openstack service is up and running.
1135 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1136 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a vlan port-create.
1137 (neutron port-create net-A-private --name stag-100).
1138 4) Now boot image in the same created network using nova boot image command (example given below :-
1139 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
1140 5) Wait till VM boots up and starts running.
1141 6) Verify that a VM is launched and running by using novaclient python API.
1142 7) Now ping to the VM from outside network which are internet network (global ping)
1143 8) verify that ping is not successful
1144 9) Verify that flow is being added in ovs-switch in compute-node.
1145 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1146 11) Verify that cord-onos pushed flows to OVS switch.
1147 """
1148 pass
ChetanGaonkeraaea6b62016-12-16 17:06:39 -08001149
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001150 def test_cordvtn_creating_virtual_floating_IP_with_vlan_connectivity_network_and_boot_image_connectivity_negative_scenario(self):
1151 """
1152 Algo:
1153 1) Validate that required openstack service is up and running.
1154 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1155 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a floating ip and vlan port-create.
1156 (neutron port-create net-A-private --name stag-500).
1157 4) Now boot image in the same created network using nova boot image command (example given below :-
1158 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
1159 5) Wait till VM boots up and starts running.
1160 6) Verify that a VM is launched and running by using novaclient python API.
1161 7) Now ping to the VM from outside network which are internet network (global ping)
1162 8) verify that ping is not successful
1163 9) Verify that flow is being added in ovs-switch in compute-node.
1164 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1165 11) Verify that cord-onos pushed flows to OVS switch.
1166 """
1167 pass
ChetanGaonkeraaea6b62016-12-16 17:06:39 -08001168
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001169 def test_cordvtn_creating_virtual_private_network_and_boot_image_connectivity_negative_scenario(self):
1170 """
1171 Algo:
1172 1) Validate that required openstack service is up and running.
1173 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1174 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network.
1175 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
1176 4) Now boot image in the same created network using nova boot image command (example given below :-
1177 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1178 5) Wait till VM boots up and starts running.
1179 6) Verify that a VM is launched and running by using novaclient python API.
1180 7) Now ping to the VM from compute node network which are launched a VM.
1181 8) verify that ping is not successful
1182 9) Verify that flow is being added in ovs-switch in compute-node.
1183 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1184 11) Verify that cord-onos pushed flows to OVS switch.
1185 """
1186 pass
ChetanGaonkeraaea6b62016-12-16 17:06:39 -08001187
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001188 def test_cordvtn_creating_virtual_public_network_and_boot_image_connectivity_negative_scenario(self):
1189 """
1190 Algo:
1191 1) Validate that required openstack service is up and running.
1192 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1193 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as public network.
1194 (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24).
1195 4) Now boot image in the same created network using nova boot image command (example given below :-
1196 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1197 5) Wait till VM boots up and starts running.
1198 6) Verify that a VM is launched and running by using novaclient python API.
1199 7) Now ping to the VM from compute node network which are launched a VM.
1200 8) verify that ping is not successful
1201 9) Verify that flow is being added in ovs-switch in compute-node.
1202 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1203 11) Verify that cord-onos pushed flows to OVS switch.
1204 """
1205 pass
ChetanGaonkeraaea6b62016-12-16 17:06:39 -08001206
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001207 def test_cordvtn_creating_virtual_local_management_network_and_boot_image_connectivity(self):
1208 """
1209 Algo:
1210 1) Validate that required openstack service is up and running.
1211 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1212 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
1213 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
1214 4) Now boot image in the same created network using nova boot image command (example given below :-
1215 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
1216 5) Wait till VM boots up and starts running.
1217 6) Verify that a VM is launched and running by using novaclient python API.
1218 7) Now ping to the VM from compute node network which are launched a VM.
1219 8) verify that ping is successful
1220 9) Verify that flow is being added in ovs-switch in compute-node.
1221 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1222 11) Verify that cord-onos pushed flows to OVS switch.
1223 """
1224 pass
ChetanGaonkeraaea6b62016-12-16 17:06:39 -08001225
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001226 def test_cordvtn_creating_virtual_vlan_connectivity_network_and_boot_image_connectivity_negative_scenario(self):
1227 """
1228 Algo:
1229 1) Validate that required openstack service is up and running.
1230 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1231 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a vlan port-create.
1232 (neutron port-create net-A-private --name stag-100).
1233 4) Now boot image in the same created network using nova boot image command (example given below :-
1234 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
1235 5) Wait till VM boots up and starts running.
1236 6) Verify that a VM is launched and running by using novaclient python API.
1237 7) Now ping to the VM from compute node network which are launched a VM.
1238 8) verify that ping is not successful
1239 9) Verify that flow is being added in ovs-switch in compute-node.
1240 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1241 11) Verify that cord-onos pushed flows to OVS switch.
1242 """
1243 pass
ChetanGaonkeraaea6b62016-12-16 17:06:39 -08001244
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001245 def test_cordvtn_creating_virtual_floating_IP_with_vlan_connectivity_network_and_boot_image_connectivity_negative_scenario(self):
1246 """
1247 Algo:
1248 1) Validate that required openstack service is up and running.
1249 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1250 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a floating ip and vlan port-create.
1251 (neutron port-create net-A-private --name stag-500).
1252 4) Now boot image in the same created network using nova boot image command (example given below :-
1253 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
1254 5) Wait till VM boots up and starts running.
1255 6) Verify that a VM is launched and running by using novaclient python API.
1256 7) Now ping to the VM from compute node network which are launched a VM.
1257 8) verify that ping is not successful
1258 9) Verify that flow is being added in ovs-switch in compute-node.
1259 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1260 11) Verify that cord-onos pushed flows to OVS switch.
1261 """
1262 pass
ChetanGaonkeraaea6b62016-12-16 17:06:39 -08001263
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001264 def test_cordvtn_creating_virtual_vlan_interface_private_network_and_boot_image_connectivity_negative_scenario(self):
ChetanGaonkeraaea6b62016-12-16 17:06:39 -08001265
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001266 """
1267 Algo:
1268 1) Validate that required openstack service is up and running.
1269 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1270 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network.
1271 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
1272 4) Now boot image in the same created network using nova boot image command (example given below :-
1273 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1274 5) Wait till VM boots up and starts running.
1275 6) Verify that a VM is launched and running by using novaclient python API.
1276 7) Create a virtual interface with vlan tag and private ip on VM.
1277 8) Create a same virtual interface with valn tag and private ip on head node.
1278 9) Now ping to the VM from head node network which are launched a openstack service.
1279 10) verify that ping is successful
1280 11) Verify that flow is being added in ovs-switch in compute-node.
1281 12) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1282 13) Verify that cord-onos pushed flows to OVS switch.
1283 """
1284 pass
ChetanGaonkeraaea6b62016-12-16 17:06:39 -08001285
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001286 def test_cordvtn_creating_virtual_vlan_interface_public_network_and_boot_image_connectivity_negative_scenario(self):
ChetanGaonker901727c2016-11-29 14:05:03 -08001287
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001288 """
1289 Algo:
1290 1) Validate that required openstack service is up and running.
1291 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1292 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as public network.
1293 (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24).
1294 4) Now boot image in the same created network using nova boot image command (example given below :-
1295 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1296 5) Wait till VM boots up and starts running.
1297 6) Verify that a VM is launched and running by using novaclient python API.
1298 7) Create a virtual interface with vlan tag and public ip on VM.
1299 8) Create a same virtual interface with valn tag and any pulic ip on head node.
1300 9) Now ping to the VM from head node network which are launched a openstack service.
1301 10) verify that ping is successful
1302 11) Verify that flow is being added in ovs-switch in compute-node.
1303 12) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1304 13) Verify that cord-onos pushed flows to OVS switch.
1305 """
1306 pass
ChetanGaonker901727c2016-11-29 14:05:03 -08001307
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001308 def test_cordvtn_creating_virtual_vlan_interface_local_management_network_and_boot_image_connectivity(self):
ChetanGaonker901727c2016-11-29 14:05:03 -08001309
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001310 """
1311 Algo:
1312 1) Validate that required openstack service is up and running.
1313 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1314 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
1315 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
1316 4) Now boot image in the same created network using nova boot image command (example given below :-
1317 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
1318 5) Wait till VM boots up and starts running.
1319 6) Verify that a VM is launched and running by using novaclient python API.
1320 7) Create a virtual interface with vlan tag and local management ip on VM.
1321 8) Create a same virtual interface with valn tag and any local management ip on head node.
1322 9) Now ping to the VM from head node network which are launched a openstack service.
1323 10) verify that ping is successful
1324 11) Verify that flow is being added in ovs-switch in compute-node.
1325 12) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1326 13) Verify that cord-onos pushed flows to OVS switch.
1327 """
1328 pass
ChetanGaonker901727c2016-11-29 14:05:03 -08001329
ChetanGaonker901727c2016-11-29 14:05:03 -08001330
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001331 def test_cordvtn_creating_virtual_vlan_interface_floating_private_network_and_boot_image_connectivity_negative_scenario(self):
ChetanGaonker901727c2016-11-29 14:05:03 -08001332
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001333 """
1334 Algo:
1335 1) Validate that required openstack service is up and running.
1336 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1337 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network.
1338 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
1339 4) Now boot image in the same created network using nova boot image command (example given below :-
1340 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1341 5) Wait till VM boots up and starts running.
1342 6) Verify that a VM is launched and running by using novaclient python API.
1343 7) Create a virtual interface with vlan tag and private floating ip on VM.
1344 8) Create a same virtual interface with valn tag and private floating ip on head node.
1345 9) Now ping to the VM from head node network which are launched a openstack service.
1346 10) verify that ping is successful
1347 11) Verify that flow is being added in ovs-switch in compute-node.
1348 12) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1349 13) Verify that cord-onos pushed flows to OVS switch.
1350 """
1351 pass
ChetanGaonker901727c2016-11-29 14:05:03 -08001352
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001353 def test_cordvtn_creating_virtual_vlan_interface_floating_public_network_and_boot_image_connectivity_negative_scenario(self):
ChetanGaonker901727c2016-11-29 14:05:03 -08001354
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001355 """
1356 Algo:
1357 1) Validate that required openstack service is up and running.
1358 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1359 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as public network.
1360 (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24).
1361 4) Now boot image in the same created network using nova boot image command (example given below :-
1362 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1363 5) Wait till VM boots up and starts running.
1364 6) Verify that a VM is launched and running by using novaclient python API.
1365 7) Create a virtual interface with vlan tag and public floating ip on VM.
1366 8) Create a same virtual interface with valn tag and any pulic floating ip on head node.
1367 9) Now ping to the VM from head node network which are launched a openstack service.
1368 10) verify that ping is successful
1369 11) Verify that flow is being added in ovs-switch in compute-node.
1370 12) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1371 13) Verify that cord-onos pushed flows to OVS switch.
1372 """
1373 pass
ChetanGaonker901727c2016-11-29 14:05:03 -08001374
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001375 def test_cordvtn_creating_virtual_vlan_interface_floating_local_management_network_and_boot_image_connectivity(self):
ChetanGaonker901727c2016-11-29 14:05:03 -08001376
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001377 """
1378 Algo:
1379 1) Validate that required openstack service is up and running.
1380 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1381 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
1382 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
1383 4) Now boot image in the same created network using nova boot image command (example given below :-
1384 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
1385 5) Wait till VM boots up and starts running.
1386 6) Verify that a VM is launched and running by using novaclient python API.
1387 7) Create a virtual interface with vlan tag and local management floating ip on VM.
1388 8) Create a same virtual interface with valn tag and any local management floating ip on head node.
1389 9) Now ping to the VM from head node network which are launched a openstack service.
1390 10) verify that ping is successful
1391 11) Verify that flow is being added in ovs-switch in compute-node.
1392 12) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1393 13) Verify that cord-onos pushed flows to OVS switch.
1394 """
1395 pass
ChetanGaonker901727c2016-11-29 14:05:03 -08001396
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001397 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 -08001398
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001399 """
1400 Algo:
1401 1) Validate that required openstack service is up and running.
1402 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1403 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as public network.
1404 (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24).
1405 4) Now boot 2 images in the same created network using nova boot image command (example given below :-
1406 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1407 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-02
1408 5) Wait till VMs boot up and running.
1409 6) Verify that two VMs are launched and running by using novaclient python API.
1410 7) Now ping to the VM from other VM which are launched in the private network
1411 8) verify that ping is not successful
1412 9) Verify that flow is being added in ovs-switch in compute-node.
1413 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1414 11) Verify that cord-onos pushed flows to OVS switch.
1415 """
1416 pass
ChetanGaonker901727c2016-11-29 14:05:03 -08001417
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001418 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 -08001419
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001420 """
1421 Algo:
1422 1) Validate that required openstack service is up and running.
1423 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1424 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
1425 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
1426 4) Now boot two images in the same created network using nova boot image command (example given below :-
1427 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
1428 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
1429 5) Wait till VMs boot up and running.
1430 6) Verify that two VMs are launched and running by using novaclient python API.
1431 7) Now ping to the VM from other VM which are launched in the private network
1432 8) verify that ping is not successful
1433 9) Verify that flow is being added in ovs-switch in compute-node.
1434 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1435 11) Verify that cord-onos pushed flows to OVS switch.
1436 """
1437 pass
ChetanGaonkeraaea6b62016-12-16 17:06:39 -08001438
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001439 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 -08001440
Thangavelu K Sbdb1ec42017-02-23 19:51:42 +00001441 """
1442 Algo:
1443 1) Validate that required openstack service is up and running.
1444 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1445 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a vlan port-create.
1446 (neutron port-create net-A-private --name stag-100).
1447 4) Now boot two images in the same created network using nova boot image command (example given below :-
1448 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
1449 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
1450 5) Wait till VMs boot up and running.
1451 6) Verify that two VMs are launched and running by using novaclient python API.
1452 7) Now ping to the VM from other VM which are launched in the private network
1453 8) verify that ping is not successful
1454 9) Verify that flow is being added in ovs-switch in compute-node.
1455 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1456 11) Verify that cord-onos pushed flows to OVS switch.
1457 """
1458 pass
1459
1460 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):
1461
1462 """
1463 Algo:
1464 1) Validate that required openstack service is up and running.
1465 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1466 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a floating ip and vlan port-create.
1467 (neutron port-create net-A-private --name stag-500).
1468 4) Now boot two images in the same created network using nova boot image command (example given below :-
1469 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
1470 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-02
1471 5) Wait till VMs boot up and running.
1472 6) Verify that two VMs are launched and running by using novaclient python API.
1473 7) Now ping to the VM from other VM which are launched in the private network
1474 8) verify that ping is not successful
1475 9) Verify that flow is being added in ovs-switch in compute-node.
1476 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1477 11) Verify that cord-onos pushed flows to OVS switch.
1478 """
1479 pass
1480
1481 def test_cordvtn_creating_one_virtual_local_management_other_public_network_and_boot_2_images_in_same_service_connectivity_negative_scenario(self):
1482
1483 """
1484 Algo:
1485 1) Validate that required openstack service is up and running.
1486 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1487 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
1488 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
1489 4) Now boot two images in the same created network using nova boot image command (example given below :-
1490 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
1491 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
1492 5) Wait till VMs boot up and running.
1493 6) Verify that two VMs are launched and running by using novaclient python API.
1494 7) Now ping to the VM from other VM which are launched in the public network
1495 8) verify that ping is not successful
1496 9) Verify that flow is being added in ovs-switch in compute-node.
1497 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1498 11) Verify that cord-onos pushed flows to OVS switch.
1499 """
1500 pass
1501
1502 def test_cordvtn_creating_one_virtual_vlan_connectivity_and_a_private_network_and_boot_2_images_in_same_service_connectivity_negative_scenario(self):
1503
1504 """
1505 Algo:
1506 1) Validate that required openstack service is up and running.
1507 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1508 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a vlan port-create.
1509 (neutron port-create net-A-private --name stag-100).
1510 4) Now boot two images in the same created network using nova boot image command (example given below :-
1511 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
1512 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
1513 5) Wait till VMs boot up and running.
1514 6) Verify that two VMs are launched and running by using novaclient python API.
1515 7) Now ping to the VM from other VM which are launched in the public network
1516 8) verify that ping is not successful
1517 9) Verify that flow is being added in ovs-switch in compute-node.
1518 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1519 11) Verify that cord-onos pushed flows to OVS switch.
1520 """
1521 pass
1522
1523 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):
1524
1525 """
1526 Algo:
1527 1) Validate that required openstack service is up and running.
1528 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1529 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a floating ip and vlan port-create.
1530 (neutron port-create net-A-private --name stag-500).
1531 4) Now boot two images in the same created network using nova boot image command (example given below :-
1532 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
1533 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-02
1534 5) Wait till VMs boot up and running.
1535 6) Verify that two VMs are launched and running by using novaclient python API.
1536 7) Now ping to the VM from other VM which are launched in the public network
1537 8) verify that ping is not successful
1538 9) Verify that flow is being added in ovs-switch in compute-node.
1539 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1540 11) Verify that cord-onos pushed flows to OVS switch.
1541 """
1542 pass
1543
1544 def test_cordvtn_creating_one_virtual_vlan_connectivity_other_local_management_network_and_boot_2_images_in_same_service_connectivity_negative_scenario(self):
1545
1546 """
1547 Algo:
1548 1) Validate that required openstack service is up and running.
1549 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1550 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a vlan port-create.
1551 (neutron port-create net-A-private --name stag-100).
1552 4) Now boot two images in the same created network using nova boot image command (example given below :-
1553 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
1554 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
1555 5) Wait till VMs boot up and running.
1556 6) Verify that two VMs are launched and running by using novaclient python API.
1557 7) Now ping to the VM from other VM which are launched in the public network
1558 8) verify that ping is not successful
1559 9) Verify that flow is being added in ovs-switch in compute-node.
1560 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1561 11) Verify that cord-onos pushed flows to OVS switch.
1562 """
1563 pass
1564
1565 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):
1566
1567 """
1568 Algo:
1569 1) Validate that required openstack service is up and running.
1570 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1571 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a floating ip and vlan port-create.
1572 (neutron port-create net-A-private --name stag-500).
1573 4) Now boot two images in the same created network using nova boot image command (example given below :-
1574 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
1575 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-02
1576 5) Wait till VMs boot up and running.
1577 6) Verify that two VMs are launched and running by using novaclient python API.
1578 7) Now ping to the VM from other VM which are launched in the public network
1579 8) verify that ping is not successful
1580 9) Verify that flow is being added in ovs-switch in compute-node.
1581 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1582 11) Verify that cord-onos pushed flows to OVS switch.
1583 """
1584 pass
1585
1586 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):
1587
1588 """
1589 Algo:
1590 1) Validate that required openstack service is up and running.
1591 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1592 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a floating ip and vlan port-create.
1593 (neutron port-create net-A-private --name stag-500).
1594 4) Now boot two images in the same created network using nova boot image command (example given below :-
1595 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
1596 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-02
1597 5) Wait till VMs boot up and running.
1598 6) Verify that two VMs are launched and running by using novaclient python API.
1599 7) Now ping to the VM from other VM which are launched in the public network
1600 8) verify that ping is not successful
1601 9) Verify that flow is being added in ovs-switch in compute-node.
1602 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1603 11) Verify that cord-onos pushed flows to OVS switch.
1604 """
1605 pass
1606
1607 def test_cordvtn_creating_virtual_public_network_and_boot_2_images_with_invalid_public_field_of_onos_network_cfg_json_in_same_service(self):
1608 """
1609 Algo:
1610 1) Validate that required openstack service is up and running.
1611 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1612 3) Push network_cfg.json config file to onos with an invalid public gateway ip in network_cfg.json file.
1613 4) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as public network.
1614 (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24).
1615 5) Now boot 2 images in the same created network using nova boot image command (example given below :-
1616 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1617 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-02
1618 6) Wait till VMs boot up and running.
1619 7) Verify that two VMs are launched and running by using novaclient python API.
1620 8) Verify that flow is being added in ovs-switch in compute-node.
1621 9) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1622 10) Verify that cord-onos pushed flows to OVS switch.
1623 11) Verify ping from VM to public gateway which is send to ONOS through rest API in network_cfg.json file.
1624 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.
1625 13) Now ping one VM to other VM it should not ping again even it in the same service.
1626 """
1627 pass
1628
1629 def test_cordvtn_creating_virtual_local_management_network_and_boot_image_with_invalid_localManagementIp_field_of_onos_network_cfg_json(self):
1630
1631 """
1632 Algo:
1633 1) Validate that required openstack service is up and running.
1634 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1635 3) Push network_cfg.json config file to onos with an invalid localManagement ip in network_cfg.json file.
1636 4) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
1637 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
1638 5) Now boot image in the same created network using nova boot image command (example given below :-
1639 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
1640 6) Wait till VM boots up and starts running.
1641 7) Verify that a VM is launched and running by using novaclient python API.
1642 8) Verify that flow is being added in ovs-switch in compute-node.
1643 9) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1644 10) Verify that cord-onos pushed flows to OVS switch.
1645 11) Verify ping from VM to local management ip which is send to ONOS through rest API in network_cfg.json file.
1646 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.
1647 """
1648 pass
1649
1650 def test_cordvtn_creating_virtual_private_network_and_boot_image_with_invalid_OVSDB_port_field_of_onos_network_cfg_json(self):
1651 """
1652 Algo:
1653 1) Validate that required openstack service is up and running.
1654 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1655 3) Push network_cfg.json config file to onos with an invalid ovsdb port in network_cfg.json file.
1656 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network.
1657 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
1658 4) Now boot image in the same created network using nova boot image command (example given below :-
1659 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1660 5) Wait till VM boots up and starts running.
1661 6) Verify that a VM is launched and running by using novaclient python API.
1662 7) Verify that flows are being added in ovs-switch in compute-node.
1663 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1664 9) Verify that cord-onos did not push any flows to OVS switch.
1665 """
1666 pass
1667
1668 def test_cordvtn_creating_virtual_private_network_and_boot_image_with_invalid_OpenStack_details_in_onos_network_cfg_json(self):
1669 """
1670 Algo:
1671 1) Validate that required openstack service is up and running.
1672 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1673 3) Push network_cfg.json config file to onos with an invalid openstack in network_cfg.json file.
1674 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network.
1675 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
1676 4) Now boot image in the same created network using nova boot image command (example given below :-
1677 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1678 5) Wait till VM boots up and starts running.
1679 6) Verify that a VM is launched and running by using novaclient python API.
1680 7) Verify that no flows are being added in ovs-switch in compute-node.
1681 8) Verify that onos-ml2 plugin is not being received a message from openstack service neutron.
1682 9) Verify that cord-onos did not push any flows to OVS switch.
1683 """
1684 pass
1685
1686 def test_cordvtn_creating_virtual_private_network_and_boot_image_with_invalid_compute_node_details_in_onos_network_cfg_json(self):
1687 """
1688 Algo:
1689 1) Validate that required openstack service is up and running.
1690 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1691 3) Push network_cfg.json config file to onos with an invalid compute node details in network_cfg.json file.
1692 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network.
1693 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
1694 4) Now boot image in the same created network using nova boot image command (example given below :-
1695 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1696 5) Wait till VM boots up and starts running.
1697 6) Verify that a VM is launched and running by using novaclient python API.
1698 7) Verify that no flows are being added in ovs-switch in compute-node.
1699 8) Verify that onos-ml2 plugin is not being received a message from openstack service neutron.
1700 9) Verify that cord-onos did not push any flows to OVS switch.
1701 """
1702 pass
1703
1704
1705 def test_cordvtn_creating_two_virtual_private_networks_and_boot_images_in_different_services_connectivity(self):
1706 """
1707 Algo:
1708 1) Validate that required openstack service is up and running.
1709 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1710 3) From CORD-Test container, use python-neutron client and create two networks with name - NetA and NetB with an IP as private network.
1711 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
1712 (neutron net-create net-B-private, neutron subnet-create net-B-private 10.1.0.0/24).
1713 4) Now boot 2 images in the same created network using nova boot image command (example given below :-
1714 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1715 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-B-vm-01
1716 5) Wait till VMs boot up and running.
1717 6) Verify that two VMs are launched and running by using novaclient python API.
1718 7) Verify that flow is being added in ovs-switch in compute-node.
1719 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1720 9) Verify that cord-onos pushed flows to OVS switch.
1721 10) Now ping from VM which is Net-A to other VM which is in Net-B, should not ping.
1722 11) Verify that no flows are being added in the OVS switch.
1723 """
1724 pass
1725
1726 def test_cordvtn_creating_two_virtual_public_networks_and_boot_images_in_different_service_connectivity(self):
1727 """
1728 Algo:
1729 1) Validate that required openstack service is up and running.
1730 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1731 3) From CORD-Test container, use python-neutron client and create two networks with name - NetA and NetB with an IP as public network.
1732 (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24).
1733 (neutron net-create net-A-public, neutron subnet-create net-B-public 198.1.0.0/24).
1734 4) Now boot 2 images in the same created network using nova boot image command (example given below :-
1735 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1736 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-B-vm-01
1737 5) Wait till VMs boot up and running.
1738 6) Verify that two VMs are launched and running by using novaclient python API.
1739 7) Verify that flow is being added in ovs-switch in compute-node.
1740 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1741 9) Verify that cord-onos pushed flows to OVS switch.
1742 10) Now ping from VM which is Net-A to other VM which is in Net-B, should not ping.
1743 11) Verify that no flows are being added in the OVS switch.
1744 """
1745 pass
1746
1747 def test_cordvtn_creating_two_virtual_local_management_networks_and_boot_images_in_different_service_connectivity(self):
1748 """
1749 Algo:
1750 1) Validate that required openstack service is up and running.
1751 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1752 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.
1753 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
1754 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.28.0.0/24 -gateway 172.28.0.1).
1755 4) Now boot two images in the same created network using nova boot image command (example given below :-
1756 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
1757 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
1758 5) Wait till VMs boot up and running.
1759 6) Verify that two VMs are launched and running by using novaclient python API.
1760 7) Verify that flow is being added in ovs-switch in compute-node.
1761 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1762 9) Verify that cord-onos pushed flows to OVS switch.
1763 10) Now ping from VM which is Net-A to other VM which is in Net-B, should not ping.
1764 11) Verify that no flows are being added in the OVS switch.
1765 """
1766 pass
1767
1768 def test_cordvtn_creating_two_virtual_vlan_connectivity_networks_and_boot_images_in_different_service_connectivity(self):
1769 """
1770 Algo:
1771 1) Validate that required openstack service is up and running.
1772 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1773 3) From CORD-Test container, use python-neutron client and create two networks with name - NetA and NetB with a vlan port-create.
1774 (neutron port-create net-A-private --name stag-100).
1775 (neutron port-create net-B-private --name stag-200).
1776 4) Now boot two images in the same created network using nova boot image command (example given below :-
1777 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
1778 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg1-01
1779 5) Wait till VMs boot up and running.
1780 6) Verify that two VMs are launched and running by using novaclient python API.
1781 7) Verify that flow is being added in ovs-switch in compute-node.
1782 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1783 9) Verify that cord-onos pushed flows to OVS switch.
1784 10) Now ping from VM which is Net-A to other VM which is in Net-B, should not ping.
1785 11) Verify that no flows are being added in the OVS switch.
1786 """
1787 pass
1788 def test_cordvtn_creating_two_virtual_floating_IP_with_vlan_connectivity_networks_and_boot_images_in_different_service_connectivity(self):
1789 """
1790 Algo:
1791 1) Validate that required openstack service is up and running.
1792 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1793 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.
1794 (neutron port-create net-A-private --name stag-500).
1795 (neutron port-create net-B-private --name stag-500).
1796 4) Now boot two images in the same created network using nova boot image command (example given below :-
1797 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01
1798 nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-02
1799 5) Wait till VMs boot up and running.
1800 6) Verify that two VMs are launched and running by using novaclient python API.
1801 7) Verify that flow is being added in ovs-switch in compute-node.
1802 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1803 9) Verify that cord-onos pushed flows to OVS switch.
1804 10) Now ping from VM which is Net-A to other VM which is in Net-B, should not ping.
1805 11) Verify that no flows are being added in the OVS switch.
1806 """
1807 pass
1808
1809 def test_cordvtn_creating_two_virtual_private_networks_and_boot_images_for_services_dependency_with_out_xos_direct_access(self):
1810 """
1811 Algo:
1812 1) Validate that required openstack service is up and running.
1813 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1814 3) Push service dependency data.json file to onos to subscriber of other service.
1815 $ curl -X POST -H "Content-Type: application/json" -u onos:rocks -d @data.json http://$OC1:8181/onos/cordvtn/serviceNetworks
1816 4) From CORD-Test container, use python-neutron client and create two networks with name - NetA and NetBwith an IP as private network.
1817 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
1818 (neutron net-create net-B-private, neutron subnet-create net-B-private 10.1.0.0/24).
1819 5) Now boot 2 images in the same created network using nova boot image command (example given below :-
1820 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1821 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-B-vm-01
1822 6) Wait till VMs boot up and running.
1823 7) Verify that two VMs are launched and running by using novaclient python API.
1824 8) Verify that flow is being added in ovs-switch in compute-node.
1825 9) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1826 10) Verify that cord-onos pushed flows to OVS switch.
1827 11) Now ping from VM which is Net-A to other VM which is in Net-B, should ping.
1828 12) Verify that flows are being added in the OVS switch.
1829 """
1830 pass
1831
1832 def test_cordvtn_creating_two_virtual_private_networks_and_boot_images_for_services_dependency_with_out_xos_indirect_access(self):
1833 """
1834 Algo:
1835 1) Validate that required openstack service is up and running.
1836 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1837 3) Push service dependency data.json file to onos to subscriber of other service.
1838 $ curl -X POST -H "Content-Type: application/json" -u onos:rocks -d @data.json http://$OC1:8181/onos/cordvtn/serviceNetworks
1839 4) From CORD-Test container, use python-neutron client and create two networks with name - NetA and NetBwith an IP as private network.
1840 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
1841 (neutron net-create net-B-private, neutron subnet-create net-B-private 10.1.0.0/24).
1842 5) Now boot 2 images in the same created network using nova boot image command (example given below :-
1843 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1844 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-B-vm-01
1845 6) Wait till VMs boot up and running.
1846 7) Verify that two VMs are launched and running by using novaclient python API.
1847 8) Verify that flow is being added in ovs-switch in compute-node.
1848 9) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1849 10) Verify that cord-onos pushed flows to OVS switch.
1850 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.
1851 12) Verify that flows are being added in the OVS switch.
1852 """
1853 pass
1854
1855 def test_cordvtn_creating_two_virtual_private_networks_and_boot_images_remove_services_dependency_with_out_xos_direct_access(self):
1856 """
1857 Algo:
1858 1) Validate that required openstack service is up and running.
1859 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1860 3) Push service dependency data.json file to onos to subscriber of other service.
1861 $ curl -X POST -H "Content-Type: application/json" -u onos:rocks -d @data.json http://$OC1:8181/onos/cordvtn/serviceNetworks
1862 4) From CORD-Test container, use python-neutron client and create two networks with name - NetA and NetBwith an IP as private network.
1863 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
1864 (neutron net-create net-B-private, neutron subnet-create net-B-private 10.1.0.0/24).
1865 5) Now boot 2 images in the same created network using nova boot image command (example given below :-
1866 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1867 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-B-vm-01
1868 6) Wait till VMs boot up and running.
1869 7) Verify that two VMs are launched and running by using novaclient python API.
1870 8) Verify that flow is being added in ovs-switch in compute-node.
1871 9) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1872 10) Verify that cord-onos pushed flows to OVS switch.
1873 11) Now ping from VM which is Net-A to other VM which is in Net-B, should ping.
1874 12) Verify that flows are being added in the OVS switch.
1875 13) Push config data with outservice dependency in data.json file to onos to subscriber of other service.
1876 14) Now ping from VM which is Net-A to other VM which is in Net-B, should not ping.
1877 15) Verify that no flows are being added in the OVS switch.
1878 """
1879 pass
1880
1881 def test_cordvtn_creating_two_virtual_private_networks_and_boot_images_remove_services_dependency_with_out_xos_indirect_access(self):
1882 """
1883 Algo:
1884 1) Validate that required openstack service is up and running.
1885 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1886 3) Push service dependency data.json file to onos to subscriber of other service.
1887 $ curl -X POST -H "Content-Type: application/json" -u onos:rocks -d @data.json http://$OC1:8181/onos/cordvtn/serviceNetworks
1888 4) From CORD-Test container, use python-neutron client and create two networks with name - NetA and NetBwith an IP as private network.
1889 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
1890 (neutron net-create net-B-private, neutron subnet-create net-B-private 10.1.0.0/24).
1891 5) Now boot 2 images in the same created network using nova boot image command (example given below :-
1892 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1893 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-B-vm-01
1894 6) Wait till VMs boot up and running.
1895 7) Verify that two VMs are launched and running by using novaclient python API.
1896 8) Verify that flow is being added in ovs-switch in compute-node.
1897 9) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1898 10) Verify that cord-onos pushed flows to OVS switch.
1899 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.
1900 12) Verify that flows are being added in the OVS switch.
1901 13) Push config data with out service dependency in data.json file to onos to subscriber of other service.
1902 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.
1903 15) Verify that no flows are being added in the OVS switch.
1904 """
1905 pass
1906
1907 def test_cordvtn_creating_two_virtual_private_networks_and_boot_images_for_services_dependency_with_xos_direct_access(self):
1908 """
1909 Algo:
1910 1) Validate that required openstack service is up and running.
1911 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1912 3) Validate that XOS is up and running.
1913 4) From CORD-Test container, use python-neutron client and create two networks with name - NetA and NetBwith an IP as private network.
1914 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
1915 (neutron net-create net-B-private, neutron subnet-create net-B-private 10.1.0.0/24).
1916 5) Now boot 2 images in the same created network using nova boot image command (example given below :-
1917 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1918 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-B-vm-01
1919 6) Wait till VMs boot up and running.
1920 7) Verify that two VMs are launched and running by using novaclient python API.
1921 8) Verify that flow is being added in ovs-switch in compute-node.
1922 9) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1923 10) Verify that cord-onos pushed flows to OVS switch.
1924 11) Now ping from VM which is Net-A to other VM which is in Net-B, should ping.
1925 12) Verify that flows are being added in the OVS switch.
1926 """
1927 pass
1928
1929 def test_cordvtn_creating_two_virtual_private_networks_and_boot_images_for_services_dependency_with_xos_indirect_access(self):
1930 """
1931 Algo:
1932 1) Validate that required openstack service is up and running.
1933 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1934 3) Validate that XOS is up and running.
1935 4) From CORD-Test container, use python-neutron client and create two networks with name - NetA and NetBwith an IP as private network.
1936 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
1937 (neutron net-create net-B-private, neutron subnet-create net-B-private 10.1.0.0/24).
1938 5) Now boot 2 images in the same created network using nova boot image command (example given below :-
1939 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
1940 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-B-vm-01
1941 6) Wait till VMs boot up and running.
1942 7) Verify that two VMs are launched and running by using novaclient python API.
1943 8) Verify that flow is being added in ovs-switch in compute-node.
1944 9) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
1945 10) Verify that cord-onos pushed flows to OVS switch.
1946 11) Now ping from VM which is Net-B to other VM which is in Net-A, should ping.
1947 12) Verify that flows are being added in the OVS switch.
1948 """
1949 pass
1950
1951 def test_cordvtn_with_access_agent_serviceType_and_vtn_location_field_network_cfg_connectivity_to_access_device(self):
1952 """
1953 Algo:
1954 1) Validate that required openstack service is up and running.
1955 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1956 3) Push access-agent additional network_cfg to ONOS and specify vtn-location field info must be access-agent container.
1957 4) Launch the access-agent and access-device containers and then restart openstack compute node.
1958 $ sudo docker run --privileged --cap-add=ALL -d --name access-agent -t ubuntu:14.04 /bin/bash
1959 5) Create each interface on br-int and br-mgmt using pipework on access-agent containers
1960 $ sudo ./pipework br-mgmt -i eth1 access-agent 10.10.10.20/24
1961 $ sudo ./pipework br-int -i eth2 access-agent 10.168.0.100/24 fa:00:00:00:00:11
1962 6) We ahve to stop ONOS service to test this
1963 onos-service stop
1964 sudo ovs-ofctl -O OpenFlow13 del-flows br-int "arp"
1965 7) Now attach to access-agent container and ping to access-device
1966 8) Verify that ping should be success and flows are being added in br-int.
1967 """
1968 pass
1969
1970 def test_cordvtn_with_access_agent_serviceType_and_vtn_location_field_in_network_cfg_connectivity_to_head_node(self):
1971 """
1972 Algo:
1973 1) Validate that required openstack service is up and running.
1974 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1975 3) Push access-agent additional network_cfg to ONOS and specify vtn-location field info must be access-agent container.
1976 4) Launch the access-agent and access-device containers and then restart openstack compute node.
1977 $ sudo docker run --privileged --cap-add=ALL -d --name access-agent -t ubuntu:14.04 /bin/bash
1978 5) Create each interface on br-int and br-mgmt using pipework on access-agent containers
1979 $ sudo ./pipework br-mgmt -i eth1 access-agent 10.10.10.20/24
1980 $ sudo ./pipework br-int -i eth2 access-agent 10.168.0.100/24 fa:00:00:00:00:11
1981 6) We ahve to stop ONOS service to test this
1982 onos-service stop
1983 sudo ovs-ofctl -O OpenFlow13 del-flows br-int "arp"
1984 7) Now attach to access-agent container and ping to head node
1985 8) Verify that ping should be success and flows are being added in br-int.
1986 """
1987 pass
1988
1989 def test_cordvtn_with_access_agent_serviceType_and_invalid_vtn_location_field_network_cfg_connectivity_to_access_device(self):
1990 """
1991 Algo:
1992 1) Validate that required openstack service is up and running.
1993 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
1994 3) Push access-agent additional network_cfg to ONOS and specify vtn-location field info must not be access-agent container.
1995 4) Launch the access-agent and access-device containers and then restart openstack compute node.
1996 $ sudo docker run --privileged --cap-add=ALL -d --name access-agent -t ubuntu:14.04 /bin/bash
1997 5) Create each interface on br-int and br-mgmt using pipework on access-agent containers
1998 $ sudo ./pipework br-mgmt -i eth1 access-agent 10.10.10.20/24
1999 $ sudo ./pipework br-int -i eth2 access-agent 10.168.0.100/24 fa:00:00:00:00:11
2000 6) We ahve to stop ONOS service to test this
2001 onos-service stop
2002 sudo ovs-ofctl -O OpenFlow13 del-flows br-int "arp"
2003 7) Now attach to access-agent container and ping to access-device
2004 8) Verify that ping should not be success and no flows are being added in br-int.
2005 """
2006 pass
2007
2008 def test_cordvtn_with_access_agent_serviceType_and_invalid_vtn_location_field_in_network_cfg_connectivity_to_head_node(self):
2009 """
2010 Algo:
2011 1) Validate that required openstack service is up and running.
2012 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
2013 3) Push access-agent additional network_cfg to ONOS and specify vtn-location field info must not be access-agent container.
2014 4) Launch the access-agent and access-device containers and then restart openstack compute node.
2015 $ sudo docker run --privileged --cap-add=ALL -d --name access-agent -t ubuntu:14.04 /bin/bash
2016 5) Create each interface on br-int and br-mgmt using pipework on access-agent containers
2017 $ sudo ./pipework br-mgmt -i eth1 access-agent 10.10.10.20/24
2018 $ sudo ./pipework br-int -i eth2 access-agent 10.168.0.100/24 fa:00:00:00:00:11
2019 6) We ahve to stop ONOS service to test this
2020 onos-service stop
2021 sudo ovs-ofctl -O OpenFlow13 del-flows br-int "arp"
2022 7) Now attach to access-agent container and ping to head node
2023 8) Verify that ping should not be success and no flows are being added in br-int.
2024 """
2025 pass
2026
2027 def test_cordvtn_creating_virtual_private_network_and_boot_2_images_in_same_service_connectivity_after_restarting_VMs(self):
2028 """
2029 Algo:
2030 1) Validate that required openstack service is up and running.
2031 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
2032 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network.
2033 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
2034 4) Now boot 2 images in the same created network using nova boot image command (example given below :-
2035 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
2036 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-02
2037 5) Wait till VMs boot up and running.
2038 6) Verify that two VMs are launched and running by using novaclient python API.
2039 7) Now ping to the VM from other VM which are launched in same network
2040 8) verify that ping is successful
2041 9) Verify that flow is being added in ovs-switch in compute-node.
2042 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
2043 11) Verify that cord-onos pushed flows to OVS switch.
2044 12) Restart both VMs in same service and repeat steps 7 to 11.
2045 """
2046 pass
2047
2048 def test_cordvtn_creating_virtual_private_network_and_boot_2_images_in_same_service_connectivity_after_restarting_cord_onos(self):
2049 """
2050 Algo:
2051 1) Validate that required openstack service is up and running.
2052 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
2053 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network.
2054 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
2055 4) Now boot 2 images in the same created network using nova boot image command (example given below :-
2056 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
2057 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-02
2058 5) Wait till VMs boot up and running.
2059 6) Verify that two VMs are launched and running by using novaclient python API.
2060 7) Now ping to the VM from other VM which are launched in same network
2061 8) verify that ping is successful
2062 9) Verify that flow is being added in ovs-switch in compute-node.
2063 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
2064 11) Verify that cord-onos pushed flows to OVS switch.
2065 12) Restart ONOS service and repeat steps 7 to 11.
2066 """
2067 pass
2068
2069 def test_cordvtn_creating_virtual_private_network_and_boot_2_images_in_same_service_connectivity_after_delete_any_VM_recreating_it(self):
2070 """
2071 Algo:
2072 1) Validate that required openstack service is up and running.
2073 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
2074 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network.
2075 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
2076 4) Now boot 2 images in the same created network using nova boot image command (example given below :-
2077 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
2078 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-02
2079 5) Wait till VMs boot up and running.
2080 6) Verify that two VMs are launched and running by using novaclient python API.
2081 7) Now ping to the VM from other VM which are launched in same network
2082 8) verify that ping is successful
2083 9) Verify that flow is being added in ovs-switch in compute-node.
2084 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
2085 11) Verify that cord-onos pushed flows to OVS switch.
2086 12) Delete a VM which was created earlier and repeat steps 4 to 11.
2087 """
2088 pass
2089
2090 def test_cordvtn_creating_virtual_private_network_and_boot_2_images_in_same_service_connectivity_after_delete_and_add_br_int_bridge(self):
2091 """
2092 Algo:
2093 1) Validate that required openstack service is up and running.
2094 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
2095 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network.
2096 (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24).
2097 4) Now boot 2 images in the same created network using nova boot image command (example given below :-
2098 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
2099 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-02
2100 5) Wait till VMs boot up and running.
2101 6) Verify that two VMs are launched and running by using novaclient python API.
2102 7) Now ping to the VM from other VM which are launched in same network
2103 8) verify that ping is successful
2104 9) Verify that flow is being added in ovs-switch in compute-node.
2105 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
2106 11) Verify that cord-onos pushed flows to OVS switch.
2107 12) Delete a br_int bridge and repeat steps 7 to 11, (it should not ping)
2108 13) Add br_int bridge and repeat steps 7 to 11, (it should ping)
2109 """
2110 pass
2111
2112 def test_cordvtn_creating_virtual_public_network_and_boot_image_connectivity_after_restarting_VM(self):
2113
2114 """
2115 Algo:
2116 1) Validate that required openstack service is up and running.
2117 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
2118 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as public network.
2119 (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24).
2120 4) Now boot image in the same created network using nova boot image command (example given below :-
2121 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
2122 5) Wait till VM boots up and starts running.
2123 6) Verify that a VM is launched and running by using novaclient python API.
2124 7) Now ping to the VM from outside network which are internet network (global ping)
2125 8) verify that ping is successful
2126 9) Verify that flow is being added in ovs-switch in compute-node.
2127 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
2128 11) Verify that cord-onos pushed flows to OVS switch.
2129 12) Restart the VM in service and repeat steps 7 to 11.
2130
2131 """
2132 pass
2133
2134 def test_cordvtn_creating_virtual_public_network_and_boot_image_connectivity_after_restarting_cord_onos(self):
2135
2136 """
2137 Algo:
2138 1) Validate that required openstack service is up and running.
2139 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
2140 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as public network.
2141 (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24).
2142 4) Now boot image in the same created network using nova boot image command (example given below :-
2143 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
2144 5) Wait till VM boots up and starts running.
2145 6) Verify that a VM is launched and running by using novaclient python API.
2146 7) Now ping to the VM from outside network which are internet network (global ping)
2147 8) verify that ping is successful
2148 9) Verify that flow is being added in ovs-switch in compute-node.
2149 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
2150 11) Verify that cord-onos pushed flows to OVS switch.
2151 12) Restart onos service container and repeat steps 7 to 11.
2152
2153 """
2154 pass
2155
2156 def test_cordvtn_creating_virtual_public_network_and_boot_image_connectivity_after_delete_and_recreate_VM(self):
2157
2158 """
2159 Algo:
2160 1) Validate that required openstack service is up and running.
2161 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
2162 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as public network.
2163 (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24).
2164 4) Now boot image in the same created network using nova boot image command (example given below :-
2165 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
2166 5) Wait till VM boots up and starts running.
2167 6) Verify that a VM is launched and running by using novaclient python API.
2168 7) Now ping to the VM from outside network which are internet network (global ping)
2169 8) verify that ping is successful
2170 9) Verify that flow is being added in ovs-switch in compute-node.
2171 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
2172 11) Verify that cord-onos pushed flows to OVS switch.
2173 12) Delete and re-create a VM in the same service and repeat steps 7 to 11.
2174
2175 """
2176 pass
2177
2178 def test_cordvtn_creating_virtual_public_network_and_boot_image_connectivity_after_delete_and_add_br_int_bridge(self):
2179
2180 """
2181 Algo:
2182 1) Validate that required openstack service is up and running.
2183 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
2184 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as public network.
2185 (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24).
2186 4) Now boot image in the same created network using nova boot image command (example given below :-
2187 $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01
2188 5) Wait till VM boots up and starts running.
2189 6) Verify that a VM is launched and running by using novaclient python API.
2190 7) Now ping to the VM from outside network which are internet network (global ping)
2191 8) verify that ping is successful
2192 9) Verify that flow is being added in ovs-switch in compute-node.
2193 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
2194 11) Verify that cord-onos pushed flows to OVS switch.
2195 12) Delete a br_int bridge and repeat steps 7 to 11, (it should not ping)
2196 13) Add br_int bridge and repeat steps 7 to 11, (it should ping)
2197
2198 """
2199 pass
2200
2201 def test_cordvtn_creating_virtual_local_management_network_and_boot_image_connectivity_after_restarting_VM(self):
2202
2203 """
2204 Algo:
2205 1) Validate that required openstack service is up and running.
2206 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
2207 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
2208 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
2209 4) Now boot image in the same created network using nova boot image command (example given below :-
2210 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
2211 5) Wait till VM boots up and starts running.
2212 6) Verify that a VM is launched and running by using novaclient python API.
2213 7) Now ping to the VM from compute node network which are launched a VM.
2214 8) verify that ping is successful
2215 9) Verify that flow is being added in ovs-switch in compute-node.
2216 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
2217 11) Verify that cord-onos pushed flows to OVS switch.
2218 12) Restart the VM in service and repeat steps 7 to 11.
2219 """
2220 pass
2221
2222 def test_cordvtn_creating_virtual_local_management_network_and_boot_image_connectivity_after_restarting_cord_onos(self):
2223
2224 """
2225 Algo:
2226 1) Validate that required openstack service is up and running.
2227 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
2228 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
2229 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
2230 4) Now boot image in the same created network using nova boot image command (example given below :-
2231 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
2232 5) Wait till VM boots up and starts running.
2233 6) Verify that a VM is launched and running by using novaclient python API.
2234 7) Now ping to the VM from compute node network which are launched a VM.
2235 8) verify that ping is successful
2236 9) Verify that flow is being added in ovs-switch in compute-node.
2237 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
2238 11) Verify that cord-onos pushed flows to OVS switch.
2239 12) Restart the onos service and repeat steps 7 to 11.
2240 """
2241 pass
2242
2243 def test_cordvtn_creating_virtual_local_management_network_and_boot_image_connectivity_after_delete_and_recreate_VM(self):
2244
2245 """
2246 Algo:
2247 1) Validate that required openstack service is up and running.
2248 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
2249 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
2250 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
2251 4) Now boot image in the same created network using nova boot image command (example given below :-
2252 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
2253 5) Wait till VM boots up and starts running.
2254 6) Verify that a VM is launched and running by using novaclient python API.
2255 7) Now ping to the VM from compute node network which are launched a VM.
2256 8) verify that ping is successful
2257 9) Verify that flow is being added in ovs-switch in compute-node.
2258 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
2259 11) Verify that cord-onos pushed flows to OVS switch.
2260 12) Delete and re-create a VM in the same service and repeat steps 7 to 11.
2261 """
2262 pass
2263
2264 def test_cordvtn_creating_virtual_local_management_network_and_boot_image_connectivity_after_delete_and_add_br_int_bridge(self):
2265
2266 """
2267 Algo:
2268 1) Validate that required openstack service is up and running.
2269 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
2270 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
2271 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
2272 4) Now boot image in the same created network using nova boot image command (example given below :-
2273 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
2274 5) Wait till VM boots up and starts running.
2275 6) Verify that a VM is launched and running by using novaclient python API.
2276 7) Now ping to the VM from compute node network which are launched a VM.
2277 8) verify that ping is successful
2278 9) Verify that flow is being added in ovs-switch in compute-node.
2279 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
2280 11) Verify that cord-onos pushed flows to OVS switch.
2281 12) Delete a br_int bridge and repeat steps 7 to 11, (it should not ping)
2282 13) Add br_int bridge and repeat steps 7 to 11, (it should ping)
2283 """
2284 pass
2285
2286 def test_cordvtn_creating_virtual_vlan_interface_local_management_network_and_boot_image_connectivity_after_restarting_VM(self):
2287
2288 """
2289 Algo:
2290 1) Validate that required openstack service is up and running.
2291 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
2292 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
2293 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
2294 4) Now boot image in the same created network using nova boot image command (example given below :-
2295 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
2296 5) Wait till VM boots up and starts running.
2297 6) Verify that a VM is launched and running by using novaclient python API.
2298 7) Create a virtual interface with vlan tag and local management ip on VM.
2299 8) Create a same virtual interface with valn tag and any local management ip on head node.
2300 9) Now ping to the VM from head node network which are launched a openstack service.
2301 10) verify that ping is successful
2302 11) Verify that flow is being added in ovs-switch in compute-node.
2303 12) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
2304 13) Verify that cord-onos pushed flows to OVS switch.
2305 14) Restart the VM in service and repeat steps 9 to 13.
2306
2307 """
2308 pass
2309
2310 def test_cordvtn_creating_virtual_vlan_interface_local_management_network_and_boot_image_connectivity_after_restarting_cord_onos(self):
2311
2312 """
2313 Algo:
2314 1) Validate that required openstack service is up and running.
2315 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
2316 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
2317 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
2318 4) Now boot image in the same created network using nova boot image command (example given below :-
2319 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
2320 5) Wait till VM boots up and starts running.
2321 6) Verify that a VM is launched and running by using novaclient python API.
2322 7) Create a virtual interface with vlan tag and local management ip on VM.
2323 8) Create a same virtual interface with valn tag and any local management ip on head node.
2324 9) Now ping to the VM from head node network which are launched a openstack service.
2325 10) verify that ping is successful
2326 11) Verify that flow is being added in ovs-switch in compute-node.
2327 12) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
2328 13) Verify that cord-onos pushed flows to OVS switch.
2329 14) Restart the ONOS service and repeat steps 9 to 13.
2330
2331 """
2332 pass
2333
2334 def test_cordvtn_creating_virtual_vlan_interface_local_management_network_and_boot_image_connectivity_after_delete_and_recreate_VM(self):
2335
2336 """
2337 Algo:
2338 1) Validate that required openstack service is up and running.
2339 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
2340 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
2341 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
2342 4) Now boot image in the same created network using nova boot image command (example given below :-
2343 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
2344 5) Wait till VM boots up and starts running.
2345 6) Verify that a VM is launched and running by using novaclient python API.
2346 7) Create a virtual interface with vlan tag and local management ip on VM.
2347 8) Create a same virtual interface with valn tag and any local management ip on head node.
2348 9) Now ping to the VM from head node network which are launched a openstack service.
2349 10) verify that ping is successful
2350 11) Verify that flow is being added in ovs-switch in compute-node.
2351 12) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
2352 13) Verify that cord-onos pushed flows to OVS switch.
2353 14) Delete and re-create a VM in service and repeat steps 9 to 13.
2354
2355 """
2356 pass
2357
2358 def test_cordvtn_creating_virtual_vlan_interface_local_management_network_and_boot_image_connectivity_after_delete_and_add_br_int_bridge(self):
2359
2360 """
2361 Algo:
2362 1) Validate that required openstack service is up and running.
2363 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
2364 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
2365 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
2366 4) Now boot image in the same created network using nova boot image command (example given below :-
2367 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
2368 5) Wait till VM boots up and starts running.
2369 6) Verify that a VM is launched and running by using novaclient python API.
2370 7) Create a virtual interface with vlan tag and local management ip on VM.
2371 8) Create a same virtual interface with valn tag and any local management ip on head node.
2372 9) Now ping to the VM from head node network which are launched a openstack service.
2373 10) verify that ping is successful
2374 11) Verify that flow is being added in ovs-switch in compute-node.
2375 12) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
2376 13) Verify that cord-onos pushed flows to OVS switch.
2377 14) Delete a br_int bridge and repeat steps 9 to 13, (it should not ping)
2378 15) Add br_int bridge and repeat steps 9 to 13, (it should ping)
2379
2380 """
2381 pass
2382
2383 def test_cordvtn_creating_virtual_vlan_interface_floating_local_management_network_and_boot_image_connectivity_after_restarting_VM(self):
2384
2385 """
2386 Algo:
2387 1) Validate that required openstack service is up and running.
2388 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
2389 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
2390 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
2391 4) Now boot image in the same created network using nova boot image command (example given below :-
2392 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
2393 5) Wait till VM boots up and starts running.
2394 6) Verify that a VM is launched and running by using novaclient python API.
2395 7) Create a virtual interface with vlan tag and local management floating ip on VM.
2396 8) Create a same virtual interface with valn tag and any local management floating ip on head node.
2397 9) Now ping to the VM from head node network which are launched a openstack service.
2398 10) verify that ping is successful
2399 11) Verify that flow is being added in ovs-switch in compute-node.
2400 12) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
2401 13) Verify that cord-onos pushed flows to OVS switch.
2402 14) Restart the VM in service and repeat steps 9 to 13.
2403 """
2404 pass
2405
2406 def test_cordvtn_creating_virtual_vlan_interface_floating_local_management_network_and_boot_image_connectivity_after_restarting_cord_onos(self):
2407
2408 """
2409 Algo:
2410 1) Validate that required openstack service is up and running.
2411 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
2412 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
2413 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
2414 4) Now boot image in the same created network using nova boot image command (example given below :-
2415 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
2416 5) Wait till VM boots up and starts running.
2417 6) Verify that a VM is launched and running by using novaclient python API.
2418 7) Create a virtual interface with vlan tag and local management floating ip on VM.
2419 8) Create a same virtual interface with valn tag and any local management floating ip on head node.
2420 9) Now ping to the VM from head node network which are launched a openstack service.
2421 10) verify that ping is successful
2422 11) Verify that flow is being added in ovs-switch in compute-node.
2423 12) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
2424 13) Verify that cord-onos pushed flows to OVS switch.
2425 14) Restart the ONOS service and repeat steps 9 to 13.
2426 """
2427 pass
2428
2429 def test_cordvtn_creating_virtual_vlan_interface_floating_local_management_network_and_boot_image_connectivity_after_delete_and_recreate_VM(self):
2430 """
2431 Algo:
2432 1) Validate that required openstack service is up and running.
2433 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
2434 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
2435 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
2436 4) Now boot image in the same created network using nova boot image command (example given below :-
2437 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
2438 5) Wait till VM boots up and starts running.
2439 6) Verify that a VM is launched and running by using novaclient python API.
2440 7) Create a virtual interface with vlan tag and local management floating ip on VM.
2441 8) Create a same virtual interface with valn tag and any local management floating ip on head node.
2442 9) Now ping to the VM from head node network which are launched a openstack service.
2443 10) verify that ping is successful
2444 11) Verify that flow is being added in ovs-switch in compute-node.
2445 12) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
2446 13) Verify that cord-onos pushed flows to OVS switch.
2447 14) Delete and re-create a VM in service and repeat steps 9 to 13.
2448 """
2449 pass
2450
2451 def test_cordvtn_creating_virtual_vlan_interface_floating_local_management_network_and_boot_image_connectivity_after_delete_and_add_br_int_bridge(self):
2452
2453 """
2454 Algo:
2455 1) Validate that required openstack service is up and running.
2456 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list".
2457 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network.
2458 (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1).
2459 4) Now boot image in the same created network using nova boot image command (example given below :-
2460 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
2461 5) Wait till VM boots up and starts running.
2462 6) Verify that a VM is launched and running by using novaclient python API.
2463 7) Create a virtual interface with vlan tag and local management floating ip on VM.
2464 8) Create a same virtual interface with valn tag and any local management floating ip on head node.
2465 9) Now ping to the VM from head node network which are launched a openstack service.
2466 10) verify that ping is successful
2467 11) Verify that flow is being added in ovs-switch in compute-node.
2468 12) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron.
2469 13) Verify that cord-onos pushed flows to OVS switch.
2470 14) Delete a br_int bridge and repeat steps 9 to 13, (it should not ping)
2471 15) Add br_int bridge and repeat steps 9 to 13, (it should ping)
2472 """
2473 pass