From f1d1e3542fa596330ff950973df3eada9d32b1b4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alfonso=20Mart=C3=ADnez?= Date: Mon, 11 Jan 2021 15:34:34 +0100 Subject: [PATCH] mgr/dashboard: fix issues from cherry-pick conflict resolution MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit src/test/mgr/mgr-dashboard-smoke.sh src/vstart.sh - Add 'tell mgr' in ac-user-create command. src/pybind/mgr/dashboard/tests/test_access_control.py qa/tasks/mgr/dashboard/test_auth.py - Remove 'force_password' argument. qa/tasks/mgr/dashboard/test_rgw.py - Fix test_status test. cherry-pick commit: b82478e1061bfc1475693b0910a7f14276b4d6ab Fixes: https://tracker.ceph.com/issues/48355 Signed-off-by: Alfonso Martínez --- qa/tasks/mgr/dashboard/test_auth.py | 2 +- qa/tasks/mgr/dashboard/test_rgw.py | 4 ++-- src/pybind/mgr/dashboard/tests/test_access_control.py | 3 +-- src/test/mgr/mgr-dashboard-smoke.sh | 2 +- src/vstart.sh | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/qa/tasks/mgr/dashboard/test_auth.py b/qa/tasks/mgr/dashboard/test_auth.py index 6603b85928ba..87bdd8771bd9 100644 --- a/qa/tasks/mgr/dashboard/test_auth.py +++ b/qa/tasks/mgr/dashboard/test_auth.py @@ -33,7 +33,7 @@ class AuthTest(DashboardTestCase): def test_login_without_password(self): with self.assertRaises(CommandFailedError): - self.create_user('admin2', '', ['administrator'], force_password=True) + self.create_user('admin2', '', ['administrator']) def test_a_set_login_credentials(self): self.create_user('admin2', 'admin2', ['administrator']) diff --git a/qa/tasks/mgr/dashboard/test_rgw.py b/qa/tasks/mgr/dashboard/test_rgw.py index 64c185291d3d..9e781142069b 100644 --- a/qa/tasks/mgr/dashboard/test_rgw.py +++ b/qa/tasks/mgr/dashboard/test_rgw.py @@ -332,8 +332,8 @@ class RgwDaemonTest(DashboardTestCase): '--system', '--access-key=admin', '--secret=admin' ]) self._ceph_cmd(['dashboard', 'set-rgw-api-user-id', 'admin']) - self._ceph_cmd(['dashboard', 'set-rgw-api-secret-key', 'admin']) - self._ceph_cmd(['dashboard', 'set-rgw-api-access-key', 'admin']) + self._ceph_cmd_with_secret(['dashboard', 'set-rgw-api-secret-key'], 'admin') + self._ceph_cmd_with_secret(['dashboard', 'set-rgw-api-access-key'], 'admin') data = self._get('/api/rgw/status') self.assertStatus(200) diff --git a/src/pybind/mgr/dashboard/tests/test_access_control.py b/src/pybind/mgr/dashboard/tests/test_access_control.py index 268a4f1861e9..1a479aa67fde 100644 --- a/src/pybind/mgr/dashboard/tests/test_access_control.py +++ b/src/pybind/mgr/dashboard/tests/test_access_control.py @@ -566,8 +566,7 @@ class AccessControlTest(unittest.TestCase, CLICommandTestMixin): def test_set_user_password_empty(self): with self.assertRaises(CmdException) as ctx: - self.exec_cmd('ac-user-set-password', username='admin', inbuf='\n', - force_password=True) + self.exec_cmd('ac-user-set-password', username='admin', inbuf='\n') self.assertEqual(ctx.exception.retcode, -errno.EINVAL) self.assertEqual(str(ctx.exception), ERROR_MSG_EMPTY_INPUT_FILE) diff --git a/src/test/mgr/mgr-dashboard-smoke.sh b/src/test/mgr/mgr-dashboard-smoke.sh index 99dfb26b5e3a..c3f2a822efc7 100755 --- a/src/test/mgr/mgr-dashboard-smoke.sh +++ b/src/test/mgr/mgr-dashboard-smoke.sh @@ -54,7 +54,7 @@ function TEST_dashboard() { DASHBOARD_ADMIN_SECRET_FILE="/tmp/dashboard-admin-secret.txt" printf 'admin' > "${DASHBOARD_ADMIN_SECRET_FILE}" - ceph_adm dashboard ac-user-create admin -i "${DASHBOARD_ADMIN_SECRET_FILE}" + ceph_adm tell mgr dashboard ac-user-create admin -i "${DASHBOARD_ADMIN_SECRET_FILE}" tries=0 while [[ $tries < 30 ]] ; do diff --git a/src/vstart.sh b/src/vstart.sh index f7dabd74c0b4..8174c3e5a848 100755 --- a/src/vstart.sh +++ b/src/vstart.sh @@ -830,7 +830,7 @@ EOF if $with_mgr_dashboard; then DASHBOARD_ADMIN_SECRET_FILE="${CEPH_CONF_PATH}/dashboard-admin-secret.txt" printf 'admin' > "${DASHBOARD_ADMIN_SECRET_FILE}" - ceph_adm dashboard ac-user-create admin -i "${DASHBOARD_ADMIN_SECRET_FILE}" \ + ceph_adm tell mgr dashboard ac-user-create admin -i "${DASHBOARD_ADMIN_SECRET_FILE}" \ administrator if [ "$ssl" != "0" ]; then if ! ceph_adm tell mgr dashboard create-self-signed-cert; then -- 2.47.3