Merge "Add .zuul.yaml with Tempest jobs"
diff --git a/manila_tempest_tests/config.py b/manila_tempest_tests/config.py
index 9e4a168..e33dba8 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.40",
+               default="2.42",
                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/services/share/v2/json/shares_client.py b/manila_tempest_tests/services/share/v2/json/shares_client.py
index 89a948e..fdcb3cb 100644
--- a/manila_tempest_tests/services/share/v2/json/shares_client.py
+++ b/manila_tempest_tests/services/share/v2/json/shares_client.py
@@ -820,6 +820,8 @@
             'extra_specs': kwargs.get('extra_specs'),
             is_public_keyname: is_public,
         }
+        if kwargs.get('description'):
+            post_body['description'] = kwargs.get('description')
         post_body = json.dumps({'share_type': post_body})
         resp, body = self.post('types', post_body, version=version)
         self.expected_success(200, resp.status)
diff --git a/manila_tempest_tests/tests/api/admin/test_share_types.py b/manila_tempest_tests/tests/api/admin/test_share_types.py
index 2df0561..dfa9fe7 100644
--- a/manila_tempest_tests/tests/api/admin/test_share_types.py
+++ b/manila_tempest_tests/tests/api/admin/test_share_types.py
@@ -58,18 +58,30 @@
             self.assertIn(old_key_name, share_type)
             self.assertNotIn(new_key_name, share_type)
 
+    def _verify_description(self, expect_des, share_type, version):
+        if utils.is_microversion_ge(version, "2.41"):
+            self.assertEqual(expect_des, share_type['description'])
+        else:
+            self.assertNotIn('description', share_type)
+
     @tc.attr(base.TAG_POSITIVE, base.TAG_API)
-    @ddt.data('2.0', '2.6', '2.7')
+    @ddt.data('2.0', '2.6', '2.7', '2.40', '2.41')
     def test_share_type_create_get(self, version):
         self.skip_if_microversion_not_supported(version)
 
         name = data_utils.rand_name("tempest-manila")
+        description = None
+        if utils.is_microversion_ge(version, "2.41"):
+            description = "Description for share type"
         extra_specs = self.add_extra_specs_to_dict({"key": "value", })
 
         # Create share type
         st_create = self.create_share_type(
-            name, extra_specs=extra_specs, version=version)
+            name, extra_specs=extra_specs, version=version,
+            description=description)
         self.assertEqual(name, st_create['share_type']['name'])
+        self._verify_description(
+            description, st_create['share_type'], version)
         self._verify_is_public_key_name(st_create['share_type'], version)
         st_id = st_create["share_type"]["id"]
 
@@ -77,6 +89,7 @@
         get = self.shares_v2_client.get_share_type(st_id, version=version)
         self.assertEqual(name, get["share_type"]["name"])
         self.assertEqual(st_id, get["share_type"]["id"])
+        self._verify_description(description, get['share_type'], version)
         self.assertEqual(extra_specs, get["share_type"]["extra_specs"])
         self._verify_is_public_key_name(get['share_type'], version)
 
@@ -84,16 +97,20 @@
         self.assertDictMatch(get["volume_type"], get["share_type"])
 
     @tc.attr(base.TAG_POSITIVE, base.TAG_API)
-    @ddt.data('2.0', '2.6', '2.7')
+    @ddt.data('2.0', '2.6', '2.7', '2.40', '2.41')
     def test_share_type_create_list(self, version):
         self.skip_if_microversion_not_supported(version)
 
         name = data_utils.rand_name("tempest-manila")
+        description = None
+        if utils.is_microversion_ge(version, "2.41"):
+            description = "Description for share type"
         extra_specs = self.add_extra_specs_to_dict()
 
         # Create share type
         st_create = self.create_share_type(
-            name, extra_specs=extra_specs, version=version)
+            name, extra_specs=extra_specs, version=version,
+            description=description)
         self._verify_is_public_key_name(st_create['share_type'], version)
         st_id = st_create["share_type"]["id"]
 
