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