ChetanGaonker | 901727c | 2016-11-29 14:05:03 -0800 | [diff] [blame] | 1 | # |
| 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 | # |
| 16 | import unittest |
| 17 | import os,sys |
ChetanGaonker | 901727c | 2016-11-29 14:05:03 -0800 | [diff] [blame] | 18 | import keystoneclient.v2_0.client as ksclient |
| 19 | import keystoneclient.apiclient.exceptions |
| 20 | import neutronclient.v2_0.client as nclient |
| 21 | import neutronclient.common.exceptions |
Chetan Gaonker | 09b77ae | 2017-03-08 01:44:25 +0000 | [diff] [blame] | 22 | import novaclient.v1_1.client as novaclient |
ChetanGaonker | 901727c | 2016-11-29 14:05:03 -0800 | [diff] [blame] | 23 | from multiprocessing import Pool |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 24 | from neutronclient.v2_0 import client as neutron_client |
Chetan Gaonker | 09b77ae | 2017-03-08 01:44:25 +0000 | [diff] [blame] | 25 | import neutronclient.v2_0.client as neutronclient |
ChetanGaonker | 901727c | 2016-11-29 14:05:03 -0800 | [diff] [blame] | 26 | from nose.tools import assert_equal |
A.R Karthick | be7768c | 2017-03-17 11:39:41 -0700 | [diff] [blame] | 27 | from CordTestUtils import get_mac |
| 28 | from OnosCtrl import OnosCtrl |
ChetanGaonker | 901727c | 2016-11-29 14:05:03 -0800 | [diff] [blame] | 29 | from CordLogger import CordLogger |
A.R Karthick | d4eed64 | 2017-03-09 14:40:52 -0800 | [diff] [blame] | 30 | from TestManifest import TestManifest |
Chetan Gaonker | a6e23a7 | 2017-03-14 01:27:49 +0000 | [diff] [blame] | 31 | from OnosFlowCtrl import OnosFlowCtrl |
Chetan Gaonker | 09b77ae | 2017-03-08 01:44:25 +0000 | [diff] [blame] | 32 | from scapy.all import * |
| 33 | import requests |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 34 | import time |
Chetan Gaonker | 3c8ae68 | 2017-02-18 00:50:45 +0000 | [diff] [blame] | 35 | import py_compile |
Chetan Gaonker | 09b77ae | 2017-03-08 01:44:25 +0000 | [diff] [blame] | 36 | import json |
ChetanGaonker | 901727c | 2016-11-29 14:05:03 -0800 | [diff] [blame] | 37 | |
ChetanGaonker | 71fe030 | 2016-12-19 17:45:44 -0800 | [diff] [blame] | 38 | PROTO_NAME_TCP = 'tcp' |
| 39 | PROTO_NAME_ICMP = 'icmp' |
| 40 | IPv4 = 'IPv4' |
| 41 | |
| 42 | OS_USERNAME = 'admin' |
Chetan Gaonker | 0fb91c9 | 2017-02-07 01:52:18 +0000 | [diff] [blame] | 43 | OS_PASSWORD = 'VeryLongKeystoneAdminPassword' |
ChetanGaonker | 71fe030 | 2016-12-19 17:45:44 -0800 | [diff] [blame] | 44 | OS_TENANT = 'admin' |
Chetan Gaonker | 0fb91c9 | 2017-02-07 01:52:18 +0000 | [diff] [blame] | 45 | OS_AUTH_URL = 'https://keystone.cord.lab:5000/v2.0' |
| 46 | OS_SERVICE_ENDPOINT = 'https://keystone.cord.lab:5000/v2.0/' |
Chetan Gaonker | 1f422af | 2017-01-13 21:59:16 +0000 | [diff] [blame] | 47 | VM_BOOT_TIMEOUT = 100 |
| 48 | VM_DELETE_TIMEOUT = 100 |
| 49 | |
ChetanGaonker | 71fe030 | 2016-12-19 17:45:44 -0800 | [diff] [blame] | 50 | |
| 51 | #VM SSH CREDENTIALS |
| 52 | VM_USERNAME = 'ubuntu' |
| 53 | VM_PASSWORD = 'ubuntu' |
| 54 | |
| 55 | TENANT_PREFIX = 'test-' |
| 56 | VM_PREFIX = 'test-' |
| 57 | NETWORK_PREFIX = 'test-' |
| 58 | CIDR_PREFIX = '192.168' |
| 59 | |
Chetan Gaonker | 1c387cf | 2017-02-22 02:21:43 +0000 | [diff] [blame] | 60 | class vtn_validation_utils: |
| 61 | |
A.R Karthick | d4eed64 | 2017-03-09 14:40:52 -0800 | [diff] [blame] | 62 | endpoint = '172.17.0.5' |
| 63 | version = '' |
| 64 | vtn_app = 'org.opencord.vtn' |
| 65 | |
Chetan Gaonker | 1c387cf | 2017-02-22 02:21:43 +0000 | [diff] [blame] | 66 | def __init__(self, version): |
| 67 | self.version = version |
A.R Karthick | d4eed64 | 2017-03-09 14:40:52 -0800 | [diff] [blame] | 68 | self.manifest = None |
| 69 | self.vtn_enabled = False |
| 70 | manifest = os.getenv('MANIFEST', None) |
| 71 | if manifest: |
| 72 | self.manifest = TestManifest(manifest = manifest) |
| 73 | self.endpoint = self.manifest.onos_ip |
| 74 | self.vtn_enabled = self.manifest.synchronizer == 'vtn' |
Chetan Gaonker | 1c387cf | 2017-02-22 02:21:43 +0000 | [diff] [blame] | 75 | |
A.R Karthick | d4eed64 | 2017-03-09 14:40:52 -0800 | [diff] [blame] | 76 | self.app_ctrl = OnosCtrl(self.vtn_app, controller = self.endpoint) |
Chetan Gaonker | 1c387cf | 2017-02-22 02:21:43 +0000 | [diff] [blame] | 77 | |
A.R Karthick | d4eed64 | 2017-03-09 14:40:52 -0800 | [diff] [blame] | 78 | def getDevices(self): |
| 79 | return OnosCtrl.get_devices(controller = self.endpoint) |
Chetan Gaonker | 1c387cf | 2017-02-22 02:21:43 +0000 | [diff] [blame] | 80 | |
A.R Karthick | d4eed64 | 2017-03-09 14:40:52 -0800 | [diff] [blame] | 81 | def getLinks(self): |
| 82 | return OnosCtrl.get_links(controller = self.endpoint) |
Chetan Gaonker | 1c387cf | 2017-02-22 02:21:43 +0000 | [diff] [blame] | 83 | |
A.R Karthick | d4eed64 | 2017-03-09 14:40:52 -0800 | [diff] [blame] | 84 | def getDevicePorts(self, switch_id): |
| 85 | return OnosCtrl.get_ports_device(switch_id, controller = self.endpoint) |
Chetan Gaonker | 1c387cf | 2017-02-22 02:21:43 +0000 | [diff] [blame] | 86 | |
A.R Karthick | d4eed64 | 2017-03-09 14:40:52 -0800 | [diff] [blame] | 87 | def activateVTNApp(self): |
| 88 | return self.app_ctrl.activate() |
| 89 | |
| 90 | def deactivateVTNApp(self): |
| 91 | return self.app_ctrl.deactivate() |
Chetan Gaonker | 1c387cf | 2017-02-22 02:21:43 +0000 | [diff] [blame] | 92 | |
ChetanGaonker | 901727c | 2016-11-29 14:05:03 -0800 | [diff] [blame] | 93 | class cordvtn_exchange(CordLogger): |
| 94 | |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 95 | app_cordvtn = 'org.opencord.vtn' |
| 96 | test_path = os.path.dirname(os.path.realpath(__file__)) |
| 97 | cordvtn_dir = os.path.join(test_path, '..', 'setup') |
| 98 | cordvtn_conf_file = os.path.join(test_path, '..', '../cordvtn/network_cfg.json') |
ChetanGaonker | 901727c | 2016-11-29 14:05:03 -0800 | [diff] [blame] | 99 | |
| 100 | @classmethod |
| 101 | def setUpClass(cls): |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 102 | ''' Activate the cordvtn app''' |
ChetanGaonker | 901727c | 2016-11-29 14:05:03 -0800 | [diff] [blame] | 103 | time.sleep(3) |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 104 | cls.onos_ctrl = OnosCtrl(cls.app_cordvtn) |
| 105 | status, _ = cls.onos_ctrl.activate() |
Chetan Gaonker | 09b77ae | 2017-03-08 01:44:25 +0000 | [diff] [blame] | 106 | assert_equal(status, True) |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 107 | time.sleep(3) |
| 108 | cls.cordvtn_setup() |
ChetanGaonker | 901727c | 2016-11-29 14:05:03 -0800 | [diff] [blame] | 109 | |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 110 | @classmethod |
| 111 | def tearDownClass(cls): |
ChetanGaonker | 901727c | 2016-11-29 14:05:03 -0800 | [diff] [blame] | 112 | '''Deactivate the cord vtn app''' |
Chetan Gaonker | 09b77ae | 2017-03-08 01:44:25 +0000 | [diff] [blame] | 113 | #cls.onos_ctrl.deactivate() |
| 114 | #cls.cord_vtn_cleanup() |
ChetanGaonker | 901727c | 2016-11-29 14:05:03 -0800 | [diff] [blame] | 115 | |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 116 | @classmethod |
| 117 | def cordvtn_setup(cls): |
| 118 | pass |
| 119 | |
| 120 | @classmethod |
| 121 | def cord_vtn_cleanup(cls): |
| 122 | ##reset the ONOS port configuration back to default |
Chetan Gaonker | 09b77ae | 2017-03-08 01:44:25 +0000 | [diff] [blame] | 123 | pass |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 124 | |
| 125 | @classmethod |
| 126 | def onos_load_config(cls, cordvtn_conf_file): |
| 127 | status, code = OnosCtrl.config(cordvtn_conf_file) |
ChetanGaonker | 901727c | 2016-11-29 14:05:03 -0800 | [diff] [blame] | 128 | if status is False: |
| 129 | log.info('JSON request returned status %d' %code) |
| 130 | assert_equal(status, True) |
| 131 | time.sleep(3) |
| 132 | |
Chetan Gaonker | 09b77ae | 2017-03-08 01:44:25 +0000 | [diff] [blame] | 133 | def get_neutron_credentials(self): |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 134 | n = {} |
| 135 | n['username'] = os.environ['OS_USERNAME'] |
| 136 | n['password'] = os.environ['OS_PASSWORD'] |
| 137 | n['auth_url'] = os.environ['OS_AUTH_URL'] |
| 138 | n['tenant_name'] = os.environ['OS_TENANT_NAME'] |
Chetan Gaonker | 80e0615 | 2017-03-07 01:07:19 +0000 | [diff] [blame] | 139 | n['ca_cert'] = os.environ['REQUESTS_CA_BUNDLE'] |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 140 | return n |
| 141 | |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 142 | def create_network(i): |
| 143 | neutron_credentials = get_neutron_credentials() |
| 144 | neutron = neutron_client.Client(**neutron_credentials) |
| 145 | json = {'network': {'name': 'network-' + str(i), |
| 146 | 'admin_state_up': True}} |
| 147 | while True: |
| 148 | try: |
Chetan Gaonker | 3c8ae68 | 2017-02-18 00:50:45 +0000 | [diff] [blame] | 149 | net = neutron.create_network(body=json) |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 150 | print '\nnetwork-' + str(i) + ' created' |
Chetan Gaonker | 3c8ae68 | 2017-02-18 00:50:45 +0000 | [diff] [blame] | 151 | return net |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 152 | except Exception as e: |
| 153 | print e |
| 154 | continue |
| 155 | |
ChetanGaonker | 901727c | 2016-11-29 14:05:03 -0800 | [diff] [blame] | 156 | def create_tenant(tenant_name): |
| 157 | new_tenant = keystone.tenants.create(tenant_name=tenant_name, |
| 158 | description="CORD Tenant \ |
| 159 | created", |
| 160 | enabled=True) |
| 161 | tenant_id = new_tenant.id |
| 162 | tenant_status = True |
| 163 | user_data = [] |
| 164 | for j in range(2): |
| 165 | j += 1 |
| 166 | user_name = tenant_name + '-user-' + str(j) |
| 167 | user_data.append(create_user(user_name, tenant_id)) |
| 168 | |
| 169 | print " Tenant and User Created" |
| 170 | |
| 171 | tenant_data = {'tenant_name': tenant_name, |
| 172 | 'tenant_id': tenant_id, |
| 173 | 'status': tenant_status} |
| 174 | return tenant_data |
| 175 | |
| 176 | def create_user(user_name, tenant_id): |
| 177 | new_user = keystone.users.create(name=user_name, |
| 178 | password="ubuntu", |
| 179 | tenant_id=tenant_id) |
| 180 | print(' - Created User %s' % user_name) |
| 181 | keystone.roles.add_user_role(new_user, member_role, tenant_id) |
| 182 | if assign_admin: |
| 183 | admin_user = keystone.users.find(name='admin') |
| 184 | admin_role = keystone.roles.find(name='admin') |
| 185 | keystone.roles.add_user_role(admin_user, admin_role, tenant_id) |
| 186 | user_data = {'name': new_user.name, |
| 187 | 'id': new_user.id} |
| 188 | return user_data |
| 189 | |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 190 | def create_port( router_id, network_id): |
| 191 | credentials = get_credentials() |
| 192 | neutron = client.Client(**credentials) |
| 193 | router = neutron.show_router(router_id) |
| 194 | |
| 195 | value = {'port':{ |
| 196 | 'admin_state_up':True, |
| 197 | 'device_id': router_id, |
| 198 | 'name': 'port1', |
| 199 | 'network_id':network_id, |
| 200 | }} |
| 201 | response = neutron.create_port(body=value) |
| 202 | |
ChetanGaonker | 71fe030 | 2016-12-19 17:45:44 -0800 | [diff] [blame] | 203 | def router_create(self, name): |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 204 | external_network = None |
| 205 | for network in self.neutron.list_networks()["networks"]: |
| 206 | if network.get("router:external"): |
| 207 | external_network = network |
| 208 | break |
| 209 | |
| 210 | if not external_network: |
| 211 | raise Exception("Alarm! Can not to find external network") |
| 212 | |
| 213 | gw_info = { |
| 214 | "network_id": external_network["id"], |
| 215 | "enable_snat": True |
| 216 | } |
| 217 | router_info = { |
| 218 | "router": { |
| 219 | "name": name, |
| 220 | "external_gateway_info": gw_info, |
| 221 | "tenant_id": self.tenant_id |
| 222 | } |
| 223 | } |
ChetanGaonker | 71fe030 | 2016-12-19 17:45:44 -0800 | [diff] [blame] | 224 | router = self.neutron.router_create(router_info)['router'] |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 225 | return router |
| 226 | |
ChetanGaonker | 901727c | 2016-11-29 14:05:03 -0800 | [diff] [blame] | 227 | def delete_tenant(tenant_name): |
| 228 | tenant = keystone.tenants.find(name=tenant_name) |
| 229 | for j in range(2): |
| 230 | j += 1 |
| 231 | user_name = tenant_name + '-user-' + str(j) |
| 232 | delete_user(user_name, tenant.id) |
| 233 | tenant.delete() |
| 234 | print(' - Deleted Tenant %s ' % tenant_name) |
| 235 | return True |
| 236 | |
| 237 | def delete_user(user_name, tenant_id): |
| 238 | user = keystone.users.find(name=user_name) |
| 239 | user.delete() |
| 240 | |
| 241 | print(' - Deleted User %s' % user_name) |
| 242 | return True |
| 243 | |
ChetanGaonker | 71fe030 | 2016-12-19 17:45:44 -0800 | [diff] [blame] | 244 | def set_environment(tenants_num=0, networks_per_tenant=1, vms_per_network=2): |
Chetan Gaonker | 09b77ae | 2017-03-08 01:44:25 +0000 | [diff] [blame] | 245 | octet = 115 |
| 246 | vm_inc = 11 |
| 247 | image = nova_connection.images.get(IMAGE_ID) |
| 248 | flavor = nova_connection.flavors.get(FLAVOR_ID) |
ChetanGaonker | 71fe030 | 2016-12-19 17:45:44 -0800 | [diff] [blame] | 249 | |
Chetan Gaonker | 09b77ae | 2017-03-08 01:44:25 +0000 | [diff] [blame] | 250 | admin_user_id = keystone_connection.users.find(name=OS_USERNAME).id |
| 251 | member_role_id = keystone_connection.roles.find(name='Member').id |
| 252 | for num_tenant in range(1, tenants_num+1): |
| 253 | tenant = keystone_connection.tenants.create('%stenant%s' % (TENANT_PREFIX, num_tenant)) |
| 254 | keystone_connection.roles.add_user_role(admin_user_id, member_role_id, tenant=tenant.id) |
| 255 | for num_network in range(networks_per_tenant): |
| 256 | network_json = {'name': '%snet%s' % (NETWORK_PREFIX, num_tenant*10+num_network), |
| 257 | 'admin_state_up': True, |
| 258 | 'tenant_id': tenant.id} |
| 259 | network = neutron_connection.create_network({'network': network_json}) |
| 260 | subnet_json = {'name': '%ssubnet%s' % (NETWORK_PREFIX, num_tenant*10+num_network), |
| 261 | 'network_id': network['network']['id'], |
| 262 | 'tenant_id': tenant.id, |
| 263 | 'enable_dhcp': True, |
| 264 | 'cidr': '%s.%s.0/24' % (CIDR_PREFIX, octet), 'ip_version': 4} |
| 265 | octet += 1 |
| 266 | subnet = neutron_connection.create_subnet({'subnet': subnet_json}) |
| 267 | router_json = {'name': '%srouter%s' % (NETWORK_PREFIX, num_tenant*10+num_network), |
| 268 | 'tenant_id': tenant.id} |
| 269 | router = neutron_connection.router_create({'router': router_json}) |
| 270 | port = neutron_connection.add_interface_router(router['router']['id'], {'subnet_id': subnet['subnet']['id']}) |
| 271 | for num_vm in range(vms_per_network): |
| 272 | tenant_nova_connection = novacli.Client(OS_USERNAME, OS_PASSWORD, tenant.name, OS_AUTH_URL) |
| 273 | m = tenant_nova_connection.servers.create('%svm%s' % (VM_PREFIX, vm_inc), image, flavor, nics=[{'net-id': network['network']['id']}, {'net-id': MGMT_NET}]) |
| 274 | vm_inc += 1 |
ChetanGaonker | 71fe030 | 2016-12-19 17:45:44 -0800 | [diff] [blame] | 275 | |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 276 | def verify_neutron_crud(): |
| 277 | x = os.system("neutron_test.sh") |
| 278 | return x |
ChetanGaonker | 901727c | 2016-11-29 14:05:03 -0800 | [diff] [blame] | 279 | |
Author Name | 91eaeba | 2017-01-05 13:41:45 -0800 | [diff] [blame] | 280 | def list_floatingips( **kwargs): |
| 281 | creds = get_neutron_credentials() |
| 282 | neutron = client.Client(**creds) |
| 283 | return neutron.list_floatingips(**kwargs)['floatingips'] |
| 284 | |
| 285 | def list_security_groups( **kwargs): |
| 286 | creds = get_neutron_credentials() |
| 287 | neutron = client.Client(**creds) |
| 288 | return neutron.list_security_groups(**kwargs)['security_groups'] |
| 289 | |
| 290 | def list_subnets( **kwargs): |
| 291 | creds = get_neutron_credentials() |
| 292 | neutron = client.Client(**creds) |
| 293 | return neutron.list_subnets(**kwargs)['subnets'] |
| 294 | |
| 295 | def list_networks( **kwargs): |
| 296 | creds = get_neutron_credentials() |
| 297 | neutron = client.Client(**creds) |
| 298 | return neutron.list_networks(**kwargs)['networks'] |
| 299 | |
| 300 | def list_ports( **kwargs): |
| 301 | creds = get_neutron_credentials() |
| 302 | neutron = client.Client(**creds) |
| 303 | return neutron.list_ports(**kwargs)['ports'] |
| 304 | |
| 305 | def list_routers( **kwargs): |
| 306 | creds = get_neutron_credentials() |
| 307 | neutron = client.Client(**creds) |
| 308 | return neutron.list_routers(**kwargs)['routers'] |
| 309 | |
| 310 | def update_floatingip( fip, port_id=None): |
| 311 | creds = get_neutron_credentials() |
| 312 | neutron = client.Client(**creds) |
| 313 | neutron.update_floatingip(fip, {"floatingip": |
| 314 | {"port_id": port_id}}) |
| 315 | |
| 316 | def update_subnet( subnet_id, **subnet_params): |
| 317 | creds = get_neutron_credentials() |
| 318 | neutron = client.Client(**creds) |
| 319 | neutron.update_subnet(subnet_id, {'subnet': subnet_params}) |
| 320 | |
| 321 | def update_router( router_id, **router_params): |
| 322 | creds = get_neutron_credentials() |
| 323 | neutron = client.Client(**creds) |
| 324 | neutron.update_router(router_id, {'router': router_params}) |
| 325 | |
| 326 | def router_gateway_set( router_id, external_gateway): |
| 327 | creds = get_neutron_credentials() |
| 328 | neutron = client.Client(**creds) |
| 329 | neutron.update_router( |
| 330 | router_id, {'router': {'external_gateway_info': |
| 331 | {'network_id': external_gateway}}}) |
| 332 | |
| 333 | def router_gateway_clear( router_id): |
| 334 | creds = get_neutron_credentials() |
| 335 | neutron = client.Client(**creds) |
| 336 | neutron.update_router( |
| 337 | router_id, {'router': {'external_gateway_info': None}}) |
| 338 | |
| 339 | def router_add_interface( router_id, subnet_id): |
| 340 | creds = get_neutron_credentials() |
| 341 | neutron = client.Client(**creds) |
| 342 | neutron.add_interface_router(router_id, {'subnet_id': subnet_id}) |
| 343 | |
| 344 | def router_rem_interface( router_id, subnet_id): |
| 345 | creds = get_neutron_credentials() |
| 346 | neutron = client.Client(**creds) |
| 347 | neutron.remove_interface_router( |
| 348 | router_id, {'subnet_id': subnet_id}) |
| 349 | |
| 350 | def create_floatingip( **floatingip_params): |
| 351 | creds = get_neutron_credentials() |
| 352 | neutron = client.Client(**creds) |
| 353 | response = neutron.create_floatingip( |
| 354 | {'floatingip': floatingip_params}) |
| 355 | if 'floatingip' in response and 'id' in response['floatingip']: |
| 356 | return response['floatingip']['id'] |
| 357 | |
Chetan Gaonker | 1f422af | 2017-01-13 21:59:16 +0000 | [diff] [blame] | 358 | def make_iperf_pair(server, client, **kwargs): |
| 359 | ssh = SSHClient() |
| 360 | ssh.set_missing_host_key_policy(MissingHostKeyPolicy()) |
| 361 | |
| 362 | ssh.connect(server, username=VM_USERNAME, password=VM_PASSWORD) |
| 363 | ssh.exec_command('/usr/local/bin/iperf3 -s -D') |
| 364 | |
| 365 | ssh.connect(client, username=VM_USERNAME, password=VM_PASSWORD) |
| 366 | stdin, stdout, stderr = ssh.exec_command('/usr/local/bin/iperf3 -c %s -J' % server) |
| 367 | |
| 368 | rawdata = stdout.read() |
| 369 | data = json.loads(rawdata.translate(None,'\t').translate(None,'\n')) |
| 370 | |
| 371 | return data |
| 372 | |
Chetan Gaonker | 0fb91c9 | 2017-02-07 01:52:18 +0000 | [diff] [blame] | 373 | def connect_ssh(os_ip, private_key_file=None, user='ubuntu'): |
| 374 | key = ssh.RSAKey.from_private_key_file(private_key_file) |
| 375 | client = ssh.SSHClient() |
| 376 | client.set_missing_host_key_policy(ssh.WarningPolicy()) |
| 377 | client.connect(ip, username=user, pkey=key, timeout=5) |
| 378 | return client |
Chetan Gaonker | 1f422af | 2017-01-13 21:59:16 +0000 | [diff] [blame] | 379 | |
Chetan Gaonker | 0fb91c9 | 2017-02-07 01:52:18 +0000 | [diff] [blame] | 380 | def validate_vtn_flows(switch): |
| 381 | egress = 1 |
| 382 | ingress = 2 |
| 383 | egress_map = { 'ether': '00:00:00:00:00:03', 'ip': '192.168.30.1' } |
| 384 | ingress_map = { 'ether': '00:00:00:00:00:04', 'ip': '192.168.40.1' } |
| 385 | device_id = 'of:{}'.format(get_mac(switch)) |
Chetan Gaonker | a6e23a7 | 2017-03-14 01:27:49 +0000 | [diff] [blame] | 386 | ctlr = self.ctlr_ip.split(',')[0] |
| 387 | flow = OnosFlowCtrl(deviceId = device_id, |
| 388 | egressPort = egress, |
| 389 | ingressPort = ingress, |
| 390 | ethType = '0x800', |
| 391 | ipSrc = ('IPV4_SRC', ingress_map['ip']+'/32'), |
| 392 | ipDst = ('IPV4_DST', egress_map['ip']+'/32'), |
| 393 | controller = ctlr |
| 394 | ) |
Chetan Gaonker | 0fb91c9 | 2017-02-07 01:52:18 +0000 | [diff] [blame] | 395 | flow_id = flow.findFlow(device_id, IN_PORT = ('port', ingress), |
| 396 | ETH_TYPE = ('ethType','0x800'), IPV4_SRC = ('ip', ingress_map['ip']+'/32'), |
| 397 | IPV4_DST = ('ip', egress_map['ip']+'/32')) |
| 398 | if flow_id: |
| 399 | return True |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 400 | |
Chetan Gaonker | 3c8ae68 | 2017-02-18 00:50:45 +0000 | [diff] [blame] | 401 | def cordvtn_config_load(self, config = None): |
| 402 | if config: |
| 403 | for k in config.keys(): |
| 404 | if cordvtn_config.has_key(k): |
| 405 | cordvtn_config[k] = config[k] |
| 406 | self.onos_load_config(self.cordvtn_dict) |
| 407 | |
Chetan Gaonker | 09b77ae | 2017-03-08 01:44:25 +0000 | [diff] [blame] | 408 | def search_value(self, d, pat): |
Thangavelu K S | a2f5ac0 | 2017-03-13 18:29:00 +0000 | [diff] [blame] | 409 | match = False |
Chetan Gaonker | 3c8ae68 | 2017-02-18 00:50:45 +0000 | [diff] [blame] | 410 | for k, v in d.items(): |
| 411 | if isinstance(v, dict): |
Thangavelu K S | a2f5ac0 | 2017-03-13 18:29:00 +0000 | [diff] [blame] | 412 | match = self.search_value(v, pat) |
| 413 | elif type(v) is list: |
| 414 | for i in range(len(v)): |
| 415 | if type(v[i]) is dict: |
| 416 | match = self.search_value(v[i], pat) |
| 417 | else: |
| 418 | if v == pat: |
| 419 | match == True |
| 420 | return True |
| 421 | elif v == pat: |
| 422 | match == True |
| 423 | return True |
| 424 | return match |
| 425 | |
Thangavelu K S | aea3c67 | 2017-03-15 18:57:05 +0000 | [diff] [blame] | 426 | def get_key_value(self, d, key = None, value = None,): |
| 427 | match = False |
| 428 | ret_k = "" |
| 429 | ret_v = "" |
| 430 | if type(d) is not dict: |
| 431 | if type(d) is not list: |
| 432 | match = 'NOT_FOUND' |
| 433 | return [match, ret_k, ret_v] |
| 434 | else: |
| 435 | for i in range(len(d)): |
| 436 | if type(d[i]) is dict: |
| 437 | match,ret_k,ret_v = self.get_key_value(d[i], key, value) |
| 438 | if match is True: |
| 439 | print "Network creation is successful" |
| 440 | break |
| 441 | else: |
| 442 | for k, v in d.items(): |
| 443 | if isinstance(v, dict): |
| 444 | match,ret_k,ret_v = self.get_key_value(v, key, value) |
| 445 | elif type(v) is list: |
| 446 | for i in range(len(v)): |
| 447 | if type(v[i]) is dict: |
| 448 | match,ret_k,ret_v = self.get_key_value(v[i], key, value) |
| 449 | else: |
| 450 | if key: |
| 451 | if k == key: |
| 452 | match = True |
| 453 | return [match, key, v] |
| 454 | elif value: |
| 455 | if v == value: |
| 456 | match = True |
| 457 | return [match, k, value] |
| 458 | else: |
| 459 | if key: |
| 460 | if k == key: |
| 461 | match = True |
| 462 | return [match, key, v] |
| 463 | elif value: |
| 464 | if v == value: |
| 465 | match = True |
| 466 | return [match, k, value] |
| 467 | if match == False: |
| 468 | match = 'NOT_FOUND' |
| 469 | return [match, ret_k, ret_v] |
| 470 | |
| 471 | def neutron_network_creation_and_validation(self, net_name): |
| 472 | creds = self.get_neutron_credentials() |
| 473 | neutron = neutronclient.Client(**creds) |
| 474 | body_example = {"network":{"name": net_name,"admin_state_up":True}} |
| 475 | net = neutron.create_network(body=body_example) |
| 476 | networks = neutron.list_networks(name=net_name) |
| 477 | data = networks |
| 478 | return [self.search_value(data, net_name)] |
| 479 | |
| 480 | def neutron_network_deletion(self, net_name): |
| 481 | creds = self.get_neutron_credentials() |
| 482 | neutron = neutronclient.Client(**creds) |
| 483 | networks = neutron.list_networks(name=net_name) |
| 484 | net_id = self.get_key_value(d=networks, key = 'id') |
| 485 | net = neutron.delete_network(net_id[2]) |
| 486 | return [self.get_key_value(d=networks, value = net_name)] |
| 487 | |
| 488 | def neutron_subnet_creation_and_validation(self,net_name,sub_cird): |
| 489 | creds = self.get_neutron_credentials() |
| 490 | neutron = neutronclient.Client(**creds) |
| 491 | networks = neutron.list_networks(name=net_name) |
| 492 | net_id = self.get_key_value(d=networks, key = 'id') |
| 493 | cidr = sub_cird |
| 494 | body_subnet_example = {"subnet":{"network_id": net_id[2],"ip_version":4, "cidr":str(cidr), "allocation_pools": [{"start": "172.27.0.20", "end": "172.27.0.21"}]}} |
| 495 | neutron_sub = neutron.create_subnet(body_subnet_example) |
| 496 | networks = neutron.list_networks(name=net_name) |
| 497 | return [self.get_key_value(d=networks, key = 'subnets')] |
| 498 | |
| 499 | def test_cordvtn_neutron_network_creation_and_validation_on_head_node_with_neutron_service(self): |
| 500 | """ |
| 501 | Algo: |
| 502 | 0. Create vtn_test_1_net. |
| 503 | 1. Do GET Rest API and validate creation of network. |
| 504 | 2. Validate network on neutron openstack. |
| 505 | """ |
| 506 | result = self.neutron_network_creation_and_validation('vtn_test_1_net') |
| 507 | if result is True: |
| 508 | self.neutron_network_deletion('vtn_test_1_net') |
| 509 | assert_equal(result, True) |
| 510 | |
| 511 | def test_cordvtn_neutron_network_creation_and_validation_on_onos(self): |
| 512 | """ |
| 513 | Algo: |
| 514 | 0. Create Test-Net, |
| 515 | 1. Load cordvtn config, vtn-cfg-1.json to cord-onos |
| 516 | 2. Run sync command for cordvtn |
| 517 | 3. Do GET Rest API and validate creation of network |
| 518 | 4. Validate network synch with created network in cord-onos |
| 519 | """ |
| 520 | creds = self.get_neutron_credentials() |
| 521 | neutron = neutronclient.Client(**creds) |
| 522 | body_example = {"network":{"name": "vtn_test_2_net","admin_state_up":True}} |
| 523 | net = neutron.create_network(body=body_example) |
| 524 | vtn_util = vtn_validation_utils('') |
| 525 | url = "http://{0}:8181/onos/cordvtn/serviceNetworks".format(vtn_util.endpoint) |
| 526 | auth = ('karaf','karaf') |
| 527 | |
| 528 | resp = requests.get(url=url, auth=auth) |
| 529 | data = json.loads(resp.text) |
| 530 | result = self.search_value(data, "vtn_test_2_net") |
| 531 | self.neutron_network_deletion('vtn_test_2_net') |
| 532 | assert_equal(result, True) |
| 533 | |
| 534 | def test_cordvtn_with_neutron_network_deletion_recreation_and_validation_on_head_node_with_neutron_service(self): |
| 535 | """ |
| 536 | Algo: |
| 537 | 0. Create Test-Net, |
| 538 | 1. Load cordvtn config, vtn-cfg-1.json to cord-onos |
| 539 | 2. Run sync command for cordvtn |
| 540 | 3. Do GET Rest API and validate creation of network |
| 541 | 4. Validate network synch with created network in cord-onos |
| 542 | """ |
| 543 | result = self.neutron_network_creation_and_validation('vtn_test_3_net') |
| 544 | if result is True: |
| 545 | self.neutron_network_deletion('vtn_test_1_net') |
| 546 | assert_equal(result, True) |
| 547 | result_again = self.neutron_network_creation_and_validation('vtn_test_3_net') |
| 548 | if result_again is True: |
| 549 | self.neutron_network_deletion('vtn_test_1_net') |
| 550 | assert_equal(result, True) |
| 551 | |
| 552 | def test_cordvtn_with_neutron_network_deletion_recreation_and_validation_on_onos(self): |
| 553 | """ |
| 554 | Algo: |
| 555 | 0. Create Test-Net, |
| 556 | 1. Load cordvtn config, vtn-cfg-1.json to cord-onos |
| 557 | 2. Run sync command for cordvtn |
| 558 | 3. Do GET Rest API and validate creation of network |
| 559 | 4. Validate network synch with created network in cord-onos |
| 560 | """ |
| 561 | creds = self.get_neutron_credentials() |
| 562 | neutron = neutronclient.Client(**creds) |
| 563 | body_example = {"network":{"name": "vtn_test_4_net","admin_state_up":True}} |
| 564 | net = neutron.create_network(body=body_example) |
| 565 | vtn_util = vtn_validation_utils('') |
| 566 | url = "http://{0}:8181/onos/cordvtn/serviceNetworks".format(vtn_util.endpoint) |
| 567 | auth = ('karaf','karaf') |
| 568 | |
| 569 | resp = requests.get(url=url, auth=auth) |
| 570 | data = json.loads(resp.text) |
| 571 | result = self.search_value(data, "vtn_test_4_net") |
| 572 | assert_equal(result, True) |
| 573 | self.neutron_network_deletion('vtn_test_4_net') |
| 574 | url = "http://{0}:8181/onos/cordvtn/serviceNetworks".format(vtn_util.endpoint) |
| 575 | auth = ('karaf','karaf') |
| 576 | |
| 577 | resp = requests.get(url=url, auth=auth) |
| 578 | data = json.loads(resp.text) |
| 579 | result = self.search_value(data, "vtn_test_4_net") |
| 580 | assert_equal(result, False) |
| 581 | net = neutron.create_network(body=body_example) |
| 582 | vtn_util = vtn_validation_utils('') |
| 583 | url = "http://{0}:8181/onos/cordvtn/serviceNetworks".format(vtn_util.endpoint) |
| 584 | auth = ('karaf','karaf') |
| 585 | |
| 586 | resp = requests.get(url=url, auth=auth) |
| 587 | data = json.loads(resp.text) |
| 588 | result = self.search_value(data, "vtn_test_4_net") |
| 589 | self.neutron_network_deletion('vtn_test_4_net') |
| 590 | assert_equal(result, True) |
| 591 | |
| 592 | def test_cordvtn_with_neutron_management_network_creation_and_validation_on_head_node_with_neutron_service(self): |
| 593 | test_net_name = 'vtn_test_5_net_management' |
| 594 | test_sub_net_cidr = "172.27.0.0/24" |
| 595 | result = self.neutron_network_creation_and_validation('vtn_test_5_net_management') |
| 596 | assert_equal(result, True) |
| 597 | sub_result = self.neutron_subnet_creation_and_validation(test_net_name,test_sub_net_cidr) |
| 598 | if sub_result[0] is True: |
| 599 | self.neutron_network_deletion('vtn_test_5_net_management') |
| 600 | assert_equal(sub_result[0], True) |
| 601 | |
| 602 | def test_cordvtn_with_neutron_management_network_creation_and_validation_on_onos(self): |
| 603 | self.neutron_network_creation_and_validation('vtn_test_6_net_management') |
| 604 | creds = self.get_neutron_credentials() |
| 605 | neutron = neutronclient.Client(**creds) |
| 606 | networks = neutron.list_networks(name='vtn_test_6_net_management') |
| 607 | net_id = self.get_key_value(d=networks, key = 'id') |
| 608 | cidr = "172.27.0.0/24" |
| 609 | body_subnet_example = {"subnet":{"network_id": net_id[2],"ip_version":4, "cidr":str(cidr), "allocation_pools": [{"start": "172.27.0.20", "end": "172.27.0.21"}]}} |
| 610 | neutron_sub = neutron.create_subnet(body_subnet_example) |
| 611 | |
| 612 | vtn_util = vtn_validation_utils('') |
| 613 | url = "http://{0}:8181/onos/cordvtn/serviceNetworks".format(vtn_util.endpoint) |
| 614 | auth = ('karaf','karaf') |
| 615 | |
| 616 | resp = requests.get(url=url, auth=auth) |
| 617 | data = json.loads(resp.text) |
| 618 | for i in range(len(data['ServiceNetworks'])): |
| 619 | if data['ServiceNetworks'][i]['name'] == 'vtn_test_5_net_management': |
| 620 | sub_net_id = self.get_key_value(d=data['ServiceNetworks'][i], key = 'subnet') |
| 621 | if sub_net_id[2] == " ": |
| 622 | log.info('Sub network is not successful') |
| 623 | self.neutron_network_deletion('vtn_test_6_net_management') |
| 624 | assert_equal(False, True) |
| 625 | break |
| 626 | elif sub_net_id[2] == cidr: |
| 627 | log.info('Sub network is successful') |
| 628 | self.neutron_network_deletion('vtn_test_6_net_management') |
| 629 | assert_equal(sub_net_id[0], True) |
| 630 | break |
| 631 | |
| 632 | def test_cordvtn_with_neutron_network_creation_and_validation_on_head_node_with_neutron_service(self): |
Thangavelu K S | a2f5ac0 | 2017-03-13 18:29:00 +0000 | [diff] [blame] | 633 | """ |
| 634 | Algo: |
| 635 | 0. Create Test-Net, |
| 636 | 1. Load cordvtn config, vtn-cfg-1.json to cord-onos |
| 637 | 2. Run sync command for cordvtn |
| 638 | 3. Do GET Rest API and validate creation of network |
| 639 | 4. Validate network synch with created network in cord-onos |
| 640 | """ |
| 641 | creds = self.get_neutron_credentials() |
| 642 | neutron = neutronclient.Client(**creds) |
| 643 | body_example = {"network":{"name": "Net-1","admin_state_up":True}} |
| 644 | net = neutron.create_network(body=body_example) |
| 645 | networks = neutron.list_networks(name='Net-1') |
| 646 | vtn_util = vtn_validation_utils('') |
| 647 | data = networks |
| 648 | result = self.search_value(data, "Net-1") |
| 649 | assert_equal(result, True) |
| 650 | |
| 651 | def test_cordvtn_neutron_network_creation_and_validation_on_onos(self): |
| 652 | """ |
| 653 | Algo: |
| 654 | 0. Create Test-Net, |
| 655 | 1. Load cordvtn config, vtn-cfg-1.json to cord-onos |
| 656 | 2. Run sync command for cordvtn |
| 657 | 3. Do GET Rest API and validate creation of network |
| 658 | 4. Validate network synch with created network in cord-onos |
| 659 | """ |
| 660 | creds = self.get_neutron_credentials() |
| 661 | neutron = neutronclient.Client(**creds) |
| 662 | body_example = {"network":{"name": "Net-1","admin_state_up":True}} |
| 663 | net = neutron.create_network(body=body_example) |
| 664 | networks = neutron.list_networks(name='Net-1') |
| 665 | vtn_util = vtn_validation_utils('') |
| 666 | url = "http://{0}:8181/onos/cordvtn/serviceNetworks".format(vtn_util.endpoint) |
| 667 | auth = ('karaf','karaf') |
| 668 | |
| 669 | resp = requests.get(url=url, auth=auth) |
| 670 | data = json.loads(resp.text) |
| 671 | result = self.search_value(data, "Net-1") |
| 672 | assert_equal(result, True) |
| 673 | |
| 674 | def test_cordvtn_neutron_network_delete_and_validation_on_neutron_openstack(self): |
| 675 | |
| 676 | """ |
| 677 | Algo: |
| 678 | 0. Create Test-Net, |
| 679 | 1. Load cordvtn config, vtn-cfg-1.json to cord-onos |
| 680 | 2. Run sync command for cordvtn |
| 681 | 3. Do GET Rest API and validate creation of network |
| 682 | 4. Validate network synch with created network in cord-onos |
| 683 | """ |
| 684 | creds = self.get_neutron_credentials() |
| 685 | neutron = neutronclient.Client(**creds) |
| 686 | body_example = {"network":{"name": "Net-1","admin_state_up":False}} |
| 687 | net = neutron.delete_network("Net-1") |
| 688 | networks = neutron.list_networks(name='Net-1') |
| 689 | vtn_util = vtn_validation_utils('') |
| 690 | data = networks |
| 691 | result = self.search_value(data, "Net-1") |
| 692 | assert_equal(result, True) |
Chetan Gaonker | 3c8ae68 | 2017-02-18 00:50:45 +0000 | [diff] [blame] | 693 | |
| 694 | def test_cordvtn_neutron_network_sync(self): |
| 695 | """ |
| 696 | Algo: |
| 697 | 0. Create Test-Net, |
| 698 | 1. Load cordvtn config, vtn-cfg-1.json to cord-onos |
| 699 | 2. Run sync command for cordvtn |
| 700 | 3. Do GET Rest API and validate creation of network |
| 701 | 4. Validate network synch with created network in cord-onos |
| 702 | """ |
Chetan Gaonker | 09b77ae | 2017-03-08 01:44:25 +0000 | [diff] [blame] | 703 | creds = self.get_neutron_credentials() |
Chetan Gaonker | 3c8ae68 | 2017-02-18 00:50:45 +0000 | [diff] [blame] | 704 | neutron = neutronclient.Client(**creds) |
Chetan Gaonker | 09b77ae | 2017-03-08 01:44:25 +0000 | [diff] [blame] | 705 | body_example = {"network":{"name": "Test-Net-1","admin_state_up":True}} |
Chetan Gaonker | 3c8ae68 | 2017-02-18 00:50:45 +0000 | [diff] [blame] | 706 | net = neutron.create_network(body=body_example) |
Chetan Gaonker | a6e23a7 | 2017-03-14 01:27:49 +0000 | [diff] [blame] | 707 | url = "http://{0}:8181/onos/cordvtn/serviceNetworks".format(vtn_util.endpoint) |
| 708 | auth = ('karaf','karaf') |
| 709 | body_create_subnet = {'subnets': [{'cidr': '192.168.199.0/24', |
| 710 | 'ip_version': 4, 'network_id': network_id}]} |
| 711 | |
| 712 | subnet = neutron.create_subnet(body=body_create_subnet) |
| 713 | |
| 714 | resp = requests.get(url=url, auth=auth) |
| 715 | data = json.loads(resp.text) |
| 716 | result = self.search_value(data, "Test-Net-1") |
| 717 | assert_equal(result, True) |
| 718 | |
| 719 | def test_cordvtn_neutron_port_sync(self): |
| 720 | """ |
| 721 | Algo: |
| 722 | 0. Create Test-Net, |
| 723 | 1. Load cordvtn config, vtn-cfg-1.json to cord-onos |
| 724 | 2. Run sync command for cordvtn |
| 725 | 3. Do GET Rest API and validate creation of network |
Thangavelu K S | aea3c67 | 2017-03-15 18:57:05 +0000 | [diff] [blame] | 726 | 4. Validate network synch with created port in cord-onos |
Chetan Gaonker | a6e23a7 | 2017-03-14 01:27:49 +0000 | [diff] [blame] | 727 | """ |
| 728 | creds = self.get_neutron_credentials() |
| 729 | neutron = neutronclient.Client(**creds) |
| 730 | body_example = {"network":{"name": "Test-Net-1","admin_state_up":True}} |
| 731 | net = neutron.create_network(body=body_example) |
| 732 | network_id = net['network']['id'] |
| 733 | device_id = 'of:{}'.format(get_mac(self.switch)) |
| 734 | body_example = {'port': {'admin_state_up': True,'device_id':device_id, 'network_id':network_id}} |
| 735 | response = neutron.create_port(body=body_example) |
| 736 | url = "http://{0}:8181/onos/cordvtn/servicePorts".format(vtn_util.endpoint) |
Chetan Gaonker | 3c8ae68 | 2017-02-18 00:50:45 +0000 | [diff] [blame] | 737 | auth = ('karaf','karaf') |
| 738 | |
| 739 | resp = requests.get(url=url, auth=auth) |
| 740 | data = json.loads(resp.text) |
Chetan Gaonker | a6e23a7 | 2017-03-14 01:27:49 +0000 | [diff] [blame] | 741 | result = self.search_value(data, device_id) |
Chetan Gaonker | 3c8ae68 | 2017-02-18 00:50:45 +0000 | [diff] [blame] | 742 | assert_equal(result, True) |
| 743 | |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 744 | def test_cordvtn_basic_tenant(self): |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 745 | |
ChetanGaonker | 71fe030 | 2016-12-19 17:45:44 -0800 | [diff] [blame] | 746 | tenant_1= create_tenant("CORD_Subscriber_Test_Tenant_1") |
Chetan Gaonker | 0fb91c9 | 2017-02-07 01:52:18 +0000 | [diff] [blame] | 747 | if tenant1 != 0: |
ChetanGaonker | 71fe030 | 2016-12-19 17:45:44 -0800 | [diff] [blame] | 748 | print "Creation of CORD Subscriber Test Tenant 1" |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 749 | |
ChetanGaonker | 71fe030 | 2016-12-19 17:45:44 -0800 | [diff] [blame] | 750 | tenant_2 = create_tenant("CORD_Subscriber_Test_Tenant_2") |
Chetan Gaonker | 0fb91c9 | 2017-02-07 01:52:18 +0000 | [diff] [blame] | 751 | if tenant2 != 0: |
ChetanGaonker | 71fe030 | 2016-12-19 17:45:44 -0800 | [diff] [blame] | 752 | print "Creation of CORD Subscriber Test Tenant 2" |
| 753 | |
| 754 | create_net(tenant_1,"a1") |
| 755 | create_subnet(tenant_1,"a1","as1","10.0.1.0/24") |
| 756 | |
| 757 | create_net(tenant_2,"a2") |
| 758 | create_subnet(tenant_2,"a2","as1","10.0.2.0/24") |
| 759 | |
| 760 | netid_1 = get_id(tenant_1,"net","a1") |
| 761 | netid_2 = get_id(tenant_2,"net","a2") |
| 762 | |
| 763 | nova_boot(tenant_1,"vm1",netid=netid) |
| 764 | nova_boot(tenant_2,"vm1",netid=netid) |
| 765 | |
| 766 | nova_wait_boot(tenant_1,"vm1", "ACTIVE") |
| 767 | nova_wait_boot(tenant_2,"vm1", "ACTIVE") |
| 768 | |
| 769 | router_create(tenant_1,"r1") |
| 770 | router_interface_add(tenant_1,"r1","as1") |
| 771 | router_create(tenant_2,"r1") |
| 772 | router_interface_add(tenant_2,"r1","as1") |
| 773 | |
| 774 | create_net(tenant_1,"x1","","--router:external=True") |
| 775 | create_net(tenant_2,"x1","","--router:external=True") |
| 776 | |
| 777 | router_gateway_set(tenant_1,"r1","x1") |
| 778 | router_gateway_set(tenant_2,"r1","x1") |
| 779 | |
| 780 | subnetid_1 = get_id(tenant_1,"subnet","as1") |
| 781 | subnetid_2 = get_id(tenant_2,"subnet","as1") |
| 782 | port_create(tenant_1,"p1","a1","10.0.1.100",subnetid_1) |
| 783 | port_create(tenant_2,"p1","a1","10.0.1.100",subnetid_2) |
| 784 | |
| 785 | port_id_1 = get_id(tenant_1,"port","p1") |
| 786 | port_id_2 = get_id(tenant_2,"port","p1") |
Chetan Gaonker | 0fb91c9 | 2017-02-07 01:52:18 +0000 | [diff] [blame] | 787 | status = validate_vtn_flows() |
| 788 | assert_equal(status, True) |
ChetanGaonker | 71fe030 | 2016-12-19 17:45:44 -0800 | [diff] [blame] | 789 | |
Chetan Gaonker | 0fb91c9 | 2017-02-07 01:52:18 +0000 | [diff] [blame] | 790 | def test_cordvtn_for_creation_of_network(self): |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 791 | |
| 792 | ret1 = create_tenant(netA) |
| 793 | if ret1 != 0: |
| 794 | print "Creation of Tenant netA Failed" |
| 795 | |
| 796 | ret2 = create_tenant(netB) |
| 797 | if ret2 != 0: |
| 798 | print "Creation of Tenant netB Failed" |
ChetanGaonker | d65b761 | 2016-12-07 01:01:20 -0800 | [diff] [blame] | 799 | network = {'name': self.network_name, 'admin_state_up': True} |
| 800 | self.neutron.create_network({'network':network}) |
| 801 | log.info("Created network:{0}".format(self.network_name)) |
Chetan Gaonker | 0fb91c9 | 2017-02-07 01:52:18 +0000 | [diff] [blame] | 802 | status = validate_vtn_flows() |
| 803 | assert_equal(status, True) |
ChetanGaonker | d65b761 | 2016-12-07 01:01:20 -0800 | [diff] [blame] | 804 | |
| 805 | def test_cordvtn_to_create_net_work_with_subnet(self): |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 806 | |
| 807 | ret1 = create_tenant(netA) |
| 808 | if ret1 != 0: |
| 809 | print "Creation of Tenant netA Failed" |
| 810 | |
| 811 | ret2 = create_tenant(netB) |
| 812 | if ret2 != 0: |
| 813 | print "Creation of Tenant netB Failed" |
ChetanGaonker | d65b761 | 2016-12-07 01:01:20 -0800 | [diff] [blame] | 814 | network_name = self.network_name |
| 815 | network = {'name': network_name, 'admin_state_up': True} |
| 816 | network_info = self.neutron.create_network({'network':network}) |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 817 | network_id = network_info['network']['id'] |
ChetanGaonker | d65b761 | 2016-12-07 01:01:20 -0800 | [diff] [blame] | 818 | |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 819 | log.info("Created network:{0}".format(network_id)) |
ChetanGaonker | d65b761 | 2016-12-07 01:01:20 -0800 | [diff] [blame] | 820 | self.network_ids.append(network_id) |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 821 | subnet_count = 1 |
| 822 | for cidr in self.subnet_cidrs: |
ChetanGaonker | d65b761 | 2016-12-07 01:01:20 -0800 | [diff] [blame] | 823 | gateway_ip = str(list(cidr)[1]) |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 824 | subnet = {"network_id": network_id, "ip_version":4, |
| 825 | "cidr":str(cidr), "enable_dhcp":True, |
| 826 | "host_routes":[{"destination":"0.0.0.0/0", "nexthop":gateway_ip}] |
| 827 | } |
ChetanGaonker | d65b761 | 2016-12-07 01:01:20 -0800 | [diff] [blame] | 828 | subnet = {"name":"subnet-"+str(subnet_count), "network_id": network_id, "ip_version":4, "cidr":str(cidr), "enable_dhcp":True} |
| 829 | print subnet |
| 830 | self.neutron.create_subnet({'subnet':subnet}) |
| 831 | log.info("Created subnet:{0}".format(str(cidr))) |
| 832 | if not self.number_of_subnet - 1: |
| 833 | break |
| 834 | self.number_of_subnet -= 1 |
| 835 | subnet_count += 1 |
Chetan Gaonker | 0fb91c9 | 2017-02-07 01:52:18 +0000 | [diff] [blame] | 836 | status = validate_vtn_flows() |
| 837 | assert_equal(status, True) |
ChetanGaonker | d65b761 | 2016-12-07 01:01:20 -0800 | [diff] [blame] | 838 | |
| 839 | def test_cordvtn_subnet_limit(self): |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 840 | onos_load_config() |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 841 | |
| 842 | ret1 = create_tenant(netA) |
| 843 | if ret1 != 0: |
| 844 | print "Creation of Tenant netA Failed" |
| 845 | |
| 846 | ret2 = create_tenant(netB) |
| 847 | if ret2 != 0: |
| 848 | print "Creation of Tenant netB Failed" |
ChetanGaonker | d65b761 | 2016-12-07 01:01:20 -0800 | [diff] [blame] | 849 | network_name = uuid.uuid4().get_hex() |
| 850 | network = {'name': network_name, 'admin_state_up': True} |
| 851 | network_info = self.neutron.create_network({'network':network}) |
| 852 | log.info("Created network:{0}".format(network_name)) |
| 853 | network_id = network_info['network']['id'] |
| 854 | self.network_ids.append(network_id) |
| 855 | subnet_cidrs = ['11.2.2.0/29', '11.2.2.8/29'] |
| 856 | for cidr in subnet_cidrs: |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 857 | subnet = {"network_id": network_id, "ip_version":4, "cidr": cidr} |
| 858 | subnet_info = self.neutron.create_subnet({'subnet':subnet}) |
| 859 | subnet_id = subnet_info['subnet']['id'] |
| 860 | log.info("Created subnet:{0}".format(cidr)) |
ChetanGaonker | d65b761 | 2016-12-07 01:01:20 -0800 | [diff] [blame] | 861 | while True: |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 862 | port = {"network_id": network_id, "admin_state_up": True} |
| 863 | port_info = self.neutron.create_port({'port':port}) |
| 864 | port_id = port_info['port']['id'] |
| 865 | self.port_ids.append(port_id) |
| 866 | log.info("Created Port:{0}".format(port_info['port']['id'])) |
| 867 | if not self.quota_limit: |
ChetanGaonker | d65b761 | 2016-12-07 01:01:20 -0800 | [diff] [blame] | 868 | break |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 869 | self.quota_limit -= 1 |
Chetan Gaonker | 0fb91c9 | 2017-02-07 01:52:18 +0000 | [diff] [blame] | 870 | status = validate_vtn_flows() |
| 871 | assert_equal(status, True) |
ChetanGaonker | d65b761 | 2016-12-07 01:01:20 -0800 | [diff] [blame] | 872 | |
| 873 | def test_cordvtn_floatingip_limit(self): |
ChetanGaonker | d65b761 | 2016-12-07 01:01:20 -0800 | [diff] [blame] | 874 | |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 875 | ret1 = create_tenant(netA) |
| 876 | if ret1 != 0: |
| 877 | print "Creation of Tenant netA Failed" |
| 878 | |
| 879 | ret2 = create_tenant(netB) |
| 880 | if ret2 != 0: |
| 881 | print "Creation of Tenant netB Failed" |
| 882 | while True: |
| 883 | floatingip = {"floating_network_id": self.floating_nw_id} |
| 884 | fip_info = self.neutron.create_floatingip({'floatingip':floatingip}) |
| 885 | fip_id = fip_info['floatingip']['id'] |
| 886 | log.info("Created Floating IP:{0}".format(fip_id)) |
| 887 | self.fip_ids.append(fip_id) |
| 888 | if not self.quota_limit: |
| 889 | break |
| 890 | self.quota_limit -= 1 |
Chetan Gaonker | 0fb91c9 | 2017-02-07 01:52:18 +0000 | [diff] [blame] | 891 | status = validate_vtn_flows() |
| 892 | assert_equal(status, True) |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 893 | |
Chetan Gaonker | 0fb91c9 | 2017-02-07 01:52:18 +0000 | [diff] [blame] | 894 | def test_cordvtn_for_10_neutron_networks(self): |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 895 | |
| 896 | ret1 = create_tenant(netA) |
| 897 | if ret1 != 0: |
| 898 | print "Creation of Tenant netA Failed" |
| 899 | |
| 900 | ret2 = create_tenant(netB) |
| 901 | if ret2 != 0: |
| 902 | print "Creation of Tenant netB Failed" |
| 903 | pool = Pool(processes=10) |
| 904 | ret = os.system("neutron quote-update --network 15") |
| 905 | if ret1 != 0: |
| 906 | print "Neutron network install failed" |
| 907 | for i in range(1, 11): |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 908 | pool.apply_async(create_network, (i, )) |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 909 | |
| 910 | pool.close() |
| 911 | pool.join() |
Chetan Gaonker | 0fb91c9 | 2017-02-07 01:52:18 +0000 | [diff] [blame] | 912 | status = validate_vtn_flows() |
| 913 | assert_equal(status, True) |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 914 | |
Chetan Gaonker | 0fb91c9 | 2017-02-07 01:52:18 +0000 | [diff] [blame] | 915 | def test_cordvtn_for_100_neutron_networks(self): |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 916 | |
| 917 | ret1 = create_tenant(netA) |
| 918 | if ret1 != 0: |
| 919 | print "Creation of Tenant netA Failed" |
| 920 | |
| 921 | ret2 = create_tenant(netB) |
| 922 | if ret2 != 0: |
| 923 | print "Creation of Tenant netB Failed" |
| 924 | pool = Pool(processes=10) |
| 925 | |
| 926 | ret = os.system("neutron quote-update --network 105") |
| 927 | if ret1 != 0: |
| 928 | print "Neutron network install failed" |
| 929 | for i in range(1, 101): |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 930 | pool.apply_async(create_network, (i, )) |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 931 | |
| 932 | pool.close() |
| 933 | pool.join() |
Chetan Gaonker | 0fb91c9 | 2017-02-07 01:52:18 +0000 | [diff] [blame] | 934 | status = validate_vtn_flows() |
| 935 | assert_equal(status, True) |
| 936 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 937 | def test_cordvtn_creating_virtual_private_network(self): |
| 938 | """ |
| 939 | Algo: |
| 940 | 1) Validate that required openstack service is up and running. |
| 941 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 942 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network. |
| 943 | (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24). |
| 944 | 4) Verify that NetA is being created and validate IP in nova list command. |
| 945 | 5) Verify that flow is being added in ovs-switch in compute-node. |
| 946 | 6) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 947 | """ |
| 948 | pass |
Chetan Gaonker | 0fb91c9 | 2017-02-07 01:52:18 +0000 | [diff] [blame] | 949 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 950 | def test_cordvtn_creating_virtual_public_network(self): |
| 951 | """ |
| 952 | Algo: |
| 953 | 1) Validate that required openstack service is up and running. |
| 954 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 955 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as public network. |
| 956 | (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24). |
| 957 | 4) Verify that NetA is being created and validate IP in nova list command. |
| 958 | 5) Verify that flow is being added in ovs-switch in compute-node. |
| 959 | 6) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 960 | """ |
| 961 | pass |
Chetan Gaonker | 0fb91c9 | 2017-02-07 01:52:18 +0000 | [diff] [blame] | 962 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 963 | def test_cordvtn_creating_virtual_local_management_network(self): |
| 964 | """ |
| 965 | Algo: |
| 966 | 1) Validate that required openstack service is up and running. |
| 967 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 968 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network. |
| 969 | (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1). |
| 970 | 4) Verify that NetA is being created and validate IP in nova list command. |
| 971 | 5) Verify that flow is being added in ovs-switch in compute-node. |
| 972 | 6) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 973 | """ |
| 974 | pass |
Chetan Gaonker | 0fb91c9 | 2017-02-07 01:52:18 +0000 | [diff] [blame] | 975 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 976 | def test_cordvtn_creating_virtual_vlan_connectivity_network(self): |
| 977 | """ |
| 978 | Algo: |
| 979 | 1) Validate that required openstack service is up and running. |
| 980 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 981 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a vlan port-create. |
| 982 | (neutron port-create net-A-private --name stag-100). |
| 983 | 4) Verify that NetA is being created and validate IP in nova list command. |
| 984 | 5) Verify that flow is being added in ovs-switch in compute-node. |
| 985 | 6) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 986 | """ |
| 987 | pass |
Chetan Gaonker | 0fb91c9 | 2017-02-07 01:52:18 +0000 | [diff] [blame] | 988 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 989 | def test_cordvtn_creating_virtual_floating_IP_with_vlan_connectivity_network(self): |
| 990 | """ |
| 991 | Algo: |
| 992 | 1) Validate that required openstack service is up and running. |
| 993 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 994 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a floating ip and vlan port-create. |
| 995 | (neutron port-create net-A-private --name stag-500). |
| 996 | 4) Verify that NetA is being created and validate IP in nova list command. |
| 997 | 5) Verify that flow is being added in ovs-switch in compute-node. |
| 998 | 6) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 999 | """ |
| 1000 | pass |
Chetan Gaonker | 0fb91c9 | 2017-02-07 01:52:18 +0000 | [diff] [blame] | 1001 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1002 | def test_cordvtn_creating_virtual_private_network_and_boot_image(self): |
| 1003 | """ |
| 1004 | Algo: |
| 1005 | 1) Validate that required openstack service is up and running. |
| 1006 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1007 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network. |
| 1008 | (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24). |
| 1009 | 4) Now boot image in the same created network using nova boot image command (example given below :- |
| 1010 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01 |
| 1011 | 5) Wait till VM boots up and starts running. |
| 1012 | 6) Verify that a VM is launched and running by using novaclient python API. |
| 1013 | 7) Verify that flow is being added in ovs-switch in compute-node. |
| 1014 | 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1015 | 9) Verify that cord-onos pushed flows to OVS switch. |
| 1016 | """ |
| 1017 | pass |
Chetan Gaonker | 0fb91c9 | 2017-02-07 01:52:18 +0000 | [diff] [blame] | 1018 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1019 | def test_cordvtn_creating_virtual_public_network_and_boot_image(self): |
Chetan Gaonker | 0fb91c9 | 2017-02-07 01:52:18 +0000 | [diff] [blame] | 1020 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1021 | """ |
| 1022 | Algo: |
| 1023 | 1) Validate that required openstack service is up and running. |
| 1024 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1025 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as public network. |
| 1026 | (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24). |
| 1027 | 4) Now boot image in the same created network using nova boot image command (example given below :- |
| 1028 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01 |
| 1029 | 5) Wait till VM boots up and starts running. |
| 1030 | 6) Verify that a VM is launched and running by using novaclient python API. |
| 1031 | 7) Verify that flow is being added in ovs-switch in compute-node. |
| 1032 | 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1033 | 9) Verify that cord-onos pushed flows to OVS switch. |
| 1034 | """ |
| 1035 | pass |
Chetan Gaonker | 0fb91c9 | 2017-02-07 01:52:18 +0000 | [diff] [blame] | 1036 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1037 | def test_cordvtn_creating_virtual_local_management_network_and_boot_image(self): |
Chetan Gaonker | 0fb91c9 | 2017-02-07 01:52:18 +0000 | [diff] [blame] | 1038 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1039 | """ |
| 1040 | Algo: |
| 1041 | 1) Validate that required openstack service is up and running. |
| 1042 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1043 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network. |
| 1044 | (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1). |
| 1045 | 4) Now boot image in the same created network using nova boot image command (example given below :- |
| 1046 | 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 |
| 1047 | 5) Wait till VM boots up and starts running. |
| 1048 | 6) Verify that a VM is launched and running by using novaclient python API. |
| 1049 | 7) Verify that flow is being added in ovs-switch in compute-node. |
| 1050 | 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1051 | 9) Verify that cord-onos pushed flows to OVS switch. |
| 1052 | """ |
| 1053 | pass |
Chetan Gaonker | 0fb91c9 | 2017-02-07 01:52:18 +0000 | [diff] [blame] | 1054 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1055 | def test_cordvtn_creating_virtual_vlan_connectivity_network_and_boot_image(self): |
| 1056 | """ |
| 1057 | Algo: |
| 1058 | 1) Validate that required openstack service is up and running. |
| 1059 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1060 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a vlan port-create. |
| 1061 | (neutron port-create net-A-private --name stag-100). |
| 1062 | 4) Now boot image in the same created network using nova boot image command (example given below :- |
| 1063 | nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01 |
| 1064 | 5) Wait till VM boots up and starts running. |
| 1065 | 6) Verify that a VM is launched and running by using novaclient python API. |
| 1066 | 7) Verify that flow is being added in ovs-switch in compute-node. |
| 1067 | 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1068 | 9) Verify that cord-onos pushed flows to OVS switch. |
| 1069 | """ |
| 1070 | pass |
Chetan Gaonker | 0fb91c9 | 2017-02-07 01:52:18 +0000 | [diff] [blame] | 1071 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1072 | def test_cordvtn_creating_virtual_floating_IP_with_vlan_connectivity_network_and_boot_image(self): |
| 1073 | """ |
| 1074 | Algo: |
| 1075 | 1) Validate that required openstack service is up and running. |
| 1076 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1077 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a floating ip and vlan port-create. |
| 1078 | (neutron port-create net-A-private --name stag-500). |
| 1079 | 4) Now boot image in the same created network using nova boot image command (example given below :- |
| 1080 | nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01 |
| 1081 | 5) Wait till VM boots up and starts running. |
| 1082 | 6) Verify that a VM is launched and running by using novaclient python API. |
| 1083 | 7) Verify that flow is being added in ovs-switch in compute-node. |
| 1084 | 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1085 | 9) Verify that cord-onos pushed flows to OVS switch. |
| 1086 | """ |
| 1087 | pass |
Chetan Gaonker | 0fb91c9 | 2017-02-07 01:52:18 +0000 | [diff] [blame] | 1088 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1089 | def test_cordvtn_creating_virtual_private_network_and_boot_2_images_in_same_service(self): |
| 1090 | """ |
| 1091 | Algo: |
| 1092 | 1) Validate that required openstack service is up and running. |
| 1093 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1094 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network. |
| 1095 | (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24). |
| 1096 | 4) Now boot 2 images in the same created network using nova boot image command (example given below :- |
| 1097 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01 |
| 1098 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-02 |
| 1099 | 5) Wait till VMs boot up and running. |
| 1100 | 6) Verify that two VMs are launched and running by using novaclient python API. |
| 1101 | 7) Verify that flow is being added in ovs-switch in compute-node. |
| 1102 | 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1103 | 9) Verify that cord-onos pushed flows to OVS switch. |
| 1104 | """ |
| 1105 | pass |
Chetan Gaonker | 0fb91c9 | 2017-02-07 01:52:18 +0000 | [diff] [blame] | 1106 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1107 | def test_cordvtn_creating_virtual_public_network_and_boot_2_images_in_same_service(self): |
| 1108 | """ |
| 1109 | Algo: |
| 1110 | 1) Validate that required openstack service is up and running. |
| 1111 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1112 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as public network. |
| 1113 | (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24). |
| 1114 | 4) Now boot 2 images in the same created network using nova boot image command (example given below :- |
| 1115 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01 |
| 1116 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-02 |
| 1117 | 5) Wait till VMs boot up and running. |
| 1118 | 6) Verify that two VMs are launched and running by using novaclient python API. |
| 1119 | 7) Verify that flow is being added in ovs-switch in compute-node. |
| 1120 | 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1121 | 9) Verify that cord-onos pushed flows to OVS switch. |
| 1122 | """ |
| 1123 | pass |
Chetan Gaonker | 0fb91c9 | 2017-02-07 01:52:18 +0000 | [diff] [blame] | 1124 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1125 | def test_cordvtn_creating_virtual_local_management_network_and_boot_2_images_in_same_service(self): |
| 1126 | """ |
| 1127 | Algo: |
| 1128 | 1) Validate that required openstack service is up and running. |
| 1129 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1130 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network. |
| 1131 | (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1). |
| 1132 | 4) Now boot two images in the same created network using nova boot image command (example given below :- |
| 1133 | 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 |
| 1134 | 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 |
| 1135 | 5) Wait till VMs boot up and running. |
| 1136 | 6) Verify that two VMs are launched and running by using novaclient python API. |
| 1137 | 7) Verify that flow is being added in ovs-switch in compute-node. |
| 1138 | 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1139 | 9) Verify that cord-onos pushed flows to OVS switch. |
| 1140 | """ |
| 1141 | pass |
Chetan Gaonker | 0fb91c9 | 2017-02-07 01:52:18 +0000 | [diff] [blame] | 1142 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1143 | def test_cordvtn_creating_virtual_vlan_connectivity_network_and_boot_2_images_in_same_service(self): |
| 1144 | """ |
| 1145 | Algo: |
| 1146 | 1) Validate that required openstack service is up and running. |
| 1147 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1148 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a vlan port-create. |
| 1149 | (neutron port-create net-A-private --name stag-100). |
| 1150 | 4) Now boot two images in the same created network using nova boot image command (example given below :- |
| 1151 | nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01 |
| 1152 | nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01 |
| 1153 | 5) Wait till VMs boot up and running. |
| 1154 | 6) Verify that two VMs are launched and running by using novaclient python API. |
| 1155 | 7) Verify that flow is being added in ovs-switch in compute-node. |
| 1156 | 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1157 | 9) Verify that cord-onos pushed flows to OVS switch. |
| 1158 | """ |
| 1159 | pass |
Chetan Gaonker | 0fb91c9 | 2017-02-07 01:52:18 +0000 | [diff] [blame] | 1160 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1161 | def test_cordvtn_creating_virtual_floating_IP_with_vlan_connectivity_network_and_boot_2_images_in_same_service(self): |
| 1162 | """ |
| 1163 | Algo: |
| 1164 | 1) Validate that required openstack service is up and running. |
| 1165 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1166 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a floating ip and vlan port-create. |
| 1167 | (neutron port-create net-A-private --name stag-500). |
| 1168 | 4) Now boot two images in the same created network using nova boot image command (example given below :- |
| 1169 | nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01 |
| 1170 | nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-02 |
| 1171 | 5) Wait till VMs boot up and running. |
| 1172 | 6) Verify that two VMs are launched and running by using novaclient python API. |
| 1173 | 7) Verify that flow is being added in ovs-switch in compute-node. |
| 1174 | 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1175 | 9) Verify that cord-onos pushed flows to OVS switch. |
| 1176 | """ |
| 1177 | pass |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 1178 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1179 | def test_cordvtn_creating_virtual_private_network_and_boot_2_images_in_same_service_connectivity(self): |
| 1180 | """ |
| 1181 | Algo: |
| 1182 | 1) Validate that required openstack service is up and running. |
| 1183 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1184 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network. |
| 1185 | (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24). |
| 1186 | 4) Now boot 2 images in the same created network using nova boot image command (example given below :- |
| 1187 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01 |
| 1188 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-02 |
| 1189 | 5) Wait till VMs boot up and running. |
| 1190 | 6) Verify that two VMs are launched and running by using novaclient python API. |
| 1191 | 7) Now ping to the VM from other VM which are launched in same network |
| 1192 | 8) verify that ping is successful |
| 1193 | 9) Verify that flow is being added in ovs-switch in compute-node. |
| 1194 | 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1195 | 11) Verify that cord-onos pushed flows to OVS switch. |
| 1196 | """ |
| 1197 | pass |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 1198 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1199 | def test_cordvtn_creating_virtual_public_network_and_boot_2_images_in_same_service_connectivity_negative_scenario(self): |
| 1200 | """ |
| 1201 | Algo: |
| 1202 | 1) Validate that required openstack service is up and running. |
| 1203 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1204 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as public network. |
| 1205 | (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24). |
| 1206 | 4) Now boot 2 images in the same created network using nova boot image command (example given below :- |
| 1207 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01 |
| 1208 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-02 |
| 1209 | 5) Wait till VMs boot up and running. |
| 1210 | 6) Verify that two VMs are launched and running by using novaclient python API. |
| 1211 | 7) Now ping to the VM from other VM which are launched in same network |
| 1212 | 8) verify that ping is not successful |
| 1213 | 9) Verify that flow is being added in ovs-switch in compute-node. |
| 1214 | 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1215 | 11) Verify that cord-onos pushed flows to OVS switch. |
| 1216 | """ |
| 1217 | pass |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 1218 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1219 | def test_cordvtn_creating_virtual_local_management_network_and_boot_2_images_in_same_service_connectivity_negative_scenario(self): |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 1220 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1221 | """ |
| 1222 | Algo: |
| 1223 | 1) Validate that required openstack service is up and running. |
| 1224 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1225 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network. |
| 1226 | (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1). |
| 1227 | 4) Now boot two images in the same created network using nova boot image command (example given below :- |
| 1228 | 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 |
| 1229 | 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 |
| 1230 | 5) Wait till VMs boot up and running. |
| 1231 | 6) Verify that two VMs are launched and running by using novaclient python API. |
| 1232 | 7) Now ping to the VM from other VM which are launched in same network |
| 1233 | 8) verify that ping is not successful |
| 1234 | 9) Verify that flow is being added in ovs-switch in compute-node. |
| 1235 | 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1236 | 11) Verify that cord-onos pushed flows to OVS switch. |
| 1237 | """ |
| 1238 | pass |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 1239 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1240 | def test_cordvtn_creating_virtual_vlan_connectivity_network_and_boot_2_images_in_same_service_connectivity_negative_scenario(self): |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 1241 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1242 | """ |
| 1243 | Algo: |
| 1244 | 1) Validate that required openstack service is up and running. |
| 1245 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1246 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a vlan port-create. |
| 1247 | (neutron port-create net-A-private --name stag-100). |
| 1248 | 4) Now boot two images in the same created network using nova boot image command (example given below :- |
| 1249 | nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01 |
| 1250 | nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01 |
| 1251 | 5) Wait till VMs boot up and running. |
| 1252 | 6) Verify that two VMs are launched and running by using novaclient python API. |
| 1253 | 7) Now ping to the VM from other VM which are launched in same network |
| 1254 | 8) verify that ping is not successful |
| 1255 | 9) Verify that flow is being added in ovs-switch in compute-node. |
| 1256 | 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1257 | 11) Verify that cord-onos pushed flows to OVS switch. |
| 1258 | """ |
| 1259 | pass |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 1260 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1261 | def test_cordvtn_creating_virtual_floating_IP_with_vlan_connectivity_network_and_boot_2_images_in_same_service_connectivity_negative_scenario(self): |
| 1262 | """ |
| 1263 | Algo: |
| 1264 | 1) Validate that required openstack service is up and running. |
| 1265 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1266 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a floating ip and vlan port-create. |
| 1267 | (neutron port-create net-A-private --name stag-500). |
| 1268 | 4) Now boot two images in the same created network using nova boot image command (example given below :- |
| 1269 | nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01 |
| 1270 | nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-02 |
| 1271 | 5) Wait till VMs boot up and running. |
| 1272 | 6) Verify that two VMs are launched and running by using novaclient python API. |
| 1273 | 7) Now ping to the VM from other VM which are launched in same network |
| 1274 | 8) verify that ping is not successful |
| 1275 | 9) Verify that flow is being added in ovs-switch in compute-node. |
| 1276 | 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1277 | 11) Verify that cord-onos pushed flows to OVS switch. |
| 1278 | """ |
| 1279 | pass |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 1280 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1281 | def test_cordvtn_creating_virtual_private_network_and_boot_image_connectivity_negative_scenario(self): |
| 1282 | """ |
| 1283 | Algo: |
| 1284 | 1) Validate that required openstack service is up and running. |
| 1285 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1286 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network. |
| 1287 | (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24). |
| 1288 | 4) Now boot image in the same created network using nova boot image command (example given below :- |
| 1289 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01 |
| 1290 | 5) Wait till VM boots up and starts running. |
| 1291 | 6) Verify that a VM is launched and running by using novaclient python API. |
| 1292 | 7) Now ping to the VM from outside network which are internet network (global ping) |
| 1293 | 8) verify that ping is not successful |
| 1294 | 9) Verify that flow is being added in ovs-switch in compute-node. |
| 1295 | 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1296 | 11) Verify that cord-onos pushed flows to OVS switch. |
| 1297 | """ |
| 1298 | pass |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 1299 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1300 | def test_cordvtn_creating_virtual_public_network_and_boot_image_connectivity(self): |
| 1301 | """ |
| 1302 | Algo: |
| 1303 | 1) Validate that required openstack service is up and running. |
| 1304 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1305 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as public network. |
| 1306 | (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24). |
| 1307 | 4) Now boot image in the same created network using nova boot image command (example given below :- |
| 1308 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01 |
| 1309 | 5) Wait till VM boots up and starts running. |
| 1310 | 6) Verify that a VM is launched and running by using novaclient python API. |
| 1311 | 7) Now ping to the VM from outside network which are internet network (global ping) |
| 1312 | 8) verify that ping is successful |
| 1313 | 9) Verify that flow is being added in ovs-switch in compute-node. |
| 1314 | 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1315 | 11) Verify that cord-onos pushed flows to OVS switch. |
| 1316 | """ |
| 1317 | pass |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 1318 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1319 | def test_cordvtn_creating_virtual_local_management_network_and_boot_image_connectivity_negative_scenario(self): |
| 1320 | """ |
| 1321 | Algo: |
| 1322 | 1) Validate that required openstack service is up and running. |
| 1323 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1324 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network. |
| 1325 | (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1). |
| 1326 | 4) Now boot image in the same created network using nova boot image command (example given below :- |
| 1327 | 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 |
| 1328 | 5) Wait till VM boots up and starts running. |
| 1329 | 6) Verify that a VM is launched and running by using novaclient python API. |
| 1330 | 7) Now ping to the VM from outside network which are internet network (global ping) |
| 1331 | 8) verify that ping is not successful |
| 1332 | 9) Verify that flow is being added in ovs-switch in compute-node. |
| 1333 | 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1334 | 11) Verify that cord-onos pushed flows to OVS switch. |
| 1335 | """ |
| 1336 | pass |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 1337 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1338 | def test_cordvtn_creating_virtual_vlan_connectivity_network_and_boot_image_connectivity_negative_scenario(self): |
| 1339 | """ |
| 1340 | Algo: |
| 1341 | 1) Validate that required openstack service is up and running. |
| 1342 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1343 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a vlan port-create. |
| 1344 | (neutron port-create net-A-private --name stag-100). |
| 1345 | 4) Now boot image in the same created network using nova boot image command (example given below :- |
| 1346 | nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01 |
| 1347 | 5) Wait till VM boots up and starts running. |
| 1348 | 6) Verify that a VM is launched and running by using novaclient python API. |
| 1349 | 7) Now ping to the VM from outside network which are internet network (global ping) |
| 1350 | 8) verify that ping is not successful |
| 1351 | 9) Verify that flow is being added in ovs-switch in compute-node. |
| 1352 | 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1353 | 11) Verify that cord-onos pushed flows to OVS switch. |
| 1354 | """ |
| 1355 | pass |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 1356 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1357 | def test_cordvtn_creating_virtual_floating_IP_with_vlan_connectivity_network_and_boot_image_connectivity_negative_scenario(self): |
| 1358 | """ |
| 1359 | Algo: |
| 1360 | 1) Validate that required openstack service is up and running. |
| 1361 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1362 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a floating ip and vlan port-create. |
| 1363 | (neutron port-create net-A-private --name stag-500). |
| 1364 | 4) Now boot image in the same created network using nova boot image command (example given below :- |
| 1365 | nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01 |
| 1366 | 5) Wait till VM boots up and starts running. |
| 1367 | 6) Verify that a VM is launched and running by using novaclient python API. |
| 1368 | 7) Now ping to the VM from outside network which are internet network (global ping) |
| 1369 | 8) verify that ping is not successful |
| 1370 | 9) Verify that flow is being added in ovs-switch in compute-node. |
| 1371 | 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1372 | 11) Verify that cord-onos pushed flows to OVS switch. |
| 1373 | """ |
| 1374 | pass |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 1375 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1376 | def test_cordvtn_creating_virtual_private_network_and_boot_image_connectivity_negative_scenario(self): |
| 1377 | """ |
| 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 private network. |
| 1382 | (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24). |
| 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 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) Now ping to the VM from compute node network which are launched a VM. |
| 1388 | 8) verify that ping is not successful |
| 1389 | 9) Verify that flow is being added in ovs-switch in compute-node. |
| 1390 | 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1391 | 11) Verify that cord-onos pushed flows to OVS switch. |
| 1392 | """ |
| 1393 | pass |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 1394 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1395 | def test_cordvtn_creating_virtual_public_network_and_boot_image_connectivity_negative_scenario(self): |
| 1396 | """ |
| 1397 | Algo: |
| 1398 | 1) Validate that required openstack service is up and running. |
| 1399 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1400 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as public network. |
| 1401 | (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24). |
| 1402 | 4) Now boot image in the same created network using nova boot image command (example given below :- |
| 1403 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01 |
| 1404 | 5) Wait till VM boots up and starts running. |
| 1405 | 6) Verify that a VM is launched and running by using novaclient python API. |
| 1406 | 7) Now ping to the VM from compute node network which are launched a VM. |
| 1407 | 8) verify that ping is not successful |
| 1408 | 9) Verify that flow is being added in ovs-switch in compute-node. |
| 1409 | 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1410 | 11) Verify that cord-onos pushed flows to OVS switch. |
| 1411 | """ |
| 1412 | pass |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 1413 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1414 | def test_cordvtn_creating_virtual_local_management_network_and_boot_image_connectivity(self): |
| 1415 | """ |
| 1416 | Algo: |
| 1417 | 1) Validate that required openstack service is up and running. |
| 1418 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1419 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network. |
| 1420 | (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1). |
| 1421 | 4) Now boot image in the same created network using nova boot image command (example given below :- |
| 1422 | 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 |
| 1423 | 5) Wait till VM boots up and starts running. |
| 1424 | 6) Verify that a VM is launched and running by using novaclient python API. |
| 1425 | 7) Now ping to the VM from compute node network which are launched a VM. |
| 1426 | 8) verify that ping is successful |
| 1427 | 9) Verify that flow is being added in ovs-switch in compute-node. |
| 1428 | 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1429 | 11) Verify that cord-onos pushed flows to OVS switch. |
| 1430 | """ |
| 1431 | pass |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 1432 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1433 | def test_cordvtn_creating_virtual_vlan_connectivity_network_and_boot_image_connectivity_negative_scenario(self): |
| 1434 | """ |
| 1435 | Algo: |
| 1436 | 1) Validate that required openstack service is up and running. |
| 1437 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1438 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a vlan port-create. |
| 1439 | (neutron port-create net-A-private --name stag-100). |
| 1440 | 4) Now boot image in the same created network using nova boot image command (example given below :- |
| 1441 | nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01 |
| 1442 | 5) Wait till VM boots up and starts running. |
| 1443 | 6) Verify that a VM is launched and running by using novaclient python API. |
| 1444 | 7) Now ping to the VM from compute node network which are launched a VM. |
| 1445 | 8) verify that ping is not successful |
| 1446 | 9) Verify that flow is being added in ovs-switch in compute-node. |
| 1447 | 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1448 | 11) Verify that cord-onos pushed flows to OVS switch. |
| 1449 | """ |
| 1450 | pass |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 1451 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1452 | def test_cordvtn_creating_virtual_floating_IP_with_vlan_connectivity_network_and_boot_image_connectivity_negative_scenario(self): |
| 1453 | """ |
| 1454 | Algo: |
| 1455 | 1) Validate that required openstack service is up and running. |
| 1456 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1457 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a floating ip and vlan port-create. |
| 1458 | (neutron port-create net-A-private --name stag-500). |
| 1459 | 4) Now boot image in the same created network using nova boot image command (example given below :- |
| 1460 | nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01 |
| 1461 | 5) Wait till VM boots up and starts running. |
| 1462 | 6) Verify that a VM is launched and running by using novaclient python API. |
| 1463 | 7) Now ping to the VM from compute node network which are launched a VM. |
| 1464 | 8) verify that ping is not successful |
| 1465 | 9) Verify that flow is being added in ovs-switch in compute-node. |
| 1466 | 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1467 | 11) Verify that cord-onos pushed flows to OVS switch. |
| 1468 | """ |
| 1469 | pass |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 1470 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1471 | def test_cordvtn_creating_virtual_vlan_interface_private_network_and_boot_image_connectivity_negative_scenario(self): |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 1472 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1473 | """ |
| 1474 | Algo: |
| 1475 | 1) Validate that required openstack service is up and running. |
| 1476 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1477 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network. |
| 1478 | (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24). |
| 1479 | 4) Now boot image in the same created network using nova boot image command (example given below :- |
| 1480 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01 |
| 1481 | 5) Wait till VM boots up and starts running. |
| 1482 | 6) Verify that a VM is launched and running by using novaclient python API. |
| 1483 | 7) Create a virtual interface with vlan tag and private ip on VM. |
| 1484 | 8) Create a same virtual interface with valn tag and private ip on head node. |
| 1485 | 9) Now ping to the VM from head node network which are launched a openstack service. |
| 1486 | 10) verify that ping is successful |
| 1487 | 11) Verify that flow is being added in ovs-switch in compute-node. |
| 1488 | 12) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1489 | 13) Verify that cord-onos pushed flows to OVS switch. |
| 1490 | """ |
| 1491 | pass |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 1492 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1493 | def test_cordvtn_creating_virtual_vlan_interface_public_network_and_boot_image_connectivity_negative_scenario(self): |
ChetanGaonker | 901727c | 2016-11-29 14:05:03 -0800 | [diff] [blame] | 1494 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1495 | """ |
| 1496 | Algo: |
| 1497 | 1) Validate that required openstack service is up and running. |
| 1498 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1499 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as public network. |
| 1500 | (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24). |
| 1501 | 4) Now boot image in the same created network using nova boot image command (example given below :- |
| 1502 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01 |
| 1503 | 5) Wait till VM boots up and starts running. |
| 1504 | 6) Verify that a VM is launched and running by using novaclient python API. |
| 1505 | 7) Create a virtual interface with vlan tag and public ip on VM. |
| 1506 | 8) Create a same virtual interface with valn tag and any pulic ip on head node. |
| 1507 | 9) Now ping to the VM from head node network which are launched a openstack service. |
| 1508 | 10) verify that ping is successful |
| 1509 | 11) Verify that flow is being added in ovs-switch in compute-node. |
| 1510 | 12) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1511 | 13) Verify that cord-onos pushed flows to OVS switch. |
| 1512 | """ |
| 1513 | pass |
ChetanGaonker | 901727c | 2016-11-29 14:05:03 -0800 | [diff] [blame] | 1514 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1515 | def test_cordvtn_creating_virtual_vlan_interface_local_management_network_and_boot_image_connectivity(self): |
ChetanGaonker | 901727c | 2016-11-29 14:05:03 -0800 | [diff] [blame] | 1516 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1517 | """ |
| 1518 | Algo: |
| 1519 | 1) Validate that required openstack service is up and running. |
| 1520 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1521 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network. |
| 1522 | (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1). |
| 1523 | 4) Now boot image in the same created network using nova boot image command (example given below :- |
| 1524 | 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 |
| 1525 | 5) Wait till VM boots up and starts running. |
| 1526 | 6) Verify that a VM is launched and running by using novaclient python API. |
| 1527 | 7) Create a virtual interface with vlan tag and local management ip on VM. |
| 1528 | 8) Create a same virtual interface with valn tag and any local management ip on head node. |
| 1529 | 9) Now ping to the VM from head node network which are launched a openstack service. |
| 1530 | 10) verify that ping is successful |
| 1531 | 11) Verify that flow is being added in ovs-switch in compute-node. |
| 1532 | 12) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1533 | 13) Verify that cord-onos pushed flows to OVS switch. |
| 1534 | """ |
| 1535 | pass |
ChetanGaonker | 901727c | 2016-11-29 14:05:03 -0800 | [diff] [blame] | 1536 | |
ChetanGaonker | 901727c | 2016-11-29 14:05:03 -0800 | [diff] [blame] | 1537 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1538 | def test_cordvtn_creating_virtual_vlan_interface_floating_private_network_and_boot_image_connectivity_negative_scenario(self): |
ChetanGaonker | 901727c | 2016-11-29 14:05:03 -0800 | [diff] [blame] | 1539 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1540 | """ |
| 1541 | Algo: |
| 1542 | 1) Validate that required openstack service is up and running. |
| 1543 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1544 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network. |
| 1545 | (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24). |
| 1546 | 4) Now boot image in the same created network using nova boot image command (example given below :- |
| 1547 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01 |
| 1548 | 5) Wait till VM boots up and starts running. |
| 1549 | 6) Verify that a VM is launched and running by using novaclient python API. |
| 1550 | 7) Create a virtual interface with vlan tag and private floating ip on VM. |
| 1551 | 8) Create a same virtual interface with valn tag and private floating ip on head node. |
| 1552 | 9) Now ping to the VM from head node network which are launched a openstack service. |
| 1553 | 10) verify that ping is successful |
| 1554 | 11) Verify that flow is being added in ovs-switch in compute-node. |
| 1555 | 12) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1556 | 13) Verify that cord-onos pushed flows to OVS switch. |
| 1557 | """ |
| 1558 | pass |
ChetanGaonker | 901727c | 2016-11-29 14:05:03 -0800 | [diff] [blame] | 1559 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1560 | def test_cordvtn_creating_virtual_vlan_interface_floating_public_network_and_boot_image_connectivity_negative_scenario(self): |
ChetanGaonker | 901727c | 2016-11-29 14:05:03 -0800 | [diff] [blame] | 1561 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1562 | """ |
| 1563 | Algo: |
| 1564 | 1) Validate that required openstack service is up and running. |
| 1565 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1566 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as public network. |
| 1567 | (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24). |
| 1568 | 4) Now boot image in the same created network using nova boot image command (example given below :- |
| 1569 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01 |
| 1570 | 5) Wait till VM boots up and starts running. |
| 1571 | 6) Verify that a VM is launched and running by using novaclient python API. |
| 1572 | 7) Create a virtual interface with vlan tag and public floating ip on VM. |
| 1573 | 8) Create a same virtual interface with valn tag and any pulic floating ip on head node. |
| 1574 | 9) Now ping to the VM from head node network which are launched a openstack service. |
| 1575 | 10) verify that ping is successful |
| 1576 | 11) Verify that flow is being added in ovs-switch in compute-node. |
| 1577 | 12) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1578 | 13) Verify that cord-onos pushed flows to OVS switch. |
| 1579 | """ |
| 1580 | pass |
ChetanGaonker | 901727c | 2016-11-29 14:05:03 -0800 | [diff] [blame] | 1581 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1582 | def test_cordvtn_creating_virtual_vlan_interface_floating_local_management_network_and_boot_image_connectivity(self): |
ChetanGaonker | 901727c | 2016-11-29 14:05:03 -0800 | [diff] [blame] | 1583 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1584 | """ |
| 1585 | Algo: |
| 1586 | 1) Validate that required openstack service is up and running. |
| 1587 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1588 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network. |
| 1589 | (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1). |
| 1590 | 4) Now boot image in the same created network using nova boot image command (example given below :- |
| 1591 | 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 |
| 1592 | 5) Wait till VM boots up and starts running. |
| 1593 | 6) Verify that a VM is launched and running by using novaclient python API. |
| 1594 | 7) Create a virtual interface with vlan tag and local management floating ip on VM. |
| 1595 | 8) Create a same virtual interface with valn tag and any local management floating ip on head node. |
| 1596 | 9) Now ping to the VM from head node network which are launched a openstack service. |
| 1597 | 10) verify that ping is successful |
| 1598 | 11) Verify that flow is being added in ovs-switch in compute-node. |
| 1599 | 12) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1600 | 13) Verify that cord-onos pushed flows to OVS switch. |
| 1601 | """ |
| 1602 | pass |
ChetanGaonker | 901727c | 2016-11-29 14:05:03 -0800 | [diff] [blame] | 1603 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1604 | def test_cordvtn_creating_one_virtual_public_and_a_private_network_and_boot_2_images_in_same_service_connectivity_negative_scenario(self): |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 1605 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1606 | """ |
| 1607 | Algo: |
| 1608 | 1) Validate that required openstack service is up and running. |
| 1609 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1610 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as public network. |
| 1611 | (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24). |
| 1612 | 4) Now boot 2 images in the same created network using nova boot image command (example given below :- |
| 1613 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01 |
| 1614 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-02 |
| 1615 | 5) Wait till VMs boot up and running. |
| 1616 | 6) Verify that two VMs are launched and running by using novaclient python API. |
| 1617 | 7) Now ping to the VM from other VM which are launched in the private network |
| 1618 | 8) verify that ping is not successful |
| 1619 | 9) Verify that flow is being added in ovs-switch in compute-node. |
| 1620 | 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1621 | 11) Verify that cord-onos pushed flows to OVS switch. |
| 1622 | """ |
| 1623 | pass |
ChetanGaonker | 901727c | 2016-11-29 14:05:03 -0800 | [diff] [blame] | 1624 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1625 | def test_cordvtn_creating_one_virtual_local_management_and_a_private_network_and_boot_2_images_in_same_service_connectivity_negative_scenario(self): |
ChetanGaonker | 901727c | 2016-11-29 14:05:03 -0800 | [diff] [blame] | 1626 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1627 | """ |
| 1628 | Algo: |
| 1629 | 1) Validate that required openstack service is up and running. |
| 1630 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1631 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network. |
| 1632 | (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1). |
| 1633 | 4) Now boot two images in the same created network using nova boot image command (example given below :- |
| 1634 | 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 |
| 1635 | 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 |
| 1636 | 5) Wait till VMs boot up and running. |
| 1637 | 6) Verify that two VMs are launched and running by using novaclient python API. |
| 1638 | 7) Now ping to the VM from other VM which are launched in the private network |
| 1639 | 8) verify that ping is not successful |
| 1640 | 9) Verify that flow is being added in ovs-switch in compute-node. |
| 1641 | 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1642 | 11) Verify that cord-onos pushed flows to OVS switch. |
| 1643 | """ |
| 1644 | pass |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 1645 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1646 | def test_cordvtn_creating_one_virtual_vlan_connectivity_and_a_private_network_and_boot_2_images_in_same_service_connectivity_negative_scenario(self): |
ChetanGaonker | aaea6b6 | 2016-12-16 17:06:39 -0800 | [diff] [blame] | 1647 | |
Thangavelu K S | bdb1ec4 | 2017-02-23 19:51:42 +0000 | [diff] [blame] | 1648 | """ |
| 1649 | Algo: |
| 1650 | 1) Validate that required openstack service is up and running. |
| 1651 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1652 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a vlan port-create. |
| 1653 | (neutron port-create net-A-private --name stag-100). |
| 1654 | 4) Now boot two images in the same created network using nova boot image command (example given below :- |
| 1655 | nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01 |
| 1656 | nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01 |
| 1657 | 5) Wait till VMs boot up and running. |
| 1658 | 6) Verify that two VMs are launched and running by using novaclient python API. |
| 1659 | 7) Now ping to the VM from other VM which are launched in the private network |
| 1660 | 8) verify that ping is not successful |
| 1661 | 9) Verify that flow is being added in ovs-switch in compute-node. |
| 1662 | 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1663 | 11) Verify that cord-onos pushed flows to OVS switch. |
| 1664 | """ |
| 1665 | pass |
| 1666 | |
| 1667 | 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): |
| 1668 | |
| 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) From CORD-Test container, use python-neutron client and create network with name - NetA with a floating ip and vlan port-create. |
| 1674 | (neutron port-create net-A-private --name stag-500). |
| 1675 | 4) Now boot two images in the same created network using nova boot image command (example given below :- |
| 1676 | nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01 |
| 1677 | nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-02 |
| 1678 | 5) Wait till VMs boot up and running. |
| 1679 | 6) Verify that two VMs are launched and running by using novaclient python API. |
| 1680 | 7) Now ping to the VM from other VM which are launched in the private network |
| 1681 | 8) verify that ping is not successful |
| 1682 | 9) Verify that flow is being added in ovs-switch in compute-node. |
| 1683 | 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1684 | 11) Verify that cord-onos pushed flows to OVS switch. |
| 1685 | """ |
| 1686 | pass |
| 1687 | |
| 1688 | def test_cordvtn_creating_one_virtual_local_management_other_public_network_and_boot_2_images_in_same_service_connectivity_negative_scenario(self): |
| 1689 | |
| 1690 | """ |
| 1691 | Algo: |
| 1692 | 1) Validate that required openstack service is up and running. |
| 1693 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1694 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network. |
| 1695 | (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1). |
| 1696 | 4) Now boot two images in the same created network using nova boot image command (example given below :- |
| 1697 | 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 |
| 1698 | 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 |
| 1699 | 5) Wait till VMs boot up and running. |
| 1700 | 6) Verify that two VMs are launched and running by using novaclient python API. |
| 1701 | 7) Now ping to the VM from other VM which are launched in the public network |
| 1702 | 8) verify that ping is not successful |
| 1703 | 9) Verify that flow is being added in ovs-switch in compute-node. |
| 1704 | 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1705 | 11) Verify that cord-onos pushed flows to OVS switch. |
| 1706 | """ |
| 1707 | pass |
| 1708 | |
| 1709 | def test_cordvtn_creating_one_virtual_vlan_connectivity_and_a_private_network_and_boot_2_images_in_same_service_connectivity_negative_scenario(self): |
| 1710 | |
| 1711 | """ |
| 1712 | Algo: |
| 1713 | 1) Validate that required openstack service is up and running. |
| 1714 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1715 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a vlan port-create. |
| 1716 | (neutron port-create net-A-private --name stag-100). |
| 1717 | 4) Now boot two images in the same created network using nova boot image command (example given below :- |
| 1718 | nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01 |
| 1719 | nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01 |
| 1720 | 5) Wait till VMs boot up and running. |
| 1721 | 6) Verify that two VMs are launched and running by using novaclient python API. |
| 1722 | 7) Now ping to the VM from other VM which are launched in the public network |
| 1723 | 8) verify that ping is not successful |
| 1724 | 9) Verify that flow is being added in ovs-switch in compute-node. |
| 1725 | 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1726 | 11) Verify that cord-onos pushed flows to OVS switch. |
| 1727 | """ |
| 1728 | pass |
| 1729 | |
| 1730 | 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): |
| 1731 | |
| 1732 | """ |
| 1733 | Algo: |
| 1734 | 1) Validate that required openstack service is up and running. |
| 1735 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1736 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a floating ip and vlan port-create. |
| 1737 | (neutron port-create net-A-private --name stag-500). |
| 1738 | 4) Now boot two images in the same created network using nova boot image command (example given below :- |
| 1739 | nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01 |
| 1740 | nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-02 |
| 1741 | 5) Wait till VMs boot up and running. |
| 1742 | 6) Verify that two VMs are launched and running by using novaclient python API. |
| 1743 | 7) Now ping to the VM from other VM which are launched in the public network |
| 1744 | 8) verify that ping is not successful |
| 1745 | 9) Verify that flow is being added in ovs-switch in compute-node. |
| 1746 | 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1747 | 11) Verify that cord-onos pushed flows to OVS switch. |
| 1748 | """ |
| 1749 | pass |
| 1750 | |
| 1751 | def test_cordvtn_creating_one_virtual_vlan_connectivity_other_local_management_network_and_boot_2_images_in_same_service_connectivity_negative_scenario(self): |
| 1752 | |
| 1753 | """ |
| 1754 | Algo: |
| 1755 | 1) Validate that required openstack service is up and running. |
| 1756 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1757 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a vlan port-create. |
| 1758 | (neutron port-create net-A-private --name stag-100). |
| 1759 | 4) Now boot two images in the same created network using nova boot image command (example given below :- |
| 1760 | nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01 |
| 1761 | nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01 |
| 1762 | 5) Wait till VMs boot up and running. |
| 1763 | 6) Verify that two VMs are launched and running by using novaclient python API. |
| 1764 | 7) Now ping to the VM from other VM which are launched in the public network |
| 1765 | 8) verify that ping is not successful |
| 1766 | 9) Verify that flow is being added in ovs-switch in compute-node. |
| 1767 | 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1768 | 11) Verify that cord-onos pushed flows to OVS switch. |
| 1769 | """ |
| 1770 | pass |
| 1771 | |
| 1772 | 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): |
| 1773 | |
| 1774 | """ |
| 1775 | Algo: |
| 1776 | 1) Validate that required openstack service is up and running. |
| 1777 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1778 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a floating ip and vlan port-create. |
| 1779 | (neutron port-create net-A-private --name stag-500). |
| 1780 | 4) Now boot two images in the same created network using nova boot image command (example given below :- |
| 1781 | nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01 |
| 1782 | nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-02 |
| 1783 | 5) Wait till VMs boot up and running. |
| 1784 | 6) Verify that two VMs are launched and running by using novaclient python API. |
| 1785 | 7) Now ping to the VM from other VM which are launched in the public network |
| 1786 | 8) verify that ping is not successful |
| 1787 | 9) Verify that flow is being added in ovs-switch in compute-node. |
| 1788 | 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1789 | 11) Verify that cord-onos pushed flows to OVS switch. |
| 1790 | """ |
| 1791 | pass |
| 1792 | |
| 1793 | 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): |
| 1794 | |
| 1795 | """ |
| 1796 | Algo: |
| 1797 | 1) Validate that required openstack service is up and running. |
| 1798 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1799 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with a floating ip and vlan port-create. |
| 1800 | (neutron port-create net-A-private --name stag-500). |
| 1801 | 4) Now boot two images in the same created network using nova boot image command (example given below :- |
| 1802 | nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01 |
| 1803 | nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-02 |
| 1804 | 5) Wait till VMs boot up and running. |
| 1805 | 6) Verify that two VMs are launched and running by using novaclient python API. |
| 1806 | 7) Now ping to the VM from other VM which are launched in the public network |
| 1807 | 8) verify that ping is not successful |
| 1808 | 9) Verify that flow is being added in ovs-switch in compute-node. |
| 1809 | 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1810 | 11) Verify that cord-onos pushed flows to OVS switch. |
| 1811 | """ |
| 1812 | pass |
| 1813 | |
| 1814 | def test_cordvtn_creating_virtual_public_network_and_boot_2_images_with_invalid_public_field_of_onos_network_cfg_json_in_same_service(self): |
| 1815 | """ |
| 1816 | Algo: |
| 1817 | 1) Validate that required openstack service is up and running. |
| 1818 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1819 | 3) Push network_cfg.json config file to onos with an invalid public gateway ip in network_cfg.json file. |
| 1820 | 4) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as public network. |
| 1821 | (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24). |
| 1822 | 5) Now boot 2 images in the same created network using nova boot image command (example given below :- |
| 1823 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01 |
| 1824 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-02 |
| 1825 | 6) Wait till VMs boot up and running. |
| 1826 | 7) Verify that two VMs are launched and running by using novaclient python API. |
| 1827 | 8) Verify that flow is being added in ovs-switch in compute-node. |
| 1828 | 9) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1829 | 10) Verify that cord-onos pushed flows to OVS switch. |
| 1830 | 11) Verify ping from VM to public gateway which is send to ONOS through rest API in network_cfg.json file. |
| 1831 | 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. |
| 1832 | 13) Now ping one VM to other VM it should not ping again even it in the same service. |
| 1833 | """ |
| 1834 | pass |
| 1835 | |
| 1836 | def test_cordvtn_creating_virtual_local_management_network_and_boot_image_with_invalid_localManagementIp_field_of_onos_network_cfg_json(self): |
| 1837 | |
| 1838 | """ |
| 1839 | Algo: |
| 1840 | 1) Validate that required openstack service is up and running. |
| 1841 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1842 | 3) Push network_cfg.json config file to onos with an invalid localManagement ip in network_cfg.json file. |
| 1843 | 4) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network. |
| 1844 | (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1). |
| 1845 | 5) Now boot image in the same created network using nova boot image command (example given below :- |
| 1846 | 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 |
| 1847 | 6) Wait till VM boots up and starts running. |
| 1848 | 7) Verify that a VM is launched and running by using novaclient python API. |
| 1849 | 8) Verify that flow is being added in ovs-switch in compute-node. |
| 1850 | 9) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1851 | 10) Verify that cord-onos pushed flows to OVS switch. |
| 1852 | 11) Verify ping from VM to local management ip which is send to ONOS through rest API in network_cfg.json file. |
| 1853 | 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. |
| 1854 | """ |
| 1855 | pass |
| 1856 | |
| 1857 | def test_cordvtn_creating_virtual_private_network_and_boot_image_with_invalid_OVSDB_port_field_of_onos_network_cfg_json(self): |
| 1858 | """ |
| 1859 | Algo: |
| 1860 | 1) Validate that required openstack service is up and running. |
| 1861 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1862 | 3) Push network_cfg.json config file to onos with an invalid ovsdb port in network_cfg.json file. |
| 1863 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network. |
| 1864 | (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24). |
| 1865 | 4) Now boot image 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 | 5) Wait till VM boots up and starts running. |
| 1868 | 6) Verify that a VM is launched and running by using novaclient python API. |
| 1869 | 7) Verify that flows are being added in ovs-switch in compute-node. |
| 1870 | 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1871 | 9) Verify that cord-onos did not push any flows to OVS switch. |
| 1872 | """ |
| 1873 | pass |
| 1874 | |
| 1875 | def test_cordvtn_creating_virtual_private_network_and_boot_image_with_invalid_OpenStack_details_in_onos_network_cfg_json(self): |
| 1876 | """ |
| 1877 | Algo: |
| 1878 | 1) Validate that required openstack service is up and running. |
| 1879 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1880 | 3) Push network_cfg.json config file to onos with an invalid openstack in network_cfg.json file. |
| 1881 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network. |
| 1882 | (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24). |
| 1883 | 4) Now boot image in the same created network using nova boot image command (example given below :- |
| 1884 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01 |
| 1885 | 5) Wait till VM boots up and starts running. |
| 1886 | 6) Verify that a VM is launched and running by using novaclient python API. |
| 1887 | 7) Verify that no flows are being added in ovs-switch in compute-node. |
| 1888 | 8) Verify that onos-ml2 plugin is not being received a message from openstack service neutron. |
| 1889 | 9) Verify that cord-onos did not push any flows to OVS switch. |
| 1890 | """ |
| 1891 | pass |
| 1892 | |
| 1893 | def test_cordvtn_creating_virtual_private_network_and_boot_image_with_invalid_compute_node_details_in_onos_network_cfg_json(self): |
| 1894 | """ |
| 1895 | Algo: |
| 1896 | 1) Validate that required openstack service is up and running. |
| 1897 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1898 | 3) Push network_cfg.json config file to onos with an invalid compute node details in network_cfg.json file. |
| 1899 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network. |
| 1900 | (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24). |
| 1901 | 4) Now boot image in the same created network using nova boot image command (example given below :- |
| 1902 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01 |
| 1903 | 5) Wait till VM boots up and starts running. |
| 1904 | 6) Verify that a VM is launched and running by using novaclient python API. |
| 1905 | 7) Verify that no flows are being added in ovs-switch in compute-node. |
| 1906 | 8) Verify that onos-ml2 plugin is not being received a message from openstack service neutron. |
| 1907 | 9) Verify that cord-onos did not push any flows to OVS switch. |
| 1908 | """ |
| 1909 | pass |
| 1910 | |
| 1911 | |
| 1912 | def test_cordvtn_creating_two_virtual_private_networks_and_boot_images_in_different_services_connectivity(self): |
| 1913 | """ |
| 1914 | Algo: |
| 1915 | 1) Validate that required openstack service is up and running. |
| 1916 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1917 | 3) From CORD-Test container, use python-neutron client and create two networks with name - NetA and NetB with an IP as private network. |
| 1918 | (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24). |
| 1919 | (neutron net-create net-B-private, neutron subnet-create net-B-private 10.1.0.0/24). |
| 1920 | 4) Now boot 2 images in the same created network using nova boot image command (example given below :- |
| 1921 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01 |
| 1922 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-B-vm-01 |
| 1923 | 5) Wait till VMs boot up and running. |
| 1924 | 6) Verify that two VMs are launched and running by using novaclient python API. |
| 1925 | 7) Verify that flow is being added in ovs-switch in compute-node. |
| 1926 | 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1927 | 9) Verify that cord-onos pushed flows to OVS switch. |
| 1928 | 10) Now ping from VM which is Net-A to other VM which is in Net-B, should not ping. |
| 1929 | 11) Verify that no flows are being added in the OVS switch. |
| 1930 | """ |
| 1931 | pass |
| 1932 | |
| 1933 | def test_cordvtn_creating_two_virtual_public_networks_and_boot_images_in_different_service_connectivity(self): |
| 1934 | """ |
| 1935 | Algo: |
| 1936 | 1) Validate that required openstack service is up and running. |
| 1937 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1938 | 3) From CORD-Test container, use python-neutron client and create two networks with name - NetA and NetB with an IP as public network. |
| 1939 | (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24). |
| 1940 | (neutron net-create net-A-public, neutron subnet-create net-B-public 198.1.0.0/24). |
| 1941 | 4) Now boot 2 images in the same created network using nova boot image command (example given below :- |
| 1942 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01 |
| 1943 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-B-vm-01 |
| 1944 | 5) Wait till VMs boot up and running. |
| 1945 | 6) Verify that two VMs are launched and running by using novaclient python API. |
| 1946 | 7) Verify that flow is being added in ovs-switch in compute-node. |
| 1947 | 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1948 | 9) Verify that cord-onos pushed flows to OVS switch. |
| 1949 | 10) Now ping from VM which is Net-A to other VM which is in Net-B, should not ping. |
| 1950 | 11) Verify that no flows are being added in the OVS switch. |
| 1951 | """ |
| 1952 | pass |
| 1953 | |
| 1954 | def test_cordvtn_creating_two_virtual_local_management_networks_and_boot_images_in_different_service_connectivity(self): |
| 1955 | """ |
| 1956 | Algo: |
| 1957 | 1) Validate that required openstack service is up and running. |
| 1958 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1959 | 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. |
| 1960 | (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1). |
| 1961 | (neutron net-create net-A-management, neutron subnet-create net-A-management 172.28.0.0/24 -gateway 172.28.0.1). |
| 1962 | 4) Now boot two images in the same created network using nova boot image command (example given below :- |
| 1963 | 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 |
| 1964 | 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 |
| 1965 | 5) Wait till VMs boot up and running. |
| 1966 | 6) Verify that two VMs are launched and running by using novaclient python API. |
| 1967 | 7) Verify that flow is being added in ovs-switch in compute-node. |
| 1968 | 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1969 | 9) Verify that cord-onos pushed flows to OVS switch. |
| 1970 | 10) Now ping from VM which is Net-A to other VM which is in Net-B, should not ping. |
| 1971 | 11) Verify that no flows are being added in the OVS switch. |
| 1972 | """ |
| 1973 | pass |
| 1974 | |
| 1975 | def test_cordvtn_creating_two_virtual_vlan_connectivity_networks_and_boot_images_in_different_service_connectivity(self): |
| 1976 | """ |
| 1977 | Algo: |
| 1978 | 1) Validate that required openstack service is up and running. |
| 1979 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 1980 | 3) From CORD-Test container, use python-neutron client and create two networks with name - NetA and NetB with a vlan port-create. |
| 1981 | (neutron port-create net-A-private --name stag-100). |
| 1982 | (neutron port-create net-B-private --name stag-200). |
| 1983 | 4) Now boot two images in the same created network using nova boot image command (example given below :- |
| 1984 | nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01 |
| 1985 | nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg1-01 |
| 1986 | 5) Wait till VMs boot up and running. |
| 1987 | 6) Verify that two VMs are launched and running by using novaclient python API. |
| 1988 | 7) Verify that flow is being added in ovs-switch in compute-node. |
| 1989 | 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 1990 | 9) Verify that cord-onos pushed flows to OVS switch. |
| 1991 | 10) Now ping from VM which is Net-A to other VM which is in Net-B, should not ping. |
| 1992 | 11) Verify that no flows are being added in the OVS switch. |
| 1993 | """ |
| 1994 | pass |
| 1995 | def test_cordvtn_creating_two_virtual_floating_IP_with_vlan_connectivity_networks_and_boot_images_in_different_service_connectivity(self): |
| 1996 | """ |
| 1997 | Algo: |
| 1998 | 1) Validate that required openstack service is up and running. |
| 1999 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 2000 | 3) From CORD-Test container, use python-neutron client and create two networks with name - NetA and NetB with a floating ip and vlan port-create. |
| 2001 | (neutron port-create net-A-private --name stag-500). |
| 2002 | (neutron port-create net-B-private --name stag-500). |
| 2003 | 4) Now boot two images in the same created network using nova boot image command (example given below :- |
| 2004 | nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-01 |
| 2005 | nova boot --image 6ba954df-063f-4379-9e2a-920050879918 --flavor 2 --nic port-id=2c7a397f-949e-4502-aa61-2c9cefe96c74 --user-data passwd.data vsg-02 |
| 2006 | 5) Wait till VMs boot up and running. |
| 2007 | 6) Verify that two VMs are launched and running by using novaclient python API. |
| 2008 | 7) Verify that flow is being added in ovs-switch in compute-node. |
| 2009 | 8) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 2010 | 9) Verify that cord-onos pushed flows to OVS switch. |
| 2011 | 10) Now ping from VM which is Net-A to other VM which is in Net-B, should not ping. |
| 2012 | 11) Verify that no flows are being added in the OVS switch. |
| 2013 | """ |
| 2014 | pass |
| 2015 | |
| 2016 | def test_cordvtn_creating_two_virtual_private_networks_and_boot_images_for_services_dependency_with_out_xos_direct_access(self): |
| 2017 | """ |
| 2018 | Algo: |
| 2019 | 1) Validate that required openstack service is up and running. |
| 2020 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 2021 | 3) Push service dependency data.json file to onos to subscriber of other service. |
| 2022 | $ curl -X POST -H "Content-Type: application/json" -u onos:rocks -d @data.json http://$OC1:8181/onos/cordvtn/serviceNetworks |
| 2023 | 4) From CORD-Test container, use python-neutron client and create two networks with name - NetA and NetBwith an IP as private network. |
| 2024 | (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24). |
| 2025 | (neutron net-create net-B-private, neutron subnet-create net-B-private 10.1.0.0/24). |
| 2026 | 5) Now boot 2 images in the same created network using nova boot image command (example given below :- |
| 2027 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01 |
| 2028 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-B-vm-01 |
| 2029 | 6) Wait till VMs boot up and running. |
| 2030 | 7) Verify that two VMs are launched and running by using novaclient python API. |
| 2031 | 8) Verify that flow is being added in ovs-switch in compute-node. |
| 2032 | 9) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 2033 | 10) Verify that cord-onos pushed flows to OVS switch. |
| 2034 | 11) Now ping from VM which is Net-A to other VM which is in Net-B, should ping. |
| 2035 | 12) Verify that flows are being added in the OVS switch. |
| 2036 | """ |
| 2037 | pass |
| 2038 | |
| 2039 | def test_cordvtn_creating_two_virtual_private_networks_and_boot_images_for_services_dependency_with_out_xos_indirect_access(self): |
| 2040 | """ |
| 2041 | Algo: |
| 2042 | 1) Validate that required openstack service is up and running. |
| 2043 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 2044 | 3) Push service dependency data.json file to onos to subscriber of other service. |
| 2045 | $ curl -X POST -H "Content-Type: application/json" -u onos:rocks -d @data.json http://$OC1:8181/onos/cordvtn/serviceNetworks |
| 2046 | 4) From CORD-Test container, use python-neutron client and create two networks with name - NetA and NetBwith an IP as private network. |
| 2047 | (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24). |
| 2048 | (neutron net-create net-B-private, neutron subnet-create net-B-private 10.1.0.0/24). |
| 2049 | 5) Now boot 2 images in the same created network using nova boot image command (example given below :- |
| 2050 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01 |
| 2051 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-B-vm-01 |
| 2052 | 6) Wait till VMs boot up and running. |
| 2053 | 7) Verify that two VMs are launched and running by using novaclient python API. |
| 2054 | 8) Verify that flow is being added in ovs-switch in compute-node. |
| 2055 | 9) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 2056 | 10) Verify that cord-onos pushed flows to OVS switch. |
| 2057 | 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. |
| 2058 | 12) Verify that flows are being added in the OVS switch. |
| 2059 | """ |
| 2060 | pass |
| 2061 | |
| 2062 | def test_cordvtn_creating_two_virtual_private_networks_and_boot_images_remove_services_dependency_with_out_xos_direct_access(self): |
| 2063 | """ |
| 2064 | Algo: |
| 2065 | 1) Validate that required openstack service is up and running. |
| 2066 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 2067 | 3) Push service dependency data.json file to onos to subscriber of other service. |
| 2068 | $ curl -X POST -H "Content-Type: application/json" -u onos:rocks -d @data.json http://$OC1:8181/onos/cordvtn/serviceNetworks |
| 2069 | 4) From CORD-Test container, use python-neutron client and create two networks with name - NetA and NetBwith an IP as private network. |
| 2070 | (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24). |
| 2071 | (neutron net-create net-B-private, neutron subnet-create net-B-private 10.1.0.0/24). |
| 2072 | 5) Now boot 2 images in the same created network using nova boot image command (example given below :- |
| 2073 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01 |
| 2074 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-B-vm-01 |
| 2075 | 6) Wait till VMs boot up and running. |
| 2076 | 7) Verify that two VMs are launched and running by using novaclient python API. |
| 2077 | 8) Verify that flow is being added in ovs-switch in compute-node. |
| 2078 | 9) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 2079 | 10) Verify that cord-onos pushed flows to OVS switch. |
| 2080 | 11) Now ping from VM which is Net-A to other VM which is in Net-B, should ping. |
| 2081 | 12) Verify that flows are being added in the OVS switch. |
| 2082 | 13) Push config data with outservice dependency in data.json file to onos to subscriber of other service. |
| 2083 | 14) Now ping from VM which is Net-A to other VM which is in Net-B, should not ping. |
| 2084 | 15) Verify that no flows are being added in the OVS switch. |
| 2085 | """ |
| 2086 | pass |
| 2087 | |
| 2088 | def test_cordvtn_creating_two_virtual_private_networks_and_boot_images_remove_services_dependency_with_out_xos_indirect_access(self): |
| 2089 | """ |
| 2090 | Algo: |
| 2091 | 1) Validate that required openstack service is up and running. |
| 2092 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 2093 | 3) Push service dependency data.json file to onos to subscriber of other service. |
| 2094 | $ curl -X POST -H "Content-Type: application/json" -u onos:rocks -d @data.json http://$OC1:8181/onos/cordvtn/serviceNetworks |
| 2095 | 4) From CORD-Test container, use python-neutron client and create two networks with name - NetA and NetBwith an IP as private network. |
| 2096 | (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24). |
| 2097 | (neutron net-create net-B-private, neutron subnet-create net-B-private 10.1.0.0/24). |
| 2098 | 5) Now boot 2 images in the same created network using nova boot image command (example given below :- |
| 2099 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01 |
| 2100 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-B-vm-01 |
| 2101 | 6) Wait till VMs boot up and running. |
| 2102 | 7) Verify that two VMs are launched and running by using novaclient python API. |
| 2103 | 8) Verify that flow is being added in ovs-switch in compute-node. |
| 2104 | 9) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 2105 | 10) Verify that cord-onos pushed flows to OVS switch. |
| 2106 | 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. |
| 2107 | 12) Verify that flows are being added in the OVS switch. |
| 2108 | 13) Push config data with out service dependency in data.json file to onos to subscriber of other service. |
| 2109 | 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. |
| 2110 | 15) Verify that no flows are being added in the OVS switch. |
| 2111 | """ |
| 2112 | pass |
| 2113 | |
| 2114 | def test_cordvtn_creating_two_virtual_private_networks_and_boot_images_for_services_dependency_with_xos_direct_access(self): |
| 2115 | """ |
| 2116 | Algo: |
| 2117 | 1) Validate that required openstack service is up and running. |
| 2118 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 2119 | 3) Validate that XOS is up and running. |
| 2120 | 4) From CORD-Test container, use python-neutron client and create two networks with name - NetA and NetBwith an IP as private network. |
| 2121 | (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24). |
| 2122 | (neutron net-create net-B-private, neutron subnet-create net-B-private 10.1.0.0/24). |
| 2123 | 5) Now boot 2 images in the same created network using nova boot image command (example given below :- |
| 2124 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01 |
| 2125 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-B-vm-01 |
| 2126 | 6) Wait till VMs boot up and running. |
| 2127 | 7) Verify that two VMs are launched and running by using novaclient python API. |
| 2128 | 8) Verify that flow is being added in ovs-switch in compute-node. |
| 2129 | 9) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 2130 | 10) Verify that cord-onos pushed flows to OVS switch. |
| 2131 | 11) Now ping from VM which is Net-A to other VM which is in Net-B, should ping. |
| 2132 | 12) Verify that flows are being added in the OVS switch. |
| 2133 | """ |
| 2134 | pass |
| 2135 | |
| 2136 | def test_cordvtn_creating_two_virtual_private_networks_and_boot_images_for_services_dependency_with_xos_indirect_access(self): |
| 2137 | """ |
| 2138 | Algo: |
| 2139 | 1) Validate that required openstack service is up and running. |
| 2140 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 2141 | 3) Validate that XOS is up and running. |
| 2142 | 4) From CORD-Test container, use python-neutron client and create two networks with name - NetA and NetBwith an IP as private network. |
| 2143 | (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24). |
| 2144 | (neutron net-create net-B-private, neutron subnet-create net-B-private 10.1.0.0/24). |
| 2145 | 5) Now boot 2 images in the same created network using nova boot image command (example given below :- |
| 2146 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01 |
| 2147 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-B-vm-01 |
| 2148 | 6) Wait till VMs boot up and running. |
| 2149 | 7) Verify that two VMs are launched and running by using novaclient python API. |
| 2150 | 8) Verify that flow is being added in ovs-switch in compute-node. |
| 2151 | 9) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 2152 | 10) Verify that cord-onos pushed flows to OVS switch. |
| 2153 | 11) Now ping from VM which is Net-B to other VM which is in Net-A, should ping. |
| 2154 | 12) Verify that flows are being added in the OVS switch. |
| 2155 | """ |
| 2156 | pass |
| 2157 | |
| 2158 | def test_cordvtn_with_access_agent_serviceType_and_vtn_location_field_network_cfg_connectivity_to_access_device(self): |
| 2159 | """ |
| 2160 | Algo: |
| 2161 | 1) Validate that required openstack service is up and running. |
| 2162 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 2163 | 3) Push access-agent additional network_cfg to ONOS and specify vtn-location field info must be access-agent container. |
| 2164 | 4) Launch the access-agent and access-device containers and then restart openstack compute node. |
| 2165 | $ sudo docker run --privileged --cap-add=ALL -d --name access-agent -t ubuntu:14.04 /bin/bash |
| 2166 | 5) Create each interface on br-int and br-mgmt using pipework on access-agent containers |
| 2167 | $ sudo ./pipework br-mgmt -i eth1 access-agent 10.10.10.20/24 |
| 2168 | $ sudo ./pipework br-int -i eth2 access-agent 10.168.0.100/24 fa:00:00:00:00:11 |
| 2169 | 6) We ahve to stop ONOS service to test this |
| 2170 | onos-service stop |
| 2171 | sudo ovs-ofctl -O OpenFlow13 del-flows br-int "arp" |
| 2172 | 7) Now attach to access-agent container and ping to access-device |
| 2173 | 8) Verify that ping should be success and flows are being added in br-int. |
| 2174 | """ |
| 2175 | pass |
| 2176 | |
| 2177 | def test_cordvtn_with_access_agent_serviceType_and_vtn_location_field_in_network_cfg_connectivity_to_head_node(self): |
| 2178 | """ |
| 2179 | Algo: |
| 2180 | 1) Validate that required openstack service is up and running. |
| 2181 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 2182 | 3) Push access-agent additional network_cfg to ONOS and specify vtn-location field info must be access-agent container. |
| 2183 | 4) Launch the access-agent and access-device containers and then restart openstack compute node. |
| 2184 | $ sudo docker run --privileged --cap-add=ALL -d --name access-agent -t ubuntu:14.04 /bin/bash |
| 2185 | 5) Create each interface on br-int and br-mgmt using pipework on access-agent containers |
| 2186 | $ sudo ./pipework br-mgmt -i eth1 access-agent 10.10.10.20/24 |
| 2187 | $ sudo ./pipework br-int -i eth2 access-agent 10.168.0.100/24 fa:00:00:00:00:11 |
| 2188 | 6) We ahve to stop ONOS service to test this |
| 2189 | onos-service stop |
| 2190 | sudo ovs-ofctl -O OpenFlow13 del-flows br-int "arp" |
| 2191 | 7) Now attach to access-agent container and ping to head node |
| 2192 | 8) Verify that ping should be success and flows are being added in br-int. |
| 2193 | """ |
| 2194 | pass |
| 2195 | |
| 2196 | def test_cordvtn_with_access_agent_serviceType_and_invalid_vtn_location_field_network_cfg_connectivity_to_access_device(self): |
| 2197 | """ |
| 2198 | Algo: |
| 2199 | 1) Validate that required openstack service is up and running. |
| 2200 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 2201 | 3) Push access-agent additional network_cfg to ONOS and specify vtn-location field info must not be access-agent container. |
| 2202 | 4) Launch the access-agent and access-device containers and then restart openstack compute node. |
| 2203 | $ sudo docker run --privileged --cap-add=ALL -d --name access-agent -t ubuntu:14.04 /bin/bash |
| 2204 | 5) Create each interface on br-int and br-mgmt using pipework on access-agent containers |
| 2205 | $ sudo ./pipework br-mgmt -i eth1 access-agent 10.10.10.20/24 |
| 2206 | $ sudo ./pipework br-int -i eth2 access-agent 10.168.0.100/24 fa:00:00:00:00:11 |
| 2207 | 6) We ahve to stop ONOS service to test this |
| 2208 | onos-service stop |
| 2209 | sudo ovs-ofctl -O OpenFlow13 del-flows br-int "arp" |
| 2210 | 7) Now attach to access-agent container and ping to access-device |
| 2211 | 8) Verify that ping should not be success and no flows are being added in br-int. |
| 2212 | """ |
| 2213 | pass |
| 2214 | |
| 2215 | def test_cordvtn_with_access_agent_serviceType_and_invalid_vtn_location_field_in_network_cfg_connectivity_to_head_node(self): |
| 2216 | """ |
| 2217 | Algo: |
| 2218 | 1) Validate that required openstack service is up and running. |
| 2219 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 2220 | 3) Push access-agent additional network_cfg to ONOS and specify vtn-location field info must not be access-agent container. |
| 2221 | 4) Launch the access-agent and access-device containers and then restart openstack compute node. |
| 2222 | $ sudo docker run --privileged --cap-add=ALL -d --name access-agent -t ubuntu:14.04 /bin/bash |
| 2223 | 5) Create each interface on br-int and br-mgmt using pipework on access-agent containers |
| 2224 | $ sudo ./pipework br-mgmt -i eth1 access-agent 10.10.10.20/24 |
| 2225 | $ sudo ./pipework br-int -i eth2 access-agent 10.168.0.100/24 fa:00:00:00:00:11 |
| 2226 | 6) We ahve to stop ONOS service to test this |
| 2227 | onos-service stop |
| 2228 | sudo ovs-ofctl -O OpenFlow13 del-flows br-int "arp" |
| 2229 | 7) Now attach to access-agent container and ping to head node |
| 2230 | 8) Verify that ping should not be success and no flows are being added in br-int. |
| 2231 | """ |
| 2232 | pass |
| 2233 | |
| 2234 | def test_cordvtn_creating_virtual_private_network_and_boot_2_images_in_same_service_connectivity_after_restarting_VMs(self): |
| 2235 | """ |
| 2236 | Algo: |
| 2237 | 1) Validate that required openstack service is up and running. |
| 2238 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 2239 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network. |
| 2240 | (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24). |
| 2241 | 4) Now boot 2 images in the same created network using nova boot image command (example given below :- |
| 2242 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01 |
| 2243 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-02 |
| 2244 | 5) Wait till VMs boot up and running. |
| 2245 | 6) Verify that two VMs are launched and running by using novaclient python API. |
| 2246 | 7) Now ping to the VM from other VM which are launched in same network |
| 2247 | 8) verify that ping is successful |
| 2248 | 9) Verify that flow is being added in ovs-switch in compute-node. |
| 2249 | 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 2250 | 11) Verify that cord-onos pushed flows to OVS switch. |
| 2251 | 12) Restart both VMs in same service and repeat steps 7 to 11. |
| 2252 | """ |
| 2253 | pass |
| 2254 | |
| 2255 | def test_cordvtn_creating_virtual_private_network_and_boot_2_images_in_same_service_connectivity_after_restarting_cord_onos(self): |
| 2256 | """ |
| 2257 | Algo: |
| 2258 | 1) Validate that required openstack service is up and running. |
| 2259 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 2260 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network. |
| 2261 | (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24). |
| 2262 | 4) Now boot 2 images in the same created network using nova boot image command (example given below :- |
| 2263 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01 |
| 2264 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-02 |
| 2265 | 5) Wait till VMs boot up and running. |
| 2266 | 6) Verify that two VMs are launched and running by using novaclient python API. |
| 2267 | 7) Now ping to the VM from other VM which are launched in same network |
| 2268 | 8) verify that ping is successful |
| 2269 | 9) Verify that flow is being added in ovs-switch in compute-node. |
| 2270 | 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 2271 | 11) Verify that cord-onos pushed flows to OVS switch. |
| 2272 | 12) Restart ONOS service and repeat steps 7 to 11. |
| 2273 | """ |
| 2274 | pass |
| 2275 | |
| 2276 | def test_cordvtn_creating_virtual_private_network_and_boot_2_images_in_same_service_connectivity_after_delete_any_VM_recreating_it(self): |
| 2277 | """ |
| 2278 | Algo: |
| 2279 | 1) Validate that required openstack service is up and running. |
| 2280 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 2281 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network. |
| 2282 | (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24). |
| 2283 | 4) Now boot 2 images in the same created network using nova boot image command (example given below :- |
| 2284 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01 |
| 2285 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-02 |
| 2286 | 5) Wait till VMs boot up and running. |
| 2287 | 6) Verify that two VMs are launched and running by using novaclient python API. |
| 2288 | 7) Now ping to the VM from other VM which are launched in same network |
| 2289 | 8) verify that ping is successful |
| 2290 | 9) Verify that flow is being added in ovs-switch in compute-node. |
| 2291 | 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 2292 | 11) Verify that cord-onos pushed flows to OVS switch. |
| 2293 | 12) Delete a VM which was created earlier and repeat steps 4 to 11. |
| 2294 | """ |
| 2295 | pass |
| 2296 | |
| 2297 | def test_cordvtn_creating_virtual_private_network_and_boot_2_images_in_same_service_connectivity_after_delete_and_add_br_int_bridge(self): |
| 2298 | """ |
| 2299 | Algo: |
| 2300 | 1) Validate that required openstack service is up and running. |
| 2301 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 2302 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as private network. |
| 2303 | (neutron net-create net-A-private, neutron subnet-create net-A-private 10.0.0.0/24). |
| 2304 | 4) Now boot 2 images in the same created network using nova boot image command (example given below :- |
| 2305 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01 |
| 2306 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-02 |
| 2307 | 5) Wait till VMs boot up and running. |
| 2308 | 6) Verify that two VMs are launched and running by using novaclient python API. |
| 2309 | 7) Now ping to the VM from other VM which are launched in same network |
| 2310 | 8) verify that ping is successful |
| 2311 | 9) Verify that flow is being added in ovs-switch in compute-node. |
| 2312 | 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 2313 | 11) Verify that cord-onos pushed flows to OVS switch. |
| 2314 | 12) Delete a br_int bridge and repeat steps 7 to 11, (it should not ping) |
| 2315 | 13) Add br_int bridge and repeat steps 7 to 11, (it should ping) |
| 2316 | """ |
| 2317 | pass |
| 2318 | |
| 2319 | def test_cordvtn_creating_virtual_public_network_and_boot_image_connectivity_after_restarting_VM(self): |
| 2320 | |
| 2321 | """ |
| 2322 | Algo: |
| 2323 | 1) Validate that required openstack service is up and running. |
| 2324 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 2325 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as public network. |
| 2326 | (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24). |
| 2327 | 4) Now boot image in the same created network using nova boot image command (example given below :- |
| 2328 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01 |
| 2329 | 5) Wait till VM boots up and starts running. |
| 2330 | 6) Verify that a VM is launched and running by using novaclient python API. |
| 2331 | 7) Now ping to the VM from outside network which are internet network (global ping) |
| 2332 | 8) verify that ping is successful |
| 2333 | 9) Verify that flow is being added in ovs-switch in compute-node. |
| 2334 | 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 2335 | 11) Verify that cord-onos pushed flows to OVS switch. |
| 2336 | 12) Restart the VM in service and repeat steps 7 to 11. |
| 2337 | |
| 2338 | """ |
| 2339 | pass |
| 2340 | |
| 2341 | def test_cordvtn_creating_virtual_public_network_and_boot_image_connectivity_after_restarting_cord_onos(self): |
| 2342 | |
| 2343 | """ |
| 2344 | Algo: |
| 2345 | 1) Validate that required openstack service is up and running. |
| 2346 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 2347 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as public network. |
| 2348 | (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24). |
| 2349 | 4) Now boot image in the same created network using nova boot image command (example given below :- |
| 2350 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01 |
| 2351 | 5) Wait till VM boots up and starts running. |
| 2352 | 6) Verify that a VM is launched and running by using novaclient python API. |
| 2353 | 7) Now ping to the VM from outside network which are internet network (global ping) |
| 2354 | 8) verify that ping is successful |
| 2355 | 9) Verify that flow is being added in ovs-switch in compute-node. |
| 2356 | 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 2357 | 11) Verify that cord-onos pushed flows to OVS switch. |
| 2358 | 12) Restart onos service container and repeat steps 7 to 11. |
| 2359 | |
| 2360 | """ |
| 2361 | pass |
| 2362 | |
| 2363 | def test_cordvtn_creating_virtual_public_network_and_boot_image_connectivity_after_delete_and_recreate_VM(self): |
| 2364 | |
| 2365 | """ |
| 2366 | Algo: |
| 2367 | 1) Validate that required openstack service is up and running. |
| 2368 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 2369 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as public network. |
| 2370 | (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24). |
| 2371 | 4) Now boot image in the same created network using nova boot image command (example given below :- |
| 2372 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01 |
| 2373 | 5) Wait till VM boots up and starts running. |
| 2374 | 6) Verify that a VM is launched and running by using novaclient python API. |
| 2375 | 7) Now ping to the VM from outside network which are internet network (global ping) |
| 2376 | 8) verify that ping is successful |
| 2377 | 9) Verify that flow is being added in ovs-switch in compute-node. |
| 2378 | 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 2379 | 11) Verify that cord-onos pushed flows to OVS switch. |
| 2380 | 12) Delete and re-create a VM in the same service and repeat steps 7 to 11. |
| 2381 | |
| 2382 | """ |
| 2383 | pass |
| 2384 | |
| 2385 | def test_cordvtn_creating_virtual_public_network_and_boot_image_connectivity_after_delete_and_add_br_int_bridge(self): |
| 2386 | |
| 2387 | """ |
| 2388 | Algo: |
| 2389 | 1) Validate that required openstack service is up and running. |
| 2390 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 2391 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as public network. |
| 2392 | (neutron net-create net-A-public, neutron subnet-create net-A-public 198.0.0.0/24). |
| 2393 | 4) Now boot image in the same created network using nova boot image command (example given below :- |
| 2394 | $ nova boot --image 3e2d7760-774a-4a16-be07-aaccafa779b6 --flavor 1 --nic net-id=8bc19377-f493-4cad-af23-45fb299da9de net-A-vm-01 |
| 2395 | 5) Wait till VM boots up and starts running. |
| 2396 | 6) Verify that a VM is launched and running by using novaclient python API. |
| 2397 | 7) Now ping to the VM from outside network which are internet network (global ping) |
| 2398 | 8) verify that ping is successful |
| 2399 | 9) Verify that flow is being added in ovs-switch in compute-node. |
| 2400 | 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 2401 | 11) Verify that cord-onos pushed flows to OVS switch. |
| 2402 | 12) Delete a br_int bridge and repeat steps 7 to 11, (it should not ping) |
| 2403 | 13) Add br_int bridge and repeat steps 7 to 11, (it should ping) |
| 2404 | |
| 2405 | """ |
| 2406 | pass |
| 2407 | |
| 2408 | def test_cordvtn_creating_virtual_local_management_network_and_boot_image_connectivity_after_restarting_VM(self): |
| 2409 | |
| 2410 | """ |
| 2411 | Algo: |
| 2412 | 1) Validate that required openstack service is up and running. |
| 2413 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 2414 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network. |
| 2415 | (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1). |
| 2416 | 4) Now boot image in the same created network using nova boot image command (example given below :- |
| 2417 | 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 |
| 2418 | 5) Wait till VM boots up and starts running. |
| 2419 | 6) Verify that a VM is launched and running by using novaclient python API. |
| 2420 | 7) Now ping to the VM from compute node network which are launched a VM. |
| 2421 | 8) verify that ping is successful |
| 2422 | 9) Verify that flow is being added in ovs-switch in compute-node. |
| 2423 | 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 2424 | 11) Verify that cord-onos pushed flows to OVS switch. |
| 2425 | 12) Restart the VM in service and repeat steps 7 to 11. |
| 2426 | """ |
| 2427 | pass |
| 2428 | |
| 2429 | def test_cordvtn_creating_virtual_local_management_network_and_boot_image_connectivity_after_restarting_cord_onos(self): |
| 2430 | |
| 2431 | """ |
| 2432 | Algo: |
| 2433 | 1) Validate that required openstack service is up and running. |
| 2434 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 2435 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network. |
| 2436 | (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1). |
| 2437 | 4) Now boot image in the same created network using nova boot image command (example given below :- |
| 2438 | 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 |
| 2439 | 5) Wait till VM boots up and starts running. |
| 2440 | 6) Verify that a VM is launched and running by using novaclient python API. |
| 2441 | 7) Now ping to the VM from compute node network which are launched a VM. |
| 2442 | 8) verify that ping is successful |
| 2443 | 9) Verify that flow is being added in ovs-switch in compute-node. |
| 2444 | 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 2445 | 11) Verify that cord-onos pushed flows to OVS switch. |
| 2446 | 12) Restart the onos service and repeat steps 7 to 11. |
| 2447 | """ |
| 2448 | pass |
| 2449 | |
| 2450 | def test_cordvtn_creating_virtual_local_management_network_and_boot_image_connectivity_after_delete_and_recreate_VM(self): |
| 2451 | |
| 2452 | """ |
| 2453 | Algo: |
| 2454 | 1) Validate that required openstack service is up and running. |
| 2455 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 2456 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network. |
| 2457 | (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1). |
| 2458 | 4) Now boot image in the same created network using nova boot image command (example given below :- |
| 2459 | 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 |
| 2460 | 5) Wait till VM boots up and starts running. |
| 2461 | 6) Verify that a VM is launched and running by using novaclient python API. |
| 2462 | 7) Now ping to the VM from compute node network which are launched a VM. |
| 2463 | 8) verify that ping is successful |
| 2464 | 9) Verify that flow is being added in ovs-switch in compute-node. |
| 2465 | 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 2466 | 11) Verify that cord-onos pushed flows to OVS switch. |
| 2467 | 12) Delete and re-create a VM in the same service and repeat steps 7 to 11. |
| 2468 | """ |
| 2469 | pass |
| 2470 | |
| 2471 | def test_cordvtn_creating_virtual_local_management_network_and_boot_image_connectivity_after_delete_and_add_br_int_bridge(self): |
| 2472 | |
| 2473 | """ |
| 2474 | Algo: |
| 2475 | 1) Validate that required openstack service is up and running. |
| 2476 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 2477 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network. |
| 2478 | (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1). |
| 2479 | 4) Now boot image in the same created network using nova boot image command (example given below :- |
| 2480 | 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 |
| 2481 | 5) Wait till VM boots up and starts running. |
| 2482 | 6) Verify that a VM is launched and running by using novaclient python API. |
| 2483 | 7) Now ping to the VM from compute node network which are launched a VM. |
| 2484 | 8) verify that ping is successful |
| 2485 | 9) Verify that flow is being added in ovs-switch in compute-node. |
| 2486 | 10) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 2487 | 11) Verify that cord-onos pushed flows to OVS switch. |
| 2488 | 12) Delete a br_int bridge and repeat steps 7 to 11, (it should not ping) |
| 2489 | 13) Add br_int bridge and repeat steps 7 to 11, (it should ping) |
| 2490 | """ |
| 2491 | pass |
| 2492 | |
| 2493 | def test_cordvtn_creating_virtual_vlan_interface_local_management_network_and_boot_image_connectivity_after_restarting_VM(self): |
| 2494 | |
| 2495 | """ |
| 2496 | Algo: |
| 2497 | 1) Validate that required openstack service is up and running. |
| 2498 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 2499 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network. |
| 2500 | (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1). |
| 2501 | 4) Now boot image in the same created network using nova boot image command (example given below :- |
| 2502 | 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 |
| 2503 | 5) Wait till VM boots up and starts running. |
| 2504 | 6) Verify that a VM is launched and running by using novaclient python API. |
| 2505 | 7) Create a virtual interface with vlan tag and local management ip on VM. |
| 2506 | 8) Create a same virtual interface with valn tag and any local management ip on head node. |
| 2507 | 9) Now ping to the VM from head node network which are launched a openstack service. |
| 2508 | 10) verify that ping is successful |
| 2509 | 11) Verify that flow is being added in ovs-switch in compute-node. |
| 2510 | 12) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 2511 | 13) Verify that cord-onos pushed flows to OVS switch. |
| 2512 | 14) Restart the VM in service and repeat steps 9 to 13. |
| 2513 | |
| 2514 | """ |
| 2515 | pass |
| 2516 | |
| 2517 | def test_cordvtn_creating_virtual_vlan_interface_local_management_network_and_boot_image_connectivity_after_restarting_cord_onos(self): |
| 2518 | |
| 2519 | """ |
| 2520 | Algo: |
| 2521 | 1) Validate that required openstack service is up and running. |
| 2522 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 2523 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network. |
| 2524 | (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1). |
| 2525 | 4) Now boot image in the same created network using nova boot image command (example given below :- |
| 2526 | 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 |
| 2527 | 5) Wait till VM boots up and starts running. |
| 2528 | 6) Verify that a VM is launched and running by using novaclient python API. |
| 2529 | 7) Create a virtual interface with vlan tag and local management ip on VM. |
| 2530 | 8) Create a same virtual interface with valn tag and any local management ip on head node. |
| 2531 | 9) Now ping to the VM from head node network which are launched a openstack service. |
| 2532 | 10) verify that ping is successful |
| 2533 | 11) Verify that flow is being added in ovs-switch in compute-node. |
| 2534 | 12) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 2535 | 13) Verify that cord-onos pushed flows to OVS switch. |
| 2536 | 14) Restart the ONOS service and repeat steps 9 to 13. |
| 2537 | |
| 2538 | """ |
| 2539 | pass |
| 2540 | |
| 2541 | def test_cordvtn_creating_virtual_vlan_interface_local_management_network_and_boot_image_connectivity_after_delete_and_recreate_VM(self): |
| 2542 | |
| 2543 | """ |
| 2544 | Algo: |
| 2545 | 1) Validate that required openstack service is up and running. |
| 2546 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 2547 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network. |
| 2548 | (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1). |
| 2549 | 4) Now boot image in the same created network using nova boot image command (example given below :- |
| 2550 | 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 |
| 2551 | 5) Wait till VM boots up and starts running. |
| 2552 | 6) Verify that a VM is launched and running by using novaclient python API. |
| 2553 | 7) Create a virtual interface with vlan tag and local management ip on VM. |
| 2554 | 8) Create a same virtual interface with valn tag and any local management ip on head node. |
| 2555 | 9) Now ping to the VM from head node network which are launched a openstack service. |
| 2556 | 10) verify that ping is successful |
| 2557 | 11) Verify that flow is being added in ovs-switch in compute-node. |
| 2558 | 12) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 2559 | 13) Verify that cord-onos pushed flows to OVS switch. |
| 2560 | 14) Delete and re-create a VM in service and repeat steps 9 to 13. |
| 2561 | |
| 2562 | """ |
| 2563 | pass |
| 2564 | |
| 2565 | def test_cordvtn_creating_virtual_vlan_interface_local_management_network_and_boot_image_connectivity_after_delete_and_add_br_int_bridge(self): |
| 2566 | |
| 2567 | """ |
| 2568 | Algo: |
| 2569 | 1) Validate that required openstack service is up and running. |
| 2570 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 2571 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network. |
| 2572 | (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1). |
| 2573 | 4) Now boot image in the same created network using nova boot image command (example given below :- |
| 2574 | 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 |
| 2575 | 5) Wait till VM boots up and starts running. |
| 2576 | 6) Verify that a VM is launched and running by using novaclient python API. |
| 2577 | 7) Create a virtual interface with vlan tag and local management ip on VM. |
| 2578 | 8) Create a same virtual interface with valn tag and any local management ip on head node. |
| 2579 | 9) Now ping to the VM from head node network which are launched a openstack service. |
| 2580 | 10) verify that ping is successful |
| 2581 | 11) Verify that flow is being added in ovs-switch in compute-node. |
| 2582 | 12) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 2583 | 13) Verify that cord-onos pushed flows to OVS switch. |
| 2584 | 14) Delete a br_int bridge and repeat steps 9 to 13, (it should not ping) |
| 2585 | 15) Add br_int bridge and repeat steps 9 to 13, (it should ping) |
| 2586 | |
| 2587 | """ |
| 2588 | pass |
| 2589 | |
| 2590 | def test_cordvtn_creating_virtual_vlan_interface_floating_local_management_network_and_boot_image_connectivity_after_restarting_VM(self): |
| 2591 | |
| 2592 | """ |
| 2593 | Algo: |
| 2594 | 1) Validate that required openstack service is up and running. |
| 2595 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 2596 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network. |
| 2597 | (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1). |
| 2598 | 4) Now boot image in the same created network using nova boot image command (example given below :- |
| 2599 | 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 |
| 2600 | 5) Wait till VM boots up and starts running. |
| 2601 | 6) Verify that a VM is launched and running by using novaclient python API. |
| 2602 | 7) Create a virtual interface with vlan tag and local management floating ip on VM. |
| 2603 | 8) Create a same virtual interface with valn tag and any local management floating ip on head node. |
| 2604 | 9) Now ping to the VM from head node network which are launched a openstack service. |
| 2605 | 10) verify that ping is successful |
| 2606 | 11) Verify that flow is being added in ovs-switch in compute-node. |
| 2607 | 12) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 2608 | 13) Verify that cord-onos pushed flows to OVS switch. |
| 2609 | 14) Restart the VM in service and repeat steps 9 to 13. |
| 2610 | """ |
| 2611 | pass |
| 2612 | |
| 2613 | def test_cordvtn_creating_virtual_vlan_interface_floating_local_management_network_and_boot_image_connectivity_after_restarting_cord_onos(self): |
| 2614 | |
| 2615 | """ |
| 2616 | Algo: |
| 2617 | 1) Validate that required openstack service is up and running. |
| 2618 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 2619 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network. |
| 2620 | (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1). |
| 2621 | 4) Now boot image in the same created network using nova boot image command (example given below :- |
| 2622 | 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 |
| 2623 | 5) Wait till VM boots up and starts running. |
| 2624 | 6) Verify that a VM is launched and running by using novaclient python API. |
| 2625 | 7) Create a virtual interface with vlan tag and local management floating ip on VM. |
| 2626 | 8) Create a same virtual interface with valn tag and any local management floating ip on head node. |
| 2627 | 9) Now ping to the VM from head node network which are launched a openstack service. |
| 2628 | 10) verify that ping is successful |
| 2629 | 11) Verify that flow is being added in ovs-switch in compute-node. |
| 2630 | 12) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 2631 | 13) Verify that cord-onos pushed flows to OVS switch. |
| 2632 | 14) Restart the ONOS service and repeat steps 9 to 13. |
| 2633 | """ |
| 2634 | pass |
| 2635 | |
| 2636 | def test_cordvtn_creating_virtual_vlan_interface_floating_local_management_network_and_boot_image_connectivity_after_delete_and_recreate_VM(self): |
| 2637 | """ |
| 2638 | Algo: |
| 2639 | 1) Validate that required openstack service is up and running. |
| 2640 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 2641 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network. |
| 2642 | (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1). |
| 2643 | 4) Now boot image in the same created network using nova boot image command (example given below :- |
| 2644 | 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 |
| 2645 | 5) Wait till VM boots up and starts running. |
| 2646 | 6) Verify that a VM is launched and running by using novaclient python API. |
| 2647 | 7) Create a virtual interface with vlan tag and local management floating ip on VM. |
| 2648 | 8) Create a same virtual interface with valn tag and any local management floating ip on head node. |
| 2649 | 9) Now ping to the VM from head node network which are launched a openstack service. |
| 2650 | 10) verify that ping is successful |
| 2651 | 11) Verify that flow is being added in ovs-switch in compute-node. |
| 2652 | 12) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 2653 | 13) Verify that cord-onos pushed flows to OVS switch. |
| 2654 | 14) Delete and re-create a VM in service and repeat steps 9 to 13. |
| 2655 | """ |
| 2656 | pass |
| 2657 | |
| 2658 | def test_cordvtn_creating_virtual_vlan_interface_floating_local_management_network_and_boot_image_connectivity_after_delete_and_add_br_int_bridge(self): |
| 2659 | |
| 2660 | """ |
| 2661 | Algo: |
| 2662 | 1) Validate that required openstack service is up and running. |
| 2663 | 2) Validate that compute node is being created and get compute node name by using "sudo cord prov list". |
| 2664 | 3) From CORD-Test container, use python-neutron client and create network with name - NetA with an IP as local management network. |
| 2665 | (neutron net-create net-A-management, neutron subnet-create net-A-management 172.27.0.0/24 -gateway 172.27.0.1). |
| 2666 | 4) Now boot image in the same created network using nova boot image command (example given below :- |
| 2667 | 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 |
| 2668 | 5) Wait till VM boots up and starts running. |
| 2669 | 6) Verify that a VM is launched and running by using novaclient python API. |
| 2670 | 7) Create a virtual interface with vlan tag and local management floating ip on VM. |
| 2671 | 8) Create a same virtual interface with valn tag and any local management floating ip on head node. |
| 2672 | 9) Now ping to the VM from head node network which are launched a openstack service. |
| 2673 | 10) verify that ping is successful |
| 2674 | 11) Verify that flow is being added in ovs-switch in compute-node. |
| 2675 | 12) Verify that onos-ml2 plugin syncs through ReST call from openstack service neutron. |
| 2676 | 13) Verify that cord-onos pushed flows to OVS switch. |
| 2677 | 14) Delete a br_int bridge and repeat steps 9 to 13, (it should not ping) |
| 2678 | 15) Add br_int bridge and repeat steps 9 to 13, (it should ping) |
| 2679 | """ |
| 2680 | pass |