Merge pull request #31318 from mrc0mmand/test-switch-to-btrfs

test: use btrfs by default on Arch as well
This commit is contained in:
Yu Watanabe 2024-02-18 04:55:56 +09:00 committed by GitHub
commit 20fedbe32b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 25 additions and 13 deletions

View file

@ -3,6 +3,10 @@
set -e
TEST_DESCRIPTION="Test various scenarios involving transition from/to initrd"
# Note: for debugging systemd.journald.max_level_console=debug might come in handy
# as well, but it's not used here since it's _very_ noisy and slows the test
# down a lot
KERNEL_APPEND="${KERNEL_APPEND:-} systemd.journald.forward_to_console=1"
TEST_NO_NSPAWN=1
# shellcheck source=test/test-functions

View file

@ -12,20 +12,17 @@ TEST_NO_NSPAWN=1
. "${TEST_BASE_DIR:?}/test-functions"
test_append_files() {
# Create a swap file
(
image_install mkswap swapon swapoff stress
local workspace="${1:?}"
dd if=/dev/zero of="${initdir:?}/swapfile" bs=1M count=48
chmod 0600 "${initdir:?}/swapfile"
image_install mkswap swapon swapoff stress
image_install -o btrfs
mkdir -p "${initdir:?}/etc/systemd/system/init.scope.d/"
cat >>"${initdir:?}/etc/systemd/system/init.scope.d/test-55-oomd.conf" <<EOF
mkdir -p "${workspace:?}/etc/systemd/system/init.scope.d/"
cat >"${workspace:?}/etc/systemd/system/init.scope.d/test-55-oomd.conf" <<EOF
[Scope]
MemoryHigh=infinity
StartupMemoryHigh=10G
EOF
)
}
do_test "$@" 55

View file

@ -47,9 +47,13 @@ KERNEL_VER="${KERNEL_VER-$(uname -r)}"
QEMU_TIMEOUT="${QEMU_TIMEOUT:-1800}"
NSPAWN_TIMEOUT="${NSPAWN_TIMEOUT:-1800}"
TIMED_OUT= # will be 1 after run_* if *_TIMEOUT is set and test timed out
get_bool "$LOOKS_LIKE_SUSE" && FSTYPE="${FSTYPE:-btrfs}" || FSTYPE="${FSTYPE:-ext4}"
UNIFIED_CGROUP_HIERARCHY="${UNIFIED_CGROUP_HIERARCHY:-default}"
EFI_MOUNT="${EFI_MOUNT:-$(bootctl -x 2>/dev/null || echo /boot)}"
if get_bool "$LOOKS_LIKE_SUSE" || get_bool "$LOOKS_LIKE_ARCH"; then
FSTYPE="${FSTYPE:-btrfs}"
else
FSTYPE="${FSTYPE:-ext4}"
fi
# Note that defining a different IMAGE_NAME in a test setup script will only result
# in default.img being copied and renamed. It can then be extended by defining
# a test_append_files() function. The $1 parameter will be the root directory.
@ -1119,14 +1123,14 @@ install_fs_tools() {
install_modules() {
dinfo "Install modules"
instmods bridge dummy ipvlan macvlan vfat veth
instmods bridge dummy ext4 ipvlan macvlan vfat veth
instmods loop =block
instmods nls_ascii =nls
instmods overlay =overlayfs
instmods scsi_debug
if get_bool "$LOOKS_LIKE_SUSE"; then
instmods ext4 af_packet
instmods af_packet
fi
}
@ -1846,7 +1850,7 @@ save_journal() {
# Show messages from the testsuite-XX.service or messages with priority "warning" and higher
echo " --- $source_dir ---"
"$JOURNALCTL" --no-pager --no-hostname -o short-monotonic -D "$source_dir" \
"$JOURNALCTL" --all --no-pager --no-hostname -o short-monotonic -D "$source_dir" \
_SYSTEMD_UNIT="testsuite-${TESTID:?}.service" + SYSLOG_IDENTIFIER="testsuite-$TESTID.sh" + \
PRIORITY=4 + PRIORITY=3 + PRIORITY=2 + PRIORITY=1 + PRIORITY=0

View file

@ -23,7 +23,14 @@ rm -rf /run/systemd/system/testsuite-55-testbloat.service.d
# Activate swap file if we are in a VM
if systemd-detect-virt --vm --quiet; then
mkswap /swapfile
if [[ "$(findmnt -n -o FSTYPE /)" == btrfs ]]; then
btrfs filesystem mkswapfile -s 64M /swapfile
else
dd if=/dev/zero of=/swapfile bs=1M count=64
chmod 0600 /swapfile
mkswap /swapfile
fi
swapon /swapfile
swapon --show
fi