summaryrefslogtreecommitdiff
path: root/openstackclient/tests/compute/v2/fakes.py
Commit message (Collapse)AuthorAgeFilesLines
...
| * Add unit tests for 'hypervisor stats' commandting.wang2016-02-221-0/+61
| | | | | | | | | | | | | | '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-201-0/+12
| | | | 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
* | Support "network delete" command in nova networkTang Chen2016-02-141-0/+4
| | | | | | | | | | | | | | | | | | "network delete" command is not implemented in nova network. This patch implements it. Change-Id: I5dac1eed6eb8e67298bb446418835a6ab85c859c Depends-On: I1b59264cd40aaf1062f4e8db233ccb7fd0e95f0e partial-Bug: 1543672
* | Floating IP: Neutron support for "ip floating delete" commandJude Job2016-02-141-0/+3
|/ | | | | | | | | | This patch implements "ip floating delete" command for both compute and network. Also includes unit tests. Change-Id: Ie61f0faad65ec90f9d9956ae463412be8d963d05 partial-Bug: 1519502 Related-to: blueprint neutron-client Co-Authored-By: Tang Chen <chen.tang@easystack.cn>
* Merge "Add unit tests for "hypervisor show" command"Jenkins2016-02-081-0/+26
|\
| * Add unit tests for "hypervisor show" commandTang Chen2016-02-071-0/+26
| | | | | | | | Change-Id: Ib75e5eb5b197e9d58fb87a595a43b8774b7b1987
* | Define security_group_rules mock in FakeComputev2ClientTang Chen2016-02-061-0/+3
| | | | | | | | | | | | | | security_group_rules mock should be defined in FakeComputev2Client, and used in each test class. Change-Id: I44bb6379b2c1b6cb277296e08e25dd4d7255c276
* | Move security_groups mock definition to FakeComputev2ClientTang Chen2016-02-061-0/+14
|/ | | | | | All compute client related mocks should be defined in FakeComputev2Client. Change-Id: Ie75385af772ca23286c4cf131d3d54cc14f20a30
* Add unit tests for "hypervisor list" commandTang Chen2016-02-051-0/+45
| | | | | | | | | | | There is no unit tests for "hypervisor" command. This patch introudces a new class FakeHypervisor to fake one or more hypervisors, and a base class TestHypervisor. Also adds hypervisors mock to fake compute client. And also, this patch adds unit tests for "hypervisor list" command. Change-Id: I18733eae1a8f4fff72e830d9a060fb8f0f58fbf5
* Refactor "os availability zone list"Richard Theis2016-01-141-0/+62
| | | | | | | | | | | | Refactor the "os availability zone list" command to make it a common command instead of a compute-only command. Since availability zones are common to compute, volume and network (new), this refactoring allows availability zone support to be added for volume and network. In addition to the refactor, unit and functional tests were added. Change-Id: I63e9d41d229b21cd38e5a083493042c096d65e05 Partial-Bug: #1532945
* Use FakeVolume in server test cases.Tang Chen2015-12-081-2/+0
| | | | | | | | 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
* Merge "Add project name/ID validation for "openstack quota show""Jenkins2015-12-011-0/+2
|\
| * Add project name/ID validation for "openstack quota show"xiexs2015-11-291-0/+2
| | | | | | | | | | | | | | A validation is necessary to check the existence of project. This patch is similar to Ia2d8c96527820e25b074e6486d3f39c5ad7eae60. Change-Id: Id8895ba7a21ecad05942619a82a87c0dc68eae53
* | Add testcases for compute.v2.servicexiexs2015-12-011-2/+9
|/ | | | | | | | | 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
* Remove old fake flavor data.Tang Chen2015-11-281-12/+0
| | | | | | | | 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
* Introduce class FakeFlavor to fake one or more flavors.Tang Chen2015-11-281-0/+64
| | | | | Change-Id: I1b20e7d50e478ce8114ca08aa455b7acad4ea7f5 Implements: blueprint improve-flavor-unit-test
* Refactor: Move FakeFlavorResource to compute_fakes.py.Tang Chen2015-11-281-0/+21
| | | | | | | Just like FakeServer and FakeResource, FakeFlavorResource should be in compute_fakes.py. Change-Id: I8315256fb90377605fa2190e24c9674f6aaf6efd Implements: blueprint improve-flavor-unit-test
* Move FakeServer to tests.common.v2.compute.fakeslin-hua-cheng2015-11-251-0/+70
| | | | | | | FakeServer should not be in tests.fakes since this should be just for generic re-usable classes. Change-Id: I19209952de69626dfa3caadc5d1cc69b7feadeba
* Merge "Remove the old fake server data."Jenkins2015-11-251-9/+0
|\
| * Remove the old fake server data.Tang Chen2015-11-211-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The old fake server framework has be replaced with the new class FakeServer, which is stronger in: 1. faking multiple servers with random names and ids 2. faking methods in a server 3. easier to use So remove the old fake server data, and use class FakeServer from now on. Change-Id: Ife8ee37a7ce14d9a3201104bce8075a918a97613 Implements: blueprint osc-unit-test-framework-improvement
* | Unable to set some compute quotasRichard Theis2015-11-201-0/+16
|/ | | | | | | | | | | | | | | | | | | | | | The OpenStackClient mapping of 'openstack quota set' arguments isn't correct for compute quota items that have to different names. For example, the --injected-file-size argument is mapped to injected_file_size, but the compute quotas item is actually injected_file_content_bytes. This incorrect mapping prevented the impacted compute quota items from being set. The problem impacts the following 'openstack quota set' arguments: --injected-file-size --injected-path-size --properties --secgroup-rules --secgroups This patch set also expands the compute quota unit tests to verify all compute quota items that can be set. Change-Id: I0a2f241e425f4811e4ae55be183ac0c8b0805c2a Closes-Bug: #1475831
* Split the vol_id from a dev mappingxiexs2015-11-111-0/+10
| | | | | | | Add a split into the dev mapping to get the right vol_id. Change-Id: I1a7bf6351491b1321c5ca0fa4a27f29825400eaf Closes-Bug: #1514394
* Add compute service deleteAlex Schultz2015-10-161-0/+4
| | | | | | | | This change adds 'compute service delete <service>' to the openstack client. This is the equivalent of 'nova service-delete <id>' Change-Id: I69ef1cac72cbe125c2114f8e958e22350a70f367 Closes-Bug: #1503510
* Fix quota set failed problemjiaxi2015-07-281-0/+18
| | | | | | | | | | | | | | | | When using the command: openstack quota set, the compute quota below can't be set successfully,the value of compute quota stay unchanged, 'fixed-ips', 'floating-ips', 'injected-files', 'key-pairs'. What's more,I add a TODO comment in the code for two reason. 1. volume quota set works fine for the moment. 2. To indicate that this issue about volume needs discuss and report another bug, if it's confirmed. This bug is only about compute quota. Change-Id: Ic1028d561f5a0030cf65ac18fc117bf01e945478 Partial-Bug: #1420104
* Fix security group create description bugDean Troyer2015-04-221-0/+6
| | | | | | | | --description is optional in our CLI but the server requires it to be non-empty. Set a default value of the given name. Closes-Bug: #1434172 Change-Id: I81507a77ad8d815000ff411784ae71e229c77f78
* Add 'find by name' to --nic for creating serverzhiyuan_cai2015-01-271-0/+6
| | | | | | | Add 'find by name' feature to --nic option for creating server. Closes-Bug: #1353040 Change-Id: Idd0a30415d8360a57e33efedf2467593652683d4
* Close files on server create, add testsDean Troyer2014-10-141-0/+1
| | | | | | | | | | The files opened for the --files and --user-data options were never closed, potentially leaking memory in a long-running client. Close them if they are file objects. Add a couple of basic tests for server create. Change-Id: I1658b0caa2d6af17308149cb52196ee28266ddf2
* Fix server resizeDean Troyer2014-07-081-0/+14
| | | | | | | | So apparently we've never resized a server??? Fixed command args and add some tests. Change-Id: I6c3f6fec22390e9d269b7117a42a190d2b4b80ba
* Add support for extension listMatt Fischer2014-06-111-0/+21
| | | | | | | | | | | | - Add support in the common section for extension list. This only supports Identity for now. Once the APIs for volume and compute are supported in the respective APIs, they will be added. Once network is added to this client, it will be added (the API already supports it). - Include extension fakes for volume and compute for pre-enablement. Change-Id: Iebb0156a779887d2ab06488a2a27b70b56369376 Closes-Bug: #1319115
* Add server image create commandDean Troyer2013-11-181-7/+6
| | | | | | Translation of 'nova image-create', with tests! Change-Id: I8a833aeff6f291e4774063ed235876eb2ba9c13c
* Complete basic test infrastructureDean Troyer2013-11-181-0/+55
This finally gets all of the API tests into a common framework regarding test classes and so forth. Change-Id: If675347129c50dcba0bfc5b6c58f5a2ca57ff46c