]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/s3tests: configure mfa tests
authorYehuda Sadeh <yehuda@redhat.com>
Wed, 4 Apr 2018 18:31:37 +0000 (11:31 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Mon, 9 Apr 2018 14:02:17 +0000 (07:02 -0700)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
qa/tasks/s3tests.py

index a2664390de3319a0d1aeb49484d8bb87df8e90e4..89e5a34b3f005834263a61c68442ece4912eda3f 100644 (file)
@@ -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: