From 12d21f032e9a67b327101c42481a546a48a6ac21 Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Tue, 11 Oct 2022 20:01:32 +0200 Subject: test: instrument functional tests with more logs Also: - Do not tun tests with privileged containers HICN-806 - Refactor robot test files and config.sh Currently some logs are missing from the robot output of the functional tests. This patch adds them. Ticket: HICN-805 Signed-off-by: Mauro Sardara Change-Id: I9893eb356a4dd12f4bc6347b8fe02e358c9bf737 --- scripts/functions.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'scripts/functions.sh') diff --git a/scripts/functions.sh b/scripts/functions.sh index 544c283fc..9ff252416 100644 --- a/scripts/functions.sh +++ b/scripts/functions.sh @@ -114,6 +114,10 @@ function download_artifacts() { return 1 } +function is_selinuxenabled() { + sudo selinuxenabled && return 1 || return 0 +} + # Run functional tests function functional_test() { echo "*******************************************************************" @@ -129,8 +133,16 @@ function functional_test() { fi # Run functional tests - pushd ${SCRIPT_PATH}/../tests - BUILD_SOFTWARE=${build_sw} DOCKERFILE=${dockerfile_path} bash ./run-functional.sh + pushd "${SCRIPT_PATH}/../tests" + # If selinux, let's run the tests with a privileged container to bypass + # the checks, which cost also in performance + if is_selinuxenabled; then + local privileged=false + else + local privileged=true + fi + + BUILD_SOFTWARE=${build_sw} DOCKERFILE=${dockerfile_path} TEST_PRIVILEGED=${privileged} bash ./run-functional.sh popd echo "*******************************************************************" -- cgit 1.2.3-korg