128 Commits

Author SHA1 Message Date
Prashanth Pai
85bd7d622e Add a swiftonfile specific functional test
Test whether files created over mountpoint can be accessed over
Swift using GET.

Signed-off-by: Prashanth Pai <ppai@redhat.com>
2014-08-07 12:54:16 +05:30
Thiago da Silva
3ba8ce2700 added comment to code change
Signed-off-by: Thiago da Silva <thiago@redhat.com>
2014-07-24 21:11:22 -04:00
Thiago da Silva
d567111103 clean up saio env after running func tests
Current tests from upstream swift leave containers in the
database after they are done running.

This causes an issue with sof tests because we clean up the
tests directory /mnt/swiftonfile. When running the
functional tests a second time always fails because the
setup functions tries to delete existing containers,
but the sof object servers returns 404, thus causing
the whole test to fail.

Signed-off-by: Thiago da Silva <thiago@redhat.com>
2014-07-24 21:09:22 -04:00
Thiago da Silva
72eb3be6d2 Revert "fix functional tests to cleanup containers"
This reverts commit 8608b5e816031eb072bc95fce59a7b30d8e3496a.
2014-07-24 21:09:22 -04:00
Thiago da Silva
09affa3951 fix functional tests to cleanup containers
Current tests from upstream swift leave containers in the
database after they are done running.

This causes an issue with sof tests because we clean up the
tests directory /mnt/swiftonfile. When running the
functional tests a second time always fails because the
setup functions tries to delete existing containers,
but the sof object servers returns 404, thus causing
the whole test to fail.

