Commit Graph

288 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
Zuul 81c4ee6c5f Merge "Fix getting share networks and security services error" 2017-12-18 13:57:24 +00:00
Jiao Pengju 9f69258cab Fix getting share networks and security services error
It will fail when non-admin tenants try to get share networks
and security services with option '{all_tenants: 1}'.
The reason is that the policy of 'get_all_share_networks' and
'get_all_security_services' are admin api, they do not allow
the non-admin tenants list the share networks and security
services with all_tenants=1. This patch removes the policy check
of non-admin tenants and allows non-admin tenants to request to
list with 'all_tenants=1', however 'all_tenants' in the request
is just ignored.

Change-Id: Ied021b66333f1254cd232bbc38562a4a9b762ad2
Co-Authored-By: Goutham Pacha Ravi <gouthampravi@gmail.com>
Related-Bug: #1721787
2017-12-18 09:17:40 +08:00
Zuul 4b0f4480fd Merge "Add count info in /shares and /shares/detail response" 2017-12-13 13:00:29 +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
ghanshyam e58cb67be9 Remove usage of deprecated config 'resources_prefix'
Config option 'resources_prefix' was deprecated and marked
for removal.
- 6dd6fc66d8/tempest/config.py (L1081)

Tempest is going to remove this config options soon.

This commit removes its usage and hardcode the resource
prefix to 'tempest'

Change-Id: I9c140b3a9efabeced7fc26cb1f169ebe6789d88b
2017-12-10 07:07:34 +03:00
zhongjun 125651d566 Add 'description' in share type APIs
This fix add attr 'description' in list/create share
type APIs.

Change-Id: I39705acbfca812b66d74fbd2fee228a7a85bc2d8
Closes-Bug: #1724183
2017-11-22 13:28:41 -05:00
Valeriy Ponomaryov 7ba41320f3 Fix 'project_share_type_quotas' DB table unique constraint
It should be possible to use share type quotas in each project/tenant.
But we get error trying to set share types quota in second+ project
for the same share type. It happens so due to the bug in DB schema,
where we don't have 'project_id' in unique constraint.
So, add new DB migration that fixes unique constraint and cover it with
DB and tempest tests.

Change-Id: I1405ced4e12b40904b7227c9f6285e2775005f8a
Closes-Bug: #1722707
2017-10-14 23:22:10 +03:00
Dustin Schoenbrun c26bd6b10c tempest: remove call to set_network_resources()
Since the merge of the stable interface for Tempest network_resources
[0], a call within the Manila scenario tests was causing failures
around the ordering of method calls in the set up of the test class.
This patch removes the call as currently it doesn't do anything and
will fix our scenario tests.

[0] - I4eab8f2a722b47edc20e4aab0ef453bec16842f3

Change-Id: Ia9226329035508c37ca499e6efbd2382502eb141
Closes-Bug: #1717562
2017-09-16 21:18:38 -04:00
yogesh 29a52269aa [Tempest] Fix tests for pre-existing share network
Currently tempest tests do not support creating and
adding Security Service to newly created share networks.
This causes CIFS multitenancy tests to fail on some
of the backends.
Therefore, having pre-existing share network helps
testing such scenarios.

When using a pre-existing share network,
we can still test the share network API and
create share networks, however, we shouldn't
create shares on such networks.
So, any tests that create new share networks
and use them to create shares need to be skipped.

- This patch makes sure that the pre-existing
share_network is not cleaned up.
- One share_server related test is skipped
to avoid deleting share network as part of test.
- One share network negative test is skipped
to avoid creating a share with new share network.

Change-Id: I272806b05c8b4d30451d0cf4b9dd3f366b8bf728
Closes-Bug: #1698429
2017-08-08 15:00:51 -04:00
Jenkins 111b188e56 Merge "Use tempest-plugin service client registration" 2017-08-03 13:42:22 +00:00
junboli fb17422c86 Enable some off-by-default checks
Some of the available checks are disabled by default, like:
[H106] Don't put vim configuration in source files
[H203] Use assertIs(Not)None to check for None
[H904] Use ',' instead of '%', String interpolation should be
       delayed to be handled by the logging code, rather than
       being done at the point of the logging call.

Change-Id: Ie985fcf78997a86d41e40eacbb4a5ace8592a348
2017-08-03 16:13:32 +08:00
Jenkins 5757655f1d Merge "Fix cannot deny ipv6 access rules" 2017-08-03 00:43:55 +00:00
zhongjun a1ba28cad3 Fix cannot deny ipv6 access rules
We cannot deny ipv6 access rules because we remove the ipv6
access rules from global delete rules, not just remove the
ipv6 access rules from driver update_access interface parameters.
So the ipv6 access rules cannot be deleted in db.
Now, changed to only remove the ipv6 access rules
from the driver update_access interface parameters(add_rules,
delete_rules, access_rules_to_be_on_share).

