2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2000-2004 Silicon Graphics, Inc. All Rights Reserved.
10 _begin_fstest mkfs auto quick
12 seqfull="$seqres.full"
13 # Import common functions.
16 # Override the default cleanup function.
20 _scratch_unmount 2>/dev/null
27 echo "*** $* ***" >>$seqfull
37 s/Device: *[0-9][0-9]*,[0-9][0-9]*/Device: <DEVICE>/;
38 s/Inode: *[0-9][0-9]*/Inode: <INODE>/;
39 s/Size: *[0-9][0-9]* *Filetype: Dir/Size: <DSIZE> Filetype: Dir/;
43 # real QA test starts here
48 # mkfs cannot create a filesystem with protofiles if realtime is enabled, so
49 # don't run this test if the rtinherit is anywhere in the mkfs options.
50 echo "$MKFS_OPTIONS" | grep -q "rtinherit" && \
51 _notrun "Cannot mkfs with a protofile and -d rtinherit."
57 $here/src/devzero -b 2048 -n 2 -c -v 44 $tempfile.2
66 file_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_0 ---755 3 1 $tempfile
67 file_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_1 ---755 3 1 $tempfile
68 file_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_2 ---755 3 1 $tempfile
69 file_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_3 ---755 3 1 $tempfile
70 file_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_4 ---755 3 1 $tempfile
73 setuid -u-666 0 0 $tempfile
74 setgid --g666 0 0 $tempfile
75 setugid -ug666 0 0 $tempfile
76 block_device b--012 3 1 161 162
77 char_device c--345 3 1 177 178
79 symlink l--123 0 0 bigfile
80 : a file we actually read
81 bigfile ---666 3 0 $tempfile.2
88 _fail "failed to create test protofile"
93 echo "*** create FS version $1"
94 VERSION="-n version=$1"
97 _scratch_unmount >/dev/null 2>&1
100 _scratch_mkfs_xfs $VERSION -p $protofile >>$seqfull 2>&1 \
101 || _fail "mkfs failed"
108 _try_scratch_mount >>$seqfull 2>&1 \
109 || _fail "mount failed"
112 (cd $SCRATCH_MNT ; find . | LC_COLLATE=POSIX sort \
113 | grep -v ".use_space" \
114 | xargs $here/src/lstat64 | _filter_stat)
115 diff -q $SCRATCH_MNT/bigfile $tempfile.2 \
116 || _fail "bigfile corrupted"
118 echo "*** unmount FS"
120 _scratch_unmount >>$seqfull 2>&1 \
121 || _fail "umount failed"