261 Commits

Author SHA1 Message Date
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
Thiago da Silva
9e56bceacc fix issue with GET on large object
Fixing a call to _drop_cache that had an extra parameter

A patch to this issue was first provided by Xw Huang(xwhuang@qnap.com)
in gluster-swift gerrit. I'm transferring the patch to swiftonfile.

Fixes issue #13

Signed-off-by: Thiago da Silva <thiago@redhat.com>
2014-05-20 15:50:55 -04:00
Thiago da Silva
ae7c93b461 Merge pull request #6 from prashanthpai/rebase
Sync with OpenStack Swift v1.13.1
2014-05-19 21:44:50 -04:00
Prashanth Pai
191e55b976 Revert: allow non-root user to run functests
This caused Jenkins to not run functests.

Signed-off-by: Prashanth Pai <ppai@redhat.com>
2014-05-08 15:01:01 +05:30
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
Thiago da Silva
b6d1671b61 Merge pull request #12 from pushpesh/functionalnosetestremove
Functionalnosetestremove
2014-05-07 07:56:13 -04:00
Thiago da Silva
962622b102 Merge pull request #8 from thiagol11/update_readme
updated README.md to Swift-On-File
2014-05-06 15:58:31 -04:00
Thiago da Silva
45608577de Merge pull request #9 from prashanthpai/spec-expirer
Fix object-expirer.conf-gluster RPM build error
2014-05-06 15:57:27 -04:00
Pushpesh Sharma
be0ae7e1c6 Minor update 2014-05-06 16:28:39 +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
Prashanth Pai
8ab1069410 Fix object-expirer.conf-gluster RPM build error
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2014-05-05 10:21:35 +05:30
Thiago da Silva
afee30faf0 added new support filesystem section
Also, called out the fact that the quick start guide
focus on glusterfs

Signed-off-by: Thiago da Silva <thiago@redhat.com>
2014-05-02 16:07:48 -04:00
Thiago da Silva
527b01f0cc updated README.md to Swift-On-File
Signed-off-by: Thiago da Silva <thiago@redhat.com>
2014-05-02 15:37:10 -04:00
Thiago da Silva
9a240c7a0d Merge pull request #3 from thiagol11/add_jenkins_to_travis
adding support to run jenkins triggered by travis
2014-04-30 07:24:07 -04:00
Thiago da Silva
34b5a8bf7d removing blank lines
Signed-off-by: Thiago da Silva <thiago@redhat.com>
2014-04-28 19:30:38 -04:00
Thiago da Silva
3568b6457c fixing missing fi
Signed-off-by: Thiago da Silva <thiago@redhat.com>
2014-04-28 15:45:44 -04:00
Thiago da Silva
d8f5b0f36a adding support to run jenkins triggered by travis
Signed-off-by: Thiago da Silva <thiago@redhat.com>
2014-04-28 15:34:39 -04:00
Thiago da Silva
8041944598 Update README.md 2014-04-22 14:58:18 -04:00
Thiago da Silva
c015148c36 Merge pull request #2 from thiagol11/master
Adding travis unit testing
2014-04-22 14:56:38 -04:00
Thiago da Silva
3ddd952fc6 fixing travis file to run correct unit test
Signed-off-by: Thiago da Silva <thiago@redhat.com>
2014-04-22 14:41:09 -04:00
Thiago da Silva
c582669ded adding travis status badge to README
Signed-off-by: Thiago da Silva <thiago@redhat.com>
2014-04-22 14:35:28 -04:00
Thiago da Silva
809309618e adding py26 unit testing to travis
Signed-off-by: Thiago da Silva <thiago@redhat.com>
2014-04-22 14:29:46 -04:00
Thiago da Silva
37835fdf72 trigger travis build
Signed-off-by: Thiago da Silva <thiago@redhat.com>
2014-04-22 14:24:37 -04:00
Thiago da Silva
cb6332a188 adding travis ci testing
adding .travis.yml file to enable unit testing run by travis

