85 Commits

Author SHA1 Message Date
Jenkins
7897740f28 Merge "Add default values for domain related options" 2016-04-04 14:55:41 +00:00
Andrey Kurilin
e458fab8ef Add default values for domain related options
Keystone V3 requires that the options os_user_domain_id/os_user_domain_name
and os_project_domain_id/os_project_domain_name be set. These options do not
have default values and novaclient will fail if they are not set by user.

This patch adds default values for os_project_domain_id and
os_user_domain_id in case of Keystone V3 env.
This is consistent with what the OpenStack CLI does.

Also, two functional tests are added to check authentication via
Keystone V2 and V3.

Partial-Bug: #1522402

Change-Id: Ieb41a7fbf24107f7250ef34218604fba96531195
2016-04-04 10:57:41 +00:00
Matt Riedemann
92bbae6d09 Use keystoneclient python bindings for testing
The keystone CLI has been deprecated for a long time
in favor of python-openstackclient and
Icbe15814bc4faf33f513f9654440068795eae807 finally removes
the CLI from python-keystoneclient. This will be in the 3.0
release of python-keystoneclient.

tempest-lib is using the keystone CLI and the novaclient
functional tests are using tempest-lib (which is also
deprecated now).

This change removes the usage of the keystone CLI from
python-keystoneclient via tempest-lib and replaces it
with simply using the keystone v2 python bindings from
the client.

Change-Id: I557acefbf363304ce24ac81566bb651cbfe09176
2016-03-23 20:12:59 -04:00
Kevin_Zheng
7cefdd36a6 Add changes-since support when list servers
Nova API supports change-since filter when list servers:
https://github.com/openstack/nova/blob/master/nova/api/openstack/compute/servers.py#L325-L331
but in python-novaclient we don't.
This patch  add the support for change-since when list servers.

Closes-bug: #1551591

depends-on: Ic2f239f634f917a5771b0401a5073546c710c036

Change-Id: I27f2d1e33a56d357e247111b338c93861716cfee
2016-03-16 17:56:21 +08:00
Cao ShuFeng
680320169b Remove additional 'timeout' element
Remove additional 'timeout' element from trigger crash dump test and
rename _wait_for_nmi to _assert_nmi so that we get at least one
'assert' for each test.

Change-Id: I70372a8c725827ee9b5285ed92ca06b35eb0edbc
Closes-bug: 1554306
2016-03-08 10:25:22 +08:00
Jenkins
17be772404 Merge "Return a less dramatic message for public flavors." 2016-03-08 01:35:48 +00:00
Sven Anderson
c2ec89d285 Return a less dramatic message for public flavors.
Getting the access list of a public flavor bails out with a dramatic
error message, suggesting that something is broken.  This changes the
message to an unagitated "Access list not available for public
flavors."

Change-Id: I432496c24b23de8fa58de93f2cbed8bed1d540b1
2016-03-07 11:35:27 +01:00
Ken'ichi Ohmichi
471e08a4d4 Remove console expectation from NMI tests
The original tests expect the server console contains a message
  "Uhhuh. NMI received for unknown reason"
but the expectation is wrong because this message is fallback one
when disabling crash dump, that means the test expects the crash
dump is disable. That is not the purpose of this NMI feature.

In addition, this message is output on x86 cpu architecture only
because the message is implemented in
  https://github.com/torvalds/linux/blob/master/arch/x86/kernel/nmi.c#L304
So if we use the other cpu architectures on the test, this test will
fail.

Let's remove the expectation from the tests.

Change-Id: I62fe2e00433fd216def25d99a2f20d17b988fb84
Closes-Bug: #1553597
2016-03-06 06:47:54 +09:00
Jenkins
6a8df59254 Merge "Functional tests for trigger-crash-dump (microversion 2.17)" 2016-02-25 17:59:29 +00:00
Andrey Kurilin
cd88097ff5 [microversions] Enable 2.21
2.21 - The os-instance-actions API now returns information from deleted
       instances.

Change-Id: Iff514e4fa9135207c6f8e32e444d45b1b61d8c7c
2016-02-24 20:57:34 +02:00
Anna Babich
f5a25fe997 Functional tests for trigger-crash-dump (microversion 2.17)
It's a resource-consuming task to implement full-flow (up to getting
and reading a dump file) functional test for trigger-crash-dump.
We need to upload Ubuntu image for booting an instance based on it,
and to install kdump with its further configuring on this instance.

