File 0001-TEST-05-RLIMITS-adapt-for-openQA.patch of Package systemd-v245-testsuite
From dbe7c8c80e7b19282e0087f163a3d694824d233b Mon Sep 17 00:00:00 2001
From: Elisei Roca <eroca@suse.de>
Date: Fri, 8 May 2020 19:18:21 +0200
Subject: [PATCH] TEST-05-RLIMITS: adapt for openQA
---
test/TEST-05-RLIMITS/test-rlimits.sh | 2 +-
test/TEST-05-RLIMITS/test.sh | 31 ++++++++++++++++++++++++++++
2 files changed, 32 insertions(+), 1 deletion(-)
diff --git a/test/TEST-05-RLIMITS/test-rlimits.sh b/test/TEST-05-RLIMITS/test-rlimits.sh
index 86b57601fe..434787139e 100755
--- a/test/TEST-05-RLIMITS/test-rlimits.sh
+++ b/test/TEST-05-RLIMITS/test-rlimits.sh
@@ -12,4 +12,4 @@ set -o pipefail
[[ "$(ulimit -n -S)" = "10000" ]]
[[ "$(ulimit -n -H)" = "16384" ]]
-touch /testok
+echo SUSEtest OK > /testok
diff --git a/test/TEST-05-RLIMITS/test.sh b/test/TEST-05-RLIMITS/test.sh
index bda37ef212..1de0009b39 100755
--- a/test/TEST-05-RLIMITS/test.sh
+++ b/test/TEST-05-RLIMITS/test.sh
@@ -2,6 +2,7 @@
set -e
TEST_DESCRIPTION="Resource limits-related tests"
+export TEST_BASE_DIR=/var/opt/systemd-tests/test
. $TEST_BASE_DIR/test-functions
test_setup() {
@@ -31,10 +32,40 @@ Type=oneshot
EOF
cp test-rlimits.sh $initdir/
+ cp test-rlimits.sh /
+ cp $initdir/etc/systemd/system/testsuite.service /etc/systemd/system/testsuite.service
+ mv /etc/systemd/system.conf /etc/systemd/system.conf.orig
+ cp $initdir/etc/systemd/system.conf /etc/systemd/
setup_testsuite
)
setup_nspawn_root
}
+test_run() {
+ systemctl daemon-reload
+ systemctl start testsuite.service || return 1
+ if [ -z "$TEST_NO_NSPAWN" ]; then
+ if run_nspawn "nspawn-root"; then
+ check_result_nspawn "nspawn-root" || return 1
+ else
+ dwarn "can't run systemd-nspawn, skipping"
+ fi
+ fi
+ ret=1
+ test -s /failed && ret=$(($ret+1))
+ [[ -e /testok ]] && ret=0
+ return $ret
+}
+
+test_cleanup() {
+ _test_cleanup
+ rm -f /etc/systemd/system/testsuite.service
+ mv /etc/systemd/system.conf.orig /etc/systemd/system.conf
+ for file in $(ls /testok* /failed* /test-rlimits.sh 2>/dev/null); do
+ rm $file
+ done
+ return 0
+}
+
do_test "$@"
--
2.26.2