summaryrefslogtreecommitdiff
path: root/openstackclient/tests/identity
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Add support for domain specific roles"Jenkins2016-08-183-3/+336
|\
| * Add support for domain specific rolesHenry Nash2016-08-103-3/+336
| | | | | | | | | | | | | | A role entity can now be specified as domain specific. Closes-bug: #1606105 Change-Id: I564cf3da1d61f5bfcf85be591480d2f5c8d694a0
* | Fix up last-minute imports to use osc-libDean Troyer2016-08-181-1/+2
| | | | | | | | Change-Id: I1ed2983cf574ebd565eeac4f8199fbc3a2e29c8e
* | Gate-unbreaking combo reviewDean Troyer2016-08-182-74/+9
|/ | | | | | | | | | | | | | | | | | | | | | | | Fix argument precedence hack Working around issues in os-client-config <= 1.18.0 This is ugly because the issues in o-c-c 1.19.1 run even deeper than in 1.18.0, so we're going to use 1.19.0 get_one_cloud() that is known to work for OSC and fix o-c-c with an axe. Remove return values for set commands 'identity provider set' and 'service provider set' were still returning their show-like data, this is a fail for set commands now, don't know how this ever passed before... Constraints are ready to be used for tox.ini Per email[1] from Andreas, we don't need to hack at install_command any longer. [1] http://openstack.markmail.org/thread/a4l7tokbotwqvuoh Co-authorioed-by: Steve Martinelli <s.martinelli@gmail.com> Depends-On: I49313dc7d4f44ec897de7a375f25b7ed864226f1 Change-Id: I426548376fc7d3cdb36501310dafd8c44d22ae30
* Add unit tests for group commands in identity v3Huanxuan Ao2016-08-042-0/+429
| | | | | | | | | | | | | Add unit tests for commands below in identity v3: group create group delete group show group set group add user group remove user group contains user Change-Id: I02f3b49e93582245a2749492bba1dfc4c5e0258d
* Refactor identity v3 unit tests with fake classHuanxuan Ao2016-08-025-609/+572
| | | | | | | | Refactor unit tests in identity v3 for "user", "endpoint", "group" and "service" with fake classes. Change-Id: I57316bbf762c805f8e9ae225b394bbe58ebdd416 Partially-Implements: blueprint refactor-identity-unit-test
* Merge "Fix error for find_service() in identity"Jenkins2016-07-273-19/+65
|\
| * Fix error for find_service() in identitysunyajing2016-07-223-19/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | if there are more than one services be found with one name, a NoUniqueMatch exception should be raised but we can see a NotFound Exception raised instead. It is because in "find_service()", we use "find_resource()" first, if "find_resource()" return a exception, we just think it is a NotFound Exception and continue to find by type but ignore a NoUniqueMatch exception of "find_resource()". This patch refactor the "find_service()" method to solve this problem. Change-Id: Id4619092c57f276ae0698c89df0d5503b7423a4e Co-Authored-By: Huanxuan Ao <huanxuan.ao@easystack.cn> Closes-Bug:#1597296
* | Merge "Standardize import format"Jenkins2016-07-263-3/+0
|\ \
| * | Standardize import formatshizhihui2016-07-223-3/+0
| |/ | | | | | | | | | | | | | | According to the rule in http://docs.openstack.org/developer/hacking/#imports I modify some irregular import format. Change-Id: Ibf29ccaf3ddec4a956334cc3368ebee7a66e282c
* | Merge "Unit test of credential in identityv3"Jenkins2016-07-262-28/+367
|\ \
| * | Unit test of credential in identityv3Huanxuan Ao2016-07-232-28/+367
| |/ | | | | | | | | | | | | Add missing unit tests and refactor the older tests with fake classeds for credential in identity v3 Change-Id: I94d4f80a86806c6115178421bd481b7622065956
* | Add assignment list to v2 identity and deprecate alternate listingHenry Nash2016-07-223-0/+335
|/ | | | | | | | | | | | | | | | | | | | | | | | | The current identity role list command (both v2 and v3) is overloaded with listing roles as well as assignments (if you provide user, group, project or domain options). This is in addition to the v3 assignment list command designed for this purpose. This overloading complicates the fact that roles can now be domain specific (i.e. have a domain attribute), so the command 'role list --domain <domain-name' will soon become ambigious (this is in a follow on patch). This patch: - Adds a v2 assignments list, with support for pulling the user and project from the auth credentials - For comapability, adds the same auth support to the existing v3 assignments list - Deprecates the use of role list and user role list to list assignments Change-Id: I65bafdef4f8c89e863dab101369d0d629fa818b8 Partial-Bug: 1605774
* Support bulk deletion for delete commands in identityv3Huanxuan Ao2016-07-199-9/+9
| | | | | | | | | | | | | | | | | | | | | | | Support bulk deletion for delete commands in the list below identity/v3/consumer identity/v3/credential identity/v3/domain identity/v3/ec2creds identity/v3/endpoint identity/v3/federation_protocol identity/v3/identity_provider identity/v3/mapping identity/v3/policy identity/v3/region identity/v3/service_provider identity/v3/service The unit test in identityv3 need to be refactored, so I add some functional tests instead. I will add all unit tests at one time after the refactor completed. Change-Id: I82367570f59817b47c87b6c7bfeae95ccfe5c50e Closes-Bug: #1592906
* Make set/unset commands pass normally when nothing specified in identityv3Huanxuan Ao2016-07-145-7/+32
| | | | | Change-Id: I554b41969f96b62a2c6d37024caa56b1441d5ed1 Partial-bug: #1588588
* Unskip tests caused by bug 1599333Steve Martinelli2016-07-073-11/+18
| | | | | | | | | | There is now a second .get() call in osc_lib.utils.find_resources. These tests were failing because they only mocked a single access call to .get(). Ensure there are two calls to .get(), with the first one raising an exception. Change-Id: Idd2ad4a27a6db5bee633cc37a1042dbb0a57aa71 Closes-Bug: #1599333
* Merge "Refactor unit tests for project and domain with fake classes in ↵Jenkins2016-07-063-298/+343
|\ | | | | | | identityv3"
| * Refactor unit tests for project and domain with fake classes in identityv3Huanxuan Ao2016-07-043-298/+343
| | | | | | | | | | | | | | | | Add FakeProject and FakeDomain classes and update unit tests for project and domain. Change-Id: Ifeed5dcba03155daa3b7b46b34d49c333ab19135 Partially-Implements: blueprint refactor-identity-unit-test
* | skip failing tests due to bug 1599333 is fixedSteve Martinelli2016-07-053-0/+10
|/ | | | | | | | latest osc-lib breaks some of the tests, skip them for now so we can continue to merge patches that are already approved. Change-Id: I433190e9f763bea1df3135612b281d925745f884 Related-Bug: 1599333
* Update Fakes.py and unit tests for commands in identity V2.0sunyajing2016-06-276-383/+319
| | | | | | | Update remaining commands:role, service, user, token. Change-Id: I06eed60dd2f312bad6076c78b53cd07bcd4cd55c Partially-Implements: blueprint refactor-identity-unit-test
* Support multi-delete for commands in identity V2sunyajing2016-06-232-2/+2
| | | | | | | | Commands are "ec2 credentials delete", "service delete", "endpoint delete". Also update their unit tests and functional tests. Partial-Bug: #1592906 Change-Id: I1a0b7160b803a523646d09d030e6f112c81c4c24
* Merge "Add FakeObject classes to fakes.py, update unit tests in identity V2."Jenkins2016-06-235-275/+422
|\
| * Add FakeObject classes to fakes.py, update unit tests in identity V2.sunyajing2016-06-225-275/+422
| | | | | | | | | | | | | | | | Clean up fakes.py , use FakeCatalog, FakeProject, FakeService, FakeEndpoint, FakeRole classes instead, also update their unit tests. Change-Id: I510d175ec194165b0595ebd430e8cc596d363587 Partially-Implements: blueprint refactor-identity-unit-test
* | Use resource id when name given for identity showDavid Rosales2016-06-224-0/+62
|/ | | | | | | | | | | | | | | Currently a user is allowed to specify either a resource ID or name when running openstack identity comands. In some cases, when a name is specified instead of an ID, the command will return as not able to find the resource when it in fact does exist. The changes here are to check the client against the token on such requests and to extract the ID of the resource specified if enough information exists between the two. We then use the ID associated with the resource to complete the user requests. Change-Id: I40713b0ded42063b786dc21247e854224b9d2fe2 Closes-Bug: #1561599
* Make set/unset command in identity and image pass normally when nothing ↵sunyajing2016-06-172-0/+56
| | | | | | | | | specified Also update its unit tests. Change-Id: I82b90658b0d4247cdc9a650f14aceda640a32059 Partial-bug: #1588588
* osc-lib: utilsDean Troyer2016-06-133-7/+7
| | | | | | | | Use osc-lib directly for utils. Leave openstackclient.common.utils for deprecation period. Change-Id: I5bd9579abc4e07f45219ccd0565626e6667472f7
* osc-lib: exceptionsDean Troyer2016-06-134-4/+7
| | | | | | | | Use osc-lib directly for exceptions. Leave openstackclient.common.exceptions for deprecation period. Change-Id: Iea3e862302372e1b31ccd27f69db59b4953ca828
* Moving authentication from keystoneclient to keystoneauthNavid Pustchi2016-06-097-60/+210
| | | | | | | | | | | | | | | | | Currently OpenStackClient uses keystoneclient for authentication. This change will update OpenStackClient to use keystoneauth for authentication. All dependant test have been updated. Updating how auth_ref is set in the tests to use KSA fixtures had some racy side-effects. The user_role_list tests failed when they picked up an auth_ref that was a fixture. This exposed a weakness in ListUserRole that needed to be fixed at the same time re handling of unscoped tokens and options. Change-Id: I4ddb2dbbb3bf2ab37494468eaf65cef9213a6e00 Closes-Bug: 1533369
* Update unit test test_extension with fake classHuanxuan Ao2016-06-071-20/+38
| | | | | | | Add FakeExtension class in networkv2, computev2, volumev2, identityv2_0 and update unit test test/common/test_extension.py Change-Id: I94815de7801860edb7fa91a7d146455cab946652
* Merge "keystone: fix catalog output when region is unset"Jenkins2016-05-252-4/+23
|\
| * keystone: fix catalog output when region is unsetJulien Danjou2016-05-252-4/+23
| | | | | | | | | | | | | | | | | | | | If no region is set in Keystone, null is deserialized as None and the region has None has value, which triggers a type error when building the output string. This patch fixes that. Change-Id: I7637dc2595655cf452f38308f99fe66ac782e16d
* | Merge "Search by user defined ID for service providers"Jenkins2016-05-251-0/+1
|\ \
| * | Search by user defined ID for service providersSteve Martinelli2016-05-241-0/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | IDs for service providers can be user defined (like, Bob). This causes issues with the usual get by ID method. Keystone server side has implemented changes to search by ID when listing, which should resolve the issue with minimal changes to the client side. Change-Id: Ic705806e4bc7bb24f946a1fce803a0a0a4d788c1 Closes-Bug: 1555830
* | Search by user defined ID for identity providersSteve Martinelli2016-05-231-0/+1
|/ | | | | | | | | | | | IDs for service providers can be user defined (like, Bob). This causes issues with the usual get by ID method. Keystone server side has implemented changes to search by ID when listing, which should resolve the issue with minimal changes to the client side. Change-Id: Ic58df22b3445d3293a8e1c76c5da79badebf6528 Closes-Bug: 1479837
* Trivial: Reorder classes in identity v3 in alphabetical orderTang Chen2016-03-116-217/+217
| | | | Change-Id: Iaf2e336c2415416ec69f6b974743c26509bba561
* [Identity] Check return value is None in identity v3 unit testsTang Chen2016-03-096-15/+28
| | | | | | | | | take_action() in commands inheriting from Command returns nothing. So we should assert the return is None in the unit tests of these commands. Change-Id: I53eeb88316b2c20882fed97149d55cb04bcb2b2e Closes-Bug: #1550636
* [Identity] Check return value is None in identity v3 unit testsTang Chen2016-03-089-30/+64
| | | | | | | | | take_action() in commands inheriting from Command returns nothing. So we should assert the return is None in the unit tests of these commands. Change-Id: I02af06b3d476aac2d93a23ef2111cdc7fa0892ec Partial-Bug: #1550636
* Test take_action() instead of run() in unit testsTang Chen2016-03-0510-95/+101
| | | | | | | | | | | | | | | | | | | | | Some of the unit tests test run(), but not take_action(). For example, in openstackclient/tests/volume/v1/test_volume.py, there is: def test_volume_set_size_smaller(self): ...... result = self.cmd.run(parsed_args) self.assertEqual(0, result) ...... run() is defined in class Command in cliff. We don't need to test it in OSC unit tests. On the contrary, we should test take_action(), which is overwritten in each command classes in OSC. Change-Id: If07e89953d40ac530f08cbb1ec05f5805171364b Closes-bug: #1553468
* Fixed a bunch of spacingBrandon Palm2016-02-237-57/+80
| | | | | | | Nothing too complicated here. I fixed a bunch of spacing issues that I saw in OSC. Change-Id: I935ab48e7c5bac5f88ecdb3a05f73fb44fc9f41d
* Support unscoped token requestguang-yee2016-02-194-0/+55
| | | | | | | | Make scope check optional for the "token issue" command as unscoped token is a valid Keystone V2/V3 API. Change-Id: Ie1cded4dbfdafd3a78c0ebdf89e3f66762509930 Closes-Bug: #1543214
* Merge "Return names in list role assignments"Jenkins2016-02-172-7/+118
|\
| * Return names in list role assignmentsTom Cocozzello2016-01-272-7/+118
| | | | | | | | | | | | | | | | | | | | | | | | Utilize the new include names functionality added to list role assignments (GET /role_assignments?include_names=True). Which will return the names of the entities instead of their IDs. Change-Id: I6dc03baf61ef9354a8a259a9f17ff47ce1665ce7 Depends-On: I4aa77c08660a0cbd021502155938a46121ca76ef Closes-Bug: #1479569 Implements: blueprint list-assignment-with-names
* | Merge "Add "token revoke" for identity v3"Jenkins2016-02-172-0/+23
|\ \
| * | Add "token revoke" for identity v3lin-hua-cheng2016-02-092-0/+23
| |/ | | | | | | | | Change-Id: Ie631600d02942fe6ce035f31af46abe44e543631 Closes-bug: #1543226
* | Identity: Fix DisplayCommandBase comments for cliff ShowOne subclass testsTang Chen2016-02-1017-75/+225
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As bug #1477199 describes, the wrong comment below is all over the unit test code of OSC. # DisplayCommandBase.take_action() returns two tuples There is no such class named DisplayCommandBase in OSC. It is in cliff. All OSC command classes inherit from the base classes in cliff, class Command, class Lister and class ShowOne. It is like this: Object |--> Command |--> DisplayCommandBase |--> Lister |--> ShowOne take_action() is an abstract method of class Command, and generally is overwritten by subclasses. * Command.take_action() returns nothing. * Lister.take_action() returns a tuple which contains a tuple of columns and a generator used to generate the data. * ShowOne.take_action() returns an iterator which contains a tuple of columns and a tuple of data. So, this problem should be fixed in 3 steps: 1. Remove all DisplayCommandBase comments for tests of classes inheriting from class Command in cliff as it returns nothing. 2. Fix all DisplayCommandBase comments for tests of classes inheriting from class Lister in cliff. Lister.take_action() returns a tuple and a generator. 3. Fix all DisplayCommandBase comments for tests of classes inheriting from class ShowOne in cliff. ShowOne.take_action() returns two tuples. This patch finishes step 3 in all identity tests. Change-Id: I1f05e833cdacd30915954e4220b6e1f16ac1ed40 Closes-bug: #1477199
* | Identity: Fix DisplayCommandBase comments for cliff Lister subclass testsTang Chen2016-02-1021-56/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As bug #1477199 describes, the wrong comment below is all over the unit test code of OSC. # DisplayCommandBase.take_action() returns two tuples There is no such class named DisplayCommandBase in OSC. It is in cliff. All OSC command classes inherit from the base classes in cliff, class Command, class Lister and class ShowOne. It is like this: Object |--> Command |--> DisplayCommandBase |--> Lister |--> ShowOne take_action() is an abstract method of class Command, and generally is overwritten by subclasses. * Command.take_action() returns nothing. * Lister.take_action() returns a tuple which contains a tuple of columns and a generator used to generate the data. * ShowOne.take_action() returns an iterator which contains a tuple of columns and a tuple of data. So, this problem should be fixed in 3 steps: 1. Remove all DisplayCommandBase comments for tests of classes inheriting from class Command in cliff as it returns nothing. 2. Fix all DisplayCommandBase comments for tests of classes inheriting from class Lister in cliff. Lister.take_action() returns a tuple and a generator. 3. Fix all DisplayCommandBase comments for tests of classes inheriting from class ShowOne in cliff. ShowOne.take_action() returns two tuples. This patch finishes step 2 in all identity tests. Change-Id: I2929ee688b1d7afc52c6ab325982bdc24c60a995 Partial-bug: #1477199
* | Identity: Fix DisplayCommandBase comments for cliff Command subclass testsTang Chen2016-02-106-27/+0
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As bug #1477199 describes, the wrong comment below is all over the unit test code of OSC. # DisplayCommandBase.take_action() returns two tuples There is no such class named DisplayCommandBase in OSC. It is in cliff. All OSC command classes inherit from the base classes in cliff, class Command, class Lister and class ShowOne. It is like this: Object |--> Command |--> DisplayCommandBase |--> Lister |--> ShowOne take_action() is an abstract method of class Command, and generally is overwritten by subclasses. * Command.take_action() returns nothing. * Lister.take_action() returns a tuple which contains a tuple of columns and a generator used to generate the data. * ShowOne.take_action() returns an iterator which contains a tuple of columns and a tuple of data. So, this problem should be fixed in 3 steps: 1. Remove all DisplayCommandBase comments for tests of classes inheriting from class Command in cliff as it returns nothing. 2. Fix all DisplayCommandBase comments for tests of classes inheriting from class Lister in cliff. Lister.take_action() returns a tuple and a generator. 3. Fix all DisplayCommandBase comments for tests of classes inheriting from class ShowOne in cliff. ShowOne.take_action() returns two tuples. This patch finishes step 1 in all identity tests. Change-Id: Id7180d10c050c6286b2c05cd990e2e275fbc3d38 Partial-bug: #1477199
* Merge "Changed the abstract columns and datalists from test cases of common ↵Jenkins2016-01-1416-777/+529
|\ | | | | | | and Identity"
| * Changed the abstract columns and datalists from test cases of common and ↵SaiKiran2016-01-1216-779/+531
| | | | | | | | | | | | | | | | | | | | | | Identity columns and datalist has been set in each test case in compute, which is not necessary. This patch abstract it out and remove all redundant code. Change-Id: I45a3582088161f12e60e7c933da8e7dcc0ae8e7b Closes-Bug: #1532384
* | Support non-interactive user password updateGuang Yee2016-01-111-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently user password update require interactive prompting of user's original password. This is problematic because we can't support non-interactive applications and therefore hinders automation. This patch make it possible by optionally accepting an '--original-password' argument. If specified, we would use it instead of prompting. DocImpact Change-Id: I2d994e8c2be949f7ae616ac1d1594fb94e1a27cd Closes-Bug: 1531360