summaryrefslogtreecommitdiff
path: root/openstackclient/tests/unit/identity
Commit message (Collapse)AuthorAgeFilesLines
...
* | Support to add/remove multi users for "group add/remove user"Huanxuan Ao2017-03-212-35/+134
| | | | | | | | | | | | | | | | Similar delete commands in OSC, we can also support add/remove multi users for one specified group, this review implement it. Change-Id: I8ccf99d4ee83a18778fa3ff5c0a42bc7c6ff21fb Implements: bp support-multi-add-remove
* | Non-Admin can't list own projectsadrian-turjak2017-03-201-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to a default Keystone policy until Newtown, and the use of resource_find, non-admins are unable to list their own projects. This patch bypasses this problem while also introducing better UX for non-admins wishing to get their project list. 'openstack project list' retains the default of 'list all projects' but on a forbidden error will default instead to 'list my projects'. This way for non-admins 'list my projects' feels like the default without breaking the expected admin default. Adding the '--my-projects' option allows admins to easily list their own projects or allows non-admins to be explicit and bypass the forbidden error fallback. Change-Id: I1021276f69fbbf28e13e17c4e567d932fce7ed8b Closes-Bug: #1627555
* | Merge "Narrow expected responses for CheckUserInGroup"Jenkins2017-03-161-0/+17
|\ \
| * | Narrow expected responses for CheckUserInGroupColleen Murphy2017-03-141-0/+17
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When checking whether a given user is in a given group, keystone will return a 404 Not Found if all went well but the user was not in the group. It may also return a 403 if the user and the group are in different backends, which would also mean that the user was not in the group[1]. Any other 400 response is a client error and any 500 response is a server error to which the user should be alerted. Without this patch, openstackclient treats any exception as a valid "not found" and may end up hiding server errors. This patch reduces the caught exceptions to 403 and 404 responses and treats everything else as an error. [1] https://developer.openstack.org/api-ref/identity/v3/?expanded=check-whether-user-belongs-to-group-detail#check-whether-user-belongs-to-group Closes-bug: #1672634 Change-Id: Id3f3b2409b7cee480ee3c19b6d6c3070599ffe8f
* | Merge "Add sort support to project list"Jenkins2017-03-163-0/+90
|\ \ | |/ |/|
| * Add sort support to project listTom Jose Kalapura2017-03-083-0/+90
| | | | | | | | | | | | | | | | Add sort support to project list by sorting items in the client side. By default list will be sorted by name. Change-Id: I00011406846b4003aff075eeeb88ac18fa5e2820 Closes-Bug: #1596818
* | Merge "Modify error handling for role and group commands"Jenkins2017-02-132-0/+72
|\ \
| * | Modify error handling for role and group commandsHuanxuan Ao2017-02-092-0/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | if command failed, we usually raise exception, if command success, sometimes there is not any output (such as set, add commands) So modify the error handling for role and group commands. Change-Id: I1c0f86c04dcedd9c0d725fd73f3436be9da75ee0
* | | Fix --parents and --children options in project showRui Chen2017-02-091-28/+18
|/ / | | | | | | | | | | | | | | Options "--parents" and "--children" don't work in "project show" command, fix the issue and add related unit and functional tests. Change-Id: Id9965267a037442f1077f8e1929d0527981f643d Closes-Bug: #1499657
* | Merge "Adds domain specification for SetUser"Jenkins2017-01-261-0/+36
|\ \
| * | Adds domain specification for SetUserSamuel Pilla2017-01-251-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the ability to specify the domain context for making changes to a user with `--domain` flag. Example: $ openstack user set test_user --domain test_domain --enable Change-Id: I2b3241785c22e72e19181394acff650422299b0e Closes-Bug: #1658147
* | | Fix 'mapping set' return valueColleen Murphy2017-01-251-6/+2
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without this patch, the command 'openstack mapping set <args>' will, upon success, print the rules for the updated mapping and exit with return code 1 (failure). This is a problem for scripts and config management tools that depend on the return code to validate whether the operation was successful, since even upon success the command returns a failing error code. Moreover, the behavior of printing the new value is completely unlike the behavior of any of the 'set' subcommands for other entities. This patch normalizes the 'mapping set' command by omitting any return value in the SetMapping take_action() method. This way the client will only exit with an error code if an exception is raised, and not upon normal operation. Change-Id: I610ec3b2fa7561072346d46e49cfc1ae82130e0d
* | Error handling for delete commands in identityHuanxuan Ao2017-01-038-0/+231
| | | | | | | | | | | | | | | | | | Add missing multi deletion error handling for identity delete commands. All delete commands in identity support error handling now. Change-Id: I05626dcb5e516a423d610906347b02236ba7eeaf
* | Remove auth_with_unscoped_saml decoratorColleen Murphy2016-12-041-26/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The auth_with_unscoped_saml decorator existed to make sure the user selected the right auth plugin before trying to call either a 'federation domain' or 'federation project' command. This is outdated, because openstackclient now uses keystoneauth[1] and keystoneauth removed its entrypoints for the federation plugins[2] since its _Rescoped class no longer needs them. This patch removes the decorator since that validation check was the only thing standing in the way of the commands working correctly. Also removed the '*_list_wrong_auth' tests since those only existed to test the decorator, and stopped setting the plugin in the positive tests since the automatically-determined token plugin should now be fine. [1] http://git.openstack.org/cgit/openstack/python-openstackclient/commit/?id=6ae0d2e8a54fd5139e63a990ab4bdce634e73c5e [2] http://git.openstack.org/cgit/openstack/keystoneauth/commit/?id=d9e4d26bb86f8d48e43188b88bab9d7fe778d2c1 Change-Id: Id981739663113447a7bba8ddba81ba9394a19e07 Closes-bug: #1624115
* | Replace 'MagicMock' with 'Mock'qtang2016-09-147-12/+12
|/ | | | | Change-Id: I7aeceede6bd3cb88cf04f398454f9758dbee20f1 Closes-Bug: #1475722
* move unit tests to new "unit" test moduleSteve Martinelli2016-09-0833-0/+13686
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