332 Commits

Author SHA1 Message Date
jiahui.qiang
7d93db21e5 Fix can not set is_default in network
The value of is_default always be None, can not be set by
"network set" command. Allow "--default" and "--no-default"
options to be recognized when ``--external`` is not present.

Closes-bug:#1665231

Change-Id: I7a05fc7734a15994f72ca4e47997b4952f1f72f8
2017-02-23 15:51:48 +00:00
zhiyong.dai
40ec7a9c96 Support --no-property in "volume set" command
Add "--no-property" option to "volume set" command in v1 and v2
and update the test cases.

Change-Id: Id5660f23b3b2d9aa72f4c16b19ce83f3f7ed2fa4
2017-02-23 21:49:11 +08:00
Rui Chen
0898ebacb8 Support list commands by group name keyword
The output of current "command list" is so long, it's
very difficult for users to find out the commands
they care about.

Add "--group <group-keyword>" option to filter the commands by group
name keyword, like: --group volume, list all openstack.volume.v2
(cinder) commands

That support the scenario that users need to know the current support
commands of some OpenStack services(nova, neutron, cinder and so on) in
OSC.

Change-Id: Id673042729ad36a0cac0b81fb31a3537c24f03fc
Closes-Bug: #1666780
2017-02-23 12:13:06 +08:00
Jenkins
c8435f2d5a Merge "Show openstacksdk version info in "module list"" 2017-02-22 22:51:28 +00:00
Rui Chen
10f0300f70 Show openstacksdk version info in "module list"
openstacksdk bug/1588823 exist, no good way to add __version__ for
openstack module properly, fix the issue in osc side, make openstacksdk
module information be available.

Change-Id: I27ff61792443d1aa07f31598bed3aa32f924ff40
Partial-Bug: #1662058
2017-02-22 16:40:22 +08:00
Anindita Das
edaeece7f1 OSC Network Flavor
Implements Neutron feature of Network Flavor into OpenstackClient
This patch implements the following commands:
network flavor create
network flavor delete
network flavor list
network flavor show
network flavor set

Works with openstacksdk version 0.9.8

Change-Id: I29d7a62341010a1d067a8ca93bccb7d9b8d4c425
Partially-Implements: blueprint neutron-client-flavors
Partially-Implements: blueprint network-commands-options
2017-02-22 02:45:51 +00:00
Jenkins
62938c02e0 Merge "Fix properties format for volume qos in volume v1" 2017-02-21 19:49:16 +00:00
Huanxuan Ao
1be6c2d92f Fix properties format for volume qos in volume v1
Notice that patch [1] fixed the error of properties
format for volume qos in volume v2, but there is the
same bug in volume v1, and the patch missed that, so
fix the problem in v1 as well

[1] https://review.openstack.org/#/c/421065/

Partial-Bug: #1656767
Change-Id: I156bf13d164dbd0d0a7ce394964176718c4ff0e5
2017-02-21 19:34:15 +08:00
Rui Chen
c7e0948a2d Rework port functional tests on json output format
Some functional tests try to parse the CLI table output
format, that cause much work on parse string by using
regular expression. Using json format in functional tests
is better and easier way, the patch rework for port related
tests.

Change-Id: I0ec997bf63da4925742848c593db09d89655ca34
2017-02-21 07:35:02 +00:00
Justin A Wilson
4d5f2c3925 Add Cinder v3 client support for volumes
Initial Cinder v3 support

Change-Id: Idd5074832e80697ed0671f06d3291dfd92dbfb08
2017-02-20 20:37:36 +00:00
Dean Troyer
74a35fb005 Finish converting server functional tests to JSON format
Change-Id: Ic9563bd86feb1f7afd403e49499205a499f0c142
2017-02-18 11:50:39 -06:00
Jenkins
83a0db0a54 Merge "Fix "server create" command failed when --nic auto or none" 2017-02-18 06:41:14 +00:00
Jenkins
bf10900c13 Merge "Functional test for router" 2017-02-18 06:25:16 +00:00
Jenkins
c88975136d Merge "Add "encryption-*" options in volume type commands" 2017-02-18 03:36:06 +00:00
Dean Troyer
ef1a86a802 Fix image selection in server function tests
The image selection has been affected by Cirros image changes in DevStack,
make the logic moe robust and convert it to JSON.  The conversion for the
remainder of the file will follow.

Change-Id: I8f3318f55ed79d617c3594142f0c086e2bd1a7b1
2017-02-17 12:14:41 -06:00
Rui Chen
c051c5f090 Fix "server create" command failed when --nic auto or none
"auto" and "none" options was added into --nic argument of server create
command in patch https://review.openstack.org/#/c/412698/ , but that
don't work and raise internal error when execute command. The patch
fix that issue and add unit and functional tests.

