"""
Task for running RGW S3 tests with the AWS Java SDK
"""
-from cStringIO import StringIO
+from io import BytesIO
import logging
import base64
repo,
'{tdir}/s3-tests-java'.format(tdir=testdir),
],
- stdout=StringIO()
+ stdout=BytesIO()
)
if client in self.config and self.config[client] is not None:
if 'sha1' in self.config[client] and self.config[client]['sha1'] is not None:
testdir = teuthology.get_testdir(self.ctx)
self.ctx.cluster.only(client).run(
args=['{tdir}/s3-tests-java/bootstrap.sh'.format(tdir=testdir)],
- stdout=StringIO()
+ stdout=BytesIO()
)
endpoint = self.ctx.rgw.role_endpoints[client]
'-file', endpoint.cert.certificate,
'-storepass', 'changeit',
],
- stdout=StringIO()
+ stdout=BytesIO()
)
def create_users(self):
log.info('{args}'.format(args=args))
self.ctx.cluster.only(client).run(
args=args,
- stdout=StringIO()
+ stdout=BytesIO()
)
else:
self.users.pop(section)
with open('s3_tests_tmp.yaml', 'w') as outfile:
yaml.dump(cfg_dict, outfile, default_flow_style=False)
- conf_fp = StringIO()
- with open('s3_tests_tmp.yaml', 'r') as infile:
+ conf_fp = BytesIO()
+ with open('s3_tests_tmp.yaml', 'rb') as infile:
for line in infile:
conf_fp.write(line)
'{tdir}/s3-tests-java/config.properties'.format(
tdir=testdir)
],
- stdout=StringIO()
+ stdout=BytesIO()
)
args = ['cd',
'{tdir}/s3-tests-java'.format(tdir=testdir),
self.ctx.cluster.only(client).run(
args=['radosgw-admin', 'gc',
'process', '--include-all'],
- stdout=StringIO()
+ stdout=BytesIO()
)
if gr != 'All':
self.ctx.cluster.only(client).run(
args=args + ['--tests'] + [gr] + extra_args,
- stdout=StringIO()
+ stdout=BytesIO()
)
else:
self.ctx.cluster.only(client).run(
args=args + extra_args,
- stdout=StringIO()
+ stdout=BytesIO()
)
for i in range(2):
self.ctx.cluster.only(client).run(
args=['radosgw-admin', 'gc',
'process', '--include-all'],
- stdout=StringIO()
+ stdout=BytesIO()
)
def remove_tests(self, client):
'cat', self.log_name,
run.Raw('&&'),
'rm', self.log_name],
- stdout=StringIO()
+ stdout=BytesIO()
)
self.ctx.cluster.only(client).run(
'-rf',
'{tdir}/s3-tests-java'.format(tdir=testdir),
],
- stdout=StringIO()
+ stdout=BytesIO()
)
def delete_users(self, client):
'--purge-data',
'--cluster', 'ceph',
],
- stdout=StringIO()
+ stdout=BytesIO()
)