From 73ded056aff0f25605fee2a633f3d13e0369606a Mon Sep 17 00:00:00 2001 From: Christian Schwede Date: Tue, 1 Dec 2015 14:59:35 +0000 Subject: [PATCH] Add functional test for repeated SLO segments Currently fails on master, passes with change If13af444ed301ebd8fd34a0d96a330ded648f0c4 applied. Change-Id: I05b231cc232d5b4117bccee40eebc7093114c61c --- test/functional/tests.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/functional/tests.py b/test/functional/tests.py index 007b2c6e4d..571a6b3473 100644 --- a/test/functional/tests.py +++ b/test/functional/tests.py @@ -2645,6 +2645,17 @@ class TestSloEnv(object): 'size_bytes': None}, ]), parms={'multipart-manifest': 'put'}) + file_item = cls.container.file("ranged-manifest-repeated-segment") + file_item.write( + json.dumps([ + {'path': seg_info['seg_a']['path'], 'etag': None, + 'size_bytes': None, 'range': '-1048578'}, + {'path': seg_info['seg_a']['path'], 'etag': None, + 'size_bytes': None}, + {'path': seg_info['seg_b']['path'], 'etag': None, + 'size_bytes': None, 'range': '-1048578'}, + ]), parms={'multipart-manifest': 'put'}) + class TestSlo(Base): env = TestSloEnv @@ -2694,6 +2705,15 @@ class TestSlo(Base): ('c', 1), ('d', 1)], grouped_file_contents) + def test_slo_get_ranged_manifest_repeated_segment(self): + file_item = self.env.container.file('ranged-manifest-repeated-segment') + grouped_file_contents = [ + (char, sum(1 for _char in grp)) + for char, grp in itertools.groupby(file_item.read())] + self.assertEqual( + [('a', 2097152), ('b', 1048576)], + grouped_file_contents) + def test_slo_get_ranged_submanifest(self): file_item = self.env.container.file('ranged-submanifest') grouped_file_contents = [