21 Commits

Author SHA1 Message Date
Felipe Rodrigues
bef40b3f80 Fix tests creating share without using share_size
Some tests from share group and replication are not creating
share following the `share_size` tempest CONF. This patch
fixed them applying that configuration.

Change-Id: If525e97a5d456d6ddebb4bf9bc8ff6190c95a555
2021-08-23 14:49:51 -03:00
lkuchlan
86f2432476 Enable http response extraction
This patch is a preparation for adding RBAC tests.
Currently, we only return the body without the response
in manila REST client. The response is necessary for
the testing, because we need to check the returned code
status and to compare it with the expected status.
This way we will check if the user has the right
permissions for the action.

Change-Id: If0e39afb635c469a25919770a869087bf5def561
2021-07-21 12:45:09 +03:00
lkuchlan
3af822bf96 Fix class inheritances in base.py
Change of inheritance to "BaseSharesMixedTest" class since it
requires admin privileges.
This change will allow removal of duplicate code.

Beyond that, "create_share_type" method is under "BaseSharesTest",
which is incorrect since it requires admin privileges.

Change-Id: Idd2c2285e266f0b733301ccfae5c423340de2511
2021-06-21 18:14:25 +00:00
Goutham Pacha Ravi
b60fddac7f Setup snapshot extra specs only if required
For legacy reasons we always included snapshot_support
and create_share_from_snapshot_support in all the
share types the tests created. These extra-specs are
no different from any other optional extra-specs in
manila, atleast since API version 2.24 (snapshot_support
was "implied"/"required" until API version 2.23). 2.24
is a really old version to support for tempest testing.

Since we always use the latest API version to create the
share types necessary, we only ever need 1 required
extra spec (driver_handles_share_servers) - lets supply
the rest only within tests that need to test snapshots
and shares from snapshots.

This patch also adds missing skip decorators for share
group tests that were testing snapshots.

Change-Id: Ifaceab574e3242e44a9cf1bea77a4be9e505d8b8
Related-Bug: #1922784
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
2021-05-31 10:10:27 +03:00
Goutham Pacha Ravi
a0acf25969 Fix API version test skip logic
API tests must be evaluated by min and max
versions, however, we've multiple places
where we don't seem to evaluate the min_version;
this leads to incorrect behavior when test
runners set a different min_version in their
test configuration.

We can also consolidate the decorators and
callables that we have. We attempted this in
the recent past [1], however, we replaced the
callables with calling a decorator method, which
resulted in many tests not being skipped.

This bugfix is currently necessary to get
tests working against stable/ussuri and
stable/train branches.

[1] I0c35aff993e67c1ef44c27580f8c2c829a6275f7
Change-Id: I2eceb1d5fe42b1b779e115a0144a5d9639d3753f
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
2021-05-28 00:57:45 -07:00
lkuchlan
f7fc5b6494 Consolidate waiters methods
Currently, for each resource there is a waiter method.
The code is almost the same in all waiter methods.
This patch suggests proposes to consolidate these methods.

Change-Id: I92f4628051731a9f7e05404b48a96d2ed27a855b
2021-02-19 15:17:22 +02:00
lkuchlan
540e74ac3d Moving resource waiters to a new module
Currently, resource waiters methods are placed under
service clients modules. There are three duplicated
waiters in both v1 and v2 modules:
- wait_for_share_status
- wait_for_snapshot_status
- wait_for_access_rule_status

This patch suggests to separate the waiter functions
from client modules and collect them in one place.

Change-Id: I9f0d50a325139e6067e4339533d4b01a322df7a8
2021-01-21 10:14:19 +02:00
lkuchlan
88452b3d31 Add uuid for tests
We should add a unique identifier for manila tests like
done in tempest. This will help to track a specific
test over time.
This patch adds a unique id for all functional and scenario
tests and also adds check-uuid to tox tests.