Change-Id: Ia718c3bac0a5172a0cdbe9f0d97972a9346c1172
Co-Authored-By: Kevin_Zheng <zhengzhenyu@huawei.com>
Closes-Bug: #1663520
2017-02-15 14:25:37 +08:00
Jenkins
f106b4f022 Merge "Refactor volume functional test in volume v1" 2017-02-14 08:01:03 +00:00
Jenkins
10bd6a6267 Merge "Refactor availability zone functional test" 2017-02-13 17:41:20 +00:00
Jenkins
0c42c88d88 Merge "Refactor module functional test" 2017-02-13 17:27:39 +00:00
Jenkins
2cb1cee361 Merge "Modify error handling for role and group commands" 2017-02-13 17:27:33 +00:00
Jenkins
30fdb488a8 Merge "Functional test for volume qos" 2017-02-13 14:25:55 +00:00
Jenkins
5a9b5f7cb9 Merge "Functional test for configuration" 2017-02-13 12:14:07 +00:00
Jenkins
5de97e385f Merge "Functional test for aggregate" 2017-02-13 08:51:14 +00:00
Huanxuan Ao
35b2724293 Refactor volume functional test in volume v1
There is a patch for refactor of volume funtional
test in volume v2 [1], but v1 is missing, this
change add the v1 refactor with json format.

[1]: https://review.openstack.org/#/c/417349

Change-Id: I969df3c8dbca21a62f6245e3e95680cf3cd47dc1
2017-02-13 15:59:27 +08:00
Jenkins
1c76c70d71 Merge "Fix --parents and --children options in project show" 2017-02-09 17:38:15 +00:00
Huanxuan Ao
cfd4e2a722 Modify error handling for role and group commands
if command failed, we usually raise exception,
if command success, sometimes there is not any
output (such as set, add commands)
So modify the error handling for role and group
commands.

Change-Id: I1c0f86c04dcedd9c0d725fd73f3436be9da75ee0
2017-02-09 19:49:55 +08:00
Rui Chen
4679a4c193 Fix --parents and --children options in project show
Options "--parents" and "--children" don't work in "project show"
command, fix the issue and add related unit and functional tests.

Change-Id: Id9965267a037442f1077f8e1929d0527981f643d
Closes-Bug: #1499657
2017-02-09 19:24:55 +08:00
Jenkins
46d1df0adf Merge "Functional test for agent" 2017-02-09 06:35:56 +00:00
Jenkins
2966bd0639 Merge "Functional test for server group" 2017-02-09 05:58:32 +00:00
Rui Chen
3afd2b7ff2 Fix "module list --all" failed
KeyError cause the command "module list --all" failed,
fix it, and do refactor to filter private modules and
reduce the loop times, add related unit tests and
functional tests.

Change-Id: Icd77739502e05b5f763a04a92547497bf82d5d63
Closes-Bug: #1661814
2017-02-06 09:44:18 +08:00
Dean Troyer
1e3dc48c64 Add relnotes for the two recent bug fixes
Also add a functional test for network create --project

Change-Id: Idbfdf82f1ea6c84fb6a51df88e746e5ddb896b4f
2017-01-28 07:42:17 -06:00
Dean Troyer
4a12280999 Fix address scope list --share
Remove the 'shared' key from the attrs passed in to the SDK with 0.9.13.

