Skip to content

Commit cc51407

Browse files
committed
fstests_ovl_xfs: cut and autorun scripts
Add xfs-backed-overlayfs runner for fstests. fstests can be used as a harness for the unionmount testsuite, but we already have unionmount_testsuite, so omit the testsuite from the image for now. Signed-off-by: David Disseldorp <[email protected]>
1 parent 08e05ed commit cc51407

File tree

2 files changed

+85
-0
lines changed

2 files changed

+85
-0
lines changed

autorun/fstests_ovl_xfs.sh

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/bin/bash
2+
# SPDX-License-Identifier: (LGPL-2.1 OR LGPL-3.0)
3+
# Copyright (C) SUSE LLC 2025, all rights reserved.
4+
5+
_vm_ar_env_check || exit 1
6+
7+
set -x
8+
9+
modprobe nvme
10+
modprobe virtio_blk
11+
modprobe zram num_devices="0" || _fatal "failed to load zram module"
12+
13+
_vm_ar_hosts_create
14+
_vm_ar_dyn_debug_enable
15+
16+
_fstests_users_groups_provision
17+
18+
fstests_cfg="${FSTESTS_SRC}/configs/$(hostname -s).config"
19+
cat > "$fstests_cfg" << EOF
20+
MODULAR=0
21+
TEST_DIR=/mnt/test
22+
SCRATCH_MNT=/mnt/scratch
23+
USE_KMEMLEAK=yes
24+
FSTYP=xfs
25+
MKFS_OPTIONS=
26+
EOF
27+
_fstests_devs_provision "$fstests_cfg"
28+
. "$fstests_cfg"
29+
30+
mkdir -p "$TEST_DIR" "$SCRATCH_MNT"
31+
mkfs."${FSTYP}" $MKFS_OPTIONS -f "$TEST_DEV" || _fatal "mkfs failed"
32+
mount -t "$FSTYP" "$TEST_DEV" "$TEST_DIR" || _fatal
33+
34+
# xfstests does *not* do scratch mkfs+mount for -overlayfs backing
35+
mkfs."${FSTYP}" $MKFS_OPTIONS -f "$SCRATCH_DEV" || _fatal "mkfs failed"
36+
37+
# fstests generic/131 needs loopback networking
38+
ip link set dev lo up
39+
40+
set +x
41+
42+
echo "Ready for FSQA, e.g.: ./check -overlay"
43+
44+
cd "$FSTESTS_SRC" || _fatal
45+
[[ -n "$FSTESTS_AUTORUN_CMD" ]] && eval "$FSTESTS_AUTORUN_CMD"

cut/fstests_ovl_xfs.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/bin/bash
2+
# SPDX-License-Identifier: (LGPL-2.1 OR LGPL-3.0)
3+
# Copyright (C) SUSE LLC 2025, all rights reserved.
4+
5+
RAPIDO_DIR="$(realpath -e ${0%/*})/.."
6+
. "${RAPIDO_DIR}/runtime.vars"
7+
8+
_rt_require_dracut_args "$RAPIDO_DIR/autorun/lib/fstests.sh" \
9+
"$RAPIDO_DIR/autorun/fstests_ovl_xfs.sh" "$@"
10+
req_inst=()
11+
_rt_require_fstests
12+
_rt_require_pam_mods req_inst "pam_rootok.so" "pam_limits.so"
13+
_rt_human_size_in_b "${FSTESTS_ZRAM_SIZE:-1G}" zram_bytes \
14+
|| _fail "failed to calculate memory resources"
15+
# 2x multiplier for one test and one scratch zram. +2G as buffer
16+
_rt_mem_resources_set "$((2048 + (zram_bytes * 2 / 1048576)))M"
17+
18+
"$DRACUT" --install "tail blockdev ps rmdir resize dd vim grep find df sha256sum \
19+
strace mkfs mkfs.xfs free ip su uuidgen losetup ipcmk \
20+
which perl awk bc touch cut chmod true false unlink \
21+
mktemp getfattr setfattr chacl attr killall hexdump sync \
22+
id sort uniq date expr tac diff head dirname seq \
23+
basename tee egrep yes mkswap timeout blkdiscard \
24+
fstrim fio logger dmsetup chattr lsattr cmp stat \
25+
dbench /usr/share/dbench/client.txt hostname getconf md5sum \
26+
od wc getfacl setfacl tr xargs sysctl link truncate quota \
27+
repquota setquota quotacheck quotaon pvremove vgremove \
28+
xfs_mkfile xfs_db xfs_io xfs_spaceman fsck comm indent \
29+
xfs_mdrestore xfs_bmap xfs_fsr xfsdump xfs_freeze xfs_info \
30+
xfs_logprint xfs_repair xfs_growfs xfs_quota xfs_metadump \
31+
chgrp du fgrep pgrep tar rev kill duperemove python3 \
32+
${req_inst[*]} ${FSTESTS_SRC}/ltp/* ${FSTESTS_SRC}/src/* \
33+
${FSTESTS_SRC}/src/log-writes/* \
34+
${FSTESTS_SRC}/src/aio-dio-regress/*" \
35+
--include "$FSTESTS_SRC" "$FSTESTS_SRC" \
36+
--add-drivers "zram nvme lzo lzo-rle dm-snapshot dm-flakey overlay xfs \
37+
loop scsi_debug dm-log-writes virtio_blk" \
38+
--modules "base" \
39+
"${DRACUT_RAPIDO_ARGS[@]}" \
40+
"$DRACUT_OUT" || _fail "dracut failed"

0 commit comments

Comments
 (0)