diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 13:00:47 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 13:00:47 +0000 |
commit | 2cb7e0aaedad73b076ea18c6900b0e86c5760d79 (patch) | |
tree | da68ca54bb79f4080079bf0828acda937593a4e1 /test/TEST-56-OOMD/test.sh | |
parent | Initial commit. (diff) | |
download | systemd-upstream.tar.xz systemd-upstream.zip |
Adding upstream version 247.3.upstream/247.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/TEST-56-OOMD/test.sh')
-rwxr-xr-x | test/TEST-56-OOMD/test.sh | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/test/TEST-56-OOMD/test.sh b/test/TEST-56-OOMD/test.sh new file mode 100755 index 0000000..55b0d1d --- /dev/null +++ b/test/TEST-56-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 "$@" 56 |