From acd36681191fd46fdea930dad84c7edb5d2621be Mon Sep 17 00:00:00 2001 From: Andrey Kurilin Date: Sun, 4 Dec 2016 22:45:55 +0200 Subject: [PATCH] [CI][cli] use env variable to determine KeystoneV3 `rally deployment create --fromenv` tries to guess keystone version by presence of "USER_DOMAIN_NAME" or "PROJECT_DOMAIN_NAME" environment variables. But this cariable can be missed. Let's check special variable for keystone version - OS_IDENTITY_API_VERSION or IDENTITY_API_VERSION. Also, this patch fixes DeploymentTestCase.test_config functional test to support keystone v3 Change-Id: Ia75109fb8388b7b02af764c5f93ef5bd04f00676 --- tests/functional/test_cli_deployment.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/functional/test_cli_deployment.py b/tests/functional/test_cli_deployment.py index 2d0f3a1f..748ea8dd 100644 --- a/tests/functional/test_cli_deployment.py +++ b/tests/functional/test_cli_deployment.py @@ -50,8 +50,14 @@ class DeploymentTestCase(unittest.TestCase): config["admin"]["username"]) self.assertEqual(utils.TEST_ENV["OS_PASSWORD"], config["admin"]["password"]) - self.assertEqual(utils.TEST_ENV["OS_TENANT_NAME"], - config["admin"]["tenant_name"]) + if "project_name" in config["admin"]: + # keystone v3 + self.assertEqual(utils.TEST_ENV["OS_TENANT_NAME"], + config["admin"]["project_name"]) + else: + # keystone v2 + self.assertEqual(utils.TEST_ENV["OS_TENANT_NAME"], + config["admin"]["tenant_name"]) self.assertEqual(utils.TEST_ENV["OS_AUTH_URL"], config["auth_url"])