[Tempest] Add valuable tags to tests

To be able to run tests based on following criteria:
- Only API is required and tested.
- API and share back-end required, API is tested.
- API and share back-end required, back-end is tested

Also, add doc with detailed description of running subset of tests.

Change-Id: I9ae105eaa527621c85d5038bba15edf4b065eaa3
Closes-Bug: #1587874
This commit is contained in:
Valeriy Ponomaryov 2016-06-01 18:30:12 +03:00
parent e96e7cb299
commit 797bbcb303
63 changed files with 1011 additions and 771 deletions

View File

@ -28,6 +28,7 @@ Programming HowTos and Tutorials
development.environment
unit_tests
tempest_tests
addmethod.openstackapi
documenting_your_work
adding_release_notes

View File

@ -0,0 +1,166 @@
Tempest Tests
=============
Manila stores tempest tests as plugin under ``manila_tempest_tests`` directory.
It contains functional and scenario tests.
Installation of plugin to tempest
---------------------------------
Tempest plugin installation is common for all its plugins and detailed
information can be found in its `docs`_.
In simple words: if you have installed manila project on the same machine as
tempest, then tempest will find it.
.. _docs: http://docs.openstack.org/developer/tempest/plugin.html#using-plugins
Configuration of manila-related tests in tempest.conf
-----------------------------------------------------
All config options for manila are defined in ``manila_tempest_tests/config.py``
module. They can be set/redefined in ``tempest.conf`` file.
Here is a configuration example:
.. code-block:: ini
[service_available]
manila = True
[share]
# Capabilities
capability_storage_protocol = NFS
capability_snapshot_support = True
backend_names = Backendname1,BackendName2
backend_replication_type = readable
# Enable/Disable test groups
multi_backend = True
multitenancy_enabled = True
enable_protocols = nfs,cifs,glusterfs,cephfs
enable_ip_rules_for_protocols = nfs
enable_user_rules_for_protocols = cifs
enable_cert_rules_for_protocols = glusterfs
enable_cephx_rules_for_protocols = cephfs
username_for_user_rules = foouser
enable_ro_access_level_for_protocols = nfs
run_quota_tests = True
run_extend_tests = True
run_shrink_tests = True
run_snapshot_tests = True
run_consistency_group_tests = True
run_replication_tests = True
run_migration_tests = True
run_manage_unmanage_tests = True
run_manage_unmanage_snapshot_tests = True
.. note::
None of existing share drivers support all features. So, make sure
that share backends really support features you enable in config.
Running tests
-------------
To run tests, it is required to install `pip`_, `tox`_ and `virtualenv`_
packages on host machine. Then run following command
from tempest root directory:
.. code-block:: console
$ tox -e all-plugin -- manila_tempest_tests.tests.api
or to run only scenario tests:
.. code-block:: console
$ tox -e all-plugin -- manila_tempest_tests.tests.scenario
.. _pip: https://pypi.python.org/pypi/pip
.. _tox: https://pypi.python.org/pypi/tox
.. _virtualenv: https://pypi.python.org/pypi/virtualenv
Running a subset of tests based on test location
------------------------------------------------
Instead of running all tests, you can specify an individual directory, file,
class, or method that contains test code.
To run the tests in the ``manila_tempest_tests/tests/api/admin`` directory:
.. code-block:: console
$ tox -e all-plugin -- manila_tempest_tests.tests.api.admin
To run the tests in the
``manila_tempest_tests/tests/api/admin/test_admin_actions.py`` module:
.. code-block:: console
$ tox -e all-plugin -- manila_tempest_tests.tests.api.admin.test_admin_actions
To run the tests in the `AdminActionsTest` class in
``manila_tempest_tests/tests/api/admin/test_admin_actions.py`` module:
.. code-block:: console
$ tox -e all-plugin -- manila_tempest_tests.tests.api.admin.test_admin_actions.AdminActionsTest
To run the `AdminActionsTest.test_reset_share_state` test method in
``manila_tempest_tests/tests/api/admin/test_admin_actions.py`` module:
.. code-block:: console
$ tox -e all-plugin -- manila_tempest_tests.tests.api.admin.test_admin_actions.AdminActionsTest.test_reset_share_state
Running a subset of tests based on service involvement
------------------------------------------------------
To run the tests that require only `manila-api` service running:
.. code-block:: console
$ tox -e all-plugin -- \
\(\?\=\.\*\\\[\.\*\\bapi\\b\.\*\\\]\) \
\(\^manila_tempest_tests.tests.api\)
To run the tests that require all manila services running,
but intended to test API behaviour:
.. code-block:: console
$ tox -e all-plugin -- \
\(\?\=\.\*\\\[\.\*\\b\(api\|api_with_backend\)\\b\.\*\\\]\) \
\(\^manila_tempest_tests.tests.api\)
To run the tests that require all manila services running,
but intended to test back-end (manila-share) behaviour:
.. code-block:: console
$ tox -e all-plugin -- \
\(\?\=\.\*\\\[\.\*\\bbackend\\b\.\*\\\]\) \
\(\^manila_tempest_tests.tests.api\)
Running a subset of positive or negative tests
----------------------------------------------
To run only positive tests, use following command:
.. code-block:: console
$ tox -e all-plugin -- \
\(\?\=\.\*\\\[\.\*\\bpositive\\b\.\*\\\]\) \
\(\^manila_tempest_tests.tests.api\)
To run only negative tests, use following command:
.. code-block:: console
$ tox -e all-plugin -- \
\(\?\=\.\*\\\[\.\*\\bnegative\\b\.\*\\\]\) \
\(\^manila_tempest_tests.tests.api\)
To run only positive API tests, use following command:
.. code-block:: console
$ tox -e all-plugin -- \
\(\?\=\.\*\\\[\.\*\\bpositive\\b\.\*\\\]\) \
\(\?\=\.\*\\\[\.\*\\bapi\\b\.\*\\\]\) \
\(\^manila_tempest_tests.tests.api\)

View File

@ -39,13 +39,13 @@ class AdminActionsTest(base.BaseSharesAdminTest):
if CONF.share.run_snapshot_tests:
cls.sn = cls.create_snapshot_wait_for_active(cls.sh["id"])
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_reset_share_state(self):
for status in self.states:
self.shares_v2_client.reset_state(self.sh["id"], status=status)
self.shares_v2_client.wait_for_share_status(self.sh["id"], status)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_reset_share_instance_state(self):
id = self.sh_instance["id"]
for status in self.states:
@ -53,7 +53,7 @@ class AdminActionsTest(base.BaseSharesAdminTest):
id, s_type="share_instances", status=status)
self.shares_v2_client.wait_for_share_instance_status(id, status)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
def test_reset_snapshot_state_to_error(self):
@ -63,7 +63,7 @@ class AdminActionsTest(base.BaseSharesAdminTest):
self.shares_v2_client.wait_for_snapshot_status(
self.sn["id"], status)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_force_delete_share(self):
share = self.create_share()
@ -78,7 +78,7 @@ class AdminActionsTest(base.BaseSharesAdminTest):
self.shares_v2_client.force_delete(share["id"])
self.shares_v2_client.wait_for_resource_deletion(share_id=share["id"])
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_force_delete_share_instance(self):
share = self.create_share(cleanup_in_class=False)
instances = self.shares_v2_client.get_instances_of_share(share["id"])
@ -101,7 +101,7 @@ class AdminActionsTest(base.BaseSharesAdminTest):
self.shares_v2_client.wait_for_resource_deletion(
share_instance_id=instance["id"])
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
def test_force_delete_snapshot(self):
@ -119,7 +119,7 @@ class AdminActionsTest(base.BaseSharesAdminTest):
self.shares_v2_client.force_delete(sn["id"], s_type="snapshots")
self.shares_v2_client.wait_for_resource_deletion(snapshot_id=sn["id"])
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@base.skip_if_microversion_lt("2.15")
def test_reset_share_task_state(self):
for task_state in self.task_states:

View File

