Commit Graph

26 Commits

Author SHA1 Message Date
Raissa Sarmento 797048c5ce Remove in-tree tempest plugin
Remove in-tree tempest plugin in favor of newly
created manila-tempest-plugin repository.

Change-Id: I1fb124598f38067fee469df124ee684f748c6f57
2017-12-22 11:11:38 +00:00
zhongjun 6dac83660d Add count info in /shares and /shares/detail response
Added support for display count info
in share list&detail APIs:

1. /v2/{project_id}/shares?with_count=True
2. /v2/{project_id}/shares/detail?with_count=True

Partially-Implements bp add-amount-info-in-list-api
Change-Id: I12c41a46140b04f26565d8934e0326480477c612
2017-12-13 01:46:17 +00:00
zhongjun f906bcdd4e Fix the exact filter can be filter by inexact value
Fix the ``exact`` filters (name, description) in ``shares``,
``snapshots``, ``share-networks`` list can be filter by ``inexact``
value.

Change-Id: I51e6b754f37a09c09a60e9a7fb51d3c9721f2d1f
Closes-bug: #1704971
2017-07-24 11:49:13 +08:00
zhongjun c96df66823 Add like filter
Add like filter support in ``shares``, ``snapshots``,
``share-networks``, ``share-groups`` list APIs.

APIImpact

Implements BP like-filter
Change-Id: I5fdf6d89d0b6c7fa182ddfaac60979bc6c0fc2a5
2017-07-10 14:55:41 +08:00
zhongjun 4af1944985 Use parenthesis instead of backslashes in tempest folder
Use parenthesis instead of backslashes in tempest folder

TrivialFix
Change-Id: I6c2ea07b0bfc5852b28e44989406cc10eb912e33
2017-06-22 02:48:50 +00:00
Ben Swartzlander 15b27e8fbe Only return share host for admins using shares API
Also, allow filtering by host based on policy 'list_by_host' that
defaults to 'admin only'.

Do not bump API, because it is not considered as expected behavior,
hence should not be kept for old microversions.

Co-Authored-By: Valeriy Ponomaryov <vponomaryov@mirantis.com>
APIImpact
Change-Id: I799bb7378927b6c3ee0f9fe88fd9876a03dd85b5
Closes bug: 1664370
2017-02-16 18:13:31 +00:00
Alex Meade d25f101ab4 Manila Share Groups
Remove the experimental consistency group APIs and
replace them with the experimental Share Group APIs.

DocImpact
APIImpact
Partially-implements-blueprint: manila-share-groups

Change-Id: I79a80a62ae4e0015d6161edc2b93fd1f9ba69537
2017-01-23 21:29:12 +02:00
Clinton Knight d4a379d083 Implement share revert to snapshot
This commit adds the ability for Manila to revert a
share to the latest available snapshot.

The feature is implemented in the LVM driver, for
testing purposes.

APIImpact
DocImpact
Co-Authored-By: Ben Swartzlander <ben@swartzlander.org>
Co-Authored-By: Andrew Kerr <andrew.kerr@netapp.com>
Implements: blueprint manila-share-revert-to-snapshot
Change-Id: Id497e13070e0003db2db951526a52de6c2182cca
2017-01-17 15:06:01 -05:00
Clinton Knight 0d6db3588c 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
Jenkins 44c186bc70 Merge "Use assert(Not)In/Greater(Equal)/LessEqual/IsNotNone" 2016-10-13 10:33:53 +00:00
Marc Koderer a0163f4c20 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
Béla Vancsics f33ac181b0 Use assert(Not)In/Greater(Equal)/LessEqual/IsNotNone
Instead of using assertTrue(A * B) / assertFalse(A * B)
developers should use assertNotIn, assertIn, assertGreater,
assertGreaterEqual or assertLessEqual or assertIsNotNone.
They are compatible with Python 2.7[1] and 3.4[2]

[1]: https://docs.python.org/2.7/library/unittest.html
[2]: https://docs.python.org/3.4/library/unittest.html

