Commit Graph

25 Commits

Author SHA1 Message Date
Michael Johnson f4935ea128 Accommodate stable branches with scoped tokens
This patch updates the Designate tempest plugin to accommodate stable
branches that still have keystone scoped tokens. The "Direction
change"[1] means scoped tokens were dropped in the Bobcat (2023.2)
release. However the stable branches back to Wallaby will still have
scoped tokens available as a configuration option.

[1] https://governance.openstack.org/tc/goals/selected/consistent-and-secure-rbac.html#direction-change

Change-Id: Ia57b5126dbc9fbe98cbcaa7ad0e11d36c21a14da
2023-04-11 17:07:07 +00:00
Michael Johnson 288cdcf697 Update designate-tempest-plugin "direction change"
The RBAC goal has changed[1] and system scope is no longer going to be
used. This patch updates Designate tempest plugin to align to this change in
direction by removing the system scope from the policy tests.

[1] https://governance.openstack.org/tc/goals/selected/consistent-and-secure-rbac.html#direction-change

Change-Id: I4e5c56630d5cca96278fe67232519c067356da23
2023-03-31 16:24:24 +00:00
Ghanshyam Mann ed18e74a69 Add project_reader in new RBAC tests
Tempest is fixing the bug#1964509 (depends-on) where
project_reader user will be created under the same project
as primary, project_member, project_admin users.

'primary', 'project_admin', 'project_member', and 'project_reader'
creds will be created in same projects. All the alt creds will be
created under the new projects. non alt and alt creds will use
different project, for example, 'project_alt_member' and
'project_member' creds will be created in different project.

Related-Bug: #1964509

Depends-On: https://review.opendev.org/c/openstack/tempest/+/871018
Change-Id: I143e69c1e150ddf7fa1757dea7bced6bff6739a9
2023-02-23 19:07:30 +00:00
Michael Johnson 73065cdaca Add API version check capabilities
This patch adds a method that allows us to get the current Designate API version under test for use in test classes to skip tests against new features introduced in a specific API version.
This patch also centralizes the "primary" zones client to be instantiated once and updates the tests to use a standardized name for the client.
Finally, it adds a missing requirement of oslo.serialization to requirements.txt.

Change-Id: I240911c0ab9b9bad7851268865d6a8e867627673
2023-02-19 18:11:49 +02:00
Arkady Shtempler 3b5d149cf3 Zone Imports - refactoring and new test cases
1) Refactoring:
   - Replace Python underscore variable with indexing.
   - Use constants.
   - Move negative test cases to dedicated "Negative" class.
   - Client's "create_zone_import" had to be improved.
   - Using provided "wait_until" in the existing tests.
2) "test_create_zone_import_invalid_file_data"
   Try to create a zone import using invalid zone file data.
   Expected: zone gets into the ERROR status.
3) "test_zone_cannot_be_update_by_import"
   Try to update an existing zone using Zone import.
   Expected: zone import gets into the ERROR status.
4) "test_create_zone_import_invalid_content_type" to test
   "415 unsupported_content_type" error response.

Change-Id: Ifce7e6ed910c43aacc566cdf692eec45779811e4
2022-06-14 10:26:34 +03:00
Michael Johnson cd0f76ead3 Expand Designate RBAC testing - zones import
This patch adds RBAC testing for allowed and disallowed credentials.
This is one of a series of patches adding testing. This patch covers the
zones import API.

Change-Id: I3b7f7eb00a31da5d9f26e71f961ca5300ec17bd2
2022-05-27 19:25:51 +00:00
Michael Johnson ade263cd1e Fix TLD issues for test concurrency
Currently there are intermittent test failures due to inconsistent
management of TLDs across the test classes. This is due to some test
classes using the same TLD and cleaning them up or cases where a TLD is
expected to exist, but may not have been created yet.

This patch established a dedicated TLD for each test class that creates
zones. Inside each test case, a zone name will be created with the test
name and the test class TLD. This creates the required TLD isolation to
allow successful test concurrency.

The patch also changes the base TLD from 'org' to the RFC 2606 reserved 'test'.
This should allow for easier identification of test related resources.

Change-Id: I3509767ec0ce6be6b6f15a1bc15a730a4a144b09
2022-05-23 21:07:16 +00:00
Michael Johnson a3a236331c Make the API tests compatible with scoped tokens
This patch makes the API tests compatible with keystone scoped
tokens and the new RBAC defaults.

For example, admin system scoped tokens do not have a project_id associated
with them requiring some tests to be updated to not assume the admin
credential always has a project_id.

This patch also makes some sections consistently ordered across files.

Change-Id: Ie2c7402967f40bb90e0d97dad1c3d59f82cb6d80
2021-09-23 21:48:41 +00:00
Michael Johnson df9fda1c88 Update service client access in tempest tests
All the Designate service clients are registered via the plugin interface[1],
that way Tempest register and create the lazy initialization of registered
clients so that they can be access from there in consistent way.

But designate-tempest-client create a separate instance of those and access
instead of accessing the registered service client in Tempest. This commit
makes all the service clients access from Tempest registry and remove the
separate objects.

[1] https://github.com/openstack/designate-tempest-plugin/blob/master/designate_tempest_plugin/plugin.py#L78

Change-Id: I4b65ca16cd53ff4c6bece642764a4abe2a469c01
2021-09-23 21:02:30 +00:00
Michael Johnson 65ebf4bbe7 Fix list-all-project tests for pagination limit
Designate has a fairly small default pagination limit of 20.
Some tests were making list API calls with the all-projects header,
which with parallel test execution could cause the list to exceed the
default pagination limit of 20. This would cause the tests to intermittently
fail.
This patch sets the request parameter "limit" to 1000 for these tests
to allow for parallel test execution which may cause lists to include
more than twenty entries.

