]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: set rgw credentials: fix api tests 42252/head
authorAlfonso Martínez <almartin@redhat.com>
Wed, 11 Aug 2021 06:59:13 +0000 (08:59 +0200)
committerAlfonso Martínez <almartin@redhat.com>
Wed, 11 Aug 2021 06:59:13 +0000 (08:59 +0200)
Fixes: https://tracker.ceph.com/issues/44605
Signed-off-by: Alfonso Martínez <almartin@redhat.com>
qa/tasks/mgr/dashboard/test_rgw.py
qa/tasks/mgr/dashboard/test_settings.py
src/pybind/mgr/dashboard/run-backend-api-tests.sh

index b7d650f41602056d54e88595aee78e955b7a6f0d..b973a2be4820d5602342eed941a9b83eb0445a5c 100644 (file)
@@ -70,20 +70,11 @@ class RgwApiCredentialsTest(RgwTestCase):
 
     AUTH_ROLES = ['rgw-manager']
 
-    def setUp(self):
-        super(RgwApiCredentialsTest, self).setUp()
-        # Restart the Dashboard module to ensure that the connection to the
-        # RGW Admin Ops API is re-established with the new credentials.
-        self.logout()
-        self._ceph_cmd(['mgr', 'module', 'disable', 'dashboard'])
-        self._ceph_cmd(['mgr', 'module', 'enable', 'dashboard', '--force'])
-        super(RgwApiCredentialsTest, self).setUp()
-
     def test_invalid_credentials(self):
         self._ceph_cmd_with_secret(['dashboard', 'set-rgw-api-secret-key'], 'invalid')
         self._ceph_cmd_with_secret(['dashboard', 'set-rgw-api-access-key'], 'invalid')
         resp = self._get('/api/rgw/user')
-        self.assertStatus(500)
+        self.assertStatus(404)
         self.assertIn('detail', resp)
         self.assertIn('component', resp)
         self.assertIn('Error connecting to Object Gateway', resp['detail'])
index 869ea2ca445fb8b4de88e66791ee536a1739b424..d6ad1e762e38e7d2b8a99f2747b406a6ae7fc4fc 100644 (file)
@@ -51,15 +51,15 @@ class SettingsTest(DashboardTestCase):
 
     def test_bulk_set(self):
         self._put('/api/settings', {
-            'USER_PWD_EXPIRATION_WARNING_1': 12,
-            'USER_PWD_EXPIRATION_WARNING_2': 6,
+            'RGW_API_ACCESS_KEY': 'dummy-key',
+            'RGW_API_SECRET_KEY': 'dummy-secret',
         })
         self.assertStatus(200)
 
-        host = self._get('/api/settings/rgw-api-host')['value']
+        access_key = self._get('/api/settings/rgw-api-access-key')['value']
         self.assertStatus(200)
-        self.assertEqual('somehost', host)
+        self.assertEqual('dummy-key', access_key)
 
-        port = self._get('/api/settings/rgw-api-port')['value']
+        secret_key = self._get('/api/settings/rgw-api-secret-key')['value']
         self.assertStatus(200)
-        self.assertEqual(7777, port)
+        self.assertEqual('dummy-secret', secret_key)
index 46ce4ce951e46c8c7559634faa331ce3cf060e83..20abe7ebf01778975672108bd4ff6c522bd69baf 100755 (executable)
@@ -43,7 +43,7 @@ setup_teuthology() {
 
     ${TEUTHOLOGY_PYTHON_BIN:-/usr/bin/python3} -m venv venv
     source venv/bin/activate
-    pip install 'setuptools >= 12'
+    pip install -U pip 'setuptools >= 12'
     pip install git+https://github.com/ceph/teuthology#egg=teuthology[test]
     pushd $CURR_DIR
     pip install -r requirements.txt -c constraints.txt