nova/nova/tests/functional/api_samples
jichenjc 6abb88befe Check flavor type before add tenant access
Currently we allow tenant access for public flavor, however,
we can't query it after that because flavor is public.
This patch adds check for add access function to raise exception
if the flavor is public.

Also, a nit change is use methods introduced in
793bcc07b9 to get flavor.

APIImpact: Adds new 2.7 API microversion due to new error condition
           in flavor access API
Implements blueprint check-flavor-type-before-add-tenant
Closes-Bug: #1361476

Change-Id: I461175e9969a0dd5b2b7ef75ea7d9f36f3a306d0
2015-07-24 15:36:29 +03:00
..
OS-EXT-IPS V2 tests -Reuse server post req/resp sample file 2015-03-11 16:19:40 +09:00
OS-EXT-IPS-MAC V2 tests -Reuse server post req/resp sample file 2015-03-11 16:19:40 +09:00
OS-EXT-VIF-NET V2 tests -Reuse server post req/resp sample file 2015-03-11 16:19:40 +09:00
all_extensions Merge extension-info functional tests of v2 and v2.1 2015-06-09 14:48:19 +08:00
flavors Move V2 sample files to respective directory 2015-03-11 07:22:36 +00:00
limits Move V2 sample files to respective directory 2015-03-11 07:22:36 +00:00
os-extended-floating-ips Nuke XML support from Nova REST API - Phase 1 2015-01-05 12:46:04 -05:00
os-extended-rescue-with-image V2 tests -Reuse server post req/resp sample file 2015-03-11 16:19:40 +09:00
os-server-group-quotas Merge quota_sets functional tests of v2 and v2.1 2015-06-16 09:43:03 +08:00
os-server-list-multi-status V2 tests -Reuse server post req/resp sample file 2015-03-11 16:19:40 +09:00
os-used-limits Nuke XML support from Nova REST API - Phase 1 2015-01-05 12:46:04 -05:00
os-used-limits-for-admin Nuke XML support from Nova REST API - Phase 1 2015-01-05 12:46:04 -05:00
os-virtual-interfaces V2 tests -Reuse server post req/resp sample file 2015-03-11 16:19:40 +09:00
servers Share admin password func test between v2 and v2.1 2015-05-26 10:51:29 +09:00
versions Check flavor type before add tenant access 2015-07-24 15:36:29 +03:00
README.rst Merge "Cleanup XML for api samples tests for Nova REST API" 2015-01-27 02:50:31 +00:00

README.rst

Api Samples

This part of the tree contains templates for API samples. The documentation in doc/api_samples is completely autogenerated from the tests in this directory.

To add a new api sample, add tests for the common passing and failing cases in this directory for your extension, and modify test_samples.py for your tests. There should be both JSON and XML tests included.

Then run the following command:

GENERATE_SAMPLES=True tox -e functional

Which will create the files on doc/api_samples.

If new tests are added or the .tpl files are changed due to bug fixes, the samples must be regenerated so they are in sync with the templates, as there is an additional test which reloads the documentation and ensures that it's in sync.

Debugging sample generation

If a .tpl is changed, its matching .json must be removed else the samples won't be generated. If an entirely new extension is added, a directory for it must be created before its samples will be generated.