summaryrefslogtreecommitdiff
path: root/xtests/run-xtests.sh
diff options
context:
space:
mode:
authorThorsten Kukuk <kukuk@thkukuk.de>2006-08-30 08:45:30 +0000
committerThorsten Kukuk <kukuk@thkukuk.de>2006-08-30 08:45:30 +0000
commit424578c5c4a5edbd79142c9348f4eda689530651 (patch)
tree6ef01329b2a0fb48e171b382f777eb1347494f86 /xtests/run-xtests.sh
parentd668e9e5eed079686000f0979391f3691a54408a (diff)
Relevant BUGIDs:
Purpose of commit: cleanup/bugfix Commit summary: --------------- 2006-08-30 Thorsten Kukuk <kukuk@thkukuk.de> * xtests/Makefile.am: Move shell code to execute tests from here ... * xtests/run-xtests.sh: ... to here. * xtests/*.c: Include config.h. * tests/*.c: Likewise.
Diffstat (limited to 'xtests/run-xtests.sh')
-rwxr-xr-xxtests/run-xtests.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/xtests/run-xtests.sh b/xtests/run-xtests.sh
new file mode 100755
index 00000000..9c8c3571
--- /dev/null
+++ b/xtests/run-xtests.sh
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+if test `id -u` -ne 0 ; then
+ echo "You need to be root to run the tests"
+ exit 1
+fi
+
+XTESTS="tst-pam_dispatch1 tst-pam_dispatch2 tst-pam_dispatch3 \
+ tst-pam_dispatch4 tst-pam_cracklib1"
+
+failed=0
+pass=0
+all=0
+
+for testname in $XTESTS ; do
+ install -m 644 $testname.pamd /etc/pam.d/$testname
+ ./$testname > /dev/null
+ if test $? -ne 0 ; then
+ echo "FAIL: $testname"
+ failed=`expr $failed + 1`
+ else
+ echo "PASS: $testname"
+ pass=`expr $pass + 1`
+ fi
+ all=`expr $all + 1`
+ rm -f /etc/pam.d/$testname
+ done
+ if test "$failed" -ne 0; then
+ echo "==================="
+ echo "$failed of $all tests failed"
+ echo "==================="
+ exit 1
+ else
+ echo "=================="
+ echo "All $all tests passed"
+ echo "=================="
+ fi
+exit 0