Closes-bug: 1707066

Depends-On: Ifea1799e1d2e3963fec7e90ce3f9cb47b9f02f4f

Change-Id: Idd0014d898d5468922625e62f9e649926dc04e35
2017-08-02 18:16:33 +00:00
shangxiaobj 5084efe621 [Trivialfix]Fix typos
Fix the typos in manila.

Change-Id: I4d446759eddf512c46247aca0bab08b4c8155d9a
2017-08-01 01:25:50 -07:00
Andrea Frittoli (andreaf) 56718fe24f Use tempest-plugin service client registration
Tempest is going to expose a new optional interface in the plugin
class, to automatically register service clients implemented in
a plugin. Along with this the former client manager, renamed to
ServiceClients, is going to move to a stable interface in
tempest.lib.

Co-Authored-By: Raissa Sarmento <rdearauj@redhat.com>
Change-Id: I4cc9e2b9cd5cb09dff04ee16edcf85e59aec554f
2017-07-31 20:41:06 +01:00
Jenkins 244284fb6e Merge "Fix the exact filter can be filter by inexact value" 2017-07-26 20:56:45 +00:00
Valeriy Ponomaryov 256b5c84ba Add share groups and share group snapshots quotas
"Quota" APIs now will return two new following keys:

- 'share_groups'
- 'share_group_snapshots'

For user and project, but not share type.
Default values can be configured using following config options:

- 'quota_share_groups'
- 'quota_share_group_snapshots'

APIImpact
DocImpact
Implements BluePrint add-share-groups-quota
Change-Id: I397a8e886226cb22fa50abdf2a4a938bb04c655d
2017-07-26 11:32:43 +03:00
Jenkins 7a979c2f1b Merge "Update location of dynamic creds in tempest tests" 2017-07-25 12:00:02 +00:00
Raissa Sarmento 07fb60155f Update location of dynamic creds in tempest tests
Tempest is migrating their dynamic credentials interface to tempest
lib as part of the effort to create stable interfaces. [0] We will
need to update its location in our code to conform with it.

[0] http://lists.openstack.org/pipermail/openstack-dev/2017-July/119934.html

Depends-On: Id8d60e4d7c22bc72c3e48bc768509ff0cc0c89d5

Change-Id: Iaa6bf908ff5d63cbbfddc7060594818c66ce607c
2017-07-24 12:57:06 +01:00
Jan Provaznik 220cdfbd9f Provide filter name in user messages
Filtering issues are most common when creating a share. User messages
now keep information which was the last executed filter if hosts
filtering failed.

DocImpact
Partially-implements: blueprint user-messages

Change-Id: I9ce096eebda3249687268e361b7141dea4032b57
2017-07-24 11:11:06 +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
Valeriy Ponomaryov 05c42ecf70 Add quotas per share type
With this feature it will be possible to set quotas per share type
for all existing quota resources. It is useful for deployments with
multiple backends that are accessible via different share types.

Also, fix one of existing DB migrations that hangs on PostgreSQL.

APIImpact
DocImpact
Implements blueprint support-quotas-per-share-type
Change-Id: I8472418c2eb363cf5a76c672c7fdea72f21e4f63
2017-07-19 17:29:04 +03:00
Luong Anh Tuan 4d3b9c6774 Replace test.attr with decorators.attr
Function 'tempest.test.attr()' has moved to 'tempest.lib.decorators
.attr()' in Pike and will be removed in a future version.
This patch replaces the 'tempest.test.attr()' with the 'tempest.lib
.decorators.attr().'

Change-Id: I672fbce15ea9b70d977eb0073426c394a1318b86
2017-07-19 08:24:12 +00:00
zhongjun 031dd4b335 Enable IPv6 in manila(allow access)
Please read spec for design detail [1].

Add support to validate IPv6 based addresses
in allow access API when access type is IP.

[1] f7202a6cfe32a057f752a4e393f848f8a0211c36

APIImpact
DocImpact

Change-Id: Ica242007e77a7e21b2151e5fc32401b501d961b2
Partial-Implements: blueprint support-ipv6-access
2017-07-17 09:44:41 +08:00
Alex Meade dd630c3929 User Messages
For quite some time, OpenStack services have wanted to be able to send
messages to API end users (by user I do not mean the operator, but the
user that is interacting with the client).

