Commit Graph

21 Commits

Author SHA1 Message Date
jichenjc 38e2c9c459 Remove core extension list
core extension comes from V2 API and we don't need that now
so this patch removes the code related to the extension.

Partially implements blueprint remove-legacy-v2-api-code

Change-Id: Idd3e54f757713d3bdb5f817a6cd34c04e6c681ab
2016-05-04 05:49:35 +08:00
ghanshyam f44d1aff9d Enable all extension for all remaining sample tests
As extensions options has been deprecated, API sample tests
should run against all extension enable.

This commit enables all extensions for all the remaining sample tests
and remove extensions specific tests and sample files.

Also remove extension setting specific logic from base test class
along with TODOs.

Partially implements blueprint api-sample-tests-with-all-extensions

Change-Id: I66b593760789e5b3b92137a672246f8d91e44cba
2016-06-10 06:03:02 +00:00
ghanshyam 00b29d86e2 Remove v2 extension setting from functional tests
Now v2 API legacy code has been removed, functional
tests do not need to set the v2 extensions.

This patch removes the extension setting on osapi_compute_extension
flag.

Partially implements blueprint remove-legacy-v2-api-code

Change-Id: If5db4b141702fa94777fc5706dec6c3fb6c9c594
2016-06-08 12:46:15 +09:00
EdLeafe b6dd96c342 Move config options from nova/api directory (5)
This is the fifth and final patch moving config options from the
nova/api directory. In this patch, the deprecated options from the
legacy_v2 directory have been moved to nova/conf/legacy_v2.py. A
subsequent patch will enhance the help text for these options.

Blueprint centralize-config-options-newton

Change-Id: I3fdff0d3c0c2f36155ad4f7060395e788b78d150
2016-05-17 13:07:47 +00:00
EdLeafe 39e2bc9cfc Move config options from nova/api directory (2)
This is the second patch moving config options from the nova/api
directory. In this patch, the openstack common options are moved. A
subsequent patch will enhance the help text for these options.

Blueprint centralize-config-options-newton

Change-Id: If56965c88d910d4d3ed2232efa91b2033ed34468
2016-05-09 19:23:20 +00:00
He Jie Xu 73eda1cb7d Remove the legacy v2 API test scenarios from API sample tests
This patches from the test scenarios for the legacy v2 from API
sample tests. There still have some codes for legacy v2 which should
be cleanup, but that can be done later patches. This patch just stop
the test on the legacy v2 API.

Partially implements blueprint remove-legacy-v2-api-code

Change-Id: I38626e5a4aa98cbfd7b65b5eb0edbcae96e5b3f2
2016-05-04 15:49:52 +08:00
Sean Dague 45474089b8 Allow all api_samples tests to be run individually
oslo.config is very specific about what is allowed to be overridden in
our flags method. When run as a whole, the functional tests import
enough stuff so that all the tests pass. But if you attempt to run
just the versions tests, they will fail with an import error. This is
because the api_samples_base references osapi_compute_link_prefix and
osapi_compute_extension in all cases.

Adding this to the base class makes these tests runnable on their own.

Change-Id: I6e9800fdfb7a3c8495de71220bfec0597e45da82
2016-02-05 08:11:03 -05:00
Sergey Nikitin eea7169474 Fixed incorrect names/comments for API version 2.18
Change Id92251243d9e92f30e466419110fce5781304823 added
API version 2.18, but because of a lot of rebases some
comments and class names has incorrect API version
(2.16 and 2.17). It may confuse developers in future.
These mistakes must be fixed.

Change-Id: I9719e9ddb3393f24976d1b5e4464e759daaa704e
2016-01-25 11:36:47 +03:00
Sean Dague 1f16a763e7 Make project_id optional in v2.1 urls
This introduces microversion 2.18 which signals that the {project_id}
is no longer required in URLs.

It tests this with an additional scenario in api_samples which makes
all the requests without the project_id in the url (using a different
noauth middleware to accomplish this).

Update the link fixer in the ApiSamples matching code to also update
for optional project_id. This is the least worse approach here,
because if we set request_api_version, then we have to duplicate the
entire template tree as well, which we definitely don't want to do, as
it now correctly handles either url form.

This updates the auth tests to bifurcate with testscenarios instead of
the subclass model, which makes for more consistent tests.

In order to support adding routes without project_id we have to be
able to restrict project_id something that doesn't match any of our
top level routes.

The default for this is [0-9a-f\-]+ which will match all of the
following:

 - keystone default generated project_ids [0-9a-f]{32}
 - integer project_ids (\d+) - known in use by RAX
 - uuids with dashes (no known users, but suspect there might be)

This can be overrided with the new (but already deprecated)
``project_id_regex`` config option.

NOTE: we used this feature to expand the regex to match 'fake' and
'openstack' as valid project ids in tests. Those concepts are deeply
embedded in our tests, and need to be unwound independently.

APIImpact

Implements bp:service-catalog-tng

Co-Authored-By: Augustina Ragwitz <auggy@cpan.org>
Change-Id: Id92251243d9e92f30e466419110fce5781304823
2016-01-24 06:38:15 -05:00
Matt Riedemann 0875a411aa ServerGroupsV213SampleJsonTest should actually test v2.13
This API samples test was not using testscenarios properly,
and it wasn't extending the correct test class, so it was:

1. Not actually running tests.
2. Not running tests at the correct microversion (v2.13).

