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 \
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"
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}
33 for i
in `echo $tests`; do
34 if [ -x .
/test$i ]; then
35 tests_no
=`expr $tests_no + 1`
39 # Print test welcome message
41 echo "Running POSIX compliance test suite. There are $tests_no tests in total."
44 # Provide an argument for test63
47 # Run all the tests, keeping track of who failed.
48 for i
in `echo $tests`
52 total
=`expr $total + 1`
55 testid
="`echo $i | sed 's/\..*//'`"
56 ARG
=`eval echo "\\${ARGS_$testid}"`
58 then su
- bin
-c "cd `pwd`; ./test$i $ARG" || FAIL
=1
59 else .
/test$i $ARG || FAIL
=1
62 then passed
=`expr $passed + 1`
63 else failed
=`expr $failed + 1`
64 badones
=`echo $badones " " $i`
67 skipped
=`expr $skipped + 1`
71 # Print results of the tests.
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
, \
77 echo The following tests failed
: $badones