summaryrefslogtreecommitdiff
path: root/source4/script/tests/test_binding_string.sh
blob: 8f8177cf56f04c10b9cbd601ee7e9ff5c2660e46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/sh

if [ $# -lt 4 ]; then
cat <<EOF
Usage: test_binding_string.sh SERVER USERNAME PASSWORD DOMAIN
EOF
exit 1;
fi

server="$1"
username="$2"
password="$3"
domain="$4"
shift 4

testit() {
   cmdline="$*"
   if ! $cmdline > test.$$ 2>&1; then
       cat test.$$;
       rm -f test.$$;
       echo "TEST FAILED - $cmdline";
       exit 1;
   fi
   rm -f test.$$;
}

for I in "ncacn_np:$server" \
		 "ncacn_ip_tcp:$server" \
		 "ncacn_np:$server[rpcecho]"  \
		 "ncacn_np:$server[/pipe/rpcecho]" \
		 "ncacn_np:$server[/pipe/rpcecho,sign,seal]" \
		 "ncacn_np:$server[,sign]" \
		 "ncacn_ip_tcp:$server[,sign]" \
		 "ncalrpc:" \
		 "308FB580-1EB2-11CA-923B-08002B1075A7@ncacn_np:$server" \
		 "308FB580-1EB2-11CA-923B-08002B1075A7@ncacn_ip_tcp:$server" 
do
	testit bin/smbtorture "$I" -U"$username"%"$password" -W $domain RPC-ECHO "$*"
done

echo "ALL OK";