aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartek Grzybowski <b.grzybowski@partner.samsung.com>2020-09-15 07:56:29 +0000
committerGerrit Code Review <gerrit@onap.org>2020-09-15 07:56:29 +0000
commit86d315d18e9d5840186b7657eb13c8add11fe5e3 (patch)
tree446404aea5366435ea25157f2190195bf405f87f
parent803e49918dc80f21859b2355dcc33e179abb5fa1 (diff)
parentfc0b7c34d403e837c8e58ef4c3649d09f69f4230 (diff)
Merge "Check that variables for exit actions are defined"
-rwxr-xr-xrun-csit.sh18
1 files changed, 10 insertions, 8 deletions
diff --git a/run-csit.sh b/run-csit.sh
index 634b0c7c..52d16932 100755
--- a/run-csit.sh
+++ b/run-csit.sh
@@ -24,14 +24,16 @@
function on_exit(){
rc=$?
- rsync -av "$WORKDIR/" "$WORKSPACE/archives"
-
- # Record list of active docker containers
- docker ps --format "{{.Image}}" > "$WORKSPACE/archives/_docker-images.log"
-
- # show memory consumption after all docker instances initialized
- docker_stats | tee "$WORKSPACE/archives/_sysinfo-2-after-robot.txt"
-
+ if [[ ${WORKSPACE} ]]; then
+ if [[ ${WORKDIR} ]]; then
+ rsync -av "$WORKDIR/" "$WORKSPACE/archives"
+ fi
+ # Record list of active docker containers
+ docker ps --format "{{.Image}}" > "$WORKSPACE/archives/_docker-images.log"
+
+ # show memory consumption after all docker instances initialized
+ docker_stats | tee "$WORKSPACE/archives/_sysinfo-2-after-robot.txt"
+ fi
# Run teardown script plan if it exists
cd "${TESTPLANDIR}"
TEARDOWN="${TESTPLANDIR}/teardown.sh"