From: Yehuda Sadeh Date: Wed, 4 Apr 2018 18:31:37 +0000 (-0700) Subject: qa/tasks/s3tests: configure mfa tests X-Git-Tag: v13.1.0~343^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9569cc82785ed1cffba1bf2a285ddd99bacaf51e;p=ceph.git qa/tasks/s3tests: configure mfa tests Signed-off-by: Yehuda Sadeh --- diff --git a/qa/tasks/s3tests.py b/qa/tasks/s3tests.py index a2664390de33..89e5a34b3f00 100644 --- a/qa/tasks/s3tests.py +++ b/qa/tasks/s3tests.py @@ -88,6 +88,9 @@ def _config_user(s3tests_conf, section, user): 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 @@ -124,6 +127,23 @@ def create_users(ctx, config): '--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: