From 30403d05bfcf6fb11ebfc88a4f1a4b48bde6eb70 Mon Sep 17 00:00:00 2001 From: Rodrigo Barbieri Date: Wed, 1 Feb 2017 10:15:41 -0200 Subject: [PATCH] Remove redundant revert-to-snapshot test option This option is used to control how revert-to-snapshot extra-spec is used when creating a share type for several tests, but for the same tests, it is more appropriate to either not create a share-type (thus use the default or "don't care" behavior) or do so based on the value of run_revert_to_snapshot_tests. TrivialFix Change-Id: Ie8a0030a896634eb8deaff17ea72371419eecdea --- contrib/ci/post_test_hook.sh | 4 ---- manila_tempest_tests/config.py | 4 ++++ manila_tempest_tests/plugin.py | 6 ------ manila_tempest_tests/tests/api/base.py | 3 --- .../tests/api/test_revert_to_snapshot.py | 9 ++++----- .../tests/api/test_revert_to_snapshot_negative.py | 3 --- 6 files changed, 8 insertions(+), 21 deletions(-) diff --git a/contrib/ci/post_test_hook.sh b/contrib/ci/post_test_hook.sh index 8ed6b7109e..a7c85c66c0 100755 --- a/contrib/ci/post_test_hook.sh +++ b/contrib/ci/post_test_hook.sh @@ -276,10 +276,6 @@ iniset $TEMPEST_CONFIG share run_mount_snapshot_tests $RUN_MANILA_MOUNT_SNAPSHOT # Create share from snapshot support iniset $TEMPEST_CONFIG share capability_create_share_from_snapshot_support $CAPABILITY_CREATE_SHARE_FROM_SNAPSHOT_SUPPORT -# Revert share to snapshot support -CAPABILITY_REVERT_TO_SNAPSHOT_SUPPORT=${CAPABILITY_REVERT_TO_SNAPSHOT_SUPPORT:-$RUN_MANILA_REVERT_TO_SNAPSHOT_TESTS} -iniset $TEMPEST_CONFIG share capability_revert_to_snapshot_support $CAPABILITY_REVERT_TO_SNAPSHOT_SUPPORT - iniset $TEMPEST_CONFIG validation ip_version_for_ssh 4 iniset $TEMPEST_CONFIG validation network_for_ssh ${PRIVATE_NETWORK_NAME:-"private"} diff --git a/manila_tempest_tests/config.py b/manila_tempest_tests/config.py index ee3dd42a5f..2ba9ae523a 100644 --- a/manila_tempest_tests/config.py +++ b/manila_tempest_tests/config.py @@ -104,6 +104,10 @@ ShareGroup = [ "False if the driver being tested does not support " "creating shares from snapshots."), cfg.BoolOpt("capability_revert_to_snapshot_support", + deprecated_for_removal=True, + deprecated_reason="Redundant configuration option. Please use " + "'run_revert_to_snapshot_tests' config " + "option instead.", help="Defines extra spec that satisfies specific back end " "capability called 'revert_to_snapshot_support' " "and will be used for setting up custom share type. " diff --git a/manila_tempest_tests/plugin.py b/manila_tempest_tests/plugin.py index 7e1fa120d7..dfec0b182e 100644 --- a/manila_tempest_tests/plugin.py +++ b/manila_tempest_tests/plugin.py @@ -50,12 +50,6 @@ class ManilaTempestPlugin(plugins.TempestPlugin): conf.share.run_snapshot_tests, group="share", ) - if conf.share.capability_revert_to_snapshot_support is None: - conf.set_default( - "capability_revert_to_snapshot_support", - conf.share.run_revert_to_snapshot_tests, - group="share", - ) def get_opt_lists(self): return [(config_share.share_group.name, config_share.ShareGroup), diff --git a/manila_tempest_tests/tests/api/base.py b/manila_tempest_tests/tests/api/base.py index 78371950f5..2c26c782f1 100644 --- a/manila_tempest_tests/tests/api/base.py +++ b/manila_tempest_tests/tests/api/base.py @@ -763,8 +763,6 @@ class BaseSharesTest(test.BaseTestCase): CONF.share.capability_snapshot_support) create_from_snapshot_support = six.text_type( CONF.share.capability_create_share_from_snapshot_support) - revert_to_snapshot_support = six.text_type( - CONF.share.capability_revert_to_snapshot_support) extra_specs_dict = { "driver_handles_share_servers": dhss, @@ -773,7 +771,6 @@ class BaseSharesTest(test.BaseTestCase): optional = { "snapshot_support": snapshot_support, "create_share_from_snapshot_support": create_from_snapshot_support, - "revert_to_snapshot_support": revert_to_snapshot_support, } # NOTE(gouthamr): In micro-versions < 2.24, snapshot_support is a # required extra-spec diff --git a/manila_tempest_tests/tests/api/test_revert_to_snapshot.py b/manila_tempest_tests/tests/api/test_revert_to_snapshot.py index 91eca02c18..156a396c62 100644 --- a/manila_tempest_tests/tests/api/test_revert_to_snapshot.py +++ b/manila_tempest_tests/tests/api/test_revert_to_snapshot.py @@ -37,9 +37,6 @@ class RevertToSnapshotTest(base.BaseSharesMixedTest): if not CONF.share.run_revert_to_snapshot_tests: msg = "Revert to snapshot tests are disabled." raise cls.skipException(msg) - if not CONF.share.capability_revert_to_snapshot_support: - msg = "Revert to snapshot support is disabled." - raise cls.skipException(msg) if not CONF.share.capability_snapshot_support: msg = "Snapshot support is disabled." raise cls.skipException(msg) @@ -85,8 +82,10 @@ class RevertToSnapshotTest(base.BaseSharesMixedTest): cls.share_zone = cls.zones[0] cls.replica_zone = cls.zones[-1] - extra_specs = cls.add_extra_specs_to_dict( - {"replication_type": cls.replication_type}) + extra_specs = cls.add_extra_specs_to_dict({ + "replication_type": cls.replication_type, + constants.REVERT_TO_SNAPSHOT_SUPPORT: True, + }) share_type = cls.create_share_type( cls.replicated_share_type_name, extra_specs=extra_specs, diff --git a/manila_tempest_tests/tests/api/test_revert_to_snapshot_negative.py b/manila_tempest_tests/tests/api/test_revert_to_snapshot_negative.py index ee403af26d..505a614243 100644 --- a/manila_tempest_tests/tests/api/test_revert_to_snapshot_negative.py +++ b/manila_tempest_tests/tests/api/test_revert_to_snapshot_negative.py @@ -37,9 +37,6 @@ class RevertToSnapshotNegativeTest(base.BaseSharesMixedTest): if not CONF.share.run_revert_to_snapshot_tests: msg = "Revert to snapshot tests are disabled." raise cls.skipException(msg) - if not CONF.share.capability_revert_to_snapshot_support: - msg = "Revert to snapshot support is disabled." - raise cls.skipException(msg) if not CONF.share.capability_snapshot_support: msg = "Snapshot support is disabled." raise cls.skipException(msg)