r19473: Add NET tests in their own script. Run the same set of tests that 'make test...
[Samba/ekacnet.git] / source4 / script / tests / win / wintest_net.sh
blobd2dbb3bcc05fc0dec8b4b5923cbe800730b7085b
1 #!/bin/sh
3 . script/tests/test_functions.sh
5 . script/tests/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_net.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="NET-API-LOOKUP NET-API-LOOKUPHOST NET-API-RPCCONN-BIND NET-API-RPCCONN-SRV NET-API-RPCCONN-DC NET-API-RPCCONN-DCINFO NET-API-LISTSHARES"
24 #These tests fail on ncacn_np: NET-API-LOOKUPPDC NET-API-CREATEUSER NET-API-DELETEUSER
26 ncalrpc_tests="NET-API-RPCCONN-SRV NET-API-RPCCONN-DC NET-API-RPCCONN-DCINFO NET-API-LISTSHARES"
27 #These tests fail on ncalrpc: NET-API-CREATEUSER NET-API-DELETEUSER
29 ncacn_ip_tcp_tests="NET-API-LOOKUP NET-API-LOOKUPHOST NET-API-RPCCONN-SRV NET-API-RPCCONN-DC NET-API-RPCCONN-DCINFO NET-API-LISTSHARES"
30 #These tests fail on ncacn_ip_tcp: NET-API-LOOKUPPDC NET-API-CREATEUSER NET-API-DELETEUSER
32 bind_options="seal,padcheck bigendian"
34 test_type="ncalrpc ncacn_np ncacn_ip_tcp"
36 all_errs=0
37 for o in $bind_options; do
38 for transport in $test_type; do
39 case $transport in
40 ncalrpc) net_test=$ncalrpc_tests ;;
41 ncacn_np) net_test=$ncacn_np_tests ;;
42 ncacn_ip_tcp) net_test=$ncacn_ip_tcp_tests ;;
43 esac
45 for t in $net_test; do
46 test_name="$t on $transport with $o"
47 old_errs=$all_errs
48 testit "$test_name" $SMBTORTURE_BIN_PATH \
49 -U $username%$password \
50 -W $domain \
51 $transport:$server[$o] \
52 $t || all_errs=`expr $all_errs + 1`
53 if [ $old_errs -lt $all_errs ]; then
54 restore_snapshot "\n$test_name failed."
56 done
57 done
58 done
60 testok $0 $all_errs