Change-Id: I26ab3bc3cad5e1dddc812388b864d51c73f53f58
2016-09-30 09:43:49 +02:00
marcusvrn cad4854114 Add share_size config option
All tempest tests create shares with fixed size, 1GB. This patch add
a config option in order to allow configurable share sizes as cinder
does (Cinder change-ID reference:
I2897f6d6bd970f73867f56d9d23a768cafcbfd80).

TrivialFix

Change-Id: Ifd09519b63c6c1a0ec8449e5dae1ffe0caa1b879
2016-06-29 09:48:36 -03:00
Goutham Pacha Ravi eb784f1807 Add user_id and project_id to snapshot APIs
In a cloud with multi-tenancy, administrators
would like to see the project_id of the tenant
while listing snapshots of all tenants.

Likewise, we also should expose the user_id field
as it would help in cases where tenants have multiple
users.

DocImpact
User and administrator references need to capture
this information.

APIImpact
API changes are micro-versioned.

Change-Id: I3ad655dc9ab7440f205b0e153fccaa99abb79bbd
Closes-Bug: #1587161
2016-06-16 18:38:15 -04:00
Valeriy Ponomaryov 797bbcb303 [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
zhongjun 4334a067f0 Add user_id echo in manila show/create/manage API
Add "user_id" detail when we run command
"manila show/create/manage ...". Make the operator know
which user created this share.

APIImpact

Closes-Bug: #1562846
Change-Id: I2858c7f63182288f354b96448f0970d3642d4bf7
2016-05-11 09:16:21 +08:00
Ben Swartzlander 4368c98b71 Update tempest commit and switch to tempest.lib
tempest_lib was renamed to tempest.lib which causes problems
when running tests because tempest imports plugins from other
projects and crashes.

Closes bug: 1552520

Change-Id: Id7d43dee256856062bd0dadad9c469c1500ee36e
2016-03-02 23:09:00 -05:00
Goutham Pacha Ravi f858e537dd Share Replication API and Scheduler Support
This patch provides the scheduler support to filter share
backends matching replication capabilities reported by the
hosts and the replication_type extra_spec provided via the
share_type during share creation.

It also adds wsgi routes, API endpoints and driver entry
routines to support the actions: list, show, create, delete
and promote share replicas. It augments the ShareInstance
DB model with a 'replica_state' attribute and the Share DB
Model with 'replication_type' attribute to support these
workflows.

Replica states are periodically updated from the respective
backends that the replicas are created on.

APIImpact
Impact on existing APIs:
In Microversion 2.11, the /shares APIs return 2 additional
fields during index and show calls for each share: 'has_replicas'
and 'replication_type'. Similarly, the field 'replica_state' is
added to the API response for /share-instances.
Also, deletion of a share that has replicas is forbidden,
returning error code 403.

DocImpact

Co-Authored-By: Alex Meade <mr.alex.meade@gmail.com>

Implements: blueprint manila-share-replication

Change-Id: I10515d55b1291c34777a31d8c6a3a1954f551235
2016-02-11 19:45:37 +00:00
Jenkins 5d75766c61 Merge "Fix params order in assertEqual" 2016-02-08 15:41:41 +00:00
Igor Malinovskiy b1b723ad0b Add update_access() method to driver interface
- Add update_access() method to driver interface
- Move all code related to access operations to ShareInstanceAccess
class
- Statuses from individual access rules are now mapped to
share_instance's access_rules_status
- Add 'access_rules_status' field to share instance, which indicates
current status of applying access rules

APIImpact
Co-Authored-By: Rodrigo Barbieri <rodrigo.barbieri@fit-tecnologia.org.br>
Co-Authored-By: Tiago Pasqualini da Silva <tiago.pasqualini@gmail.com>
Implements: bp new-share-access-driver-interface

Change-Id: Iff1ec2e3176a46e9f6bd383b38ffc5d838aa8bb8
2016-02-05 10:41:51 -02:00
Yatin Kumbhare dac72337f7 Fix params order in assertEqual
Fix params order to correspond to real signature:
assertEqual(expected, actual)

Change-Id: I5887e9c4fbd8953b3be9e89ce86758f8d1d842b2
Closes-Bug: #1277104
2016-01-27 11:52:08 +05:30
Valeriy Ponomaryov dcbdcf3534 Implement export location metadata feature
Some upcoming features require more than one export location and
possibility to mark them with specific labels like fast/slow or
rw/ro.

So, implement 'export locations metadata' feature:
- It allows to set any key-value pairs for each export location.
- These key-value pairs can be set only by share manager using
  response from various share driver methods.
- Example of update is implemented using Generic driver
  "create_instance" method.
- Metadata can be updated for any export location in any place
  of share manager where db function "share_export_locations_update"
  is called.
- Keys from export location metadata table will be added to 'share' and
  'share instances' views as export location attributes.

Also:
- Add new attr 'is_admin_only' for existing export locations model.
  If set to True, then only admins will be able to see them. Unless
  policy is changed.
- Add APIs for reading export locations by share and share instance IDs.
- Remove 'export_location' and 'export_locations' attrs
  from 'share' and 'share instance' views.
- Bump microversion as new APIs implemented.

APIImpact

Implements bp export-location-metadata

Change-Id: I36d1aa8d9302e097ffb08d239cf7a81101d2c1cb
2016-01-15 12:29:12 +02:00
nidhimittalhada 672175728f Fix 'extend' API for 2.7+ microversions
Extend/Shrink share is not working in microversion 2.7+.
When trying to extend/shrink a share, manila raises an
error telling that the new share size must be an integer.
Bug was due to improper use of get method on dictionary.
Corrected by using get method properly.

Change-Id: I700581d815da0fdd6addedc42f3e2ba528680e60
Closes-Bug: #1531536
2016-01-12 17:39:58 +05:30
Goutham Pacha Ravi ffa63ef965 Improve tempest tests for shares listing APIs
In manila_tempest_tests/tests/api/test_shares_actions.py,
tempest tests for share list and detail APIs so far only
assert the presence of the 'snapshot_support' key in
addition to some basic keys.

Add assertions for keys introduced in later microversions.
Include more 'basic keys' that are expected to be
part of the response for these APIs before v2.1.

Leverage the microversion comparison methods introduced
in commit 8caad2655c
and skip tests beyond microversion 2.4 if tempest is
configured for a lower microversion.

Also, un-skip QA checks in the file.

Change-Id: I65913098ae10de245844728f298fe6474e3ca628
Closes-Bug: 1528456
2015-12-23 13:39:00 +00:00
Valeriy Ponomaryov 3ea5752570 Add 'snapshot_support' attr to share details
Recently was introduced feature where snapshots become optional.

Share started have new attr "snapshot_support". But it is absent in
share payload and, hence, can not be used outside of Manila.

Also, fix lost import of translation function for related snapshot API.

Change-Id: Iddb0cf1e046b9d480a22e79b33c8674a2405362e
Closes-Bug: #1491345
Closes-Bug: #1491346
2015-09-15 23:22:27 +03:00
Marc Koderer 09798caae1 Use Tempest plugin interface
Make use of the Tempest plugin interface instead of copying Manila
files into Tempest. This will remove the burden to port Manila
tests onto Tempest master recurrently.

This ports all existing Manila Tempest test to the new structure.

It uses manila_tempest_tests as new top folder for all Tempest
tests. It follow the model of Heat (see [1]).

[1]: https://github.com/openstack/heat/tree/master/heat_integrationtests

Change-Id: Ie5ed64a6777ed1acf8dd56522c26705ae897596d
Partly-implements: bp tempest-plugin-interface
Depends-On: I26dd32b1de8cceeaa6dc674092efec683df71889
2015-09-05 00:36:33 +00:00