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'])
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)
${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