aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/bash/function/common.sh
diff options
context:
space:
mode:
authorVratko Polak <vrpolak@cisco.com>2019-06-24 17:53:55 +0200
committerVratko Polak <vrpolak@cisco.com>2019-06-24 19:06:59 +0200
commitcac8f76ce1f9085e9eede19b250f4a4cb9b199e0 (patch)
treef878d1ed7b14a0e18c09b1854d7490ba1272d63a /resources/libraries/bash/function/common.sh
parent065313317117200ae456d1462be8af7898c5302e (diff)
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 <vrpolak@cisco.com>
Diffstat (limited to 'resources/libraries/bash/function/common.sh')
-rw-r--r--resources/libraries/bash/function/common.sh9
1 files changed, 8 insertions, 1 deletions
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