Merge "Delete Share Instance of unmanaged share"
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/admin/test_services_negative.py b/manila_tempest_tests/tests/api/admin/test_services_negative.py
index 07914d3..a229c45 100644
--- a/manila_tempest_tests/tests/api/admin/test_services_negative.py
+++ b/manila_tempest_tests/tests/api/admin/test_services_negative.py
@@ -47,7 +47,13 @@
         # so do not take it in account.
         for service in services + services_fake:
             service["updated_at"] = "removed_possible_difference"
-        self.assertEqual(services, services_fake)
+
+        msg = ('Unexpected service list. Expected %s, got %s.' %
+               (services, services_fake))
+        self.assertEqual(sorted(services, key=lambda service: service['id']),
+                         sorted(services_fake,
+                                key=lambda service: service['id']),
+                         msg)
 
     @test.attr(type=["gate", "smoke", "negative", ])
     def test_get_service_by_invalid_host(self):
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):
diff --git a/manila_tempest_tests/tests/api/test_shares_actions.py b/manila_tempest_tests/tests/api/test_shares_actions.py
index 36fd6e5..42a7589 100644
--- a/manila_tempest_tests/tests/api/test_shares_actions.py
+++ b/manila_tempest_tests/tests/api/test_shares_actions.py
@@ -473,12 +473,19 @@
         new_size = 2
 
         # extend share and wait for active status
-        self.shares_client.extend_share(share['id'], new_size)
+        self.shares_v2_client.extend_share(share['id'], new_size)
         self.shares_client.wait_for_share_status(share['id'], 'available')
 
         # check state and new size
-        share = self.shares_client.get_share(share['id'])
-        self.assertEqual(new_size, share['size'])
+        share_get = self.shares_v2_client.get_share(share['id'])
+        msg = (
+            "Share could not be extended. "
+            "Expected %(expected)s, got %(actual)s." % {
+                "expected": new_size,
+                "actual": share_get['size'],
+            }
+        )
+        self.assertEqual(new_size, share_get['size'], msg)
 
     @test.attr(type=["gate", ])
     @testtools.skipUnless(
@@ -489,12 +496,19 @@
         new_size = 1
 
         # shrink share and wait for active status
-        self.shares_client.shrink_share(share['id'], new_size)
+        self.shares_v2_client.shrink_share(share['id'], new_size)
         self.shares_client.wait_for_share_status(share['id'], 'available')
 
         # check state and new size
-        share = self.shares_client.get_share(share['id'])
-        self.assertEqual(new_size, share['size'])
+        share_get = self.shares_v2_client.get_share(share['id'])
+        msg = (
+            "Share could not be shrunk. "
+            "Expected %(expected)s, got %(actual)s." % {
+                "expected": new_size,
+                "actual": share_get['size'],
+            }
+        )
+        self.assertEqual(new_size, share_get['size'], msg)
 
 
 class SharesRenameTest(base.BaseSharesTest):