From cac8f76ce1f9085e9eede19b250f4a4cb9b199e0 Mon Sep 17 00:00:00 2001 From: Vratko Polak Date: Mon, 24 Jun 2019 17:53:55 +0200 Subject: Store "tag" and "url" in files in reservation dir String "Unknown" is used if test run tag or url is not supplied, so this change should be backward compatible. + Used "runtag", as both "test" and "tag" start with taken "-t". + Fixed some pylint violations. + Docstring explaining the steps taken and reasoning behind two files. + Other minor improvements. Change-Id: If704d02e51374087fe39ad0f69432477d1b310d3 Signed-off-by: Vratko Polak --- resources/libraries/bash/function/common.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'resources/libraries') diff --git a/resources/libraries/bash/function/common.sh b/resources/libraries/bash/function/common.sh index 08e916f65f..5deab8aa40 100644 --- a/resources/libraries/bash/function/common.sh +++ b/resources/libraries/bash/function/common.sh @@ -524,6 +524,10 @@ function reserve_and_cleanup_testbed () { # Variables read: # - TOPOLOGIES - Array of paths to topology yaml to attempt reservation on. # - PYTHON_SCRIPTS_DIR - Path to directory holding the reservation script. + # - BUILD_TAG - Any string suitable as filename, identifying + # test run executing this function. May be unset. + # - BUILD_URL - Any string suitable as URL, identifying + # test run executing this function. May be unset. # Variables set: # - TOPOLOGIES - Array of paths to topologies, with failed cleanups removed. # - WORKING_TOPOLOGY - Path to topology yaml file of the reserved testbed. @@ -535,7 +539,10 @@ function reserve_and_cleanup_testbed () { while [[ ${TOPOLOGIES[@]} ]]; do for topo in "${TOPOLOGIES[@]}"; do set +e - python "${PYTHON_SCRIPTS_DIR}/topo_reservation.py" -t "${topo}" + scrpt="${PYTHON_SCRIPTS_DIR}/topo_reservation.py" + opts=("-t" "${topo}" "-r" "${BUILD_TAG:-Unknown}") + opts+=("-u" "${BUILD_URL:-Unknown}") + python "${scrpt}" "${opts[@]}" result="$?" set -e if [[ "${result}" == "0" ]]; then -- cgit 1.2.3-korg