From 9d8d96c23f4d8a87921454e599216bc5d46b443e Mon Sep 17 00:00:00 2001 From: Adam Saleh Date: Mar 24 2022 13:52:48 +0000 Subject: Adding env-var flag to skip tests not runnable in containers. --- diff --git a/tests/p_audit/1_auditd_running.sh b/tests/p_audit/1_auditd_running.sh index bb050cd..dc9abf5 100755 --- a/tests/p_audit/1_auditd_running.sh +++ b/tests/p_audit/1_auditd_running.sh @@ -3,7 +3,7 @@ t_Log "Running $0 - check if auditd is running." -if [ $SKIP_QA_HARNESS -eq 1 ]; then +if [ $SKIP_QA_HARNESS -eq 1 -o $CONTAINERTEST -eq 1 ]; then echo "Skipping this test ..." else service auditd status > /dev/null 2>&1 diff --git a/tests/p_audit/2_auditd_generate-events.sh b/tests/p_audit/2_auditd_generate-events.sh index a157cee..e6dd704 100755 --- a/tests/p_audit/2_auditd_generate-events.sh +++ b/tests/p_audit/2_auditd_generate-events.sh @@ -1,9 +1,13 @@ #!/bin/sh # Author: Athmane Madjoudj +if [ $SKIP_QA_HARNESS -eq 1 -o $CONTAINERTEST -eq 1 ]; then + echo "Skipping this test ..." +else t_Log "Running $0 - Generate some events for audit log." useradd testauditd userdel testauditd t_CheckExitStatus $? +fi diff --git a/tests/p_audit/3_auditd_logging.sh b/tests/p_audit/3_auditd_logging.sh index 0207701..53e4c96 100755 --- a/tests/p_audit/3_auditd_logging.sh +++ b/tests/p_audit/3_auditd_logging.sh @@ -1,8 +1,11 @@ #!/bin/sh # Author: Athmane Madjoudj - +if [ $SKIP_QA_HARNESS -eq 1 -o $CONTAINERTEST -eq 1 ]; then + echo "Skipping this test ..." +else t_Log "Running $0 - check if audit log is not empty." [[ -s /var/log/audit/audit.log ]] t_CheckExitStatus $? +fi diff --git a/tests/p_autofs/0-install_autofs.sh b/tests/p_autofs/0-install_autofs.sh index 348649e..f343470 100755 --- a/tests/p_autofs/0-install_autofs.sh +++ b/tests/p_autofs/0-install_autofs.sh @@ -1,6 +1,10 @@ #!/bin/bash # Author: Christoph Galuschka +if [ $CONTAINERTEST -eq 1]; then + echo "Skipping this test ..." +else + t_Log "Running $0 - Installing required packages" if [ "$centos_ver" = "5" ] ; then @@ -31,3 +35,4 @@ ls -al /mnt | egrep -q '(dnf|yum)' t_CheckExitStatus $? umount /mnt +fi diff --git a/tests/p_autofs/10-autofs-nfs-mount.sh b/tests/p_autofs/10-autofs-nfs-mount.sh index 939a37e..76ca03a 100755 --- a/tests/p_autofs/10-autofs-nfs-mount.sh +++ b/tests/p_autofs/10-autofs-nfs-mount.sh @@ -1,6 +1,8 @@ #!/bin/sh # Author: Christoph Galuschka - +if [ $CONTAINERTEST -eq 1]; then + echo "Skipping this test ..." +else t_Log "Running $0 - autofs can mount nfs share test." t_Log 'Preparing autofs configuration' @@ -23,3 +25,4 @@ t_ServiceControl autofs stop t_ServiceControl nfs stop t_ServiceControl nfs-server stop t_ServiceControl rpcbind stop +fi