summaryrefslogtreecommitdiffstats
path: root/csit
diff options
context:
space:
mode:
authordemskeq8 <alexander.dehn@highstreet-technologies.com>2021-05-25 18:25:10 +0200
committerHerbert Eiselt <herbert.eiselt@highstreet-technologies.com>2021-06-17 15:20:48 +0000
commit10a11542b39240d0f6b969d662c794a42782731a (patch)
tree6db7c3ac78d5298e7a86cd62c2effbb51738a3e7 /csit
parent3184da810b196d7e3eb7efe61ea7a7325dbc27f2 (diff)
[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 <alexander.dehn@highstreet-technologies.com> Change-Id: Ie3ebc85e32d0e429db55604f862c46abc9c27cee Former-commit-id: 10ec243ccd7f33857b855f7bfd549e2c3cb4b640
Diffstat (limited to 'csit')
-rwxr-xr-xcsit/run-csit.sh17
1 files changed, 14 insertions, 3 deletions
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"