--- /dev/null
+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
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")
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...")
check_env_variables()
create_directories()
source_rc_file()
+ patch_config_file()
verify_deployment()
install_rally()
RUN ${repos_dir}/rally/install_rally.sh --yes
ADD http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img /home/opnfv/functest/data/
+ADD http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-lxc.tar.gz /home/opnfv/functest/data/
ADD http://205.177.226.237:9999/onosfw/firewall_block_image.img /home/opnfv/functest/data/
RUN gpg --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
GLANCE_IMAGE_PATH))
image_id = os_utils.create_glance_image(glance_client,
GLANCE_IMAGE_NAME,
- GLANCE_IMAGE_PATH)
+ GLANCE_IMAGE_PATH,
+ GLANCE_IMAGE_FORMAT)
if not image_id:
logger.error("Failed to create the Glance image...")
exit(-1)
GLANCE_IMAGE_PATH))
image_id = os_utils.create_glance_image(glance_client,
GLANCE_IMAGE_NAME,
- GLANCE_IMAGE_PATH)
+ GLANCE_IMAGE_PATH,
+ GLANCE_IMAGE_FORMAT)
if not image_id:
logger.error("Failed to create a Glance image...")
exit(-1)
GLANCE_IMAGE_PATH))
image_id = os_utils.create_glance_image(glance_client,
GLANCE_IMAGE_NAME,
- GLANCE_IMAGE_PATH)
+ GLANCE_IMAGE_PATH,
+ GLANCE_IMAGE_FORMAT)
if not image_id:
logger.error("Failed to create a Glance image...")
exit(EXIT_CODE)
GLANCE_IMAGE_PATH))
image_id = os_utils.create_glance_image(glance_client,
GLANCE_IMAGE_NAME,
- GLANCE_IMAGE_PATH)
+ GLANCE_IMAGE_PATH,
+ GLANCE_IMAGE_FORMAT)
if not image_id:
logger.error("Failed to create a Glance image...")
exit(EXIT_CODE)
logger.debug(r)
return True
except Exception, e:
- print ("Error [push_results_to_db('%s', '%s', '%s', " +
- "'%s', '%s', '%s', '%s', '%s', '%s')]:" %
- (url, project, case_name, pod_name, version,
- scenario, criteria, build_tag, details)), e
+ print("Error [push_results_to_db('%s', '%s', '%s', " +
+ "'%s', '%s', '%s', '%s', '%s', '%s')]:" %
+ (url, project, case_name, pod_name, version,
+ scenario, criteria, build_tag, details)), e
return False
return status
+def merge_dicts(dict1, dict2):
+ for k in set(dict1.keys()).union(dict2.keys()):
+ if k in dict1 and k in dict2:
+ if isinstance(dict1[k], dict) and isinstance(dict2[k], dict):
+ yield (k, dict(merge_dicts(dict1[k], dict2[k])))
+ else:
+ yield (k, dict2[k])
+ elif k in dict1:
+ yield (k, dict1[k])
+ else:
+ yield (k, dict2[k])
+
+
def check_test_result(test_name, ret, start_time, stop_time):
def get_criteria_value():
return get_criteria_by_test(test_name).split('==')[1].strip()