Commit Graph

255 Commits

Author SHA1 Message Date
Jenkins 9d20132a1d Merge "Merge quota_classes functional tests of v2 and v2.1" 2015-03-27 18:51:16 +00:00
Jenkins 15fae605ca Merge "Merge cell functional tests for V2 and V2.1" 2015-03-26 19:48:35 +00:00
Jenkins a46c460075 Merge "Merge V2 and V2.1 aggregate functional tests" 2015-03-26 19:48:09 +00:00
parklong 860c481503 Merge quota_classes functional tests of v2 and v2.1
Currently v2 and v2.1 have separate functional tests and their
corresponding sample files. As v2 and v2.1 are supposed to be identical,
there is overhead to maintain two set of functional tests and sample files.
We can have one set of tests which can run for both v2 and v2.1.

This commit merges quota_classes functional tests.

In V2 quota_classes has following extensions
- os-server-group-quotas
- os-quota-class-sets

In V2.1, os-server-group-quotas extensions have been moved to extensions
limits, and there is no functional test for it.

so we merge os-quota-class-sets between V2 and V2.1, and delete
os-server-group-quotas

Partially implements merge_sample_tests

Change-Id: I46838ddffdb0c950781502716acaa01925ff9f67
2015-03-25 17:26:30 +08:00
ghanshyam d98aa4fadc Merge V2 and V2.1 floating ips functional tests
Currently v2 and v2.1 have separate functional tests and their
corresponding sample files. As v2 and v2.1 are supposed to be identical,
there is overhead to maintain two set of functional tests and sample files.
We can have one set of tests which can run for both v2 and v2.1.

This commit merges all floating ip functional tests.
Below APIs tests are megred-
-floating_ip_dns
-floating-ips-bulk
-floating-ips
-floating-ip-pools

Change-Id: Ibde0b152949559dec90ea0e7ee6668ab05b4927f
2015-03-25 15:42:35 +09:00
ghanshyam 6a16798b59 Merge cell functional tests for V2 and V2.1
Currently v2 and v2.1 have separate functional tests and their
corresponding sample files. As v2 and v2.1 are supposed to be identical,
there is overhead to maintain two set of functional tests and sample files.

We can have one set of tests which can run for both v2 and v2.1.

This commit merges cell functional tests.

In V2 cell has following extensions
- os-cells
- os-cell-capacities

In V2.1 above extensions have been merged together in os-cell plugins

Change-Id: I42adfa5de21e3af03761fc12d04498de5112f385
2015-03-24 16:18:24 +09:00
ghanshyam 0f3abb7fdf Merge V2 and V2.1 aggregate functional tests
Currently v2 and v2.1 have separate functional tests and their
corresponding sample files. As v2 and v2.1 are supposed to be identical,
there is overhead to maintain two set of functional tests and sample files.

We can have one set of tests which can run for both v2 and v2.1.

This commit merges aggregate functional tests.

Change-Id: I6d6ffd797d6015cebac3b21fc073b2297e5f67f2
2015-03-24 15:20:15 +09:00
ghanshyam e24c2239fb Merge V2 and V2.1 functional tests
Currently v2 and v2.1 have separate functional tests and their
corresponding sample files. As v2 and v2.1 are supposed to be identical,
there is overhead to maintain two set of functional tests and sample files.

We can have one set of tests which can run for both v2 and v2.1.

This commit use the testscenearios to generate the tests one for v2 and one for v2.1
and make v2.1 tests to run against v2.1 plugins by redirecting /v2 endpoint to v2.1
plugins in api-paste.ini

As example this commit merge flavor APIs functional tests between v2 & v2.1.
In V2 flavor API has following extensions
- Flavor_swap
- Flavor_disabled
- Flavorextradata
In V2.1 above extensions have been merged together in flavor plugins

NOTE- As testscenarios is applied in base class. v2 tests will be generated
for all the existing tests but for tests which are not merged yet
their v2 generated tests will be skipped till they gets
merged. After merge, both version tests are expected to pass like
flavor tests in this patch. So you may see lot of skipped tests
which is expected and will gets disappear as tests gets merged.