Here, the "light" version of functional test is proposed.
It's based on knowledge that trigger-crash-dump uses a NMI injection,
and when the 'trigger-crash-dump' operation is executed,
instance's kernel receives the MNI signal, and an appropriate
message will appear in the instance's log.

Wait_for_server_os_boot() method has been added to ClientTestBase
to check if instance's operating system  is completely booted.

The _create_server() method has been removed since the change
which puts this method to the base test class has been merged.

Change-Id: I2313c5d37a7cf87a8d75e37c93aab136cf028ec1
2016-02-22 18:58:21 +02:00
Andrey Kurilin
083ce7eeea [functional] Move code for boot vm to base testcase
It would be nice to reduce code duplication.

Change-Id: Ie430b64c7e08f6cba8771c85cc1894fa71357ccb
2016-02-19 13:21:50 +02:00
Jenkins
9774405f8e Merge "Allow to specify a network for functional tests" 2016-02-18 15:20:56 +00:00
Andrey Kurilin
1d1e43957d [microversions] Add support for 2.19
2.19 - Allow the user to set and get the server description. The user will
       be able to set the description when creating, rebuilding, or updating
       a server, and get the description as part of the server details.

Methods `rebuild` and `create` of novaclient.v2.servers.ServerManager were
not wrapped with `api_versions.wraps` decorator to reduce code and docsting
duplication. Version checks added inside these methods.

Change-Id: I75b804c6edd0cdf02c2cd002d0b5968fec8da545
2016-02-16 16:20:41 +02:00
Ralf Haferkamp
8a2ed13620 Allow to specify a network for functional tests
Currently the tests just attach instances to the first network returned
by "net-list". That might however not be the right thing in some
environments. This change allows to override the default network via the
environment variable "OS_NOVACLIENT_NETWORK". If not specified the
test will fallback to the old behaviour and just use the first network.

Closes-Bug: #1510975
Change-Id: Ie682111127584a33d8e96377d812d3a6352c760d
2016-02-16 12:43:04 +01:00
Vincent Untz
e378d32353 Fix running functional tests against deployment with insecure SSL
Change-Id: I106d571e7ddeaeaa1de1ffeff3e88e1eb6898032
2016-02-08 17:51:47 +01:00
Jenkins
3c934b0455 Merge "Support to boot a VM with network name" 2016-02-02 12:04:10 +00:00
Jenkins
f2fb37f189 Merge "Functional tests for os-services" 2016-01-27 20:56:25 +00:00
Pavel Kholkin
15d7b403bb Support to boot a VM with network name
Bug_description:
Today, in order to specify networking arguments, the nova client
only accept uuid's. It would be nice if we could extend the
client option to allow names to be accepted too.

Solution:
This patch supports provisioning of VM by mentioning network name.
_boot method currently validates for network ID to boot a VM.

Updates:
* new parameter 'net-name' is added
* when 'net-name' is specified network ID is retrieved
* network ID is used for further processing of vm boot request
* if multiple networks with the same name exist then
NoUniqueMatch exception is raised
* help text is updated

DocImpact
Closes-Bug: #1496180

Co-Authored-By: Pavel Kholkin <pkholkin@mirantis.com>

Change-Id: Ifb14a76749901ee106cdb807e38820a2c25e1320
2016-01-27 23:08:26 +03:00
Andrey Kurilin
a54a1d16db [microversions] Extend shell with 2.12
Shell was not extended in original patch[1], which turned on v2.12, since
there was not any support of vif in shell yet.
Since shell entry point for legacy vif was merged[2], we need to add support
for v2.12 in shell too.

[1] - I18cf23847d3b2b01f5a6ffae2ebc4bede54babce
[2] - Ib3078125beb7beaa08a3408486db54e0d10763e6