Signed-off-by: Thiago da Silva <thiago@redhat.com>
2014-07-24 21:09:22 -04:00
Thiago da Silva
16b7d16803 removing unused files
These files are no long in use by swiftonfile.
- functional_auth/tempauth files are no longer required because
tests now rely on a saio setup where tempauth is already used
by default.
- tools/functional_tests.sh has been replaced by .functests.
- tools/tox_run.sh is no longer required, but swiftonfile now requires
a saio setup and swiftonfile to be configured as a storage policy
for testing.
- test/unit/common/data/* files are also no longer in use.

Signed-off-by: Thiago da Silva <thiago@redhat.com>
2014-07-09 08:54:56 -04:00
Thiago da Silva
81734f62f8 fix unit test reference to gluster.swift
Changed it to swiftonfile.swift.

Signed-off-by: Thiago da Silva <thiago@redhat.com>
2014-07-08 11:18:16 -04:00
Thiago da Silva
de24352275 changing references of gluster to swiftonfile
Renamed files and directories as well as replaced
infile references to gluster where appropriate

Signed-off-by: Thiago da Silva <thiago@redhat.com>
2014-07-08 11:04:31 -04:00
Prashanth Pai
5fe3970027 Fix unlink call after successful rename
This used to appear for every PUT of an object.

Signed-off-by: Prashanth Pai <ppai@redhat.com>
2014-07-07 14:49:45 +05:30
Prashanth Pai
50067f9c69 Support Storage Policy - Rev 7
* Rename references of '/mnt/gluster-object' to '/mnt/swiftonfile'.
* Rename swiftonfile SP name from 'sof' to 'swiftonfile'.
* Retain reseller_prefix in account dir created. This is to comply
  with Swift's behavior.
* Cleanup mountpoint after running swiftonfile specific tests.

Signed-off-by: Prashanth Pai <ppai@redhat.com>
2014-06-24 14:44:31 +05:30
Prashanth Pai
8ea7bd718d Support Storage Policy - Rev 5
* Sync to Swift 2.0.0rc1 release.
* Use separate conf files for functional tests
* Define swiftonfile as policy with index 2

Signed-off-by: Prashanth Pai <ppai@redhat.com>
2014-06-23 15:08:35 +05:30
Prashanth Pai
d91e33a0f4 Support Storage Policy - Rev 4
Added Swift On File specific functional tests that checks SoF's
object naming convention by comparing names of objects PUT and
actual files found over mountpoint.

Remove old reference to keystone functional tests.

Signed-off-by: Prashanth Pai <ppai@redhat.com>
2014-06-23 12:22:43 +05:30
Prashanth Pai
abf0641e40 Support Storage Policy - Rev 3
* Functional tests now run in SAIO+SoF setup.
* Fix and update various constraints.
* Update object-server.conf, swift.conf files. Add test.conf file.
* Added ./.functests script

TODO:
* Reintroduce gluster_swift_tests.py with SoF
  specific functional tests.

Signed-off-by: Prashanth Pai <ppai@redhat.com>
2014-06-23 12:22:43 +05:30
Prashanth Pai
33e8e2312e Support Storage Policy - Rev 2
* Fix API inconsistencies
* Remove hard-coded reseller_prefix = AUTH_
* Remove unused methods from gluster/swift/common/utils.py
  These used to be called from DiskDir earlier.
* Remove hidden configuration option that were related to account
  and container listings and metadata.
* Remove unused and redundant attributes

Signed-off-by: Prashanth Pai <ppai@redhat.com>
2014-06-23 12:22:42 +05:30
Prashanth Pai
7ab8e35ff6 Support Storage Policy - Rev 1
* Inherit DiskFileMananger class and few other methods from Swift
  and reuse them.
* Unit tests for write_pickle method.
* Added policy_idx args, wherever missing.

Signed-off-by: Prashanth Pai <ppai@redhat.com>
2014-06-23 12:22:42 +05:30
Prashanth Pai
3f4d0f98de Support Storage Policy
* The file path on mountpoint was /container/obj and has been changed to
  /account/container/obj. This structure is not created on account and
  container creation but rather during the first object PUT to that
  container.
* Rename OnDiskManager class to DiskFileManager
* Remove overridden container_update() method and use Swift's default
  implementation that updates container DB.
* Add support for async_dir in storage policies - failed database
  updates are stored in these directories to be later picked up by
  object-updater daemon. This change reintroduced write_pickle and
  pickle_async_update methods which are slightly modified versions
  of Swift's methods of the same name.
* Updated tox.ini dependency on Swift to point to feature/ec branch of
  Swift's github repo.

Signed-off-by: Prashanth Pai <ppai@redhat.com>
2014-06-23 12:22:42 +05:30
Prashanth Pai
ba39ade716 Remove non SP related code
This commit only removes code that is not required when swiftonfile
will be used as Storage Policy in Swift.

This commit does NOT:
* include code changes to support SP
* fix functional tests
* update documentation related to SP

This commit removes the following:
* Gen builders script and its man page.
* Authentication guide, user guide and other docs.
* Swiftkerbauth code, unit tests, func tests and doc.
* gswauth code, unit tests, func tests and doc.
* Object expirer code modifications, unit tests and doc.
* Conf files of account, container, proxy.
* Account, container and proxy server code - server.py of each.
* Account, container and proxy unit and functional tests.
* DiskDir class and corresponding unit tests.
* Our overridden ring.py (enforces account = volume = device) and tests.
* Functional tests for authentication filters.
* modules/swift and test/deploy directories.
* Proxy base controllers unit tests.

NOTE: We may have to reintroduce some of the above functional and unit
tests after SP related code changes - during fixing functional tests.

This commit modifies:
* setup.py to reflect the above code removals.
* constraints.py to remove references to ring.py
* object server.py to remove object-expirer changes
* tox.ini to remove ksfunctest and swfunctest

Signed-off-by: Prashanth Pai <ppai@redhat.com>
2014-06-23 12:22:42 +05:30
Luis Pabon
466d38a28a Merge pull request #16 from thiagol11/GET_failure
fix issue with GET on large object
2014-05-23 11:00:44 -04:00
Thiago da Silva
ad31435cf4 Merge pull request #17 from lpabon/glusterfs_deploy_test
Tests to verify locally deployed software.
2014-05-23 10:59:06 -04:00
Luis Pabon
ebddcb6d8f Tests to verify locally deployed software.
The difference between these tests and those under the functional
directory, is that these tests do not run under tox, and so
require a full OpenStack Swift + swiftonfile deployment.

The conf files where copies of the gswauth test, but I modified them
to be able to do a mount check.

The purpose of this tests is to confirm the quality of the software
in a deployed system.

The tests require the following:
- GlusterFS Volumes: test, test2, gsmetadata
- Directory /mnt/gluster-object
- OpenStack Swift + swiftonfile to be installed.

Signed-off-by: Luis Pabon <lpabon@redhat.com>
2014-05-22 14:59:14 -04:00
Thiago da Silva
49cddb0f1e removing unused time module
Signed-off-by: Thiago da Silva <thiago@redhat.com>
2014-05-21 11:37:20 -04:00
Thiago da Silva
006dfba79e adding functional test to cover same issue
functional test writes and read a large object to exercise
code that calls drop_cache after reading 1MB of data

Signed-off-by: Thiago da Silva <thiago@redhat.com>
2014-05-21 11:30:44 -04:00
Thiago da Silva
9eb79c9f49 adding unit test that would have caught this issue
This chunk of code is only executed when reading a large file
(> 1014 * 1024), so the issue was never caught in our unit tests

refer to issue #13

Signed-off-by: Thiago da Silva <thiago@redhat.com>
2014-05-20 19:20:26 -04:00
Prashanth Pai
cb7e968873 Modify unit tests and func tests
* Updated tox.ini
* Created .unittests and .functests
* Added tempurl to pipeline in conf files so that tempurl tests are not
  skipped
* Updated .gitignore file

Signed-off-by: Prashanth Pai <ppai@redhat.com>
2014-05-08 12:11:46 +05:30
Prashanth Pai
d23fd1b56c Sync with OpenStack Swift v1.13.1
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2014-05-08 11:45:08 +05:30
Pushpesh Sharma
65000f1c93 Removing functionalnosetests
With the Icehouse release of openstack-swift functional
case classified as fucntionalnose tests have been moved
to functional cases.Although we copied test suites from
test/fucntionalnose/ to test/functional/ but we still
have same cases under test/functionalnose.This might
cause duplicate tests run.

Change-Id: I025206467aad364debd9050b3186e1379d89ffaf
Signed-off-by: Pushpesh Sharma psharma@redhat.com
Reviewed-on: http://review.gluster.org/7516
Reviewed-by: Prashanth Pai ppai@redhat.com
Tested-by: Prashanth Pai ppai@redhat.com
Reviewed-by: Chetan Risbud crisbud@redhat.com
Reviewed-by: Thiago da Silva thiago@redhat.com
2014-05-06 16:23:08 +05:30
Thiago da Silva
404fcd815c Updating code to call fs_utils instead of python's os module
This change is being done to prepare the code to always call
fs_utils for all filesystem calls on the data being stored.
By creating this interface (i.e., fs_utils), we can then
make a seamless change to use the current method of 'os.'
calls over FUSE _or_ libgfapi. This new method will be introduced
in a new separate patch.

Change-Id: Ic768fa7352d7672b1f060230bb4486f0ec228152
Signed-off-by: Thiago da Silva <thiago@redhat.com>
Reviewed-on: http://review.gluster.org/7333
Reviewed-by: Prashanth Pai <ppai@redhat.com>
Reviewed-by: Luis Pabon <lpabon@redhat.com>
Tested-by: Luis Pabon <lpabon@redhat.com>
2014-04-10 12:50:38 -07:00
Thiago da Silva
b00a996732 removing exception handling in do_mkdir
This change is being made to allow callers to handle
any exception thrown by os.mkdir.

This function is currently never called anywhere in the code.
It was introduced as part of the first commit to this project
but it was never used.

This patch (http://review.gluster.org/#/c/5304/) removed the
early version of this function, and this patch
(http://review.gluster.org/#/c/5305/) added it back with new
exception handling.

Change-Id: I71325660cb47594b0804da3da21920e26d2055f2
Signed-off-by: Thiago da Silva <thiago@redhat.com>
Reviewed-on: http://review.gluster.org/7350
Reviewed-by: Prashanth Pai <ppai@redhat.com>
Reviewed-by: Chetan Risbud <crisbud@redhat.com>
Tested-by: Chetan Risbud <crisbud@redhat.com>
2014-03-27 03:14:32 -07:00
Thiago da Silva
09688dc594 fix __exit__ function not closing file descriptor
The file descriptor is not being closed because
it is self._fd is None

Change-Id: I7edc8a78b09bdd76d59ac8f3dbc809af652f9b0e
Signed-off-by: Thiago da Silva <thiago@redhat.com>
Reviewed-on: http://review.gluster.org/7315
Reviewed-by: Luis Pabon <lpabon@redhat.com>
Tested-by: Luis Pabon <lpabon@redhat.com>
2014-03-26 13:30:22 -07:00
Thiago da Silva
972c252c41 removing check_user_xattr function
This function is no longer used, the code that called
this function was removed as part of this patch:
http://review.gluster.com/#/c/3390/

Change-Id: I6e81e4b763ce302289e2be5467dc4776f0750c15
Signed-off-by: Thiago da Silva <thiago@redhat.com>
Reviewed-on: http://review.gluster.org/7336
Reviewed-by: Luis Pabon <lpabon@redhat.com>
Tested-by: Luis Pabon <lpabon@redhat.com>
2014-03-26 08:25:40 -07:00
Prashanth Pai
2014cdb906 Add support for Object Expiration feature
Preventing access to expired objects
------------------------------------
Re-enabled accepting X-Delete-At and X-Delete-After headers. During a GET on
an expired object, DiskFileExpired is raised by DiskFile class. This will
result in object-server returning HTTPNotFound (404) to the client.

Tracking objects to be deleted
------------------------------
Objects to be deleted are tracked using "tracker objects". These are PUT into
a special account(a volume, for now). These zero size "tracker objects" have
names that contain:
    * Expiration timestamp
    * Path of the actual object to be deleted

Deleting actual objects from GlusterFS volume
---------------------------------------------
The object-expirer daemon runs a pass once every X seconds. For every pass it
makes, it queries the special account for "tracker objects". Based on
(timestamp, path) present in name of "tracker objects", object-expirer then
deletes the actual object and the corresponding tracker object.

To run object-expirer forever:
    swift-init object-expirer start
To run just once:
    swift-object-expirer -o -v /etc/swift/object-expirer.conf

Caveat/Limitation: Object-expirer needs a separate account(volume) that
is not used by other services like gswauth. By default, this volume is
named "gsexpiring" and is configurable.

More info about object expiration:
http://docs.openstack.org/developer/swift/overview_expiring_objects.html

Change-Id: I876995bf4f16ef4bfdff901561e0558ecf1dc38f
Signed-off-by: Prashanth Pai <ppai@redhat.com>
Reviewed-on: http://review.gluster.org/6891
Tested-by: Chetan Risbud <crisbud@redhat.com>
Reviewed-by: pushpesh sharma <psharma@redhat.com>
Tested-by: pushpesh sharma <psharma@redhat.com>
Reviewed-by: Chetan Risbud <crisbud@redhat.com>
2014-03-24 22:14:15 -07:00
Chetan Risbud
2505d82815 Functional tests for SwiftKerbAuth filter.
This provides an infrastructure for swiftkerbauth
related functional test cases.
More test cases will be added later.
Added a section in swiftkerbauth guide about how to run
functional tests.

test/functional_auth/swiftkerbauth
----------------------------------

A new authentication filter related functional
tests and configuration to reside here.
The configuration would help setup the
environment. All the generic functional tests
should run fine with PASSIVE mode of swiftkerbatuh.
Please refere to swiftkerbatuh documentation for
ACTIVE/PASSIVE mode of working.

swiftkerbauth/test_swkrbath_active.py
-------------------------------------
This file has all the testcases of active mode of
swiftkerbauth. More test cases to be added later.

SwiftKerbAuth related test cases are meant to run
on the setup where SwiftKerbAuth is setup and
installed.

Change-Id: Ibc2a3945f5c9b6714475fcec0ee9d153debb48e3
Signed-off-by: Chetan Risbud <crisbud@redhat.com>
Reviewed-on: http://review.gluster.org/6925
Reviewed-by: Luis Pabon <lpabon@redhat.com>
Tested-by: Luis Pabon <lpabon@redhat.com>
2014-03-14 11:56:15 -07:00
Prashanth Pai
2ccd2c4d96 Sync with OpenStack Swift v1.13.0
Also, bumped version of gluster-swift to v1.13.0

Change-Id: I797dc704c9523540cba847b1e8ff3da97b79630c
Signed-off-by: Prashanth Pai <ppai@redhat.com>
Reviewed-on: http://review.gluster.org/7229
Reviewed-by: Chetan Risbud <crisbud@redhat.com>
Reviewed-by: Luis Pabon <lpabon@redhat.com>
Tested-by: Luis Pabon <lpabon@redhat.com>
2014-03-13 05:09:19 -07:00
Chetan Risbud
1a6b55714f PUT of a Directory failed
PUT of a directory fails with gluster-swift when there exists
object of a same name. This is because the objects and directories are placed on
the glusterfs. And hence the filesystem semantics are applicable there.

Exceptions raised in such situation are needed to be handled and reported
correctly back to proxy-server with HTTPConflict as a error code. Although
swift still continues to choose 503 as the best respose in such cases. No
tracebacks reported.

Fix covers the case when there exists a directory and object of the same
name is PUT.

Code changes fixes both the failure cases mentioned in the bug.

Examples of failing PUT requests:
1) curl -v  -X PUT http://127.0.0.1:8080/v1/AUTH_test/c1/dir1/obj2/anotherobject
-d'asdasdsadA'
-- obj2 was already an object.

2)curl -v -H 'Content-Length: 0' -H 'Content-Type: application/directory' -X PUT
http://127.0.0.1:8080/v1/AUTH_test/c1/obj1
-- obj1 was already and object

Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1071021

Change-Id: Id3042d920e3f99e740d4042ef5907ac8c59e04db
Signed-off-by: Chetan Risbud <crisbud@redhat.com>
Reviewed-on: http://review.gluster.org/7181
Reviewed-by: Prashanth Pai <ppai@redhat.com>
Tested-by: Prashanth Pai <ppai@redhat.com>
2014-03-12 06:00:20 -07:00
Luis Pabon
d5ebf36f7e Sync with OpenStack Swift v1.12.0
* Bumped the version of gluster-swift to v1.12.0.
* Added document on how to do a sync

Change-Id: I676e110759b0bce3007a2a38f3b384b4ca9d710d
Signed-off-by: Luis Pabon <lpabon@redhat.com>
Reviewed-on: http://review.gluster.org/6977
Reviewed-by: Prashanth Pai <ppai@redhat.com>
Reviewed-by: Chetan Risbud <crisbud@redhat.com>
Tested-by: Chetan Risbud <crisbud@redhat.com>
2014-02-16 22:08:06 -08:00
Chetan Risbud
5a0e9a3713 Revert "Attempt to fix failing testMetadataOnPost functional test"
This reverts commit ad6fb3558019e0f65de0b36c2c2f78d94925838c

Change-Id: I0e04c923880b3b987bedb04fdb10d3f9813bb884
Reviewed-on: http://review.gluster.org/6952
Reviewed-by: Chetan Risbud <crisbud@redhat.com>
Tested-by: Chetan Risbud <crisbud@redhat.com>
2014-02-10 06:50:38 -08:00
Prashanth Pai
ad6fb35580 Attempt to fix failing testMetadataOnPost functional test
On Jenkins, functional tests occasionally fail in testMetadataOnPost test case
with ResponseNotReady exception. This is an attempt to fix that as I'm
guessing that the following could be the reason.

It is advised to read the whole response body before sending a new request:
http://docs.python.org/2/library/httplib.html#httplib.HTTPConnection.getresponse
http://hg.python.org/cpython/file/2.7/Lib/httplib.py#l1033

Change-Id: I2ee880fd15af8766dcbd12f84ef561a67acdcdce
Signed-off-by: Prashanth Pai <ppai@redhat.com>
Reviewed-on: http://review.gluster.org/6945
Reviewed-by: Chetan Risbud <crisbud@redhat.com>
Tested-by: Chetan Risbud <crisbud@redhat.com>
2014-02-10 06:09:14 -08:00
Thiago da Silva
3ee9a70402 adding error handling to gswauth-cleanup-tokens tool
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>
2014-02-05 06:23:04 -08:00
Pushpesh Sharma
ec2c548af9 Fixes some TCs that assert for response code 403
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>
2014-01-30 22:17:37 -08:00
Chetan Risbud
03128e172e Rebase swiftkerbauth imported code with upstream
Few changes have been merged to upstream swiftkerbauth repo.
This commit brings it down to gluster-swift repo.
Bringing below changes to gluster-swift repo in one go.

http://review.gluster.org/#/c/6296/
http://review.gluster.org/#/c/6370/
http://review.gluster.org/#/c/6595/
http://review.gluster.org/#/c/6713/
http://review.gluster.org/#/c/6732/

Change-Id: I10dc12d75ec63fca313339fbc71e4f18071af552
Signed-off-by: Chetan Risbud <crisbud@redhat.com>
Reviewed-on: http://review.gluster.org/6764
Reviewed-by: Prashanth Pai <ppai@redhat.com>
2014-01-27 22:55:55 -08:00
Pushpesh Sharma
1f432663ba Test cases for gswauth-cleanup-token
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>
2014-01-24 08:12:15 -08:00
Pushpesh Sharma
22d8dffb36 Provide more generic string in testAssert of some TCs
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>
2014-01-21 10:11:42 -08:00
Chetan Risbud
4b988ce3c5 Initial import of the swiftkerbauth
Imported code till commit f64a3354185f32928e2568d9ece4a52fa4746c05
Changed a code bit to import correct definitions.
kerbauth unit tests do run along with gluster-swift.
Install script does install swiftkerbauth.
import swiftkerbauth from http://review.gluster.org/swiftkrbauth.git

Change-Id: Ia89f2b77cc68df10dee2f41ce074f3381ac3c408
Signed-off-by: Chetan Risbud <crisbud@redhat.com>
Reviewed-on: http://review.gluster.org/6597
Reviewed-by: Prashanth Pai <ppai@redhat.com>
Reviewed-by: Luis Pabon <lpabon@redhat.com>
Tested-by: Luis Pabon <lpabon@redhat.com>
2014-01-21 10:09:44 -08:00
Luis Pabon
6a8e9a70e9 Sync with OpenStack v1.11.0 Jan 10 2014
Updated tox.ini, functional tests, and proxy
unit tests.

BUG: https://bugs.launchpad.net/bugs/1268017

Change-Id: I5ff8359b8abdb8fe5ae82492c12f57c395992735
Signed-off-by: Luis Pabon <lpabon@redhat.com>
Reviewed-on: http://review.gluster.org/6682
Reviewed-by: Thiago da Silva <thiago@redhat.com>
Tested-by: Thiago da Silva <thiago@redhat.com>
2014-01-15 11:28:08 -08:00
Thiago da Silva
62d07833db fix error handing in swauth tools
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>
2014-01-14 12:15:53 -08:00
Thiago da Silva
205a6e4aa7 Fix bug where admin is able to delete reseller_admin
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>
2014-01-10 12:52:53 -08:00
Prashanth Pai
94a3f539e7 Fix users not able to change their own password/key
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>
2014-01-07 13:50:30 -08:00
Prashanth Pai
d1c7b1cc4b Handle ENOSPC on os.close() operation
It is quite possible that errors on a previous write()
operation are first reported at the final close().

For fruther info, refer to: http://review.gluster.org/#/c/6269/

Change-Id: If0fbe2f5109d28c82cb493f2526fd5057f86b556
Signed-off-by: Prashanth Pai <ppai@redhat.com>
Reviewed-on: http://review.gluster.org/6608
Reviewed-by: Luis Pabon <lpabon@redhat.com>
Tested-by: Luis Pabon <lpabon@redhat.com>
2014-01-07 13:49:29 -08:00
Luis Pabon
e280f91ff1 Unit test should use python 2.6 calls only
Change-Id: I994b0e45d4fdb898378de7cd103f7e429a7fd9cc
Signed-off-by: Luis Pabon <lpabon@redhat.com>
Reviewed-on: http://review.gluster.org/6662
Reviewed-by: Thiago Da Silva <thiago@redhat.com>
2014-01-07 13:48:42 -08:00
Pushpesh Sharma
331bc6ce85 Fixes,TCs for user/account operation by non super_admin users
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>
2014-01-06 18:28:54 -08:00