diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-26 10:33:11 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-26 10:33:11 +0000 |
commit | ae3ecffbd2e40760fef5dc09db30ea8a81abec70 (patch) | |
tree | f3b77bfda1bae06d3326ef27c3cb61539e7f93cc /test/test-functions | |
parent | Adding debian version 102-3. (diff) | |
download | dracut-ae3ecffbd2e40760fef5dc09db30ea8a81abec70.tar.xz dracut-ae3ecffbd2e40760fef5dc09db30ea8a81abec70.zip |
Merging upstream version 103.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/test-functions')
-rw-r--r-- | test/test-functions | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/test/test-functions b/test/test-functions index b664fb0..2b32821 100644 --- a/test/test-functions +++ b/test/test-functions @@ -12,13 +12,18 @@ export TESTDIR KVERSION=${KVERSION-$(uname -r)} -[ -z "$USE_NETWORK" ] && USE_NETWORK="network-legacy" +[ -z "$USE_NETWORK" ] && USE_NETWORK="network" if [[ -z $basedir ]]; then basedir="$(realpath ../..)"; fi DRACUT=${DRACUT-${basedir}/dracut.sh} PKGLIBDIR=${PKGLIBDIR-$basedir} +TEST_KERNEL_CMDLINE+=" panic=1 oops=panic softlockup_panic=1 systemd.crash_reboot console=ttyS0,115200n81 $DEBUGFAIL " +if [[ $V != "1" && $V != "2" ]]; then + TEST_KERNEL_CMDLINE+="quiet " +fi + test_dracut() { TEST_DRACUT_ARGS+=" --local --no-hostonly --no-hostonly-cmdline --no-early-microcode --add test --force --kver $KVERSION" @@ -31,7 +36,7 @@ test_dracut() { IFS=' ' read -a TEST_DRACUT_ARGS_ARRAY <<< "$TEST_DRACUT_ARGS" "$DRACUT" \ - --kernel-cmdline "panic=1 oops=panic softlockup_panic=1 systemd.crash_reboot quiet rd.retry=10 rd.info rd.shell=0 selinux=0 console=ttyS0,115200n81 $DEBUGFAIL" \ + --kernel-cmdline "rd.retry=10 rd.info rd.shell=0" \ "${TEST_DRACUT_ARGS_ARRAY[@]}" \ "$@" || return 1 } @@ -143,20 +148,11 @@ while (($# > 0)); do else echo -e "TEST: $TEST_DESCRIPTION " "$COLOR_SUCCESS" "[STARTED]" "$COLOR_NORMAL" fi - if [[ $V == "1" ]]; then - set -o pipefail - ( - test_setup && test_run - ret=$? - test_cleanup - if ((ret != 0)) && [[ -f "$TESTDIR"/server.log ]]; then - mv "$TESTDIR"/server.log ./server${TEST_RUN_ID:+-$TEST_RUN_ID}.log - fi - rm -fr -- "$TESTDIR" - rm -f -- .testdir${TEST_RUN_ID:+-$TEST_RUN_ID} - exit $ret - ) < /dev/null 2>&1 | tee "test${TEST_RUN_ID:+-$TEST_RUN_ID}.log" - elif [[ $V == "2" ]]; then + if [[ $V == "1" || $V == "2" ]]; then + tee_command="tee" + if [[ $V == "2" && -x "$basedir/logtee" ]]; then + tee_command="$basedir/logtee" + fi set -o pipefail ( test_setup && test_run @@ -168,7 +164,7 @@ while (($# > 0)); do rm -fr -- "$TESTDIR" rm -f -- .testdir${TEST_RUN_ID:+-$TEST_RUN_ID} exit $ret - ) < /dev/null 2>&1 | "$basedir/logtee" "test${TEST_RUN_ID:+-$TEST_RUN_ID}.log" + ) < /dev/null 2>&1 | "$tee_command" "test${TEST_RUN_ID:+-$TEST_RUN_ID}.log" else ( test_setup && test_run |