diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 09:49:46 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 09:49:46 +0000 |
commit | 50b37d4a27d3295a29afca2286f1a5a086142cec (patch) | |
tree | 9212f763934ee090ef72d823f559f52ce387f268 /src/tests/runtests.sh | |
parent | Initial commit. (diff) | |
download | freeradius-b44c43f84b67b16f7897077658751679f7087fa7.tar.xz freeradius-b44c43f84b67b16f7897077658751679f7087fa7.zip |
Adding upstream version 3.2.1+dfsg.upstream/3.2.1+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tests/runtests.sh')
-rwxr-xr-x | src/tests/runtests.sh | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/tests/runtests.sh b/src/tests/runtests.sh new file mode 100755 index 0000000..cc403c6 --- /dev/null +++ b/src/tests/runtests.sh @@ -0,0 +1,51 @@ +#!/bin/sh + +: ${BIN_PATH=./} +: ${PORT=12340} +: ${HOME_PORT=12350} +: ${SECRET=testing123} + +rm -f verbose.log +RCODE=0 + +echo "Running tests:" +for NAME in $@ +do + TOTAL=`grep TESTS $NAME | sed 's/.*TESTS//'` + + # + # Each test may have multiple variants. + # + 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 = \"$BASE\"," >> .request + echo 'Test-Number = ' $NUMBER >> .request + + rm ./radclient.log > /dev/null 2>&1 + $BIN_PATH/radclient -f .request -xF -D ./ 127.0.0.1:$PORT auth $SECRET 1> ./radclient.log + if [ "$?" = "0" ]; then + echo "${BASE}_${NUMBER} : Success" + else + echo "${BASE}_${NUMBER} : FAILED" + cat ./radclient.log + RCODE=1 + fi + done +done + + +if [ "$RCODE" = "0" ] +then + rm -f radiusd.log radclient.log + echo "All tests succeeded" +else + echo "See radclient.log for more details" +fi + +exit $RCODE |