Change-Id: I0e0262f818c7d7fb15528b16d3225b9578910996
2015-03-23 17:27:55 +09:00
Jenkins 59356a4d80 Merge "Fix V2 hide server address functional tests" 2015-03-20 02:19:40 +00:00
ghanshyam f2cc1bd7bc Move V2 sample files to respective directory
Some sample files like server, images etc are kept under api_samples/
directory.
As plan is to create clean directory structure for sample files for
V2, V2.1 and microversion, moving these sample files to respective directory
will help to achieve that.

Change-Id: I284d035f6fadb26a94bcb3586f4a8c72942ee423
2015-03-11 07:22:36 +00:00
ghanshyam 83be099a7a V2 tests -Reuse server post req/resp sample file
There are lot of duplicate sample files for server POST req/resp
in functional tests.

This patch reuse the server post req/resp sample file for V2
functional tests.

Change-Id: I4fc5771af9407b9e75cf07682ee1706935a87709
2015-03-11 16:19:40 +09:00
yunhong jiang ab437c0e90 API: Change the API cpu_info to be meaning ful.
Currently the API sample get '?' for the cpu_info, this is really
confusing, it even does not tell the type of the return.

Change it to be more meaningful.

Change-Id: I791beb7502f47dff646a46c08e818c29f9e6cd79
2015-02-24 13:57:49 -08:00
Jenkins 10a7974b3a Merge "Change v2.1 API status to CURRENT" 2015-02-24 08:37:02 +00:00
ghanshyam 30941b211a Fix V2 hide server address functional tests
In V2 hide server address extension functional tests, created instance
state does not belong to configured hide server address state. Due to
that address never got hidden from server.

Sample files used in those tests are wrong which makes those tests
pass.

This patch fix the tests by overriding the conf value and fix the
sample files accordingly.

Change-Id: I60e502941bb4b2634a542ead02465a186a22d9ae
2015-02-20 06:26:44 +00:00
Jenkins 009874f4c8 Merge "Add missing api samples for floating-ips api(v2)" 2015-02-16 14:56:12 +00:00
Eli Qiao c4a632a8f4 Add missing api samples for floating-ips api(v2)
floating-ips api missing floating-ips-get-resp sample file,
and the integrated test cases use a wrong sample file(algouth
the contents are same).
This patch addes missing api samples file and correct the
integrated test case.

Change-Id: Icadcabad369cb6a9c3270915aa3bc9545d5348e8
2015-02-15 18:23:58 +08:00
Chris Yeoh 9b794005fe Implement api samples test for os-baremetal-nodes Part 2
Implements an API sample test for a GET request for os-baremetal-nodes
which was previously manually generated and wrong. Removes api samples
for add-interface, create, and remove-interface which were removed
for os-baremetal-nodes at some point.

This should bring the os-baremetal-nodes plugin in sync with reality
for both v2 and v2.1

Partially implements blueprint v2-on-v3-api

Change-Id: Ibd55b43368485b7f460ef6564f611df136275562
2015-02-11 14:48:53 +10:30
Chris Yeoh e11a6de1d9 Implement api samples test for os-baremetal-nodes
Looks like the api samples for os-baremetal-noes were added manually
and so either weren't correct in the first place or the api output
has changed since the first merge. This patch implements tests
for index method. More to follow in later patches

Partially implements bp v2-on-v3-api

Change-Id: I3bd421b9a8b9eb49d274c190d124aaac6fbd361f
2015-02-10 22:06:18 +10:30
Ken'ichi Ohmichi c2d863578a Change v2.1 API status to CURRENT
Most v2.1 API patches are merged and the v2.1 API gate jobs are stable
now. This patch changes v2.1 API status to CURRENT from EXPERIMENTAL,
and does v2 one to SUPPORTED for making developers concentrate on v2.1
API instead of v2 API.
We will replace /v2 endpoint with v2.1 code because users will be able
to continue using /v2 endpoint without any changes, and /v2 endpoint
status becomes

  CURRENT -> SUPPORTED -> CURRENT

Partially implements blueprint v2-on-v3-api