diff --git a/manila_tempest_tests/tests/api/admin/test_share_types_negative.py b/manila_tempest_tests/tests/api/admin/test_share_types_negative.py
index b3bf855..62d38cc 100644
--- a/manila_tempest_tests/tests/api/admin/test_share_types_negative.py
+++ b/manila_tempest_tests/tests/api/admin/test_share_types_negative.py
@@ -13,6 +13,7 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
+import ddt
 from tempest.lib.common.utils import data_utils
 from tempest.lib import exceptions as lib_exc
 from testtools import testcase as tc
@@ -20,6 +21,7 @@
 from manila_tempest_tests.tests.api import base
 
 
+@ddt.ddt
 class ShareTypesAdminNegativeTest(base.BaseSharesMixedTest):
 
     def _create_share_type(self):
@@ -49,6 +51,18 @@
                           client=self.admin_shares_v2_client)
 
     @tc.attr(base.TAG_NEGATIVE, base.TAG_API)
+    @ddt.data('2.0', '2.6', '2.40')
+    def test_create_share_type_with_description_in_wrong_version(
+            self, version):
+        self.assertRaises(lib_exc.BadRequest,
+                          self.create_share_type,
+                          data_utils.rand_name("tempest_type_name"),
+                          extra_specs=self.add_extra_specs_to_dict(),
+                          description="tempest_type_description",
+                          version=version,
+                          client=self.admin_shares_v2_client)
+
+    @tc.attr(base.TAG_NEGATIVE, base.TAG_API)
     def test_get_share_type_by_nonexistent_id(self):
         self.assertRaises(lib_exc.NotFound,
                           self.admin_shares_v2_client.get_share_type,
diff --git a/manila_tempest_tests/tests/api/base.py b/manila_tempest_tests/tests/api/base.py
index e81c5d4..b34c92a 100644
--- a/manila_tempest_tests/tests/api/base.py
+++ b/manila_tempest_tests/tests/api/base.py
@@ -177,7 +177,7 @@
             project_network_cidr=CONF.network.project_network_cidr,
             project_network_mask_bits=CONF.network.project_network_mask_bits,
             public_network_id=CONF.network.public_network_id,
-            resource_prefix=CONF.resources_prefix,
+            resource_prefix='tempest',
             identity_admin_endpoint_type=identity_admin_endpoint_type,
             identity_uri=identity_uri)
 
diff --git a/manila_tempest_tests/tests/api/test_security_services.py b/manila_tempest_tests/tests/api/test_security_services.py
index fd884f2..30cf6a9 100644
--- a/manila_tempest_tests/tests/api/test_security_services.py
+++ b/manila_tempest_tests/tests/api/test_security_services.py
@@ -200,3 +200,11 @@
         self.assertTrue(any(self.ss_ldap['id'] == ss['id'] for ss in listed))
         self.assertTrue(any(self.ss_kerberos['id'] == ss['id']
                             for ss in listed))
+
+    @tc.attr(base.TAG_POSITIVE, base.TAG_API)
+    def test_try_list_security_services_all_tenants(self):
+        listed = self.shares_client.list_security_services(
+            params={'all_tenants': 1})
+        self.assertTrue(any(self.ss_ldap['id'] == ss['id'] for ss in listed))
+        self.assertTrue(any(self.ss_kerberos['id'] == ss['id']
+                            for ss in listed))
diff --git a/manila_tempest_tests/tests/api/test_security_services_negative.py b/manila_tempest_tests/tests/api/test_security_services_negative.py
index 1f8e188..0814b6d 100644
--- a/manila_tempest_tests/tests/api/test_security_services_negative.py
+++ b/manila_tempest_tests/tests/api/test_security_services_negative.py
@@ -120,9 +120,3 @@
         self.assertRaises(lib_exc.NotFound,
                           self.shares_client.get_security_service,
                           ss["id"])
