Store "tag" and "url" in files in reservation dir
[csit.git] / resources / libraries / bash / function / common.sh
index 08e916f..5deab8a 100644 (file)
@@ -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.
     # 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.
     # 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
     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
             result="$?"
             set -e
             if [[ "${result}" == "0" ]]; then