792 Commits

Author SHA1 Message Date
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
Jenkins
bfac3c6d55 Merge "Remove unused code in tests/unit/v2/fakes.py" 2016-03-07 21:31:09 +00:00
Jenkins
58356df3d9 Merge "Remove console expectation from NMI tests" 2016-03-07 17:48:26 +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
Takashi NATSUME
a571ebd72a Remove unused code in tests/unit/v2/fakes.py
TrivialFix
Change-Id: I9c089f50f0b48bb7f41af9c4d6fbb8355d668a74
2016-03-07 06:52:33 +00: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
Kevin_Zheng
93913c84b6 Use novaclient/utils directly and remove openstack/common (1/4)
We can use novaclient/utils directly and get rid
of openstack/common folder.

This is the first part.

Change-Id: Iaec234fbcf4d0f8c7e8f2175eae11d3083a62090
Partial-Bug: #1551603
2016-03-03 01:23:34 +00:00
Jenkins
f9360ae6d4 Merge "Provide user with coherent interface to get request_ids" 2016-03-02 13:05:05 +00:00
Jenkins
d56c95de40 Merge "[microversion] Bump to 2.25" 2016-03-02 12:15:34 +00:00
Eli Qiao
ae598280ac [microversion] Bump to 2.25
microversion v2.25 will change parameter of os-migrateLive, this patch
adds supports to that changes.

os-migrateLive will abandon disk_over_commit and the default value of
block_migration will be set to `auto`

Depends-on: Ibb0d50f0f7444028ef9d0c294aea41edf0024b31
Implements: blueprint making-live-migration-api-friendly
Change-Id: I01b22593724616bc0a7793c509ecabf095d6927d
2016-03-02 17:24:17 +08:00
Jenkins
32a28f8040 Merge "Support for abort an ongoing live migration" 2016-03-01 22:00:25 +00:00
Jenkins
3a3a5c8ac6 Merge "Add two server-migration commands and bump migration-list command" 2016-03-01 15:11:12 +00:00
Andrea Rosa
77e50cc91b Support for abort an ongoing live migration
In Nova API microversion 2.24 there is a new operation which allows to
abort a running live migration.

This change is to enable this feature at the client side implementing a
new method to call the new nova API:
nova live-migration-abort <server_id> <migration_id>

Implements blueprint: abort-live-migration

Depends-On: I1ff861e54997a069894b542bd764ac3ef1b3dbb2

Change-Id: Ic2ead126e0cf48aa54a083e97cb9d1303a5a9bbd
2016-03-01 13:43:33 +00:00
ShaoHe Feng
e0c7d2c673 Add two server-migration commands and bump migration-list command
1. Add two new commands
Add nova client server-migration-list and server-migration-show

2. Bump and old command
Add migration_type field for migration-list command

Partially implements blueprint live-migration-progress-report

Depends-On: Ia92ecbe3c99082e3a34adf4fd29041b1a95ef21e

Change-Id: I071198fa9ba0699383bdebf4fab54714a435e6c3
2016-03-01 12:27:54 +00:00
Jenkins
eb461f082b Merge "Add a way to discover only contrib extensions" 2016-03-01 00:48:38 +00:00
Jenkins
6a8df59254 Merge "Functional tests for trigger-crash-dump (microversion 2.17)" 2016-02-25 17:59:29 +00:00
Jenkins
a36df7e63f Merge "Support for forcing live migration to complete" 2016-02-25 17:40:00 +00:00
Jenkins
91a7084067 Merge "[microversions] Enable 2.21" 2016-02-25 17:37:44 +00:00
Pawel Koniszewski
62c76301a2 Support for forcing live migration to complete
In API microversion 2.22 in Nova there is new ServerMigrations resource
that allows opertators to force on-going live migration to complete:
https://review.openstack.org/#/c/245921/

This patch implements new method in python-novaclient to take advantage
of the new API:
nova live-migration-force-complete <instance_id/name> <migration_id>

Change-Id: I823c20b4e0c7b63e905f564a7dff13d3fb314a26
Implements blueprint pause-vm-during-live-migration
2016-02-25 13:59:11 +00:00
Jenkins
bbba47448c Merge "Use assertIsNone instead of assertEqual(None, ***)" 2016-02-24 23:02:40 +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
Andrey Kurilin
ca5b06f6ae [microversions] fix help msg for versioned args
If command has arguments with one name, but for different versions(see an
example below), both arguments will be displayed. This patch fixes this
issue.

Example of arguments:

    @cliutils.args("name",
                   help="Name of a good action.",
                   start_version="2.1",
                   end_version="2.20")
    @cliutils.args("name",
                   help="Name of a very good action.",
                   start_version="2.21")
    def do_something_good(cs, args):
        pass

Example of helpoutput before patch:

    Positional arguments:
      <name>    Name of a good action. (Supported by API versions '2.0' - '2.20')
      <name>    Name of a very good action. (Supported by API versions '2.21' -
                '2.latest')

