From a2a5b6aa6664b61fa31d25f329426ff089372f17 Mon Sep 17 00:00:00 2001 From: Samuel Merritt Date: Thu, 16 Apr 2015 11:42:12 -0700 Subject: [PATCH] Functional test for SLO PUT overwriting one of its own segments Change-Id: I4855816848f4fdb148d0b82735cf79bc68429617 --- test/functional/tests.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/functional/tests.py b/test/functional/tests.py index 95f168e6e8..3fbbdd784e 100644 --- a/test/functional/tests.py +++ b/test/functional/tests.py @@ -2259,6 +2259,26 @@ class TestSlo(Base): else: self.fail("Expected ResponseError but didn't get it") + def test_slo_overwrite_segment_with_manifest(self): + file_item = self.env.container.file("seg_b") + try: + file_item.write( + json.dumps([ + {'size_bytes': 1024 * 1024, + 'etag': hashlib.md5('a' * 1024 * 1024).hexdigest(), + 'path': '/%s/%s' % (self.env.container.name, 'seg_a')}, + {'size_bytes': 1024 * 1024, + 'etag': hashlib.md5('b' * 1024 * 1024).hexdigest(), + 'path': '/%s/%s' % (self.env.container.name, 'seg_b')}, + {'size_bytes': 1024 * 1024, + 'etag': hashlib.md5('c' * 1024 * 1024).hexdigest(), + 'path': '/%s/%s' % (self.env.container.name, 'seg_c')}]), + parms={'multipart-manifest': 'put'}) + except ResponseError as err: + self.assertEqual(409, err.status) + else: + self.fail("Expected ResponseError but didn't get it") + def test_slo_copy(self): file_item = self.env.container.file("manifest-abcde") file_item.copy(self.env.container.name, "copied-abcde")