]> CyberLeo.Net >> Repos - FreeBSD/releng/8.0.git/blob - tools/regression/acltools/00.t
Adjust to reflect 8.0-RELEASE.
[FreeBSD/releng/8.0.git] / tools / regression / acltools / 00.t
1 #!/bin/sh
2 #
3 # This is a wrapper script to run tools-posix.test.
4 #
5 # If any of the tests fails, here is how to debug it: go to
6 # the directory with problematic filesystem mounted on it,
7 # and do /path/to/test run /path/to/test tools-posix.test, e.g.
8 #
9 # /usr/src/tools/regression/acltools/run /usr/src/tools/regression/acltools/tools-posix.test
10 #
11 # Output should be obvious.
12 #
13 # $FreeBSD$
14 #
15
16 echo "1..4"
17
18 if [ `whoami` != "root" ]; then
19         echo "not ok 1 - you need to be root to run this test."
20         exit 1
21 fi
22
23 TESTDIR=`dirname $0`
24
25 # Set up the test filesystem.
26 MD=`mdconfig -at swap -s 10m`
27 MNT=`mktemp -dt acltools`
28 newfs /dev/$MD > /dev/null
29 mount -o acls /dev/$MD $MNT
30 if [ $? -ne 0 ]; then
31         echo "not ok 1 - mount failed."
32         exit 1
33 fi
34
35 echo "ok 1"
36
37 cd $MNT
38
39 # First, check whether we can crash the kernel by creating too many
40 # entries.  For some reason this won't work in the test file.
41 touch xxx
42 i=0;
43 while :; do i=$(($i+1)); setfacl -m u:$i:rwx xxx 2> /dev/null; if [ $? -ne 0 ]; then break; fi; done
44 chmod 600 xxx
45 rm xxx
46 echo "ok 2"
47
48 perl $TESTDIR/run $TESTDIR/tools-posix.test > /dev/null
49
50 if [ $? -eq 0 ]; then
51         echo "ok 3"
52 else
53         echo "not ok 3"
54 fi
55
56 cd /
57 umount -f $MNT
58 rmdir $MNT
59 mdconfig -du $MD
60
61 echo "ok 4"
62