HALF ECHO LEARN / REFERENCE COLLECTION

v262.2

test/units/TEST-07-PID1.thp-disable.sh

Git blob: 06626ad0918320758e642bbc2d016f877af5ead2

Lines 1–26 of 26

#!/usr/bin/env bash
# SPDX-License-Identifier: LGPL-2.1-or-later
set -eux
set -o pipefail
 
systemd-run --wait \
        /usr/lib/systemd/tests/unit-tests/manual/test-thp no-disable
 
systemd-run --wait \
        -p MemoryTHP=disable \
        /usr/lib/systemd/tests/unit-tests/manual/test-thp disable
 
# The following test will always return 77 if at compile time the kernel version
# is less than 6.18. If it happens don't let the whole test fail
set +e
 
systemd-run --wait \
        -p MemoryTHP=madvise \
        /usr/lib/systemd/tests/unit-tests/manual/test-thp madvise
 
if [ $? -eq 77 ]; then
        exit 0
fi
 
set -e