+ # Cleanup check.
+ set +e
+ cleanup_topo
+ result="$?"
+ set -e
+ if [[ "${result}" == "0" ]]; then
+ break
+ fi
+ warn "Testbed cleanup failed: ${topo}"
+ untrap_and_unreserve_testbed "Fail of unreserve after cleanup."
+ # WORKING_TOPOLOGY is now empty again.
+ # 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}" != "${topo}" ]]; then
+ new_topologies+=("${item}")
+ fi
+ done
+ TOPOLOGIES=("${new_topologies[@]}")