1232 Commits

Author SHA1 Message Date
Jenkins
a080227b07 Merge "TestServerGeneral: Add test for _prep_server_detail()" 2015-12-22 04:10:53 +00:00
Jenkins
e79860e495 Merge "TestServerGeneral: Add test for _format_servers_list_networks()" 2015-12-22 04:10:46 +00:00
Tang Chen
17f3685a83 TestServerGeneral: Add test for _prep_server_detail()
1. Make TestServerGeneral inherit from TestServer because
   we need to use servers_mock, image_mock and flavor_mock
   in compute_client.
2. Create a dict containing all info of a server in the
   original format, and pass it to _prep_server_detail().
3. Compare the original and formatted dict.

Change-Id: Ie0b83c42a5c3bbba630a064d28374d07e2ce9caf
Implements: blueprint osc-unit-test-framework-improvement
2015-12-20 11:33:46 +08:00
Tang Chen
b4660fec7d TestServerGeneral: Add test for _format_servers_list_networks()
The items in a dict are in random order. So if a server is in two networks,
there may be two results after formatted.

Change-Id: I2e15d202639e3fff427935f46650a405b0e51bcc
Implements: blueprint osc-unit-test-framework-improvement
2015-12-20 11:24:12 +08:00
Jenkins
b611045639 Merge "Refactor TestImageCreate with FakeImage class" 2015-12-19 06:59:44 +00:00
Jenkins
b220f4b667 Merge "Remove list output from "compute service set"" 2015-12-18 21:40:22 +00:00
Jenkins
31b5a22db8 Merge "Add image re/deactivate commands" 2015-12-18 21:40:04 +00:00
Jenkins
5840dd5a77 Merge "TestServerGeneral: Add test for _format_servers_list_power_state()" 2015-12-17 21:09:46 +00:00
Jenkins
d66e666b67 Merge "Replace assertEqual(None, *) with assertIsNone in tests" 2015-12-17 19:38:09 +00:00
Tang Chen
e590597871 Trivial: Remove useless return from files in network
Change-Id: Ib871fbde7c7140eca875403332ad5ab65a7e940d
2015-12-18 18:05:41 +08:00
SaiKiran
fe7d2d12c0 Replace assertEqual(None, *) with assertIsNone in tests
In python-openstackclient some test cases using asserEqual(None, *)
instead of assertIsNone(). assertIsNone method provides clear error message.

Change-Id: I3069a6436d11efa513ae94f21ceab46c498d6e25
Closes-Bug: #1527054
2015-12-17 17:10:37 +05:30
Jenkins
251939fb36 Merge "Trivial: Remove useless return from files in compute." 2015-12-16 14:56:41 +00:00
Tang Chen
494659fbe4 Trivial: Remove useless return from files in compute.
Change-Id: I9dc6749256fcd53d292d7f658912c032e9ce9df5
2015-12-17 09:34:12 +08:00
NiallBunting
b3943d7142 Add image re/deactivate commands
This change allows admins to deactivate and reactivate their
images. Currently this has to be done with the REST api or the
glanceclient.

This change introduces `--deactivate` and `--activate` for the `image
set` command.

This requires glanceclient 1.2.0. Which got bumped here:
https://review.openstack.org/#/c/257512/

Change-Id: I476c44a0343cdc92d58ddc93fb06470242de2345
Depends-On: I2c370c6bf6ff664d94d756cc76aaa983fbdb8869
Closes-Bug: 1516661
2015-12-16 14:25:41 +00:00
Jenkins
d72f6228cf Merge "Router: Add "router show" command using SDK" 2015-12-16 09:56:11 +00:00
Tang Chen
408dc7b290 Router: Add "router show" command using SDK
This patch adds "router show" command to osc using sdk.

Change-Id: Idb0f7f0376926e97f9f70a52ef21511e7ffa9d92
Implements: blueprint neutron-client
Partial-bug: #1519503
2015-12-17 09:19:40 +08:00
Tang Chen
8a805dae0c Router: Add "router set" command using SDK
This patch adds "router set" command to osc using sdk.

NOTE: Setting ha property of a router is not supported for now.
      Will suppport it in another patch.

