From 10a11542b39240d0f6b969d662c794a42782731a Mon Sep 17 00:00:00 2001 From: demskeq8 Date: Tue, 25 May 2021 18:25:10 +0200 Subject: [SDNC-CSIT] Run tests optional in docker container Define alternative robot-framework docker image in env ROBOT_IMAGE Issue-ID: TEST-314 Signed-off-by: demskeq8 Change-Id: Ie3ebc85e32d0e429db55604f862c46abc9c27cee Former-commit-id: 10ec243ccd7f33857b855f7bfd549e2c3cb4b640 --- csit/run-csit.sh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'csit') diff --git a/csit/run-csit.sh b/csit/run-csit.sh index e7cb0054..eb255e93 100755 --- a/csit/run-csit.sh +++ b/csit/run-csit.sh @@ -2,6 +2,7 @@ # # Copyright 2016-2017 Huawei Technologies Co., Ltd. # Modification Copyright 2019-2021 © Samsung Electronics Co., Ltd. +# Modification Copyright 2021 © highstreet-technologies GmbH # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -192,9 +193,19 @@ SUITES=$( xargs -a testplan.txt ) echo ROBOT_VARIABLES="${ROBOT_VARIABLES}" echo "Starting Robot test suites ${SUITES} ..." relax_set -echo "*** TRACE **** python is $(which python) [version $(python --version)]" -env -python -m robot.run -N ${TESTPLAN} -v WORKSPACE:/tmp ${ROBOT_VARIABLES} ${TESTOPTIONS} ${SUITES} + +# Runs an alternative robotframework setup as docker image in $ROBOT_IMAGE +# test suites will be executed within this docker container +# and results are stored as usual +if [[ -z $ROBOT_IMAGE ]]; then + echo "*** TRACE **** python is $(which python) [version $(python --version)]" + env + python -m robot.run -N ${TESTPLAN} -v WORKSPACE:/tmp ${ROBOT_VARIABLES} ${TESTOPTIONS} ${SUITES} +else + echo "*** TRACE **** python is running in a container" + docker run --net="host" -v ${WORKSPACE}:${WORKSPACE} -v ${WORKDIR}:${WORKDIR} $ROBOT_IMAGE \ + python -B -m robot.run -N ${TESTPLAN} -v WORKSPACE:/tmp --outputdir ${WORKDIR} ${ROBOT_VARIABLES} ${TESTOPTIONS} ${SUITES} +fi RESULT=$? load_set echo "RESULT: $RESULT" -- cgit 1.2.3-korg