3 # expected sha1sum of the FS image
4 expect
=98bcafa04cb1eb75b7add6c95eb587c37f5050e0
8 # ownership matters for the proto file.
9 # the run script runs us with user "bin" (3), group "bin" (7).
10 if [ "`id -u`" != 3 -o "`id -g`" != 7 ]
12 echo "test script should be run with uid 3, gid 7."
21 rm -rf $testdir $protofile $fsimage
29 mkdir
-p $testdir $testdir/contents
$testdir/modes
37 # Make some small & big & bigger files
39 prevf
=$testdir/contents
/file
40 echo "Test contents 123" >$prevf
41 for double
in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
42 do fn
=$testdir/contents
/fn.
$double
43 cat $prevf $prevf >$fn
47 # Make some files with various modes & mtimes
49 for many
in 0 1 2 3 4 5 6 7 8 9
50 do for m1
in 0 1 2 3 4 5 6 7
51 do for m2
in 0 1 2 3 4 5 6 7
52 do for m3
in 0 1 2 3 4 5 6 7
55 fn
=$testdir/modes
/m
${mode}${many}
56 echo "$many $m1 $m2 $m3 $mode" > $fn
63 # Make an MFS filesystem image out of it
68 dd if=/dev
/zero seek
=$BLOCKS of
=$fsimage count
=1 bs
=$BS >/dev
/null
2>&1
71 /usr
/sbin
/mkproto
-s -b $BLOCKS -i $INODES $testdir >$protofile
73 /sbin
/mkfs.mfs
-T 1 -b $BLOCKS -i $INODES $fsimage $protofile >/dev
/null
2>&1
74 sum="`sha1 $fsimage | awk '{ print $4 }'`"
76 rm -rf $testdir $protofile $fsimage
78 if [ $sum != $expect ]
80 echo sum $sum is not expected
$expect