Change-Id: I262c7df709a8a7e9ed36591571069b9bcef0f51c
2020-09-08 10:54:10 -07:00
Goutham Pacha Ravi
af44826a3a Stop forcing creation of "isolated" credentials
A number of tests are creating an "isolated"
test credential to test cross project separation.
This isn't necessary, since test base classes
already request projects to run the tests. So we
can just use different project contexts where
appropriate.

In the quota tests, we request tempest to allocate
us fresh credentials, because these tests can be
destructive if they accidentally malfunction.
We do this by setting the class level directive
"force_tenant_isolation=True". Whenever we do
this, we will skip the tests if tempest is
configured to not use dynamic credentials;
because tempest will gladly ignore the explicit
configuration to disallow dynamic credentials
and give us new credentials, which might be
frustrating to test runners.

In this change, we
- delete all the code to request "isolated"
  test credentials from tempest.
- delete code that was written to cleanup
  test credentials allocated to test "methods"
  and classes.
- refactor quota tests to revert updates
  when the test concludes (requesting fresh
  credentials for these tests is just a fail-safe)
- Fix creation of share types per visibility, a change
  that was accidentally removed in [1]
- Fix "SharesAdminQuotasUpdateTest.test_reset_share_type_quotas"
  by using a correct project user instead of a
  random project's user to force enforce user quota
  higher than the project.

[1] I15880e400df30918762ebd7304244b4a27200168
Co-Authored-By: Lucio Seki <luciomitsuru.seki@fit-tecnologia.org.br>
Change-Id: I7607019e47ce9e8c6584f69c2b2d3228873f24df
Closes-Bug: #1883795
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
2020-06-29 23:29:33 -07:00
lkuchlan
a3b6f7ad25 Move all conditions skipped under "skip_checks" method
Manila tempest plugin class structure should be compatible
with tempest project as manila tempest plugin is a plugin
of tempest.
In some cases incompatibility can cause problems.
For example: using "check_uuid" tool for generating UUIDs
for tests does not work properly in manila, Because some
classes are wrapped with conditions skipped.
I suggest to use "skip_checks" method that been used to
evaluate config before tests methods and skip them based
on these checks.

This patch moves all conditions under this method.

Two new functions been added to "skip_checks" method
in order to skip by microversions and reduce a duplicated
code:
  - "check_skip_with_microversion"
  - "check_skip_with_microversion_not_supported"

Change-Id: Id0a15dbfbd3d85d7773c26e252f4cc4d906cf377
2020-02-14 21:22:21 +00:00
Douglas Viroel
bd4e78c622 Enable share-replica tests in multitenancy enviroments
This patch enables share-replica tests to be executed in a multitenancy
environment, providing a share-network to be used by both shares and
share-replicas.

The multitenancy test for share-replicas will be enabled only for API
version equal or greater than 2.51.

Depends-On: I60bdb493ad5766f28408a0c877f960922fe44ad0
Change-Id: Icb93fc346b71edc7bb3ac989e9751899bb80fbe5
2019-09-14 13:59:19 +00:00
Goutham Pacha Ravi
839c98b2c1 Fix availability zones tests
Whenever creating a resource in an availability zone,
the positive test cases must ensure that the AZ supports
the characteristics needed by the resource.

Add a new helper method to filter AZs by share types
to facilitate such a check.

Change-Id: Ia721c434ceae5f02fc51bef5ec48b356da0de98d
Closes-Bug: #1811739
2019-01-15 11:21:26 -08:00
Victoria Martinez de la Cruz
f6bc6fa7bc Create a generic share type (api tests)
Tempest assumes a default share type already created
to work. This means, if a default share type is not
created and not specified in the conf file, tempest
tests fail. A workaround is to create a share type
as part of the environment setup for all the tests
that need it. This patch set does that.

Change-Id: I15880e400df30918762ebd7304244b4a27200168
Closes-Bug: #1743472
2018-08-05 19:37:43 -03:00
Raissa Sarmento
80f5fbf2c9 Initial fixes to plugin repo
Fixing requirements and setup for manila tempest plugin.

