torture3: Fix bug 10687
[Samba.git] / source4 / selftest / win / wintest_rpc.sh
blobd0a0783c2ee0cd2c8ffe4aadcdd8ed785973ba7b
1 #!/bin/sh
3 . selftest/test_functions.sh
5 . selftest/win/wintest_functions.sh
7 # This variable is defined in the per-hosts .fns file.
8 . $WINTESTCONF
10 if [ $# -lt 4 ]; then
11 cat <<EOF
12 Usage: test_rpc.sh SERVER USERNAME PASSWORD DOMAIN
13 EOF
14 exit 1;
17 server="$1"
18 username="$2"
19 password="$3"
20 domain="$4"
21 shift 4
23 ncacn_np_tests="RPC-SRVSVC RPC-UNIXINFO RPC-ECHO RPC-DSSETUP RPC-ALTERCONTEXT RPC-MULTIBIND"
24 # These tests fail on ncacn_np: RPC-SPOOLSS RPC-SCHANNEL RPC-JOIN RPC-LSA
25 # RPC-NETLOGON
27 ncalrpc_tests="RPC-UNIXINFO RPC-ECHO"
28 # These tests fail on ncalrpc: RPC-SCHANNEL RPC-JOIN RPC-LSA RPC-DSSETUP
29 # RPC-ALTERCONTEXT RPC-MULTIBIND RPC-NETLOGON
31 ncacn_ip_tcp_tests="RPC-UNIXINFO RPC-ECHO"
32 # These tests fail on ncacn_ip_tcp: RPC-SCHANNEL RPC-JOIN RPC-LSA RPC-DSSETUP
33 # RPC-ALTERCONTEXT RPC-MULTIBIND RPC-NETLOGON
35 bind_options="seal,padcheck bigendian"
37 test_type="ncalrpc ncacn_np ncacn_ip_tcp"
39 all_errs=0
41 on_error() {
42 errstr=$1
43 all_errs=`expr $all_errs + 1`
45 restore_snapshot "$errstr" "$VM_CFG_PATH"
48 for o in $bind_options; do
49 for transport in $test_type; do
50 case $transport in
51 ncalrpc) rpc_test=$ncalrpc_tests ;;
52 ncacn_np) rpc_test=$ncacn_np_tests ;;
53 ncacn_ip_tcp) rpc_test=$ncacn_ip_tcp_tests ;;
54 esac
56 for t in $rpc_test; do
57 test_name="$t on $transport with $o"
59 $SMBTORTURE_BIN_PATH -U $username%$password \
60 -W $domain $transport:$server[$o] \
61 $t || on_error "\n$test_name failed."
62 done
63 done
64 done
66 exit $all_errs