summaryrefslogtreecommitdiff
path: root/openstackclient/tests/test_shell.py
Commit message (Collapse)AuthorAgeFilesLines
* osc-lib: shellDean Troyer2016-08-051-485/+103
| | | | | | | | | | | | | Convert to using ClientManager and OpenStackShell from osc-lib. * Change all internal uses of ClientManager private attributes that are now public in osc-lib's ClientManager. Leave back-compat copies in place in OSC's clientManager so we don't break plugins. * Put some work-arounds in place for changes in osc-lib that we need until a new release makes it through the g-r and u-c change process. * Add a test for Unicode decoding of argv in shell.main() to parallel the one in osc-lib. Change-Id: I85289740d4ca081f2aca8c9b40ec422ad25d302c
* Fix foundation copyrightsDean Troyer2016-06-141-1/+1
| | | | | | | | The OpenStack LLC copyrights date from before OpenStack was transferred to the foundation. These appear to be getting copy-pasted to new files so at least should reflect the correct entity. Change-Id: I02953d752cb24ead6aa4ad8bfe257a48317c9f13
* Rename --profile to --os-profileDean Troyer2016-04-191-1/+1
| | | | | | | | | * The --profile global option is deprecated but will be supported through at least April 2017. * Update man page Closes-bug: #1571812 Change-Id: I2e623411a56096b4cc352f4eedbf770632ae2cc3
* Merge "Support client certificate/key"Jenkins2016-04-061-0/+23
|\
| * Support client certificate/keyCedric Brandily2016-04-061-0/+23
| | | | | | | | | | | | | | | | | | | | This change enables to specify a client certificate/key with: * usual CLI options (--os-cert/--os-key) * usual environment variables ($OS_CERT/$OS_KEY) * os-client-config Change-Id: Ibeaaa5897ae37b37c1e91f3e47076e4e8e4a8ded Closes-Bug: #1565112
* | Use fixtures and addCleanup instead of tearDownCedric Brandily2016-04-051-34/+25
|/ | | | | | | | | | Nothing ensures tearDown call as tearDown is called only if test succeeds. This change replaces tearDown use with: * addCleanup use to stop mocks * EnvFixture which ensures to unmock environment thanks to useFixture. Change-Id: I1ff422e6a7585bc48b04b8f5c4cc1e7e9ddab1bc
* Merge "Add shell --profile option to trigger osprofiler from CLI"Jenkins2016-02-261-0/+1
|\
| * Add shell --profile option to trigger osprofiler from CLIDina Belova2016-02-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will allow to trigger profiling of various services that allow it currently and which APIs support is added to openstackclient. Cinder and Glance have osprofiler support already, Nova and Keystone are in progress. To use this functionality osprofiler (and its storage backend) needs to be installed in the environment. If so, you will be able to trigger profiling via the following command, for example: $ openstack --profile SECRET_KEY user list At the end of output there will be message with <trace_id>, and to plot nice HTML graphs the following command should be used: $ osprofiler trace show <trace_id> --html --out result.html Related Keystone change: https://review.openstack.org/#/c/103368/ Related Nova change: https://review.openstack.org/#/c/254703/ The similar change to the keystoneclient (https://review.openstack.org/#/c/255308/) was abandoned as new CLI extenstions are not more accepted to python-keystoneclient. Change-Id: I3d6ac613e5da70619d0a4781e5d066fde073b407
* | Fixed a bunch of spacingBrandon Palm2016-02-231-0/+7
| | | | | | | | | | | | | | Nothing too complicated here. I fixed a bunch of spacing issues that I saw in OSC. Change-Id: I935ab48e7c5bac5f88ecdb3a05f73fb44fc9f41d
* | Use instanceof instead of typeBrandon Palm2016-02-221-2/+2
|/ | | | | | | | | Adjusted conditional statements to use instanceof when comparing variables. Instanceof supports inheritance type checking better than type. Change-Id: I4ee0004934dc2322d43ef07e797a6811e39a812c Closes-Bug: 1548530
* Add all regions to cloud configurationRichard Theis2015-12-231-1/+1
| | | | | | | | | OCC now requires all regions to be listed in the cloud configuration. Update the shell unit tests to list all of the regions being tested. Change-Id: Ic7300d1f708339701b5daadbf2c4769b239a2adb Closes-Bug: #1528926
* Merge "Create log configuration class"Jenkins2015-09-091-90/+4
|\
| * Create log configuration classTerryHowe2015-08-261-90/+4
| | | | | | | | | | | | | | | | | | | | | | | | Configuration of logging gets triggered twice. The first time it uses the CLI options when the application is started and second it uses the configuration file after that is read. The state of the logging needs to be saved from the first to the second time, so I created a class. Implements: blueprint logging-migration Change-Id: I7b8d1a3b6fd128e98cafd7c16009c7b694a52146
* | Merge "Set up every time record log in file"Jenkins2015-09-081-4/+92
|\ \ | |/
| * Set up every time record log in fileDaisuke Fujita2015-08-081-4/+92
| | | | | | | | | | | | | | | | | | This will allow users to record logs of all their commands into a predefined log file, in clouds.yaml. The log should have a format similar to that of oslo.log. Change-Id: I1b334bf429d575fc25809c9706fc0b11116be3f1 Implements: blueprint every-time-record-log-in-file
* | Do not set default versions in parsed argsTerryHowe2015-07-181-12/+14
|/ | | | | | | | | | | Setting default versions in parsed args makes it so OCC cannot tell if the argument was parsed, an environment variable was set or it is just defaulted. In order to set api versions from OCC, it will have to be defaulted after processing OCC. Closes-Bug: #1453229 Change-Id: I4d065919397b783f3bdd4022c986c0234a7a16e6
* Merge "Rename endpoint type to interface"Jenkins2015-07-171-5/+5
|\
| * Rename endpoint type to interfaceTerryHowe2015-07-151-5/+5
| | | | | | | | | | Change-Id: I4e21d09bc747e8210f4f79a1d6c4c7ccf2f25d1c Closes-Bug: #1454392
* | temporarily skip help testsSteve Martinelli2015-07-131-0/+2
|/ | | | | | | | | | | | We're trying to change cliff for the better, by improving the UX of the help command. But cliff tests against the tip of OSC. Temporarily skip the tests that are failing and then update them once the fix for cliff has been merged. The patch in question: https://review.openstack.org/#/c/201258/ Change-Id: Ie1e7ddd66477ddf4a3bafedad12934e900ace48f
* Add --os-endpoint-type cli optional argumentRoxana Gherle2015-07-021-0/+8
| | | | | | | | | | | | User should be able to specify the endpoint type through a CLI optional argument/ENV variable setting. We will name this new optional argument: --os-endpoint-type (Env: OS_ENDPOINT_TYPE) and based on the value given, the service API will use that specific endpoint type. Possible values: public, admin, internal. DocImpact Closes-Bug: #1454392 Change-Id: Ife3d4e46b44c0ddcd712b1130e27e362545a9a29
* Allow --insecure to override --os-cacertDean Troyer2015-06-041-4/+5
| | | | | | | | | | | | | Change --insecure to ignore the --os-cacert setting. This is a change from before where OSC followed the requests pattern of cacert taking priority. This logic is also introduced in os-client-config 1.3.0; we do not require that release yet so it is duplicated here for now. That change will come with the upcoming global options refactor. Closes-Bug: #1447784 Change-Id: Iaa6d499ed0929c00a56dcd92a2017487c702774a
* Rework shell testsDean Troyer2015-06-021-212/+175
| | | | | | | | | | | This is the first step in reworking the shell argument handling, clean up and add tests to ensure functionality doesn't change. * Rework shell tests to break down global options and auth options. * Make tests table-driven * Remove 'os_' from 'cacert' and 'default_domain' internal option names Change-Id: Icf69c7e84f3f44b366fe64b6bbf4e3fe958eb302
* Add cli tests for --verify and friendsDean Troyer2015-05-281-1/+53
| | | | | | | | | | The tests that will change after the verify-always-true bug is fixed are currently commented out. The commented asserts show where we want to go. Also fixes --verify parser value Change-Id: I891e3ead5fc3da3ed2ecba5d2befd9e910778655
* Fix shell testsTerryHowe2015-05-281-9/+9
| | | | | | | | Personally, I think these tests should be removed, they are testing OCC. An internal OCC change on a private method broke this test. Change-Id: I760bf90ef8bd97e30be7838874337be695d45285
* Add os-client-config cli testsDean Troyer2015-05-011-1/+255
| | | | | | | Add tests for --os-cloud handling and precedence between CLI, env vars and clouds.yaml. Change-Id: I91d96f483d395f19ffcf74ec0187718ba01a1c41
* Add --os-cloud supportDean Troyer2015-04-181-221/+206
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a new option --os-cloud that allows the configuration values for multiple clouds to be stored in a local file and selected with a single option. Internal option names have had 'os_' removed to be comptible with the options returned from OpenStackConfig().get_one_cloud(). The config file is ~/.config/openstack/clouds.yaml: Sample ------ clouds: devstack: auth: auth_url: http://192.168.122.10:35357/ project_name: demo username: demo password: 0penstack region_name: RegionOne devstack: auth: auth_url: http://192.168.122.10:35357/ project_name: demo username: demo password: 0penstack region_name: RegionOne Co-Authored-By: Monty Taylor <mordred@inaugust.com> Change-Id: I4939acf8067e44ffe06a2e26fc28f1adf8985b7d Depends-On: I45e2550af58aee616ca168d20a557077beeab007
* fix the wrong order of assertEqual argswanghong2015-01-271-43/+43
| | | | | | Let's fix them thoroughly. Change-Id: I8a1f042fb614b05c9836a49041f3883638b870b0
* Liberalize version matching a bitDean Troyer2014-11-161-3/+3
| | | | | | | | | | | | | | | | | For class-loading purposes we can just use the major version, so accept that. Only Identity and Compute were affected; Compute is included just to be pedantically complete. For command groups we also just use the major version so fix Compute and the version option handling. Change the internal default for Identity to a simple '2' so it is also consistent with the rest of the world. Then comes microversioning... Closes-Bug: #1292638 Change-Id: Ibaf823b31caa288a83de38d2c258860b128b87d8
* Change --os-auth-plugin to --os-auth-typeDean Troyer2014-10-231-18/+18
| | | | | | | | | | | | | | | | | | | | User's don't know what a plugin is. * Internally, os_auth_type and/or auth_type represents what the user supplied. * auth_plugin_name is the name of the selected plugin * auth_plugin is the actual plugin object Plugin selection process: * if --os-auth-type is supplied: * if it matches against an available plugin, done * (if it can map to an availble plugin type, done; TODO in a followup) * if --os-auth-type is not supplied: * if --os-url and --os-token are supplied, select 'token_endpoint' * if --os-username supplied, select identity_api_version + 'password' * if --os-token supplied, select identity_api_version + 'token' Change-Id: Ice4535214e311ebf924087cf77f6d84d76f5f3ee
* Support for keystone auth pluginsMatthieu Huin2014-10-091-43/+43
| | | | | | | | | | | | | | | | | | | | | | | This patch allows the user to choose which authentication plugin to use with the CLI. The arguments needed by the auth plugins are automatically added to the argument parser. Some examples with the currently available authentication plugins:: OS_USERNAME=admin OS_PROJECT_NAME=admin OS_AUTH_URL=http://keystone:5000/v2.0 \ OS_PASSWORD=admin openstack user list OS_USERNAME=admin OS_PROJECT_DOMAIN_NAME=default OS_USER_DOMAIN_NAME=default \ OS_PROJECT_NAME=admin OS_AUTH_URL=http://keystone:5000/v3 OS_PASSWORD=admin \ OS_IDENTITY_API_VERSION=3 OS_AUTH_PLUGIN=v3password openstack project list OS_TOKEN=1234 OS_URL=http://service_url:35357/v2.0 \ OS_IDENTITY_API_VERSION=2.0 openstack user list The --os-auth-plugin option can be omitted; if so the CLI will attempt to guess which plugin to use from the other options. Change-Id: I330c20ddb8d96b3a4287c68b57c36c4a0f869669 Co-Authored-By: Florent Flament <florent.flament-ext@cloudwatt.com>
* Move network stuff to v2 instead of v2_0Terry Howe2014-07-071-2/+2
| | | | | | Rename network stuff v2 Change-Id: Ia9b8feda20dfd35b0f3712b8e2419d0bf5da0acd
* trust authenticationMatthieu Huin2014-07-031-14/+49
| | | | | | | | | This patch enables authenticating by using a trust. The trust ID must be set with the parameter --os-trust-id or the env variable OS_TRUST_ID. Trusts are available for the identity v3 API. Co-Authored-By: Florent Flament <florent.flament@cloudwatt.com> Change-Id: Iacc389b203bbadda53ca31a7f5a9b8b6e1a1f522
* Network CRUDTerry Howe2014-06-241-2/+9
| | | | | | | bp/neutron https://wiki.openstack.org/wiki/OpenStackClient/Commands#Network_2 Change-Id: I89ee083154afa544b03587e84becace36d9d522a
* Add support for specifying custom domainsPaul Belanger2014-01-071-4/+178
| | | | | | | | | | | | Add the ability to pass user_domain_id / user_domain_name, domain_id / domain_name, and project_domain_id / project_domain_name to keystone. These parameters are the first step needed to getting multi-domain support working via the CLI. Closes-Bug: #1198171 Change-Id: I81a8534913978ff1cce01ec02741ae477e8c5fa4 Signed-off-by: Paul Belanger <paul.belanger@polybeacon.com> Signed-off-by: Bo Tang <btang@cs.utsa.edu>
* Remove tenant round 1 - global optionsDean Troyer2013-07-311-22/+46
| | | | | | | | | Change the global auth options to use 'project', leave the original tenant options in place but silent for compatability with the existing project CLI auth options. This is the only compatibility for tenant usage in this changeover. Change-Id: I3cce6e552f18822cc9f445ec5f301b0f5d9003f8
* Complete Image v1Dean Troyer2013-07-181-1/+1
| | | | | | | | | * Add v1 versions of image delete, list, save, set, show * Change default Image API to v1 Rebased for https://review.openstack.org/#/c/36772/ Change-Id: Ie2bfe660aac8a0fcf651c67fd1ea4842e76ce377
* Move tests into project package.Monty Taylor2013-06-301-0/+293
There are several reasons for this. One is that the majority of OpenStack packages behave this way. The second is that it makes writing software that extends something easier to test (which is a clear usecase for openstackclient) And third, tests/__init__.py implies a global package named "tests" - which I'm pretty sure we're not providing. Change-Id: Ic708ffd92aea78c2ffc1a8579af0587af4fca4ff