r3393: added test_rpc.sh. The idea is that this script will test all the
[samba.git] / source4 / script / tests / test_rpc.sh
1 #!/bin/sh
2
3 # add tests to this list as they start passing, so we test
4 # that they stay passing
5 tests="RPC-SCHANNEL RPC-ECHO"
6
7 if [ $# -lt 4 ]; then
8 cat <<EOF
9 Usage: test_echo.sh SERVER USERNAME PASSWORD DOMAIN
10 EOF
11 exit 1;
12 fi
13
14 server="$1"
15 username="$2"
16 password="$3"
17 domain="$4"
18 shift 4
19
20 testit() {
21    cmdline="$*"
22    if ! $cmdline > test.$$ 2>&1; then
23        cat test.$$;
24        rm -f test.$$;
25        echo "TEST FAILED - $cmdline";
26        exit 1;
27    fi
28    rm -f test.$$;
29 }
30
31 for transport in ncalrpc ncacn_np ncacn_ip_tcp; do
32  for bindoptions in connect sign seal sign,seal validate padcheck bigendian bigendian,seal; do
33    for t in $tests; do
34     echo Testing $t on $transport with $bindoptions
35     testit bin/smbtorture $transport:"$server[$bindoptions]" -U"$username"%"$password" -W $domain $t "$*"
36    done
37  done
38 done
39
40 echo "ALL OK";