summaryrefslogtreecommitdiffstats
path: root/test/functional_auth/gswauth/test_gswauth_cli.py
Commit message (Collapse)AuthorAgeFilesLines
* adding error handling to gswauth-cleanup-tokens toolThiago da Silva2014-02-051-6/+2
| | | | | | | | | | | | | | | added input validation for a couple of options and error handling in case a non-existing account name is provided Change-Id: I6d703d584552fc7b7574f34e79ed25a2982b6d5e Signed-off-by: Thiago da Silva <thiago@redhat.com> Reviewed-on: http://review.gluster.org/6767 Reviewed-by: Prashanth Pai <ppai@redhat.com> Tested-by: Prashanth Pai <ppai@redhat.com> Reviewed-by: pushpesh sharma <psharma@redhat.com> Tested-by: pushpesh sharma <psharma@redhat.com> Reviewed-by: Chetan Risbud <crisbud@redhat.com>
* Fixes some TCs that assert for response code 403Pushpesh Sharma2014-01-301-15/+13
| | | | | | | | | | | | | For some scenarios although the expected response as per the REST spec is 403, but due to technical limitation/performance improvements it is decided to go with 401.EX:An admin/regular user tries to add a reseller admin user. Change-Id: Ibc280a0be6e5cb81d4d2c46d9a758915ff60ae8f Reviewed-on: http://review.gluster.org/6833 Reviewed-by: Prashanth Pai <ppai@redhat.com> Reviewed-by: Chetan Risbud <crisbud@redhat.com> Tested-by: Chetan Risbud <crisbud@redhat.com>
* Test cases for gswauth-cleanup-tokenPushpesh Sharma2014-01-241-8/+152
| | | | | | | | | | | | This commit creates a new class to validate the cleanup-token & set-account-service CLI utility.This test tries to cover all the psossible values that can be passed as user input valid/invalid. Change-Id: Ia8ca40ca9e63a296b70cb999c6507b7b1ffbdf61 Signed-off-by: Pushpesh Sharma <psharma@redhat.com> Reviewed-on: http://review.gluster.org/6759 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com>
* Provide more generic string in testAssert of some TCsPushpesh Sharma2014-01-211-12/+12
| | | | | | | | | | | | | | | CLI test case were failing on RHEL systems as the error string on Fedora19 and RHEL6.4 systems are different however a more gereric string is there on both of the systems and this is about that only. It replaces the 'ECONNREFUSED' & 'No address associated with hostname' with 'Check that the admin_url is valid'.Now the TCs pass on both of the OS. Change-Id: Iff8b2719e8917864ed8f80d961c55a7f9f6fc77b Signed-off-by: Pushpesh Sharma <psharma@redhat.com> Reviewed-on: http://review.gluster.org/6718 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com>
* fix error handing in swauth toolsThiago da Silva2014-01-141-5/+48
| | | | | | | | | | | | | The swauth tools did not handle an invalid admin_url, so it just failed printing the stacktrace, which is not useful to end users. This fix catches the exception and prints an error message that can help user solve the issue. Change-Id: I806c1cf191b5921e904b155f65cdbde5f2aac695 Signed-off-by: Thiago da Silva <thiago@redhat.com> Reviewed-on: http://review.gluster.org/6431 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com>
* Fix bug where admin is able to delete reseller_adminThiago da Silva2014-01-101-2/+2
| | | | | | | | | | | | | | | | | Changed the code to only allow the super_admin to delete a reseller_admin. This follows the same logic of user creation, where only the super_admin can create a reseller_admin. Also, took the opportunity to refactor some code and implemented get_user_detail method to remove duplicated code Bug 1260239: https://bugs.launchpad.net/gluster-swift/+bug/1260239 Change-Id: I9e4866cd7ad08698f427846be566ab2364ad4850 Signed-off-by: Thiago da Silva <thiago@redhat.com> Reviewed-on: http://review.gluster.org/6516 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com>
* Fix users not able to change their own password/keyPrashanth Pai2014-01-071-5/+71
| | | | | | | | | | | | | | | | | | | | | | | Users were not able to update their own password/key with the update operation resulting in 403 (HTTPForbidden). EXAMPLES: Command to update password/key of regular user: gswauth-add-user -U account1:user1 -K old_pass account1 user1 new_pass Command to update password/key of account admin: gswauth-add-user -U account1:admin -K old_pass -a account1 admin new_pass Command to update password/key of reseller_admin: gswauth-add-user -U account1:radmin -K old_pass -r account1 radmin new_pass BUG: https://bugs.launchpad.net/gluster-swift/+bug/1262227 Change-Id: I604da5aee67099b29541eb7e51a040a041f1961b Signed-off-by: Prashanth Pai <ppai@redhat.com> Reviewed-on: http://review.gluster.org/6650 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com>
* Fixes,TCs for user/account operation by non super_admin usersPushpesh Sharma2014-01-061-96/+394
| | | | | | | | | | | | | | | | | | | This commit does following: 1.New functions in Utils based on CLI 2.Fixes for existing suite 3.Test cases for non super_admin users doing user/account operations I tried to cover most of the possible test cases that can be duducted from the swauth dev guide and swuath user role matrix.These resources can be found here: https://raw.github.com/rbeede/swauth/master/doc/source/Draft%20Security%20Guide/swift_swauth_roles_matrix.png http://gholt.github.io/swauth/dev/ Change-Id: I3267a718e5432cddc751ec53fe9b05ef9061a5e3 Signed-off-by: Pushpesh Sharma <psharma@redhat.com> Reviewed-on: http://review.gluster.org/6537 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com>
* gswauth: Fix 403 being returned instead of 401Prashanth Pai2013-12-181-10/+32
| | | | | | | | | | | | | | | | | | | | - 401(Unauthorized) is to be returned when user credentials are wrong where as 403(Forbidden) is to be returned when user credentials are correct but the user doesn't have the priveleges to carry out the operation. - Also error messages displayed when using swauth-* command line utilities have been updated. Change-Id: I485786896ad14d3263f4325d1857cacc93adab96 Signed-off-by: Prashanth Pai <ppai@redhat.com> Reviewed-on: http://review.gluster.org/6336 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com> Signed-off-by: Prashanth Pai <ppai@redhat.com> Reviewed-on: http://review.gluster.org/6447 Reviewed-by: Thiago Da Silva <thiago@redhat.com> Tested-by: Thiago Da Silva <thiago@redhat.com>
* renaming swauth tools to gswauthThiago da Silva2013-12-061-9/+9
| | | | | | | | | | | | | | | | cli tools for account and user mgmt have been renamed from swauth-* to gswauth-* Updated other configuration and test files accordingly Change-Id: Iced3bb27fbd09da45754ddb264f8fb4528ab423c Signed-off-by: Thiago da Silva <thiago@redhat.com> Reviewed-on: http://review.gluster.org/6417 Reviewed-by: pushpesh sharma <psharma@redhat.com> Tested-by: pushpesh sharma <psharma@redhat.com> Reviewed-by: Shilpa MJ <smanjara@redhat.com> Tested-by: Shilpa MJ <smanjara@redhat.com> Reviewed-by: Luis Pabon <lpabon@redhat.com>
* adding tabular output to swauth-listThiago da Silva2013-11-271-2/+15
| | | | | | | | | | | | swauth-list now shows lists of accounts, users and groups in a tabular format (default). JSON and plain-text options are still available Change-Id: I897009f5f6c05aa4c14e306bb6ad35234e993fcd Signed-off-by: Thiago da Silva <thiago@redhat.com> Reviewed-on: http://review.gluster.org/6347 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com>
* Functional Tests for gswauth_cliPushpesh Sharma2013-11-201-0/+246
This test suite plans to tests following gswauth commands:- 1. swauth-prep 2. swauth-add-account 3. swauth-delete-account 4. swauth-add-user 5. swauth-delete-user 6. swauth-set-account-service 7. swauth-cleanup-tokens 8. swauth-list It uses 'commands' python module to execute gswauthcommands, and capture the status and output of commands followed by asserts to verify if the captured status and output is same as expected ones.This initial draft has tests for first 1-5 commands. Change-Id: I8591884e87c6ffd88446aacd04a1db2daab2d189 Signed-off-by: Pushpesh Sharma <psharma@redhat.com> Reviewed-on: http://review.gluster.org/6277 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com>