From 0227e20f014f8ad2103000c1d91a37b6afba0fda Mon Sep 17 00:00:00 2001 From: Vratko Polak Date: Thu, 7 Nov 2019 14:13:45 +0100 Subject: [PATCH] Source ansible.sh for entry scripts using cleanup Change-Id: Iee02577ee0c054feb61edee807182c6808f235b0 Signed-off-by: Vratko Polak --- resources/libraries/bash/entry/per_patch_perf.sh | 2 ++ resources/libraries/bash/function/common.sh | 2 ++ 2 files changed, 4 insertions(+) diff --git a/resources/libraries/bash/entry/per_patch_perf.sh b/resources/libraries/bash/entry/per_patch_perf.sh index ad0ae90085..8c9d7d2ca3 100644 --- a/resources/libraries/bash/entry/per_patch_perf.sh +++ b/resources/libraries/bash/entry/per_patch_perf.sh @@ -39,6 +39,8 @@ source "${BASH_FUNCTION_DIR}/common.sh" || { exit 1 } source "${BASH_FUNCTION_DIR}/per_patch.sh" || die "Source failed." +# Cleanup needs ansible. +source "${BASH_FUNCTION_DIR}/ansible.sh" || die "Source failed." common_dirs || die check_prerequisites || die set_perpatch_vpp_dir || die diff --git a/resources/libraries/bash/function/common.sh b/resources/libraries/bash/function/common.sh index f5e1111a17..e4783dd1ec 100644 --- a/resources/libraries/bash/function/common.sh +++ b/resources/libraries/bash/function/common.sh @@ -576,6 +576,7 @@ function reserve_and_cleanup_testbed () { # - WORKING_TOPOLOGY - Path to topology yaml file of the reserved testbed. # Functions called: # - die - Print to stderr and exit. + # - ansible_hosts - Perform an action using ansible, see ansible.sh # Traps registered: # - EXIT - Calls cancel_all for ${WORKING_TOPOLOGY}. @@ -1031,6 +1032,7 @@ function untrap_and_unreserve_testbed () { # - EXIT - Failure to untrap is reported, but ignored otherwise. # Functions called: # - die - Print to stderr and exit. + # - ansible_hosts - Perform an action using ansible, see ansible.sh set -xo pipefail set +eu # We do not want to exit early in a "teardown" function. -- 2.16.6