Compare commits

...
Sign in to create a new pull request.

2 commits

Author SHA1 Message Date
Yehuda Sadeh
f3fdbc384b s3_test: add test for listing objects with special prefix
Check for ceph issue #5362. Prefix starts with underscore.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2013-06-17 11:46:54 -07:00
Yehuda Sadeh
b9a5858523 test_s3: basic cors test
related to issue #5261

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
2013-06-06 11:19:05 -07:00
2 changed files with 31 additions and 1 deletions

View file

@ -1,6 +1,6 @@
PyYAML
nose >=1.0.0
boto ==2.4.1
boto >=2.6.0
bunch >=1.0.0
# 0.14 switches to libev, that means bootstrap needs to change too
gevent ==0.13.6

View file

@ -34,6 +34,7 @@ import AnonymousAuth
from email.header import decode_header
from ordereddict import OrderedDict
from boto.s3.cors import CORSConfiguration
from . import (
nuke_prefixed_buckets,
@ -3789,6 +3790,20 @@ def test_bucket_create_special_key_names():
names = [e.name for e in list(li)]
eq(names, key_names)
@attr(resource='bucket')
@attr(method='get')
@attr(operation='create and list objects with underscore as prefix, list using prefix')
@attr(assertion='listing works correctly')
def test_bucket_list_special_prefix():
key_names = ['_bla/1', '_bla/2', '_bla/3', '_bla/4', 'abcd']
bucket = _create_keys(keys=key_names)
li = bucket.get_all_keys()
eq(len(li), 5)
li2 = bucket.get_all_keys(prefix='_bla/')
eq(len(li2), 4)
@attr(resource='object')
@attr(method='put')
@attr(operation='copy zero sized object in same bucket')
@ -4058,6 +4073,21 @@ def test_stress_bucket_acls_changes():
for i in xrange(10):
_test_bucket_acls_changes_persistent(bucket);
@attr(resource='bucket')
@attr(method='put')
@attr(operation='set cors')
@attr(assertion='succeeds')
def test_set_cors():
bucket = get_new_bucket()
cfg = CORSConfiguration()
cfg.add_rule('GET', '*')
e = assert_raises(boto.exception.S3ResponseError, bucket.get_cors)
eq(e.status, 404)
bucket.set_cors(cfg)
new_cfg = bucket.get_cors()
class FakeFile(object):
"""
file that simulates seek, tell, and current character