summaryrefslogtreecommitdiff
path: root/openstackclient/tests/unit
Commit message (Collapse)AuthorAgeFilesLines
* [Compute]Make column content readable for both human and machineRui Chen2017-09-184-63/+84
| | | | | | | | | | | | | | | | Currently, we use utils.format_dict(), utils.format_list(), utils.format_list_of_dicts to make column value can be easy to read by human, but osc support to format the CLI output into several format, like: json, shell, csv, yaml, most of these should be understand by program and code, so keeping the column content as the original value make sense, like {u'name': u'RuiChen'} than name='RuiChen' The patch include all compute commands. Change-Id: I313a52f94895625e6045df870320840fee157759 Implements: blueprint osc-formattable-columns Partial-Bug: #1538015 Partial-Bug: #1538006
* Merge remote-tracking branch 'origin/master' into f4-merge-branchDean Troyer2017-09-1439-29/+252
|\ | | | | | | Change-Id: Ie6c321e67aa9338334e4649879e60847a5d1eb56
| * Correct import of keystoneauth1 sessionGage Hugo2017-09-121-1/+1
| | | | | | | | | | | | | | | | keystoneclient.session has been long deprecated in favor of keystoneauth1.session. This change corrects the import in the tests to use the correct library's session. Change-Id: Ic24ebde59e4b9eb70d6f14c1e0536f8d24f0de73
| * Merge "flake8-import-order: Ensure to place project imports last"Jenkins2017-08-242-3/+3
| |\
| | * flake8-import-order: Ensure to place project imports lastAkihiro Motoki2017-08-222-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | To ensure project imports are placed after third party import, we need to specify application-import-names. Previously flake8-import-check checked only standard imports or not. Change-Id: Iad7afa456cec7cf5b44955f1ea03c593a4c0e426
| * | Implied RolesHarry Rybacki2017-08-222-0/+205
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow the user to create an inference rule between two roles. The first, called the prior role is the role explicitly assigned to an individual. The second, called the implied role, is one that the user gets implicitly. For example: Role B implies Role A. User X is assigned Role B. Therefore User X also assigned Role A. The management and maintenance of the rules is performed in the Keystone server. Change-Id: If547c2f16e812bc7fffd742ec37e6a26011f3185
| * Use flake8-import-order pluginAkihiro Motoki2017-08-1737-32/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In reviews we usually check import grouping but it is boring. By using flake8-import-order plugin, we can avoid this. It enforces loose checking so it sounds good to use it. This flake8 plugin is already used in tempest. Note that flake8-import-order version is pinned to avoid unexpected breakage of pep8 job. Setup for unit tests of hacking rules is tweaked to disable flake8-import-order checks. This extension assumes an actual file exists and causes hacking rule unit tests. Change-Id: I12b596820727aeeb379bee16c2bc993dee9eb637
* | Merge "Use cliff formattable columns in volume v2 commands" into feature/osc4Jenkins2017-08-177-128/+161
|\ \
| * | Use cliff formattable columns in volume v2 commandsAkihiro Motoki2017-08-167-128/+161
| | | | | | | | | | | | | | | | | | Partial-Bug: #1687955 Partially implement blueprint osc-formattable-columns Change-Id: I8bfb95c7b1a891de00978118b80cc8d81c6729bd
* | | Merge "Use cliff formattable columns in identity commands" into feature/osc4Jenkins2017-08-176-47/+73
|\ \ \ | |/ / |/| |
| * | Use cliff formattable columns in identity commandsAkihiro Motoki2017-08-166-47/+73
| | | | | | | | | | | | | | | | | | Partial-Bug: #1687955 Partially implement blueprint osc-formattable-columns Change-Id: I3f85129460ebeb177f5fdb30995bc1dcdf28c774
* | | Use cliff formattable columns in volume v1 commandsAkihiro Motoki2017-08-165-72/+131
|/ / | | | | | | | | | | Partial-Bug: #1687955 Partially implement blueprint osc-formattable-columns Change-Id: Icd8345b7364029f35971d12d0dc90db2e4018186
* | Use cliff formattable columns in image commandsAkihiro Motoki2017-08-165-34/+37
| | | | | | | | | | | | | | | | | | Related functional tests are converted into JSON format. Otherwise, it is not easy to check results. Partial-Bug: #1687955 Partially implement blueprint osc-formattable-columns Change-Id: I682e67be24372c0de145f8db20911b13530ae6c6
* | Use cliff formattable columns in network commandsAkihiro Motoki2017-08-1610-234/+251
|/ | | | | | | | | | Use cliff formattable columns not to convert complex fields into a string when a machine readable format like JSON or YAML is requested. Partial-Bug: #1687955 Partially implement blueprint osc-formattable-columns Change-Id: If478fccd867a4bcd7c86e283c5aaf67a667cc080
* Use instance variables for subnet testsGary Kotton2017-07-261-141/+146
| | | | | | | Commit 78a832441af3928994446d2afab07f0abb0dd26a let to random failures of test_create_with_tags. This addresses that issue. Change-Id: I470da7a1863a8c22257b1c27bc6d2b1c45c9cca3
* Merge "Use *_as_ids instead *_as_list"Jenkins2017-07-261-10/+10
|\
| * Use *_as_ids instead *_as_listRodrigo Duarte Sousa2017-03-011-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The parents_as_list and subtree_as_list query parameters limit the result to only parents and subtree where the user making the call has role assignments in. Since OSC only displays the IDs, the call would be the same as the similar *_as_ids queries, the difference is that the later doesn't enforce the role assignments (making it more useful). Output example by using this patch: $ openstack project show --children root +-------------+------------------------------+ | Field | Value | +-------------+------------------------------+ | description | | | domain_id | default | | enabled | True | | id | 123 | | is_domain | False | | name | root | | parent_id | default | | subtree | {u'456': None, u'789': None} | +-------------+------------------------------+ Change-Id: Ib7b37ae8f55190a7efcc375d5be4a2823d02d1a4
* | Merge "Add optional parameter "user_id" and "type" to list credentials"Jenkins2017-07-251-1/+29
|\ \
| * | Add optional parameter "user_id" and "type" to list credentialszhanghongtao2017-07-251-1/+29
| | | | | | | | | | | | | | | | | | | | | | | | In keystone version 3.5, "type" optional attribute has been added to list credentials. This patch add "user_id" and "type" optional parameter in openstack client. Change-Id: Ia09ee7c39204fdff2dfd7b9b606d888d007caac5
* | | network tag UT: avoid using mix-in test classAkihiro Motoki2017-07-256-359/+628
|/ / | | | | | | | | | | | | | | | | | | This is a follow-up patch on https://review.openstack.org/#/c/461195/ There is a suggestion to keep test code more straight-forward and avoid using mix-in to reduce the code complexity. This commit moves all logic implemented in _test_tag.py into individual network tests. Change-Id: I0a9f8c6cd758db9035b0fd60ce4b9bfc791b6cbd
* | Network tag supportAkihiro Motoki2017-07-238-85/+526
| | | | | | | | | | | | | | | | | | | | | | | | | | Neutron tag mechanism now supports network, subnet, port, subnetpool and router. Tag support for more resources is planned. This commit introduces a common mixin class to implement tag operation and individual resource consumes it. To support tag remove, network unset command is added. Implements blueprint neutron-client-tag Change-Id: Iad59d052f46896d27d73c22d6d4bb3df889f2352
* | Add domain parameter to Identity ProviderKristi Nikolla2017-07-212-3/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Identity providers are now associated with domains. This change allows a user to specify a domain by ID or by name when creating an identity provider. [0] This also adds the column for Domain ID in listing. Updating a domain for an identity provider is not supported, so that isn't changed. [0]. Id18b8b2fe853b97631bc990df8188ed64a6e1275 Closes-Bug: 1698390 Change-Id: Icc408e2fe88f257d5863bd3df716a777d52befcc
* | Merge "Now OSC server create check keys in --nic"Jenkins2017-07-201-0/+60
|\ \
| * | Now OSC server create check keys in --nicM V P Nitesh2017-06-231-0/+60
| | | | | | | | | | | | | | | | | | | | | | | | Now OSC command to create server will check all the keys in --nic and throws an exception if the key is invalid key. Change-Id: I5482da0ae63d6d4298aa614e4d09bb0547da9ec3 Closes-Bug: #1681411
* | | Merge "Network L3 Router Commands for OSC"Jenkins2017-07-202-24/+199
|\ \ \
| * | | Network L3 Router Commands for OSCAnkur Gupta2017-07-112-24/+199
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Implements: blueprint network-l3-commands Co-Authored-By: Akihiro Motoki <amotoki@gmail.com> Change-Id: Ia24d76227e164062e89a74c1621b8acb830b26cf
* | | | Merge "Fix 'domain' filter not work well in some commands"Jenkins2017-07-202-1/+83
|\ \ \ \
| * | | | Fix 'domain' filter not work well in some commandsjiangpch2017-07-182-1/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 'domain' filter not work well in commands 'project show', 'user show' and 'user set'. Depends-On: I490900d6249f01654d4cba43bddd3e7af7928a84 Closes-Bug: #1704097 Change-Id: Ib4f47cbaba27eb56c4a41d187fee74a995e62dc7
* | | | | Merge "Fix column names for server list --no-name-lookup"Jenkins2017-07-201-11/+6
|\ \ \ \ \
| * | | | | Fix column names for server list --no-name-lookupDean Troyer2017-07-171-11/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When --long is not present change the 'Image Name' column to 'Image' and add the 'Flavor' column. These columns will contain Names unless --no-name-lookup is specified when they will contain IDs. Change-Id: I92cfb22136aee32616894e60e9227b4da185da99
* | | | | | Merge "Add server list -n and --no-name-lookup arguments"Jenkins2017-07-201-0/+50
|\ \ \ \ \ \ | |/ / / / / | | / / / / | |/ / / / |/| | | |
| * | | | Add server list -n and --no-name-lookup argumentsBoris Pavlovic2017-07-101-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove translation of Image ID and Flavor ID to Image and Flavor names In large environments amount of images can be very large (thousands) Which requires ~hundreds of requests to Glance to get all images (by default client request only 20 images) As a result listing even few servers is going to take minutes This patch allows to avoid these queries by not doing translation, which allows one to get information about servers in seconds. Change-Id: I4ae00e6324a41c4c79bf5b620179dae99aea5431
* | | | | Merge "Add 'data_plane_status' option to Port classes"Jenkins2017-07-132-0/+60
|\ \ \ \ \
| * | | | | Add 'data_plane_status' option to Port classesCarlos Goncalves2017-07-122-0/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds 'data_plane_status' option to SetPort and UnsetPort classes. Closes-Bug: #1684989 Change-Id: I26e23b551afb8c37e6babdea1655efb7c5c6873b
* | | | | | image-list should support filters 'name','status'nidhimittalhada2017-07-121-0/+28
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | nova api support parameters like 'name', 'server', 'status', etc in image-list(). So openstackclient should support this too. DocImpact Closes-Bug: #1698742 Change-Id: Ice66b409f989e6785aa3b2d42f2fdbf6e23fa0aa
* | | | | Fix unit test failures related to new os-client-config and osc-libAkihiro Motoki2017-07-122-18/+16
| |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [breakage related to os-client-config 1.28.0] os-client-config 1.28.0 add a check if filebased and envvars are both used. This check causes OSC unit test failure. OSC now instantiates OpenStackConfig twice as a workaround. The unit test mocks _load_config_file() and it returns a config dict, but os-client-config OpenStackConfig.__init__ updates the dict returned. As a result, when OpenStackConfig is instantiated second time, the mock of _load_config_file returns a modified version of the config dict. This hits the new check in os-client-config 1.28.0. This commit changes the mock to use side_effect rather than return_value to ensure the original dict is used. [breakage related to osc-lib 1.7.0] The change in osc-lib 1.7.0 added "if" logic to avoid calling get() twice. In tests.unit.volume.test_find_resource, kwargs is empty dict in find_resource(), so the second call to get() is NOT called now. Removing the second elements of side_effect addresses the unit failure. Co-Authored-By: Rui Chen <chenrui.momo@gmail.com> Change-Id: Ib9d14661b2755bbd6619e15c0d9023fbc9d27d70 Closes-Bug: #1703782 Closes-Bug: #1703783
* | | | Merge "Allow objects to be streamed to stdout"Jenkins2017-07-062-0/+47
|\ \ \ \
| * | | | Allow objects to be streamed to stdoutHonza Pokorny2017-07-052-0/+47
| |/ / / | | | | | | | | | | | | Change-Id: Icd8de6b2122fe77926d93da9bda08f56c3672a7a
* | | | Add new parameter "is_default" to Network QoS policy.Rodolfo Alonso Hernandez2017-07-052-3/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a set of exclusive parameters to the Network QoS policy: --default: makes this policy the default policy for the project to which the qos policy belongs. --no-default: unset the property. Closes-Bug: #1639220 Depends-On: If5ff2b00fa828f93aa089e275ddbd1ff542b79d4 Depends-On: Ibe7b7881cb190bfd5582f35b6de51a8bc21135de Change-Id: I0269b837dc29bbd8ee2089d847cadb72d800fa30
* | | | Merge "Show neutron tags in OSC network show"Jenkins2017-06-302-0/+8
|\ \ \ \ | |/ / / |/| | |
| * | | Show neutron tags in OSC network showM V P Nitesh2017-06-222-0/+8
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | Now tag information of the network is displayed when the user tries to see the network details using the command openstack network show <net-id> Change-Id: I587d2bca37b8dbef4400db3d8ace3c81d87e2db3 Closes-Bug: #1695783
* | | Merge "When creating a trust, send role_ids instead or role_names"Jenkins2017-06-221-1/+1
|\ \ \
| * | | When creating a trust, send role_ids instead or role_namesKristi Nikolla2017-06-221-1/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes create a trust to use ids instead of names because of the possibility of roles sharing a name. Even if the user uniquely identified a role by inputting the id, the request sent to the identity service would used the name, therefore the command would fail in the case that two roles share a name. This does not change how trusts are displayed during trust list or trust show, a name will still be shown instead of an id. Depends-On: I38e0ac35946ee6e53128babac3ea759a380572e0 Change-Id: I5bdf89f1e288954a7f5c2704231f270bc7d196f5 Closes-Bug: 1696111
* | | Merge "Add direction field to QoS bandwidth limit."Jenkins2017-06-222-14/+57
|\ \ \
| * | | Add direction field to QoS bandwidth limit.Rodolfo Alonso Hernandez2017-06-222-14/+57
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch enables the direction ('ingress'/'egress') field on the QoS bandwidth limit rule object and CRUD commands. Closes-Bug: #1614121 Depends-On: Ia13568879c2b6f80fb190ccafe7e19ca05b0c6a8 Depends-On: I90c412a5c8757b3ffe8abfc1165a70bdb8744702 Change-Id: Ic6981474f22efbf294ac11c2e0304b04494a1bbe
* | | Merge "Add project purge command to osc"Jenkins2017-06-221-0/+314
|\ \ \
| * | | Add project purge command to oscSteve Martinelli2017-06-131-0/+314
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | See the initial implementation: https://github.com/openstack/ospurge/blob/master/ospurge/client.py Partial-Bug: 1584596 Change-Id: I3aa86af7c85e7ca3b7f04b43e8e07125f7d956d1
* | | Merge "Don't show hint about vlan transparent in network set"Jenkins2017-06-221-3/+0
|\ \ \ | |/ / |/| |
| * | Don't show hint about vlan transparent in network setHong Hui Xiao2017-06-121-3/+0
| | | | | | | | | | | | | | | | | | | | | Update this attribute is not allowed in neutron. Change-Id: I38010b26e116246c13dbb6cc6a777d2f22f6dc30 Closes-Bug: #1691776
* | | Add default-quota to subnet pool commandsReedip2017-06-121-1/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add --default-quota option to subnet pool create and set commands. Setting default-quota back to None may break the current Neutron behavior, therefore support for Unset command is not provided in this patch. Neutron API: https://github.com/openstack/neutron/blob/a0e0e8b6686b847a4963a6aa6a3224b5768544e6/neutron/api/v2/attributes.py#L239 Closes-Bug: #1667294 Change-Id: Ia4e7c23a49e91a090133c729353cdb8e62bc5674