Merge "Fix export location used for extend/shrink tests"
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.py b/manila_tempest_tests/tests/scenario/manager.py
index e767b02..6e8a2f6 100644
--- a/manila_tempest_tests/tests/scenario/manager.py
+++ b/manila_tempest_tests/tests/scenario/manager.py
@@ -330,31 +330,19 @@
return image['id']
def glance_image_create(self):
- img_path = CONF.scenario.img_dir + "/" + CONF.scenario.img_file
- aki_img_path = CONF.scenario.img_dir + "/" + CONF.scenario.aki_img_file
- ari_img_path = CONF.scenario.img_dir + "/" + CONF.scenario.ari_img_file
- ami_img_path = CONF.scenario.img_dir + "/" + CONF.scenario.ami_img_file
+ img_path = CONF.scenario.img_file
img_container_format = CONF.scenario.img_container_format
img_disk_format = CONF.scenario.img_disk_format
img_properties = CONF.scenario.img_properties
LOG.debug("paths: img: %s, container_format: %s, disk_format: %s, "
- "properties: %s, ami: %s, ari: %s, aki: %s",
+ "properties: %s",
img_path, img_container_format, img_disk_format,
- img_properties, ami_img_path, ari_img_path, aki_img_path)
- try:
- image = self._image_create('scenario-img',
- img_container_format,
- img_path,
- disk_format=img_disk_format,
- properties=img_properties)
- except IOError:
- LOG.debug("A qcow2 image was not found. Try to get a uec image.")
- kernel = self._image_create('scenario-aki', 'aki', aki_img_path)
- ramdisk = self._image_create('scenario-ari', 'ari', ari_img_path)
- properties = {'kernel_id': kernel, 'ramdisk_id': ramdisk}
- image = self._image_create('scenario-ami', 'ami',
- path=ami_img_path,
- properties=properties)
+ img_properties)
+ image = self._image_create('scenario-img',
+ img_container_format,
+ img_path,
+ disk_format=img_disk_format,
+ properties=img_properties)
LOG.debug("image:%s", image)
return image
diff --git a/manila_tempest_tests/tests/scenario/manager_share.py b/manila_tempest_tests/tests/scenario/manager_share.py
index d0e82c5..1ae1b4a 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