Change-Id: I2c5e6612db4a792f1950f53c0bc69617e47b0fff
Depends-On: I8e63a684093dfe3a643c07b20e8080c1e950ed5a
2015-02-09 05:27:56 +00:00
Ken'ichi Ohmichi 46bd4e4292 Apply v2.1 API to href of version API
Now Nova contains v2 and v2.1 APIs, but version API returns the same
href between v2 and v2.1 like:
  {"href": "http://192.168.11.62:8774/v2/", "rel": "self"}
in a response.
In addition, current generate_href() handles v3 API case also. However
v3 API has disappeared, so the code is meaningless now.
This patch fixes the problem for returning a right href.

Change-Id: Ie3ac1223a9c88a33bcc037c7a50ac308bcebea2d
Closes-Bug: #1373741
2015-01-29 12:12:14 +00:00
Davanum Srinivas aff3e8699a Cleanup bad JSON files
- Add missing commas
- Replace single quote with double quote
- events field contains a list of events (event-create-req.json)
- Remove empty files
- Adds a JSON validation test to the docs pipeline

Co-Authored-By: Nicolas Simonds <nic@metacloud.com>
Change-Id: I9a4a9b6b8e2da73b5f25145be3b2faa44ebdb340
2015-01-22 11:46:05 -08:00
Davanum Srinivas 417704816e Nuke XML support from Nova REST API - Phase 1
In I5a580fc323c3809790b4a68a9f8f8129ecdc2cf0 we switched off XML support. In
this review we entirely remove all the testcases and supporting files.

Change-Id: I83827d438753fd3899053dd6e09bc77c997c7406
2015-01-05 12:46:04 -05:00
Jenkins 7aa8fdde66 Merge "Remove blanks before ':'" 2014-12-02 13:43:46 +00:00
Jenkins 1277c12209 Merge "Fix API samples/templates of multinic-add-fixed-ip" 2014-12-02 13:05:15 +00:00
jichenjc 55aa1ff1b6 Remove blanks before ':'
A space before ":" is unnecessary because of JSON.
So this patch removes the blanks before ':' for
v2 os-virtual-interfaces integrated test.

Change-Id: I20965a183a6a00e263cd0fdd91a3337162ecbe9b
2014-12-01 11:06:48 +08:00
Steven Kaufer f268be97bd GET servers API sorting REST API updates
Updates the v2 and v3 /servers and /servers/detail APIs to support the
multiple sort keys and sort directions (using the 'sort_key' and
'sort_dir' parameters); these parameters can be specified multiple
times to create a list of sort keys and directions. These parameters
are passed from the API layer to the compute layer, then to the
instance layer (with updated version), then to the database layers,
and then to the common paginate_query function; the paginate_query
function already supports multiple sort keys and directions. The
function signatures in these various layers are updated with new
'sort_keys' and 'sort_dirs' parameters that represent the sort keys
and directions information as lists.

This support is enabled on the v2 API by the existence of a new
'os-server-sort-keys' API extension and is always enabled in the v3
API. The extension API sample issues 2 server creates and then ensures
that both servers are listed (name is unique) in the list reply.

DocImpact: The existing v2 and v3 servers API documentation needs to
reflect these new parameters.

The nova client will also be updated to use these parameters.

Change-Id: I02baf6c3cc7d29abab132ef1726140c57e17d9b6
Partially implements: blueprint nova-pagination
2014-12-01 02:47:02 +00:00
Ken'ichi Ohmichi 701168de08 Fix API samples/templates of multinic-add-fixed-ip
API samples and templates of multinic-add-fixed-ip are malformed and
one parameter name is wrong now.
This patch fixes them.

Change-Id: I997584fdcf0b57220280b554ab9da9782d3d0250
2014-11-27 04:28:21 +00:00
Vishvananda Ishaya cc02d56ca8 Fix bulk floating ip ext to show uuid and fixed_ip
The bulk floating ip extension was not showing the instance_uuid
or the fixed_ip properly due to a missing join and an ommision
when the extension was first created. This updates the extension
to display all of the relevant data.

Change-Id: I81c2c742a7eed134b5452c19da0cc55811c009ab
Closes-Bug: #1360426
2014-11-17 16:42:16 -08:00
jichenjc e516de74c1 Remove project id in ViewBuilder alternate link
Clearly nobody really uses the "application/vnd.openstack.image"
links in the returned results from GET /v2/{tenant}/images
REST API call, since the link URI returned in it is wrong.

