Merge "Remove deprecated scenario image options"
diff --git a/manila_tempest_tests/tests/api/admin/test_user_messages.py b/manila_tempest_tests/tests/api/admin/test_user_messages.py
index 9d69f90..83c5e37 100644
--- a/manila_tempest_tests/tests/api/admin/test_user_messages.py
+++ b/manila_tempest_tests/tests/api/admin/test_user_messages.py
@@ -124,7 +124,7 @@
         time_1 = created_at_1 - datetime.timedelta(seconds=1)
         time_2 = created_at_2 - datetime.timedelta(seconds=1)
 
-        params1 = {'created_since': str(created_at_1)}
+        params1 = {'created_since': str(time_1)}
         # should return all user messages created by this test including
         # self.message
         messages = self.shares_v2_client.list_messages(params=params1)
@@ -132,6 +132,10 @@
         self.assertGreaterEqual(len(ids), 2)
         self.assertIn(self.message['id'], ids)
         self.assertIn(new_message['id'], ids)
+        for message in messages:
+            time_diff_with_created_since = timeutils.delta_seconds(
+                time_1, timeutils.parse_strtime(message['created_at']))
+            self.assertGreaterEqual(time_diff_with_created_since, 0)
 
         params2 = {'created_since': str(time_1),
                    'created_before': str(time_2)}
@@ -143,6 +147,13 @@
         self.assertGreaterEqual(len(ids), 1)
         self.assertIn(self.message['id'], ids)
         self.assertNotIn(new_message['id'], ids)
+        for message in messages:
+            time_diff_with_created_since = timeutils.delta_seconds(
+                time_1, timeutils.parse_strtime(message['created_at']))
+            time_diff_with_created_before = timeutils.delta_seconds(
+                time_2, timeutils.parse_strtime(message['created_at']))
+            self.assertGreaterEqual(time_diff_with_created_since, 0)
+            self.assertGreaterEqual(0, time_diff_with_created_before)
 
         params3 = {'created_before': str(time_2)}
         # should not include self.message
@@ -151,3 +162,7 @@
         self.assertGreaterEqual(len(ids), 1)
         self.assertNotIn(new_message['id'], ids)
         self.assertIn(self.message['id'], ids)
+        for message in messages:
+            time_diff_with_created_before = timeutils.delta_seconds(
+                time_2, timeutils.parse_strtime(message['created_at']))
+            self.assertGreaterEqual(0, time_diff_with_created_before)
diff --git a/manila_tempest_tests/tests/api/test_quotas.py b/manila_tempest_tests/tests/api/test_quotas.py
index d7137f5..32152e0 100644
--- a/manila_tempest_tests/tests/api/test_quotas.py
+++ b/manila_tempest_tests/tests/api/test_quotas.py
@@ -82,15 +82,13 @@
             self.assertGreater(int(quotas["replica_gigabytes"]), -2)
 
     @ddt.data(
-        *itertools.product(set(("2.25", CONF.share.max_api_microversion)),
-                           (True, False)),
-        *itertools.product(set(("2.53", CONF.share.max_api_microversion)),
-                           (True, False))
+        *itertools.product(set(
+            ["2.25", "2.53", CONF.share.max_api_microversion]), (True, False))
     )
     @ddt.unpack
     @tc.attr(base.TAG_POSITIVE, base.TAG_API)
-    @base.skip_if_microversion_not_supported("2.25")
     def test_show_quotas_detail(self, microversion, with_user):
+        self.skip_if_microversion_not_supported(microversion)
         quota_args = {"tenant_id": self.tenant_id, "version": microversion, }
         keys = ['gigabytes', 'snapshot_gigabytes', 'shares',
                 'snapshots', 'share_networks']
diff --git a/manila_tempest_tests/tests/api/test_rules.py b/manila_tempest_tests/tests/api/test_rules.py
index dc63429..7ad57a9 100644
--- a/manila_tempest_tests/tests/api/test_rules.py
+++ b/manila_tempest_tests/tests/api/test_rules.py
@@ -81,12 +81,16 @@
     protocol = "nfs"
 
     @classmethod
-    def resource_setup(cls):
-        super(ShareIpRulesForNFSTest, cls).resource_setup()
+    def skip_checks(cls):
+        super(ShareIpRulesForNFSTest, cls).skip_checks()
         if (cls.protocol not in CONF.share.enable_protocols or
                 cls.protocol not in CONF.share.enable_ip_rules_for_protocols):
             msg = "IP rule tests for %s protocol are disabled" % cls.protocol
             raise cls.skipException(msg)
