summaryrefslogtreecommitdiff
path: root/openstackclient/tests/compute/v2/fakes.py
Commit message (Collapse)AuthorAgeFilesLines
* move unit tests to new "unit" test moduleSteve Martinelli2016-09-081-1249/+0
| | | | | | | | this will better isolate the unit tests from the functional tests. unfortunately, the "integration" tests had to be lumped into the "unit" tests since we need the separation in testr.conf Change-Id: Ifd12198c1f90e4e3c951c73bfa1884ab300d8ded
* Allow setting quotas for server groups and server group membersElena Ezhova2016-07-271-0/+4
| | | | | | | | Adds support of --server-groups and --server-group-members options to the "quota set" command. Change-Id: I178d1e267d010be7e908adefcf3b15abdafd9da4 Closes-Bug: #1602223
* Merge "Add Support for showing flavor access list"Jenkins2016-07-221-0/+29
|\
| * Add Support for showing flavor access listHuanxuan Ao2016-07-221-0/+29
| | | | | | | | | | | | | | | | | | Add a attribute "access_project_id" for flavor object to display the access project id list by using "flavor show" command. Change-Id: I7f0c152b816e0ca2e32e47f9b5c1aa7663d33b6d Closes-Bug:#1575461
* | Merge "Add unit tests for "host list" and "host show" commands"Jenkins2016-07-211-1/+7
|\ \ | |/ |/|
| * Add unit tests for "host list" and "host show" commandsHuanxuan Ao2016-06-271-1/+7
| | | | | | | | | | | | | | Missing unit tests for "host list" and "host show" commands in computev2, this patch add them. Change-Id: Ib157920fa2267ec96d206cdf46213563a105501b
* | Add notes, modify notes in fakes docstringzheng yin2016-07-081-6/+17
| | | | | | | | | | | | | | | | Some code has no notes, then add them Some code notes are not perfect, then improve them Some code notes are incorrect, then modify them Change-Id: I43f9a8663ae138bdd494bc234c1fac00c2dd6c95
* | modify notes in the FakeHypervisorStats docstringzheng yin2016-07-071-1/+1
| | | | | | | | | | | | The arugments should be: count and current_workload Change-Id: I445d1d72d1f1b86a626bb4c9512cdb8311b2ebc9
* | Transfer "ip floating pool list" to "floating ip pool list"Tang Chen2016-07-041-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch does the following things to transfer "ip floating pool list" to "floating ip pool list": * Add a new command "floating ip pool list" to deprecate "ip floating pool list". The source code is in network/v2 dir. * Add doc for "floating ip pool list". * Add floating ip pool unit tests. Change-Id: Id410f4e4a96cf589a6e8def209574da71395b55f Implements: blueprint rework-ip-commands Partial-bug: 1555990 Co-Authored-By: Dean Troyer <dtroyer@gmail.com>
* | Merge "Add "--property" option to "flavor create" command"Jenkins2016-06-301-0/+1
|\ \
| * | Add "--property" option to "flavor create" commandHuanxuan Ao2016-06-291-0/+1
| |/ | | | | | | | | | | | | | | Add "--property" option to "flavor create" command to support adding properties to a new falvor. Change-Id: I4f06b364375d5a81584fe41122d48e9568fa712a Closes-Bug: #1596798
* | Support bulk deletion for delete commands in computev2Huanxuan Ao2016-06-271-0/+19
|/ | | | | | | | | | | Support bulk deletion and error handling for "keypair delete" and "service delete" commands in computev2. Up to now, all the delete commands in computev2 support bulk deletion. Change-Id: I6d5c960e9716188e56615514d0921618a15a88ec Partially-Implements: blueprint multi-argument-compute Partial-Bug: #1592906
* Merge "Fix errors for "host set" command"Jenkins2016-06-231-1/+0
|\
| * Fix errors for "host set" commandHuanxuan Ao2016-06-221-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "Host set" command cannot work. Because: 1.Host has no 'ID' attribute, so 'ID' attribute cannot be found in "host set" command. 2.value "True" and "Flase" are invalid in updata() method of host. 3.Some update functionalities is not supported in host API now. This patch solves the problems 1 and 2 in OSC. But the problem 3 is a API problem and can't be solved in OSC, only XenServer driver support to set enable/disable and maintenance host, it is a normal problem. After this patch the output of "host set" command is: The requested functionality is not supported. (HTTP 501) (Request-ID: req-14031fce-8c90-48a0-8492-dc8e3dd349f3) Just the same as the "host-update" command in novaclient. Change-Id: Ibe94c4d3d492d3d63355de803810edb988e1b4e9 Closes-Bug: #1594689
* | Refactor unit test of "compute service list" commandHuanxuan Ao2016-06-221-1/+5
| | | | | | | | | | | | | | | | | | | | The unit test of "compute service list" only checked the "Disabled Reason" columns and its data. It is not enough. This patch change the test to check all datas in the list. Also, this patch modify the "Id" to "ID" in this command. Change-Id: I988fd6365f2652185dd96d9417f294eba9c31cd9
* | Support bulk deletion for "flavor/aggregate delete"Huanxuan Ao2016-06-211-1/+37
|/ | | | | | | | | Support bulk deletion and error handling for "aggregate delete" and "flavor delete" commands. Change-Id: I3f6105cbeeab1c9f8cd571c63ce0e7ac3d4252b3 Partially-Implements: blueprint multi-argument-compute Partial-Bug: #1592906
* Support bulk deletion for commands that exist in both network and compute.Huanxuan Ao2016-06-151-0/+19
| | | | | | | | | | | | | | | Some delete commands in networkv2 are exist in both network and compute, They can use NetworkAndComputeDeleteclass to supprot bulk deletion and error handling and the codes are similar, so I change them all in this patch. The changed commands including: 1.floating ip delete 2.security group delete 3.security group rule delete Also, I update unit tests and docs for these commands in this patch. Change-Id: I6c94c3d10ba579ddd9b14d17673c821e3481fd8a Partially-Implements: blueprint multi-argument-network
* Update unit test test_extension with fake classHuanxuan Ao2016-06-071-20/+36
| | | | | | | Add FakeExtension class in networkv2, computev2, volumev2, identityv2_0 and update unit test test/common/test_extension.py Change-Id: I94815de7801860edb7fa91a7d146455cab946652
* Merge "add unit test for compute agent command"Jenkins2016-05-311-0/+52
|\
| * add unit test for compute agent commandsunyajing2016-05-311-0/+52
| | | | | | | | Change-Id: I966d5a3a307fcd7f4efb1267aa2896efd53be50d
* | Add support for setting flavor-accessHuanxuan Ao2016-05-301-0/+3
|/ | | | | | | | This patch adds "--project" option in "flavor set" command to support for setting flavor access. Change-Id: I75b473600080d8ab1dd6ad01561c4f989ed3c3bd Partial-Bug: #1575461
* Refactor service unit testsTang Chen2016-05-251-11/+48
| | | | | | | Add a FakeService class, and refactor service unit tests to use this class. Change-Id: I650ad83386a58205ebe42274d2bf2f508436bfa6
* Merge "Enhance exception handling for "network delete" command"Jenkins2016-05-171-0/+19
|\
| * Enhance exception handling for "network delete" commandTang Chen2016-04-141-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch rework "network delete" command following the rules in doc/source/command-errors.rst. In "network delete" command, there are multiple REST API calls, and we should make as many of them as possible. And log error for each one, give a better error message. Also return a non-zero exit code. Change-Id: I39ae087dd7bd08d049d513abfa6c5cab2bd13b2b Partial-Bug: #1556719
* | Map server power state num to meanful stringTang Chen2016-05-071-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | In _prep_server_detail(), power_state is not formatted by _format_servers_list_power_state(). So when executing "server show" or "server create", the power state is represented by number. This patch map the numbers to meanful strings. This patch also adds power_state attribute to FakeServer, and improves unit tests for this attribute. Change-Id: I2ec674327de4e5133b8712ba6bb53fa5ce55e3f4
* | Add a unit test for "flavor create" commandHuanxuan Ao2016-05-041-2/+2
| | | | | | | | | | | | | | There was not a unit test for "flavor create" command in the "test_flavor.py".So I add the unit test. Change-Id: Ib1e821ea524eb33c0ba73643164228c7b83253b4
* | Merge "Fix mutable default arguments in tests"Jenkins2016-04-201-26/+33
|\ \
| * | Fix mutable default arguments in testsTang Chen2016-04-201-26/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Python’s default arguments are evaluated only once when the function is defined, not each time the function is called. This means that if you use a mutable default argument (like list and dict) and mutate it, you will and have mutated that object for all future calls to the function as well. More details about this wrong usage here: http://docs.python-guide.org/en/latest/writing/gotchas/#mutable-default-arguments In unit tests, most FakeXXX classes' methods take mutable arguments with default values [] or {}. We should change them to None. Change-Id: Iea833b66aa1379829511ad5c6d4432b72f3488e2 Closed-bug: #1550320
* | | Add "server group create" commandRui Chen2016-04-201-0/+34
|/ / | | | | | | | | | | | | | | | | Support compute v2 "server group create" command in OSC. Implements: blueprint nova-server-group-support Partial-Bug: #1542171 Change-Id: I96ffb07764d3adb715e048943cfee3b879c280f6
* | 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
* Trivial: Rename FakehypervisorStats to FakeHypervisorStatsTang Chen2016-04-051-2/+2
| | | | Change-Id: I138b1b8a3327947b8cd032d8d0c32d98548ce2ad
* Merge "Add "aggregate unset" to osc"Jenkins2016-03-301-0/+32
|\
| * Add "aggregate unset" to oscRui Chen2016-03-241-0/+32
| | | | | | | | | | | | | | | | 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-231-3/+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-171-0/+56
|\
| * [compute] Add set host commandjichenjc2016-02-261-0/+56
| | | | | | | | | | | | set host command is missing, add it as SetHost class. Change-Id: I7acb94150718b7150598632cbebc3d85018a0d59
* | Support "--long" option in ListServiceRui Chen2016-03-141-0/+2
| | | | | | | | | | | | | | | | Add "--long" option in ListService so that compute service disabled reason can be showed. Change-Id: I1ace8f1c4e4efe0a1a8f6710425d73eb5db9e5e1 Closes-Bug: #1556815
* | 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
* | 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
* | Trivial: Fix incorrect comments in compute fakes.pyTang Chen2016-03-081-3/+3
|/ | | | Change-Id: I18b1720af13b444527dda1ecab52e3cc8d8d9376
* Merge "[compute] Add unit test for keypair"Jenkins2016-03-041-0/+55
|\
| * [compute] Add unit test for keypairjichenjc2016-02-231-0/+55
| | | | | | | | | | | | keypair do not have unit test, this patch adds it. Change-Id: Id702ccaad239b916340bb17014d1ede0a28aaec9
* | Refactor security group list to use SDKRichard Theis2016-02-291-0/+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 "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-241-0/+6
|/ | | | | | | | 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-231-0/+61
|\