r3032: Somewhat stricter syntax for binding strings:
[samba.git] / source4 / script / tests / test_binding_string.sh
1 #!/bin/sh
2
3 if [ $# -lt 4 ]; then
4 cat <<EOF
5 Usage: test_binding_string.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    cmdline="$*"
18    if ! $cmdline > test.$$ 2>&1; then
19        cat test.$$;
20        rm -f test.$$;
21        echo "TEST FAILED - $cmdline";
22        exit 1;
23    fi
24    rm -f test.$$;
25 }
26
27 for I in "ncacn_np:$server" \
28                  "ncacn_ip_tcp:$server" \
29                  "ncacn_np:$server[rpcecho]"  \
30                  "ncacn_np:$server[/pipe/rpcecho]" \
31                  "ncacn_np:$server[/pipe/rpcecho,sign,seal]" \
32                  "ncacn_np:$server[,sign]" \
33                  "ncacn_ip_tcp:$server[,sign]" \
34                  "308FB580-1EB2-11CA-923B-08002B1075A7@ncacn_np:$server" \
35                  "308FB580-1EB2-11CA-923B-08002B1075A7@ncacn_ip_tcp:$server" 
36 do
37         testit bin/smbtorture "$I" -U"$username"%"$password" -W $domain RPC-ECHO "$*"
38 done
39
40 echo "ALL OK";