Change-Id: Ic074c2c4dc5a5f97c609aac5992f78557722bb71
2021-06-21 23:43:27 +00:00
Michael Johnson cddf415841 Improve the zone import API tests
This patch improves the zone import API tests such that they will
wait for a completed status before advancing. This not only insures
the test didn't get stuck in "PENDING", but also assures the import
record has been updated with the zone ID allowing the zone to be
cleaned up at test completion.

Change-Id: Ied4d4d37b3e5428f69b6ba2b0cfecb99d7125f2c
2021-06-16 00:43:21 +00:00
Erik Olof Gunnar Andersson e8ba5cc266 Fixed multiple leaking tests
- Fixed multiple issues with cleanups.
- Fixed tld never being removed.
- Added some additional waiters.

Change-Id: I2a83c7c2c276be6c0d4fac82e0beaa157362dca0
2021-06-15 00:30:49 -07:00
Arkady Shtempler c9441415ef Adding "wait_for_zone_import_status" to stable:
1) test_create_zone_import_invalid_name
2) test_create_zone_import_invalid_ttl

Change-Id: Iebaeeeb9e6c285b1d72ad7d5caf569265dc10669
2021-05-12 14:58:26 +03:00
Arkady Shtempler 40322f3c6b Adding four new test cases to "import zone" test suite
1) "test_create_zone_import_invalid_ttl"
   Use invalid TTL value to create zone import.
   Expected: should fail.

2) "test_create_zone_import_invalid_name"
   Use invalid name to create zone import.
   Expected: should fail

3) "test_show_import_impersonate_another_project"
   Use admin client to impersonate another project and to
   show created zone imports.
   Note: test is based on "x-auth-sudo-project-id" HTTP header.

4) "test_list_import_zones_all_projects"
   Use admin client to list all created zone imports.
   Note: test is based on "x-auth-all-projects" HTTP header.

Change-Id: Icca248d21ccb495d438ff828a79c0894690792f1
2021-05-04 10:58:06 +03:00
Maksym Shalamov 2da1d6e6c9 Fix deleting zones after tests
these tests create zones as part of the test but do clean them up
afterward slowly. This leads to these and following tests in the thread
to fail with over quota when default zone quota is sufficiently low.

Change-Id: Iebe15ca6d0d3101237a92e011b081c38647a8de6
2019-02-21 14:26:32 +00:00
Zuul 8a3b02adbd Merge "Do not create network resources for API tests" 2018-03-16 08:41:02 +00:00
Graham Hayes bbc01e3510
Fix credential naming
Change-Id: Ica935f22ed30792033c6c36742abead20de66363
2018-02-15 18:12:05 +00:00
Ritesh Anand f015ecb1de Do not create network resources for API tests
We need to call set_network_resources() from class with API tests, to
avoid creating network resources. Which are not needed for API tests.

Change-Id: Ia93303390d9887722fa2cfde7757e5e9103ae585
Closes-Bug: #1689415
2018-01-12 18:41:21 -08:00
Thomas Herve d8dd2cecff Remove zone_id on import compare
If the import is fast, it can be done by the show, so we can't compare
zone_id.

Closes-Bug: #1734868

Change-Id: I291155304a36142ec2fd2f772215bb10f2dbae11
2017-11-28 12:40:41 +01:00
ghanshyam f4b0724d59 Replace deprecated test.attr with decorators.attr
Tempest has deprecated decorator 'tempest.test.attr' and
moved the same as stable interface to 'tempest.lib.decorators
.attr' in version 16.1.0.

Let's use the stable interface for attr decorator.
This will help Tempest to remove the deprecated decorator.

Change-Id: If72deb25a1438470442b153a41303ca6c7cbd22b
2017-07-25 05:07:39 +03:00
Emilien Macchi ddb13fe2c5 Reduce the number of "smoke" tests
This reduces the number of smoke tests to < 10. It includes v1 tests, v2
tests and one scenario test to check that a zone goes to active.

Change-Id: I9233a5d783649fe2bfad8e772f4165bdc4e1c619
2016-07-07 14:33:28 +00:00
Kiall Mac Innes 24df485be7 Replace idempotent_id decorator with tempest.lib version
Useage of the tempest.lib version is preferred, as it's considered
API stable, unlike the tempest.test version.

Change-Id: Ida2efd9fdd9ce095aaa33ce41c90f93efbcf0970
2016-06-09 16:13:10 +01:00
sonu.kumar 0127579aa7 Replace assertEqual(a>b) with assertGreater(a, b)
Change-Id: Ia6d33efa2f0896c6cc49acb157b97bb2038d1449
2016-05-24 11:24:54 +09:00
Kiall Mac Innes 8ae796c691 Port V1 Tempest test from designate's contrib folder
These are a close to a straight port as was possible, no cleanup was
performed where it wasn't absolutly necessary.

In addition, we add flags to enable V1, V2, Admin API tests, and a
V1 servers API flag, as these tests have proved particularly
susceptible to race conditions.

Change-Id: Idc31c00c95fde96087f4f222ae9c17e554e6b1fc
2016-05-12 14:44:08 +01:00
sonu.kumar aec952a9ee Add zones_import_client's methods and tests to Designate tempest plugin
Partially-Implements: blueprint designate-tempest-plugin

Change-Id: If01461617020f39b4da554b127e7b5e5fd704645
2016-04-20 10:08:46 +09:00