summaryrefslogtreecommitdiff
path: root/openstackclient/tests/compute/v2
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Merge "Move server image create command to its own resource file."Jenkins2016-06-162-144/+227
|\ \ \ | |_|/ |/| |
| * | Move server image create command to its own resource file.Dean Troyer2016-06-032-144/+227
| | | | | | | | | | | | Change-Id: If37e82072bd7a32b81bfb1a8bb048f018dd5b04f
* | | Merge "Support bulk deletion for commands that exist in both network and ↵Jenkins2016-06-151-0/+19
|\ \ \ | | | | | | | | | | | | compute."
| * | | 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
* | | | Merge "Support compute service force down/up"Jenkins2016-06-151-4/+98
|\ \ \ \ | |/ / / |/| | |
| * | | Support compute service force down/upRui Chen2016-06-141-4/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Aims to evacuate servers from compute host as soon as possible, operators might set the compute service force down manually. Novaclient support the behavior, this patch support it in OSC. Change-Id: I22ff1c5d670c449771fdcb3f4f39cd82f428531a Closes-Bug: #1589348
* | | | Fix errors in ``set/unset flavor`` unit testsTang Chen2016-06-141-9/+20
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. We should assert flavor.set_keys() is called correctly or not called in ``set flavor`` unit tests. 2. Commit c7e6973ff50ff84af9ad55f7bdaeeea83ae40f0b from me removed test_flavor_unset_no_project which used to test if --project was specified as '', and assert CommandError was raised, which is incorrect. So I removed it. But after looking into the code, I think we should not remove it, but specify nothing after --project, and assert ParserException was raised. So in this patch, we fix it as so. ('--project', '') --> ('--project') assert CommandError --> assert ParserException Change-Id: Ifd33c72d5b7581aaabffb09e9b5e38ecc67e18c0
* | | Merge "Fix errors in flavor unit tests"Jenkins2016-06-141-24/+9
|\ \ \
| * | | Fix errors in flavor unit testsTang Chen2016-06-131-24/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes the problems below: 1. flavor.unset_keys() is not checked in flavor unit tests. So check them in the tests. 2. test_flavor_unset_no_project makes no sense. It is OK to specify ``--project ''`` without raising any exception. It can pass because in the test, we set nither project nor property. So remove this test. Change-Id: I04e537349936343b6d8c85b06bc6d0ba6bd41d6f
* | | | osc-lib: utilsDean Troyer2016-06-134-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use osc-lib directly for utils. Leave openstackclient.common.utils for deprecation period. Change-Id: I5bd9579abc4e07f45219ccd0565626e6667472f7
* | | | osc-lib: exceptionsDean Troyer2016-06-137-8/+15
|/ / / | | | | | | | | | | | | | | | | | | | | | Use osc-lib directly for exceptions. Leave openstackclient.common.exceptions for deprecation period. Change-Id: Iea3e862302372e1b31ccd27f69db59b4953ca828
* | | 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 "Refactor SetService --enable/disable option"Jenkins2016-06-061-31/+26
|\ \
| * | Refactor SetService --enable/disable optionTang Chen2016-06-041-31/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch changes the following: 1. --enable/disable option should follow the rules in the doc below: http://docs.openstack.org/developer/python-openstackclient/command-options.html#boolean-options 2. "--disable-resion" is specified but not "--disable", an exception is raised instead of igoring "--disable-reason" option. Change-Id: I92e9234111e661bfe7119a8e19389a87c874ab0c
* | | Add server set/unset unit test casesRui Chen2016-06-061-0/+87
| | | | | | | | | | | | | | | | | | | | | Unit test cases don't cover compute "server set/unset" commands, the patch add some test cases for them. Change-Id: I440c32968bd41b948352a9764a37c9af3e68803d
* | | Merge "Support multiple argument for compute agent delete command"Jenkins2016-06-051-5/+56
|\ \ \ | |/ / |/| |
| * | Support multiple argument for compute agent delete commandsunyajing2016-06-031-5/+56
| | | | | | | | | | | | | | | Change-Id: I3b19e4914d475b86d7e8aa8d76e62a2ac811272f Partially-Implements: blueprint multi-argument-compute
* | | Fix wrong test in flavor unit testsTang Chen2016-06-031-5/+3
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | In test_flavor_set_no_project(), we aimed to test a situation like this: User specifies "--project" option, but didn't specifies the project name or ID. But in the source code, it becomes "--project ''". The test could past because if project and property are both None, the command will raise an exception. Change-Id: I39567306debb901e8bad420fa2492f1b207efddc
* | Add support for removing flavor-accessHuanxuan Ao2016-06-021-2/+86
|/ | | | | | | | Add "--project" and "--project-domain" options in "flavor unset" command to remove flavor access. Change-Id: Ia5c5a80d9890d5af066b75b4e202647c18c7d915 Partial-Bug: #1575461
* Merge "add unit test for compute agent command"Jenkins2016-05-312-0/+255
|\
| * add unit test for compute agent commandsunyajing2016-05-312-0/+255
| | | | | | | | Change-Id: I966d5a3a307fcd7f4efb1267aa2896efd53be50d
* | Merge "Add support for setting flavor-access"Jenkins2016-05-302-2/+100
|\ \
| * | Add support for setting flavor-accessHuanxuan Ao2016-05-302-2/+100
| |/ | | | | | | | | | | | | | | This patch adds "--project" option in "flavor set" command to support for setting flavor access. Change-Id: I75b473600080d8ab1dd6ad01561c4f989ed3c3bd Partial-Bug: #1575461
* | Merge "[compute] Add server backup function"Jenkins2016-05-301-0/+270
|\ \
| * | [compute] Add server backup functionjichenjc2016-05-271-0/+270
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add server backup function There is no return value for this command per following doc http://developer.openstack.org/api-ref-compute-v2.1.html#createBackup, also novaclient can't be updated now due to backward compatible issue http://lists.openstack.org/pipermail/openstack-dev/2016-March/089376.html, so we have to get the information ourselves. The Image tests were not using warlock images, so that needed to be fixed before we could completely test things like --wait. Change-Id: I30159518c4d3fdec89f15963bda641a0b03962d1
* | Support to set server stateRui Chen2016-05-281-0/+61
|/ | | | | | | | | | When a server is unexpected state, OSC don't support reset the server to active or error state, that's supported by novaclient, and it's an important command for operators, the patch implement this function. Change-Id: I3e7800feb192832b0719ef9a353945beb6bfd509 Implements: blueprint server-reset-state
* Refactor service unit testsTang Chen2016-05-252-73/+101
| | | | | | | 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
* | Merge "Add unit tests for "server show" command"Jenkins2016-05-111-0/+95
|\ \
| * | Add unit tests for "server show" commandTang Chen2016-05-111-0/+95
| | | | | | | | | | | | Change-Id: I6eb0c4e7d5d3e677764b253e3324720a784a110b
* | | Merge "Use find_resource() instead of get() in _prep_server_detail()"Jenkins2016-05-111-7/+5
|\ \ \ | |/ / |/| |
| * | Use find_resource() instead of get() in _prep_server_detail()Tang Chen2016-05-091-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is such a comment in test_server.py: # Call .get() to retrieve all of the server information # as findall(name=blah) and REST /details are not the same # and do not return flavor and image information. This is an out of date comment. There is no function named findall() in OSC now. So use find_resource() instead of get(), and remove this comment. Change-Id: I8d79afc5f341fb5caf771d905506b7f1c7a41ae8
* | | Merge "Map server power state num to meanful string"Jenkins2016-05-092-1/+7
|\ \ \ | |/ / |/| |
| * | Map server power state num to meanful stringTang Chen2016-05-072-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge "Trivial: Remove unuseful comments for assertRaise() checking"Jenkins2016-05-071-1/+0
|\ \ \ | |/ / |/| |
| * | Trivial: Remove unuseful comments for assertRaise() checkingTang Chen2016-05-061-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | "Missing required args should bail here" is not understandable and not necessary. The code is obvious enough. And some of the comments are misused because of code copy. So remove them. Change-Id: I031395f2c882386c7a708db5cf4eee75393dc639
* | | Merge "Make "flavor show" command to show a private flavor properly"Jenkins2016-05-061-13/+9
|\ \ \ | |/ / |/| |
| * | Make "flavor show" command to show a private flavor properlyHuanxuan Ao2016-05-021-13/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "flavor show" command could not show a private flavor by flavor name becauce it could not find a private flavor by flavor name. In "until.find_resource(parsed_args.flavor)", If parsed_args.falvor is a name of a flavor, "flavors.find(name=parsed_args.flavor)"will be called to find a flavor.But the default value of "is_public" is "Ture" in "flavors.find()" so that we can only find public flavors.If we want to find all flaovrs by flavor name,we should add "is_public=None" in "flavors.find()". So I tried to change "until.find_resource(parsed_args.flavor)" to "until.find_resource(parsed_args.flavor, is_public=None)", but then I could not find any flavor by flavor id because "is_public" is an unexpected argument of "flavors.get()" in "until.find_resource()". In this case,I think "until.find_resource()" can not find a private flavor properly,and we should combine "manager.get(flavor.id)" and "manager.find(name=flavor.name, is_public=None)" by ourselve to find a flavor. Also,this bug affects other flavor commands like "flavor set/unset/delete",so I fix them in this patch too. Change-Id: I4a4ed7b0a2f522ee04d1c3270afcda7064285c39 Closes-Bug: #1575478
* | | Add a unit test for "flavor create" commandHuanxuan Ao2016-05-042-2/+162
|/ / | | | | | | | | | | | | There was not a unit test for "flavor create" command in the "test_flavor.py".So I add the unit test. Change-Id: Ib1e821ea524eb33c0ba73643164228c7b83253b4
* | Fix error in flavor set/unset commandHuanxuan Ao2016-04-281-4/+8
| | | | | | | | | | | | | | | | | | | | In the "flavor set/unset" command,the "flavor" parameter can be a name but can not be a id of a flavor. I think we should find a flavor by using "utils.find_resource()" in these commands. Change-Id: I5836788f7ed18813f1ebde31bb808b7c3f932b80 Closes-Bug: #1575624
* | Merge "Add "server group show" command"Jenkins2016-04-201-0/+23
|\ \
| * | Add "server group show" commandRui Chen2016-04-201-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | Support compute v2 "server group show" command in OSC. Implements: blueprint nova-server-group-support Closes-Bug: #1542171 Change-Id: I1a6d103151c704bda5b67cb9a49cc43c7d9f1d6a
* | | 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 list" commandRui Chen2016-04-201-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | Support compute v2 "server group list" command in OSC. Implements: blueprint nova-server-group-support Partial-Bug: #1542171 Change-Id: I68b80e3c4458692472af671028cd1f939736bcb8
* | | Add "server group delete" commandRui Chen2016-04-201-0/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support compute v2 "server group delete" command in OSC. Implements: blueprint nova-server-group-support Partial-Bug: #1542171 Related-Bug: #1563301 Change-Id: I7d792d669b147b24dc774844cfc9dbacd60d017b
* | | Add "server group create" commandRui Chen2016-04-202-0/+142
|/ / | | | | | | | | | | | | | | | | 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