summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgy Dyuldin <g.dyuldin@gmail.com>2017-04-14 18:09:00 +0300
committerGeorgy Dyuldin <g.dyuldin@gmail.com>2017-04-14 18:09:00 +0300
commitd2e3ea940731c0cf8161aff36935e0b1209f9378 (patch)
tree586baadd7e65089d99585d4589ad5d40f76608fc
parent35c6eef7b8f24b8ad29f022d615b94f65813f583 (diff)
Fix some tests failures on baremetal contrail lab
Notes
Notes (review): Verified+1: Plugins CI <plugins.ci@mirantis.com> Code-Review+2: okosse <okosse@mirantis.com> Workflow+1: okosse <okosse@mirantis.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Fri, 14 Apr 2017 15:14:32 +0000 Reviewed-on: https://review.openstack.org/456917 Project: openstack/fuel-plugin-contrail Branch: refs/heads/master
-rw-r--r--plugin_test/vapor/vapor/fixtures/skip.py13
-rw-r--r--plugin_test/vapor/vapor/helpers/dpdk.py2
-rw-r--r--plugin_test/vapor/vapor/settings.py6
-rw-r--r--plugin_test/vapor/vapor/tests/common/test_base.py38
-rw-r--r--plugin_test/vapor/vapor/tests/common/test_security_group.py1
-rw-r--r--plugin_test/vapor/vapor/tests/common/test_sg_policy.py5
-rw-r--r--plugin_test/vapor/vapor/tests/test_dpdk.py5
-rw-r--r--plugin_test/vapor/vapor/tests/test_system.py1
8 files changed, 48 insertions, 23 deletions
diff --git a/plugin_test/vapor/vapor/fixtures/skip.py b/plugin_test/vapor/vapor/fixtures/skip.py
index 8fd50ff..0d53278 100644
--- a/plugin_test/vapor/vapor/fixtures/skip.py
+++ b/plugin_test/vapor/vapor/fixtures/skip.py
@@ -14,6 +14,7 @@ import pytest
14import six 14import six
15from stepler.fixtures import skip 15from stepler.fixtures import skip
16 16
17from vapor.helpers import dpdk
17from vapor.helpers import sriov 18from vapor.helpers import sriov
18from vapor import settings 19from vapor import settings
19 20
@@ -45,6 +46,18 @@ class Predicates(skip.Predicates):
45 46
46 @property 47 @property
47 @_store_call 48 @_store_call
49 def dpdk_enabled(self):
50 """Define whether dpdk enabled at least on one node."""
51 os_faults_steps = self._get_fixture('os_faults_steps')
52 computes = self._get_fixture('computes')
53 dpdk_devices = dpdk.get_devices(os_faults_steps, computes)
54 for devices_groups in dpdk_devices.values():
55 if len(devices_groups[settings.DPDK_ENABLED_GROUP]) > 0:
56 return True
57 return False
58
59 @property
60 @_store_call
48 def contrail_control_nodes_count(self): 61 def contrail_control_nodes_count(self):
49 """Return contrail control nodes count.""" 62 """Return contrail control nodes count."""
50 return len(settings.CONTRAIL_ROLES_DISTRIBUTION[ 63 return len(settings.CONTRAIL_ROLES_DISTRIBUTION[
diff --git a/plugin_test/vapor/vapor/helpers/dpdk.py b/plugin_test/vapor/vapor/helpers/dpdk.py
index 4fd13ea..1cf73df 100644
--- a/plugin_test/vapor/vapor/helpers/dpdk.py
+++ b/plugin_test/vapor/vapor/helpers/dpdk.py
@@ -21,7 +21,7 @@ from vapor import settings
21 21
22def get_devices(os_faults_steps, nodes): 22def get_devices(os_faults_steps, nodes):
23 result = os_faults_steps.execute_cmd( 23 result = os_faults_steps.execute_cmd(
24 nodes, '{} --status'.format(settings.DPDK_NEC_BIND_PATH), check=False) 24 nodes, '{} --status'.format(settings.DPDK_NEC_BIND_CMD), check=False)
25 node_statuses = {} 25 node_statuses = {}
26 for node_result in result: 26 for node_result in result:
27 node = nodes_steps.get_node_by_result(node_result, os_faults_steps) 27 node = nodes_steps.get_node_by_result(node_result, os_faults_steps)
diff --git a/plugin_test/vapor/vapor/settings.py b/plugin_test/vapor/vapor/settings.py
index 2fcf1aa..e766682 100644
--- a/plugin_test/vapor/vapor/settings.py
+++ b/plugin_test/vapor/vapor/settings.py
@@ -192,10 +192,10 @@ SERVER_ATTR_HYPERVISOR_HOSTNAME = 'OS-EXT-SRV-ATTR:hypervisor_hostname'
192 192
193NEUTRON_SRIOV_NIC_AGENT = "neutron-sriov-nic-agent" 193NEUTRON_SRIOV_NIC_AGENT = "neutron-sriov-nic-agent"
194 194
195DPDK_NEC_BIND_PATH = '/opt/contrail/bin/dpdk_nic_bind.py' 195DPDK_NEC_BIND_CMD = 'curl https://raw.githubusercontent.com/Juniper/contrail-dpdk/master/tools/dpdk_nic_bind.py 2>/dev/null | python -' # noqa
196 196
197# SR-IOV 197# SR-IOV
198SRIOV_PHYSNET = 'physnet1' 198SRIOV_PHYSNET = os.environ.get('SRIOV_PHYSNET', 'physnet1')
199 199
200# Security groups 200# Security groups
201INGRESS = 'ingress' 201INGRESS = 'ingress'
@@ -217,3 +217,5 @@ SECURITY_GROUP_PING_RULES = [
217 217
218SECURITY_GROUP_SSH_PING_RULES = (stepler_config.SECURITY_GROUP_SSH_RULES + 218SECURITY_GROUP_SSH_PING_RULES = (stepler_config.SECURITY_GROUP_SSH_RULES +
219 SECURITY_GROUP_PING_RULES) 219 SECURITY_GROUP_PING_RULES)
220
221DPDK_ENABLED_GROUP = u'Network devices using DPDK-compatible driver'
diff --git a/plugin_test/vapor/vapor/tests/common/test_base.py b/plugin_test/vapor/vapor/tests/common/test_base.py
index 5fde6cf..eb95ccf 100644
--- a/plugin_test/vapor/vapor/tests/common/test_base.py
+++ b/plugin_test/vapor/vapor/tests/common/test_base.py
@@ -56,9 +56,8 @@ def test_create_vm_bulk(net_subnet_router, tiny_flavor,
56 56
57 57
58def test_delete_vm_with_associated_vn(contrail_network, contrail_subnet, 58def test_delete_vm_with_associated_vn(contrail_network, contrail_subnet,
59 tiny_flavor, cirros_image, 59 flavor, cirros_image, server_steps,
60 server_steps, network_steps, 60 network_steps, contrail_api_client):
61 contrail_api_client):
62 """Description: Test to validate that VN cannot be deleted if 61 """Description: Test to validate that VN cannot be deleted if
63 there is a VM associated with it. 62 there is a VM associated with it.
64 Test steps: 63 Test steps:
@@ -69,13 +68,20 @@ def test_delete_vm_with_associated_vn(contrail_network, contrail_subnet,
69 The attempt to delete VN should fail. 68 The attempt to delete VN should fail.
70 """ 69 """
71 server_steps.create_servers( 70 server_steps.create_servers(
72 image=cirros_image, flavor=tiny_flavor, 71 image=cirros_image,
73 nics=[{'net-id': contrail_network.uuid}]) 72 flavor=flavor,
73 nics=[{
74 'net-id': contrail_network.uuid
75 }])
76
74 net = network_steps.get_network(id=contrail_network.uuid) 77 net = network_steps.get_network(id=contrail_network.uuid)
75 78
79 neutron_client = network_steps._client._rest_client
76 # Check that we can't delete this net. 80 # Check that we can't delete this net.
77 assert_that(calling(network_steps.delete).with_args(net), 81 assert_that(
78 raises(neutron_exceptions.NetworkInUseClient)) 82 calling(neutron_client.delete_network).with_args(
83 contrail_network.uuid),
84 raises(neutron_exceptions.NetworkInUseClient))
79 85
80 # Check that network is still there 86 # Check that network is still there
81 # via contrail API 87 # via contrail API
@@ -84,8 +90,8 @@ def test_delete_vm_with_associated_vn(contrail_network, contrail_subnet,
84 has_item(has_entry('uuid', contrail_network.uuid))) 90 has_item(has_entry('uuid', contrail_network.uuid)))
85 91
86 # via neutron API 92 # via neutron API
87 assert_that(network_steps.get_network_by_name(net['name']), 93 assert_that(
88 is_not(empty())) 94 network_steps.get_network_by_name(net['name']), is_not(empty()))
89 95
90 96
91def test_two_nets_same_name(contrail_api_client, contrail_network, 97def test_two_nets_same_name(contrail_api_client, contrail_network,
@@ -234,9 +240,10 @@ def test_create_server_on_exhausted_subnet(cirros_image, flavor, network,
234 '(Exceeded maximum number of retries)')) 240 '(Exceeded maximum number of retries)'))
235 241
236 242
237def test_file_transfer_with_scp( 243def test_file_transfer_with_scp(ubuntu_xenial_image, keypair, flavor,
238 ubuntu_image, keypair, flavor, create_floating_ip, public_network, 244 create_floating_ip, public_network, network,
239 network, subnet, security_group, server_steps, port_steps): 245 subnet, security_group, port_steps,
246 server_steps):
240 """Validate File Transfer using scp between VMs. 247 """Validate File Transfer using scp between VMs.
241 248
242 Steps: 249 Steps:
@@ -262,7 +269,9 @@ def test_file_transfer_with_scp(
262 "chmod 600 {path}", 269 "chmod 600 {path}",
263 "echo {done_marker}", 270 "echo {done_marker}",
264 ]).format( 271 ]).format(
265 content=key_content, path=key_path, user=username, 272 content=key_content,
273 path=key_path,
274 user=username,
266 done_marker=stepler_config.USERDATA_DONE_MARKER) 275 done_marker=stepler_config.USERDATA_DONE_MARKER)
267 276
268 ssh_opts = ('-o UserKnownHostsFile=/dev/null ' 277 ssh_opts = ('-o UserKnownHostsFile=/dev/null '
@@ -271,7 +280,7 @@ def test_file_transfer_with_scp(
271 # Boot servers 280 # Boot servers
272 servers = server_steps.create_servers( 281 servers = server_steps.create_servers(
273 count=2, 282 count=2,
274 image=ubuntu_image, 283 image=ubuntu_xenial_image,
275 flavor=flavor, 284 flavor=flavor,
276 networks=[network], 285 networks=[network],
277 security_groups=[security_group], 286 security_groups=[security_group],
@@ -435,7 +444,6 @@ def test_vm_multi_intf_in_same_vn_chk_ping(
435 ip, server_ssh, timeout=stepler_config.PING_CALL_TIMEOUT) 444 ip, server_ssh, timeout=stepler_config.PING_CALL_TIMEOUT)
436 445
437 446
438@pytest.mark.parametrize('flavor', [dict(ram=128, disk=1)], indirect=True)
439def test_create_multiple_servers_on_many_networks( 447def test_create_multiple_servers_on_many_networks(
440 cirros_image, flavor, create_network, create_subnet, server_steps): 448 cirros_image, flavor, create_network, create_subnet, server_steps):
441 """Validate creation of multiple VN with multiple subnet and VMs in it. 449 """Validate creation of multiple VN with multiple subnet and VMs in it.
diff --git a/plugin_test/vapor/vapor/tests/common/test_security_group.py b/plugin_test/vapor/vapor/tests/common/test_security_group.py
index c5def65..88595e8 100644
--- a/plugin_test/vapor/vapor/tests/common/test_security_group.py
+++ b/plugin_test/vapor/vapor/tests/common/test_security_group.py
@@ -304,6 +304,7 @@ def test_security_group_rules_uuid_in_contrail_and_neutron(contrail_api_client,
304 assert_that(contrail_rules_uuids, equal_to(neutron_rules_uuids)) 304 assert_that(contrail_rules_uuids, equal_to(neutron_rules_uuids))
305 305
306 306
307@pytest.mark.requires('not dpdk_enabled')
307@pytest.mark.parametrize( 308@pytest.mark.parametrize(
308 'contrail_2_servers_different_networks', [dict(ubuntu=True)], 309 'contrail_2_servers_different_networks', [dict(ubuntu=True)],
309 indirect=True, 310 indirect=True,
diff --git a/plugin_test/vapor/vapor/tests/common/test_sg_policy.py b/plugin_test/vapor/vapor/tests/common/test_sg_policy.py
index f643cb4..ecc2428 100644
--- a/plugin_test/vapor/vapor/tests/common/test_sg_policy.py
+++ b/plugin_test/vapor/vapor/tests/common/test_sg_policy.py
@@ -223,8 +223,9 @@ def test_security_group_and_allow_all_policy(
223 ids=['tcp_all', 'tcp_port']) 223 ids=['tcp_all', 'tcp_port'])
224def test_allow_all_security_group_and_policies( 224def test_allow_all_security_group_and_policies(
225 contrail_network_policy, security_group, 225 contrail_network_policy, security_group,
226 neutron_security_group_rule_steps, connectivity_test_resources, 226 neutron_security_group_rule_steps, server_steps,
227 server_steps, contrail_api_client, policy_entries, checks): 227 connectivity_test_resources, contrail_api_client, policy_entries,
228 checks):
228 """Verify traffic restrictions by policy with security group. 229 """Verify traffic restrictions by policy with security group.
229 230
230 Steps: 231 Steps:
diff --git a/plugin_test/vapor/vapor/tests/test_dpdk.py b/plugin_test/vapor/vapor/tests/test_dpdk.py
index 14e2b58..fc95917 100644
--- a/plugin_test/vapor/vapor/tests/test_dpdk.py
+++ b/plugin_test/vapor/vapor/tests/test_dpdk.py
@@ -38,8 +38,7 @@ def test_bound_network_interfaces(os_faults_steps, computes):
38 devices = dpdk.get_devices(os_faults_steps, computes) 38 devices = dpdk.get_devices(os_faults_steps, computes)
39 assert_that(devices.values(), 39 assert_that(devices.values(),
40 only_contains( 40 only_contains(
41 has_entries('Network devices using DPDK-compatible driver', 41 has_entries(settings.DPDK_ENABLED_GROUP, is_not(empty()))))
42 is_not(empty()))))
43 42
44 43
45def test_huge_pages_usage(os_faults_steps, computes): 44def test_huge_pages_usage(os_faults_steps, computes):
@@ -71,7 +70,7 @@ def test_contrail_vrouter_dpdk_cpu_usage(os_faults_steps, computes):
71 70
72 71
73@pytest.mark.parametrize( 72@pytest.mark.parametrize(
74 'flavor', [dict(metadata={"hw:mem_page_size": "small"})], indirect=True) 73 'flavor', [dict(ram=1024, metadata={"hw:mem_page_size": "large"})], indirect=True)
75@pytest.mark.usefixtures('flavor') 74@pytest.mark.usefixtures('flavor')
76def test_vrouter_create_interface(request, os_faults_steps, computes): 75def test_vrouter_create_interface(request, os_faults_steps, computes):
77 """Verify if vRouter creates interface after creation of a virtual machine. 76 """Verify if vRouter creates interface after creation of a virtual machine.
diff --git a/plugin_test/vapor/vapor/tests/test_system.py b/plugin_test/vapor/vapor/tests/test_system.py
index 46f73c7..40e2a24 100644
--- a/plugin_test/vapor/vapor/tests/test_system.py
+++ b/plugin_test/vapor/vapor/tests/test_system.py
@@ -29,6 +29,7 @@ from vapor.helpers import policy
29from vapor import settings 29from vapor import settings
30 30
31 31
32@pytest.mark.requires('not dpdk_enabled')
32def test_no_connectivity_between_vms_in_different_tenants( 33def test_no_connectivity_between_vms_in_different_tenants(
33 request, contrail_api_client, os_faults_steps): 34 request, contrail_api_client, os_faults_steps):
34 """Check no connectivity between VMs in different tenants. 35 """Check no connectivity between VMs in different tenants.