From 9bac523f2bd595112ea1d9c322626752c7c379bc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alfonso=20Mart=C3=ADnez?= Date: Tue, 21 Apr 2020 15:27:06 +0200 Subject: [PATCH] mgr/dashboard: fix tasks.mgr.dashboard.test_rgw.RgwBucketTest.test_all MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Increased the time for getting 2nd TOTP. Fixes: https://tracker.ceph.com/issues/44405 Signed-off-by: Alfonso Martínez (cherry picked from commit ee2b2d19781e531770350ad2abe53ce876cebe3b) --- qa/tasks/mgr/dashboard/test_rgw.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qa/tasks/mgr/dashboard/test_rgw.py b/qa/tasks/mgr/dashboard/test_rgw.py index 9cb3504b5ae35..47a6de2450ee8 100644 --- a/qa/tasks/mgr/dashboard/test_rgw.py +++ b/qa/tasks/mgr/dashboard/test_rgw.py @@ -116,7 +116,7 @@ class RgwBucketTest(RgwTestCase): _mfa_token_serial = '1' _mfa_token_seed = '23456723' - _mfa_token_time_step = 3 + _mfa_token_time_step = 2 AUTH_ROLES = ['rgw-manager'] @@ -152,7 +152,7 @@ class RgwBucketTest(RgwTestCase): totp_key = base64.b32decode(self._mfa_token_seed) totp = TOTP(totp_key, 6, SHA1(), self._mfa_token_time_step, backend=default_backend(), enforce_key_length=False) - time_value = time.time() + time_value = int(time.time()) return totp.generate(time_value) def test_all(self): @@ -241,7 +241,7 @@ class RgwBucketTest(RgwTestCase): self.assertEqual(data['mfa_delete'], 'Enabled') # Update bucket: disable versioning & MFA Delete. - time.sleep(self._mfa_token_time_step + 2) # Required to get new TOTP pin. + time.sleep(self._mfa_token_time_step * 3) # Required to get new TOTP pin. self._put( '/api/rgw/bucket/teuth-test-bucket', params={ -- 2.39.5