From: hongbo tian Date: Wed, 22 Mar 2017 09:18:57 +0000 (+0000) Subject: Merge "dovetail tool: Bugfix about the prepare_env of yardstick and get the yardstick... X-Git-Tag: ovp.0.9.0~216 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=9d86d3b50a9617b6042cc8bf3f900c9b0573d888;p=dovetail.git Merge "dovetail tool: Bugfix about the prepare_env of yardstick and get the yardstick.log" --- 9d86d3b50a9617b6042cc8bf3f900c9b0573d888 diff --cc dovetail/conf/yardstick_config.yml index a70749d9,91811a2a..934cdbdc --- a/dovetail/conf/yardstick_config.yml +++ b/dovetail/conf/yardstick_config.yml @@@ -2,12 -2,16 +2,12 @@@ yardstick: image_name: opnfv/yardstick docker_tag: latest - envs: '-e INSTALLER_TYPE=compass -e INSTALLER_IP=192.168.200.2 - -e NODE_NAME=dovetail-pod -e DEPLOY_SCENARIO=ha_nosdn - -e BUILD_TAG=dovetail -e CI_DEBUG=true -e DEPLOY_TYPE=baremetal - -e EXTERNAL_NETWORK=ext-net' opts: '-id --privileged=true' pre_condition: - - 'source /home/opnfv/repos/yardstick/tests/ci/prepare_env.sh && - source /home/opnfv/repos/yardstick/tests/ci/clean_images.sh && cleanup' - - 'source /home/opnfv/repos/yardstick/tests/ci/prepare_env.sh && - cd /home/opnfv/repos/yardstick && source tests/ci/load_images.sh' + - 'cd /home/opnfv/repos/yardstick && source tests/ci/prepare_env.sh && + source tests/ci/clean_images.sh && cleanup' + - 'cd /home/opnfv/repos/yardstick && source tests/ci/prepare_env.sh && + source tests/ci/load_images.sh' cmds: - 'mkdir -p /home/opnfv/yardstick/results/' - 'cd /home/opnfv/repos/yardstick && source tests/ci/prepare_env.sh && diff --cc dovetail/container.py index c90ff387,4889e51e..6d5a8d4f --- a/dovetail/container.py +++ b/dovetail/container.py @@@ -56,31 -57,13 +56,34 @@@ class Container(object) cls.logger.error("File %s is not exist", dovetail_config['openrc']) return None + # This is used for showing the debug logs of the upstream projects + envs = ' -e CI_DEBUG=true' + + # These are all just used by Functest's function push_results_to_db + if type.lower() == "functest": + ins_type = " -e INSTALLER_TYPE=vendor-specific" + scenario = " -e DEPLOY_SCENARIO=default" + node = " -e NODE_NAME=default" + tag = " -e BUILD_TAG=daily-master-001" + + envs = "%s %s %s %s %s" % (envs, ins_type, scenario, node, tag) + + if type.lower() == "yardstick": + ext_net = dt_utils.get_ext_net_name(dovetail_config['openrc'], + cls.logger) + if ext_net: + envs = "%s%s%s" % (envs, " -e EXTERNAL_NETWORK=", ext_net) + else: + cls.logger.error("Can't find any external network.") + return None + result_volume = ' -v %s:%s ' % (dovetail_config['result_dir'], dovetail_config[type]['result']['dir']) - cmd = 'sudo docker run %s %s %s %s %s %s /bin/bash' % \ - (opts, envs, sshkey, openrc, result_volume, docker_image) + log_volume = ' -v %s:%s ' % (dovetail_config['result_dir'], + dovetail_config[type]['result']['log']) + cmd = 'sudo docker run %s %s %s %s %s %s %s /bin/bash' % \ + (opts, envs, sshkey, openrc, result_volume, + log_volume, docker_image) dt_utils.exec_cmd(cmd, cls.logger) ret, container_id = \ dt_utils.exec_cmd("sudo docker ps | grep " + docker_image +