Glance URIs do *not* contain a project or tenant in the URI
structure like Nova's REST API URIs do, but _get_alternate_link()
method of the image ViewBuilder tacks it on improperly:

Change-Id: I4ccb5628569c60026a1772df0794ac0271c48db3
Closes-Bug: #1343080
2014-10-22 14:23:18 +08:00
Sahid Orentino Ferdjaoui 48e94bf75c cmd: update the default behavior of serial console
When using serial console we are expecting using a plain websocket
so we should to return the 'ws://' scheme as the default one, also
it makes no sense to handle webserving content since currently
nothing has been implemented in favor of this case.

DocImpact: The 'base_url' option serial_console has been updated
Closes-Bug: #1373950
Change-Id: I0d0e4f7060febec5e0a357cd3e8c05486f2afaa5
2014-09-29 10:24:57 -04:00
Jenkins 110addf6ba Merge "Fix integrated test cases for assisted-volume-snapshots" 2014-09-21 01:47:19 +00:00
Phil Day 9a4d7ab534 Add quotas for Server Groups (V2 API change)
This second change in a sequence that adds new quota values
for server groups.  This part adds the new V2 API extensions
to make the new quota values visible and changeable, and updates
the unit tests to check both V2 cases.

Note that Tempest changes https://review.openstack.org/#/c/112474/
is required to get a clean run as it checks for a specific
set of values.

The quota checks themselves are covered in a subsequent
dependent change.

Implements: blueprint server-group-quotas
DocImpact

Change-Id: I78974602d4be04deaf173b3e43f2dab92e8f4171
2014-09-13 08:43:26 +00:00
Eli Qiao 478bce9798 Fix integrated test cases for assisted-volume-snapshots
qcow is not a valid type of snapshot in real environment,
the require type should be qcow2 instead of qcow.
Change-Id: I0fc8e90913699074cd997f5c1e0693372436d14f
2014-09-10 00:55:05 +00:00
Vladan Popovic e89eaf9a7d api: add serial console API calls v2
Adds a new REST APIv2 to call service serial console

Co-Authored-By: Ian Wells <iawells@cisco.com>
Co-Authored-By: Sushma Korati <sushma_korati@persistent.co.in>
Co-Authored-By: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@redhat.com>

Patial-Implements: blueprint serial-ports
Change-Id: I35d94c1924caa9cbc0fcdd9c637d28e95ff31ab2
2014-09-05 09:08:37 +00:00
Ken'ichi Ohmichi fe5f22de04 Change v3 version API to v2.1
This patch changes v3 version API to v2.1 and makes v2 unit tests
share between v2 and v2.1.
v2.1 API does not support XML format. Unit tests related to XML
don't work against v2.1.

Partially implements blueprint v2-on-v3-api

Change-Id: I7abadb0c9082b9e90a98938967f0e27d1a2fa766
2014-08-30 07:08:59 +00:00
Jenkins 30dedd1418 Merge "Add api extension for new network fields." 2014-08-23 01:50:01 +00:00
Vishvananda Ishaya 71fabdc8dc Add api extension for new network fields.
This uses the existing api extension to implement the actual control
of the fields, but the check is based on a new dummy extension
called os-extended-networks.

Api sample tests added for new extension.

DocImpact: Adds an extension that enables extra fields for network
create. The new fields are:
  mtu: int (default flag) if set, nova sets the mtu on bridge. This
       allows network_device_mtu flag to be set per network.
  dhcp_server: ip (default == gateway) if different from gateway, sets
                nova to assume gateway is external.
  enable_dhcp: bool (default true) false will disable dhcp on network.
  share_address: bool (default flag) if specifed, network will have
                 the same dhcp ip on every host. This allows
                 share_dhcp_address flag to be set per network.
  allowed_start: ip if specified, reserves all ips before allowed_start.
  allowed_end: ip if specified, reserves all ips after allowed_end.

Partially-implements blueprint better-support-for-multiple-networks

