summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGorka Eguileor <geguileo@redhat.com>2015-04-13 12:41:00 +0200
committerGorka Eguileor <geguileo@redhat.com>2015-06-18 13:37:09 +0200
commitef2447e9d273a37b896de05d0ddfe74220034596 (patch)
tree35b840c4227aca57c09862c9ba4eb1b9c3264af4
parent0ae8f4102e7aeebb75fe5f65c02ed9bfa76cebb5 (diff)
downloadglance_store-ef2447e9d273a37b896de05d0ddfe74220034596.tar.gz
Fix random test error in swift store delete
On random gate jobs gate-glance_store-python27 would fail with exception "swiftclient.exceptions.ClientException: Object DELETE failed" on test test_delete_with_some_segments_failing in tests.unit.test_swift_store. Error would happen when test_image_id's UUID ended in 001 or 003 as fake_delete_object method had a bug. Change-Id: If279d19d38507e12087b412a6f367850bd9bfb6f Closes-Bug: #1442517
-rw-r--r--glance_store/tests/unit/test_swift_store.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/glance_store/tests/unit/test_swift_store.py b/glance_store/tests/unit/test_swift_store.py
index d4547c8..c83381e 100644
--- a/glance_store/tests/unit/test_swift_store.py
+++ b/glance_store/tests/unit/test_swift_store.py
@@ -900,14 +900,14 @@ class SwiftTests(object):
def fake_get_container(container, **kwargs):
# Returning 5 fake segments
- return None, [{'name': '%s-%05d' % (test_image_id, x)}
+ return None, [{'name': '%s-%03d' % (test_image_id, x)}
for x in range(1, 6)]
def fake_delete_object(container, object_name):
# Simulate error on 1st and 3rd segments
global SWIFT_DELETE_OBJECT_CALLS
SWIFT_DELETE_OBJECT_CALLS += 1
- if object_name.endswith('001') or object_name.endswith('003'):
+ if object_name.endswith('-001') or object_name.endswith('-003'):
raise swiftclient.ClientException('Object DELETE failed')
else:
pass