Depends-On: I21f2e27ba18f18ebdf07105452c0ffb6fc04bb83
Change-Id: Id773014b915817ff41b9bffd41e84e4d53fb78be
2017-11-20 12:01:12 -03:00
Clinton Knight
4699a8c73d Add create_share_from_snapshot_support extra spec
The snapshot_support extra spec has always meant two
things: a driver can take snapshots and create shares
from snapshots. As we add alternate snapshot semantics,
it is likely that some drivers will want to support
snapshots and some of the new semantics while being
unable to create new shares from snapshots.

This work adds a new extra spec,
create_share_from_snapshot_support, that removes the
overloading on snapshot_support. It also makes the
existing snapshot_support extra spec optional,
allowing admins to create types without setting
snapshot_support; shares created with such types
will not support snapshots.

APIImpact
DocImpact

Co-Authored-By: Goutham Pacha Ravi <gouthamr@netapp.com>
Implements: blueprint add-create-share-from-snapshot-extra-spec
Change-Id: Ib0ad5fbfdf6297665c208149b08c8d21b3c232be
2016-12-21 09:57:08 -05:00
Marc Koderer
e2251ea8e9 Remove tempest.test usage from manila tests
Manila tempest tests should be independent from tempest code
as much as possible. The decorator test.attr is widely used in
all tests to set testcase attrs. This decorator doesn't
really do anyting else than calling testtools.testcase.attr.

Change-Id: If10beb9ae7562524f602a6fd7254aa95ef24d70e
Partially-Implements: bp tempest-no-deps
2016-09-30 12:47:17 +00:00
zengyingzhe
269d1fcd68 Fix test bugs for replication CI
Change-Id: I9e1986a44d915adcece41a3db8fccae8ca8045d9
2016-08-29 11:46:20 +08:00
vponomaryov
a0c8794a1f Delete duplicated broken tempest test
Test "test_unmanage_replicated_share_snapshot_with_no_replica" is
located in "replication" test suite. But, it does only
"snapshot unmanage" actions without any relations to "replication".
Also, it does not delete real snapshot resource, because
"manila snapshot" gets only unmanaged.
So, just remove above mentioned test as duplication that, moreover,
leads to resources orphanage and cleanup errors.

Change-Id: Ifc762a882a78159adacfe168a4edbe824178301a
Closes-Bug: #1599165
2016-07-05 16:46:51 +03:00
Valeriy Ponomaryov
39cdf72f8e [Tempest] Stop using deprecated Tempest opts
Currently, Manila CI Tempest jobs use deprecated options of Tempest.
Recently, latest version of Tempest dropped them [1].
Manila CI jobs work ok, because they check out specific version of
Tempest. But it will work until first Devstack update for some one
more Tempest feature and then we will be forced to use latest Tempest
again. Switch to supported approach of setting up users in Tempest,
to avoid such sudden blockers.

[1] I8c24cd17f643083dde71ab2bd2a38417c54aeccb

Change-Id: I5b3ebab52ea1401f6f7a116d1260268eb10ebe0c
Closes-Bug: #1586129
2016-06-08 11:44:08 +03:00
Valeriy Ponomaryov
2abf5d7dc2 [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
2016-06-08 11:25:32 +03:00
yogesh
44ce126f7d Handle manage/unmanage for replicated shares
Managing a share with a share type that has replication_type
extra_spec must be allowed. Drivers are expected to fail
this operation if the share was part of a replication relationship
that Manila does not know about.

Unmanaging a share with replicas must not be permitted
until all replicas are removed.

Managing and unmanaging of snapshots must not
be permitted for a share that has replicas.

Modify the NetApp driver for manage_existing to check
for existing replicas.

Also fix issue with manage retry where the share
data was being altered inappropriately by a DB API.

Closes-Bug: #1561641
Closes-Bug: #1565903

Co-Authored-By: Goutham Pacha Ravi <gouthamr@netapp.com>

Change-Id: I82f1fef1e30114e017efd00fa7da70aceecab94c
2016-04-15 19:00:23 +00:00