Also convert the functional tests to the JSON-style (that's how I found this).

Closes-bug: 1659993
Change-Id: I614fbce967cdd07fe7360242547dbf52e7677939
2017-01-27 19:56:44 -06:00
Jenkins
da2a820d2f Merge "Support "--no-property" option in volume snapshot set" 2017-01-26 06:38:31 +00:00
Nikita Gerasimov
95c8661f86 Switch server create to block_device_mapping_v2
Current compute_client.servers.create() relies on block_device_mapping
arg which is legacy[1]. "block_device_mapping" format require
device_name which is leads to hard-coded hack in --volume key handler
to KVM specific. "block_device_mapping_v2" format is more friendly
to hypervisiors.
Support of block_device_mapping_v2 appear in python-novaclient 2.16.0,
openstackclient require at least 2.29.0

Makes options --volume and --block-device-mapping work simultaneously.
Appends --block-device-mapping data even if --volume used.
After bug 1383338 only --volume was taken when both are used.

[1]http://docs.openstack.org/developer/nova/block_device_mapping.html

NOTE(dtroyer): I moved the new test_boot_from_volume() functional
test to Ie51b1c375c5940856ec76a5770df3c6bd18a3eba to test our
previous behaviour.  The only changes required to support the new
behaviour should be that the empty_volume is now attached in that test.

Change-Id: I7bac3d870dd9ca404093142f8bce22a62e49180d
Closes-Bug: 1647406
Closes-Bug: 1497845
2017-01-26 02:02:30 +00:00
Jenkins
51c418f8c3 Merge "Add server_boot_from_volume() test" 2017-01-26 01:40:14 +00:00
Jenkins
0cfb65bee7 Merge "Add server test for image and flavor lookups" 2017-01-26 01:36:11 +00:00
Jenkins
cb74397215 Merge "Fix Identity functional tests to not require OS_AUTH_URL" 2017-01-26 01:19:17 +00:00
Jenkins
55ea0e5b39 Merge "Add meter rule to OSC" 2017-01-26 01:19:10 +00:00
zhiyong.dai
26d50be79a Support "--no-property" option in volume snapshot set
Supporting "--no-property" option will apply user a convenient
way to clean all properties of volume snapshot in a short command,
and this kind of behavior is the recommended way to devref.
The patch adds "--no-property" option in "volume snapshot set" command,
and update related test cases and devref document.

Change-Id: I5f10cc2b5814553699920c4343995b2e11416e4e
Implements: blueprint allow-overwrite-set-options
2017-01-25 17:32:58 -06:00
Dean Troyer
d780e9e91f Fix Identity functional tests to not require OS_AUTH_URL
The Identity functional tests had an assumption that OS_AUTH_URL would
always be present, but when running the functional tests and only setting
OS_CLOUD (using clouds.yaml for creds) this fell down.

Change-Id: Ie589d301f866b06d9f8be8deeb953e03bc01cf09
2017-01-25 15:25:32 -06:00
Steve Martinelli
42ac82b1a4 change assert_show_fields to not fail on new fields
whenever a resource adds a field (which is allowed in our API
guidelines), OSC functional tests fail, because we validate
the resource keys to a hardcoded list.

instead, this change proposes that the logic of
assert_show_fields is flipped around, so our hardcoded list acts
as a minimum set of values that must appear in the resource.

as part of this change, some fields were remove from the constants
since they were not actually in the returned data.

also, delete unused code `assert_show_structure`.

Change-Id: I8c0f0e80ea472f9c7f93c5f1f0ae52048e6cd7da
2017-01-25 13:09:16 -08:00
Dean Troyer
5ecb353f89 Add server_boot_from_volume() test
Plucked this test out of I5529f412578c50090e70d17aa0129217bf803fed in
order to validate the current behaviour before applying that change.
It was converted to the new JSON-style.

Change-Id: Ie51b1c375c5940856ec76a5770df3c6bd18a3eba
2017-01-25 19:56:34 +00:00
Dean Troyer
9ada3b529d Add server test for image and flavor lookups
Review Ia66e44e530799ce6531922dcf6a84e38528c8725 changes OSC's server
commands to use the image client rather than compute clirnt (yay!)
but we never really tested any of this in functional tests.  This review
adds a simple functional test (in the new style) to watch the client
change; it passes locally for me without the client change, due to timing
we went ahead and merged that first.

Change-Id: I5529f412578c50090e70d17aa0129217bf803fed
2017-01-25 02:34:27 +00:00
Jenkins
bfad2abf23 Merge "Fix OSC networking commands help errors" 2017-01-24 15:35:33 +00:00
Jenkins
11ef43da49 Merge "Functional tests - port" 2017-01-24 06:06:31 +00:00
Ankur Gupta
5caac0e563 Add meter rule to OSC
Implement network feature meter label rules into
OpenStack Client.

Allows for creation of rules to meter
network traffic.

Partially Implements: blueprint neutron-client-metering

Change-Id: If18c078d7e80c122583417669f820f02c84d6237
2017-01-23 00:24:35 +00:00
Rui Chen
4d9da2c40a Fix OSC networking commands help errors
OSC networking commands need to authenticate to get
service catalog, then decide to show nova-network or
neutron command help message. Fake token and fake
auth_type in prepare_to_run_command() casue os-cloud-config
use AdminToken auth plugin, but pass all the auth information
(include: username, password and so on) to it, that casue the
class initialization error. Pop the fake token and url, then
try to load auth plugin again to fix the issue.

Change-Id: I8b140f0b0a60681fc2a35a013bb0c84ff8cb9589
Closes-Bug: #1650026
2017-01-22 06:30:31 +00:00
jiahui.qiang
4f4af3d67d Switch to use cleanup method in functional test
Switch the delete command in subnet and router functional tests. Because
addCleanup will also work when an assertion fails ,except the test is for
testing delete command.

Change-Id: I33634f5148c4895c7cf4d4773a9c33c8368850c7
2017-01-21 18:22:26 +08:00
Jenkins
bf3f12f596 Merge "Error in the return of command 'volume qos create'" 2017-01-21 06:18:08 +00:00
jiahui.qiang
f96cff1a6d Functional test for router
Refactor functional tests for testing more command options.

Change-Id: I6200045c6228e245fc48a4d48d4b3796dede61b5
2017-01-19 01:26:08 +08:00