summaryrefslogtreecommitdiff
path: root/openstackclient/tests/compute
Commit message (Collapse)AuthorAgeFilesLines
* Remove methods argument from FakeHypervisorStatsTang Chen2016-04-151-2/+1
| | | | | | | methods argument is not necessary in FakeHypervisorStats class. Remove it. Change-Id: I288f71b412beb3e583e957a9fd99210bc6f3f543
* Remove fake methods code from compute networkTang Chen2016-04-121-77/+15
| | | | | | | | | | | | Network objects don't have any method needs to fake. keys() method is only used by _get_columns() helper to obtain all attributes of an object. But in compute network implementation, attributes are obtained from obj._info directly, which is a dictionary itself. So there is no need to fake this method. Change-Id: Ie6a46ef6a3042641e55a7002573ef501db7b60e1
* Merge "Refactor security group rule list to use SDK"Jenkins2016-04-111-229/+0
|\
| * Refactor security group rule list to use SDKRichard Theis2016-03-281-229/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Refactored the 'os security group rule list' command to use the SDK when neutron is enabled, but continue to use the nova client when nova network is enabled. In addition, a release note was added to document the features and fixes resulting from this refactor. Change-Id: I24d04b720102ed1c60776e1ca67d4ca20e31b663 Partial-Bug: #1519512 Implements: blueprint neutron-client
* | Merge "Log hint when --enable present with --disable-reason"Jenkins2016-04-061-9/+64
|\ \
| * | Log hint when --enable present with --disable-reasonRui Chen2016-04-051-9/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | --enable and --disable-reason should be mutually exclusive in "compute service set" command, but now when they are present at the same time, --disable-reason would be ignored silently. Fix these and add some hints about --disable-reason argument is ignored in this situation. Change-Id: I43254b6bc40fcae4fd0dc3457f26fad84c267072 Closes-Bug: #1556801
* | | Trivial: Rename FakehypervisorStats to FakeHypervisorStatsTang Chen2016-04-052-3/+3
|/ / | | | | | | Change-Id: I138b1b8a3327947b8cd032d8d0c32d98548ce2ad
* | Merge "Add unit tests for compute v2 aggregate"Jenkins2016-03-301-5/+331
|\ \
| * | Add unit tests for compute v2 aggregateRui Chen2016-03-261-5/+331
| | | | | | | | | | | | | | | | | | | | | | | | This patch add the complete unit tests to cover compute v2 aggregate object. Change-Id: Ifcf9248eabb5ca3ee5ca01c5843e96ba681c3b5a Closes-Bug: #1560832
* | | Merge "Add "aggregate unset" to osc"Jenkins2016-03-302-0/+98
|\ \ \ | |/ / | | / | |/ |/|
| * Add "aggregate unset" to oscRui Chen2016-03-242-0/+98
| | | | | | | | | | | | | | | | Support "aggregate unset" command in order to remove the property of aggregate object in OSC. Change-Id: I49645135586362f0fd251f5e4a4c03eff273d9e9 Closes-Bug: #1559866
* | Refactor security group rule create to use SDKRichard Theis2016-03-232-269/+3
|/ | | | | | | | | | | | | Refactored the 'os security group rule create' command to use the SDK when neutron is enabled, but continue to use the nova client when nova network is enabled. Added a release note for the change in security group rules output due to Network v2. Change-Id: I8c6c99d5272ff5d410a449f73d198d834c5cd96e Partial-Bug: #1519512 Implements: blueprint neutron-client
* Merge "[compute] Add set host command"Jenkins2016-03-172-0/+131
|\
| * [compute] Add set host commandjichenjc2016-02-262-0/+131
| | | | | | | | | | | | set host command is missing, add it as SetHost class. Change-Id: I7acb94150718b7150598632cbebc3d85018a0d59
* | Support "--long" option in ListServiceRui Chen2016-03-142-1/+27
| | | | | | | | | | | | | | | | Add "--long" option in ListService so that compute service disabled reason can be showed. Change-Id: I1ace8f1c4e4efe0a1a8f6710425d73eb5db9e5e1 Closes-Bug: #1556815
* | Refactor security group create to use SDKRichard Theis2016-03-101-127/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactored the 'os security group create' command to use the SDK when neutron is enabled, but continue to use the nova client when nova network is enabled. Added a release note for the change in security group rules output due to Network v2. The tenant_id column name was fixed to align with the 'os security group show' command. Change-Id: Ib29df42edcddcc73a123fff6a64743a6bfcb7fbf Partial-Bug: #1519511 Implements: blueprint neutron-client
* | Refactor security group show to use SDKRichard Theis2016-03-101-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactored the 'os security group show' command to use the SDK when neutron is enabled, but continue to use the nova client when nova network is enabled. Added a release note for the change in security group rules output due to Network v2. The column names remain unchanged to maintain backwards compatibility. Change-Id: I25233ddb8115d18b8b88affb3de13346084a339d Partial-Bug: #1519511 Implements: blueprint neutron-client
* | Merge "Remove FakeFlavorResource class"Jenkins2016-03-091-29/+16
|\ \
| * | Remove FakeFlavorResource classTang Chen2016-03-091-29/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | In unit tests, all real methods are faked. They should not do any real operations in the tests. So, FakeFlavorResource is not necessary. Just fake get_keys(), set_keys and unset_keys() in FakeResource would be enough. Change-Id: Icc3473ba9c77f4817d0edddb7ff3e1bd2946fac7
* | | Merge "Add --reason for disable service"Jenkins2016-03-091-0/+26
|\ \ \ | |/ / |/| |
| * | Add --reason for disable servicejichenjc2016-03-091-0/+26
| | | | | | | | | | | | | | | | | | | | | disbale service allow a reason to be input as disable reason. This patch add support for it. Change-Id: I59622c3970e055ebd46bf03c33c864b6d064db28
* | | Trivial: Fix incorrect comments in compute fakes.pyTang Chen2016-03-081-3/+3
| |/ |/| | | | | Change-Id: I18b1720af13b444527dda1ecab52e3cc8d8d9376
* | Merge "[compute] Support restore server"Jenkins2016-03-041-0/+20
|\ \
| * | [compute] Support restore serverjichenjc2016-02-231-0/+20
| | | | | | | | | | | | | | | | | | Server in soft-delete state can be restored, add this command. Change-Id: Id9d7246f89ae65273505f36dcb664996534ae986
* | | Merge "[compute] Add unit test for keypair"Jenkins2016-03-042-0/+315
|\ \ \
| * | | [compute] Add unit test for keypairjichenjc2016-02-232-0/+315
| | | | | | | | | | | | | | | | | | | | | | | | keypair do not have unit test, this patch adds it. Change-Id: Id702ccaad239b916340bb17014d1ede0a28aaec9
* | | | Merge "Add test cases to test some commands with '--wait' and fix bug"Jenkins2016-03-041-0/+188
|\ \ \ \ | |_|_|/ |/| | |
| * | | Add test cases to test some commands with '--wait' and fix bugting.wang2016-03-021-0/+188
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "server image create" "server rebuild" "server resize" Above 3 commands are not covered by unit test. So add some unit tests. Meanwhile, fix bug. Now that image name is an optional argument, we'd better record error messages with positional arguments instead of optional argument. So, record server name. Change-Id: I41bc025d4824dc46f63a3213d82e1528bacbbe12
* | | | Refactor security group list to use SDKRichard Theis2016-02-292-62/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactored the 'os security group list' command to use the SDK when neutron is enabled, but continue to use the nova client when nova network is enabled. This refactor also removes the logic for displaying project names instead of project IDs when the --all-projects option is specified. This logic was removed because it is inconsistent with the other network commands. Since neutron will always display security groups across all projects for an admin, the --all-projects option is now hidden when neutron is enabled and the Project column is always displayed. Change-Id: I934a1f5084ef3c5f929d0ffd38ebf5064d799941 Partial-Bug: #1519511 Related-to: blueprint neutron-client
* | | | Merge "Make SetFlavor and UnsetFlavor inherit from cliff.Command"Jenkins2016-02-291-10/+4
|\ \ \ \
| * | | | Make SetFlavor and UnsetFlavor inherit from cliff.CommandTang Chen2016-02-271-10/+4
| | |/ / | |/| | | | | | | | | | | | | | | | | | set/unset comamnd classes should inherit from cliff.Command class. Change-Id: I54e5608ac0768d7d94b7f7d516ea1948daefdc1b Partial-Bug: 1546065
* | | | [Compute] Check return value is None in compute unit tests.Tang Chen2016-02-273-45/+33
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | take_action() in commands inheriting from Command returns nothing. So we should assert the return is None in the unit tests of these commands. Change-Id: I953480ecff3b5beb12255d866d0e1df45f130efd Partial-Bug: #1550636
* | | Merge "Floating IP: Neutron support for "ip floating show" command"Jenkins2016-02-251-0/+1
|\ \ \
| * | | Floating IP: Neutron support for "ip floating show" commandTang Chen2016-02-241-0/+1
| |/ / | | | | | | | | | | | | | | | Change-Id: I30350076621c83c758927444e5f8bcc2b7d0fc74 Partial-Bug: 1519502 Related-to: blueprint neutron-client
* | | Merge "Fixed a bunch of spacing"Jenkins2016-02-251-0/+2
|\ \ \ | |_|/ |/| |
| * | Fixed a bunch of spacingBrandon Palm2016-02-231-0/+2
| |/ | | | | | | | | | | | | Nothing too complicated here. I fixed a bunch of spacing issues that I saw in OSC. Change-Id: I935ab48e7c5bac5f88ecdb3a05f73fb44fc9f41d
* | Add some test cases for "server list" commandting.wang2016-02-242-27/+78
|/ | | | | | | | Add some test cases that test 'server list' command when specifying flavor or image. Because I add some attribution to fake.py, I have to change some code in create server test. Despite all this, I think it's good for testing. Change-Id: I714deac1f6f940b790a3c20af5f7ffa724ac44d1
* Merge "Add unit tests for 'hypervisor stats' command"Jenkins2016-02-232-0/+140
|\
| * Add unit tests for 'hypervisor stats' commandting.wang2016-02-222-0/+140
| | | | | | | | | | | | | | 'hypervisor stats show' command isn't covered by unit tests, so add unit tests to test it. Change-Id: Ic355230cbdd596e848191b599803dca7f27c2ffb
* | Initialize _keys in __init__() in FakeFlavorResourceTang Chen2016-02-231-2/+5
|/ | | | | | | | | | | _keys is defined as a class attribute in FakeFlavorResource. So when we call set_keys() to update it, it changes. And this change may bring trouble to the other tests afterward. So define and initialize it in __init__() as an object attribute. Change-Id: Ib18c03877b67e1b7c2e107f598076b928a58e4fb Closes-bug: #1548378
* Add unit test for "flavor show" commandTang Chen2016-02-202-10/+89
| | | | Change-Id: I1591649e5b97a885707042fcccad3335ee8c7aec
* Merge "Support "network show" command in nova network"Jenkins2016-02-181-2/+31
|\
| * Support "network show" command in nova networkTang Chen2016-02-171-2/+31
| | | | | | | | | | | | | | | | "network show" command is not implemented in nova network. This patch implements it. Change-Id: I1fadd890fe36c4e3ac5c9ed389b20c5b2fff8aca partial-Bug: 1543672
* | Merge "Support "network list" command in nova network"Jenkins2016-02-181-0/+58
|\ \ | |/
| * Support "network list" command in nova networkTang Chen2016-02-171-0/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "network list" command is not implemented in nova network. This patch implements it. The Network object in novaclient is quite different from the one in sdk. And the output of "network list" using Nova network is also quite different from using Neutron. It is like this: # openstack network list +--------------------------------------+---------+-------------+ | ID | Name | Subnet | +--------------------------------------+---------+-------------+ | 96a98ec4-31f6-45f6-99e6-9384569b3bb5 | private | 10.0.0.0/24 | +--------------------------------------+---------+-------------+ --long and --external options have not been implemented because the attrs in Network object in novaclient is too much different. This patch also introduces a new FakeNetwork class in compute/v2/fake.py to fake nova network. Change-Id: Id1fdf81fb2fa8b39f2c76b7bae37ac4fecafd0f7 Depends-On: I1b59264cd40aaf1062f4e8db233ccb7fd0e95f0e partial-Bug: 1543672
* | Merge "Refactor security group rule delete to use SDK"Jenkins2016-02-181-0/+62
|\ \ | |/ |/|
| * Refactor security group rule delete to use SDKRichard Theis2016-02-101-0/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactored the 'os security group rule delete' command to use the SDK when neutron is enabled, but continue to use the nova client when nova network is enabled. This patch set also introduces new FakeSecurityGroupRule classes for testing network and compute security group rules. And fixes were made to the network FakeSecurityGroup class. Change-Id: I8d0917925aa464e8255defae95a2a2adfb6cfb75 Partial-Bug: #1519512 Related-to: blueprint neutron-client
* | Define FakeFloatingIP class in tests/compute for nova network commandsTang Chen2016-02-161-0/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "ip floating list" command is not available for Neutron now because the implementation is incorrect. The FloatingIP objects returned from Nova and Neutron network are quite different. So they need different FakeFloatingIP class to do the tests. This patch copies class FakeFloatingIP in tests/network to tests/compute for Nova network tests. Will fix the problem in "ip floating list" command and change FakeFloatingIP in tests/network to fit Neutron network tests. Change-Id: Ia29d257868e0f1dc6cd7cfe3819875e5913f76ec Partial-Bug: 1519502 Partially implements: blueprint neutron-client
* | Merge "Use assertRaises() to check if an exception is raised"Jenkins2016-02-151-5/+4
|\ \
| * | Use assertRaises() to check if an exception is raisedTang Chen2016-02-141-5/+4
| | | | | | | | | | | | | | | | | | | | | In some test cases, try/except is used to check if an exception has been raised. We should use assertRaises() instead. Change-Id: I15c8e757dcab77fd6f895feb018184e1eb7e617b