Signed-off-by: Thiago da Silva <thiago@redhat.com>
2014-04-22 14:15:02 -04:00
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
7af0525a00 removing _make_directory_locked function
This function was added as a workaround for race condition
bug found in earlier versions of Glusterfs. The bug has since
been fixed in the latest version of Glusterfs, so there's no
need to support this code any longer.

Change-Id: I50ebb66bdf0553ae8bab98ed8f783e0389e83fa8
Signed-off-by: Thiago da Silva <thiago@redhat.com>
Reviewed-on: http://review.gluster.org/7335
Reviewed-by: Luis Pabon <lpabon@redhat.com>
Tested-by: Luis Pabon <lpabon@redhat.com>
2014-03-26 13:30:58 -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
73aa6e7883 Update quick_start_guide.md
Author: John Dickinson
Original pull request can be found here:
https://github.com/gluster/gluster-swift/pull/2

Change-Id: Id5cd45e7090f69407938e5f9431560ed0977b22d
Signed-off-by: Prashanth Pai <ppai@redhat.com>
Reviewed-on: http://review.gluster.org/7234
Reviewed-by: Thiago da Silva <thiago@redhat.com>
Reviewed-by: Luis Pabon <lpabon@redhat.com>
Tested-by: Luis Pabon <lpabon@redhat.com>
2014-03-14 11:54:59 -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
Chetan Risbud
47cbf09a22 Restart memcached after clean-up-token --purge-all
Bug: https://bugs.launchpad.net/gluster-swift/+bug/1269444

Recommended way is to flush the cached tokens from memcached after
gswauth-clean-up-token. As currently there is no way to flush only those
tokens from memcached. So a debug message recommending restart of the
memcached. A quick fix. Bigger fix would come in later.

Older cached tokens should be flushed/invalidated to let access path work
correctly with valid and new tokens.

Change-Id: Ic7a820eb3c60bac4829d5c5230cb3a5241b77957
Signed-off-by: Chetan Risbud <crisbud@redhat.com>
Reviewed-on: http://review.gluster.org/7168
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>
2014-03-11 04:24:30 -07:00
Luis Pabon
369050cb57 Update Havana link to 1.10.0-2
Change-Id: Ib0765d2109645a2da0e2e58b176ad26b932d7b99
Signed-off-by: Luis Pabon <lpabon@redhat.com>
Reviewed-on: http://review.gluster.org/7159
2014-02-25 19:39:51 -08: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
Antonio Messina
33988c9312 Update keystone authentication documentation
Add detailed information on how to configure gluster-swift
to use Keystone as an authentication source.

Change-Id: I9e3ea72378e3f85db45e0ab0320d43591976e038
Signed-off-by: Antonio Messina <antonio.s.messina@gmail.com>
Reviewed-on: http://review.gluster.org/6956
Reviewed-by: Luis Pabon <lpabon@redhat.com>
Tested-by: Luis Pabon <lpabon@redhat.com>
2014-02-14 08:42:10 -08:00
Thiago da Silva
fc8d5eb1dd simplifying instructions in auth guide
Attempted to simplify the instructions around authenticating with
swift client.

Provided users a basic and more advanced method of authenticating.
The previous version only listed the advanced method, which is still
necessary because it instructs reseller admins on how to access
other accounts

Bug: https://bugs.launchpad.net/gluster-swift/+bug/1267445

Change-Id: I99cae591627616206fb5277af4b636b8dd2ca3cd
Signed-off-by: Thiago da Silva <thiago@redhat.com>
Reviewed-on: http://review.gluster.org/6863
Reviewed-by: pushpesh sharma <psharma@redhat.com>
Reviewed-by: Prashanth Pai <ppai@redhat.com>
Reviewed-by: Chetan Risbud <crisbud@redhat.com>
Tested-by: Chetan Risbud <crisbud@redhat.com>
2014-02-10 22:38:04 -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