Change-Id: Ie38d099b2babfd8424c7d15bd3dfe8bd75e51136
2016-01-22 20:26:54 +02:00
Jenkins
c1aaf4431b Merge "Functional tests for flavors with public and non-public access" 2016-01-21 13:06:04 +00:00
Anna Babich
20c65aac87 Functional tests for os-services
The added tests check functionality of os-services actions
except 'service-delete' (it's hard to recover after test running)

Also 'forced_down' attribute exposed by microversion 2.11
is checked here

Change-Id: I6652bac4ce49d5174592f19b1b4d91ac5bd51500
2016-01-19 16:33:41 +02:00
Anna Babich
f6e0dcd34c Functional tests for flavors with public and non-public access
The added tests check granting access actions for public and
non-public flavors

The test for microversion 2.7 checks that the appropriate
error is returned when attempting to grant an access
to a public flavor for the given tenant

The base TenantTest class has been added to avoid code
duplication in test_keypairs and test_flavor_access tests

Also, test_keypairs code has been modified in accordance with
TenantTestBase class usage

Change-Id: Icf21d8aceaa191aee8b8ffc7c52e97ebe9509b3d
2016-01-19 16:14:55 +02:00
Jenkins
6c37270c4e Merge "Add functional tests launcher for py3 env" 2016-01-16 03:56:26 +00:00
Andrey Kurilin
426f6afb3c Add functional tests launcher for py3 env
It would be nice to check not only unit test on py3 env, but functional
tests too.

Also, this patch fixes usage of xrange in functional tests.

Change-Id: I15ef204022583a40a02b3f2a48771347ddc95f3e
2016-01-15 13:25:33 +00:00
Jenkins
c819132c4c Merge "[microversions] Add support for API microversion 2.13" 2016-01-13 19:32:51 +00:00
yangyapeng
06be50b97a Use assertTrue/False instead of assertEqual(T/F)
The usage of assertEqual(True/False, ***) should be changed
to a meaningful format of assertTrue/False(***).

Change-Id: I66110e5fc1afdf9dd6824b1f7bcb7b2c091a272d
Closes-Bug: #1512207
2016-01-04 09:52:04 -05:00
Kevin_Zheng
b6677ebc03 [microversions] Add support for API microversion 2.13
Nova now supports API microversion 2.13 to
allow return project_id and user_id for
os-server-groups API. Sync this to the
client side.

Change-Id: Ia09ab4bd5c693ed95b0f5dd9bc709b7597f7034e
Closes-Bug: #1526143
2015-12-23 06:39:13 +00:00
Jenkins
36e125a61e Merge "Allow command line for virtual-interface-list" 2015-12-17 19:33:21 +00:00
Jenkins
0c9abf02c9 Merge "[functional-test] add v2.8 functional test" 2015-12-17 18:02:54 +00:00
jichenjc
6b0fe2a424 Allow command line for virtual-interface-list
There is virtual-interface-list API support in nova but no
command line interface in novaclient, this patch adds it.

Closes-Bug: 1522424

Change-Id: Ib3078125beb7beaa08a3408486db54e0d10763e6
2015-12-17 12:41:43 +00:00
Jenkins
2e5b08cd63 Merge "[functional-tests] fix version of novaclient instance" 2015-12-16 15:02:39 +00:00
Jenkins
55351d0135 Merge "[microversions] Add support for 2.10" 2015-12-14 20:43:16 +00:00
jichenjc
9857dd2523 [functional-test] add v2.8 functional test
add functional test for v2.8 API (webmks console type
enablement).
Also, fixed an issue related to v2.8 microversion
enablement for the console API.

Change-Id: I7660a189cc3051dd7dbc802ad2d40a4995b44960
2015-12-11 21:46:02 +08:00
Andrey Kurilin
363bc3eafc [functional-tests] fix version of novaclient instance
setUp method of base class for functional tests creates an instance of
novaclient.client.Client with const version. This logic is wrong since we
have tests for microversions.

Change-Id: Ibd3ee5c730ae1fb3c19f512728f2a0a3693763e8
2015-12-10 23:35:04 +02:00
Andrey Kurilin
65658ed6fc [microversions] Add support for 2.10
2.10 - Added user_id parameter to os-keypairs plugin, as well as a new
property in the request body, for the create operation. Administrators will
be able to list, get details and delete keypairs owned by users other than
themselves and to create new keypairs on behalf of their users.

Change-Id: I13ca3f8a4dd9cf11bec79966bb8a2ab48847be22
2015-12-07 22:14:21 +02:00
Ghanshyam
573bdaa290 Fix H404/405 violations in novaclient/tests/*
There is a lot of H404/405 violations in novaclient, and it is better
to fix those to have a better doc string for class/methods.

This patch fixes these violations for files under  novaclient/tests/
folder.

As there are lot of violations and cannot be fixed in single patches,
So separating those in multiple patches for easy review.

Partial-Bug: #1521899
Change-Id: I6e712ece14c745013bfba0bee9d77e7875dd2263
2015-12-07 14:17:56 +09:00
Andrey Kurilin
0a535e3287 [microversions] Increase max version to 2.9
2.9 - Add a new locked attribute to the detailed view of servers. locked
will be true if anyone is currently holding a lock on the server, false
otherwise.

This microversion doesn't require any change in novaclient's code.
Just added functional tests and changed version

Change-Id: I7f33757e6f03f172e5a13ade0aa5e8d3a10dbf01
2015-12-03 10:10:21 +00:00
Vincent Untz
7d800a9e65 Fix typo in error message
Change-Id: I9ff3babd0460c41e05f18b34c3b46032edbf1459
2015-11-17 07:19:25 +01:00
Jenkins
fd13e89c46 Merge "Functional tests for os-extended-server-attributes" 2015-11-12 17:00:09 +00:00
Anna Babich
e9268e9864 Functional tests for os-extended-server-attributes
The added tests check basic set of extended server attributes
and additional attributes exposed by microversion 2.3

To avoid leak resources, cleanup part has been refactored

Change-Id: I0c8f096134838b90e17720f2a28e649998a02e3b
2015-11-09 16:47:45 +02:00
Mark Doffman
cce7cd3277 Support the server side remote-console API changes
In microversion 2.6 the remote-console API was changed.
See http://docs.openstack.org/developer/nova/api_microversion_history.html
for details of those changes.

This adds support for the new remote-console API.

Change-Id: I67098d6ce8c71f3ac0073628fd3b0aa23cd81918
Closes-Bug: #1500688
2015-10-22 10:14:13 -05:00
Jenkins
095d72f652 Merge "Rely on devstack for clouds.yaml" 2015-10-20 23:52:59 +00:00
Jenkins
73de0478e4 Merge "Increase timeout when testing admin timeout" 2015-10-20 21:55:44 +00:00
Monty Taylor
727f1044bf Rely on devstack for clouds.yaml
Rather than copying it ourselves, just consume the one that
devstack is putting there for us.

Change-Id: Ifb9f8a55e0eb342db55a3518c375ea79679ff076
2015-10-21 05:20:34 +09:00
melanie witt
a820c45543 Use v2.0 in clouds.yaml auth_url for functional test job
Commit 050a0d5b304a013e23cd5909abf6e11b7dda5f18 changed the defaults
in devstack to use the keystone v3 api. This broke the novaclient
functional test job because novaclient doesn't yet support v3
and relies on having "v2.0" in the auth_url.

This appends or replaces the version in the clouds.yaml auth_url
to v2.0 to enable the functional test job to work until v3 support
is added to novaclient.

Closes-Bug: #1506103

Change-Id: I75c5efd039b71c8855acf21c5516ccbeeaaeadb3
2015-10-16 22:47:37 +00:00
Thomas Bechtold
afaa8a2d1e Increase timeout when testing admin timeout
When running functional tests in a slow virtual environment,
the given timeout of 10 seconds to list thr available instances
is not enough. Increase the timeout to not run into
a "timed out (HTTP 408)".

Change-Id: Ie2345e6858bcc97095863d5d388bacf9c29b7682
2015-10-13 19:12:58 +02:00
melanie witt
abd0630bad Always send volume_id when booting with legacy bdm
Commit 5153dcda807c554769081626c10c43d16adea671 removed bdm v2-only
request parameters to pass nova api v2.1 schema validation, but also
removed the ability to boot with legacy bdm specifying volume_id only.

This adds volume_id back to the request for legacy bdm when
no other parameters are specified.

Closes-Bug: #1501435

Change-Id: Ie8c56c28492793990ef7ed6dc54768cef9e28a98
2015-10-01 10:55:47 +00:00
Andrey Kurilin
0455932c3a Split functional tests for legacy(V2.1) and microversions
It would be nice to ensure that fundamental use-cases of novaclient work
for both legacy(V2.1) and for microversions(latest or specified microversion).

Change-Id: Icae73dd221c9787fd08facc8642c5b564e82393a
2015-09-21 12:07:18 +03:00
Andrey Kurilin
2793331d01 Specify api_version for functional tests
Most of functional tests are written for V2.0/V2.1 API version, but
launched on "latest" compute api version('--os-compute-api-version'
flag is not ovveriden + default value of it is "latest").

This patch adds "COMPUTE_API_VERSION" parameter for base TestCase,
which sets --os-compute-api-version flag while running "nova" shell.

Change-Id: I5d711438addaba5282a15fd2b9dde1800f7d7b91
2015-09-21 12:05:46 +03:00