This fixes the testscenarios setup for the subclass and the
API samples and templates (since it's not using subs for the
intended project_id that was in the samples).

Also fixes a typo in ApiSampleTestBaseV21.

Change-Id: I27e8fce5d456914d88098c6cfabe05fa8afbc8eb
Closes-Bug: #1534354
2016-01-14 14:48:40 -08:00
Sean Dague 415b221e33 update api_samples code to use better variables
_api_version and request_api_version are pretty confusing
semantically. Update these to more meaningful names to make the code
easier to understand: api_major_version, microversion.

Change-Id: Ief6b12fc755a6c48cbef7b82ba226e47850c0b9e
2015-12-14 11:23:26 +08:00
Sean Dague ede70a1973 Use testscenarios to set attributes directly
testscenarios was previously used to set an intermediary symbol, which
then set additional attributes. This got really complicated to figure
out what scenarios were really doing, and how to add more (or bypass
them in tests).

This clarifies that usage, unwinds the testscenarios simplifying what
gets set up.

It also starts making calls to API v2.1 on the v2.1 url. This is
supported with existing API samples docs with a mechanism to update
links if they exist in the docs.

Change-Id: I9affc046300295cdf3e284ccc736019ccaffb9f2
2015-12-10 09:16:53 -05:00
EdLeafe 7d3f90cd9e Remove 'v3' from extension code
This is part of the v3 cleanup effort. The 'API_V3_CORE_EXTENSIONS'
attribute has been re-named to 'API_V21_CORE_EXTENSIONS'.

Partial-Bug: #1462901
Change-Id: I2867b7788b06a56c594153dd9e0361788112793f
2015-09-08 14:00:03 +00:00
EdLeafe 28d2b0df5a Remove more 'v3' references from the code
This is part of the V3 cleanup effort. The 'ApiSampleTestBaseV3' class
has been renamed to 'ApiSampleTestBaseV21', and all references to it
updated. Also, all references to the 'nova.api.v3' extension namespace
have been renamed to 'nova.api.v21'. Finally, some code that used short
variable names like 'v1', 'v2', etc., has been updated to rename these
'vers1', 'vers2', to avoid confusion with the v3 issue.

Change-Id: I23eab21c7158ba319e060bd075ef25afc5365381
2015-09-08 13:56:05 +00:00
Jenkins a9090bb5f5 Merge "api: use v2.1 only in api-paste.ini" 2015-09-02 04:18:31 +00:00
John Garbutt 4a18f7d3ba api: use v2.1 only in api-paste.ini
I have taken a look at:
* removed /v3
* /v2 and /v1.1 now uses v2.1 legacy mode
* add deprecation warnings for old v2 code and ec2
* ensure legacy v2 code is not used by default

DocImpact
UpgradeImpact

Depends-On: I513b54eeacee1486ea11b85913ab2d21727fc5f9
dropping a tempest test that assumes certain validation order

Change-Id: I94b1305882598cc259a267dc8e954ab242baf7d1
2015-08-28 10:14:27 +00:00
John Garbutt 11507eeceb api: deprecate the concept of extensions in v2.1
We want to remove the extension infrastructure in the v2.1 API during
the next release. To make that possible, we must deprecate the
configuration now.

Also deprecating the osapi_v3 group, and moving to osapi_v21.

UpgradeImpact
DocImpact

Part of blueprint nova-api-deprecate-extensions

Change-Id: I084444b11dceda7cf8f88c157aa67d36490fce49
2015-08-27 13:16:09 +00:00
ghanshyam 8c4b555116 Cleanup for merging v2 and v2.1 functional tests.
All functional tests have been merged between v2 and v2.1.
This commit does the cleanup for all TODO added while merging the tests.

Partially implements blueprint test-collapse-v2-and-v21

Change-Id: I2f5a3dcc41e296c3baba6e4ea7e20079df48b43d
2015-08-26 10:56:29 +09:00
ghanshyam 497b8690d2 Move common sample files methods in test base class
As functional tests have been shared among v2 and v2.1, some
function to get sample files present in api_samples_test_base.py
are now unused.

This commits removes those unused functions and moves the
correct one from  api_sample_base.py to api_samples_test_base.py.

Partially implements blueprint test-collapse-v2-and-v21

Change-Id: I7b78483e6b2980e975b0ee451f1818a1b221472f
2015-08-24 05:43:11 +00:00
ghanshyam 3fa2200f0c Share server POST sample file for microversion too
There are many place where server POST request has been used to tests
other API behavior. There was issue of having duplicate
server POST req and resp sample files in each API sample directory.
we added logic to share those sample files from common place
('servers' sample dir)

As microversion tests also need to share such logic, This commit
extends that logic to work for microversion tests also.

Partially implements blueprint test-collapse-v2-and-v21

Change-Id: I3448e1934585c2dabed6c45216ea0513db258b27
2015-08-24 14:40:12 +09:00
He Jie Xu 9f9802eebd Move the v2 api_sample functional tests
This patch move the all v2.1 api sample tests under
'functional/api_sample_tests'. Also move sample files under
'doc/api-samples'.

Co-Authored-By: Ed Leafe <ed@leafe.com>
Co-Authored-By: Alex Xu <hejie.xu@intel.com>
Partial-Bug: #1462901
Change-Id: I2b924f2ad7687a23a018a9b658e8acd9e04d7963
2015-08-18 15:25:41 +08:00