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/ -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..."
73 echo "Running tests..."
76 (cd .cache;ls -1 > ../.foo)
80 echo "-f .cache/$x" >> .bar
83 ../main/radclient `cat .bar` -xFd ./raddb 127.0.0.1:$PORT auth testing123 > radclient.log 2>&1
87 RESULT=`egrep ^\\.cache/$x radclient.log | sed 's/.* //'`
88 if [ "$RESULT" = "2" ]; then
101 rm -f radiusd.log radclient.log
102 echo "All tests succeeded"
104 echo "See radclient.log for more details"