Merge "Set use_dynamic_credentials with a priority"
This commit is contained in:
commit
df79019f2c
|
@ -184,7 +184,7 @@ def set_options(conf, deployer_input, non_admin, image_path, overrides=[],
|
|||
conf.set("auth", "admin_username", "")
|
||||
conf.set("auth", "admin_project_name", "")
|
||||
conf.set("auth", "admin_password", "")
|
||||
conf.set("auth", "use_dynamic_credentials", "False")
|
||||
conf.set("auth", "use_dynamic_credentials", "False", priority=True)
|
||||
|
||||
# get and set auth data from client's config
|
||||
if cloud_creds:
|
||||
|
@ -192,7 +192,7 @@ def set_options(conf, deployer_input, non_admin, image_path, overrides=[],
|
|||
|
||||
if accounts_path:
|
||||
# new way for running using accounts file
|
||||
conf.set("auth", "use_dynamic_credentials", "False")
|
||||
conf.set("auth", "use_dynamic_credentials", "False", priority=True)
|
||||
conf.set("auth", "test_accounts_file",
|
||||
os.path.abspath(accounts_path))
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ class BaseConfigTempestTest(base.BaseTestCase):
|
|||
conf.set("auth", "admin_username", "admin")
|
||||
conf.set("auth", "admin_project_name", "adminProject")
|
||||
conf.set("auth", "admin_password", "adminPass")
|
||||
conf.set("auth", "use_dynamic_credentials", "False")
|
||||
conf.set("auth", "use_dynamic_credentials", "False", priority=True)
|
||||
return conf
|
||||
|
||||
def _get_alt_conf(self, V2, V3):
|
||||
|
@ -79,7 +79,7 @@ class BaseConfigTempestTest(base.BaseTestCase):
|
|||
conf.set("auth", "admin_username", "admin")
|
||||
conf.set("auth", "admin_project_name", "adminProject")
|
||||
conf.set("auth", "admin_password", "adminPass")
|
||||
conf.set("auth", "use_dynamic_credentials", "True")
|
||||
conf.set("auth", "use_dynamic_credentials", "True", priority=True)
|
||||
return conf
|
||||
|
||||
def _get_creds(self, conf, admin=False, v2=False):
|
||||
|
|
|
@ -36,23 +36,28 @@ class TestTempestConf(BaseConfigTempestTest):
|
|||
# set value wihout priority (default: priority=False)
|
||||
resp = self.conf.set("section", "key", "value")
|
||||
# value should be overwritten, because it wasn't set with priority
|
||||
resp = self.conf.set("section", "key", "value")
|
||||
resp = self.conf.set("section", "key", "new_value")
|
||||
self.assertTrue(resp)
|
||||
self.assertEqual(self.conf.get("section", "key"), "new_value")
|
||||
|
||||
def test_set_value_overwrite_priority(self):
|
||||
resp = self.conf.set("sectionPriority", "key", "value", priority=True)
|
||||
resp = self.conf.set("sectionPriority", "key", "value")
|
||||
resp = self.conf.set("sectionPriority", "key", "new_value")
|
||||
self.assertFalse(resp)
|
||||
self.assertEqual(self.conf.get("sectionPriority", "key"), "value")
|
||||
|
||||
def test_set_value_overwrite_by_priority(self):
|
||||
resp = self.conf.set("section", "key", "value")
|
||||
resp = self.conf.set("section", "key", "value", priority=True)
|
||||
resp = self.conf.set("section", "key", "new_value", priority=True)
|
||||
self.assertTrue(resp)
|
||||
self.assertEqual(self.conf.get("section", "key"), "new_value")
|
||||
|
||||
def test_set_value_overwrite_priority_by_priority(self):
|
||||
resp = self.conf.set("sectionPriority", "key", "value", priority=True)
|
||||
resp = self.conf.set("sectionPriority", "key", "value", priority=True)
|
||||
resp = self.conf.set("sectionPriority", "key",
|
||||
"new_value", priority=True)
|
||||
self.assertTrue(resp)
|
||||
self.assertEqual(self.conf.get("sectionPriority", "key"), "new_value")
|
||||
|
||||
def test_get_bool_value(self):
|
||||
self.assertTrue(self.conf.get_bool_value("True"))
|
||||
|
|
Loading…
Reference in New Issue