Compare commits

...

8 commits

Author SHA1 Message Date
Ali Maredia
6f1050c9cb
Merge pull request #432 from psathyan/fix_43
Fix versioning tests failures due multiple removal of object
2022-03-02 10:35:03 -05:00
Pragadeeswaran Sathyanarayanan
d64681cba0
Fix versioning tests failures due multiple removal of object
Signed-off-by: Pragadeeswaran Sathyanarayanan <psathyan@redhat.com>
2022-03-02 19:37:52 +05:30
Ali Maredia
3c76774ad9
Merge pull request #366 from uweigand/nautilus-endianfix
[ceph-nautilus] Fix fuzzer test on big-endian systems
2020-11-23 19:07:06 -05:00
Ulrich Weigand
a3cbe2eab2 [ceph-nautilus] Fix fuzzer test on big-endian systems
Currently, the test_expand_random_binary test fails on big-endian
systems.  It turns out that this is because the special_random
routine in RepeatExpandingFormatter uses struct.pack in a manner
where the returned byte sequence depends on host byte order.

Fixed this to enforce the same output across platforms.
2020-11-03 13:18:21 +01:00
Casey Bodley
bc5b09b24e
Merge pull request #349 from tchaikov/ceph-nautilus-s3test-setuptools
bootstrap,requirements.txt: bump up setuptools and requests
2020-05-26 09:07:53 -04:00
Kefu Chai
e58fe8d627 bootstrap,requirements.txt: bump up setuptools and requests
Fixes: https://tracker.ceph.com/issues/45691
Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit b7f47c2a31)

Conflicts:
	bootstrap: trivial resolution
2020-05-26 21:05:49 +08:00
Ali Maredia
af1529053c boto2: rm functional.test_s3.test_lifecycle_rules_conflict
The assumption that there may be only one rule per prefix has
been removed.  The rules specifically tested here--without tag
filters--do overlap but are not in conflict.

I am proposing to remove altogether rather than writing new
deconfliction logic.

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Signed-off-by: Ali Maredia <amaredia@redhat.com>
2019-05-24 12:44:19 -04:00
Kefu Chai
80c3f690ce bootstrap: add libffi-dev for gevent
because gevent 1.3.2 requires cffi>=1.11.5, and cffi requires
libffi-dev to build.

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit a2b3e4ef77)
2018-05-31 00:30:53 +08:00
4 changed files with 10 additions and 24 deletions

View file

@ -2,7 +2,7 @@
set -e
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
# add a space after old values
missing="${missing:+$missing }$package"
@ -13,7 +13,7 @@ if [ -f /etc/debian_version ]; then
sudo apt-get -y install $missing
fi
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
missing="${missing:+$missing }$package"
fi
@ -23,7 +23,7 @@ elif [ -f /etc/fedora-release ]; then
sudo yum -y install $missing
fi
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
missing="${missing:+$missing }$package"
fi
@ -39,8 +39,8 @@ virtualenv --no-site-packages --distribute virtualenv
# avoid pip bugs
./virtualenv/bin/pip install --upgrade pip
# slightly old version of setuptools; newer fails w/ requests 0.14.0
./virtualenv/bin/pip install setuptools==32.3.1
# latest setuptools supporting python 2.7
./virtualenv/bin/pip install setuptools==44.1.0
./virtualenv/bin/pip install -r requirements.txt

View file

@ -5,7 +5,7 @@ bunch >=1.0.0
# 0.14 switches to libev, that means bootstrap needs to change too
gevent >=1.0
isodate >=0.4.4
requests >=0.14.0
requests >=2.23.0
pytz >=2011k
ordereddict
httplib2

View file

@ -6854,8 +6854,9 @@ def _do_remove_versions(bucket, objname, remove_start_idx, idx_inc, head_rm_rati
for j in xrange(total):
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)
else:
remove_obj_version(bucket, k, c, idx)
@ -7775,21 +7776,6 @@ def test_lifecycle_invalid_status():
eq(e.status, 400)
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):
body = '<?xml version="1.0" encoding="UTF-8"?><LifecycleConfiguration>'
for rule in rules:

View file

@ -189,7 +189,7 @@ class RepeatExpandingFormatter(string.Formatter):
if charset_arg == 'binary' or charset_arg == 'binary_no_whitespace':
num_bytes = length + 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':
tmpstring = ''.join(c for c in tmpstring if c not in string.whitespace)
return tmpstring[0:length]