This patch implements basic user messages with the following APIs.
GET /messages
GET /messages/<message_id>
DELETE /messages/<message_id>

Implements the basic /messages resource and tempest tests
The patch is aligned with related cinder patch where possible:
I8a635a07ed6ff93ccb71df8c404c927d1ecef005

DocImpact
APIImpact

Needed-By: I5ffb840a271c518f62ee1accfd8e20a97f45594d
Needed-By: I9ce096eebda3249687268e361b7141dea4032b57
Needed-By: Ic7d25a144905a39c56ababe8bd666b01bc0d0aef

Partially-implements: blueprint user-messages
Co-Authored-By: Jan Provaznik <jprovazn@redhat.com>
Change-Id: Ia0cc524e0bfb2ca5e495e575e17e9911c746690b
2017-07-13 13:05:57 +02: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 f1fbc5952d Add export-location filter in share and share instance list API
Share and share instance list API will accept new query string parameter
'export_location'. It can pass path and id of export_location to
retrieve shares filtered.

APIImpact

Partly-implement: BP support-filter-share-by-export-location
Change-Id: I5fdf6d89d0b6c7fa182ddfaac60979bc6c0fc2a6
2017-06-29 18:06:21 +00:00
Vu Cong Tuan e12b6614fa Replace the usage of 'admin_manager' with 'os_admin'
In tempest, alias 'admin_manager' has been moved to 'os_admin'
in version Pike, and it will be removed in version Queens [1].

The other usages which also need to be replaced, are listed below:
* manager > os_primary [2]
* os_adm > os_admin [3]
* os > os_primary [4]

[1] https://review.openstack.org/#/c/467852/
[2] https://review.openstack.org/#/c/468036/
[3] https://review.openstack.org/#/c/467605/
[4] https://review.openstack.org/#/c/466991/

Change-Id: If8880565ba6a70b1b1419394f4706fe37cfff1c4
2017-06-23 21:12:46 +07:00
Jenkins e17328cf94 Merge "Use parenthesis instead of backslashes in tempest folder" 2017-06-22 15:48:58 +00:00
Vu Cong Tuan 9ec653e6f2 Replace the usage of 'manager' with 'os_primary'
In tempest, alias 'manager' has been moved to 'os_primary'
in version Pike, and it will be removed in version Queens.
This patch is to replace the usage of 'manager' with 'os_primary'.

For other details, please check:
https://review.openstack.org/#/c/457555/

Change-Id: I7c3740d8941b837767d576d4e9b1fb86cd164d59
2017-06-22 16:30:13 +07: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
Vu Cong Tuan 9863c1b93d Replace assertEqual([], items) with assertEmpty(items)
Since assertEmpty() function has already been implemented in tempest,
let's use this function instead of generic assertEqual() function.
This change makes the code and the error messages to be more readable.
Therefore it improves maintainability a little bit.

TrivialFix
Change-Id: I3d671436e9ea2f7cbdda6d3dbf5c8a3f9d7625d4
2017-06-14 14:28:26 +07:00
Jenkins d929019cab Merge "[Share Groups] Fix creation of share group types with wrong specs values" 2017-06-08 15:17:45 +00:00
Valeriy Ponomaryov f95e5d90b6 [Share Groups] Add two new fields to SG API object
Previous change [1] added logic for handling of availability zones with
share groups and [2] for scheduling with share group capability
to create consistent snapshots. Those two added two new DB fields
for 'share_groups' DB model, but not to API response that requires
microversion bump. So, add these fields to API and bump microversion.

Following two new fields will be available with new microversion:
- 'availability_zone_id'
- 'consistent_snapshot_support'

Also, add tempest tests to these API changes.

[1] I000adeb53fe8435465cbedc3c539e6aaae6503c5
[2] I05553c308ae40c4ddc2c6469ff1c1a3da36a87da

Partially-Implements BP manila-share-groups
Change-Id: I343d0c6f3a5c7b58d88e95dba4af984fae738954
2017-06-06 10:13:36 +00:00
Valeriy Ponomaryov 0fff8b8c3f [Share Groups] Fix creation of share group types with wrong specs values
If we provide some other type than None or dict as group specs
creating share group type, then we get error 500 caused by unhandled
exception. So, avoid it by explicitly checking type of provided group
specs.

Change-Id: I81312617f37a8f559b3c9201b03cf8be31761365
Closes-Bug: #1673446
2017-06-06 13:11:17 +03:00
Valeriy Ponomaryov 21699451f1 [Share groups] Add scheduler filter ConsistentSnapshotFilter
That will be used for scheduling share groups based on their possibility
to create consistent snapshots.

