strace/tests/btrfs-w.test
Jeff Mahoney 826b7978ec tests: check decoding of btrfs RDWR ioctls returned data
* tests/btrfs-vw.test: New file.
* tests/btrfs-w.test: New file.
* tests/Makefile.am (DECODER_TESTS): Add them.
2016-05-27 08:54:32 +00:00

30 lines
666 B
Bash
Executable File

#!/bin/sh
# Check decoding of btrfs ioctl w/ live ioctls.
# WARNING: USE OF THIS TEST WILL MODIFY AN EXISTING BTRFS FILE SYSTEM
# Typical usage:
# mkfs.btrfs <dev>
# mount <dev> /mnt
# BTRFS_MOUNTPOINT=/mnt make check TESTS="btrfs-w"
# umount /mnt
. "${srcdir=.}/init.sh"
if [ -z "${BTRFS_MOUNTPOINT}" ]; then
skip_ "\$BTRFS_MOUNTPOINT not set"
elif [ ! -d "${BTRFS_MOUNTPOINT}" ]; then
skip_ "\$BTRFS_MOUNTPOINT does not point to a directory"
fi
run_prog ./btrfs -w "${BTRFS_MOUNTPOINT}" > /dev/null
run_strace -a16 -eioctl $args > "$EXP"
check_prog grep
grep -v '^ioctl([012],' < "$LOG" > "$OUT"
match_diff "$OUT" "$EXP"
rm -f "$EXP" "$OUT"
exit 0