s3-torture: run_fdsesstest(): replace cli_read_old() with cli_read()
[Samba/gebeck_regimport.git] / source4 / selftest / win / wintest_net.sh
blob88cec1f3a79abbf3072fcb3ebbe5f4ec34c1f56f
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_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
38 on_error() {
39 errstr=$1
41 all_errs=`expr $all_errs + 1`
42 restore_snapshot "$errstr" "$VM_CFG_PATH"
45 for o in $bind_options; do
46 for transport in $test_type; do
47 case $transport in
48 ncalrpc) net_test=$ncalrpc_tests ;;
49 ncacn_np) net_test=$ncacn_np_tests ;;
50 ncacn_ip_tcp) net_test=$ncacn_ip_tcp_tests ;;
51 esac
53 for t in $net_test; do
54 test_name="$t on $transport with $o"
55 $SMBTORTURE_BIN_PATH -U $username%$password \
56 -W $domain $transport:$server[$o] \
57 $t || on_error "\n$test_name failed."
58 done
59 done
60 done
62 exit $all_errs