Browse Source

[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
changes/06/324006/12
Valeriy Ponomaryov 5 years ago
parent
commit
797bbcb303
  1. 1
      doc/source/devref/index.rst
  2. 166
      doc/source/devref/tempest_tests.rst
  3. 14
      manila_tempest_tests/tests/api/admin/test_admin_actions.py
  4. 136
      manila_tempest_tests/tests/api/admin/test_admin_actions_negative.py
  5. 4
      manila_tempest_tests/tests/api/admin/test_consistency_group_actions.py
  6. 3
      manila_tempest_tests/tests/api/admin/test_consistency_groups.py
  7. 20
      manila_tempest_tests/tests/api/admin/test_consistency_groups_negative.py
  8. 18
      manila_tempest_tests/tests/api/admin/test_export_locations.py
  9. 44
      manila_tempest_tests/tests/api/admin/test_export_locations_negative.py
  10. 4
      manila_tempest_tests/tests/api/admin/test_migration.py
  11. 12
      manila_tempest_tests/tests/api/admin/test_migration_negative.py
  12. 8
      manila_tempest_tests/tests/api/admin/test_multi_backend.py
  13. 48
      manila_tempest_tests/tests/api/admin/test_quotas.py
  14. 26
      manila_tempest_tests/tests/api/admin/test_quotas_negative.py
  15. 10
      manila_tempest_tests/tests/api/admin/test_replication.py
  16. 16
      manila_tempest_tests/tests/api/admin/test_replication_actions.py
  17. 12
      manila_tempest_tests/tests/api/admin/test_scheduler_stats.py
  18. 4
      manila_tempest_tests/tests/api/admin/test_security_services.py
  19. 14
      manila_tempest_tests/tests/api/admin/test_services.py
  20. 16
      manila_tempest_tests/tests/api/admin/test_services_negative.py
  21. 10
      manila_tempest_tests/tests/api/admin/test_share_instances.py
  22. 10
      manila_tempest_tests/tests/api/admin/test_share_manage.py
  23. 4
      manila_tempest_tests/tests/api/admin/test_share_networks.py
  24. 21
      manila_tempest_tests/tests/api/admin/test_share_servers.py
  25. 26
      manila_tempest_tests/tests/api/admin/test_share_servers_negative.py
  26. 9
      manila_tempest_tests/tests/api/admin/test_share_types.py
  27. 10
      manila_tempest_tests/tests/api/admin/test_share_types_extra_specs.py
  28. 64
      manila_tempest_tests/tests/api/admin/test_share_types_extra_specs_negative.py
  29. 20
      manila_tempest_tests/tests/api/admin/test_share_types_negative.py
  30. 34
      manila_tempest_tests/tests/api/admin/test_shares_actions.py
  31. 2
      manila_tempest_tests/tests/api/admin/test_snapshot_manage.py
  32. 4
      manila_tempest_tests/tests/api/admin/test_snapshot_manage_negative.py
  33. 33
      manila_tempest_tests/tests/api/base.py
  34. 6
      manila_tempest_tests/tests/api/test_availability_zones.py
  35. 4
      manila_tempest_tests/tests/api/test_availability_zones_negative.py
  36. 20
      manila_tempest_tests/tests/api/test_consistency_group_actions.py
  37. 6
      manila_tempest_tests/tests/api/test_consistency_groups.py
  38. 180
      manila_tempest_tests/tests/api/test_consistency_groups_negative.py
  39. 2
      manila_tempest_tests/tests/api/test_extensions.py
  40. 4
      manila_tempest_tests/tests/api/test_limits.py
  41. 22
      manila_tempest_tests/tests/api/test_metadata.py
  42. 47
      manila_tempest_tests/tests/api/test_metadata_negative.py
  43. 16
      manila_tempest_tests/tests/api/test_microversions.py
  44. 6
      manila_tempest_tests/tests/api/test_quotas.py
  45. 8
      manila_tempest_tests/tests/api/test_quotas_negative.py
  46. 22
      manila_tempest_tests/tests/api/test_replication.py
  47. 44
      manila_tempest_tests/tests/api/test_replication_negative.py
  48. 10
      manila_tempest_tests/tests/api/test_replication_snapshots.py
  49. 24
      manila_tempest_tests/tests/api/test_rules.py
  50. 107
      manila_tempest_tests/tests/api/test_rules_negative.py
  51. 4
      manila_tempest_tests/tests/api/test_scheduler_stats_negative.py
  52. 18
      manila_tempest_tests/tests/api/test_security_services.py
  53. 6
      manila_tempest_tests/tests/api/test_security_services_mapping.py
  54. 24
      manila_tempest_tests/tests/api/test_security_services_mapping_negative.py
  55. 22
      manila_tempest_tests/tests/api/test_security_services_negative.py
  56. 19
      manila_tempest_tests/tests/api/test_share_networks.py
  57. 26
      manila_tempest_tests/tests/api/test_share_networks_negative.py
  58. 8
      manila_tempest_tests/tests/api/test_share_types_negative.py
  59. 8
      manila_tempest_tests/tests/api/test_shares.py
  60. 76
      manila_tempest_tests/tests/api/test_shares_actions.py
  61. 14
      manila_tempest_tests/tests/api/test_shares_actions_negative.py
  62. 195
      manila_tempest_tests/tests/api/test_shares_negative.py
  63. 5
      manila_tempest_tests/tests/scenario/test_share_basic_ops.py

1
doc/source/devref/index.rst

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

166
doc/source/devref/tempest_tests.rst

@ -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\)

14
manila_tempest_tests/tests/api/admin/test_admin_actions.py

@ -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:

136
manila_tempest_tests/tests/api/admin/test_admin_actions_negative.py

@ -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")

4
manila_tempest_tests/tests/api/admin/test_consistency_group_actions.py

@ -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")

3
manila_tempest_tests/tests/api/admin/test_consistency_groups.py

@ -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):

20
manila_tempest_tests/tests/api/admin/test_consistency_groups_negative.py

@ -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')

18
manila_tempest_tests/tests/api/admin/test_export_locations.py

@ -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'])

44
manila_tempest_tests/tests/api/admin/test_export_locations_negative.py

@ -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",
)

4
manila_tempest_tests/tests/api/admin/test_migration.py

@ -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):

12
manila_tempest_tests/tests/api/admin/test_migration_negative.py

@ -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')

8
manila_tempest_tests/tests/api/admin/test_multi_backend.py

@ -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]:

48
manila_tempest_tests/tests/api/admin/test_quotas.py

@ -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)

26
manila_tempest_tests/tests/api/admin/test_quotas_negative.py

@ -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()

10
manila_tempest_tests/tests/api/admin/test_replication.py

@ -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'],

16
manila_tempest_tests/tests/api/admin/test_replication_actions.py

@ -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.