Also apply following tempest plugin changes:
- Add new 'capability_sg_consistent_snapshot_support' tempest config
option, that will be used for creation of new share group types and used
to prove that scheduling works as expected.
- Fix some share group test attributes from 'only API involved' to
  'API and Backend are involved', because it is so indeed.

Change-Id: I05553c308ae40c4ddc2c6469ff1c1a3da36a87da
Partially-Implements BP manila-share-groups
2017-06-02 17:48:05 +03:00
zhongjun 233b16a519 Refactor share instances tempest test
Use ddt in share instances tempest test, and use
list_share_instances instead of get_instances_of_share
in test_list_share_instances to avoid redundant test with
test_get_instances_of_share.

TrivialFix
Change-Id: I03ae35b67e76b382b04747541afab0e4f574942c
2017-05-23 12:37:35 +00:00
yangweiwei 5a8c3c11b9 Change to share access list API
When we do manila access-list, the 'created_at' and 'updated_at' time
should be shown to the user. And then the user could determine which
is the recent access rule. As the design, the recent access-allow
rule caused the error access-status of share instance.

APIImpact
Closes-Bug: #1682795
Change-Id: Iad6070d60ec77b7de9cc9679cfa7478876084da1
2017-05-05 17:19:25 +08:00
Dustin Schoenbrun 8d3dbe2e13 Add read-only tests for cephx access rules
In the Newton cycle the ability to create read-only rules for
cephx-backed access rules was added but there were no functional tests
to exercise this feature. This patchset adds new parameters to the
existing cephx access rule test to also test read-only rules.

Change-Id: I4b4fd5790526ebc596471fd913ffe9cdb2faa520
2017-03-31 12:57:28 +00:00
zhongjun 5887f25883 change user access name limit from 32 to 255 characters
Currently, The user access name is limited to 32 characters in manila API service,
but actually the user access name is longer than 32 characters. so we need
to change user access name limit from 32 to 255 characters

APIImpact

Closes-bug: 1674908
Change-Id: I68d8afabcd3fef57e472b4067ea8949e0aa8f53a
2017-03-24 09:54:05 +08:00
Jenkins a7c7439ddc Merge "Remove redundant revert-to-snapshot test option" 2017-03-18 11:25:10 +00:00
Ken'ichi Ohmichi 190fd02bcf Switch to use stable data_utils
Tempest provides stable library interfaces under tempest.lib.
This patch switches to use it for data_utils.

Change-Id: Ia331ec10a84118e5d72a95f8f8b86509f57232a1
2017-03-12 18:57:34 -07:00
Jenkins be7f51cf00 Merge "Local copy of scenario test base class" 2017-03-11 01:22:42 +00:00
Andrea Frittoli 55600c137f Local copy of scenario test base class
The scenario tests base class from Tempest is not a stable interface
and it's going to be refactored on Tempest side, as notified in

http://lists.openstack.org/pipermail/openstack-dev/2017-February/112938.html

Maintain a local copy of the base class, taken from Tempest with head of
master at c5f1064759fe6c75a4bc5dc251ed1661845936cb.

Change-Id: I1b7470f38b9814b9baa064f9302f4f3b6a8c7894
2017-03-09 13:12:57 -05:00
Valeriy Ponomaryov 46d499a85c [Tempest] Fix concurrency in test with listing share servers
Before it was possible to pick up temporary status of share server
and fail to filter share servers as second API call, because status
could be changed. Fix it by filtering with 'active' status.

Change-Id: Idcff68ce475d31b38a34d410970cc839b06d18b3
Closes-Bug: #1670757
2017-03-07 21:22:45 +03:00
Rodrigo Barbieri 30403d05bf Remove redundant revert-to-snapshot test option
This option is used to control how revert-to-snapshot
extra-spec is used when creating a share type for several tests,
but for the same tests, it is more appropriate to either not
create a share-type (thus use the default or "don't care"
behavior) or do so based on the value of
run_revert_to_snapshot_tests.

TrivialFix

Change-Id: Ie8a0030a896634eb8deaff17ea72371419eecdea
2017-02-20 12:49:00 -03:00
Jenkins 7ef9ccb688 Merge "Only return share host for admins using shares API" 2017-02-16 23:42:14 +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
Jenkins 3d5b2d08d0 Merge "Fix to use correct config options for network_for_ssh" 2017-02-15 15:14:31 +00:00