Change-Id: I577fe5f6560be50106f345a42a826e97d5e7d64c
2014-08-19 11:21:23 -07:00
Ian Cordasco 86356bf6f1 Use rfc3986 library to validate URL paths and URIs
More work needs to be done in rfc3986 to give the user more control over what
they consider to be a valid URI in the context of RFC 3986. For example, a
previous incarnation of these tests checked that "1" and "abc" were invalid
when according to the RFC they are.

Update the API samples and tests to use valid URIs

DocImpact

Change-Id: I288fbaead64990db1053b7a11e82904611b8498f
2014-08-19 11:58:39 -05:00
Jenkins 6d98ebaaf7 Merge "servers list API support specify multi-status" 2014-08-07 06:48:05 +00:00
Yunhong Jiang 7d8a78a291 Return status for compute node
Currently when return compute node information, there is no status returned.

When the corresponding service is disabled or down and users try to
do 'hypervisor-list' or 'hypervisor-show', they will have no idea of it.

Implements: blueprint return-status-for-hypervisor-node
Closes-Bug: #1285259

DocImpact

Change-Id: I17c53b454ccef023f298f1b8875daef965d2325d
2014-07-22 10:44:05 -07:00
boh.ricky ab32995fed servers list API support specify multi-status
Currently the service list API allows the user to specify an optional status
value to use as a filter - for example to limit the list to only servers with
a status of Active.

However often the user wants to filter the list by a set of status values,
for example list servers with a status of Active or Error,
which requires two separate API calls.

Allowing the API to accept a list of status values would reduce this to a
single API call.
Allow to specify status value for many times in a request.
For example::
    GET /v2/{tenant_id}/servers?status=ACTIVE&status=ERROR
    GET /v3/servers?status=ACTIVE&status=ERROR
V2 API extension::
    {
        "alias": "os-server-list-multi-status",
        "description": "Allow to filter the
            servers by a set of status values.",
        "links": [],
        "name": "ServerListMultiStatus",
        "namespace": "http://docs.openstack.org/compute/ext/
            os-server-list-multi-status/api/v2",
        "updated": "2014-05-11T00:00:00Z"
    }

DocImpact: Adds os-server-list-multi-status extension.

blueprint servers-list-support-multi-status

Change-Id: Id0109c56070e2f920be0f95738749aa969258bc1
2014-07-23 00:24:15 +08:00
Jenkins f48f8edb9b Merge "Make hypervisor_version an int in fakeVirt driver" 2014-07-22 05:27:51 +00:00
Leandro I. Costantino d5a70de479 Add APIv2 support to make host optional on evacuate
In the event of an unrecoverable hardware failure, support needs to
relocate an instance to another compute so it can be rebuilt.

The changes involved in this patch are:
  [*] Add a new v2 extension to determine that the host argument
      on evacuate is now optional.(Extended_evacuate_find_host)
  [*] Doc regeneration.

DocImpact: The evacuate target host is now optional.
If 'host' field is not sent in the request, the scheduler will
determine the target host.
This will include nova client changes ( on the proper commit ) to support
this new optional parameter.

Implements: blueprint find-host-and-evacuate-instance

Change-Id: Ib34fb3120263b746ad2f8fe89c14137e36a07a53
Co-Authored-By: Juan M. Olle <juan.m.olle@intel.com>
Co-Authored-By: Andres Buraschi <andres.buraschi@intel.com>
Co-Authored-By: Anuj Mathur <anujm@thoughtworks.com>
Co-Authored-By: Navneet Kumar <navneetk@thoughtworks.com>
Co-Authored-By: Claxton Correya <claxton@gmail.com>
2014-07-21 10:58:54 -03:00
He Jie Xu a8b805d3a3 Fix agent_id with string type in API samples files for os-agents v2
The agent_id should be integer for agent create and index. But in
the api sample file it is string type. It's because the api sample
tests provide agent_id with string type in fake data. This patch
correct the api sample files and tests.

For agent update, it use agent_id that passed from url, make the
response use string for agent_id. We can't fix this problem for
back-compatibility. This will be fix in the future after v3 API
expose by micro-version

