summaryrefslogtreecommitdiff
path: root/test/TEST-55-OOMD
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-03-05 18:36:04 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-03-05 18:36:04 +0900
commit1ebcf47296647d3586ebd5bccc53270561e879fb (patch)
treeda790207d9769b43ee6291d643e67ef40162fd22 /test/TEST-55-OOMD
parentdaceb818cfafbeac470aa5efc5e36e64e52d906d (diff)
downloadsystemd-1ebcf47296647d3586ebd5bccc53270561e879fb.tar.gz
test: merge udev tests
Diffstat (limited to 'test/TEST-55-OOMD')
l---------test/TEST-55-OOMD/Makefile1
-rwxr-xr-xtest/TEST-55-OOMD/test.sh48
2 files changed, 49 insertions, 0 deletions
diff --git a/test/TEST-55-OOMD/Makefile b/test/TEST-55-OOMD/Makefile
new file mode 120000
index 0000000000..e9f93b1104
--- /dev/null
+++ b/test/TEST-55-OOMD/Makefile
@@ -0,0 +1 @@
+../TEST-01-BASIC/Makefile \ No newline at end of file
diff --git a/test/TEST-55-OOMD/test.sh b/test/TEST-55-OOMD/test.sh
new file mode 100755
index 0000000000..121aa8d56e
--- /dev/null
+++ b/test/TEST-55-OOMD/test.sh
@@ -0,0 +1,48 @@
+#!/usr/bin/env bash
+set -e
+TEST_DESCRIPTION="systemd-oomd Memory Pressure Test"
+
+. $TEST_BASE_DIR/test-functions
+
+check_result_nspawn() {
+ local ret=1
+ local journald_report=""
+ local pids=""
+ [[ -e $1/testok ]] && ret=0
+ if [[ -e $1/skipped ]]; then
+ echo "TEST-56-OOMD was skipped:"
+ cat $1/skipped
+ ret=0
+ fi
+ [[ -f $1/failed ]] && cp -a $1/failed $TESTDIR
+ save_journal $1/var/log/journal
+ [[ -f $TESTDIR/failed ]] && cat $TESTDIR/failed
+ echo $JOURNAL_LIST
+ test -s $TESTDIR/failed && ret=$(($ret+1))
+ [ -n "$TIMED_OUT" ] && ret=$(($ret+1))
+ check_asan_reports "$1" || ret=$(($ret+1))
+ _umount_dir $initdir
+ return $ret
+}
+
+check_result_qemu() {
+ local ret=1
+ mount_initdir
+ [[ -e $initdir/testok ]] && ret=0
+ if [[ -e $initdir/skipped ]]; then
+ echo "TEST-56-OOMD was skipped:"
+ cat $initdir/skipped
+ ret=0
+ fi
+ [[ -f $initdir/failed ]] && cp -a $initdir/failed $TESTDIR
+ save_journal $initdir/var/log/journal
+ check_asan_reports "$initdir" || ret=$(($ret+1))
+ _umount_dir $initdir
+ [[ -f $TESTDIR/failed ]] && cat $TESTDIR/failed
+ echo $JOURNAL_LIST
+ test -s $TESTDIR/failed && ret=$(($ret+1))
+ [ -n "$TIMED_OUT" ] && ret=$(($ret+1))
+ return $ret
+}
+
+do_test "$@" 55