make Patrole to run for shared network env
Devstack added to create the shared network for tempest testing
which makes sure tempest and other testing part works fine when
testing env has shared network.
- https://github.com/openstack-dev/devstack/blob/683454f319246c3bda088b5e0325c5673263ce08/lib/tempest#L259
Now patrole started failing because of the above shared network.
Details: {u'message': u'Multiple possible networks found, use a
Network ID to be more specific.', u'code': 409}
http://logs.openstack.org/55/648255/1/check/patrole-admin/63b6639/testr_results.html.gz
When patrol tests call create_tesrt_server, network id is not passed
as kwargs which means it reply on tempest to add the network id for
creating the server[1]. Tempest fail to add the network id because it
relies on used credential to have the network created for them[2].
We should create the network for requested credential using
set_network_resources() method.
Following tests are skipped due to their failure due to bad request error:
- test_update_network_provider_network_type[id-d064ef96-662b-47b6-94b7-9106dcd7ba8c]
- test_update_network_provider_physical_network[id-e3a55660-f75c-494e-a1b1-a8b36cc789ef]
- test_update_network_provider_segmentation_id[id-f6164228-b670-45fd-9ff9-b101930318c7]
[1] https://github.com/openstack/tempest/blob/75ea3dbaf9d459f6b1e72644bfa73520142e17d1/tempest/api/compute/base.py#L234
[2] https://github.com/openstack/tempest/blob/3639f91c36dbbcc8ecf9373aeb0cec83af468b81/tempest/lib/common/fixed_network.py#L95
Story: 2005369
Task: 30345
Change-Id: I1281aa090c167c1e3e401a1707d196a69e7b5cd2
diff --git a/patrole_tempest_plugin/tests/api/compute/test_server_actions_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_server_actions_rbac.py
index 5f27c9f..dfb36ca 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_server_actions_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_server_actions_rbac.py
@@ -42,6 +42,11 @@
cls.admin_servers_client = cls.os_admin.servers_client
@classmethod
+ def setup_credentials(cls):
+ cls.set_network_resources(network=True, subnet=True, router=True)
+ super(ServerActionsRbacTest, cls).setup_credentials()
+
+ @classmethod
def resource_setup(cls):
super(ServerActionsRbacTest, cls).resource_setup()
cls.server_id = cls.create_test_server(wait_until='ACTIVE')['id']
@@ -358,6 +363,11 @@
max_microversion = 'latest'
@classmethod
+ def setup_credentials(cls):
+ cls.set_network_resources(network=True, subnet=True, router=True)
+ super(ServerActionsV214RbacTest, cls).setup_credentials()
+
+ @classmethod
def resource_setup(cls):
super(ServerActionsV214RbacTest, cls).resource_setup()
cls.server_id = cls.create_test_server(wait_until='ACTIVE')['id']
@@ -390,6 +400,11 @@
max_microversion = 'latest'
@classmethod
+ def setup_credentials(cls):
+ cls.set_network_resources(network=True, subnet=True, router=True)
+ super(ServerActionsV216RbacTest, cls).setup_credentials()
+
+ @classmethod
def resource_setup(cls):
super(ServerActionsV216RbacTest, cls).resource_setup()
cls.server_id = cls.create_test_server(wait_until='ACTIVE')['id']
diff --git a/patrole_tempest_plugin/tests/api/compute/test_server_consoles_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_server_consoles_rbac.py
index 7e2693d..076ad05 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_server_consoles_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_server_consoles_rbac.py
@@ -31,6 +31,11 @@
raise cls.skipException('Console output not available.')
@classmethod
+ def setup_credentials(cls):
+ cls.set_network_resources(network=True, subnet=True, router=True)
+ super(ServerConsolesRbacTest, cls).setup_credentials()
+
+ @classmethod
def resource_setup(cls):
super(ServerConsolesRbacTest, cls).resource_setup()
cls.server_id = cls.create_test_server(wait_until='ACTIVE')['id']
@@ -55,6 +60,11 @@
raise cls.skipException('Console output not available.')
@classmethod
+ def setup_credentials(cls):
+ cls.set_network_resources(network=True, subnet=True, router=True)
+ super(ServerConsolesMaxV25RbacTest, cls).setup_credentials()
+
+ @classmethod
def resource_setup(cls):
super(ServerConsolesMaxV25RbacTest, cls).resource_setup()
cls.server_id = cls.create_test_server(wait_until='ACTIVE')['id']
@@ -80,6 +90,11 @@
raise cls.skipException('Console output not available.')
@classmethod
+ def setup_credentials(cls):
+ cls.set_network_resources(network=True, subnet=True, router=True)
+ super(ServerConsolesV26RbacTest, cls).setup_credentials()
+
+ @classmethod
def resource_setup(cls):
super(ServerConsolesV26RbacTest, cls).resource_setup()
cls.server_id = cls.create_test_server(wait_until='ACTIVE')['id']
diff --git a/patrole_tempest_plugin/tests/api/compute/test_server_metadata_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_server_metadata_rbac.py
index 07201fc..55536ad 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_server_metadata_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_server_metadata_rbac.py
@@ -22,6 +22,11 @@
class ServerMetadataRbacTest(rbac_base.BaseV2ComputeRbacTest):
@classmethod
+ def setup_credentials(cls):
+ cls.set_network_resources(network=True, subnet=True, router=True)
+ super(ServerMetadataRbacTest, cls).setup_credentials()
+
+ @classmethod
def resource_setup(cls):
super(ServerMetadataRbacTest, cls).resource_setup()
cls.server = cls.create_test_server(metadata={}, wait_until='ACTIVE')
diff --git a/patrole_tempest_plugin/tests/api/compute/test_server_misc_policy_actions_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_server_misc_policy_actions_rbac.py
index 1e07758..d1e896b 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_server_misc_policy_actions_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_server_misc_policy_actions_rbac.py
@@ -51,6 +51,11 @@
credentials = ['primary', 'admin']
@classmethod
+ def setup_credentials(cls):
+ cls.set_network_resources(network=True, subnet=True, router=True)
+ super(MiscPolicyActionsRbacTest, cls).setup_credentials()
+
+ @classmethod
def resource_setup(cls):
super(MiscPolicyActionsRbacTest, cls).resource_setup()
cls.server = cls.create_test_server(wait_until='ACTIVE')
diff --git a/patrole_tempest_plugin/tests/api/compute/test_server_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_server_rbac.py
index a5968ea..8592e12 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_server_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_server_rbac.py
@@ -33,6 +33,11 @@
class ComputeServersRbacTest(base.BaseV2ComputeRbacTest):
@classmethod
+ def setup_credentials(cls):
+ cls.set_network_resources(network=True, subnet=True, router=True)
+ super(ComputeServersRbacTest, cls).setup_credentials()
+
+ @classmethod
def setup_clients(cls):
super(ComputeServersRbacTest, cls).setup_clients()
cls.networks_client = cls.os_primary.networks_client
diff --git a/patrole_tempest_plugin/tests/api/compute/test_server_tags_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_server_tags_rbac.py
index f1c08c5..8a386f6 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_server_tags_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_server_tags_rbac.py
@@ -34,6 +34,11 @@
raise cls.skipException(msg)
@classmethod
+ def setup_credentials(cls):
+ cls.set_network_resources(network=True, subnet=True, router=True)
+ super(ServerTagsRbacTest, cls).setup_credentials()
+
+ @classmethod
def resource_setup(cls):
super(ServerTagsRbacTest, cls).resource_setup()
cls.server = cls.create_test_server(wait_until='ACTIVE')
diff --git a/patrole_tempest_plugin/tests/api/compute/test_server_volume_attachments_rbac.py b/patrole_tempest_plugin/tests/api/compute/test_server_volume_attachments_rbac.py
index c34a437..c5fbef6 100644
--- a/patrole_tempest_plugin/tests/api/compute/test_server_volume_attachments_rbac.py
+++ b/patrole_tempest_plugin/tests/api/compute/test_server_volume_attachments_rbac.py
@@ -37,6 +37,11 @@
class ServerVolumeAttachmentRbacTest(rbac_base.BaseV2ComputeRbacTest):
@classmethod
+ def setup_credentials(cls):
+ cls.set_network_resources(network=True, subnet=True, router=True)
+ super(ServerVolumeAttachmentRbacTest, cls).setup_credentials()
+
+ @classmethod
def setup_clients(cls):
super(ServerVolumeAttachmentRbacTest, cls).setup_clients()
cls.volumes_client = cls.os_primary.volumes_client_latest
diff --git a/patrole_tempest_plugin/tests/api/network/test_networks_rbac.py b/patrole_tempest_plugin/tests/api/network/test_networks_rbac.py
index 9c715b5..56ce83b 100644
--- a/patrole_tempest_plugin/tests/api/network/test_networks_rbac.py
+++ b/patrole_tempest_plugin/tests/api/network/test_networks_rbac.py
@@ -256,6 +256,7 @@
with self.override_role():
self._update_network(net_id=network['id'], router_external=True)
+ @decorators.skip_because(bug='2005489', bug_type='storyboard')
@utils.requires_ext(extension='provider', service='network')
@rbac_rule_validation.action(
service="neutron",
@@ -281,6 +282,7 @@
"Plugin does not support updating provider attributes",
str(exc))
+ @decorators.skip_because(bug='2005489', bug_type='storyboard')
@utils.requires_ext(extension='provider', service='network')
@rbac_rule_validation.action(
service="neutron",
@@ -306,6 +308,7 @@
"Plugin does not support updating provider attributes",
str(exc))
+ @decorators.skip_because(bug='2005489', bug_type='storyboard')
@utils.requires_ext(extension='provider', service='network')
@rbac_rule_validation.action(
service="neutron",
diff --git a/patrole_tempest_plugin/tests/api/volume/test_volume_actions_rbac.py b/patrole_tempest_plugin/tests/api/volume/test_volume_actions_rbac.py
index 079d5b4..497c8ce 100644
--- a/patrole_tempest_plugin/tests/api/volume/test_volume_actions_rbac.py
+++ b/patrole_tempest_plugin/tests/api/volume/test_volume_actions_rbac.py
@@ -37,13 +37,22 @@
cls.image_client = cls.os_primary.image_client_v2
@classmethod
+ def setup_credentials(cls):
+ cls.set_network_resources(network=True, subnet=True, router=True)
+ super(VolumesActionsV3RbacTest, cls).setup_credentials()
+
+ @classmethod
def resource_setup(cls):
super(VolumesActionsV3RbacTest, cls).resource_setup()
cls.volume = cls.create_volume()
def _create_server(self):
+ tenant_network = self.get_tenant_network()
server, _ = compute.create_test_server(
- self.os_primary, wait_until='ACTIVE')
+ self.os_primary, tenant_network=tenant_network,
+ wait_until='ACTIVE')
+ self.addCleanup(waiters.wait_for_server_termination,
+ self.servers_client, server['id'])
self.addCleanup(test_utils.call_and_ignore_notfound_exc,
self.servers_client.delete_server, server['id'])
return server