From 9569cc82785ed1cffba1bf2a285ddd99bacaf51e Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Wed, 4 Apr 2018 11:31:37 -0700 Subject: [PATCH] qa/tasks/s3tests: configure mfa tests Signed-off-by: Yehuda Sadeh --- qa/tasks/s3tests.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/qa/tasks/s3tests.py b/qa/tasks/s3tests.py index a2664390de331..89e5a34b3f005 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: -- 2.39.5