+
+    @classmethod
+    def resource_setup(cls):
+        super(ShareIpRulesForNFSTest, cls).resource_setup()
         # create share type
         cls.share_type = cls._create_share_type()
         cls.share_type_id = cls.share_type['id']
@@ -230,13 +234,18 @@
     protocol = "nfs"
 
     @classmethod
-    def resource_setup(cls):
-        super(ShareUserRulesForNFSTest, cls).resource_setup()
+    def skip_checks(cls):
+        super(ShareUserRulesForNFSTest, cls).skip_checks()
         if (cls.protocol not in CONF.share.enable_protocols or
                 cls.protocol not in
                 CONF.share.enable_user_rules_for_protocols):
             msg = "USER rule tests for %s protocol are disabled" % cls.protocol
             raise cls.skipException(msg)
+
+    @classmethod
+    def resource_setup(cls):
+        super(ShareUserRulesForNFSTest, cls).resource_setup()
+
         # create share type
         cls.share_type = cls._create_share_type()
         cls.share_type_id = cls.share_type['id']
@@ -320,13 +329,17 @@
     protocol = "glusterfs"
 
     @classmethod
-    def resource_setup(cls):
-        super(ShareCertRulesForGLUSTERFSTest, cls).resource_setup()
+    def skip_checks(cls):
+        super(ShareCertRulesForGLUSTERFSTest, cls).skip_checks()
         if (cls.protocol not in CONF.share.enable_protocols or
                 cls.protocol not in
                 CONF.share.enable_cert_rules_for_protocols):
             msg = "Cert rule tests for %s protocol are disabled" % cls.protocol
             raise cls.skipException(msg)
+
+    @classmethod
+    def resource_setup(cls):
+        super(ShareCertRulesForGLUSTERFSTest, cls).resource_setup()
         # create share type
         cls.share_type = cls._create_share_type()
         cls.share_type_id = cls.share_type['id']
@@ -436,14 +449,18 @@
     protocol = "cephfs"
 
     @classmethod
-    def resource_setup(cls):
-        super(ShareCephxRulesForCephFSTest, cls).resource_setup()
+    def skip_checks(cls):
+        super(ShareCephxRulesForCephFSTest, cls).skip_checks()
         if (cls.protocol not in CONF.share.enable_protocols or
                 cls.protocol not in
                 CONF.share.enable_cephx_rules_for_protocols):
             msg = ("Cephx rule tests for %s protocol are disabled." %
                    cls.protocol)
             raise cls.skipException(msg)
+
+    @classmethod
+    def resource_setup(cls):
+        super(ShareCephxRulesForCephFSTest, cls).resource_setup()
         # create share type
         cls.share_type = cls._create_share_type()
         cls.share_type_id = cls.share_type['id']
@@ -483,8 +500,8 @@
 class ShareRulesTest(base.BaseSharesMixedTest):
 
     @classmethod
-    def resource_setup(cls):
-        super(ShareRulesTest, cls).resource_setup()
+    def skip_checks(cls):
+        super(ShareRulesTest, cls).skip_checks()
         if not (any(p in CONF.share.enable_ip_rules_for_protocols
                     for p in cls.protocols) or
                 any(p in CONF.share.enable_user_rules_for_protocols
@@ -495,6 +512,10 @@
                     for p in cls.protocols)):
             cls.message = "Rule tests are disabled"
             raise cls.skipException(cls.message)
+
+    @classmethod
+    def resource_setup(cls):
+        super(ShareRulesTest, cls).resource_setup()
         if CONF.share.enable_ip_rules_for_protocols:
             cls.protocol = CONF.share.enable_ip_rules_for_protocols[0]
             cls.access_type = "ip"
diff --git a/manila_tempest_tests/tests/scenario/manager_share.py b/manila_tempest_tests/tests/scenario/manager_share.py
index 23fc4c4..a2b9c65 100644
--- a/manila_tempest_tests/tests/scenario/manager_share.py
+++ b/manila_tempest_tests/tests/scenario/manager_share.py
@@ -61,7 +61,7 @@
         super(ShareScenarioTest, cls).skip_checks()
         if not CONF.service_available.manila:
             raise cls.skipException("Manila support is required")
-        if cls.ipv6_enabled and not CONF.share.run_ipv6_tests:
+        if cls.ip_version == 6 and not CONF.share.run_ipv6_tests:
             raise cls.skipException("IPv6 tests are disabled")
         if cls.protocol not in CONF.share.enable_protocols:
             message = "%s tests are disabled" % cls.protocol