X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Fbash%2Ffunction%2Fcommon.sh;h=7a55d5687109c7eea890b18cafe313d72572a933;hb=db24a2e63a447599b5125da4b6f93f0f9184bfcc;hp=4a560ff98cf132cc7185890f739f1159d09063ec;hpb=6f1ff57c83763556450e8bfcb4571a9c017abe70;p=csit.git diff --git a/resources/libraries/bash/function/common.sh b/resources/libraries/bash/function/common.sh index 4a560ff98c..7a55d56871 100644 --- a/resources/libraries/bash/function/common.sh +++ b/resources/libraries/bash/function/common.sh @@ -239,6 +239,9 @@ function common_dirs () { TOOLS_DIR=$(readlink -e "${RESOURCES_DIR}/tools") || { die "Readlink failed." } + DOC_GEN_DIR=$(readlink -e "${TOOLS_DIR}/doc_gen") || { + die "Readlink failed." + } PYTHON_SCRIPTS_DIR=$(readlink -e "${TOOLS_DIR}/scripts") || { die "Readlink failed." } @@ -553,36 +556,6 @@ function installed () { } -function remove_topo () { - - # Remove the argument from list of available topologies. - # - # Just a de-duplicated block of code - # - # Argument: - # - ${1} - The topology item to remove. Required. - # Variable read and re-written: - # - TOPOLOGIES - Array of paths to topologies, with failed cleanups removed. - - set -exuo pipefail - - warn "Testbed ${topo} seems unsuitable, removing from the list." - - # Build new topology array. - # TOPOLOGIES=("${TOPOLOGIES[@]/$topo}") - # does not really work, see: - # https://stackoverflow.com/questions/16860877/remove-an-element-from-a-bash-array - - new_topologies=() - for item in "${TOPOLOGIES[@]}"; do - if [[ "${item}" != "${1}" ]]; then - new_topologies+=("${item}") - fi - done - TOPOLOGIES=("${new_topologies[@]}") -} - - function reserve_and_cleanup_testbed () { # Reserve physical testbed, perform cleanup, register trap to unreserve. @@ -594,8 +567,6 @@ function reserve_and_cleanup_testbed () { # - 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. @@ -611,7 +582,6 @@ function reserve_and_cleanup_testbed () { set +e 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 @@ -638,11 +608,6 @@ function reserve_and_cleanup_testbed () { fi warn "Testbed cleanup failed: ${topo}" untrap_and_unreserve_testbed "Fail of unreserve after cleanup." - # WORKING_TOPOLOGY is now empty again. - remove_topo "${topo}" - elif [[ "${result}" != "2" ]]; then - # 1 or unexpected return code, testbed is probably unusable. - remove_topo "${topo}" fi # Else testbed is accessible but currently reserved, moving on. done