tests/run: add test69 to setuids.
[minix3.git] / test / run
blobbac93215685aba316369a0b0b05874f6e1e21c4b
1 #!/bin/sh
3 # Initialization
4 PATH=:/bin:/usr/bin
5 export PATH
7 rm -rf DIR* # remove any old junk lying around
8 passed=`expr 0` # count number of tests run correctly
9 failed=`expr 0` # count number of tests that failed
10 skipped=`expr 0` # count number of tests that were skipped
11 total=`expr 0` # total number of tests tried
12 badones= # list of tests that failed
14 # Tests which require setuid
15 setuids="test11 test33 test43 test44 test46 test56 test60 test61 test65 \
16 test69"
18 tests=" 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 \
19 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 \
20 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 \
21 61 62 63 64 65 66 67 68 69\
22 sh1.sh sh2.sh interp.sh"
23 tests_no=`expr 0`
25 # Directory must be owned by bin
26 [ "$USER" != root ] || chown bin .
28 # If root, make sure the setuid tests have the correct permissions
29 [ "$USER" = root ] && chown root ${setuids}
30 [ "$USER" = root ] && chmod 4755 ${setuids}
32 # Count tests
33 for i in `echo $tests`; do
34 if [ -x ./test$i ]; then
35 tests_no=`expr $tests_no + 1`
37 done
39 # Print test welcome message
40 clear
41 echo "Running POSIX compliance test suite. There are $tests_no tests in total."
42 echo " "
44 # Provide an argument for test63
45 ARGS_63=`pwd`/mod
47 # Run all the tests, keeping track of who failed.
48 for i in `echo $tests`
50 if [ -x ./test$i ]
51 then
52 total=`expr $total + 1`
53 FAIL=0
54 unset ARG
55 testid="`echo $i | sed 's/\..*//'`"
56 ARG=`eval echo "\\${ARGS_$testid}"`
57 if [ "$USER" = root ]
58 then su - bin -c "cd `pwd`; ./test$i $ARG" || FAIL=1
59 else ./test$i $ARG || FAIL=1
61 if [ $FAIL -eq 0 ]
62 then passed=`expr $passed + 1`
63 else failed=`expr $failed + 1`
64 badones=`echo $badones " " $i`
66 else
67 skipped=`expr $skipped + 1`
69 done
71 # Print results of the tests.
72 echo " "
73 if test $total = $passed
74 then echo All $passed tests completed without error \($skipped skipped\).
75 else echo Testing completed. Score: $passed passed, $failed failed, \
76 skipped $skipped
77 echo The following tests failed: $badones
80 # echo " "