Browse Source

Merge "[Tempest] Fix tests for pre-existing share network" into stable/ocata

Zuul 10 months ago
parent
commit
a0d23e55ab

+ 3
- 0
manila_tempest_tests/tests/api/admin/test_share_servers.py View File

@@ -195,6 +195,9 @@ class ShareServersAdminTest(base.BaseSharesAdminTest):
195 195
 
196 196
     @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
197 197
     @ddt.data(True, False)
198
+    @testtools.skipIf(CONF.share.share_network_id != "",
199
+                      "This test is not suitable for pre-existing "
200
+                      "share_network.")
198 201
     def test_delete_share_server(self, delete_share_network):
199 202
         # Get network and subnet from existing share_network and reuse it
200 203
         # to be able to delete share_server after test ends.

+ 7
- 4
manila_tempest_tests/tests/api/base.py View File

@@ -406,7 +406,9 @@ class BaseSharesTest(test.BaseTestCase):
406 406
                       cleanup_in_class=True, is_public=False, **kwargs):
407 407
         client = client or cls.shares_v2_client
408 408
         description = description or "Tempest's share"
409
-        share_network_id = share_network_id or client.share_network_id or None
409
+        share_network_id = (share_network_id or
410
+                            CONF.share.share_network_id or
411
+                            client.share_network_id or None)
410 412
         metadata = metadata or {}
411 413
         size = size or CONF.share.share_size
412 414
         kwargs.update({
@@ -885,9 +887,10 @@ class BaseSharesTest(test.BaseTestCase):
885 887
                     elif res["type"] is "snapshot":
886 888
                         client.delete_snapshot(res_id)
887 889
                         client.wait_for_resource_deletion(snapshot_id=res_id)
888
-                    elif res["type"] is "share_network":
889
-                        client.delete_share_network(res_id)
890
-                        client.wait_for_resource_deletion(sn_id=res_id)
890
+                    elif (res["type"] is "share_network" and
891
+                            res_id != CONF.share.share_network_id):
892
+                            client.delete_share_network(res_id)
893
+                            client.wait_for_resource_deletion(sn_id=res_id)
891 894
                     elif res["type"] is "security_service":
892 895
                         client.delete_security_service(res_id)
893 896
                         client.wait_for_resource_deletion(ss_id=res_id)

+ 3
- 0
manila_tempest_tests/tests/api/test_share_networks_negative.py View File

@@ -111,6 +111,9 @@ class ShareNetworksNegativeTest(base.BaseSharesTest):
111 111
     @testtools.skipIf(not CONF.share.multitenancy_enabled,
112 112
                       'Can run only with drivers that do handle share servers '
113 113
                       'creation. Skipping.')
114
+    @testtools.skipIf(CONF.share.share_network_id != "",
115
+                      "This test is not suitable for pre-existing "
116
+                      "share_network.")
114 117
     def test_try_delete_share_network_with_existing_shares(self):
115 118
         # Get valid network data for successful share creation
116 119
         share_network = self.shares_client.get_share_network(

Loading…
Cancel
Save