Change-Id: I59f155675e2aae642a5b90cb70008eb5647ffe79
2016-02-24 20:10:31 +02:00
Takashi NATSUME
f55e426dd4 Use assertIsNone instead of assertEqual(None, ***)
Instead of using assertEqual(None, ***), developers should
use assertIsNone(***).

Change-Id: I55e9161a4df9197546603385228ea85528de43a7
Closes-Bug: #1510006
2016-02-23 20:15:06 +09: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
Jenkins
a89384c20a Merge "[microversions] Enable 2.20" 2016-02-19 20:26:07 +00:00
Andrey Kurilin
c18ccb1bfa Add a way to discover only contrib extensions
Several OS projects(cinder, neutron, osc...) use
`novaclient.discover_extensions` for initialization novaclient.client.Client
with novaclient.v2.contrib extensions. In this case, it would be nice to
provide a way to not discover extension via python path an entry-point.

Change-Id: I030f4c55c2795c7f7973f5f12e54b9819c4a5578
Closes-Bug: #1509500
2016-02-19 11:42:24 +00: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
f279b086d7 [microversions] Enable 2.20
2.20 - From this version of the API user can call detach and attach volumes
       for instances which are in shelved and shelved_offloaded state.

This change changes only server-side checks.

Change-Id: I15a988c730d2fb0be4416dc79b63d357ae990ff7
2016-02-17 13:44:32 +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
Cao Shufeng
f535e6945b Provide user with coherent interface to get request_ids
Currently, users must use different interface to get request_ids.
1. Commonly, ListWithMeta, DictWithMeta or TupleWithMeta, etc is
returned to user. And request_ids is returned as an attribute of
*WithMeta.

    For a server delete action:
        result = serverManager.delete(server)
        # result = TupelWithMeta
        request_ids = result.request_ids

2. Some places reutrn a tuple which contains request_ids in one of
its elements.

    For a server stop action:
        result = serverManager.stop(server)
        # result = (Response, TupleWithMeta)
        request_ids = result[1].request_ids

Such kind of difference makes user confused.
This change provides a backwards compatibility solution for users
who don't care about request_ids as TupleWithMeta is subclass of
tuple.

Change-Id: I164bb95abce6dc96cf455033f02822ccb0d87b8f
Closes-Bug: 1542179
2016-02-15 09:49:33 +00:00
Jenkins
99c588e28c Merge "[microversions] Skip microversion 2.18" 2016-02-11 01:33:19 +00:00
Andrey Kurilin
ecaca2279e [microversions] Skip microversion 2.18
2.18 - Establishes a set of routes that makes project_id an optional
       construct in v2.1.

The change on Nova-API side adds only check for existence of
"project_id" at the url. It doesn't check microversion, so all latest
and previous microversions can work with or without project_id.
Proof: all functional tests are succeed on this change (several of them
       use latest microversion).

To cut down "project_id" from the url at the novaclient side, we need to
modify ``novaclient.client.HttpClient`` and
``novaclient.client.SessionClient``. This change requires splitting
Nova's related requests and the others(authentication, volume...), which
are still require "project_id" at the url.

It is a complex task, which can be skipped for now to unblock
implementation of further microversions.

Change-Id: Ia6e608aac41d2f2d59b9504d21647e4f88af3335
2016-02-10 19:04:08 +00:00
Jenkins
1ed747c20d Merge "Fix running functional tests against deployment with insecure SSL" 2016-02-10 13:45:08 +00:00
Vincent Untz
e378d32353 Fix running functional tests against deployment with insecure SSL
Change-Id: I106d571e7ddeaeaa1de1ffeff3e88e1eb6898032
2016-02-08 17:51:47 +01:00
Andrey Kurilin
0d0749d39f Make _poll_for_status more user-friendly
NOTE: _poll_for_status is a private method, which is used only in shell
      module, so we can modify it without backward compatibility.

_poll_for_status is used for various resources with different interfaces.

In case of snapshotting, it works with Image resources, which doesn't have
"fault" attribute in "error" state. To prevent AttributeError, we should take
this into account.

Also, an exception raised by _poll_for_status(InstanceInErrorState) should
not be hardcoded for one type of resource, so this exception is renamed to
ResourceInErrorState. An exception InstanceInDeletedState, which is also
can be raised by _poll_for_status, is not modified, since I don't know cases
when it can be used with resources other than Server.

Change-Id: Ie0ee96999376cbf608caa1cf8521dbef5c939b52
Closes-Bug: #1538073
2016-02-04 20:06:43 +02:00
Jenkins
3c934b0455 Merge "Support to boot a VM with network name" 2016-02-02 12:04:10 +00:00
Takashi NATSUME
209f172242 Add return-request-id-to-caller function(5/5)
Add return-request-id-to-caller function to
resources and resource managers in the following files.
The methods in the resource class and resource manager return
a wrapper class that has 'request_ids' property.
The caller can get request ids of the callee via the property.

