b778e4216ad682d0d4657421a59d521b05e9eee4
[samba.git] / source / script / tests / test_echo.sh
1 #!/bin/sh
2
3 if [ $# -lt 4 ]; then
4 cat <<EOF
5 Usage: test_echo.sh SERVER USERNAME PASSWORD DOMAIN
6 EOF
7 exit 1;
8 fi
9
10 server="$1"
11 username="$2"
12 password="$3"
13 domain="$4"
14 shift 4
15
16 testit() {
17    trap "rm -f test.$$" EXIT
18    cmdline="$*"
19    if ! $cmdline > test.$$ 2>&1; then
20        cat test.$$;
21        rm -f test.$$;
22        echo "TEST FAILED - $cmdline";
23        exit 1;
24    fi
25    rm -f test.$$;
26 }
27
28 for transport in ncalrpc ncacn_np ncacn_ip_tcp; do
29  for bindoptions in connect sign seal sign,seal validate padcheck bigendian bigendian,seal; do
30   for ntlmoptions in \
31         "--option=socket:testnonblock=True" \
32         "--option=ntlmssp_client:ntlm2=yes" \
33         "--option=ntlmssp_client:ntlm2=no" \
34         "--option=ntlmssp_client:ntlm2=yes --option=ntlmssp_client:128bit=no" \
35         "--option=ntlmssp_client:ntlm2=no  --option=ntlmssp_client:128bit=no" \
36         "--option=ntlmssp_client:ntlm2=yes --option=ntlmssp_client:keyexchange=no" \
37         "--option=ntlmssp_client:ntlm2=no  --option=ntlmssp_client:keyexchange=no" \
38     ; do
39    echo Testing $transport with $bindoptions and $ntlmoptions
40    testit bin/smbtorture $transport:"$server[$bindoptions]" $ntlmoptions -U"$username"%"$password" -W $domain RPC-ECHO "$*"
41   done
42  done
43 done
44
45 # separately test the print option - its v slow
46 echo Testing print option
47 testit bin/smbtorture ncacn_np:"$server[print]" -U"$username"%"$password" -W $domain RPC-ECHO "$*"
48
49 echo "ALL OK";