Jeff Mahoney | 826b797 | 2016-05-26 23:33:06 -0400 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | # Check decoding of btrfs ioctl w/ live ioctls. |
| 4 | |
| 5 | # WARNING: USE OF THIS TEST WILL MODIFY AN EXISTING BTRFS FILE SYSTEM |
| 6 | |
| 7 | # Typical usage: |
| 8 | # mkfs.btrfs <dev> |
| 9 | # mount <dev> /mnt |
| 10 | # BTRFS_MOUNTPOINT=/mnt make check TESTS="btrfs-w" |
| 11 | # umount /mnt |
| 12 | |
| 13 | . "${srcdir=.}/init.sh" |
| 14 | |
| 15 | if [ -z "${BTRFS_MOUNTPOINT}" ]; then |
| 16 | skip_ "\$BTRFS_MOUNTPOINT not set" |
| 17 | elif [ ! -d "${BTRFS_MOUNTPOINT}" ]; then |
| 18 | skip_ "\$BTRFS_MOUNTPOINT does not point to a directory" |
| 19 | fi |
| 20 | |
| 21 | run_prog ./btrfs -w "${BTRFS_MOUNTPOINT}" > /dev/null |
| 22 | run_strace -a16 -eioctl $args > "$EXP" |
| 23 | check_prog grep |
| 24 | grep -v '^ioctl([012],' < "$LOG" > "$OUT" |
| 25 | match_diff "$OUT" "$EXP" |
| 26 | |
| 27 | rm -f "$EXP" "$OUT" |
| 28 | |
| 29 | exit 0 |