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
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
In python-openstackclient some test cases using asserEqual(None, *)
instead of assertIsNone(). assertIsNone method provides clear error message.
Change-Id: I3069a6436d11efa513ae94f21ceab46c498d6e25
Closes-Bug: #1527054
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
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
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
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
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
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
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
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
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
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
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
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
The previous patches have migrate all network commands to
the new version using sdk. This patch will remove the
temporary method, and implement a new make_client() to
create sdk network client.
And also, find() in openstackclient/network/common.py must
support sdk. The logic of this function will become much
easier than before, so this patch also removes two useless
test cases of find().
This patch will also remove the patched methods in tests.
Change-Id: Ic2f7bca073beb9757172d16f95d9b82c48cbbc12
Implements: blueprint neutron-client
Co-Authored-By: Terry Howe <terrylhowe@gmail.com>
Co-Authored-By: Tang Chen <tangchen@cn.fujitsu.com>
This patch makes "network show" command use sdk.
Since we have to keep the other commands runnable with
the old network client, we use a temporary method to
create sdk network client. And as a result, the tests
need to patch a method to fake the temporary method,
which will be removed at last.
There are two same test cases in the unit tests. This
patch will remove one.
And since the output has changed, we also need to fix
function test cases.
Change-Id: I4c06b4efad2db430767bbaa882b0876df3ab483a
Implements: blueprint neutron-client
Co-Authored-By: Terry Howe <terrylhowe@gmail.com>
Co-Authored-By: Tang Chen <tangchen@cn.fujitsu.com>
This patch makes "network set" command use sdk.
Since we have to keep the other commands runnable with
the old network client, we use a temporary method to
create sdk network client. And as a result, the tests
need to patch a method to fake the temporary method,
which will be removed at last.
Change-Id: I794ac4b82d9200747298f1a9ee44611140e9b6d0
Implements: blueprint neutron-client
Co-Authored-By: Terry Howe <terrylhowe@gmail.com>
Co-Authored-By: Tang Chen <tangchen@cn.fujitsu.com>
This patch makes "network delete" command use sdk.
Since we have to keep the other commands runnable with
the old network client, we use a temporary method to
create sdk network client. And as a result, the tests
need to patch a method to fake the temporary method,
which will be removed at last.
Change-Id: I1f2c404e4b0ff6727e4c535ce543aa406f2290ce
Implements: blueprint neutron-client
Co-Authored-By: Terry Howe <terrylhowe@gmail.com>
Co-Authored-By: Tang Chen <tangchen@cn.fujitsu.com>
This patch makes "network create" command use sdk.
Since we have to keep the other commands runnable with
the old network client, we use a temporary method to
create sdk network client. And as a result, the tests
need to patch a method to fake the temporary method,
which will be removed at last.
Change-Id: I06559c675be1188747257f72f18d6b4d420d0285
Implements: blueprint neutron-client
Co-Authored-By: Terry Howe <terrylhowe@gmail.com>
Co-Authored-By: Tang Chen <tangchen@cn.fujitsu.com>