summaryrefslogtreecommitdiff
path: root/test/TEST-02-UNITTESTS
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-09-22 18:26:28 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-09-24 17:02:20 +0200
commit9309a23b9513f9e36a4e7c7c7d917444ee2d97bc (patch)
treea972e7e34115b480b65c5868180069cefdbacbbf /test/TEST-02-UNITTESTS
parentabf6346c5e65ec1ab1f83841e9bd07a2e301dde8 (diff)
downloadsystemd-9309a23b9513f9e36a4e7c7c7d917444ee2d97bc.tar.gz
test: switch TEST-02-CRYPTSETUP and TEST-24-UNITTESTS
When tests are executed serially (the default), it seems better to launch the fairly generic test that runs the unittests early in the sequence. Right now the tests are ordered based on when they were written, but this doesn't make much sense.
Diffstat (limited to 'test/TEST-02-UNITTESTS')
l---------test/TEST-02-UNITTESTS/Makefile1
-rw-r--r--test/TEST-02-UNITTESTS/deny-list-ubuntu-ci-ppc64el0
-rwxr-xr-xtest/TEST-02-UNITTESTS/test.sh63
3 files changed, 64 insertions, 0 deletions
diff --git a/test/TEST-02-UNITTESTS/Makefile b/test/TEST-02-UNITTESTS/Makefile
new file mode 120000
index 0000000000..e9f93b1104
--- /dev/null
+++ b/test/TEST-02-UNITTESTS/Makefile
@@ -0,0 +1 @@
+../TEST-01-BASIC/Makefile \ No newline at end of file
diff --git a/test/TEST-02-UNITTESTS/deny-list-ubuntu-ci-ppc64el b/test/TEST-02-UNITTESTS/deny-list-ubuntu-ci-ppc64el
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/test/TEST-02-UNITTESTS/deny-list-ubuntu-ci-ppc64el
diff --git a/test/TEST-02-UNITTESTS/test.sh b/test/TEST-02-UNITTESTS/test.sh
new file mode 100755
index 0000000000..6143d3352b
--- /dev/null
+++ b/test/TEST-02-UNITTESTS/test.sh
@@ -0,0 +1,63 @@
+#!/usr/bin/env bash
+set -e
+TEST_DESCRIPTION="Run unit tests under containers"
+RUN_IN_UNPRIVILEGED_CONTAINER=yes
+
+# embed some newlines in the kernel command line to stress our test suite
+KERNEL_APPEND="
+
+frobnicate!
+
+$KERNEL_APPEND
+"
+
+. $TEST_BASE_DIR/test-functions
+
+check_result_nspawn() {
+ local _ret=1
+ [[ -e $1/testok ]] && _ret=0
+ if [[ -s $1/failed ]]; then
+ _ret=$(($_ret+1))
+ echo "=== Failed test log ==="
+ cat $1/failed
+ else
+ if [[ -s $1/skipped ]]; then
+ echo "=== Skipped test log =="
+ cat $1/skipped
+ fi
+ if [[ -s $1/testok ]]; then
+ echo "=== Passed tests ==="
+ cat $1/testok
+ fi
+ fi
+ save_journal $1/var/log/journal
+ _umount_dir $initdir
+ [[ -n "$TIMED_OUT" ]] && _ret=$(($_ret+1))
+ return $_ret
+}
+
+check_result_qemu() {
+ local _ret=1
+ mount_initdir
+ [[ -e $initdir/testok ]] && _ret=0
+ if [[ -s $initdir/failed ]]; then
+ _ret=$(($_ret+1))
+ echo "=== Failed test log ==="
+ cat $initdir/failed
+ else
+ if [[ -s $initdir/skipped ]]; then
+ echo "=== Skipped test log =="
+ cat $initdir/skipped
+ fi
+ if [[ -s $initdir/testok ]]; then
+ echo "=== Passed tests ==="
+ cat $initdir/testok
+ fi
+ fi
+ save_journal $initdir/var/log/journal
+ _umount_dir $initdir
+ [[ -n "$TIMED_OUT" ]] && _ret=$(($_ret+1))
+ return $_ret
+}
+
+do_test "$@" 02