Browse Source

Fix SRIOV test

Change-Id: I9ebd5d0ffed382c49a2e43dae67a4ac29b47ac38
Georgy Dyuldin 2 years ago
parent
commit
cbf56e3f77
2 changed files with 10 additions and 4 deletions
  1. 1
    0
      plugin_test/vapor/vapor/settings.py
  2. 9
    4
      plugin_test/vapor/vapor/tests/test_sriov.py

+ 1
- 0
plugin_test/vapor/vapor/settings.py View File

@@ -196,6 +196,7 @@ DPDK_NEC_BIND_CMD = 'curl https://raw.githubusercontent.com/Juniper/contrail-dpd
196 196
 
197 197
 # SR-IOV
198 198
 SRIOV_PHYSNET = os.environ.get('SRIOV_PHYSNET', 'physnet1')
199
+SEGMENTATION_ID = int(os.environ.get('SEGMENTATION_ID', 2426))
199 200
 
200 201
 # Security groups
201 202
 INGRESS = 'ingress'

+ 9
- 4
plugin_test/vapor/vapor/tests/test_sriov.py View File

@@ -24,7 +24,7 @@ pytestmark = pytest.mark.requires('sriov_enabled')
24 24
 def test_virtual_function_exhaustion_and_reuse(
25 25
         ubuntu_xenial_image, flavor, network, subnet, net_subnet_router,
26 26
         neutron_security_group, floating_ip, keypair, create_network,
27
-        create_subnet, create_port, os_faults_steps, computes,
27
+        create_subnet, create_port, os_faults_steps, port_steps, computes,
28 28
         floating_ip_steps, server_steps, nova_availability_zone_hosts):
29 29
     """Verify Nova can schedule VM to all the VF of a PF.
30 30
 
@@ -61,12 +61,15 @@ def test_virtual_function_exhaustion_and_reuse(
61 61
     kwargs = {
62 62
         'provider:network_type': 'vlan',
63 63
         'provider:physical_network': settings.SRIOV_PHYSNET,
64
-        'provider:segmentation_id': 200
64
+        'provider:segmentation_id': settings.SEGMENTATION_ID
65 65
     }
66 66
     sriov_net_name, = utils.generate_ids()
67 67
     sriov_net = create_network(sriov_net_name, **kwargs)
68 68
     create_subnet(
69
-        sriov_net_name + '__subnet', sriov_net, cidr="10.200.54.0/24")
69
+        sriov_net_name + '__subnet',
70
+        sriov_net,
71
+        cidr="10.200.54.0/24",
72
+        gateway_ip=None)
70 73
 
71 74
     # Create servers
72 75
     servers = []
@@ -79,14 +82,16 @@ def test_virtual_function_exhaustion_and_reuse(
79 82
         flavor=flavor,
80 83
         availability_zone='nova:{}'.format(compute_host),
81 84
         keypair=keypair,
85
+        security_groups=[neutron_security_group],
82 86
         username=stepler_config.UBUNTU_USERNAME)
87
+
83 88
     for i in range(numvfs):
84 89
         sriov_port = create_port(sriov_net, **sriov_port_kwargs)
85 90
         ports = [sriov_port]
86 91
         if i == 0:
87 92
             mgmt_port = create_port(
88 93
                 network, security_groups=[neutron_security_group['id']])
89
-            ports.insert(0, mgmt_port)
94
+            ports.append(mgmt_port)
90 95
         server = server_steps.create_servers(
91 96
             ports=ports, **server_create_args)[0]
92 97
         servers.append(server)

Loading…
Cancel
Save