@ -38,30 +38,13 @@ class AdminActionsNegativeTest(base.BaseSharesAdminTest):
cls.member_shares_client = clients.Manager().shares_client
cls.member_shares_v2_client = clients.Manager().shares_v2_client
@test.attr(type=["gate", "negative", ])
def test_reset_nonexistent_share_state(self):
self.assertRaises(lib_exc.NotFound,
self.shares_client.reset_state, "fake")
@test.attr(type=["gate", "negative", ])
def test_reset_nonexistent_share_instance_state(self):
self.assertRaises(lib_exc.NotFound, self.shares_v2_client.reset_state,
"fake", s_type="share_instances")
@test.attr(type=["gate", "negative", ])
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
def test_reset_nonexistent_snapshot_state(self):
self.assertRaises(lib_exc.NotFound, self.shares_client.reset_state,
"fake", s_type="snapshots")
@test.attr(type=["gate", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_reset_share_state_to_unacceptable_state(self):
self.assertRaises(lib_exc.BadRequest,
self.shares_client.reset_state,
self.sh["id"], status="fake")
@test.attr(type=["gate", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_reset_share_instance_state_to_unacceptable_state(self):
self.assertRaises(
lib_exc.BadRequest,
@ -71,7 +54,7 @@ class AdminActionsNegativeTest(base.BaseSharesAdminTest):
status="fake"
)
@test.attr(type=["gate", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
def test_reset_snapshot_state_to_unacceptable_state(self):
@ -79,21 +62,21 @@ class AdminActionsNegativeTest(base.BaseSharesAdminTest):
self.shares_client.reset_state,
self.sn["id"], s_type="snapshots", status="fake")
@test.attr(type=["gate", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_try_reset_share_state_with_member(self):
# Even if member from another tenant, it should be unauthorized
self.assertRaises(lib_exc.Forbidden,
self.member_shares_client.reset_state,
self.sh["id"])
@test.attr(type=["gate", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_try_reset_share_instance_state_with_member(self):
# Even if member from another tenant, it should be unauthorized
self.assertRaises(lib_exc.Forbidden,
self.member_shares_v2_client.reset_state,
self.sh_instance["id"], s_type="share_instances")
@test.attr(type=["gate", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
def test_try_reset_snapshot_state_with_member(self):
@ -102,42 +85,21 @@ class AdminActionsNegativeTest(base.BaseSharesAdminTest):
self.member_shares_client.reset_state,
self.sn["id"], s_type="snapshots")
@test.attr(type=["gate", "negative", ])
def test_force_delete_nonexistent_share(self):
self.assertRaises(lib_exc.NotFound,
self.shares_client.force_delete, "fake")
@test.attr(type=["gate", "negative", ])
def test_force_delete_nonexistent_share_instance(self):
self.assertRaises(lib_exc.NotFound,
self.shares_v2_client.force_delete,
"fake",
s_type="share_instances")
@test.attr(type=["gate", "negative", ])
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
def test_force_delete_nonexistent_snapshot(self):
self.assertRaises(lib_exc.NotFound,
self.shares_client.force_delete,
"fake",
s_type="snapshots")
@test.attr(type=["gate", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_try_force_delete_share_with_member(self):
# If a non-admin tries to do force_delete, it should be unauthorized
self.assertRaises(lib_exc.Forbidden,
self.member_shares_client.force_delete,
self.sh["id"])
@test.attr(type=["gate", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_try_force_delete_share_instance_with_member(self):
# If a non-admin tries to do force_delete, it should be unauthorized
self.assertRaises(lib_exc.Forbidden,
self.member_shares_v2_client.force_delete,
self.sh_instance["id"], s_type="share_instances")
@test.attr(type=["gate", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
def test_try_force_delete_snapshot_with_member(self):
@ -146,20 +108,14 @@ class AdminActionsNegativeTest(base.BaseSharesAdminTest):
self.member_shares_client.force_delete,
self.sn["id"], s_type="snapshots")
@test.attr(type=["gate", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_try_get_share_instance_with_member(self):
# If a non-admin tries to get instance, it should be unauthorized
self.assertRaises(lib_exc.Forbidden,
self.member_shares_v2_client.get_share_instance,
self.sh_instance["id"])
@test.attr(type=["gate", "negative", ])
def test_try_list_share_instance_with_member(self):
# If a non-admin tries to list instances, it should be unauthorized
self.assertRaises(lib_exc.Forbidden,
self.member_shares_v2_client.list_share_instances)
@test.attr(type=["gate", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_try_get_instances_of_share_with_member(self):
# If a non-admin tries to list instances of given share, it should be
# unauthorized
@ -167,23 +123,75 @@ class AdminActionsNegativeTest(base.BaseSharesAdminTest):
self.member_shares_v2_client.get_instances_of_share,
self.sh['id'])
@test.attr(type=["gate", "negative", ])
@base.skip_if_microversion_lt("2.15")
def test_reset_task_state_share_not_found(self):
self.assertRaises(
lib_exc.NotFound, self.shares_v2_client.reset_task_state,
'fake_share', 'migration_error')
@test.attr(type=["gate", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@base.skip_if_microversion_lt("2.15")
def test_reset_task_state_empty(self):
self.assertRaises(
lib_exc.BadRequest, self.shares_v2_client.reset_task_state,
self.sh['id'], None)
@test.attr(type=["gate", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@base.skip_if_microversion_lt("2.15")
def test_reset_task_state_invalid_state(self):
self.assertRaises(
lib_exc.BadRequest, self.shares_v2_client.reset_task_state,
self.sh['id'], 'fake_state')
class AdminActionsAPIOnlyNegativeTest(base.BaseSharesAdminTest):
@classmethod
def resource_setup(cls):
super(AdminActionsAPIOnlyNegativeTest, cls).resource_setup()
cls.member_shares_v2_client = clients.Manager().shares_v2_client
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_list_share_instance_with_member(self):
# If a non-admin tries to list instances, it should be unauthorized
self.assertRaises(lib_exc.Forbidden,
self.member_shares_v2_client.list_share_instances)
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
@base.skip_if_microversion_lt("2.15")
def test_reset_task_state_share_not_found(self):
self.assertRaises(
lib_exc.NotFound, self.shares_v2_client.reset_task_state,
'fake_share', 'migration_error')
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
def test_force_delete_nonexistent_snapshot(self):
self.assertRaises(lib_exc.NotFound,
self.shares_client.force_delete,
"fake",
s_type="snapshots")
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_force_delete_nonexistent_share(self):
self.assertRaises(lib_exc.NotFound,
self.shares_client.force_delete, "fake")
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_force_delete_nonexistent_share_instance(self):
self.assertRaises(lib_exc.NotFound,
self.shares_v2_client.force_delete,
"fake",
s_type="share_instances")
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_reset_nonexistent_share_state(self):
self.assertRaises(lib_exc.NotFound,
self.shares_client.reset_state, "fake")
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_reset_nonexistent_share_instance_state(self):
self.assertRaises(lib_exc.NotFound, self.shares_v2_client.reset_state,
"fake", s_type="share_instances")
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
def test_reset_nonexistent_snapshot_state(self):
self.assertRaises(lib_exc.NotFound, self.shares_client.reset_state,
"fake", s_type="snapshots")

View File

@ -46,7 +46,7 @@ class ConsistencyGroupActionsTest(base.BaseSharesAdminTest):
cls.consistency_group = cls.shares_v2_client.get_consistency_group(
cls.consistency_group['id'])
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
def test_create_cg_from_cgsnapshot_with_multiple_share_types_v2_4(self):
# Create cgsnapshot
cgsnapshot = self.create_cgsnapshot_wait_for_active(
@ -68,7 +68,7 @@ class ConsistencyGroupActionsTest(base.BaseSharesAdminTest):
'Expected share types of %s, but got %s.' % (
expected_types, actual_types))
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
def test_create_cg_from_multi_typed_populated_cgsnapshot_v2_4(self):
share_name = data_utils.rand_name("tempest-share-name")
share_desc = data_utils.rand_name("tempest-share-description")

View File

@ -42,7 +42,7 @@ class ConsistencyGroupsTest(base.BaseSharesAdminTest):
share_type = cls.create_share_type(name, extra_specs=extra_specs)
cls.share_type2 = share_type['share_type']
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_create_cg_with_multiple_share_types_v2_4(self):
# Create a consistency group
consistency_group = self.create_consistency_group(
@ -67,6 +67,7 @@ class ConsistencyGroupsTest(base.BaseSharesAdminTest):
expected_share_types,
actual_share_types))
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipIf(
not CONF.share.multitenancy_enabled, "Only for multitenancy.")
def test_create_cg_from_cgsnapshot_verify_share_server_information(self):

View File

@ -61,14 +61,14 @@ class ConsistencyGroupsNegativeTest(base.BaseSharesAdminTest):
name=cls.cgsnap_name,
description=cls.cgsnap_desc)
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_delete_share_type_in_use_by_cg(self):
# Attempt delete of share type
self.assertRaises(exceptions.BadRequest,
self.shares_client.delete_share_type,
self.share_type['id'])
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_create_share_of_unsupported_type_in_cg_v2_4(self):
# Attempt to create share of default type in the cg
self.assertRaises(exceptions.BadRequest,
@ -77,7 +77,7 @@ class ConsistencyGroupsNegativeTest(base.BaseSharesAdminTest):
consistency_group_id=self.consistency_group['id'],
version='2.4')
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_create_share_in_cg_that_is_not_available_v2_4(self):
consistency_group = self.create_consistency_group(
cleanup_in_class=False, version='2.4')
@ -122,7 +122,7 @@ class ConsistencyGroupsNegativeTest(base.BaseSharesAdminTest):
cleanup_in_class=False,
version='2.4')
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_create_cgsnapshot_of_cg_that_is_not_available_v2_4(self):
consistency_group = self.create_consistency_group(
cleanup_in_class=False, version='2.4')
@ -161,7 +161,7 @@ class ConsistencyGroupsNegativeTest(base.BaseSharesAdminTest):
cleanup_in_class=False,
version='2.4')
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_create_cgsnapshot_of_cg_with_share_in_error_state_v2_4(self):
consistency_group = self.create_consistency_group(version='2.4')
share_name = data_utils.rand_name("tempest-share-name")
@ -183,7 +183,7 @@ class ConsistencyGroupsNegativeTest(base.BaseSharesAdminTest):
cleanup_in_class=False,
version='2.4')
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_delete_cgsnapshot_not_in_available_or_error_v2_4(self):
cgsnapshot = self.create_cgsnapshot_wait_for_active(
self.consistency_group['id'],
@ -216,7 +216,7 @@ class ConsistencyGroupsNegativeTest(base.BaseSharesAdminTest):
cgsnapshot['id'],
version='2.4')
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_delete_cg_not_in_available_or_error_v2_4(self):
consistency_group = self.create_consistency_group(
cleanup_in_class=False, version='2.4')
@ -243,7 +243,7 @@ class ConsistencyGroupsNegativeTest(base.BaseSharesAdminTest):
consistency_group['id'],
version='2.4')
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_create_cg_with_conflicting_share_types_v2_4(self):
# Create conflicting share types
name = data_utils.rand_name("tempest-manila")
@ -263,7 +263,7 @@ class ConsistencyGroupsNegativeTest(base.BaseSharesAdminTest):
cleanup_in_class=False,
version='2.4')
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_create_cg_with_multi_tenant_share_type_and_no_share_network_v2_4(
self):
# Create multi tenant share type
@ -287,7 +287,7 @@ class ConsistencyGroupsNegativeTest(base.BaseSharesAdminTest):
self.assertRaises(exceptions.BadRequest, create_cg)
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_update_cg_share_types(self):
consistency_group = self.create_consistency_group(
cleanup_in_class=False, version='2.4')

View File

@ -101,7 +101,7 @@ class ExportLocationsTest(base.BaseSharesAdminTest):
# it making assertion that it has proper date value.
timeutils.parse_strtime(time)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@utils.skip_if_microversion_not_supported('2.13')
def test_list_share_export_locations(self):
export_locations = self.admin_client.list_share_export_locations(
@ -110,7 +110,7 @@ class ExportLocationsTest(base.BaseSharesAdminTest):
self._verify_export_location_structure(export_locations,
version='2.13')
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@utils.skip_if_microversion_not_supported('2.14')
def test_list_share_export_locations_with_preferred_flag(self):
export_locations = self.admin_client.list_share_export_locations(
@ -119,7 +119,7 @@ class ExportLocationsTest(base.BaseSharesAdminTest):
self._verify_export_location_structure(export_locations,
version='2.14')
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_get_share_export_location(self):
export_locations = self.admin_client.list_share_export_locations(
self.share['id'])
@ -129,14 +129,14 @@ class ExportLocationsTest(base.BaseSharesAdminTest):
self.share['id'], export_location['id'])
self._verify_export_location_structure(el, format='detail')
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_list_share_export_locations_by_member(self):
export_locations = self.member_client.list_share_export_locations(
self.share['id'])
self._verify_export_location_structure(export_locations, role='member')
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_get_share_export_location_by_member(self):
export_locations = self.admin_client.list_share_export_locations(
self.share['id'])
@ -149,7 +149,7 @@ class ExportLocationsTest(base.BaseSharesAdminTest):
self._verify_export_location_structure(el, role='member',
format='detail')
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@utils.skip_if_microversion_not_supported('2.13')
def test_list_share_instance_export_locations(self):
for share_instance in self.share_instances:
@ -159,7 +159,7 @@ class ExportLocationsTest(base.BaseSharesAdminTest):
self._verify_export_location_structure(export_locations,
version='2.13')
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@utils.skip_if_microversion_not_supported('2.14')
def test_list_share_instance_export_locations_with_preferred_flag(self):
for share_instance in self.share_instances:
@ -169,7 +169,7 @@ class ExportLocationsTest(base.BaseSharesAdminTest):
self._verify_export_location_structure(export_locations,
version='2.14')
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_get_share_instance_export_location(self):
for share_instance in self.share_instances:
export_locations = (
@ -180,7 +180,7 @@ class ExportLocationsTest(base.BaseSharesAdminTest):
share_instance['id'], el['id'])
self._verify_export_location_structure(el, format='detail')
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_share_contains_all_export_locations_of_all_share_instances(self):
share_export_locations = self.admin_client.list_share_export_locations(
self.share['id'])

View File

@ -36,15 +36,7 @@ class ExportLocationsNegativeTest(base.BaseSharesAdminTest):
cls.share_instances = cls.shares_v2_client.get_instances_of_share(
cls.share['id'])
@test.attr(type=["gate", "negative"])
def test_get_export_locations_by_inexistent_share(self):
self.assertRaises(
lib_exc.NotFound,
self.admin_client.list_share_export_locations,
"fake-inexistent-share-id",
)
@test.attr(type=["gate", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_get_inexistent_share_export_location(self):
self.assertRaises(
lib_exc.NotFound,
@ -53,15 +45,7 @@ class ExportLocationsNegativeTest(base.BaseSharesAdminTest):
"fake-inexistent-share-instance-id",
)
@test.attr(type=["gate", "negative"])
def test_get_export_locations_by_inexistent_share_instance(self):
self.assertRaises(
lib_exc.NotFound,
self.admin_client.list_share_instance_export_locations,
"fake-inexistent-share-instance-id",
)
@test.attr(type=["gate", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_get_inexistent_share_instance_export_location(self):
for share_instance in self.share_instances:
self.assertRaises(
@ -71,7 +55,7 @@ class ExportLocationsNegativeTest(base.BaseSharesAdminTest):
"fake-inexistent-share-instance-id",
)
@test.attr(type=["gate", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_list_share_instance_export_locations_by_member(self):
for share_instance in self.share_instances:
self.assertRaises(
@ -80,7 +64,7 @@ class ExportLocationsNegativeTest(base.BaseSharesAdminTest):
"fake-inexistent-share-instance-id",
)
@test.attr(type=["gate", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_get_share_instance_export_location_by_member(self):
for share_instance in self.share_instances:
export_locations = (
@ -92,3 +76,23 @@ class ExportLocationsNegativeTest(base.BaseSharesAdminTest):
self.member_client.get_share_instance_export_location,
share_instance['id'], el['id'],
)
@base.skip_if_microversion_not_supported("2.9")
class ExportLocationsAPIOnlyNegativeTest(base.BaseSharesAdminTest):
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_get_export_locations_by_nonexistent_share(self):
self.assertRaises(
lib_exc.NotFound,
self.shares_v2_client.list_share_export_locations,
"fake-inexistent-share-id",
)
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_get_export_locations_by_nonexistent_share_instance(self):
self.assertRaises(
lib_exc.NotFound,
self.shares_v2_client.list_share_instance_export_locations,
"fake-inexistent-share-instance-id",
)

View File

@ -39,7 +39,7 @@ class MigrationNFSTest(base.BaseSharesAdminTest):
if not CONF.share.run_migration_tests:
raise cls.skipException("Migration tests disabled. Skipping.")
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
@base.skip_if_microversion_lt("2.5")
def test_migration_empty_v2_5(self):
@ -52,7 +52,7 @@ class MigrationNFSTest(base.BaseSharesAdminTest):
self._validate_migration_successful(dest_pool, share, old_exports,
version='2.5')
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
@base.skip_if_microversion_lt("2.15")
def test_migration_completion_empty_v2_15(self):

View File

@ -47,28 +47,28 @@ class MigrationNFSTest(base.BaseSharesAdminTest):
cls.dest_pool = next((x for x in pools
if x['name'] != cls.share['host']), None)
@test.attr(type=["gate", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@base.skip_if_microversion_lt("2.15")
def test_migration_cancel_invalid(self):
self.assertRaises(
lib_exc.BadRequest, self.shares_v2_client.migration_cancel,
self.share['id'])
@test.attr(type=["gate", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@base.skip_if_microversion_lt("2.15")
def test_migration_get_progress_invalid(self):
self.assertRaises(
lib_exc.BadRequest, self.shares_v2_client.migration_get_progress,
self.share['id'])
@test.attr(type=["gate", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@base.skip_if_microversion_lt("2.15")
def test_migration_complete_invalid(self):
self.assertRaises(
lib_exc.BadRequest, self.shares_v2_client.migration_complete,
self.share['id'])
@test.attr(type=["gate", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@base.skip_if_microversion_lt("2.5")
def test_migrate_share_with_snapshot_v2_5(self):
snap = self.create_snapshot_wait_for_active(self.share['id'])
@ -78,14 +78,14 @@ class MigrationNFSTest(base.BaseSharesAdminTest):
self.shares_client.delete_snapshot(snap['id'])
self.shares_client.wait_for_resource_deletion(snapshot_id=snap["id"])
@test.attr(type=["gate", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@base.skip_if_microversion_lt("2.5")
def test_migrate_share_same_host_v2_5(self):
self.assertRaises(
lib_exc.BadRequest, self.shares_v2_client.migrate_share,
self.share['id'], self.share['host'], True, version='2.5')
@test.attr(type=["gate", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@base.skip_if_microversion_lt("2.5")
def test_migrate_share_not_available_v2_5(self):
self.shares_client.reset_state(self.share['id'], 'error')

View File

@ -56,14 +56,14 @@ class ShareMultiBackendTest(base.BaseSharesAdminTest):
# Create shares using precreated share types
cls.shares = cls.create_shares(share_data_list)
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_share_backend_name_reporting(self):
# Share's 'host' should be like "hostname@backend_name"
for share in self.shares:
get = self.shares_client.get_share(share['id'])
self.assertTrue(len(get["host"].split("@")) == 2)
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_share_share_type(self):
# Share type should be the same as provided with share creation
for i in [0, 1]:
@ -71,7 +71,7 @@ class ShareMultiBackendTest(base.BaseSharesAdminTest):
version="2.5")
self.assertEqual(self.sts[i]["name"], get["share_type"])
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_share_share_type_v_2_6(self):
# Share type should be the same as provided with share creation
for i in [0, 1]:
@ -80,7 +80,7 @@ class ShareMultiBackendTest(base.BaseSharesAdminTest):
self.assertEqual(self.sts[i]["id"], get["share_type"])
self.assertEqual(self.sts[i]["name"], get["share_type_name"])
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_share_backend_name_distinction(self):
# Different share backends should have different host records
if CONF.share.backend_names[0] == CONF.share.backend_names[1]:

View File

@ -34,7 +34,7 @@ class SharesAdminQuotasTest(base.BaseSharesAdminTest):
cls.user_id = cls.shares_v2_client.user_id
cls.tenant_id = cls.shares_v2_client.tenant_id
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_default_quotas(self):
quotas = self.shares_v2_client.default_quotas(self.tenant_id)
self.assertGreater(int(quotas["gigabytes"]), -2)
@ -43,7 +43,7 @@ class SharesAdminQuotasTest(base.BaseSharesAdminTest):
self.assertGreater(int(quotas["snapshots"]), -2)
self.assertGreater(int(quotas["share_networks"]), -2)
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_show_quotas(self):
quotas = self.shares_v2_client.show_quotas(self.tenant_id)
self.assertGreater(int(quotas["gigabytes"]), -2)
@ -52,7 +52,7 @@ class SharesAdminQuotasTest(base.BaseSharesAdminTest):
self.assertGreater(int(quotas["snapshots"]), -2)
self.assertGreater(int(quotas["share_networks"]), -2)
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_show_quotas_for_user(self):
quotas = self.shares_v2_client.show_quotas(
self.tenant_id, self.user_id)
@ -83,7 +83,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self.tenant_id = self.client.tenant_id
self.user_id = self.client.user_id
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_update_tenant_quota_shares(self):
# get current quotas
quotas = self.client.show_quotas(self.tenant_id)
@ -93,7 +93,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
updated = self.client.update_quotas(self.tenant_id, shares=new_quota)
self.assertEqual(new_quota, int(updated["shares"]))
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_update_user_quota_shares(self):
# get current quotas
quotas = self.client.show_quotas(self.tenant_id, self.user_id)
@ -104,7 +104,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self.tenant_id, self.user_id, shares=new_quota)
self.assertEqual(new_quota, int(updated["shares"]))
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_update_tenant_quota_snapshots(self):
# get current quotas
quotas = self.client.show_quotas(self.tenant_id)
@ -115,7 +115,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self.tenant_id, snapshots=new_quota)
self.assertEqual(new_quota, int(updated["snapshots"]))
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_update_user_quota_snapshots(self):
# get current quotas
quotas = self.client.show_quotas(self.tenant_id, self.user_id)
@ -126,7 +126,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self.tenant_id, self.user_id, snapshots=new_quota)
self.assertEqual(new_quota, int(updated["snapshots"]))
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_update_tenant_quota_gigabytes(self):
# get current quotas
custom = self.client.show_quotas(self.tenant_id)
@ -139,7 +139,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self.tenant_id, gigabytes=gigabytes)
self.assertEqual(gigabytes, int(updated["gigabytes"]))
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_update_tenant_quota_snapshot_gigabytes(self):
# get current quotas
custom = self.client.show_quotas(self.tenant_id)
@ -154,7 +154,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self.assertEqual(snapshot_gigabytes,
int(updated["snapshot_gigabytes"]))
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_update_user_quota_gigabytes(self):
# get current quotas
custom = self.client.show_quotas(self.tenant_id, self.user_id)
@ -167,7 +167,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self.tenant_id, self.user_id, gigabytes=gigabytes)
self.assertEqual(gigabytes, int(updated["gigabytes"]))
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_update_user_quota_snapshot_gigabytes(self):
# get current quotas
custom = self.client.show_quotas(self.tenant_id, self.user_id)
@ -182,7 +182,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self.assertEqual(snapshot_gigabytes,
int(updated["snapshot_gigabytes"]))
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_update_tenant_quota_share_networks(self):
# get current quotas
quotas = self.client.show_quotas(self.tenant_id)
@ -193,7 +193,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self.tenant_id, share_networks=new_quota)
self.assertEqual(new_quota, int(updated["share_networks"]))
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_update_user_quota_share_networks(self):
# get current quotas
quotas = self.client.show_quotas(
@ -206,7 +206,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
share_networks=new_quota)
self.assertEqual(new_quota, int(updated["share_networks"]))
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_reset_tenant_quotas(self):
# get default_quotas
default = self.client.default_quotas(self.tenant_id)
@ -247,7 +247,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self.assertEqual(int(default["share_networks"]),
int(reseted["share_networks"]))
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_unlimited_quota_for_shares(self):
self.client.update_quotas(self.tenant_id, shares=-1)
@ -255,7 +255,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self.assertEqual(-1, quotas.get('shares'))
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_unlimited_user_quota_for_shares(self):
self.client.update_quotas(
self.tenant_id, self.user_id, shares=-1)
@ -264,7 +264,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self.assertEqual(-1, quotas.get('shares'))
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_unlimited_quota_for_snapshots(self):
self.client.update_quotas(self.tenant_id, snapshots=-1)
@ -272,7 +272,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self.assertEqual(-1, quotas.get('snapshots'))
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_unlimited_user_quota_for_snapshots(self):
self.client.update_quotas(
self.tenant_id, self.user_id, snapshots=-1)
@ -281,7 +281,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self.assertEqual(-1, quotas.get('snapshots'))
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_unlimited_quota_for_gigabytes(self):
self.client.update_quotas(self.tenant_id, gigabytes=-1)
@ -289,7 +289,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self.assertEqual(-1, quotas.get('gigabytes'))
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_unlimited_quota_for_snapshot_gigabytes(self):
self.client.update_quotas(
self.tenant_id, snapshot_gigabytes=-1)
@ -298,7 +298,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self.assertEqual(-1, quotas.get('snapshot_gigabytes'))
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_unlimited_user_quota_for_gigabytes(self):
self.client.update_quotas(
self.tenant_id, self.user_id, gigabytes=-1)
@ -307,7 +307,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self.assertEqual(-1, quotas.get('gigabytes'))
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_unlimited_user_quota_for_snapshot_gigabytes(self):
self.client.update_quotas(
self.tenant_id, self.user_id, snapshot_gigabytes=-1)
@ -316,7 +316,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self.assertEqual(-1, quotas.get('snapshot_gigabytes'))
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_unlimited_quota_for_share_networks(self):
self.client.update_quotas(self.tenant_id, share_networks=-1)
@ -324,7 +324,7 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
self.assertEqual(-1, quotas.get('share_networks'))
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_unlimited_user_quota_for_share_networks(self):
self.client.update_quotas(
self.tenant_id, self.user_id, share_networks=-1)

View File

@ -38,18 +38,18 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest):
cls.user_id = cls.shares_client.user_id
cls.tenant_id = cls.shares_client.tenant_id
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_get_quotas_with_empty_tenant_id(self):
self.assertRaises(lib_exc.NotFound,
self.shares_client.show_quotas, "")
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_reset_quotas_with_empty_tenant_id(self):
client = self.get_client_with_isolated_creds()
self.assertRaises(lib_exc.NotFound,
client.reset_quotas, "")
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_update_shares_quota_with_wrong_data(self):
# -1 is acceptable value as unlimited
client = self.get_client_with_isolated_creds()
@ -58,7 +58,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest):
client.tenant_id,
shares=-2)
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_update_snapshots_quota_with_wrong_data(self):
# -1 is acceptable value as unlimited
client = self.get_client_with_isolated_creds()
@ -67,7 +67,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest):
client.tenant_id,
snapshots=-2)
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_update_gigabytes_quota_with_wrong_data(self):
# -1 is acceptable value as unlimited
client = self.get_client_with_isolated_creds()
@ -76,7 +76,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest):
client.tenant_id,
gigabytes=-2)
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_update_snapshot_gigabytes_quota_with_wrong_data(self):
# -1 is acceptable value as unlimited
client = self.get_client_with_isolated_creds()
@ -85,7 +85,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest):
client.tenant_id,
snapshot_gigabytes=-2)
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_update_share_networks_quota_with_wrong_data(self):
# -1 is acceptable value as unlimited
client = self.get_client_with_isolated_creds()
@ -94,7 +94,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest):
client.tenant_id,
share_networks=-2)
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_create_share_with_size_bigger_than_quota(self):
quotas = self.shares_client.show_quotas(
self.shares_client.tenant_id)
@ -105,7 +105,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest):
self.create_share,
size=overquota)
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_set_user_quota_shares_bigger_than_tenant_quota(self):
client = self.get_client_with_isolated_creds()
@ -120,7 +120,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest):
client.user_id,
shares=bigger_value)
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_set_user_quota_snaps_bigger_than_tenant_quota(self):
client = self.get_client_with_isolated_creds()
@ -135,7 +135,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest):
client.user_id,
snapshots=bigger_value)
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_set_user_quota_gigabytes_bigger_than_tenant_quota(self):
client = self.get_client_with_isolated_creds()
@ -150,7 +150,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest):
client.user_id,
gigabytes=bigger_value)
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_set_user_quota_snap_gigabytes_bigger_than_tenant_quota(self):
client = self.get_client_with_isolated_creds()
@ -165,7 +165,7 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest):
client.user_id,
snapshot_gigabytes=bigger_value)
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_set_user_quota_share_networks_bigger_than_tenant_quota(self):
client = self.get_client_with_isolated_creds()

View File

@ -67,7 +67,7 @@ class ReplicationAdminTest(base.BaseSharesAdminTest):
return [replica['id'] for replica in replica_list
if replica['replica_state'] == r_state]
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
def test_promote_out_of_sync_share_replica(self):
"""Test promote 'out_of_sync' share replica to active state."""
if (self.replication_type
@ -113,7 +113,7 @@ class ReplicationAdminTest(base.BaseSharesAdminTest):
replica_list, constants.REPLICATION_STATE_ACTIVE)
self.assertEqual(1, len(new_active_replicas))
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
def test_force_delete_share_replica(self):
"""Test force deleting a replica that is in 'error_deleting' status."""
replica = self.create_share_replica(self.share['id'],
@ -127,7 +127,7 @@ class ReplicationAdminTest(base.BaseSharesAdminTest):
self.shares_v2_client.wait_for_resource_deletion(
replica_id=replica['id'])
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
def test_reset_share_replica_status(self):
"""Test resetting a replica's 'status' attribute."""
replica = self.create_share_replica(self.share['id'],
@ -138,7 +138,7 @@ class ReplicationAdminTest(base.BaseSharesAdminTest):
self.shares_v2_client.wait_for_share_replica_status(
replica['id'], constants.STATUS_ERROR)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
def test_reset_share_replica_state(self):
"""Test resetting a replica's 'replica_state' attribute."""
replica = self.create_share_replica(self.share['id'],
@ -149,7 +149,7 @@ class ReplicationAdminTest(base.BaseSharesAdminTest):
self.shares_v2_client.wait_for_share_replica_status(
replica['id'], constants.STATUS_ERROR, status_attr='replica_state')
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
def test_resync_share_replica(self):
"""Test resyncing a replica."""
replica = self.create_share_replica(self.share['id'],

View File

@ -64,7 +64,7 @@ class ReplicationAdminTest(base.BaseSharesAdminTest):
cls.replica = cls.shares_v2_client.list_share_replicas(
share_id=cls.share['id'])[0]
@test.attr(type=["gate"])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipUnless(CONF.share.run_extend_tests,
'Extend share tests are disabled.')
def test_extend_replicated_share(self):
@ -76,7 +76,7 @@ class ReplicationAdminTest(base.BaseSharesAdminTest):
share = self.shares_v2_client.get_share(self.share["id"])
self.assertEqual(new_size, int(share["size"]))
@test.attr(type=["gate"])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipUnless(CONF.share.run_shrink_tests,
'Shrink share tests are disabled.')
def test_shrink_replicated_share(self):
@ -87,7 +87,7 @@ class ReplicationAdminTest(base.BaseSharesAdminTest):
shrink_share = self.shares_v2_client.get_share(self.share["id"])
self.assertEqual(new_size, int(shrink_share["size"]))
@test.attr(type=["gate", "positive"])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
@testtools.skipUnless(CONF.share.run_manage_unmanage_tests,
'Manage/Unmanage Tests are disabled.')
def test_manage_share_for_replication_type(self):
@ -121,7 +121,7 @@ class ReplicationAdminTest(base.BaseSharesAdminTest):
self.create_share_replica(managed_share['id'], self.replica_zone,
cleanup=True)
@test.attr(type=["gate", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipUnless(CONF.share.run_manage_unmanage_tests,
'Manage/Unmanage Tests are disabled.')
def test_unmanage_replicated_share_with_replica(self):
@ -134,7 +134,7 @@ class ReplicationAdminTest(base.BaseSharesAdminTest):
self.shares_v2_client.unmanage_share,
share_id=self.share['id'])
@test.attr(type=["gate", "positive"])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
@testtools.skipUnless(CONF.share.run_manage_unmanage_tests,
'Manage/Unmanage Tests are disabled.')
def test_unmanage_replicated_share_with_no_replica(self):
@ -145,7 +145,7 @@ class ReplicationAdminTest(base.BaseSharesAdminTest):
self.shares_v2_client.unmanage_share(share['id'])
self.shares_v2_client.wait_for_resource_deletion(share_id=share['id'])
@test.attr(type=["gate", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipUnless(CONF.share.run_manage_unmanage_snapshot_tests,
'Manage/Unmanage Snapshot Tests are disabled.')
def test_manage_replicated_share_snapshot(self):
@ -160,7 +160,7 @@ class ReplicationAdminTest(base.BaseSharesAdminTest):
provider_location="127.0.0.1:/fake_provider_location/"
"manila_share_9dc61f49_fbc8_48d7_9337_2f9593d9")
@test.attr(type=["gate", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipUnless(CONF.share.run_manage_unmanage_snapshot_tests,
'Manage/Unmanage Snapshot Tests are disabled.')
def test_unmanage_replicated_share_snapshot(self):
@ -174,7 +174,7 @@ class ReplicationAdminTest(base.BaseSharesAdminTest):
self.shares_v2_client.unmanage_snapshot,
snapshot_id=snapshot['id'])
@test.attr(type=["gate", "positive"])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipUnless(CONF.share.run_manage_unmanage_snapshot_tests,
'Manage/Unmanage Snapshot Tests are disabled.')
def test_unmanage_replicated_share_snapshot_with_no_replica(self):

View File

@ -23,7 +23,7 @@ CONF = config.CONF
class SchedulerStatsAdminTest(base.BaseSharesAdminTest):
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_pool_list(self):
# List pools
@ -36,7 +36,7 @@ class SchedulerStatsAdminTest(base.BaseSharesAdminTest):
actual_keys = set(pool.keys())
self.assertTrue(actual_keys.issuperset(required_keys))
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_pool_list_with_filters(self):
# List pools
@ -65,7 +65,7 @@ class SchedulerStatsAdminTest(base.BaseSharesAdminTest):
for k, v in search_opts.items():
self.assertEqual(v[1:-1], filtered_pool_list[0][k])
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_pool_list_with_filters_negative(self):
# Build search opts for a non-existent pool
@ -81,7 +81,7 @@ class SchedulerStatsAdminTest(base.BaseSharesAdminTest):
# Ensure we got no pools
self.assertEmpty(pool_list)
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_pool_list_detail(self):
# List pools
@ -94,7 +94,7 @@ class SchedulerStatsAdminTest(base.BaseSharesAdminTest):
actual_keys = set(pool.keys())
self.assertTrue(actual_keys.issuperset(required_keys))
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_pool_list_detail_with_filters(self):
# List pools
@ -123,7 +123,7 @@ class SchedulerStatsAdminTest(base.BaseSharesAdminTest):
for k, v in search_opts.items():
self.assertEqual(v[1:-1], filtered_pool_list[0][k])
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_pool_list_detail_with_filters_negative(self):
# Build search opts for a non-existent pool

View File

@ -46,7 +46,7 @@ class SecurityServiceAdminTest(
'kerberos',
**ss_kerberos_data)
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_list_security_services_all_tenants(self):
listed = self.shares_client.list_security_services(
params={'all_tenants': 1})
@ -57,7 +57,7 @@ class SecurityServiceAdminTest(
keys = ["name", "id", "status", "type", ]
[self.assertIn(key, s_s.keys()) for s_s in listed for key in keys]
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_list_security_services_invalid_filters(self):
listed = self.shares_client.list_security_services(
params={'fake_opt': 'some_value'})

View File

@ -26,7 +26,7 @@ class ServicesAdminTest(base.BaseSharesAdminTest):
super(ServicesAdminTest, self).setUp()
self.services = self.shares_client.list_services()
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
@ddt.data('shares_client', 'shares_v2_client')
def test_list_services(self, client_name):
services = getattr(self, client_name).list_services()
@ -35,7 +35,7 @@ class ServicesAdminTest(base.BaseSharesAdminTest):
for service in services:
self.assertIsNotNone(service['id'])
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
@ddt.data('shares_client', 'shares_v2_client')
def test_get_services_by_host_name(self, client_name):
host = self.services[0]["host"]
@ -45,7 +45,7 @@ class ServicesAdminTest(base.BaseSharesAdminTest):
for service in services:
self.assertEqual(host, service["host"])
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
@ddt.data('shares_client', 'shares_v2_client')
def test_get_services_by_binary_name(self, client_name):
binary = self.services[0]["binary"]
@ -55,7 +55,7 @@ class ServicesAdminTest(base.BaseSharesAdminTest):
for service in services:
self.assertEqual(binary, service["binary"])
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
@ddt.data('shares_client', 'shares_v2_client')
def test_get_services_by_availability_zone(self, client_name):
zone = self.services[0]["zone"]
@ -65,7 +65,7 @@ class ServicesAdminTest(base.BaseSharesAdminTest):
for service in services:
self.assertEqual(zone, service["zone"])
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
@ddt.data('shares_client', 'shares_v2_client')
def test_get_services_by_status(self, client_name):
status = self.services[0]["status"]
@ -75,7 +75,7 @@ class ServicesAdminTest(base.BaseSharesAdminTest):
for service in services:
self.assertEqual(status, service["status"])
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
@ddt.data('shares_client', 'shares_v2_client')
def test_get_services_by_state(self, client_name):
state = self.services[0]["state"]
@ -85,7 +85,7 @@ class ServicesAdminTest(base.BaseSharesAdminTest):
for service in services:
self.assertEqual(state, service["state"])
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
@ddt.data('shares_client', 'shares_v2_client')
def test_get_services_by_all_filters(self, client_name):
params = {

View File

@ -30,12 +30,12 @@ class ServicesAdminNegativeTest(base.BaseSharesAdminTest):
user_clients = clients.Manager()
cls.user_shares_client = user_clients.shares_client
@test.attr(type=["gate", "smoke", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_list_services_with_non_admin_user(self):
self.assertRaises(lib_exc.Forbidden,
self.user_shares_client.list_services)
@test.attr(type=["gate", "smoke", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_get_service_by_invalid_params(self):
# All services are expected if send the request with invalid parameter
services = self.shares_client.list_services()
@ -55,37 +55,37 @@ class ServicesAdminNegativeTest(base.BaseSharesAdminTest):
key=lambda service: service['id']),
msg)
@test.attr(type=["gate", "smoke", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_get_service_by_invalid_host(self):
params = {'host': 'fake_host'}
services_fake = self.shares_client.list_services(params)
self.assertEqual(0, len(services_fake))
@test.attr(type=["gate", "smoke", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_get_service_by_invalid_binary(self):
params = {'binary': 'fake_binary'}
services_fake = self.shares_client.list_services(params)
self.assertEqual(0, len(services_fake))
@test.attr(type=["gate", "smoke", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_get_service_by_invalid_zone(self):
params = {'zone': 'fake_zone'}
services_fake = self.shares_client.list_services(params)
self.assertEqual(0, len(services_fake))
@test.attr(type=["gate", "smoke", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_get_service_by_invalid_status(self):
params = {'status': 'fake_status'}
services_fake = self.shares_client.list_services(params)
self.assertEqual(0, len(services_fake))
@test.attr(type=["gate", "smoke", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_get_service_by_invalid_state(self):
params = {'state': 'fake_state'}
services_fake = self.shares_client.list_services(params)
self.assertEqual(0, len(services_fake))
@test.attr(type=["gate", "smoke", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
@ddt.data(
('os-services', '2.7'),
('services', '2.6'),

View File

@ -29,7 +29,7 @@ class ShareInstancesTest(base.BaseSharesAdminTest):
super(ShareInstancesTest, cls).resource_setup()
cls.share = cls.create_share()
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_get_instances_of_share_v2_3(self):
"""Test that we get only the 1 share instance back for the share."""
share_instances = self.shares_v2_client.get_instances_of_share(
@ -47,7 +47,7 @@ class ShareInstancesTest(base.BaseSharesAdminTest):
self.share['id'],
si['share_id']))
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_list_share_instances_v2_3(self):
"""Test that we get at least the share instance back for the share."""
share_instances = self.shares_v2_client.get_instances_of_share(
@ -83,14 +83,14 @@ class ShareInstancesTest(base.BaseSharesAdminTest):
'expected %s, got %s.' % (
si['id'], expected_keys, actual_keys))
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_get_share_instance_v2_3(self):
self._get_share_instance('2.3')
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_get_share_instance_v2_9(self):
self._get_share_instance('2.9')
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_get_share_instance_v2_10(self):
self._get_share_instance('2.10')

View File

@ -160,22 +160,22 @@ class ManageNFSShareTest(base.BaseSharesAdminTest):
self.shares_v2_client.get_share,
managed_share['id'])
@test.attr(type=["gate", "smoke"])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@base.skip_if_microversion_not_supported("2.5")
def test_manage_with_os_share_manage_url(self):
self._test_manage(share=self.shares[2], version="2.5")
@test.attr(type=["gate", "smoke"])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@base.skip_if_microversion_not_supported("2.8")
def test_manage_with_is_public_True(self):
self._test_manage(share=self.shares[3], is_public=True, version="2.8")
@test.attr(type=["gate", "smoke"])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@base.skip_if_microversion_not_supported("2.16")
def test_manage_show_user_id(self):
self._test_manage(share=self.shares[4], version="2.16")
@test.attr(type=["gate", "smoke"])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
def test_manage(self):
# After 'unmanage' operation, share instance should be deleted.
# Assert not related to 'manage' test, but placed here for
@ -186,7 +186,7 @@ class ManageNFSShareTest(base.BaseSharesAdminTest):
self._test_manage(share=self.shares[0])
@test.attr(type=["gate", "smoke", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_manage_invalid(self):
# Try to manage share with invalid parameters, it should not succeed
# because the scheduler will reject it. If it succeeds, then this test

View File

@ -76,7 +76,7 @@ class ShareNetworkAdminTest(
cls.sn_with_kerberos_ss["id"],
cls.ss_kerberos["id"])
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_list_share_networks_all_tenants(self):
listed = self.shares_client.list_share_networks_with_detail(
{'all_tenants': 1})
@ -85,7 +85,7 @@ class ShareNetworkAdminTest(
self.assertTrue(any(self.sn_with_kerberos_ss['id'] == sn['id']
for sn in listed))
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_list_share_networks_filter_by_project_id(self):
listed = self.shares_client.list_share_networks_with_detail(
{'project_id': self.sn_with_kerberos_ss['project_id']})

View File

@ -50,7 +50,7 @@ class ShareServersAdminTest(base.BaseSharesAdminTest):
cls.date_re = re.compile("^([0-9]{4}-[0-9]{2}-[0-9]{2}[A-Z]{1}"
"[0-9]{2}:[0-9]{2}:[0-9]{2}).*$")
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_list_share_servers_without_filters(self):
servers = self.shares_client.list_share_servers()
self.assertTrue(len(servers) > 0)
@ -81,7 +81,7 @@ class ShareServersAdminTest(base.BaseSharesAdminTest):
# Server we used is present.
any(s["share_network_name"] in self.sn_name_and_id for s in servers)
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_list_share_servers_with_host_filter(self):
# Get list of share servers and remember 'host' name
servers = self.shares_client.list_share_servers()
@ -107,7 +107,7 @@ class ShareServersAdminTest(base.BaseSharesAdminTest):
for server in servers:
self.assertEqual(server["host"], host)
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_list_share_servers_with_status_filter(self):
# Get list of share servers
servers = self.shares_client.list_share_servers()
@ -133,7 +133,7 @@ class ShareServersAdminTest(base.BaseSharesAdminTest):
for server in servers:
self.assertEqual(server["status"], status)
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_list_share_servers_with_project_id_filter(self):
search_opts = {"project_id": self.share_network["project_id"]}
servers = self.shares_client.list_share_servers(search_opts)
@ -143,7 +143,7 @@ class ShareServersAdminTest(base.BaseSharesAdminTest):
self.assertEqual(server["project_id"],
self.share_network["project_id"])
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_list_share_servers_with_share_network_name_filter(self):
search_opts = {"share_network": self.share_network["name"]}
servers = self.shares_client.list_share_servers(search_opts)
@ -153,7 +153,7 @@ class ShareServersAdminTest(base.BaseSharesAdminTest):
self.assertEqual(server["share_network_name"],
self.share_network["name"])
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_list_share_servers_with_share_network_id_filter(self):
search_opts = {"share_network": self.share_network["id"]}
servers = self.shares_client.list_share_servers(search_opts)
@ -163,7 +163,7 @@ class ShareServersAdminTest(base.BaseSharesAdminTest):
self.assertIn(server["share_network_name"],
self.sn_name_and_id)
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_show_share_server(self):
servers = self.shares_client.list_share_servers()
server = self.shares_client.show_share_server(servers[0]["id"])
@ -198,7 +198,7 @@ class ShareServersAdminTest(base.BaseSharesAdminTest):
# backend_details should be a dict
self.assertIsInstance(server["backend_details"], dict)
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_show_share_server_details(self):
servers = self.shares_client.list_share_servers()
details = self.shares_client.show_share_server_details(
@ -208,7 +208,6 @@ class ShareServersAdminTest(base.BaseSharesAdminTest):
self.assertIsInstance(k, six.string_types)
self.assertIsInstance(v, six.string_types)
@test.attr(type=["gate", "smoke", ])
def _delete_share_server(self, delete_share_network):
# Get network and subnet from existing share_network and reuse it
# to be able to delete share_server after test ends.
@ -266,10 +265,10 @@ class ShareServersAdminTest(base.BaseSharesAdminTest):
self.shares_client.wait_for_resource_deletion(
sn_id=new_sn["id"])
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_delete_share_server(self):
self._delete_share_server(False)
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_delete_share_server_by_deletion_of_share_network(self):
self._delete_share_server(True)

View File

@ -28,66 +28,66 @@ class ShareServersNegativeAdminTest(base.BaseSharesAdminTest):
super(ShareServersNegativeAdminTest, cls).resource_setup()
cls.member_shares_client = clients.Manager().shares_client
@test.attr(type=["gate", "smoke", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_list_share_servers_with_member(self):
self.assertRaises(lib_exc.Forbidden,
self.member_shares_client.list_share_servers)
@test.attr(type=["gate", "smoke", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_show_share_server_with_member(self):
self.assertRaises(lib_exc.Forbidden,
self.member_shares_client.show_share_server,
'fake_id')
@test.attr(type=["gate", "smoke", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_show_share_server_details_with_member(self):
self.assertRaises(lib_exc.Forbidden,
self.member_shares_client.show_share_server_details,
'fake_id')
@test.attr(type=["gate", "smoke", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_show_share_server_with_inexistent_id(self):
self.assertRaises(lib_exc.NotFound,
self.shares_client.show_share_server,
'fake_id')
@test.attr(type=["gate", "smoke", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_show_share_server_details_with_inexistent_id(self):
self.assertRaises(lib_exc.NotFound,
self.shares_client.show_share_server_details,
'fake_id')
@test.attr(type=["gate", "smoke", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_list_share_servers_with_wrong_filter_key(self):
search_opts = {'fake_filter_key': 'ACTIVE'}
servers = self.shares_client.list_share_servers(search_opts)
self.assertEqual(0, len(servers))
@test.attr(type=["gate", "smoke", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_list_share_servers_with_wrong_filter_value(self):
search_opts = {'host': 123}
servers = self.shares_client.list_share_servers(search_opts)
self.assertEqual(0, len(servers))
@test.attr(type=["gate", "smoke", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_list_share_servers_with_fake_status(self):
search_opts = {"status": data_utils.rand_name("fake_status")}
servers = self.shares_client.list_share_servers(search_opts)
self.assertEqual(0, len(servers))
@test.attr(type=["gate", "smoke", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_list_share_servers_with_fake_host(self):
search_opts = {"host": data_utils.rand_name("fake_host")}
servers = self.shares_client.list_share_servers(search_opts)
self.assertEqual(0, len(servers))
@test.attr(type=["gate", "smoke", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_list_share_servers_with_fake_project(self):
search_opts = {"project_id": data_utils.rand_name("fake_project_id")}
servers = self.shares_client.list_share_servers(search_opts)
self.assertEqual(0, len(servers))
@test.attr(type=["gate", "smoke", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_list_share_servers_with_fake_share_network(self):
search_opts = {
"share_network": data_utils.rand_name("fake_share_network"),
@ -95,13 +95,13 @@ class ShareServersNegativeAdminTest(base.BaseSharesAdminTest):
servers = self.shares_client.list_share_servers(search_opts)
self.assertEqual(0, len(servers))
@test.attr(type=["gate", "smoke", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_delete_share_server_with_nonexistent_id(self):
self.assertRaises(lib_exc.NotFound,
self.shares_client.delete_share_server,
"fake_nonexistent_share_server_id")
@test.attr(type=["gate", "smoke", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_delete_share_server_with_member(self):
self.assertRaises(lib_exc.Forbidden,
self.member_shares_client.delete_share_server,

View File

@ -28,7 +28,7 @@ CONF = config.CONF
@ddt.ddt
class ShareTypesAdminTest(base.BaseSharesAdminTest):
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_share_type_create_delete(self):
name = data_utils.rand_name("tempest-manila")
extra_specs = self.add_required_extra_specs_to_dict()
@ -58,7 +58,7 @@ class ShareTypesAdminTest(base.BaseSharesAdminTest):
self.assertIn(old_key_name, share_type)
self.assertNotIn(new_key_name, share_type)
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
@ddt.data('2.0', '2.6', '2.7')
def test_share_type_create_get(self, version):
self.skip_if_microversion_not_supported(version)
@ -83,7 +83,7 @@ class ShareTypesAdminTest(base.BaseSharesAdminTest):
# Check that backwards compatibility didn't break
self.assertDictMatch(get["volume_type"], get["share_type"])
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
@ddt.data('2.0', '2.6', '2.7')
def test_share_type_create_list(self, version):
self.skip_if_microversion_not_supported(version)
@ -111,7 +111,7 @@ class ShareTypesAdminTest(base.BaseSharesAdminTest):
for i in range(len(sts)):
self.assertDictMatch(sts[i], vts[i])
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_get_share_with_share_type(self):
# Data
@ -141,6 +141,7 @@ class ShareTypesAdminTest(base.BaseSharesAdminTest):
self.assertEqual(st_create["share_type"]["id"], get["share_type"])
self.assertEqual(shr_type_name, get["share_type_name"])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_private_share_type_access(self):
name = data_utils.rand_name("tempest-manila")
extra_specs = self.add_required_extra_specs_to_dict({"key": "value", })

View File

@ -40,14 +40,14 @@ class ExtraSpecsReadAdminTest(base.BaseSharesAdminTest):
cls.shares_client.create_share_type_extra_specs(
cls.st_id, cls.custom_extra_specs)
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_get_one_share_type_extra_spec(self):
es_get_one = self.shares_client.get_share_type_extra_spec(
self.st_id, "key1")
self.assertEqual({"key1": self.custom_extra_specs["key1"]}, es_get_one)
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_get_all_share_type_extra_specs(self):
es_get_all = self.shares_client.get_share_type_extra_specs(self.st_id)
@ -72,7 +72,7 @@ class ExtraSpecsWriteAdminTest(base.BaseSharesAdminTest):
self.shares_client.create_share_type_extra_specs(
self.st_id, self.custom_extra_specs)
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_update_one_share_type_extra_spec(self):
self.custom_extra_specs["key1"] = "fake_value1_updated"
@ -86,7 +86,7 @@ class ExtraSpecsWriteAdminTest(base.BaseSharesAdminTest):
expected_extra_specs.update(self.required_extra_specs)
self.assertEqual(self.custom_extra_specs, get)
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_update_all_share_type_extra_specs(self):
self.custom_extra_specs["key2"] = "value2_updated"
@ -100,7 +100,7 @@ class ExtraSpecsWriteAdminTest(base.BaseSharesAdminTest):
expected_extra_specs.update(self.required_extra_specs)
self.assertEqual(self.custom_extra_specs, get)
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_delete_one_share_type_extra_spec(self):
# Delete one extra spec for share type
self.shares_client.delete_share_type_extra_spec(self.st_id, "key1")

View File

@ -33,7 +33,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesAdminTest):
super(ExtraSpecsAdminNegativeTest, cls).resource_setup()
cls.member_shares_client = clients.Manager().shares_client
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_create_extra_specs_with_user(self):
st = self._create_share_type()
self.assertRaises(
@ -42,7 +42,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesAdminTest):
st["share_type"]["id"],
self.add_required_extra_specs_to_dict({"key": "new_value"}))
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_list_extra_specs_with_user(self):
st = self._create_share_type()
self.assertRaises(
@ -50,7 +50,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesAdminTest):
self.member_shares_client.get_share_type_extra_specs,
st["share_type"]["id"])
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_get_extra_spec_with_user(self):
st = self._create_share_type()
self.assertRaises(
@ -58,7 +58,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesAdminTest):
self.member_shares_client.get_share_type_extra_spec,
st["share_type"]["id"], "key")
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_get_extra_specs_with_user(self):
st = self._create_share_type()
self.assertRaises(
@ -66,7 +66,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesAdminTest):
self.member_shares_client.get_share_type_extra_specs,
st["share_type"]["id"])
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_read_extra_specs_on_share_type_with_user(self):
st = self._create_share_type()
share_type = self.member_shares_client.get_share_type(
@ -78,7 +78,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesAdminTest):
'Incorrect extra specs visible to non-admin user; '
'expected %s, got %s' % (expected_keys, actual_keys))
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_update_extra_spec_with_user(self):
st = self._create_share_type()
self.assertRaises(
@ -86,7 +86,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesAdminTest):
self.member_shares_client.update_share_type_extra_spec,
st["share_type"]["id"], "key", "new_value")
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_update_extra_specs_with_user(self):
st = self._create_share_type()
self.assertRaises(
@ -94,7 +94,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesAdminTest):
self.member_shares_client.update_share_type_extra_specs,
st["share_type"]["id"], {"key": "new_value"})
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_delete_extra_specs_with_user(self):
st = self._create_share_type()
self.assertRaises(
@ -102,7 +102,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesAdminTest):
self.member_shares_client.delete_share_type_extra_spec,
st["share_type"]["id"], "key")
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_set_too_long_key(self):
too_big_key = "k" * 256
st = self._create_share_type()
@ -112,7 +112,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesAdminTest):
st["share_type"]["id"],
self.add_required_extra_specs_to_dict({too_big_key: "value"}))
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_set_too_long_value_with_creation(self):
too_big_value = "v" * 256
st = self._create_share_type()
@ -122,7 +122,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesAdminTest):
st["share_type"]["id"],
self.add_required_extra_specs_to_dict({"key": too_big_value}))
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_set_too_long_value_with_update(self):
too_big_value = "v" * 256
st = self._create_share_type()
@ -135,7 +135,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesAdminTest):
st["share_type"]["id"],
self.add_required_extra_specs_to_dict({"key": too_big_value}))
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_set_too_long_value_with_update_of_one_key(self):
too_big_value = "v" * 256
st = self._create_share_type()
@ -146,121 +146,121 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesAdminTest):
self.shares_client.update_share_type_extra_spec,
st["share_type"]["id"], "key", too_big_value)
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_list_es_with_empty_shr_type_id(self):
self.assertRaises(lib_exc.NotFound,
self.shares_client.get_share_type_extra_specs, "")
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_list_es_with_invalid_shr_type_id(self):
self.assertRaises(lib_exc.NotFound,
self.shares_client.get_share_type_extra_specs,
data_utils.rand_name("fake"))
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_create_es_with_empty_shr_type_id(self):
self.assertRaises(lib_exc.NotFound,
self.shares_client.create_share_type_extra_specs,
"", {"key1": "value1", })
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_create_es_with_invalid_shr_type_id(self):
self.assertRaises(lib_exc.NotFound,
self.shares_client.create_share_type_extra_specs,
data_utils.rand_name("fake"), {"key1": "value1", })
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_create_es_with_empty_specs(self):
st = self._create_share_type()
self.assertRaises(lib_exc.BadRequest,
self.shares_client.create_share_type_extra_specs,
st["share_type"]["id"], "")
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_create_es_with_invalid_specs(self):
st = self._create_share_type()
self.assertRaises(lib_exc.BadRequest,
self.shares_client.create_share_type_extra_specs,
st["share_type"]["id"], {"": "value_with_empty_key"})
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_get_extra_spec_with_empty_key(self):
st = self._create_share_type()
self.assertRaises(lib_exc.NotFound,
self.shares_client.get_share_type_extra_spec,
st["share_type"]["id"], "")
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_get_extra_spec_with_invalid_key(self):
st = self._create_share_type()
self.assertRaises(lib_exc.NotFound,
self.shares_client.get_share_type_extra_spec,
st["share_type"]["id"], data_utils.rand_name("fake"))
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_get_extra_specs_with_empty_shr_type_id(self):
self.assertRaises(lib_exc.NotFound,
self.shares_client.get_share_type_extra_specs,
"")
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_get_extra_specs_with_invalid_shr_type_id(self):
self.assertRaises(lib_exc.NotFound,
self.shares_client.get_share_type_extra_specs,
data_utils.rand_name("fake"))
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_delete_es_key_with_empty_shr_type_id(self):
self.assertRaises(lib_exc.NotFound,
self.shares_client.delete_share_type_extra_spec,
"", "key", )
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_delete_es_key_with_invalid_shr_type_id(self):
self.assertRaises(lib_exc.NotFound,
self.shares_client.delete_share_type_extra_spec,
data_utils.rand_name("fake"), "key", )
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_delete_with_invalid_key(self):
st = self._create_share_type()
self.assertRaises(lib_exc.NotFound,
self.shares_client.delete_share_type_extra_spec,
st["share_type"]["id"], data_utils.rand_name("fake"))
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_update_spec_with_empty_shr_type_id(self):
self.assertRaises(lib_exc.NotFound,
self.shares_client.update_share_type_extra_spec,
"", "key", "new_value")
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_update_spec_with_invalid_shr_type_id(self):
self.assertRaises(lib_exc.NotFound,
self.shares_client.update_share_type_extra_spec,
data_utils.rand_name("fake"), "key", "new_value")
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_update_spec_with_empty_key(self):
st = self._create_share_type()
self.assertRaises(lib_exc.NotFound,
self.shares_client.update_share_type_extra_spec,
st["share_type"]["id"], "", "new_value")
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_update_with_invalid_shr_type_id(self):
self.assertRaises(lib_exc.NotFound,
self.shares_client.update_share_type_extra_specs,
data_utils.rand_name("fake"), {"key": "new_value"})
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_update_with_invalid_specs(self):
st = self._create_share_type()
self.assertRaises(lib_exc.BadRequest,
self.shares_client.update_share_type_extra_specs,
st["share_type"]["id"], {"": "new_value"})
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_delete_spec_driver_handles_share_servers(self):
st = self._create_share_type()
@ -270,7 +270,7 @@ class ExtraSpecsAdminNegativeTest(base.BaseSharesAdminTest):
st["share_type"]["id"],
"driver_handles_share_servers")
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_delete_spec_snapshot_support(self):
st = self._create_share_type()

View File

@ -33,35 +33,35 @@ class ShareTypesAdminNegativeTest(base.BaseSharesAdminTest):
super(ShareTypesAdminNegativeTest, cls).resource_setup()
cls.member_shares_client = clients.Manager().shares_client
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_create_share_with_nonexistent_share_type(self):
self.assertRaises(lib_exc.NotFound,
self.create_share,
share_type_id=data_utils.rand_name("fake"))
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_create_share_type_with_empty_name(self):
self.assertRaises(lib_exc.BadRequest, self.create_share_type, '')
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_create_share_type_with_too_big_name(self):
self.assertRaises(lib_exc.BadRequest,
self.create_share_type,
"x" * 256)
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_get_share_type_by_nonexistent_id(self):
self.assertRaises(lib_exc.NotFound,
self.shares_client.get_share_type,
data_utils.rand_name("fake"))
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_delete_share_type_by_nonexistent_id(self):
self.assertRaises(lib_exc.NotFound,
self.shares_client.delete_share_type,
data_utils.rand_name("fake"))
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_create_duplicate_of_share_type(self):
st = self._create_share_type()
self.assertRaises(lib_exc.Conflict,
@ -69,7 +69,7 @@ class ShareTypesAdminNegativeTest(base.BaseSharesAdminTest):
st["share_type"]["name"],
extra_specs=self.add_required_extra_specs_to_dict())
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_add_share_type_allowed_for_public(self):
st = self._create_share_type()
self.assertRaises(lib_exc.Conflict,
@ -77,7 +77,7 @@ class ShareTypesAdminNegativeTest(base.BaseSharesAdminTest):
st["share_type"]["id"],
self.shares_client.tenant_id)
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_remove_share_type_allowed_for_public(self):
st = self._create_share_type()
self.assertRaises(lib_exc.Conflict,
@ -85,14 +85,14 @@ class ShareTypesAdminNegativeTest(base.BaseSharesAdminTest):
st["share_type"]["id"],
self.shares_client.tenant_id)
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_add_share_type_by_nonexistent_id(self):
self.assertRaises(lib_exc.NotFound,
self.shares_client.add_access_to_share_type,
data_utils.rand_name("fake"),
self.shares_client.tenant_id)
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_remove_share_type_by_nonexistent_id(self):
self.assertRaises(lib_exc.NotFound,
self.shares_client.remove_access_from_share_type,

View File

@ -82,7 +82,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
snapshot_id=cls.snap['id'],
))
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_get_share(self):
# get share
@ -109,7 +109,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
share["size"])
self.assertEqual(self.share_size, int(share["size"]), msg)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_list_shares(self):
# list shares
@ -125,7 +125,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
msg = "expected id lists %s times in share list" % (len(gen))
self.assertEqual(1, len(gen), msg)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_list_shares_with_detail(self):
# list shares
@ -145,7 +145,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
msg = "expected id lists %s times in share list" % (len(gen))
self.assertEqual(1, len(gen), msg)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_list_shares_with_detail_filter_by_metadata(self):
filters = {'metadata': self.metadata}
@ -160,7 +160,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
if CONF.share.run_snapshot_tests:
self.assertFalse(self.shares[1]['id'] in [s['id'] for s in shares])
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_list_shares_with_detail_filter_by_extra_specs(self):
filters = {
"extra_specs": {
@ -193,7 +193,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
extra_specs = self.shares_client.get_share_type_extra_specs(st_id)
self.assertDictContainsSubset(filters["extra_specs"], extra_specs)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_list_shares_with_detail_filter_by_share_type_id(self):
filters = {'share_type_id': self.st['share_type']['id']}
@ -223,7 +223,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
for share in self.shares:
self.assertTrue(share['id'] in share_ids)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_list_shares_with_detail_filter_by_host(self):
base_share = self.shares_client.get_share(self.shares[0]['id'])
filters = {'host': base_share['host']}
@ -236,7 +236,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
for share in shares:
self.assertEqual(filters['host'], share['host'])
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipIf(
not CONF.share.multitenancy_enabled, "Only for multitenancy.")
def test_list_shares_with_detail_filter_by_share_network_id(self):
@ -252,7 +252,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
self.assertEqual(
filters['share_network_id'], share['share_network_id'])
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
def test_list_shares_with_detail_filter_by_snapshot_id(self):
@ -267,7 +267,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
self.assertEqual(filters['snapshot_id'], share['snapshot_id'])
self.assertFalse(self.shares[0]['id'] in [s['id'] for s in shares])
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_list_shares_with_detail_with_asc_sorting(self):
filters = {'sort_key': 'created_at', 'sort_dir': 'asc'}
@ -279,21 +279,21 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
sorted_list = [share['created_at'] for share in shares]
self.assertEqual(sorted(sorted_list), sorted_list)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_list_shares_with_detail_filter_by_existed_name(self):
# list shares by name, at least one share is expected
params = {"name": self.share_name}
shares = self.shares_client.list_shares_with_detail(params)
self.assertEqual(self.share_name, shares[0]["name"])
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_list_shares_with_detail_filter_by_fake_name(self):
# list shares by fake name, no shares are expected
params = {"name": data_utils.rand_name("fake-nonexistent-name")}
shares = self.shares_client.list_shares_with_detail(params)
self.assertEqual(0, len(shares))
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_list_shares_with_detail_filter_by_active_status(self):
# list shares by active status, at least one share is expected
params = {"status": "available"}
@ -302,14 +302,14 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
for share in shares:
self.assertEqual(params["status"], share["status"])
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_list_shares_with_detail_filter_by_fake_status(self):
# list shares by fake status, no shares are expected
params = {"status": 'fake'}
shares = self.shares_client.list_shares_with_detail(params)
self.assertEqual(0, len(shares))
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
def test_get_snapshot(self):
@ -337,7 +337,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
"actual share_id: '%s'" % (self.shares[0]["id"], get["share_id"])
self.assertEqual(self.shares[0]["id"], get["share_id"], msg)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
def test_list_snapshots(self):
@ -354,7 +354,7 @@ class SharesActionsAdminTest(base.BaseSharesAdminTest):
msg = "expected id lists %s times in share list" % (len(gen))
self.assertEqual(1, len(gen), msg)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
def test_list_snapshots_with_detail(self):

View File

@ -125,7 +125,7 @@ class ManageNFSSnapshotTest(base.BaseSharesAdminTest):
self.shares_v2_client.get_snapshot,
get_snapshot['id'])
@test.attr(type=["gate", "smoke"])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
def test_manage(self):
# Manage snapshot
self._test_manage(snapshot=self.snapshot)

View File

@ -62,7 +62,7 @@ class ManageNFSSnapshotNegativeTest(base.BaseSharesAdminTest):
share_protocol=cls.protocol
)
@test.attr(type=["gate", "smoke", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_manage_not_found(self):
# Manage snapshot fails
self.assertRaises(lib_exc.NotFound,
@ -71,7 +71,7 @@ class ManageNFSSnapshotNegativeTest(base.BaseSharesAdminTest):
'fake-vol-snap-id',
driver_options={})
@test.attr(type=["gate", "smoke", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_manage_already_exists(self):
# Manage already existing snapshot fails

View File

@ -15,6 +15,7 @@
import copy
import inspect
import re
import traceback
from oslo_concurrency import lockutils
@ -35,6 +36,37 @@ from manila_tempest_tests import utils
CONF = config.CONF
LOG = log.getLogger(__name__)
# Test tags related to test direction
TAG_POSITIVE = "positive"
TAG_NEGATIVE = "negative"
# Test tags related to service involvement
TAG_API = "api"
TAG_BACKEND = "backend"
TAG_API_WITH_BACKEND = "api_with_backend"
TAGS_MAPPER = {
"p": TAG_POSITIVE,
"n": TAG_NEGATIVE,
"a": TAG_API,
"b": TAG_BACKEND,
"ab": TAG_API_WITH_BACKEND,
}
TAGS_PATTERN = re.compile(
r"(?=.*\[.*\b(%(p)s|%(n)s)\b.*\])(?=.*\[.*\b(%(a)s|%(b)s|%(ab)s)\b.*\])" %
TAGS_MAPPER)
def verify_test_has_appropriate_tags(self):
if not TAGS_PATTERN.match(self.id()):
msg = (
"Required attributes either not set or set improperly. "
"Two test attributes are expected:\n"
" - one of '%(p)s' or '%(n)s' and \n"
" - one of '%(a)s', '%(b)s' or '%(ab)s'."
) % TAGS_MAPPER
raise self.failureException(msg)
class handle_cleanup_exceptions(object):
"""Handle exceptions raised with cleanup operations.
@ -219,6 +251,7 @@ class BaseSharesTest(test.BaseTestCase):
super(BaseSharesTest, self).setUp()
self.addCleanup(self.clear_isolated_creds)
self.addCleanup(self.clear_resources)
verify_test_has_appropriate_tags(self)
@classmethod
def resource_cleanup(cls):

View File

@ -28,14 +28,14 @@ class AvailabilityZonesTest(base.BaseSharesTest):
for key in keys:
self.assertIn(key, az)
@test.attr(type=["smoke", "gate"])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_list_availability_zones_legacy_url_api_v1(self):
# NOTE(vponomaryov): remove this test with removal of availability zone
# extension url support.
azs = self.shares_client.list_availability_zones()
self._list_availability_zones_assertions(azs)
@test.attr(type=["smoke", "gate"])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
@base.skip_if_microversion_not_supported("2.6")
def test_list_availability_zones_legacy_url_api_v2(self):
# NOTE(vponomaryov): remove this test with removal of availability zone
@ -44,7 +44,7 @@ class AvailabilityZonesTest(base.BaseSharesTest):
url='os-availability-zone', version='2.6')
self._list_availability_zones_assertions(azs)
@test.attr(type=["smoke", "gate"])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
@base.skip_if_microversion_not_supported("2.7")
def test_list_availability_zones(self):
azs = self.shares_v2_client.list_availability_zones(version='2.7')

View File

@ -22,7 +22,7 @@ from manila_tempest_tests.tests.api import base
@base.skip_if_microversion_not_supported("2.7")
class AvailabilityZonesNegativeTest(base.BaseSharesTest):
@test.attr(type=["smoke", "gate"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_list_availability_zones_api_not_found_with_legacy_url(self):
# NOTE(vponomaryov): remove this test with removal of availability zone
# extension url support.
@ -33,7 +33,7 @@ class AvailabilityZonesNegativeTest(base.BaseSharesTest):
version='2.7',
)
@test.attr(type=["smoke", "gate"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_list_availability_zones_api_not_found(self):
self.assertRaises(
lib_exc.NotFound,

View File

@ -79,7 +79,7 @@ class ConsistencyGroupActionsTest(base.BaseSharesTest):
cls.cgsnapshot2 = cls.create_cgsnapshot_wait_for_active(
cls.cg2['id'], name=cls.cgsnap_name, description=cls.cgsnap_desc)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_get_consistency_group_v2_4(self):
# Get consistency group
@ -105,7 +105,7 @@ class ConsistencyGroupActionsTest(base.BaseSharesTest):
self.assertEqual(self.cg_desc, str(consistency_group["description"]),
msg)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_get_share_v2_4(self):
# Get share
@ -141,7 +141,7 @@ class ConsistencyGroupActionsTest(base.BaseSharesTest):
self.cg["id"], share["consistency_group_id"])
self.assertEqual(self.cg["id"], share["consistency_group_id"], msg)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_list_consistency_groups_v2_4(self):
# List consistency groups
@ -160,7 +160,7 @@ class ConsistencyGroupActionsTest(base.BaseSharesTest):
cg_id)
self.assertEqual(1, len(gen), msg)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_list_consistency_groups_with_detail_v2_4(self):
# List consistency groups
@ -179,7 +179,7 @@ class ConsistencyGroupActionsTest(base.BaseSharesTest):
cg_id)
self.assertEqual(1, len(gen), msg)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_filter_shares_by_consistency_group_id_v2_4(self):
shares = self.shares_v2_client.list_shares(
@ -200,7 +200,7 @@ class ConsistencyGroupActionsTest(base.BaseSharesTest):
'Share %s expected in returned list, but got %s'
% (self.shares[0]['id'], share_ids))
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_get_cgsnapshot_v2_4(self):
# Get consistency group
@ -226,7 +226,7 @@ class ConsistencyGroupActionsTest(base.BaseSharesTest):
self.assertEqual(self.cg_desc, str(consistency_group["description"]),
msg)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_get_cgsnapshot_members_v2_4(self):
cgsnapshot_members = self.shares_v2_client.list_cgsnapshot_members(
@ -251,7 +251,7 @@ class ConsistencyGroupActionsTest(base.BaseSharesTest):
# self.assertEqual(share['share_type'],
# member['share_type_id'])
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
def test_create_consistency_group_from_populated_cgsnapshot_v2_4(self):
cgsnapshot_members = self.shares_v2_client.list_cgsnapshot_members(
@ -319,7 +319,7 @@ class ConsistencyGroupRenameTest(base.BaseSharesTest):
description=cls.cg_desc,
)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_update_consistency_group_v2_4(self):
# Get consistency_group
@ -346,7 +346,7 @@ class ConsistencyGroupRenameTest(base.BaseSharesTest):
self.assertEqual(new_name, consistency_group["name"])
self.assertEqual(new_desc, consistency_group["description"])
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_create_update_read_consistency_group_with_unicode_v2_4(self):
value1 = u'ಠ_ಠ'
value2 = u'ಠ_ರೃ'

View File

@ -32,7 +32,7 @@ CGSNAPSHOT_REQUIRED_ELEMENTS = {"id", "name", "description", "created_at",
class ConsistencyGroupsTest(base.BaseSharesTest):
"""Covers consistency group functionality."""
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
def test_create_populate_delete_consistency_group_v2_4(self):
# Create a consistency group
consistency_group = self.create_consistency_group(
@ -65,7 +65,7 @@ class ConsistencyGroupsTest(base.BaseSharesTest):
self.shares_client.get_share,
share['id'])
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_create_delete_empty_cgsnapshot_v2_4(self):
# Create base consistency group
consistency_group = self.create_consistency_group(
@ -98,7 +98,7 @@ class ConsistencyGroupsTest(base.BaseSharesTest):
cgsnapshot['id'],
version='2.4')
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_create_consistency_group_from_empty_cgsnapshot(self):
# Create base consistency group
consistency_group = self.create_consistency_group(

View File

@ -24,6 +24,86 @@ from manila_tempest_tests.tests.api import base
CONF = config.CONF
@testtools.skipUnless(CONF.share.run_consistency_group_tests,
'Consistency Group tests disabled.')
class ConsistencyGroupsAPIOnlyNegativeTest(base.BaseSharesTest):
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_delete_cg_without_passing_cg_id_v2_4(self):
self.assertRaises(lib_exc.NotFound,
self.shares_v2_client.delete_consistency_group,
'',
version='2.4')
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_delete_cg_with_wrong_id_v2_4(self):
self.assertRaises(lib_exc.NotFound,
self.shares_v2_client.delete_consistency_group,
"wrong_consistency_group_id",
version='2.4')
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_update_cg_with_wrong_id_v2_4(self):
self.assertRaises(lib_exc.NotFound,
self.shares_v2_client.update_consistency_group,
'wrong_consistency_group_id',
name='new_name',
description='new_description',
version='2.4')
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_get_cg_without_passing_cg_id_v2_4(self):
self.assertRaises(lib_exc.NotFound,
self.shares_v2_client.get_consistency_group,
'',
version='2.4')
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_filter_shares_on_invalid_cg_id_v2_4(self):
shares = self.shares_v2_client.list_shares(
detailed=True,
params={'consistency_group_id': 'foobar'},
version='2.4',
)
self.assertEqual(0, len(shares),
'Incorrect number of shares returned. Expected 0, '
'got %s.' % len(shares))
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_create_cgsnapshot_with_invalid_cg_id_value_v2_4(self):
self.assertRaises(lib_exc.BadRequest,
self.create_cgsnapshot_wait_for_active,
'foobar',
cleanup_in_class=False,
version='2.4')
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_create_cg_with_invalid_share_type_id_value_v2_4(self):
self.assertRaises(lib_exc.BadRequest,
self.create_consistency_group,
share_type_ids=['foobar'],
cleanup_in_class=False,
version='2.4')
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_create_cg_with_invalid_share_network_id_value_v2_4(self):
self.assertRaises(lib_exc.BadRequest,
self.create_consistency_group,
share_network_id='foobar',
cleanup_in_class=False,
version='2.4')
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_create_cg_with_invalid_source_cgsnapshot_id_value_v2_4(
self):
self.assertRaises(lib_exc.BadRequest,
self.create_consistency_group,
source_cgsnapshot_id='foobar',
cleanup_in_class=False,
version='2.4')
@testtools.skipUnless(CONF.share.run_consistency_group_tests,
'Consistency Group tests disabled.')
class ConsistencyGroupsNegativeTest(base.BaseSharesTest):
@ -56,16 +136,7 @@ class ConsistencyGroupsNegativeTest(base.BaseSharesTest):
name=cls.cgsnap_name,
description=cls.cgsnap_desc)
@test.attr(type=["negative", "smoke", "gate", ])
def test_create_cg_with_invalid_source_cgsnapshot_id_value_v2_4(
self):
self.assertRaises(lib_exc.BadRequest,
self.create_consistency_group,
source_cgsnapshot_id='foobar',
cleanup_in_class=False,
version='2.4')
@test.attr(type=["negative", "smoke", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_create_cg_with_nonexistent_source_cgsnapshot_id_value_v2_4(self):
self.assertRaises(lib_exc.BadRequest,
self.create_consistency_group,
@ -73,15 +144,7 @@ class ConsistencyGroupsNegativeTest(base.BaseSharesTest):
cleanup_in_class=False,
version='2.4')
@test.attr(type=["negative", "smoke", "gate", ])
def test_create_cg_with_invalid_share_network_id_value_v2_4(self):
self.assertRaises(lib_exc.BadRequest,
self.create_consistency_group,
share_network_id='foobar',
cleanup_in_class=False,
version='2.4')
@test.attr(type=["negative", "smoke", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_create_cg_with_nonexistent_share_network_id_value_v2_4(self):
self.assertRaises(lib_exc.BadRequest,
self.create_consistency_group,
@ -89,15 +152,7 @@ class ConsistencyGroupsNegativeTest(base.BaseSharesTest):
cleanup_in_class=False,
version='2.4')
@test.attr(type=["negative", "smoke", "gate", ])
def test_create_cg_with_invalid_share_type_id_value_v2_4(self):
self.assertRaises(lib_exc.BadRequest,
self.create_consistency_group,
share_type_ids=['foobar'],
cleanup_in_class=False,
version='2.4')
@test.attr(type=["negative", "smoke", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_create_cg_with_nonexistent_share_type_id_value_v2_4(self):
self.assertRaises(lib_exc.BadRequest,
self.create_consistency_group,
@ -105,15 +160,7 @@ class ConsistencyGroupsNegativeTest(base.BaseSharesTest):
cleanup_in_class=False,
version='2.4')
@test.attr(type=["negative", "smoke", "gate", ])
def test_create_cgsnapshot_with_invalid_cg_id_value_v2_4(self):
self.assertRaises(lib_exc.BadRequest,
self.create_cgsnapshot_wait_for_active,
'foobar',
cleanup_in_class=False,
version='2.4')
@test.attr(type=["negative", "smoke", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_create_cgsnapshot_with_nonexistent_cg_id_value_v2_4(self):
self.assertRaises(lib_exc.BadRequest,
self.create_cgsnapshot_wait_for_active,
@ -121,44 +168,7 @@ class ConsistencyGroupsNegativeTest(base.BaseSharesTest):
cleanup_in_class=False,
version='2.4')
@test.attr(type=["negative", "smoke", "gate", ])
def test_get_cg_with_wrong_id_v2_4(self):
self.assertRaises(lib_exc.NotFound,
self.shares_v2_client.get_consistency_group,
"wrong_consistency_group_id",
version='2.4')
@test.attr(type=["negative", "smoke", "gate", ])
def test_get_cg_without_passing_cg_id_v2_4(self):
self.assertRaises(lib_exc.NotFound,
self.shares_v2_client.get_consistency_group,
'',
version='2.4')
@test.attr(type=["negative", "smoke", "gate", ])
def test_update_cg_with_wrong_id_v2_4(self):
self.assertRaises(lib_exc.NotFound,
self.shares_v2_client.update_consistency_group,
'wrong_consistency_group_id',
name='new_name',
description='new_description',
version='2.4')
@test.attr(type=["negative", "smoke", "gate", ])
def test_delete_cg_with_wrong_id_v2_4(self):
self.assertRaises(lib_exc.NotFound,
self.shares_v2_client.delete_consistency_group,
"wrong_consistency_group_id",
version='2.4')
@test.attr(type=["negative", "smoke", "gate", ])
def test_delete_cg_without_passing_cg_id_v2_4(self):
self.assertRaises(lib_exc.NotFound,
self.shares_v2_client.delete_consistency_group,
'',
version='2.4')
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_delete_cg_in_use_by_cgsnapshot_v2_4(self):
# Attempt delete of share type
self.assertRaises(lib_exc.Conflict,
@ -166,7 +176,7 @@ class ConsistencyGroupsNegativeTest(base.BaseSharesTest):
self.consistency_group['id'],
version='2.4')
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_delete_share_in_use_by_cgsnapshot_v2_4(self):
# Attempt delete of share type
params = {'consistency_group_id': self.share['consistency_group_id']}
@ -176,7 +186,7 @@ class ConsistencyGroupsNegativeTest(base.BaseSharesTest):
params=params,
version='2.4')
@test.attr(type=["negative", "smoke", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_delete_cg_containing_a_share_v2_4(self):
self.assertRaises(lib_exc.Conflict,
self.shares_v2_client.delete_consistency_group,
@ -187,19 +197,7 @@ class ConsistencyGroupsNegativeTest(base.BaseSharesTest):
self.consistency_group['id'], version='2.4')
self.assertEqual('available', cg['status'])
@test.attr(type=["negative", "smoke", "gate", ])
def test_filter_shares_on_invalid_cg_id_v2_4(self):
shares = self.shares_v2_client.list_shares(
detailed=True,
params={'consistency_group_id': 'foobar'},
version='2.4'
)
self.assertEqual(0, len(shares),
'Incorrect number of shares returned. Expected 0, '
'got %s.' % len(shares))
@test.attr(type=["negative", "smoke", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_filter_shares_on_nonexistent_cg_id_v2_4(self):
shares = self.shares_v2_client.list_shares(
detailed=True,
@ -211,7 +209,7 @@ class ConsistencyGroupsNegativeTest(base.BaseSharesTest):
'Incorrect number of shares returned. Expected 0, '
'got %s.' % len(shares))
@test.attr(type=["negative", "smoke", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_filter_shares_on_empty_cg_id_v2_4(self):
consistency_group = self.create_consistency_group(
name='tempest_cg',

View File

@ -20,7 +20,7 @@ from manila_tempest_tests.tests.api import base
class ExtensionsTest(base.BaseSharesTest):
@test.attr(type=["smoke", "gate"])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_extensions(self):
# get extensions

View File

@ -20,7 +20,7 @@ from manila_tempest_tests.tests.api import base
class ShareLimitsTest(base.BaseSharesTest):
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_limits_keys(self):
# list limits
@ -44,7 +44,7 @@ class ShareLimitsTest(base.BaseSharesTest):
]
[self.assertIn(key, limits["absolute"].keys()) for key in abs_keys]
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_limits_values(self):
# list limits

View File

@ -25,7 +25,7 @@ class SharesMetadataTest(base.BaseSharesTest):
super(SharesMetadataTest, cls).resource_setup()
cls.share = cls.create_share()
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_set_metadata_in_share_creation(self):
md = {u"key1": u"value1", u"key2": u"value2", }
@ -39,7 +39,7 @@ class SharesMetadataTest(base.BaseSharesTest):
# verify metadata
self.assertEqual(md, metadata)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_set_get_delete_metadata(self):
md = {u"key3": u"value3", u"key4": u"value4", }
@ -64,7 +64,7 @@ class SharesMetadataTest(base.BaseSharesTest):
get_metadata = self.shares_client.get_metadata(share["id"])
self.assertEqual({}, get_metadata)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_set_and_update_metadata_by_key(self):
md1 = {u"key5": u"value5", u"key6": u"value6", }
@ -85,7 +85,7 @@ class SharesMetadataTest(base.BaseSharesTest):
# verify metadata
self.assertEqual(md2, get_md)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_set_metadata_min_size_key(self):
data = {"k": "value"}
@ -94,7 +94,7 @@ class SharesMetadataTest(base.BaseSharesTest):
body_get = self.shares_client.get_metadata(self.share["id"])
self.assertEqual(data['k'], body_get.get('k'))
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_set_metadata_max_size_key(self):
max_key = "k" * 255
data = {max_key: "value"}
@ -105,7 +105,7 @@ class SharesMetadataTest(base.BaseSharesTest):
self.assertIn(max_key, body_get)
self.assertEqual(data[max_key], body_get.get(max_key))
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_set_metadata_min_size_value(self):
data = {"key": "v"}
@ -114,7 +114,7 @@ class SharesMetadataTest(base.BaseSharesTest):
body_get = self.shares_client.get_metadata(self.share["id"])
self.assertEqual(data['key'], body_get['key'])
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_set_metadata_max_size_value(self):
max_value = "v" * 1023
data = {"key": max_value}
@ -124,7 +124,7 @@ class SharesMetadataTest(base.BaseSharesTest):
body_get = self.shares_client.get_metadata(self.share["id"])
self.assertEqual(data['key'], body_get['key'])
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_upd_metadata_min_size_key(self):
data = {"k": "value"}
@ -133,7 +133,7 @@ class SharesMetadataTest(base.BaseSharesTest):
body_get = self.shares_client.get_metadata(self.share["id"])
self.assertEqual(data, body_get)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_upd_metadata_max_size_key(self):
max_key = "k" * 255
data = {max_key: "value"}
@ -143,7 +143,7 @@ class SharesMetadataTest(base.BaseSharesTest):
body_get = self.shares_client.get_metadata(self.share["id"])
self.assertEqual(data, body_get)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_upd_metadata_min_size_value(self):
data = {"key": "v"}
@ -152,7 +152,7 @@ class SharesMetadataTest(base.BaseSharesTest):
body_get = self.shares_client.get_metadata(self.share["id"])
self.assertEqual(data, body_get)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_upd_metadata_max_size_value(self):
max_value = "v" * 1023
data = {"key": max_value}

View File

@ -13,12 +13,35 @@
# License for the specific language governing permissions and limitations
# under the License.
import ddt
from tempest.lib import exceptions as lib_exc # noqa
from tempest import test # noqa
from manila_tempest_tests.tests.api import base
@ddt.ddt
class SharesMetadataAPIOnlyNegativeTest(base.BaseSharesTest):
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
@ddt.data(True, False)
def test_try_set_metadata_to_unexisting_share(self, is_v2_client):
md = {u"key1": u"value1", u"key2": u"value2", }
client = self.shares_v2_client if is_v2_client else self.shares_client
self.assertRaises(lib_exc.NotFound,
client.set_metadata,
"wrong_share_id", md)
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
@ddt.data(True, False)
def test_try_update_all_metadata_for_unexisting_share(self, is_v2_client):
md = {u"key1": u"value1", u"key2": u"value2", }
client = self.shares_v2_client if is_v2_client else self.shares_client
self.assertRaises(lib_exc.NotFound,
client.update_all_metadata,
"wrong_share_id", md)
class SharesMetadataNegativeTest(base.BaseSharesTest):
@classmethod
@ -26,33 +49,19 @@ class SharesMetadataNegativeTest(base.BaseSharesTest):
super(SharesMetadataNegativeTest, cls).resource_setup()
cls.share = cls.create_share()
@test.attr(type=["gate", "negative", ])
def test_try_set_metadata_to_unexisting_share(self):
md = {u"key1": u"value1", u"key2": u"value2", }
self.assertRaises(lib_exc.NotFound,
self.shares_client.set_metadata,
"wrong_share_id", md)
@test.attr(type=["gate", "negative", ])
def test_try_update_all_metadata_for_unexisting_share(self):
md = {u"key1": u"value1", u"key2": u"value2", }
self.assertRaises(lib_exc.NotFound,
self.shares_client.update_all_metadata,
"wrong_share_id", md)
@test.attr(type=["gate", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_try_set_metadata_with_empty_key(self):
self.assertRaises(lib_exc.BadRequest,
self.shares_client.set_metadata,
self.share["id"], {"": "value"})
@test.attr(type=["gate", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_try_upd_metadata_with_empty_key(self):
self.assertRaises(lib_exc.BadRequest,
self.shares_client.update_all_metadata,
self.share["id"], {"": "value"})
@test.attr(type=["gate", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_try_set_metadata_with_too_big_key(self):
too_big_key = "x" * 256
md = {too_big_key: "value"}
@ -60,7 +69,7 @@ class SharesMetadataNegativeTest(base.BaseSharesTest):
self.shares_client.set_metadata,
self.share["id"], md)
@test.attr(type=["gate", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_try_upd_metadata_with_too_big_key(self):
too_big_key = "x" * 256
md = {too_big_key: "value"}
@ -68,7 +77,7 @@ class SharesMetadataNegativeTest(base.BaseSharesTest):
self.shares_client.update_all_metadata,
self.share["id"], md)
@test.attr(type=["gate", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_try_set_metadata_with_too_big_value(self):
too_big_value = "x" * 1024
md = {"key": too_big_value}
@ -76,7 +85,7 @@ class SharesMetadataNegativeTest(base.BaseSharesTest):
self.shares_client.set_metadata,
self.share["id"], md)
@test.attr(type=["gate", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_try_upd_metadata_with_too_big_value(self):
too_big_value = "x" * 1024
md = {"key": too_big_value}
@ -84,7 +93,7 @@ class SharesMetadataNegativeTest(base.BaseSharesTest):
self.shares_client.update_all_metadata,
self.share["id"], md)
@test.attr(type=["gate", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_try_delete_unexisting_metadata(self):
self.assertRaises(lib_exc.NotFound,
self.shares_client.delete_metadata,

View File

@ -33,7 +33,7 @@ class MicroversionsTest(base.BaseSharesTest):
Sends HTTP GET requests to the version API to validate microversions.
"""
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_microversions_root_version(self):
resp, resp_body = self.shares_v2_client.send_microversion_request()
@ -55,7 +55,7 @@ class MicroversionsTest(base.BaseSharesTest):
self.assertEqual(_MIN_API_VERSION, v2.get('min_version'))
self.assertEqual(_MAX_API_VERSION, v2.get('version'))
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_microversions_v1_no_version(self):
resp, resp_body = self.shares_v2_client.send_microversion_request(
@ -72,7 +72,7 @@ class MicroversionsTest(base.BaseSharesTest):
self.assertEqual('', version_list[0].get('min_version'))
self.assertEqual('', version_list[0].get('version'))
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_microversions_v1_with_version(self):
resp, resp_body = self.shares_v2_client.send_microversion_request(
@ -89,7 +89,7 @@ class MicroversionsTest(base.BaseSharesTest):
self.assertEqual('', version_list[0].get('min_version'))
self.assertEqual('', version_list[0].get('version'))
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_microversions_v2_no_version(self):
resp, resp_body = self.shares_v2_client.send_microversion_request(
@ -107,7 +107,7 @@ class MicroversionsTest(base.BaseSharesTest):
self.assertEqual(_MIN_API_VERSION, version_list[0].get('min_version'))
self.assertEqual(_MAX_API_VERSION, version_list[0].get('version'))
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_microversions_v2_min_version(self):
resp, resp_body = self.shares_v2_client.send_microversion_request(
@ -125,7 +125,7 @@ class MicroversionsTest(base.BaseSharesTest):
self.assertEqual(_MIN_API_VERSION, version_list[0].get('min_version'))
self.assertEqual(_MAX_API_VERSION, version_list[0].get('version'))
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_microversions_v2_max_version(self):
resp, resp_body = self.shares_v2_client.send_microversion_request(
@ -143,7 +143,7 @@ class MicroversionsTest(base.BaseSharesTest):
self.assertEqual(_MIN_API_VERSION, version_list[0].get('min_version'))
self.assertEqual(_MAX_API_VERSION, version_list[0].get('version'))
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_microversions_v2_invalid_version(self):
resp, _ = self.shares_v2_client.send_microversion_request(
@ -151,7 +151,7 @@ class MicroversionsTest(base.BaseSharesTest):
self.assertEqual(400, resp.status)
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_microversions_v2_unacceptable_version(self):
# First get max version from the server

View File

@ -34,7 +34,7 @@ class SharesQuotasTest(base.BaseSharesTest):
cls.user_id = cls.shares_v2_client.user_id
cls.tenant_id = cls.shares_v2_client.tenant_id
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
@ddt.data('shares_client', 'shares_v2_client')
def test_default_quotas(self, client_name):
quotas = getattr(self, client_name).default_quotas(self.tenant_id)
@ -44,7 +44,7 @@ class SharesQuotasTest(base.BaseSharesTest):
self.assertGreater(int(quotas["snapshots"]), -2)
self.assertGreater(int(quotas["share_networks"]), -2)
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
@ddt.data('shares_client', 'shares_v2_client')
def test_show_quotas(self, client_name):
quotas = getattr(self, client_name).show_quotas(self.tenant_id)
@ -54,7 +54,7 @@ class SharesQuotasTest(base.BaseSharesTest):
self.assertGreater(int(quotas["snapshots"]), -2)
self.assertGreater(int(quotas["share_networks"]), -2)
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
@ddt.data('shares_client', 'shares_v2_client')
def test_show_quotas_for_user(self, client_name):
quotas = getattr(self, client_name).show_quotas(

View File

@ -33,18 +33,18 @@ class SharesQuotasNegativeTest(base.BaseSharesTest):
raise cls.skipException(msg)
super(SharesQuotasNegativeTest, cls).resource_setup()
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_get_quotas_with_empty_tenant_id(self):
self.assertRaises(lib_exc.NotFound,
self.shares_v2_client.show_quotas, "")
@test.attr(type=["gate", "smoke", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_reset_quotas_with_user(self):
self.assertRaises(lib_exc.Forbidden,
self.shares_v2_client.reset_quotas,
self.shares_v2_client.tenant_id)
@test.attr(type=["gate", "smoke", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_update_quotas_with_user(self):
self.assertRaises(lib_exc.Forbidden,
self.shares_v2_client.update_quotas,
@ -66,7 +66,7 @@ class SharesQuotasNegativeTest(base.BaseSharesTest):
('os-services', '2.7', 'update_quotas'),
)
@ddt.unpack
@test.attr(type=["gate", "smoke", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
@base.skip_if_microversion_not_supported("2.7")
def test_show_quotas_with_wrong_versions(self, url, version, method_name):
self.assertRaises(

View File

@ -127,7 +127,7 @@ class ReplicationTest(base.BaseSharesTest):
return access_type, access_to
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
def test_add_delete_share_replica(self):
# Create the replica
share_replica = self._verify_create_replica()
@ -135,7 +135,7 @@ class ReplicationTest(base.BaseSharesTest):
# Delete the replica
self.delete_share_replica(share_replica["id"])
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
def test_add_access_rule_create_replica_delete_rule(self):
# Add access rule to the share
access_type, access_to = self._verify_config_and_set_access_rule_data()
@ -158,7 +158,7 @@ class ReplicationTest(base.BaseSharesTest):
self.shares_v2_client.wait_for_resource_deletion(
rule_id=rule["id"], share_id=self.shares[0]['id'])
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
def test_create_replica_add_access_rule_delete_replica(self):
access_type, access_to = self._verify_config_and_set_access_rule_data()
# Create the replica
@ -175,7 +175,7 @@ class ReplicationTest(base.BaseSharesTest):
# Delete the replica
self.delete_share_replica(share_replica["id"])
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
def test_add_multiple_share_replicas(self):
rep_domain, pools = self.get_pools_for_replication_domain()
if len(pools) < 3:
@ -204,7 +204,7 @@ class ReplicationTest(base.BaseSharesTest):
self.assertIn(share_replica1["id"], replica_ids)
self.assertIn(share_replica2["id"], replica_ids)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
def test_promote_in_sync_share_replica(self):
# Test promote 'in_sync' share_replica to 'active' state
if (self.replication_type
@ -235,7 +235,7 @@ class ReplicationTest(base.BaseSharesTest):
self.assertEqual(constants.REPLICATION_STATE_ACTIVE,
promoted_replica["replica_state"])
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
def test_promote_and_promote_back(self):
# Test promote back and forth between 2 share replicas
if (self.replication_type
@ -277,7 +277,7 @@ class ReplicationTest(base.BaseSharesTest):
new_replica['id'], constants.REPLICATION_STATE_IN_SYNC,
status_attr='replica_state')
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_active_replication_state(self):
# Verify the replica_state of first instance is set to active.
replica = self.shares_v2_client.get_share_replica(self.instance_id1)
@ -355,7 +355,7 @@ class ReplicationActionsTest(base.BaseSharesTest):
replica['id'], len(replica_id_list))
self.assertEqual(1, len(replica_id_list), msg)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_show_share_replica(self):
replica = self.shares_v2_client.get_share_replica(self.replica1["id"])
@ -366,7 +366,7 @@ class ReplicationActionsTest(base.BaseSharesTest):
'expected %s, got %s.' % (replica["id"],
detail_keys, actual_keys))
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_detail_list_share_replicas_for_share(self):
# List replicas for share
replica_list = self.shares_v2_client.list_share_replicas(
@ -378,7 +378,7 @@ class ReplicationActionsTest(base.BaseSharesTest):
# Verify keys
self._validate_replica_list(replica_list)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_detail_list_share_replicas_for_all_shares(self):
# List replicas for all available shares
replica_list = self.shares_v2_client.list_share_replicas()
@ -390,7 +390,7 @@ class ReplicationActionsTest(base.BaseSharesTest):
# Verify keys
self._validate_replica_list(replica_list)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_summary_list_share_replicas_for_all_shares(self):
# List replicas
replica_list = self.shares_v2_client.list_share_replicas_summary()

View File

@ -76,7 +76,7 @@ class ReplicationNegativeTest(base.BaseSharesTest):
raise self.skipException(
msg % ','.join(constants.REPLICATION_PROMOTION_CHOICES))
@test.attr(type=["gate", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_try_add_replica_to_share_with_no_replication_share_type(self):
# Create share without replication type
share = self.create_share()
@ -85,7 +85,7 @@ class ReplicationNegativeTest(base.BaseSharesTest):
share['id'],
self.replica_zone)
@test.attr(type=["gate", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_add_replica_to_share_with_error_state(self):
# Set "error" state
self.admin_client.reset_state(
@ -98,25 +98,13 @@ class ReplicationNegativeTest(base.BaseSharesTest):
self.share1['id'],
self.replica_zone)
@test.attr(type=["gate", "negative", ])
def test_get_replica_by_nonexistent_id(self):
self.assertRaises(lib_exc.NotFound,
self.shares_v2_client.get_share_replica,
data_utils.rand_uuid())
@test.attr(type=["gate", "negative", ])
def test_try_delete_replica_by_nonexistent_id(self):
self.assertRaises(lib_exc.NotFound,
self.shares_v2_client.delete_share_replica,
data_utils.rand_uuid())
@test.attr(type=["gate", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_try_delete_last_active_replica(self):
self.assertRaises(lib_exc.BadRequest,
self.shares_v2_client.delete_share_replica,
self.instance_id1)
@test.attr(type=["gate", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_try_delete_share_having_replica(self):
self.create_share_replica(self.share1["id"], self.replica_zone,
cleanup_in_class=False)
@ -124,7 +112,7 @@ class ReplicationNegativeTest(base.BaseSharesTest):
self.shares_v2_client.delete_share,
self.share1["id"])
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_promote_out_of_sync_share_replica(self):
# Test promoting an out_of_sync share_replica to active state
self._is_replication_type_promotable()
@ -142,7 +130,7 @@ class ReplicationNegativeTest(base.BaseSharesTest):
self.shares_v2_client.promote_share_replica,
replica['id'])
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_promote_active_share_replica(self):
# Test promote active share_replica
self._is_replication_type_promotable()
@ -151,7 +139,7 @@ class ReplicationNegativeTest(base.BaseSharesTest):
self.shares_v2_client.promote_share_replica(self.instance_id1,
expected_status=200)
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_promote_share_replica_for_writable_share_type(self):
# Test promote active share_replica for writable share
if self.replication_type != "writable":
@ -167,3 +155,21 @@ class ReplicationNegativeTest(base.BaseSharesTest):
# Try promoting the replica
self.shares_v2_client.promote_share_replica(replica['id'])
@testtools.skipUnless(CONF.share.run_replication_tests,
'Replication tests are disabled.')
@base.skip_if_microversion_lt(_MIN_SUPPORTED_MICROVERSION)
class ReplicationAPIOnlyNegativeTest(base.BaseSharesTest):
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_get_replica_by_nonexistent_id(self):
self.assertRaises(lib_exc.NotFound,
self.shares_v2_client.get_share_replica,
data_utils.rand_uuid())
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_delete_replica_by_nonexistent_id(self):
self.assertRaises(lib_exc.NotFound,
self.shares_v2_client.delete_share_replica,
data_utils.rand_uuid())

View File

@ -63,7 +63,7 @@ class ReplicationSnapshotTest(base.BaseSharesTest):
'availability_zone': cls.share_zone,
}}
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
def test_snapshot_after_share_replica(self):
"""Test the snapshot for replicated share.
@ -89,7 +89,7 @@ class ReplicationSnapshotTest(base.BaseSharesTest):
self.delete_share_replica(original_replica['id'])
self.create_share(snapshot_id=snapshot['id'])
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
def test_snapshot_before_share_replica(self):
"""Test the snapshot for replicated share.
@ -119,7 +119,7 @@ class ReplicationSnapshotTest(base.BaseSharesTest):
self.delete_share_replica(original_replica['id'])
self.create_share(snapshot_id=snapshot['id'])
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
def test_snapshot_before_and_after_share_replica(self):
"""Test the snapshot for replicated share.
@ -156,7 +156,7 @@ class ReplicationSnapshotTest(base.BaseSharesTest):
self.create_share(snapshot_id=snapshot1['id'])
self.create_share(snapshot_id=snapshot2['id'])
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
def test_delete_snapshot_after_adding_replica(self):
"""Verify the snapshot delete.
@ -176,7 +176,7 @@ class ReplicationSnapshotTest(base.BaseSharesTest):
self.shares_v2_client.wait_for_resource_deletion(
snapshot_id=snapshot["id"])
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
def test_create_replica_from_snapshot_share(self):
"""Test replica for a share that was created from snapshot."""

View File

@ -78,7 +78,7 @@ class ShareIpRulesForNFSTest(base.BaseSharesTest):
cls.access_type = "ip"
cls.access_to = "2.2.2.2"
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
@ddt.data('1.0', '2.9', LATEST_MICROVERSION)
def test_create_delete_access_rules_with_one_ip(self, version):
@ -120,7 +120,7 @@ class ShareIpRulesForNFSTest(base.BaseSharesTest):
self.shares_v2_client.wait_for_resource_deletion(
rule_id=rule["id"], share_id=self.share['id'], version=version)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
@ddt.data('1.0', '2.9', LATEST_MICROVERSION)
def test_create_delete_access_rule_with_cidr(self, version):
@ -162,7 +162,7 @@ class ShareIpRulesForNFSTest(base.BaseSharesTest):
self.shares_v2_client.wait_for_resource_deletion(
rule_id=rule["id"], share_id=self.share['id'], version=version)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
@testtools.skipIf(
"nfs" not in CONF.share.enable_ro_access_level_for_protocols,
"RO access rule tests are disabled for NFS protocol.")
@ -175,7 +175,7 @@ class ShareIpRulesForNFSTest(base.BaseSharesTest):
class ShareIpRulesForCIFSTest(ShareIpRulesForNFSTest):
protocol = "cifs"
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
@testtools.skipIf(
"cifs" not in CONF.share.enable_ro_access_level_for_protocols,
"RO access rule tests are disabled for CIFS protocol.")
@ -200,7 +200,7 @@ class ShareUserRulesForNFSTest(base.BaseSharesTest):
cls.access_type = "user"
cls.access_to = CONF.share.username_for_user_rules
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
@ddt.data('1.0', '2.9', LATEST_MICROVERSION)
def test_create_delete_user_rule(self, version):
@ -239,7 +239,7 @@ class ShareUserRulesForNFSTest(base.BaseSharesTest):
self.shares_v2_client.wait_for_resource_deletion(
rule_id=rule["id"], share_id=self.share['id'], version=version)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
@testtools.skipIf(
"nfs" not in CONF.share.enable_ro_access_level_for_protocols,
"RO access rule tests are disabled for NFS protocol.")
@ -252,7 +252,7 @@ class ShareUserRulesForNFSTest(base.BaseSharesTest):
class ShareUserRulesForCIFSTest(ShareUserRulesForNFSTest):
protocol = "cifs"
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
@testtools.skipIf(
"cifs" not in CONF.share.enable_ro_access_level_for_protocols,
"RO access rule tests are disabled for CIFS protocol.")
@ -279,7 +279,7 @@ class ShareCertRulesForGLUSTERFSTest(base.BaseSharesTest):
# certificate that it possesses.
cls.access_to = "client1.com"
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
@ddt.data('1.0', '2.9', LATEST_MICROVERSION)
def test_create_delete_cert_rule(self, version):
@ -318,7 +318,7 @@ class ShareCertRulesForGLUSTERFSTest(base.BaseSharesTest):
self.shares_v2_client.wait_for_resource_deletion(
rule_id=rule["id"], share_id=self.share['id'], version=version)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
@testtools.skipIf(
"glusterfs" not in CONF.share.enable_ro_access_level_for_protocols,
"RO access rule tests are disabled for GLUSTERFS protocol.")
@ -376,7 +376,7 @@ class ShareCephxRulesForCephFSTest(base.BaseSharesTest):
# Provide access to a client identified by a cephx auth id.
cls.access_to = "bob"
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
@ddt.data("alice", "alice_bob", "alice bob")
def test_create_delete_cephx_rule(self, access_to):
rule = self.shares_v2_client.create_access_rule(
@ -428,7 +428,7 @@ class ShareRulesTest(base.BaseSharesTest):
cls.shares_v2_client.share_protocol = cls.protocol
cls.share = cls.create_share()
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@ddt.data('1.0', '2.9', LATEST_MICROVERSION)
def test_list_access_rules(self, version):
if (utils.is_microversion_lt(version, '2.13') and
@ -490,7 +490,7 @@ class ShareRulesTest(base.BaseSharesTest):
self.shares_v2_client.wait_for_resource_deletion(
rule_id=rule["id"], share_id=self.share['id'], version=version)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@ddt.data('1.0', '2.9', LATEST_MICROVERSION)
def test_access_rules_deleted_if_share_deleted(self, version):
if (utils.is_microversion_lt(version, '2.13') and

View File

@ -44,63 +44,63 @@ class ShareIpRulesForNFSNegativeTest(base.BaseSharesTest):
# create snapshot
cls.snap = cls.create_snapshot_wait_for_active(cls.share["id"])
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@ddt.data('shares_client', 'shares_v2_client')
def test_create_access_rule_ip_with_wrong_target_1(self, client_name):
self.assertRaises(lib_exc.BadRequest,
getattr(self, client_name).create_access_rule,
self.share["id"], "ip", "1.2.3.256")
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@ddt.data('shares_client', 'shares_v2_client')
def test_create_access_rule_ip_with_wrong_target_2(self, client_name):
self.assertRaises(lib_exc.BadRequest,
getattr(self, client_name).create_access_rule,
self.share["id"], "ip", "1.1.1.-")
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@ddt.data('shares_client', 'shares_v2_client')
def test_create_access_rule_ip_with_wrong_target_3(self, client_name):
self.assertRaises(lib_exc.BadRequest,
getattr(self, client_name).create_access_rule,
self.share["id"], "ip", "1.2.3.4/33")
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@ddt.data('shares_client', 'shares_v2_client')
def test_create_access_rule_ip_with_wrong_target_4(self, client_name):
self.assertRaises(lib_exc.BadRequest,
getattr(self, client_name).create_access_rule,
self.share["id"], "ip", "1.2.3.*")
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@ddt.data('shares_client', 'shares_v2_client')
def test_create_access_rule_ip_with_wrong_target_5(self, client_name):
self.assertRaises(lib_exc.BadRequest,
getattr(self, client_name).create_access_rule,
self.share["id"], "ip", "1.2.3.*/23")
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@ddt.data('shares_client', 'shares_v2_client')
def test_create_access_rule_ip_with_wrong_target_6(self, client_name):
self.assertRaises(lib_exc.BadRequest,
getattr(self, client_name).create_access_rule,
self.share["id"], "ip", "1.2.3.1|23")
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@ddt.data('shares_client', 'shares_v2_client')
def test_create_access_rule_ip_with_wrong_target_7(self, client_name):
self.assertRaises(lib_exc.BadRequest,
getattr(self, client_name).create_access_rule,
self.share["id"], "ip", "1.2.3.1/-1")
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@ddt.data('shares_client', 'shares_v2_client')
def test_create_access_rule_ip_with_wrong_target_8(self, client_name):
self.assertRaises(lib_exc.BadRequest,
getattr(self, client_name).create_access_rule,
self.share["id"], "ip", "1.2.3.1/")
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@ddt.data('shares_client', 'shares_v2_client')
def test_create_access_rule_with_wrong_level(self, client_name):
self.assertRaises(lib_exc.BadRequest,
@ -110,7 +110,7 @@ class ShareIpRulesForNFSNegativeTest(base.BaseSharesTest):
'2.2.2.2',
'su')
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@ddt.data('1.0', '2.9', LATEST_MICROVERSION)
def test_create_duplicate_of_ip_rule(self, version):
# test data
@ -182,7 +182,7 @@ class ShareUserRulesForNFSNegativeTest(base.BaseSharesTest):
# create snapshot
cls.snap = cls.create_snapshot_wait_for_active(cls.share["id"])
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@ddt.data('shares_client', 'shares_v2_client')
def test_create_access_rule_user_with_wrong_input_2(self, client_name):
self.assertRaises(lib_exc.BadRequest,
@ -190,28 +190,28 @@ class ShareUserRulesForNFSNegativeTest(base.BaseSharesTest):
self.share["id"], "user",
"try+")
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@ddt.data('shares_client', 'shares_v2_client')
def test_create_access_rule_user_with_empty_key(self, client_name):
self.assertRaises(lib_exc.BadRequest,
getattr(self, client_name).create_access_rule,
self.share["id"], "user", "")
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@ddt.data('shares_client', 'shares_v2_client')
def test_create_access_rule_user_with_too_little_key(self, client_name):
self.assertRaises(lib_exc.BadRequest,
getattr(self, client_name).create_access_rule,
self.share["id"], "user", "abc")
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@ddt.data('shares_client', 'shares_v2_client')
def test_create_access_rule_user_with_too_big_key(self, client_name):
self.assertRaises(lib_exc.BadRequest,
getattr(self, client_name).create_access_rule,
self.share["id"], "user", "a" * 33)
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@ddt.data('shares_client', 'shares_v2_client')
def test_create_access_rule_user_with_wrong_input_1(self, client_name):
self.assertRaises(lib_exc.BadRequest,
@ -219,7 +219,7 @@ class ShareUserRulesForNFSNegativeTest(base.BaseSharesTest):
self.share["id"], "user",
"try+")
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@ddt.data('shares_client', 'shares_v2_client')
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
@ -230,7 +230,7 @@ class ShareUserRulesForNFSNegativeTest(base.BaseSharesTest):
access_type="user",
access_to="fakeuser")
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@ddt.data('shares_client', 'shares_v2_client')
def test_create_access_rule_user_with_wrong_share_id(self, client_name):
self.assertRaises(lib_exc.NotFound,
@ -239,7 +239,7 @@ class ShareUserRulesForNFSNegativeTest(base.BaseSharesTest):
access_type="user",
access_to="fakeuser")
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@ddt.data('shares_client', 'shares_v2_client')
def test_create_access_rule_with_wrong_level(self, client_name):
self.assertRaises(lib_exc.BadRequest,
@ -272,14 +272,14 @@ class ShareCertRulesForGLUSTERFSNegativeTest(base.BaseSharesTest):
# create snapshot
cls.snap = cls.create_snapshot_wait_for_active(cls.share["id"])
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@ddt.data('shares_client', 'shares_v2_client')
def test_create_access_rule_cert_with_empty_common_name(self, client_name):
self.assertRaises(lib_exc.BadRequest,
getattr(self, client_name).create_access_rule,
self.share["id"], "cert", "")
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@ddt.data('shares_client', 'shares_v2_client')
def test_create_access_rule_cert_with_whitespace_common_name(self,
client_name):
@ -287,7 +287,7 @@ class ShareCertRulesForGLUSTERFSNegativeTest(base.BaseSharesTest):
getattr(self, client_name).create_access_rule,
self.share["id"], "cert", " ")
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@ddt.data('shares_client', 'shares_v2_client')
def test_create_access_rule_cert_with_too_big_common_name(self,
client_name):
@ -296,7 +296,7 @@ class ShareCertRulesForGLUSTERFSNegativeTest(base.BaseSharesTest):
getattr(self, client_name).create_access_rule,
self.share["id"], "cert", "a" * 65)
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
@ddt.data('shares_client', 'shares_v2_client')
@ -307,7 +307,7 @@ class ShareCertRulesForGLUSTERFSNegativeTest(base.BaseSharesTest):
access_type="cert",
access_to="fakeclient1.com")
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@ddt.data('shares_client', 'shares_v2_client')
def test_create_access_rule_cert_with_wrong_share_id(self, client_name):
self.assertRaises(lib_exc.NotFound,
@ -334,21 +334,21 @@ class ShareCephxRulesForCephFSNegativeTest(base.BaseSharesTest):
cls.access_type = "cephx"
cls.access_to = "david"
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@ddt.data('jane.doe', u"bj\u00F6rn")
def test_create_access_rule_cephx_with_invalid_cephx_id(self, access_to):
self.assertRaises(lib_exc.BadRequest,
self.shares_v2_client.create_access_rule,
self.share["id"], self.access_type, access_to)
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_create_access_rule_cephx_with_wrong_level(self):
self.assertRaises(lib_exc.BadRequest,
self.shares_v2_client.create_access_rule,
self.share["id"], self.access_type, self.access_to,
access_level="su")
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_create_access_rule_cephx_with_unsupported_access_level_ro(self):
rule = self.shares_v2_client.create_access_rule(
self.share["id"], self.access_type, self.access_to,
@ -359,6 +359,18 @@ class ShareCephxRulesForCephFSNegativeTest(base.BaseSharesTest):
self.share['id'], rule['id'], "active")
def skip_if_cephx_access_type_not_supported_by_client(self, client):
if client == 'shares_client':
version = '1.0'
else:
version = LATEST_MICROVERSION
if (CONF.share.enable_cephx_rules_for_protocols and
utils.is_microversion_lt(version, '2.13')):
msg = ("API version %s does not support cephx access type, "
"need version greater than 2.13." % version)
raise self.skipException(msg)
@ddt.ddt
class ShareRulesNegativeTest(base.BaseSharesTest):
# Tests independent from rule type and share protocol
@ -382,47 +394,40 @@ class ShareRulesNegativeTest(base.BaseSharesTest):
# create snapshot
cls.snap = cls.create_snapshot_wait_for_active(cls.share["id"])
def skip_if_cephx_access_type_not_supported_by_client(self, client):
if client == 'shares_client':
version = '1.0'
else:
version = LATEST_MICROVERSION
if (CONF.share.enable_cephx_rules_for_protocols and
utils.is_microversion_lt(version, '2.13')):
msg = ("API version %s does not support cephx access type, "
"need version greater than 2.13." % version)
raise self.skipException(msg)
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@ddt.data('shares_client', 'shares_v2_client')
def test_delete_access_rule_with_wrong_id(self, client_name):
self.skip_if_cephx_access_type_not_supported_by_client(client_name)
skip_if_cephx_access_type_not_supported_by_client(self, client_name)
self.assertRaises(lib_exc.NotFound,
getattr(self, client_name).delete_access_rule,
self.share["id"], "wrong_rule_id")
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@ddt.data('shares_client', 'shares_v2_client')
def test_create_access_rule_ip_with_wrong_type(self, client_name):
self.skip_if_cephx_access_type_not_supported_by_client(client_name)
skip_if_cephx_access_type_not_supported_by_client(self, client_name)
self.assertRaises(lib_exc.BadRequest,
getattr(self, client_name).create_access_rule,
self.share["id"], "wrong_type", "1.2.3.4")
@test.attr(type=["negative", "gate", ])
@ddt.data('shares_client', 'shares_v2_client')
def test_create_access_rule_ip_with_wrong_share_id(self, client_name):
self.skip_if_cephx_access_type_not_supported_by_client(client_name)
self.assertRaises(lib_exc.NotFound,
getattr(self, client_name).create_access_rule,
"wrong_share_id")
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@ddt.data('shares_client', 'shares_v2_client')
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
def test_create_access_rule_ip_to_snapshot(self, client_name):
self.skip_if_cephx_access_type_not_supported_by_client(client_name)
skip_if_cephx_access_type_not_supported_by_client(self, client_name)
self.assertRaises(lib_exc.NotFound,
getattr(self, client_name).create_access_rule,
self.snap["id"])
@ddt.ddt
class ShareRulesAPIOnlyNegativeTest(base.BaseSharesTest):
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
@ddt.data('shares_client', 'shares_v2_client')
def test_create_access_rule_ip_with_wrong_share_id(self, client_name):
skip_if_cephx_access_type_not_supported_by_client(self, client_name)
self.assertRaises(lib_exc.NotFound,
getattr(self, client_name).create_access_rule,
"wrong_share_id")

View File

@ -21,12 +21,12 @@ from manila_tempest_tests.tests.api import base
class SchedulerStatsNegativeTest(base.BaseSharesTest):
@test.attr(type=["gate", "smoke", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_list_pools_with_user(self):
self.assertRaises(lib_exc.Forbidden,
self.shares_client.list_pools)
@test.attr(type=["gate", "smoke", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_list_pools_detailed_with_user(self):
self.assertRaises(lib_exc.Forbidden,
self.shares_client.list_pools,

View File

@ -27,7 +27,7 @@ LOG = log.getLogger(__name__)
class SecurityServiceListMixin(object):
@test.attr(type=["gate", "smoke"])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_list_security_services(self):
listed = self.shares_client.list_security_services()
self.assertTrue(any(self.ss_ldap['id'] == ss['id'] for ss in listed))
@ -38,7 +38,7 @@ class SecurityServiceListMixin(object):
keys = ["name", "id", "status", "type", ]
[self.assertIn(key, s_s.keys()) for s_s in listed for key in keys]
@test.attr(type=["gate", "smoke"])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_list_security_services_with_detail(self):
listed = self.shares_client.list_security_services(detailed=True)
self.assertTrue(any(self.ss_ldap['id'] == ss['id'] for ss in listed))
@ -53,7 +53,7 @@ class SecurityServiceListMixin(object):
]
[self.assertIn(key, s_s.keys()) for s_s in listed for key in keys]
@test.attr(type=["gate", "smoke"])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
@testtools.skipIf(
not CONF.share.multitenancy_enabled, "Only for multitenancy.")
def test_list_security_services_filter_by_share_network(self):
@ -79,7 +79,7 @@ class SecurityServiceListMixin(object):
keys = ["name", "id", "status", "type", ]
[self.assertIn(key, s_s.keys()) for s_s in listed for key in keys]
@test.attr(type=["gate", "smoke"])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_list_security_services_detailed_filter_by_ss_attributes(self):
search_opts = {
'name': 'ss_ldap',
@ -122,7 +122,7 @@ class SecurityServicesTest(base.BaseSharesTest,
self.ss_kerberos = self.create_security_service(
'kerberos', **ss_kerberos_data)
@test.attr(type=["gate", "smoke"])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_create_delete_security_service(self):
data = self.generate_security_service_data()
self.service_names = ["ldap", "kerberos", "active_directory"]
@ -132,7 +132,7 @@ class SecurityServicesTest(base.BaseSharesTest,
self.assertEqual(ss_name, ss["type"])
self.shares_client.delete_security_service(ss["id"])
@test.attr(type=["gate", "smoke"])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_get_security_service(self):
data = self.generate_security_service_data()
ss = self.create_security_service(**data)
@ -141,7 +141,7 @@ class SecurityServicesTest(base.BaseSharesTest,
get = self.shares_client.get_security_service(ss["id"])
self.assertDictContainsSubset(data, get)
@test.attr(type=["gate", "smoke"])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_update_security_service(self):
data = self.generate_security_service_data()
ss = self.create_security_service(**data)
@ -155,7 +155,7 @@ class SecurityServicesTest(base.BaseSharesTest,
self.assertDictContainsSubset(upd_data, updated)
self.assertDictContainsSubset(upd_data, get)
@test.attr(type=["gate", "smoke"])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipIf(
not CONF.share.multitenancy_enabled, "Only for multitenancy.")
def test_try_update_valid_keys_sh_server_exists(self):
@ -193,7 +193,7 @@ class SecurityServicesTest(base.BaseSharesTest,
ss["id"], **update_data)
self.assertDictContainsSubset(update_data, updated)
@test.attr(type=["gate", "smoke"])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_list_security_services_filter_by_invalid_opt(self):
listed = self.shares_client.list_security_services(
params={'fake_opt': 'some_value'})

View File

@ -43,7 +43,7 @@ class SecurityServicesMappingTest(base.BaseSharesTest):
# Add security service to share network
self.cl.add_sec_service_to_share_network(self.sn["id"], self.ss["id"])
@test.attr(type=["gate", "smoke"])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_map_ss_to_sn_and_list(self):
# List security services for share network
@ -52,14 +52,14 @@ class SecurityServicesMappingTest(base.BaseSharesTest):
for key in ["status", "id", "name"]:
self.assertIn(self.ss[key], ls[0][key])
@test.attr(type=["gate", "smoke"])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_map_ss_to_sn_and_delete(self):
# Remove security service from share network
self.cl.remove_sec_service_from_share_network(
self.sn["id"], self.ss["id"])
@test.attr(type=["gate", "smoke"])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_remap_ss_to_sn(self):
# Remove security service from share network

View File

@ -35,62 +35,62 @@ class SecServicesMappingNegativeTest(base.BaseSharesTest):
cls.ss = cls.create_security_service(cleanup_in_class=True)
cls.cl = cls.shares_client
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_add_sec_service_twice_to_share_network(self):
self.cl.add_sec_service_to_share_network(self.sn["id"], self.ss["id"])
self.assertRaises(lib_exc.Conflict,
self.cl.add_sec_service_to_share_network,
self.sn["id"], self.ss["id"])
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_add_nonexistant_sec_service_to_share_network(self):
self.assertRaises(lib_exc.NotFound,
self.cl.add_sec_service_to_share_network,
self.sn["id"], "wrong_ss_id")
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_add_empty_sec_service_id_to_share_network(self):
self.assertRaises(lib_exc.NotFound,
self.cl.add_sec_service_to_share_network,
self.sn["id"], "")
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_add_sec_service_to_nonexistant_share_network(self):
self.assertRaises(lib_exc.NotFound,
self.cl.add_sec_service_to_share_network,
"wrong_sn_id", self.ss["id"])
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_add_sec_service_to_share_network_with_empty_id(self):
self.assertRaises(lib_exc.NotFound,
self.cl.add_sec_service_to_share_network,
"", self.ss["id"])
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_list_sec_services_for_nonexistant_share_network(self):
self.assertRaises(lib_exc.NotFound,
self.cl.list_sec_services_for_share_network,
"wrong_id")
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_delete_nonexistant_sec_service_from_share_network(self):
self.assertRaises(lib_exc.NotFound,
self.cl.remove_sec_service_from_share_network,
self.sn["id"], "wrong_id")
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_delete_sec_service_from_nonexistant_share_network(self):
self.assertRaises(lib_exc.NotFound,
self.cl.remove_sec_service_from_share_network,
"wrong_id", self.ss["id"])
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_delete_nonexistant_ss_from_nonexistant_sn(self):
self.assertRaises(lib_exc.NotFound,
self.cl.remove_sec_service_from_share_network,
"wrong_id", "wrong_id")
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipIf(
not CONF.share.multitenancy_enabled, "Only for multitenancy.")
def test_delete_ss_from_sn_used_by_share_server(self):
@ -122,7 +122,7 @@ class SecServicesMappingNegativeTest(base.BaseSharesTest):
fresh_sn["id"],
self.ss["id"])
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_map_two_ss_with_same_type_to_sn(self):
# create share network
data = self.generate_share_network_data()
@ -147,7 +147,7 @@ class SecServicesMappingNegativeTest(base.BaseSharesTest):
self.cl.add_sec_service_to_share_network,
sn["id"], security_services[1]["id"])
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_delete_ss_that_assigned_to_sn(self):
# create share network
data = self.generate_share_network_data()

View File

@ -28,52 +28,52 @@ LOG = log.getLogger(__name__)
class SecurityServicesNegativeTest(base.BaseSharesTest):
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_create_security_service_with_empty_type(self):
self.assertRaises(lib_exc.BadRequest,
self.shares_client.create_security_service, "")
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_create_security_service_with_wrong_type(self):
self.assertRaises(lib_exc.BadRequest,
self.shares_client.create_security_service,
"wrong_type")
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_get_security_service_without_id(self):
self.assertRaises(lib_exc.NotFound,
self.shares_client.get_security_service, "")
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_get_security_service_with_wrong_id(self):
self.assertRaises(lib_exc.NotFound,
self.shares_client.get_security_service,
"wrong_id")
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_delete_security_service_without_id(self):
self.assertRaises(lib_exc.NotFound,
self.shares_client.delete_security_service, "")
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_delete_security_service_with_wrong_type(self):
self.assertRaises(lib_exc.NotFound,
self.shares_client.delete_security_service,
"wrong_id")
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_update_nonexistant_security_service(self):
self.assertRaises(lib_exc.NotFound,
self.shares_client.update_security_service,
"wrong_id", name="name")
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_update_security_service_with_empty_id(self):
self.assertRaises(lib_exc.NotFound,
self.shares_client.update_security_service,
"", name="name")
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipIf(
not CONF.share.multitenancy_enabled, "Only for multitenancy.")
def test_try_update_invalid_keys_sh_server_exists(self):
@ -108,7 +108,7 @@ class SecurityServicesNegativeTest(base.BaseSharesTest):
ss["id"],
user="new_user")
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_get_deleted_security_service(self):
data = self.generate_security_service_data()
ss = self.create_security_service(**data)
@ -121,7 +121,7 @@ class SecurityServicesNegativeTest(base.BaseSharesTest):
self.shares_client.get_security_service,
ss["id"])
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[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,

View File

@ -26,6 +26,7 @@ CONF = config.CONF
class ShareNetworkListMixin(object):
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_list_share_networks(self):
listed = self.shares_client.list_share_networks()
any(self.sn_with_ldap_ss["id"] in sn["id"] for sn in listed)
@ -34,7 +35,7 @@ class ShareNetworkListMixin(object):
keys = ["name", "id"]
[self.assertIn(key, sn.keys()) for sn in listed for key in keys]
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_list_share_networks_with_detail(self):
listed = self.shares_client.list_share_networks_with_detail()
any(self.sn_with_ldap_ss["id"] in sn["id"] for sn in listed)
@ -48,7 +49,7 @@ class ShareNetworkListMixin(object):
]
[self.assertIn(key, sn.keys()) for sn in listed for key in keys]
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_list_share_networks_filter_by_ss(self):
listed = self.shares_client.list_share_networks_with_detail(
{'security_service_id': self.ss_ldap['id']})
@ -60,7 +61,7 @@ class ShareNetworkListMixin(object):
self.assertTrue(any(ss['id'] == self.ss_ldap['id']
for ss in ss_list))
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_list_share_networks_all_filter_opts(self):
valid_filter_opts = {
'created_before': '2002-10-10',
@ -140,7 +141,7 @@ class ShareNetworksTest(base.BaseSharesTest, ShareNetworkListMixin):
cls.sn_with_kerberos_ss["id"],
cls.ss_kerberos["id"])
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_create_delete_share_network(self):
# generate data for share network
data = self.generate_share_network_data()
@ -152,7 +153,7 @@ class ShareNetworksTest(base.BaseSharesTest, ShareNetworkListMixin):
# Delete share_network
self.shares_client.delete_share_network(created["id"])
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_get_share_network(self):
get = self.shares_client.get_share_network(self.sn_with_ldap_ss["id"])
self.assertEqual('2002-02-02T00:00:00.000000', get['created_at'])
@ -160,7 +161,7 @@ class ShareNetworksTest(base.BaseSharesTest, ShareNetworkListMixin):
del data['created_at']
self.assertDictContainsSubset(data, get)
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_update_share_network(self):
update_data = self.generate_share_network_data()
updated = self.shares_client.update_share_network(
@ -168,7 +169,7 @@ class ShareNetworksTest(base.BaseSharesTest, ShareNetworkListMixin):
**update_data)
self.assertDictContainsSubset(update_data, updated)
@test.attr(type=["gate", "smoke"])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipIf(
not CONF.share.multitenancy_enabled, "Only for multitenancy.")
def test_update_valid_keys_sh_server_exists(self):
@ -181,7 +182,7 @@ class ShareNetworksTest(base.BaseSharesTest, ShareNetworkListMixin):
self.shares_client.share_network_id, **update_dict)
self.assertDictContainsSubset(update_dict, updated)
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_recreate_share_network(self):
# generate data for share network
data = self.generate_share_network_data()
@ -200,7 +201,7 @@ class ShareNetworksTest(base.BaseSharesTest, ShareNetworkListMixin):
# Delete second share network
self.shares_client.delete_share_network(sn2["id"])
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API])
def test_create_two_share_networks_with_same_net_and_subnet(self):
# generate data for share network
data = self.generate_share_network_data()

View File

@ -25,39 +25,39 @@ CONF = config.CONF
class ShareNetworksNegativeTest(base.BaseSharesTest):
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_get_share_network_without_id(self):
self.assertRaises(lib_exc.NotFound,
self.shares_client.get_share_network, "")
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_get_share_network_with_wrong_id(self):
self.assertRaises(lib_exc.NotFound,
self.shares_client.get_share_network, "wrong_id")
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_delete_share_network_without_id(self):
self.assertRaises(lib_exc.NotFound,
self.shares_client.delete_share_network, "")
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_delete_share_network_with_wrong_type(self):
self.assertRaises(lib_exc.NotFound,
self.shares_client.delete_share_network, "wrong_id")
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_update_nonexistant_share_network(self):
self.assertRaises(lib_exc.NotFound,
self.shares_client.update_share_network,
"wrong_id", name="name")
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_update_share_network_with_empty_id(self):
self.assertRaises(lib_exc.NotFound,
self.shares_client.update_share_network,
"", name="name")
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipIf(
not CONF.share.multitenancy_enabled, "Only for multitenancy.")
def test_try_update_invalid_keys_sh_server_exists(self):
@ -68,7 +68,7 @@ class ShareNetworksNegativeTest(base.BaseSharesTest):
self.shares_client.share_network_id,
neutron_net_id="new_net_id")
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_get_deleted_share_network(self):
data = self.generate_share_network_data()
sn = self.create_share_network(**data)
@ -81,33 +81,33 @@ class ShareNetworksNegativeTest(base.BaseSharesTest):
self.shares_client.get_security_service,
sn["id"])
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[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})
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[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'})
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_list_share_networks_wrong_created_since_value(self):
self.assertRaises(
lib_exc.BadRequest,
self.shares_client.list_share_networks_with_detail,
params={'created_since': '2014-10-23T08:31:58.000000'})
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_list_share_networks_wrong_created_before_value(self):
self.assertRaises(
lib_exc.BadRequest,
self.shares_client.list_share_networks_with_detail,
params={'created_before': '2014-10-23T08:31:58.000000'})
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipIf(not CONF.share.multitenancy_enabled,
'Can run only with drivers that do handle share servers '
'creation. Skipping.')

View File

@ -36,27 +36,27 @@ class ShareTypesNegativeTest(base.BaseSharesTest):
super(ShareTypesNegativeTest, cls).resource_setup()
cls.st = cls._create_share_type()
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_create_share_type_with_user(self):
self.assertRaises(lib_exc.Forbidden,
self.create_share_type,
data_utils.rand_name("used_user_creds"),
client=self.shares_client)
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_delete_share_type_with_user(self):
self.assertRaises(lib_exc.Forbidden,
self.shares_client.delete_share_type,
self.st["share_type"]["id"])
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_add_access_to_share_type_with_user(self):
self.assertRaises(lib_exc.Forbidden,
self.shares_client.add_access_to_share_type,
self.st['share_type']['id'],
self.shares_client.tenant_id)
@test.attr(type=["gate", "smoke", "negative"])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_try_remove_access_from_share_type_with_user(self):
self.assertRaises(lib_exc.Forbidden,
self.shares_client.remove_access_from_share_type,

View File

@ -36,7 +36,7 @@ class SharesNFSTest(base.BaseSharesTest):
raise cls.skipException(message)
cls.share = cls.create_share(cls.protocol)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
def test_create_get_delete_share(self):
share = self.create_share(self.protocol)
@ -97,7 +97,7 @@ class SharesNFSTest(base.BaseSharesTest):
self.shares_v2_client.get_share,
share['id'])
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
def test_create_delete_snapshot(self):
@ -119,7 +119,7 @@ class SharesNFSTest(base.BaseSharesTest):
self.assertRaises(lib_exc.NotFound,
self.shares_client.get_snapshot, snap['id'])
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
def test_create_share_from_snapshot(self):
@ -143,7 +143,7 @@ class SharesNFSTest(base.BaseSharesTest):
"source of share %s" % (snap["id"], get["snapshot_id"])
self.assertEqual(get["snapshot_id"], snap["id"], msg)
@test.attr(type=["gate", "smoke", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
@testtools.skipIf(not CONF.share.multitenancy_enabled,
"Only for multitenancy.")
@testtools.skipUnless(CONF.share.run_snapshot_tests,

View File

@ -119,45 +119,45 @@ class SharesActionsTest(base.BaseSharesTest):
share["size"])
self.assertEqual(self.share_size, int(share["size"]), msg)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_get_share_v2_1(self):
self._get_share('2.1')
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_get_share_with_snapshot_support_key(self):
self._get_share('2.2')
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@utils.skip_if_microversion_not_supported('2.4')
def test_get_share_with_consistency_groups_keys(self):
self._get_share('2.4')
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@utils.skip_if_microversion_not_supported('2.6')
def test_get_share_with_share_type_name_key(self):
self._get_share('2.6')
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@utils.skip_if_microversion_not_supported('2.9')
def test_get_share_export_locations_removed(self):
self._get_share('2.9')
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@utils.skip_if_microversion_not_supported('2.10')
def test_get_share_with_access_rules_status(self):
self._get_share('2.10')
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@utils.skip_if_microversion_not_supported('2.11')
def test_get_share_with_replication_type_key(self):
self._get_share('2.11')
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@utils.skip_if_microversion_not_supported('2.16')
def test_get_share_with_user_id(self):
self._get_share('2.16')
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_list_shares(self):
# list shares
@ -209,45 +209,45 @@ class SharesActionsTest(base.BaseSharesTest):
msg = "expected id lists %s times in share list" % (len(gen))
self.assertEqual(1, len(gen), msg)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_list_shares_with_detail_v2_1(self):
self._list_shares_with_detail('2.1')
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_list_shares_with_detail_and_snapshot_support_key(self):
self._list_shares_with_detail('2.2')
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@utils.skip_if_microversion_not_supported('2.4')
def test_list_shares_with_detail_consistency_groups_keys(self):
self._list_shares_with_detail('2.4')
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@utils.skip_if_microversion_not_supported('2.6')
def test_list_shares_with_detail_share_type_name_key(self):
self._list_shares_with_detail('2.6')
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@utils.skip_if_microversion_not_supported('2.9')
def test_list_shares_with_detail_export_locations_removed(self):
self._list_shares_with_detail('2.9')
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@utils.skip_if_microversion_not_supported('2.10')
def test_list_shares_with_detail_with_access_rules_status(self):
self._list_shares_with_detail('2.10')
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@utils.skip_if_microversion_not_supported('2.11')
def test_list_shares_with_detail_replication_type_key(self):
self._list_shares_with_detail('2.11')
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@utils.skip_if_microversion_not_supported('2.16')
def test_list_shares_with_user_id(self):
self._list_shares_with_detail('2.16')
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_list_shares_with_detail_filter_by_metadata(self):
filters = {'metadata': self.metadata}
@ -262,7 +262,7 @@ class SharesActionsTest(base.BaseSharesTest):
if CONF.share.run_snapshot_tests:
self.assertFalse(self.shares[1]['id'] in [s['id'] for s in shares])
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_list_shares_with_detail_filter_by_host(self):
base_share = self.shares_client.get_share(self.shares[0]['id'])
filters = {'host': base_share['host']}
@ -275,7 +275,7 @@ class SharesActionsTest(base.BaseSharesTest):
for share in shares:
self.assertEqual(filters['host'], share['host'])
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipIf(
not CONF.share.multitenancy_enabled, "Only for multitenancy.")
def test_list_shares_with_detail_filter_by_share_network_id(self):
@ -291,7 +291,7 @@ class SharesActionsTest(base.BaseSharesTest):
self.assertEqual(
filters['share_network_id'], share['share_network_id'])
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
def test_list_shares_with_detail_filter_by_snapshot_id(self):
@ -306,7 +306,7 @@ class SharesActionsTest(base.BaseSharesTest):
self.assertEqual(filters['snapshot_id'], share['snapshot_id'])
self.assertFalse(self.shares[0]['id'] in [s['id'] for s in shares])
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_list_shares_with_detail_with_asc_sorting(self):
filters = {'sort_key': 'created_at', 'sort_dir': 'asc'}
@ -318,21 +318,21 @@ class SharesActionsTest(base.BaseSharesTest):
sorted_list = [share['created_at'] for share in shares]
self.assertEqual(sorted(sorted_list), sorted_list)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_list_shares_with_detail_filter_by_existed_name(self):
# list shares by name, at least one share is expected
params = {"name": self.share_name}
shares = self.shares_client.list_shares_with_detail(params)
self.assertEqual(self.share_name, shares[0]["name"])
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_list_shares_with_detail_filter_by_fake_name(self):
# list shares by fake name, no shares are expected
params = {"name": data_utils.rand_name("fake-nonexistent-name")}
shares = self.shares_client.list_shares_with_detail(params)
self.assertEqual(0, len(shares))
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_list_shares_with_detail_filter_by_active_status(self):
# list shares by active status, at least one share is expected
params = {"status": "available"}
@ -341,14 +341,14 @@ class SharesActionsTest(base.BaseSharesTest):
for share in shares:
self.assertEqual(params["status"], share["status"])
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_list_shares_with_detail_filter_by_fake_status(self):
# list shares by fake status, no shares are expected
params = {"status": 'fake'}
shares = self.shares_client.list_shares_with_detail(params)
self.assertEqual(0, len(shares))
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_list_shares_with_detail_filter_by_all_tenants(self):
# non-admin user can get shares only from his project
params = {"all_tenants": 1}
@ -361,7 +361,7 @@ class SharesActionsTest(base.BaseSharesTest):
for share in shares:
self.assertEqual(project_id, share["project_id"])
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_list_shares_public_with_detail(self):
public_share = self.create_share(
name='public_share',
@ -396,7 +396,7 @@ class SharesActionsTest(base.BaseSharesTest):
self.assertFalse(any([s["id"] == private_share["id"] for s in shares]))
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
def test_get_snapshot(self):
@ -424,7 +424,7 @@ class SharesActionsTest(base.BaseSharesTest):
"actual share_id: '%s'" % (self.shares[0]["id"], get["share_id"])
self.assertEqual(self.shares[0]["id"], get["share_id"], msg)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
def test_list_snapshots(self):
@ -441,7 +441,7 @@ class SharesActionsTest(base.BaseSharesTest):
msg = "expected id lists %s times in share list" % (len(gen))
self.assertEqual(1, len(gen), msg)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
def test_list_snapshots_with_detail(self):
@ -460,7 +460,7 @@ class SharesActionsTest(base.BaseSharesTest):
msg = "expected id lists %s times in share list" % (len(gen))
self.assertEqual(1, len(gen), msg)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
def test_list_snapshots_with_detail_use_limit(self):
@ -486,7 +486,7 @@ class SharesActionsTest(base.BaseSharesTest):
self.assertEqual(1, len(snaps['snapshots']))
self.assertEqual(self.snap['id'], snaps['snapshots'][0]['id'])
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
def test_list_snapshots_with_detail_filter_by_status_and_name(self):
@ -502,7 +502,7 @@ class SharesActionsTest(base.BaseSharesTest):
self.assertEqual(filters['status'], snap['status'])
self.assertEqual(filters['name'], snap['name'])
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
def test_list_snapshots_with_detail_and_asc_sorting(self):
@ -517,7 +517,7 @@ class SharesActionsTest(base.BaseSharesTest):
sorted_list = [snap['share_id'] for snap in snaps]
self.assertEqual(sorted(sorted_list), sorted_list)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
@testtools.skipUnless(
CONF.share.run_extend_tests,
"Share extend tests are disabled.")
@ -540,7 +540,7 @@ class SharesActionsTest(base.BaseSharesTest):
)
self.assertEqual(new_size, share_get['size'], msg)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
@testtools.skipUnless(
CONF.share.run_shrink_tests,
"Share shrink tests are disabled.")
@ -586,7 +586,7 @@ class SharesRenameTest(base.BaseSharesTest):
cls.snap = cls.create_snapshot_wait_for_active(
cls.share["id"], cls.snap_name, cls.snap_desc)
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
def test_update_share(self):
# get share
@ -610,7 +610,7 @@ class SharesRenameTest(base.BaseSharesTest):
self.assertEqual(new_desc, share["description"])
self.assertTrue(share["is_public"])
@test.attr(type=["gate", ])
@test.attr(type=[base.TAG_POSITIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
def test_rename_snapshot(self):

View File

@ -32,7 +32,7 @@ class SharesActionsNegativeTest(base.BaseSharesTest):
size=1,
)
@test.attr(type=["negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipUnless(
CONF.share.run_extend_tests,
"Share extend tests are disabled.")
@ -50,7 +50,7 @@ class SharesActionsNegativeTest(base.BaseSharesTest):
self.share['id'],
new_size)
@test.attr(type=["negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipUnless(
CONF.share.run_extend_tests,
"Share extend tests are disabled.")
@ -63,7 +63,7 @@ class SharesActionsNegativeTest(base.BaseSharesTest):
self.share['id'],
new_size)
@test.attr(type=["negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipUnless(
CONF.share.run_extend_tests,
"Share extend tests are disabled.")
@ -76,7 +76,7 @@ class SharesActionsNegativeTest(base.BaseSharesTest):
self.share['id'],
new_size)
@test.attr(type=["negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipUnless(
CONF.share.run_extend_tests,
"Share extend tests are disabled.")
@ -94,7 +94,7 @@ class SharesActionsNegativeTest(base.BaseSharesTest):
share['id'],
new_size)
@test.attr(type=["negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipUnless(
CONF.share.run_shrink_tests,
"Share shrink tests are disabled.")
@ -107,7 +107,7 @@ class SharesActionsNegativeTest(base.BaseSharesTest):
self.share['id'],
new_size)
@test.attr(type=["negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipUnless(
CONF.share.run_shrink_tests,
"Share shrink tests are disabled.")
@ -120,7 +120,7 @@ class SharesActionsNegativeTest(base.BaseSharesTest):
self.share['id'],
new_size)
@test.attr(type=["negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipUnless(
CONF.share.run_shrink_tests,
"Share shrink tests are disabled.")

View File

@ -36,90 +36,13 @@ class SharesNegativeTest(base.BaseSharesTest):
metadata={'key': 'value'}
)
@test.attr(type=["negative", "smoke", "gate", ])
def test_create_share_with_invalid_protocol(self):
self.assertRaises(lib_exc.BadRequest,
self.shares_client.create_share,
share_protocol="nonexistent_protocol")
@test.attr(type=["negative", "smoke", "gate", ])
def test_create_share_with_wrong_public_value(self):
self.assertRaises(lib_exc.BadRequest,
self.shares_client.create_share, is_public='truebar')
@test.attr(type=["negative", "smoke", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_update_share_with_wrong_public_value(self):
self.assertRaises(lib_exc.BadRequest,
self.shares_client.update_share, self.share["id"],
is_public="truebar")
@test.attr(type=["negative", "smoke", "gate", ])
def test_get_share_with_wrong_id(self):
self.assertRaises(lib_exc.NotFound, self.shares_client.get_share,
"wrong_share_id")
@test.attr(type=["negative", "smoke", "gate", ])
def test_get_share_without_passing_share_id(self):
# Should not be able to get share when empty ID is passed
self.assertRaises(lib_exc.NotFound,
self.shares_client.get_share, '')
@test.attr(type=["negative", "smoke", "gate", ])
def test_list_shares_nonadmin_with_nonexistent_share_server_filter(self):
# filtering by share server allowed only for admins by default
self.assertRaises(lib_exc.Forbidden,
self.shares_client.list_shares_with_detail,
{'share_server_id': 'fake_share_server_id'})
@test.attr(type=["negative", "smoke", "gate", ])
def test_delete_share_with_wrong_id(self):
self.assertRaises(lib_exc.NotFound, self.shares_client.delete_share,
"wrong_share_id")
@test.attr(type=["negative", "smoke", "gate", ])
def test_delete_share_without_passing_share_id(self):
# Should not be able to delete share when empty ID is passed
self.assertRaises(lib_exc.NotFound,
self.shares_client.delete_share, '')
@test.attr(type=["negative", "smoke", "gate", ])
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
def test_create_snapshot_with_wrong_id(self):
self.assertRaises(lib_exc.NotFound,
self.shares_client.create_snapshot,
"wrong_share_id")
@test.attr(type=["negative", "smoke", "gate", ])
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
def test_delete_snapshot_with_wrong_id(self):
self.assertRaises(lib_exc.NotFound,
self.shares_client.delete_snapshot,
"wrong_share_id")
@test.attr(type=["negative", "smoke", "gate", ])
def test_create_share_with_invalid_size(self):
self.assertRaises(lib_exc.BadRequest,
self.shares_client.create_share, size="#$%")
@test.attr(type=["negative", "smoke", "gate", ])
def test_create_share_with_out_passing_size(self):
self.assertRaises(lib_exc.BadRequest,
self.shares_client.create_share, size="")
@test.attr(type=["negative", "smoke", "gate", ])
def test_create_share_with_zero_size(self):
self.assertRaises(lib_exc.BadRequest,
self.shares_client.create_share, size=0)
@test.attr(type=["negative", "gate", ])
def test_create_share_non_existent_az(self):
self.assertRaises(lib_exc.NotFound,
self.shares_v2_client.create_share,
availability_zone='fake_az')
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
def test_try_delete_share_with_existing_snapshot(self):
@ -135,7 +58,7 @@ class SharesNegativeTest(base.BaseSharesTest):
self.assertRaises(lib_exc.Forbidden,
self.shares_client.delete_share, share["id"])
@test.attr(type=["negative", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
def test_create_share_from_snap_with_less_size(self):
@ -160,7 +83,7 @@ class SharesNegativeTest(base.BaseSharesTest):
size=1, snapshot_id=snap["id"],
cleanup_in_class=False)
@test.attr(type=["negative", "smoke", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipIf(not CONF.share.multitenancy_enabled,
"Only for multitenancy.")
def test_create_share_with_nonexistant_share_network(self):
@ -168,7 +91,7 @@ class SharesNegativeTest(base.BaseSharesTest):
self.shares_client.create_share,
share_network_id="wrong_sn_id")
@test.attr(type=["negative", "smoke", "gate", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
@testtools.skipIf(not CONF.share.multitenancy_enabled,
"Only for multitenancy.")
@testtools.skipUnless(CONF.share.run_snapshot_tests,
@ -203,14 +126,14 @@ class SharesNegativeTest(base.BaseSharesTest):
snapshot_id=snap["id"],
)
@test.attr(type=["gate", "smoke", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_update_other_tenants_public_share(self):
isolated_client = self.get_client_with_isolated_creds(
type_of_creds='alt')
self.assertRaises(lib_exc.Forbidden, isolated_client.update_share,
self.share["id"], name="new_name")
@test.attr(type=["gate", "smoke", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_delete_other_tenants_public_share(self):
isolated_client = self.get_client_with_isolated_creds(
type_of_creds='alt')
@ -218,7 +141,7 @@ class SharesNegativeTest(base.BaseSharesTest):
isolated_client.delete_share,
self.share['id'])
@test.attr(type=["gate", "smoke", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_set_metadata_of_other_tenants_public_share(self):
isolated_client = self.get_client_with_isolated_creds(
type_of_creds='alt')
@ -227,7 +150,7 @@ class SharesNegativeTest(base.BaseSharesTest):
self.share['id'],
{'key': 'value'})
@test.attr(type=["gate", "smoke", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_update_metadata_of_other_tenants_public_share(self):
isolated_client = self.get_client_with_isolated_creds(
type_of_creds='alt')
@ -236,7 +159,7 @@ class SharesNegativeTest(base.BaseSharesTest):
self.share['id'],
{'key': 'value'})
@test.attr(type=["gate", "smoke", "negative", ])
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API_WITH_BACKEND])
def test_delete_metadata_of_other_tenants_public_share(self):
isolated_client = self.get_client_with_isolated_creds(
type_of_creds='alt')
@ -245,21 +168,101 @@ class SharesNegativeTest(base.BaseSharesTest):
self.share['id'],
'key')
@test.attr(type=["gate", "smoke", "negative", ])
def test_list_by_share_server_by_user(self):
self.assertRaises(lib_exc.Forbidden,
self.shares_client.list_shares,
params={'share_server_id': 12345})
@test.attr(type=["gate", "smoke", "negative", ])
class SharesAPIOnlyNegativeTest(base.BaseSharesTest):
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_unmanage_share_by_user(self):
self.assertRaises(lib_exc.Forbidden,
self.shares_client.unmanage_share,
'fake-id')
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_manage_share_by_user(self):
self.assertRaises(lib_exc.Forbidden,
self.shares_client.manage_share,
'fake-host', 'nfs', '/export/path',
'fake-type')
@test.attr(type=["gate", "smoke", "negative", ])
def test_unmanage_share_by_user(self):
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_list_by_share_server_by_user(self):
self.assertRaises(lib_exc.Forbidden,
self.shares_client.unmanage_share,
'fake-id')
self.shares_client.list_shares,
params={'share_server_id': 12345})
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_create_share_non_existent_az(self):
self.assertRaises(lib_exc.NotFound,
self.shares_v2_client.create_share,
availability_zone='fake_az')
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_create_share_with_zero_size(self):
self.assertRaises(lib_exc.BadRequest,
self.shares_client.create_share, size=0)
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_create_share_with_invalid_size(self):
self.assertRaises(lib_exc.BadRequest,
self.shares_client.create_share, size="#$%")
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_create_share_with_out_passing_size(self):
self.assertRaises(lib_exc.BadRequest,
self.shares_client.create_share, size="")
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
def test_delete_snapshot_with_wrong_id(self):
self.assertRaises(lib_exc.NotFound,
self.shares_client.delete_snapshot,
"wrong_share_id")
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
@testtools.skipUnless(CONF.share.run_snapshot_tests,
"Snapshot tests are disabled.")
def test_create_snapshot_with_wrong_id(self):
self.assertRaises(lib_exc.NotFound,
self.shares_client.create_snapshot,
"wrong_share_id")
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_create_share_with_invalid_protocol(self):
self.assertRaises(lib_exc.BadRequest,
self.shares_client.create_share,
share_protocol="nonexistent_protocol")
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_create_share_with_wrong_public_value(self):
self.assertRaises(lib_exc.BadRequest,
self.shares_client.create_share, is_public='truebar')
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_get_share_with_wrong_id(self):
self.assertRaises(lib_exc.NotFound, self.shares_client.get_share,
"wrong_share_id")
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_get_share_without_passing_share_id(self):
# Should not be able to get share when empty ID is passed
self.assertRaises(lib_exc.NotFound,
self.shares_client.get_share, '')
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_list_shares_nonadmin_with_nonexistent_share_server_filter(self):
# filtering by share server allowed only for admins by default
self.assertRaises(lib_exc.Forbidden,
self.shares_client.list_shares_with_detail,
{'share_server_id': 'fake_share_server_id'})
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_delete_share_with_wrong_id(self):
self.assertRaises(lib_exc.NotFound, self.shares_client.delete_share,
"wrong_share_id")
@test.attr(type=[base.TAG_NEGATIVE, base.TAG_API])
def test_delete_share_without_passing_share_id(self):
# Should not be able to delete share when empty ID is passed
self.assertRaises(lib_exc.NotFound,
self.shares_client.delete_share, '')

View File

@ -19,6 +19,7 @@ from tempest.lib.common.utils import data_utils
from tempest.lib import exceptions
from tempest import test # noqa
from manila_tempest_tests.tests.api import base
from manila_tempest_tests.tests.scenario import manager_share as manager
from manila_tempest_tests import utils
@ -43,6 +44,7 @@ class ShareBasicOpsBase(manager.ShareScenarioTest):
def setUp(self):
super(ShareBasicOpsBase, self).setUp()
base.verify_test_has_appropriate_tags(self)
# Setup image and flavor the test instance
# Support both configured and injected values
if not hasattr(self, 'flavor_ref'):
@ -169,6 +171,7 @@ class ShareBasicOpsBase(manager.ShareScenarioTest):
cleanup=cleanup)
@test.services('compute', 'network')
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
def test_mount_share_one_vm(self):
self.security_group = self._create_security_group()
self.create_share()
@ -190,6 +193,7 @@ class ShareBasicOpsBase(manager.ShareScenarioTest):
self.servers_client.delete_server(instance['id'])
@test.services('compute', 'network')
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
def test_read_write_two_vms(self):
"""Boots two vms and writes/reads data on it."""
test_data = "Some test data to write"
@ -225,6 +229,7 @@ class ShareBasicOpsBase(manager.ShareScenarioTest):
self.assertEqual(test_data, data)
@test.services('compute', 'network')
@test.attr(type=[base.TAG_POSITIVE, base.TAG_BACKEND])
def test_migration_files(self):
if self.protocol == "CIFS":