3 [ -z "$CIOPFS" ] && CIOPFS
="ciopfs"
5 FSTEST
=http
://tuxera.com
/sw
/qa
/pjd-fstest-20090130-RC.tgz
6 CIOPFS_ARGS
="-f -o direct_io,allow_other,use_ino,noauto_cache,ac_attr_timeout=0,attr_timeout=0,entry_timeout=0"
7 CIOPFS_XATTR_NAME
="user.filename"
10 [ $# -ne 0 ] && echo "$0: $*"
14 # $1 => fs type, $2 => image size, $3 => mkfs options
17 dd if=/dev
/zero of
="$1.img" bs
=1M count
=$2
19 losetup
"$loopdev" "$1.img"
24 # $1 => dir in which to perform the tests, $2 => fs type, $3 => log file
26 tar -C "$1" -xzf fstest.tgz
28 echo fs
="$2" >> tests
/conf
29 [[ $2 == ntfs
]] && echo fs
="ntfs-3g" >> tests
/conf
31 prove
-r tests
2>&1 |
tee "$3"
35 # $1 => fs type, $2 => mount options
37 echo mount
-t $1 -o "loop,$2" "$1.img" mnt
38 mount
-t $1 -o "loop,$2" "$1.img" mnt || die
"could not mount $1 image"
39 mkdir
-p "mnt/$1" "mnt/ciopfs-$1"
40 run_fstest
"mnt/$1" $1 "../../../$1.result"
41 "$CIOPFS" $CIOPFS_ARGS "mnt/ciopfs-$1" ciopfs-mnt
&> "ciopfs-$1.log" &
42 ps
-p $
! &> /dev
/null || die
"ciopfs not running, aborting..."
43 touch ciopfs-mnt
/CiOpFs
&&
44 getfattr
-n $CIOPFS_XATTR_NAME mnt
/ciopfs-
$1/ciopfs |
grep CiOpFs
&> /dev
/null ||
45 die
"ciopfs not working correctly"
46 run_fstest
"ciopfs-mnt" $1 "../../ciopfs-$1.result"
47 umount
-f ciopfs-mnt ||
kill -9 $
!
48 umount
-f mnt || die
"couldn't umount $1 image"
51 [ $# -eq 0 ] && die
"specify a directory in which to run the testsuite in"
53 [ ! -d "$1" ] && mkdir
"$1"
55 cd "$1" && rm -rf mnt ciopfs-mnt
*.img
*.result
*.log
&& mkdir
-p mnt ciopfs-mnt || die
57 [ ! -f fstest.tgz
] && wget
"$FSTEST" -O fstest.tgz
60 test_image ext3 user_xattr
68 # btrfs needs at least 256M