Change-Id: I262b4b26c94dba003e80bda2f38d2e985ef9f220
Partial-Bug: #1333494
2014-06-26 08:46:41 -07:00
Yunhong Jiang df60f2cd33 Fix doc for service list
If a service is enabled, the "disabled_reason" field in response
for /v2/.{tenant_id}./os-services/detail is null, however, currently
it's specified as "" in the doc, thus may be confusing to users.

This patch change the template and doc, it should not cause issue to
existing applications.

Change-Id: Ia71ec4c97a355bcc1a7b63e6107db77f80a5d843
Close-bug: 1328382
2014-06-16 16:57:23 +00:00
Matt Riedemann 35338d54ad Revert "Remove broken quota-classes API"
This reverts commit 7d22153d05.

The quota_classes API was used to set default quota values
so it shouldn't have been removed, so reverting a series
of changes that removed the API and it's internal code.

Related mailing list thread on the topic:

http://lists.openstack.org/pipermail/openstack-dev/2014-May/035383.html

Partial-Bug: #1299517

Conflicts:
	doc/api_samples/all_extensions/extensions-get-resp.json
	doc/api_samples/all_extensions/extensions-get-resp.xml
	nova/tests/integrated/api_samples/all_extensions/extensions-get-resp.xml.tpl

The conflicts are due to Mark McLoughlin's timestamp-format series
of changes on master (Juno).

Also note that quota_classes.py was changed due to
commit c75a15a4 to rename the NotAuthorized exception
to Forbidden.

Change-Id: I7890e6b41d4ebf19944c1d4db65111fcc4c45463
2014-06-10 06:26:50 -07:00
Juerg Haefliger 8f299f5545 Remove spaces from SSH public key comment
An SSH key generated by Nova contains the comment 'Generated by Nova'. Older
versions (prior to 0.7.2) of cloud-init trip over the spaces in the comment
and as a result of that the key injected into the root account is not disabled
by cloud-init. Yes, it's a cloud-init bug but it's also a regression in the
sense that older OpenStack installations (Essex and older) don't contain
spaces in Nova generated key comments and thus older cloud-init's are not
affected in these environments.

This patch replaces the spaces with dashes, i.e., 'Generated-by-Nova'.

Spaces were introduced by commit: 114109dbf4
Ubuntu cloud images with cloud-init < 0.7.2: 10.04 LTS and 12.04 LTS
cloud-init bug report: https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/1220273

Closes-Bug: #1297685
Change-Id: I1761f61dfbba58be98351ae4a51884b03268cf09
2014-05-20 12:08:07 +02:00
Mark McLoughlin 68fe44121e Add specific regexp for timestamps in v2 xml
datetime objects are serialized into xml using simply str() and this
is a slightly different format from ISO8601 in that the date isn't
separated from the time using 'T'.

(However, note that the iso8601 library happily accepts this format)

Add a specific regexp for this format so we can test for it in the
places we know it is used. This also means we can remove the generic
%(timestamp)s regexp.

Note that unlike the isotime and strtime formats, whether this format
includes timezone or microsecond information depends on whether the
datetime object had those fields set. The isotime format always
includes a timezone but not microseconds, whereas the strtime format
never includes a timezone but always includes microseconds.

There are a small number of examples where this format is used in JSON
too - e.g. the instance usage audit log extension pre-serializes its
timestamps by doing:

        return dict(period_beginning=str(begin),
                    period_ending=str(end),

Using a name like 'xmltime' for the timestamp format used in cases
like this actually makes sense - it highlights that the format used
in this case is a weird mistake.

Full context here:

  http://lists.openstack.org/pipermail/openstack-dev/2014-April/033971.html

Change-Id: I70f839ac17273ed10078b833aeba308bd5e994e1
2014-05-11 16:28:50 -04:00
Jenkins 5949ab8d9a Merge "Use strtime() specific timestamp regexp" 2014-05-10 01:41:55 +00:00
Ghanshyam c3cb44d688 Add Nova API Sample file & test for get keypair
This patch adds the new API Sample file and its test for Nova V2 and V3
get keypair APIs.

This patch extend the timstamps reg exp to allow the combination
of TZ and microsecond/

Closes-Bug: 1298769
Closes-Bug: 1298818

Change-Id: If695a23cf95862b7bec6fbc5bdf7fc1733d08d4a
2014-05-07 21:06:37 +09:00