columns and datalist has been set in each test case in compute,
which is not necessary. This patch abstract it out and remove
all redundant code.
Change-Id: I5e8423722416ea31fdced4c932ed141de90028ab
Closes-Bug: #1531816
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
Both nova and neutron allow security group rules to be listed without
specifying the owning security group. This patch set makes the
group argument on 'os security group rule list' optional. Behavior
is unchanged when the argument is specified. When the argument is
not specified then all accessible security group rules will be listed.
The listing will include the owning security group for each rule.
Change-Id: I6914baecf70a65354e1e82dad92c6afbd32b4973
Related-Bug: #1519512
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
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
The command will now default to the image currently in-use by
the server, effectively making the --image parameter optional.
This commit also adds basic tests for ServerRebuild since there
wasn't any. Will add more full tests for it.
Change-Id: I733fd3ad5a825f06563c72aa430122e1a0e3b3b0
Closes-bug: #1524406
Co-Authored-By: David Moreau Simard <dms@redhat.com>
Co-Authored-By: Tang Chen <tangchen@cn.fujitsu.com>
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>
We have a class FakeVolume to fake one or more volumes. So use it in
test_server.py.
Change-Id: I735ae7f678a6799e0ae4c7c25c8083d9ebf47b09
Implements: blueprint improve-volume-unittest-framework
We have a class FakeImage to fake one or more images. So use it in
test_server.py.
Change-Id: I276e4ade5aecefbe66b9722c1dfbac10b3bd14b6
Implements: blueprint improve-image-unittest-framework
The 'security group rule create' command was updated to support a
source security group. Now either a source IP address block or source
security group can be specified when creating a rule. The default
remains the same.
Change-Id: If57de2871810caddeeaee96482eb34146968e173
Closes-Bug: #1522969
We should use the formatter in the original code to set the
expected data in each test case.
The same problem exists in other test cases, like "server create".
But data structure in TestServerCreate is different from TestServerList,
so will fix the problem in another patch.
Change-Id: I233f7a91cd4cc1e996941e26ea85490fa3290572
This patch provide a class to test "server list" command. Only one simplest
case in this patch.
Some of the options in "server list" are complicated. And the server object
contains lots of attributes need to be handled in specific ways. So other
test cases will be added in other patches.
Change-Id: Id9fdba8f149bd74187aa42516067dacebc6962b5
Implements: blueprint osc-unit-test-framework-improvement
setup_servers_mock() is now able to set methods to the fake servers.
But it cannot set attributes. This patch enable it to do so.
This will be useful in "server list" test cases.
Change-Id: Ic30d750ebe4650244707a368cdd5d622a8f1b8ed
Implements: blueprint osc-unit-test-framework-improvement
Add a set of testcases to test the classes of
ListService and SetService in the compute.v2.service.
And to be consistent with cinder term, use service_binary
to represent the service binary.
Change-Id: I9fe740f07c9ce3afdba7b7cca152d614170abb96
A validation is necessary to check the existence of project.
This patch is similar to Ia2d8c96527820e25b074e6486d3f39c5ad7eae60.
Change-Id: Id8895ba7a21ecad05942619a82a87c0dc68eae53
The new class FakeFlavor has been introduced to fake one or more flavors.
So use it and remove the old fake flavor data.
Change-Id: Ie3a33b36ae6e597c6a0b1d17ad13c73cf4b73bc9
Implements: blueprint improve-flavor-unit-test
Just like FakeServer and FakeResource, FakeFlavorResource should be in compute_fakes.py.
Change-Id: I8315256fb90377605fa2190e24c9674f6aaf6efd
Implements: blueprint improve-flavor-unit-test
datalist has been set in each test case in TestFlavorList, which is not
necessary. This patch abstract it out and remove all redundant code.
Change-Id: I6f735f7d9fa29a8ab435adaef17ca559df1fdcee
Implements: blueprint improve-flavor-unit-test
The columns has been set in each test case of TestFlavorList, which is not
necessary. This patch abstract it out and remove all redundant code.
Change-Id: Ideb2872f073755ac251bd603fd906410ea86c4ef
Implements: blueprint improve-flavor-unit-tes
The unshelve operation is not supported by OSC,
and this patch tries to add it.
Change-Id: Ic60a4616cb63ad21c1a3c8e02611da8bad3a8bd0
Implements: blueprint introduce-shelve-into-osc