-
-    @tc.attr(base.TAG_NEGATIVE, base.TAG_API)
-    def test_try_list_security_services_all_tenants(self):
-        self.assertRaises(lib_exc.Forbidden,
-                          self.shares_client.list_security_services,
-                          params={'all_tenants': 1})
diff --git a/manila_tempest_tests/tests/api/test_share_networks.py b/manila_tempest_tests/tests/api/test_share_networks.py
index 3484264..4a44c12 100644
--- a/manila_tempest_tests/tests/api/test_share_networks.py
+++ b/manila_tempest_tests/tests/api/test_share_networks.py
@@ -36,6 +36,26 @@
         [self.assertIn(key, sn.keys()) for sn in listed for key in keys]
 
     @tc.attr(base.TAG_POSITIVE, base.TAG_API)
+    def test_try_list_share_networks_all_tenants(self):
+        listed = self.shares_client.list_share_networks_with_detail(
+            params={'all_tenants': 1})
+        any(self.sn_with_ldap_ss["id"] in sn["id"] for sn in listed)
+
+        # verify keys
+        keys = ["name", "id"]
+        [self.assertIn(key, sn.keys()) for sn in listed for key in keys]
+
+    @tc.attr(base.TAG_POSITIVE, base.TAG_API)
+    def test_try_list_share_networks_project_id(self):
+        listed = self.shares_client.list_share_networks_with_detail(
+            params={'project_id': 'some_project'})
+        any(self.sn_with_ldap_ss["id"] in sn["id"] for sn in listed)
+
+        # verify keys
+        keys = ["name", "id"]
+        [self.assertIn(key, sn.keys()) for sn in listed for key in keys]
+
+    @tc.attr(base.TAG_POSITIVE, base.TAG_API)
     def test_list_share_networks_with_detail(self):
         listed = self.shares_v2_client.list_share_networks_with_detail()
         any(self.sn_with_ldap_ss["id"] in sn["id"] for sn in listed)
diff --git a/manila_tempest_tests/tests/api/test_share_networks_negative.py b/manila_tempest_tests/tests/api/test_share_networks_negative.py
index 5fdc684..02bbdb9 100644
--- a/manila_tempest_tests/tests/api/test_share_networks_negative.py
+++ b/manila_tempest_tests/tests/api/test_share_networks_negative.py
@@ -82,18 +82,6 @@
                           sn["id"])
 
     @tc.attr(base.TAG_NEGATIVE, base.TAG_API)
-    def test_try_list_share_networks_all_tenants(self):
-        self.assertRaises(lib_exc.Forbidden,
-                          self.shares_client.list_share_networks_with_detail,
-                          params={'all_tenants': 1})
-
-    @tc.attr(base.TAG_NEGATIVE, base.TAG_API)
-    def test_try_list_share_networks_project_id(self):
-        self.assertRaises(lib_exc.Forbidden,
-                          self.shares_client.list_share_networks_with_detail,
-                          params={'project_id': 'some_project'})
-
-    @tc.attr(base.TAG_NEGATIVE, base.TAG_API)
     def test_try_list_share_networks_wrong_created_since_value(self):
         self.assertRaises(
             lib_exc.BadRequest,
diff --git a/manila_tempest_tests/tests/api/test_shares_actions.py b/manila_tempest_tests/tests/api/test_shares_actions.py
index cf179bf..7d28d83 100644
--- a/manila_tempest_tests/tests/api/test_shares_actions.py
+++ b/manila_tempest_tests/tests/api/test_shares_actions.py
@@ -390,6 +390,14 @@
             self.assertEqual(project_id, share["project_id"])
 
     @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
+    @base.skip_if_microversion_lt("2.42")
+    def test_list_shares_with_detail_with_count(self):
+        # list shares by name, at least one share is expected
+        params = {"with_count": 'true'}
+        shares = self.shares_v2_client.list_shares_with_detail(params)
+        self.assertGreater(shares["count"], 0)
+
+    @tc.attr(base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND)
     def test_list_shares_public_with_detail(self):
         public_share = self.create_share(
             name='public_share',