X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=src%2Ftests%2Fruntests.sh;h=cb13ea5172680651b532f3dafbe74b82778bf3e4;hb=bca85674a83f94b9cfae0ebdc129bbaf645c8f7d;hp=f073392442857d14698fcd01ad366db083a315c8;hpb=9f7e276c5de63fccb965387eef3885dfdca4ca99;p=freeradius.git diff --git a/src/tests/runtests.sh b/src/tests/runtests.sh old mode 100644 new mode 100755 index f073392..cb13ea5 --- a/src/tests/runtests.sh +++ b/src/tests/runtests.sh @@ -3,37 +3,6 @@ PORT=12340 HOME_PORT=12350 -# Sends a signal which checks if the process is active (doesn't kill anything) -function pidactive () { - kill -0 $1 2> /dev/null - return -} - -# Kill a particular process -function pidkill () { - kill $1 || return - #adjust depending how long it takes to die gracefully - sleep 1 - if pidactive $1; then - #escalating - kill -9 $1 - fi -} - -# Starts the server -function start_radiusd () { - ../main/radiusd -Xmd ../../raddb/ -n test -i 127.0.0.1 -p $PORT > radiusd.log 2>&1 & - PID=$! -#wait for the process to startup or die... - sleep 3 - if ! pidactive $PID; then - wait $PID - tail -5 radiusd.log - echo "Command failed with $?" - exit 1 - fi -} - rm -f verbose.log RCODE=0 @@ -53,25 +22,20 @@ do for NUMBER in `echo $TOTAL` do cp $NAME .request + BASE=`echo $NAME | sed 's,.*/,,'` # # Add the name of the test, and the variant to the request # - echo "Test-Name = \"$NAME\"," >> .request + echo "Test-Name = \"$BASE\"," >> .request echo 'Test-Number = ' $NUMBER >> .request - mv .request .cache/$NAME:$NUMBER + mv .request .cache/$BASE:$NUMBER done done -# -# Now run the tests -# -echo "Starting radiusd..." -start_radiusd echo "Running tests..." - (cd .cache;ls -1 > ../.foo) rm -f .bar for x in `cat .foo` @@ -93,8 +57,6 @@ do done -pidkill $PID - if [ "$RCODE" = "0" ] then rm -f radiusd.log radclient.log