diff options
author | boucherv <valentin.boucher@orange.com> | 2016-08-11 09:06:09 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@172.30.200.206> | 2016-08-11 09:06:09 +0000 |
commit | fe1cdb02640ddf9baae6d09a949a4648264dd482 (patch) | |
tree | 8b8c14c250a929cebb73f20ff6884fc714623296 /ci | |
parent | e648bdc9f4f52208a44936fd8732afbe256a20c2 (diff) | |
parent | 7eefbe8f7ec52d727e8e504e4ddd4ddb57cf569e (diff) |
Merge "Create config_functest patch to update the conf with scenario"
Diffstat (limited to 'ci')
-rw-r--r-- | ci/config_patch.yaml | 9 | ||||
-rwxr-xr-x | ci/prepare_env.py | 24 |
2 files changed, 32 insertions, 1 deletions
diff --git a/ci/config_patch.yaml b/ci/config_patch.yaml new file mode 100644 index 000000000..467a83ca0 --- /dev/null +++ b/ci/config_patch.yaml @@ -0,0 +1,9 @@ +lxd: + general: + openstack: + image_name: Cirros-0.3.4 + image_file_name: cirros-0.3.4-x86_64-lxc.tar.gz + image_disk_format: raw + + healthcheck: + disk_image: /home/opnfv/functest/data/cirros-0.3.4-x86_64-lxc.tar.gz diff --git a/ci/prepare_env.py b/ci/prepare_env.py index e31afd495..116b1a6e2 100755 --- a/ci/prepare_env.py +++ b/ci/prepare_env.py @@ -46,10 +46,16 @@ CI_SCENARIO = "" CI_DEBUG = False REPOS_DIR = os.getenv('repos_dir') FUNCTEST_REPO = REPOS_DIR + '/functest/' +CONFIG_FUNCTEST_PATH = os.environ["CONFIG_FUNCTEST_YAML"] +CONFIG_PATCH_PATH = os.path.join(os.path.dirname( + CONFIG_FUNCTEST_PATH), "config_patch.yaml") -with open(os.environ["CONFIG_FUNCTEST_YAML"]) as f: +with open(CONFIG_FUNCTEST_PATH) as f: functest_yaml = yaml.safe_load(f) +with open(CONFIG_PATCH_PATH) as f: + functest_patch_yaml = yaml.safe_load(f) + FUNCTEST_CONF_DIR = functest_yaml.get("general").get( "directories").get("dir_functest_conf") @@ -183,6 +189,21 @@ def source_rc_file(): logger.debug("Used credentials: %s" % str) +def patch_config_file(): + updated = False + for key in functest_patch_yaml: + if key in CI_SCENARIO: + new_functest_yaml = dict(ft_utils.merge_dicts( + functest_yaml, functest_patch_yaml[key])) + updated = True + + if updated: + os.remove(CONFIG_FUNCTEST_PATH) + with open(CONFIG_FUNCTEST_PATH, "w") as f: + f.write(yaml.dump(new_functest_yaml, default_style='"')) + f.close() + + def verify_deployment(): print_separator() logger.info("Verifying OpenStack services...") @@ -262,6 +283,7 @@ def main(): check_env_variables() create_directories() source_rc_file() + patch_config_file() verify_deployment() install_rally() |