Change-Id: I9c15249ae61a87291f0728ad1c8f0a98aa8119bf
Implements: blueprint neutron-client
Partial-bug: #1519503
2015-12-17 00:20:14 +08:00
Jenkins
5a387695cc Merge "Router: Add "router set" command using SDK" 2015-12-16 09:55:08 +00:00
Jenkins
1c5528d5cb Merge "Network: Improve no option test for "network create"." 2015-12-16 07:02:06 +00:00
xiexs
556397aae7 Refactor TestImageCreate with FakeImage class
Change-Id: I0044df36bb4d761c7998dfc8aa9a86d21d81da83
Implements: blueprint improve-image-unittest-framework
2015-12-16 09:25:42 +08:00
Jenkins
5ce02deac4 Merge "when fetching object store properties use lower()" 2015-12-15 23:47:56 +00:00
Jenkins
5736d1e00c Merge "Router: Add "router delete" command using SDK" 2015-12-15 15:42:49 +00:00
Tang Chen
3364855a22 Router: Add "router delete" command using SDK
This patch adds "router delete" command to osc using sdk.

Change-Id: I47d0ca7f7984942ffceaeb1c9ac69efd09145f40
Implements: blueprint neutron-client
Partial-bug: #1519503
2015-12-16 14:14:41 +08:00
Jenkins
25666684d2 Merge "Router: Add "router create" command using SDK" 2015-12-15 15:37:36 +00:00
Tang Chen
bd0bed7467 Network: Improve no option test for "network create".
Currently, test_create_no_options() case actually takes a 'name' arg.
Rename it to test_create_default_options, and add a test_create_no_options
case taking nothing.

Change-Id: I4f9d2e8cbfa843faea641d3cc959f96894c9cd5d
2015-12-15 13:22:00 +00:00
Jenkins
d97e6c80fa Merge "Add multi deletion testcase for "openstack image delete"" 2015-12-15 07:37:48 +00:00
Jenkins
24af1bf595 Merge "Refactor TestImageDelete with FakeImage" 2015-12-15 06:39:22 +00:00
Tang Chen
6158ebb0e0 Router: Add "router create" command using SDK
This patch adds "router create" command to osc using sdk.

NOTE: Test for --project needs support for fake identity client v2 and v3.
      These tests will be added in other patches.
NOTE: external_gateway_info and routes are not supported to be passed to
      create command now. They will be supported in another tow patches.
NOTE: Creating a ha router is not supported for now. Will support it in
      another patch.

Change-Id: I7642295d27c27dd498331ae1da1c293706d8f6af
Implements: blueprint neutron-client
Partial-bug: #1519503
2015-12-15 09:42:41 +08:00
Jenkins
c47aa52c43 Merge "Trivial: Improve unclear comments in test_server.py" 2015-12-14 22:47:35 +00:00
Jenkins
79e67089dd Merge "Remote security group name not displayed for rule" 2015-12-14 22:29:38 +00:00
Richard Theis
079123bb0b Remote security group name not displayed for rule
The 'security group rule list' command was updated to display the
remote security group name for a security group rule. This was done
via a new 'Remote Security Group' column. The output of the
'security group rule create' and 'security group show' commands was
also updated to include 'remote_security_group' information instead
of the raw 'group' information returned from the API layer.

Change-Id: I5f9600338c8331966d2c658109a24b502c538106
Closes-Bug: #1520003
2015-12-14 14:48:19 -05:00
Steve Martinelli
74a6a81ae9 when fetching object store properties use lower()
sometimes properties within object store concepts are stored with
mixed case depending on the client used to store said properties.

when retrieving properties to 'show' the user, always call lower()
on the property in question when comparing it to the reserved
values of the swift API.

Change-Id: I97ffc715788ca3cd021413124b6945a399465c99
Closes-Bug: 1525805
2015-12-14 12:23:44 -05:00
Jenkins
8ee3380fa2 Merge "Router: Add "router list" command using SDK" 2015-12-11 20:42:21 +00:00
Jenkins
5f7a295b52 Merge "Router: Add class FakeRouter to test "router xxx" command" 2015-12-11 20:19:17 +00:00
Tang Chen
3278b3a022 Router: Add "router list" command using SDK
Add "router list" command. It takes one "--long" option.

By default, the command will print router id, name, status,
admin state up, distributed, ha and project id.

