Fix Manila tempest tests
Remove test_share_export_locations since export locations format
depends on driver. For Generic driver different IPs are expected
in this case, for LVMDriver - same IPs.
Fix setup for ShareRulesTest class. Move all code from 'setUp' to
'resource_setup' method. Use shares_v2_client instead of shares_client
of BaseSharesTest.
Closes-bug: #1534173
Change-Id: Ie0472a061137c1cf28685766150addd5b0722484
diff --git a/manila_tempest_tests/tests/api/admin/test_multi_backend.py b/manila_tempest_tests/tests/api/admin/test_multi_backend.py
index 23fe1ae..25f4b6d 100644
--- a/manila_tempest_tests/tests/api/admin/test_multi_backend.py
+++ b/manila_tempest_tests/tests/api/admin/test_multi_backend.py
@@ -81,26 +81,6 @@
self.assertEqual(get["share_type_name"], self.sts[i]["name"])
@test.attr(type=["gate", ])
- def test_share_export_locations(self):
- # Different backends have different IPs on interfaces
- # and export locations should be different too.
- if CONF.share.backend_names[0] == CONF.share.backend_names[1]:
- raise self.skipException("Share backends "
- "configured with same name. Skipping.")
- ips = []
- for share in self.shares:
- get = self.shares_client.get_share(share['id'])
- if get["share_proto"].lower() == "nfs":
- # %ip%:/%share_path%
- ip = get["export_location"].split(":")[0]
- ips.append(ip)
- elif get["share_proto"].lower() == "cifs":
- # //%ip%/%share_path%
- ip = get["export_location"][2:].split("/")[0]
- ips.append(ip)
- self.assertNotEqual(ips[0], ips[1])
-
- @test.attr(type=["gate", ])
def test_share_backend_name_distinction(self):
# Different share backends should have different host records
if CONF.share.backend_names[0] == CONF.share.backend_names[1]:
diff --git a/manila_tempest_tests/tests/api/test_rules.py b/manila_tempest_tests/tests/api/test_rules.py
index 5336127..0399d27 100644
--- a/manila_tempest_tests/tests/api/test_rules.py
+++ b/manila_tempest_tests/tests/api/test_rules.py
@@ -230,28 +230,20 @@
for p in cls.protocols)):
cls.message = "Rule tests are disabled"
raise cls.skipException(cls.message)
- cls.share = cls.create_share()
-
- def setUp(self):
- # Here we choose protocol and rule type for
- # testing common rules functionality,
- # that isn't dependent on protocol or rule type.
- super(ShareRulesTest, self).setUp()
if CONF.share.enable_ip_rules_for_protocols:
- self.access_type = "ip"
- self.access_to = "8.8.8.8"
- protocol = CONF.share.enable_ip_rules_for_protocols[0]
+ cls.protocol = CONF.share.enable_ip_rules_for_protocols[0]
+ cls.access_type = "ip"
+ cls.access_to = "8.8.8.8"
elif CONF.share.enable_user_rules_for_protocols:
- self.access_type = "user"
- self.access_to = CONF.share.username_for_user_rules
- protocol = CONF.share.enable_user_rules_for_protocols[0]
+ cls.protocol = CONF.share.enable_user_rules_for_protocols[0]
+ cls.access_type = "user"
+ cls.access_to = CONF.share.username_for_user_rules
elif CONF.share.enable_cert_rules_for_protocols:
- self.access_type = "cert"
- self.access_to = "client3.com"
- protocol = CONF.share.enable_cert_rules_for_protocols[0]
- else:
- raise self.skipException(self.message)
- self.shares_client.protocol = protocol
+ cls.protocol = CONF.share.enable_cert_rules_for_protocols[0]
+ cls.access_type = "cert"
+ cls.access_to = "client3.com"
+ cls.shares_v2_client.share_protocol = cls.protocol
+ cls.share = cls.create_share()
@test.attr(type=["gate", ])
def test_list_access_rules(self):