6 # Sends a signal which checks if the process is active (doesn't kill anything)
7 function pidactive () {
8 kill -0 $1 2> /dev/null
12 # Kill a particular process
15 #adjust depending how long it takes to die gracefully
24 function start_radiusd () {
25 ../main/radiusd -Xmd ../../raddb/ -n test -i 127.0.0.1 -p $PORT > radiusd.log 2>&1 &
27 #wait for the process to startup or die...
29 if ! pidactive $PID; then
32 echo "Command failed with $?"
48 TOTAL=`grep TESTS $NAME | sed 's/.*TESTS//'`
51 # Each test may have multiple variants.
53 for NUMBER in `echo $TOTAL`
58 # Add the name of the test, and the variant to the request
60 echo "Test-Name = \"$NAME\"," >> .request
61 echo 'Test-Number = ' $NUMBER >> .request
63 mv .request .cache/$NAME:$NUMBER
70 echo "Starting radiusd..."
72 echo "Running tests..."
75 (cd .cache;ls -1 > ../.foo)
79 echo "-f .cache/$x" >> .bar
82 ../main/radclient `cat .bar` -xFd . 127.0.0.1:$PORT auth testing123 > radclient.log 2>&1
86 RESULT=`egrep ^\\.cache/$x radclient.log | sed 's/.* //'`
87 if [ "$RESULT" = "2" ]; then
100 rm -f radiusd.log radclient.log
101 echo "All tests succeeded"
103 echo "See radclient.log for more details"