From 6315c1bb6880a794339a7a219b9ffaf07abf52c9 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Fri, 3 Oct 2014 15:09:27 -0700 Subject: [PATCH] test_s3: add is_slow_backend for slow ec region copy Signed-off-by: Yehuda Sadeh (cherry picked from commit 97beb9c816687c5a1f6a6c1e8b1d1ca786fe3520) --- s3tests/functional/__init__.py | 9 +++++++++ s3tests/functional/test_s3.py | 10 ++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/s3tests/functional/__init__.py b/s3tests/functional/__init__.py index 26e55de..51dd506 100644 --- a/s3tests/functional/__init__.py +++ b/s3tests/functional/__init__.py @@ -26,6 +26,9 @@ def get_prefix(): assert prefix is not None return prefix +def is_slow_backend(): + return slow_backend + def choose_bucket_prefix(template, max_len=30): """ Choose a prefix for our test buckets, so they're easy to identify. @@ -237,6 +240,7 @@ def setup(): global prefix global targets + global slow_backend try: template = cfg.get('fixtures', 'bucket prefix') @@ -244,6 +248,11 @@ def setup(): template = 'test-{random}-' prefix = choose_bucket_prefix(template=template) + try: + slow_backend = cfg.getboolean('fixtures', 'slow backend') + except (ConfigParser.NoSectionError, ConfigParser.NoOptionError): + slow_backend = False + # pull the default_region out, if it exists try: default_region = cfg.get('fixtures', 'default_region') diff --git a/s3tests/functional/test_s3.py b/s3tests/functional/test_s3.py index b50e558..5544f2b 100644 --- a/s3tests/functional/test_s3.py +++ b/s3tests/functional/test_s3.py @@ -47,6 +47,7 @@ from . import ( targets, config, get_prefix, + is_slow_backend, ) @@ -4806,6 +4807,7 @@ def test_region_bucket_create_master_access_remove_secondary(): e = assert_raises(boto.exception.S3ResponseError, master_conn.get_bucket, bucket.name) eq(e.status, 404) + @attr(resource='object') @attr(method='copy') @attr(operation='copy object between regions, verify') @@ -4821,8 +4823,12 @@ def test_region_copy_object(): print 'created new dest bucket ', dest_bucket.name region_sync_meta(targets.main, dest) - for file_size in (1024, 1024 * 1024, 10 * 1024 * 1024, - 100 * 1024 * 1024): + if is_slow_backend(): + sizes = (1024, 10 * 1024 * 1024) + else: + sizes = (1024, 10 * 1024 * 1024, 100 * 1024 * 1024) + + for file_size in sizes: for (k2, r) in targets.main.iteritems(): if r == dest_conn: continue