Merge "Add support for manage/unmanage snapshots in HNAS driver"
diff --git a/manila_tempest_tests/config.py b/manila_tempest_tests/config.py
index 1c1735d..9314da0 100644
--- a/manila_tempest_tests/config.py
+++ b/manila_tempest_tests/config.py
@@ -30,7 +30,7 @@
                help="The minimum api microversion is configured to be the "
                     "value of the minimum microversion supported by Manila."),
     cfg.StrOpt("max_api_microversion",
-               default="2.22",
+               default="2.23",
                help="The maximum api microversion is configured to be the "
                     "value of the latest microversion supported by Manila."),
     cfg.StrOpt("region",
diff --git a/manila_tempest_tests/tests/api/admin/test_share_type_filter.py b/manila_tempest_tests/tests/api/admin/test_share_type_filter.py
new file mode 100644
index 0000000..e34f943
--- /dev/null
+++ b/manila_tempest_tests/tests/api/admin/test_share_type_filter.py
@@ -0,0 +1,55 @@
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+import ddt
+from tempest.lib.common.utils import data_utils
+from testtools import testcase as tc
+
+from manila_tempest_tests.tests.api import base
+
+
+@ddt.ddt
+class ShareTypeFilterTest(base.BaseSharesAdminTest):
+
+    @classmethod
+    def _create_share_type(cls):
+        name = data_utils.rand_name("unique_st_name")
+        extra_specs = cls.add_required_extra_specs_to_dict()
+        return cls.create_share_type(
+            name, extra_specs=extra_specs,
+            client=cls.admin_client)
+
+    @classmethod
+    def resource_setup(cls):
+        super(ShareTypeFilterTest, cls).resource_setup()
+        cls.admin_client = cls.shares_v2_client
+        cls.st = cls._create_share_type()
+
+    @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
+    @base.skip_if_microversion_not_supported("2.23")
+    @ddt.data(True, False)
+    def test_get_pools_with_share_type_filter_with_detail(self, detail):
+        share_type = self.st["share_type"]["id"]
+        search_opts = {"share_type": share_type}
+        kwargs = {'search_opts': search_opts}
+
+        if detail:
+            kwargs.update({'detail': True})
+
+        pools = self.admin_client.list_pools(**kwargs)['pools']
+        for pool in pools:
+            pool_keys = pool.keys()
+            self.assertIn("name", pool_keys)
+            self.assertIn("host", pool_keys)
+            self.assertIn("backend", pool_keys)
+            self.assertIn("pool", pool_keys)
+            self.assertIs(detail, "capabilities" in pool_keys)
diff --git a/manila_tempest_tests/tests/api/admin/test_share_type_filter_negative.py b/manila_tempest_tests/tests/api/admin/test_share_type_filter_negative.py
new file mode 100644
index 0000000..80f8d66
--- /dev/null
+++ b/manila_tempest_tests/tests/api/admin/test_share_type_filter_negative.py
@@ -0,0 +1,54 @@
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+import ddt
+from oslo_utils import uuidutils
+from tempest import config
+from tempest.lib.common.utils import data_utils
+from testtools import testcase as tc
+
+from manila_tempest_tests.tests.api import base
+
+CONF = config.CONF
+
+
+@ddt.ddt
+class ShareTypeFilterNegativeTest(base.BaseSharesAdminTest):
+
+    @classmethod
+    def _create_share_type(cls):
+        name = data_utils.rand_name("unique_st_name")
+        extra_specs = {
+            'share_backend_name': uuidutils.generate_uuid(),
+        }
+        extra_specs = cls.add_required_extra_specs_to_dict(
+            extra_specs=extra_specs)
+        return cls.create_share_type(
+            name, extra_specs=extra_specs,
+            client=cls.admin_client)
+
+    @classmethod
+    def resource_setup(cls):
+        super(ShareTypeFilterNegativeTest, cls).resource_setup()
+        cls.admin_client = cls.shares_v2_client
+        cls.st = cls._create_share_type()
+
+    @tc.attr(base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND)
+    @base.skip_if_microversion_not_supported("2.23")
+    @ddt.data(True, False)
+    def test_get_pools_invalid_share_type_filter_with_detail(self, detail):
+        share_type = self.st["share_type"]["name"]
+        search_opts = {"share_type": share_type}
+        pools = self.admin_client.list_pools(
+            detail=detail, search_opts=search_opts)['pools']
+
+        self.assertEmpty(pools)
diff --git a/manila_tempest_tests/tests/api/test_security_services.py b/manila_tempest_tests/tests/api/test_security_services.py
index c8b5163..2e28703 100644
--- a/manila_tempest_tests/tests/api/test_security_services.py
+++ b/manila_tempest_tests/tests/api/test_security_services.py
@@ -95,7 +95,7 @@
         self.assertTrue(any(self.ss_ldap['id'] == ss['id'] for ss in listed))
         for ss in listed:
             self.assertTrue(all(ss[key] == value for key, value
-                                in six.iteritems(search_opts)))
+                                in search_opts.items()))
 
 
 class SecurityServicesTest(base.BaseSharesTest,
diff --git a/manila_tempest_tests/tests/api/test_share_networks.py b/manila_tempest_tests/tests/api/test_share_networks.py
index 577c5a4..70f1494 100644
--- a/manila_tempest_tests/tests/api/test_share_networks.py
+++ b/manila_tempest_tests/tests/api/test_share_networks.py
@@ -13,7 +13,6 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-import six
 from tempest import config
 import testtools
 from testtools import testcase as tc
@@ -93,7 +92,7 @@
         created_since = valid_filter_opts.pop('created_since')
         for sn in listed:
             self.assertTrue(all(sn[key] == value for key, value in
-                                six.iteritems(valid_filter_opts)))
+                                valid_filter_opts.items()))
             self.assertLessEqual(sn['created_at'], created_before)
             self.assertGreaterEqual(sn['created_at'], created_since)
 
diff --git a/manila_tempest_tests/tests/scenario/test_share_basic_ops.py b/manila_tempest_tests/tests/scenario/test_share_basic_ops.py
index 0e2e390..304d4e3 100644
--- a/manila_tempest_tests/tests/scenario/test_share_basic_ops.py
+++ b/manila_tempest_tests/tests/scenario/test_share_basic_ops.py
@@ -202,7 +202,6 @@
         for location in locations:
             self.mount_share(location, ssh_client)
             self.umount_share(ssh_client)
-        self.servers_client.delete_server(instance['id'])
 
     @tc.attr(base.TAG_POSITIVE, base.TAG_BACKEND)
     def test_read_write_two_vms(self):