With "--long" option, it will also print routes and
external gateway info.

Change-Id: I9d21904c41c11ee1fa107f985744878a1dc2f970
Implements: blueprint neutron-client
Partial-bug: #1519503
2015-12-11 18:07:47 +00:00
Tang Chen
185412f28c Router: Add class FakeRouter to test "router xxx" command
A unit test class similar to FakeServer, which is able to fake one
or more routers. It will be used by the router CRUD patches.

Change-Id: I9b87c6c95282902c3a829da51229a35d4265a1e4
Implements: blueprint neutron-client
Partial-bug: #1519503
2015-12-11 17:52:19 +00:00
Jenkins
785caf503f Merge "Add source security group support to create rule" 2015-12-11 17:40:11 +00:00
Tang Chen
6f7c705d4a Trivial: Improve unclear comments in test_server.py
In test_server.py, there are two ImageManagers are faked:
1. the one in compute client
2. the one in image client
But the comments are the same. And so is volume.

This patch makes the comments more clear.

Change-Id: I2c52f48a7b3c005c185a4ac64abbb3e18d5fb3de
2015-12-11 17:18:28 +08:00
Jenkins
67090b77b2 Merge "The format_exc method does not take an exception" 2015-12-11 02:34:37 +00:00
Jenkins
823ba770e0 Merge "Fix "sevice show" cannot catch NoUniqueMatch Exception" 2015-12-10 18:37:18 +00:00
Jenkins
f2339e94b0 Merge "Add unit test for TestServerList to test --long option." 2015-12-10 18:25:40 +00:00
Tang Chen
2caf7b19e2 Trivial: Do not use plural format in command parameter in "network delete"
Since "network delete" could delete more than one network,
add a (s) to the doc.

And also, rename the parameter "networks" to "network".
The naming style is not using plural format in parameter.

Change-Id: Id434ea905af34457f84ea6bcb18addef5800429a
2015-12-11 19:39:36 +08:00
Tang Chen
a8ba54562b TestServerGeneral: Add test for _format_servers_list_power_state()
If we have tests for each helper function, then we can call them
in other tests without worrying about error.

Change-Id: I1e4273aef201fe9d8936e5c365ebb46068039892
Implements: blueprint osc-unit-test-framework-improvement
2015-12-10 17:11:41 +08:00
Terry Howe
f65f82e435 Fix poorly named test mocks
Change-Id: I6e2911e88fc458b39d5024a5714ed8af3f519946
2015-12-09 11:59:30 -07:00
Terry Howe
7a42174c4b Remove old code after sdk integration
We won't need this anymore.

Change-Id: Ib10be1dedb8db81f0cba6e45b8a9b0aade2ab473
2015-12-09 11:45:59 -07:00
Terry Howe
7aa6e5e36c SDK integration extensions and server create networks
Finish up the SDK integration with server create network and port
find and extension list.

Change-Id: I18dbada784d8aa92a45a937f251023ddf899c53e
2015-12-09 11:39:20 -07:00
Tang Chen
6a5be8c4c9 Add unit test for TestServerList to test --long option.
In two steps:
1. Setup all necessary attributes of a server in setUp(), including
   the ones that are not faked in FaseServer by default.
2. Run a similar process with no option test case.

The future plan is to move all these attributes to FakeServer.
But it will cause some other changes which has nothing to do with
this patch. So leave this job to do later.

Change-Id: I1134812a0ea146ef737b0f0ffbef8ca23684accd
Implements: blueprint osc-unit-test-framework-improvement
2015-12-09 19:42:52 +08:00
xiexs
50e52f355f Add multi deletion testcase for "openstack image delete"
Change-Id: I5442128a290a9ad3b9ff9919431a1ecc0c697dad
Implements: blueprint improve-image-unittest-framework
2015-12-09 17:58:11 +08:00
xiexs
d377756a62 Refactor TestImageDelete with FakeImage
Change-Id: I052a0220ca5d974824fc46ad403234e65e8173aa
Implements: blueprint improve-image-unittest-framework
2015-12-09 17:55:39 +08:00
Jenkins
ccbffb2ef9 Merge "Use FakeVolume in server test cases." 2015-12-09 04:14:56 +00:00