[Tempest] Fix tests for pre-existing share network
Currently tempest tests do not support creating and
adding Security Service to newly created share networks.
This causes CIFS multitenancy tests to fail on some
of the backends.
Therefore, having pre-existing share network helps
testing such scenarios.
When using a pre-existing share network,
we can still test the share network API and
create share networks, however, we shouldn't
create shares on such networks.
So, any tests that create new share networks
and use them to create shares need to be skipped.
- This patch makes sure that the pre-existing
share_network is not cleaned up.
- One share_server related test is skipped
to avoid deleting share network as part of test.
- One share network negative test is skipped
to avoid creating a share with new share network.
Change-Id: I272806b05c8b4d30451d0cf4b9dd3f366b8bf728
Closes-Bug: #1698429
diff --git a/manila_tempest_tests/tests/api/base.py b/manila_tempest_tests/tests/api/base.py
index 94e496a..e81c5d4 100644
--- a/manila_tempest_tests/tests/api/base.py
+++ b/manila_tempest_tests/tests/api/base.py
@@ -423,7 +423,9 @@
cleanup_in_class=True, is_public=False, **kwargs):
client = client or cls.shares_v2_client
description = description or "Tempest's share"
- share_network_id = share_network_id or client.share_network_id or None
+ share_network_id = (share_network_id or
+ CONF.share.share_network_id or
+ client.share_network_id or None)
metadata = metadata or {}
size = size or CONF.share.share_size
kwargs.update({
@@ -905,9 +907,10 @@
elif res["type"] is "snapshot":
client.delete_snapshot(res_id)
client.wait_for_resource_deletion(snapshot_id=res_id)
- elif res["type"] is "share_network":
- client.delete_share_network(res_id)
- client.wait_for_resource_deletion(sn_id=res_id)
+ elif (res["type"] is "share_network" and
+ res_id != CONF.share.share_network_id):
+ client.delete_share_network(res_id)
+ client.wait_for_resource_deletion(sn_id=res_id)
elif res["type"] is "security_service":
client.delete_security_service(res_id)
client.wait_for_resource_deletion(ss_id=res_id)