* novaclient/v2/volume_snapshots.py
* novaclient/v2/volumes.py
* novaclient/v2/volume_types.py

Co-authored-by: Ankit Agrawal <ankit11.agrawal@nttdata.com>
Change-Id: I4de8c5cf685a5970acc92f8a58a1db26a8d9ffc7
Implements: blueprint return-request-id-to-caller
2016-01-28 11:24:03 +00:00
Takashi NATSUME
9f10d7d0b0 Add return-request-id-to-caller function(4/5)
Add return-request-id-to-caller function to
resources and resource managers in the following files.
The methods in the resource class and resource manager return
a wrapper class that has 'request_ids' property.
The caller can get request ids of the callee via the property.

* novaclient/v2/contrib/assisted_volume_snapshots.py
* novaclient/v2/contrib/baremetal.py
* novaclient/v2/contrib/cells.py
* novaclient/v2/contrib/instance_action.py
* novaclient/v2/contrib/list_extensions.py
* novaclient/v2/contrib/migrations.py
* novaclient/v2/contrib/server_external_events.py
* novaclient/v2/contrib/tenant_networks.py

Co-authored-by: Ankit Agrawal <ankit11.agrawal@nttdata.com>
Change-Id: I58ec61eb585d145cb7d638bcb690b3ebee0461e9
Implements: blueprint return-request-id-to-caller
2016-01-28 11:23:36 +00:00
Takashi NATSUME
0414bab3d3 Add return-request-id-to-caller function(3/5)
Add return-request-id-to-caller function to
resources and resource managers in the following files.
The methods in the resource class and resource manager return
a wrapper class that has 'request_ids' property.
The caller can get request ids of the callee via the property.

* novaclient/v2/keypairs.py
* novaclient/v2/limits.py
* novaclient/v2/networks.py
* novaclient/v2/quota_classes.py
* novaclient/v2/quotas.py
* novaclient/v2/security_group_default_rules.py
* novaclient/v2/security_group_rules.py
* novaclient/v2/security_groups.py
* novaclient/v2/server_groups.py
* novaclient/v2/services.py
* novaclient/v2/usage.py
* novaclient/v2/versions.py

Co-authored-by: Ankit Agrawal <ankit11.agrawal@nttdata.com>
Change-Id: I9203f70a0eef5686b590fbff35563f2cf8b6f586
Implements: blueprint return-request-id-to-caller
2016-01-28 11:22:00 +00:00
Jenkins
0799238648 Merge "Add return-request-id-to-caller function(2/5)" 2016-01-28 11:10:16 +00:00
Jenkins
1d08e65195 Merge "Add return-request-id-to-caller function(1/5)" 2016-01-28 10:49:26 +00:00
Jenkins
8cf8edde26 Merge "Add wrapper classes for return-request-id-to-caller" 2016-01-28 10:49:05 +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
Jenkins
5e4318c27e Merge "[microversions] Extend shell with 2.12" 2016-01-27 16:13:44 +00:00
Takashi NATSUME
f194a5abad Add return-request-id-to-caller function(2/5)
Add return-request-id-to-caller function to
resources and resource managers in the following files.
The methods in the resource class and resource manager return
a wrapper class that has 'request_ids' property.
The caller can get request ids of the callee via the property.

* novaclient/v2/agents.py
* novaclient/v2/aggregates.py
* novaclient/v2/availability_zones.py
* novaclient/v2/certs.py
* novaclient/v2/cloudpipe.py
* novaclient/v2/fixed_ips.py
* novaclient/v2/flavor_access.py
* novaclient/v2/flavors.py
* novaclient/v2/floating_ip_dns.py
* novaclient/v2/floating_ip_pools.py
* novaclient/v2/floating_ips_bulk.py
* novaclient/v2/floating_ips.py
* novaclient/v2/fping.py
* novaclient/v2/hosts.py
* novaclient/v2/hypervisors.py
* novaclient/v2/images.py

Co-authored-by: Ankit Agrawal <ankit11.agrawal@nttdata.com>
Change-Id: Ic624d532f1a468dd45105bbb5aa6d8a730984338
Implements: blueprint return-request-id-to-caller
2016-01-27 02:45:22 +00:00
Takashi NATSUME
f9aa277c62 Add return-request-id-to-caller function(1/5)
Add return-request-id-to-caller function to
'Server' resource and 'ServerManager'.
The methods in the resource class and resource manager return
a wrapper class that has 'request_ids' property.
The caller can get request ids of the callee via the property.

* novaclient/v2/servers.py

Co-authored-by: Ankit Agrawal <ankit11.agrawal@nttdata.com>
Change-Id: I8c2d3abcebba7823f42e2f27356e73bc6d7ade42
Implements: blueprint return-request-id-to-caller
2016-01-27 11:44:19 +09:00