s3tests_conf[section].setdefault('display_name', 'Mr. {user}'.format(user=user))
s3tests_conf[section].setdefault('access_key', ''.join(random.choice(string.uppercase) for i in xrange(20)))
s3tests_conf[section].setdefault('secret_key', base64.b64encode(os.urandom(40)))
+ s3tests_conf[section].setdefault('totp_serial', ''.join(random.choice(string.digits) for i in xrange(10)))
+ s3tests_conf[section].setdefault('totp_seed', base64.b32encode(os.urandom(40)))
+ s3tests_conf[section].setdefault('totp_seconds', '5')
@contextlib.contextmanager
'--cluster', cluster_name,
],
)
+ ctx.cluster.only(client).run(
+ args=[
+ 'adjust-ulimits',
+ 'ceph-coverage',
+ '{tdir}/archive/coverage'.format(tdir=testdir),
+ 'radosgw-admin',
+ '-n', client_with_id,
+ 'mfa', 'create',
+ '--uid', s3tests_conf[section]['user_id'],
+ '--totp-serial', s3tests_conf[section]['totp_serial'],
+ '--totp-seed', s3tests_conf[section]['totp_seed'],
+ '--totp-seconds', s3tests_conf[section]['totp_seconds'],
+ '--totp-window', '8',
+ '--totp-seed-type', 'base32',
+ '--cluster', cluster_name,
+ ],
+ )
try:
yield
finally:
"""
assert isinstance(config, dict)
testdir = teuthology.get_testdir(ctx)
- attrs = ["!fails_on_rgw", "!lifecycle"]
- # beast parser is strict about unreadable headers
- if ctx.rgw.frontend == 'beast':
- attrs.append("!fails_strict_rfc2616")
+ # civetweb > 1.8 && beast parsers are strict on rfc2616
+ attrs = ["!fails_on_rgw", "!lifecycle_expiration", "!fails_strict_rfc2616"]
for client, client_config in config.iteritems():
+ (remote,) = ctx.cluster.only(client).remotes.keys()
args = [
'S3TEST_CONF={tdir}/archive/s3-tests.{client}.conf'.format(tdir=testdir, client=client),
- 'BOTO_CONFIG={tdir}/boto.cfg'.format(tdir=testdir),
+ 'BOTO_CONFIG={tdir}/boto.cfg'.format(tdir=testdir)
+ ]
+ # the 'requests' library comes with its own ca bundle to verify ssl
+ # certificates - override that to use the system's ca bundle, which
+ # is where the ssl task installed this certificate
+ if remote.os.package_type == 'deb':
+ args += ['REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt']
+ else:
+ args += ['REQUESTS_CA_BUNDLE=/etc/pki/tls/certs/ca-bundle.crt']
+ args += [
'{tdir}/s3-tests/virtualenv/bin/nosetests'.format(tdir=testdir),
'-w',
'{tdir}/s3-tests'.format(tdir=testdir),
if client_config is not None and 'extra_args' in client_config:
args.extend(client_config['extra_args'])
- ctx.cluster.only(client).run(
+ remote.run(
args=args,
label="s3 tests against rgw"
)
client.1:
extra_args: ['--exclude', 'test_100_continue']
"""
+ assert hasattr(ctx, 'rgw'), 's3tests must run after the rgw task'
assert config is None or isinstance(config, list) \
or isinstance(config, dict), \
"task s3tests only supports a list or dictionary for configuration"
s3tests_conf = {}
for client in clients:
+ endpoint = ctx.rgw.role_endpoints.get(client)
+ assert endpoint, 's3tests: no rgw endpoint for {}'.format(client)
+
s3tests_conf[client] = ConfigObj(
indent_type='',
infile={
'DEFAULT':
{
- 'port' : 7280,
- 'is_secure' : 'no',
+ 'port' : endpoint.port,
+ 'is_secure' : 'yes' if endpoint.cert else 'no',
+ 'api_name' : 'default',
},
'fixtures' : {},
's3 main' : {},