X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=run-csit.sh;h=55b755db76d4eea5cc9386d3687830f87826e5a8;hb=HEAD;hp=634b0c7c8000a94efca37b39266ba03d8c1329e3;hpb=0f8f41ceb38ffc8cecaadc3b98fb91d7304710e4;p=integration%2Fcsit.git diff --git a/run-csit.sh b/run-csit.sh index 634b0c7c..55b755db 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/$TESTPLAN" + fi + # Record list of active docker containers + docker ps --format "{{.Image}}" > "$WORKSPACE/archives/$TESTPLAN/_docker-images.log" + + # show memory consumption after all docker instances initialized + docker_stats | tee "$WORKSPACE/archives/$TESTPLAN/_sysinfo-2-after-robot.txt" + fi # Run teardown script plan if it exists cd "${TESTPLANDIR}" TEARDOWN="${TESTPLANDIR}/teardown.sh" @@ -133,9 +135,6 @@ if [ -z "$WORKSPACE" ]; then export WORKSPACE=$(git rev-parse --show-toplevel) fi -rm -rf "$WORKSPACE/archives" -mkdir -p "$WORKSPACE/archives" - if [ -f "${WORKSPACE}/${1}/testplan.txt" ]; then export TESTPLAN="${1}" else @@ -145,19 +144,22 @@ fi export TESTOPTIONS="${2}" +rm -rf "$WORKSPACE/archives/$TESTPLAN" +mkdir -p "$WORKSPACE/archives/$TESTPLAN" + TESTPLANDIR="${WORKSPACE}/${TESTPLAN}" # Run installation of prerequired libraries source_safely "${WORKSPACE}/prepare-csit.sh" # Activate the virtualenv containing all the required libraries installed by prepare-csit.sh -source_safely "${ROBOT_VENV}/bin/activate" +source_safely "${ROBOT3_VENV}/bin/activate" WORKDIR=$(mktemp -d --suffix=-robot-workdir) cd "${WORKDIR}" # Add csit scripts to PATH -export PATH="${PATH}:${WORKSPACE}/docker/scripts:${WORKSPACE}/scripts:${ROBOT_VENV}/bin" +export PATH="${PATH}:${WORKSPACE}/docker/scripts:${WORKSPACE}/scripts:${ROBOT3_VENV}/bin" export SCRIPTS="${WORKSPACE}/scripts" export ROBOT_VARIABLES= @@ -173,7 +175,7 @@ if [ -f "${SETUP}" ]; then fi # show memory consumption after all docker instances initialized -docker_stats | tee "$WORKSPACE/archives/_sysinfo-1-after-setup.txt" +docker_stats | tee "$WORKSPACE/archives/$TESTPLAN/_sysinfo-1-after-setup.txt" # Run test plan cd "$WORKDIR" @@ -185,7 +187,7 @@ SUITES=$( xargs -a testplan.txt ) echo ROBOT_VARIABLES="${ROBOT_VARIABLES}" echo "Starting Robot test suites ${SUITES} ..." relax_set -python -m robot.run -N ${TESTPLAN} -v WORKSPACE:/tmp ${ROBOT_VARIABLES} ${TESTOPTIONS} ${SUITES} +python3 -m robot.run -N ${TESTPLAN} -v WORKSPACE:/tmp ${ROBOT_VARIABLES} ${TESTOPTIONS} ${SUITES} RESULT=$? load_set echo "RESULT: $RESULT"