blob: 6238dca800aa6c70e3b68f14adce1ba2c1207602 [file] [log] [blame]
Jeff Mahoney826b7972016-05-26 23:33:06 -04001#!/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
15if [ -z "${BTRFS_MOUNTPOINT}" ]; then
16 skip_ "\$BTRFS_MOUNTPOINT not set"
17elif [ ! -d "${BTRFS_MOUNTPOINT}" ]; then
18 skip_ "\$BTRFS_MOUNTPOINT does not point to a directory"
19fi
20
21run_prog ./btrfs -w "${BTRFS_MOUNTPOINT}" > /dev/null
22run_strace -a16 -eioctl $args > "$EXP"
23check_prog grep
24grep -v '^ioctl([012],' < "$LOG" > "$OUT"
25match_diff "$OUT" "$EXP"
26
27rm -f "$EXP" "$OUT"
28
29exit 0