forked from TrueCloudLab/s3-tests
Compare commits
8 commits
master
...
ceph-nauti
Author | SHA1 | Date | |
---|---|---|---|
|
6f1050c9cb | ||
|
d64681cba0 | ||
|
3c76774ad9 | ||
|
a3cbe2eab2 | ||
|
bc5b09b24e | ||
|
e58fe8d627 | ||
|
af1529053c | ||
|
80c3f690ce |
4 changed files with 10 additions and 24 deletions
10
bootstrap
10
bootstrap
|
@ -2,7 +2,7 @@
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
if [ -f /etc/debian_version ]; then
|
if [ -f /etc/debian_version ]; then
|
||||||
for package in python-pip python-virtualenv python-dev libevent-dev libxml2-dev libxslt-dev zlib1g-dev; do
|
for package in python-pip python-virtualenv python-dev libevent-dev libffi-dev libxml2-dev libxslt-dev zlib1g-dev; do
|
||||||
if [ "$(dpkg --status -- $package 2>/dev/null|sed -n 's/^Status: //p')" != "install ok installed" ]; then
|
if [ "$(dpkg --status -- $package 2>/dev/null|sed -n 's/^Status: //p')" != "install ok installed" ]; then
|
||||||
# add a space after old values
|
# add a space after old values
|
||||||
missing="${missing:+$missing }$package"
|
missing="${missing:+$missing }$package"
|
||||||
|
@ -13,7 +13,7 @@ if [ -f /etc/debian_version ]; then
|
||||||
sudo apt-get -y install $missing
|
sudo apt-get -y install $missing
|
||||||
fi
|
fi
|
||||||
elif [ -f /etc/fedora-release ]; then
|
elif [ -f /etc/fedora-release ]; then
|
||||||
for package in python-pip python2-virtualenv python-devel libevent-devel libxml2-devel libxslt-devel zlib-devel; do
|
for package in python-pip python2-virtualenv python-devel libevent-devel libffi-devel libxml2-devel libxslt-devel zlib-devel; do
|
||||||
if [ "$(rpm -qa $package 2>/dev/null)" == "" ]; then
|
if [ "$(rpm -qa $package 2>/dev/null)" == "" ]; then
|
||||||
missing="${missing:+$missing }$package"
|
missing="${missing:+$missing }$package"
|
||||||
fi
|
fi
|
||||||
|
@ -23,7 +23,7 @@ elif [ -f /etc/fedora-release ]; then
|
||||||
sudo yum -y install $missing
|
sudo yum -y install $missing
|
||||||
fi
|
fi
|
||||||
elif [ -f /etc/redhat-release ]; then
|
elif [ -f /etc/redhat-release ]; then
|
||||||
for package in python-virtualenv python-devel libevent-devel libxml2-devel libxslt-devel zlib-devel; do
|
for package in python-virtualenv python-devel libevent-devel libffi-devel libxml2-devel libxslt-devel zlib-devel; do
|
||||||
if [ "$(rpm -qa $package 2>/dev/null)" == "" ]; then
|
if [ "$(rpm -qa $package 2>/dev/null)" == "" ]; then
|
||||||
missing="${missing:+$missing }$package"
|
missing="${missing:+$missing }$package"
|
||||||
fi
|
fi
|
||||||
|
@ -39,8 +39,8 @@ virtualenv --no-site-packages --distribute virtualenv
|
||||||
# avoid pip bugs
|
# avoid pip bugs
|
||||||
./virtualenv/bin/pip install --upgrade pip
|
./virtualenv/bin/pip install --upgrade pip
|
||||||
|
|
||||||
# slightly old version of setuptools; newer fails w/ requests 0.14.0
|
# latest setuptools supporting python 2.7
|
||||||
./virtualenv/bin/pip install setuptools==32.3.1
|
./virtualenv/bin/pip install setuptools==44.1.0
|
||||||
|
|
||||||
./virtualenv/bin/pip install -r requirements.txt
|
./virtualenv/bin/pip install -r requirements.txt
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ bunch >=1.0.0
|
||||||
# 0.14 switches to libev, that means bootstrap needs to change too
|
# 0.14 switches to libev, that means bootstrap needs to change too
|
||||||
gevent >=1.0
|
gevent >=1.0
|
||||||
isodate >=0.4.4
|
isodate >=0.4.4
|
||||||
requests >=0.14.0
|
requests >=2.23.0
|
||||||
pytz >=2011k
|
pytz >=2011k
|
||||||
ordereddict
|
ordereddict
|
||||||
httplib2
|
httplib2
|
||||||
|
|
|
@ -6854,8 +6854,9 @@ def _do_remove_versions(bucket, objname, remove_start_idx, idx_inc, head_rm_rati
|
||||||
|
|
||||||
for j in xrange(total):
|
for j in xrange(total):
|
||||||
r += head_rm_ratio
|
r += head_rm_ratio
|
||||||
if r >= 1:
|
|
||||||
r %= 1
|
# Head object can be removed only once.
|
||||||
|
if r == 1:
|
||||||
remove_obj_head(bucket, objname, k, c)
|
remove_obj_head(bucket, objname, k, c)
|
||||||
else:
|
else:
|
||||||
remove_obj_version(bucket, k, c, idx)
|
remove_obj_version(bucket, k, c, idx)
|
||||||
|
@ -7775,21 +7776,6 @@ def test_lifecycle_invalid_status():
|
||||||
eq(e.status, 400)
|
eq(e.status, 400)
|
||||||
eq(e.error_code, 'MalformedXML')
|
eq(e.error_code, 'MalformedXML')
|
||||||
|
|
||||||
@attr(resource='bucket')
|
|
||||||
@attr(method='put')
|
|
||||||
@attr(operation='rules conflicted in lifecycle')
|
|
||||||
@attr('lifecycle')
|
|
||||||
@attr(assertion='fails 400')
|
|
||||||
def test_lifecycle_rules_conflicted():
|
|
||||||
bucket = get_new_bucket()
|
|
||||||
lifecycle = create_lifecycle(rules=[{'id': 'rule1', 'days': 2, 'prefix': 'test1/', 'status': 'Enabled'},
|
|
||||||
{'id': 'rule2', 'days': 3, 'prefix': 'test3/', 'status': 'Enabled'},
|
|
||||||
{'id': 'rule3', 'days': 5, 'prefix': 'test1/abc', 'status': 'Enabled'}])
|
|
||||||
e = assert_raises(boto.exception.S3ResponseError, bucket.configure_lifecycle, lifecycle)
|
|
||||||
eq(e.status, 400)
|
|
||||||
eq(e.error_code, 'InvalidRequest')
|
|
||||||
|
|
||||||
|
|
||||||
def generate_lifecycle_body(rules):
|
def generate_lifecycle_body(rules):
|
||||||
body = '<?xml version="1.0" encoding="UTF-8"?><LifecycleConfiguration>'
|
body = '<?xml version="1.0" encoding="UTF-8"?><LifecycleConfiguration>'
|
||||||
for rule in rules:
|
for rule in rules:
|
||||||
|
|
|
@ -189,7 +189,7 @@ class RepeatExpandingFormatter(string.Formatter):
|
||||||
if charset_arg == 'binary' or charset_arg == 'binary_no_whitespace':
|
if charset_arg == 'binary' or charset_arg == 'binary_no_whitespace':
|
||||||
num_bytes = length + 8
|
num_bytes = length + 8
|
||||||
tmplist = [self.prng.getrandbits(64) for _ in xrange(num_bytes / 8)]
|
tmplist = [self.prng.getrandbits(64) for _ in xrange(num_bytes / 8)]
|
||||||
tmpstring = struct.pack((num_bytes / 8) * 'Q', *tmplist)
|
tmpstring = struct.pack('<' + (num_bytes / 8) * 'Q', *tmplist)
|
||||||
if charset_arg == 'binary_no_whitespace':
|
if charset_arg == 'binary_no_whitespace':
|
||||||
tmpstring = ''.join(c for c in tmpstring if c not in string.whitespace)
|
tmpstring = ''.join(c for c in tmpstring if c not in string.whitespace)
|
||||||
return tmpstring[0:length]
|
return tmpstring[0:length]
|
||||||
|
|
Loading…
Reference in a new issue