summaryrefslogtreecommitdiff
path: root/openstackclient/tests/compute
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Fix errors for "host set" command"Jenkins2016-06-232-8/+7
|\
| * Fix errors for "host set" commandHuanxuan Ao2016-06-222-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "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
* | Merge "Refactor unit test of "compute service list" command"Jenkins2016-06-232-7/+40
|\ \
| * | Refactor unit test of "compute service list" commandHuanxuan Ao2016-06-222-7/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge "Make set/unset commands in compute/image/common return normally when ↵Jenkins2016-06-221-4/+11
|\ \ \ | |/ / |/| | | | | nothing specified"
| * | Make set/unset commands in compute/image/common return normally when nothing ↵Tang Chen2016-06-211-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | specified After this patch, all set/unset commands will return normally when nothing specified. Change-Id: Id94d0329faa1a674006a9aae901f834b41917317 Close-bug: #1588588
* | | Merge "Support bulk deletion for "flavor/aggregate delete""Jenkins2016-06-223-21/+140
|\ \ \
| * | | Support bulk deletion for "flavor/aggregate delete"Huanxuan Ao2016-06-213-21/+140
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | 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
* | | Add "--project" option to the "flavor create" command.Huanxuan Ao2016-06-211-1/+27
| |/ |/| | | | | | | | | | | | | Add ``--project`` and ``--project-domain`` options to the ``flavor create`` command. We can use these options to add the flavor access to a givin project when we create the flavor. Change-Id: Ic1907272c1d1ae526f9c9e86f32ba06c6da147c0
* | Merge "Standardize logger usage"Jenkins2016-06-201-9/+6
|\ \
| * | Standardize logger usageTang Chen2016-06-201-9/+6
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use file logger for all command specific logs. This patch also fixes some usage that doesn't follow rules in: http://docs.openstack.org/developer/oslo.i18n/guidelines.html After this patch, all self.log and self.app.log will be standardized to LOG(). NOTE: In shell.py, we got the log in class OpenStackShell, which is also known as self.app.log in other classes. This logger is used to record non-command-specific logs. So we leave it as-is. Change-Id: I114f73ee6c7e84593d71e724bc1ad00d343c1896 Implements: blueprint log-usage
* | Merge "Fix console url show command broken in microversion case"Jenkins2016-06-201-0/+149
|\ \
| * | Fix console url show command broken in microversion caseRui Chen2016-06-161-0/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The response data of nova get_xxx_console API is changed from "console" to "remote_console" in microversion 2.6, and nova server side API schema verify the spice vnc type to "spice-html5", update OSC code to apply these change so that OSC can work in different nova microversion cases. Change-Id: I3bb4fe057e656209d00d2bb308ac3f7f837cb03f Closes-Bug: #1590318
* | | Use osc_lib in server_image.pyTang Chen2016-06-201-2/+3
| |/ |/| | | | | | | | | | | server_image.py is a newly created file. So I think we forgot to use osc_lib in it. Change-Id: Ieda13438662ea55b03f549108aac63c18b9af913
* | Merge "Modify unit tests of compute agent delete"Jenkins2016-06-171-0/+10
|\ \
| * | Modify unit tests of compute agent deletesunyajing2016-06-081-0/+10
| | | | | | | | | | | | | | | | | | add no-input test to ``compute agent delete`` unit tests. Change-Id: Iee22b75c9a9431e57cb634dc28a5efa9b43b7369
* | | 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
|\ \ \ | |/ / |/| |