diff options
author | Prashanth Pai <ppai@redhat.com> | 2014-01-28 12:13:33 +0530 |
---|---|---|
committer | Chetan Risbud <crisbud@redhat.com> | 2014-03-24 22:14:15 -0700 |
commit | 2014cdb9066e273cf791f38b1c8247427c76cfa9 (patch) | |
tree | 4ad9a3bd0e604ce7fdab16ed007dbdd56386f5eb /test/unit/proxy/test_server.py | |
parent | 2505d8281593730d8b31794d0fe8132417c34a48 (diff) |
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>
Diffstat (limited to 'test/unit/proxy/test_server.py')
-rw-r--r-- | test/unit/proxy/test_server.py | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/test/unit/proxy/test_server.py b/test/unit/proxy/test_server.py index 4086a32..0cb2278 100644 --- a/test/unit/proxy/test_server.py +++ b/test/unit/proxy/test_server.py @@ -3461,7 +3461,6 @@ class TestObjectController(unittest.TestCase): self.assert_(called[0]) def test_POST_converts_delete_after_to_delete_at(self): - raise SkipTest("X-Delete-At and X-Delete-After are not supported") with save_globals(): controller = proxy_server.ObjectController(self.app, 'account', 'container', 'object') @@ -3498,7 +3497,6 @@ class TestObjectController(unittest.TestCase): time.time = orig_time def test_POST_non_int_delete_after(self): - raise SkipTest("X-Delete-At and X-Delete-After are not supported") with save_globals(): controller = proxy_server.ObjectController(self.app, 'account', 'container', 'object') @@ -3513,7 +3511,6 @@ class TestObjectController(unittest.TestCase): self.assertTrue('Non-integer X-Delete-After' in res.body) def test_POST_negative_delete_after(self): - raise SkipTest("X-Delete-At and X-Delete-After are not supported") with save_globals(): controller = proxy_server.ObjectController(self.app, 'account', 'container', 'object') @@ -3528,7 +3525,6 @@ class TestObjectController(unittest.TestCase): self.assertTrue('X-Delete-At in past' in res.body) def test_POST_delete_at(self): - raise SkipTest("X-Delete-At and X-Delete-After are not supported") with save_globals(): given_headers = {} @@ -3573,7 +3569,6 @@ class TestObjectController(unittest.TestCase): self.assertTrue('X-Delete-At in past' in resp.body) def test_PUT_converts_delete_after_to_delete_at(self): - raise SkipTest("X-Delete-At and X-Delete-After are not supported") with save_globals(): controller = proxy_server.ObjectController(self.app, 'account', 'container', 'object') @@ -3596,7 +3591,6 @@ class TestObjectController(unittest.TestCase): time.time = orig_time def test_PUT_non_int_delete_after(self): - raise SkipTest("X-Delete-At and X-Delete-After are not supported") with save_globals(): controller = proxy_server.ObjectController(self.app, 'account', 'container', 'object') @@ -3612,7 +3606,6 @@ class TestObjectController(unittest.TestCase): self.assertTrue('Non-integer X-Delete-After' in res.body) def test_PUT_negative_delete_after(self): - raise SkipTest("X-Delete-At and X-Delete-After are not supported") with save_globals(): controller = proxy_server.ObjectController(self.app, 'account', 'container', 'object') @@ -3628,7 +3621,6 @@ class TestObjectController(unittest.TestCase): self.assertTrue('X-Delete-At in past' in res.body) def test_PUT_delete_at(self): - raise SkipTest("X-Delete-At and X-Delete-After are not supported") with save_globals(): given_headers = {} @@ -4023,7 +4015,6 @@ class TestObjectController(unittest.TestCase): @mock.patch('time.time', new=lambda: STATIC_TIME) def test_PUT_x_delete_at_with_fewer_container_replicas(self): - raise SkipTest("X-Delete-At and X-Delete-After are not supported") self.app.container_ring.set_replicas(2) delete_at_timestamp = int(time.time()) + 100000 @@ -4059,7 +4050,6 @@ class TestObjectController(unittest.TestCase): @mock.patch('time.time', new=lambda: STATIC_TIME) def test_PUT_x_delete_at_with_more_container_replicas(self): - raise SkipTest("X-Delete-At and X-Delete-After are not supported") self.app.container_ring.set_replicas(4) self.app.expiring_objects_account = 'expires' self.app.expiring_objects_container_divisor = 60 |