• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/router/samba-3.5.8/source4/selftest/win/
1#!/bin/sh
2
3if [ $# -lt 1 ]; then
4cat <<EOF
5Usage: wintest_2k3_dc.sh TESTGROUP
6EOF
7exit 1;
8fi
9
10TESTGROUP=$1
11
12if [ -z $WINTEST_DIR ]; then
13	echo "Environment variable WINTEST_DIR not found."
14	exit 1;
15fi
16
17# This variable is defined in the per-hosts .fns file for build-farm hosts that run windows tests.
18if [ -z $WINTESTCONF ]; then
19	echo "Please point environment variable WINTESTCONF to your test_win.conf file."
20	exit 1;
21fi
22
23. $WINTESTCONF
24. $WINTEST_DIR/wintest_functions.sh
25
26export WIN2K3_DC_REMOTE_HOST=`perl -I$WINTEST_DIR $WINTEST_DIR/vm_get_ip.pl WIN2K3_DC_VM_CFG_PATH`
27
28if [ -z $WIN2K3_DC_REMOTE_HOST ]; then
29	# Restore snapshot to ensure VM is in a known state, then exit.
30	restore_snapshot "Test failed to get the IP address of the windows 2003 DC." "$WIN2K3_DC_VM_CFG_PATH"
31	exit 1;
32fi
33
34server=$WIN2K3_DC_REMOTE_HOST
35username=$WIN2K3_DC_USERNAME
36password=$WIN2K3_DC_PASSWORD
37domain=$WIN2K3_DC_DOMAIN
38realm=$WIN2K3_DC_REALM
39
40OPTIONS="-U$username%$password -W $domain --option realm=$realm"
41
42all_errs=0
43
44on_error() {
45	name=$1
46
47	all_errs=`expr $all_errs + 1`
48	restore_snapshot "$name test failed." "$WIN2K3_DC_VM_CFG_PATH"
49}
50
51drsuapi_tests() {
52
53	name="RPC-DRSUAPI on ncacn_ip_tcp with seal"
54	bin/smbtorture \
55		ncacn_ip_tcp:$server[seal] $OPTIONS \
56		RPC-DRSUAPI || on_error "$name"
57
58	name="RPC-DRSUAPI on ncacn_ip_tcp with seal,bigendian"
59	bin/smbtorture \
60		ncacn_ip_tcp:$server[seal,bigendian] $OPTIONS \
61		RPC-DRSUAPI || on_error "$name"
62}
63
64spoolss_tests() {
65
66	name="RPC-SPOOLSS on ncacn_np"
67	bin/smbtorture \
68		ncacn_np:$server $OPTIONS \
69		RPC-SPOOLSS || on_error "$name"
70}
71
72ncacn_ip_tcp_tests() {
73	bindopt=$1
74	transport="ncacn_ip_tcp"
75	tests="RPC-SCHANNEL RPC-EPMAPPER RPC-SAMR RPC-NETLOGON RPC-LSA RPC-SAMLOGON RPC-SAMSYNC RPC-MULTIBIND"
76
77	for bindoptions in $bindopt; do
78		for t in $tests; do
79			name="$t on $transport with $bindoptions"
80			bin/smbtorture $TORTURE_OPTIONS \
81				$transport:$server[$bindoptions] \
82				$OPTIONS $t || on_error "$name"
83		done
84	done
85}
86
87ncacn_np_tests() {
88	bindopt=$1
89	transport="ncacn_np"
90	tests="RPC-SCHANNEL RPC-DSSETUP RPC-EPMAPPER RPC-SAMR RPC-WKSSVC RPC-SRVSVC RPC-EVENTLOG RPC-NETLOGON RPC-LSA RPC-SAMLOGON RPC-SAMSYNC RPC-MULTIBIND RPC-WINREG"
91
92	for bindoptions in $bindopt; do
93		for t in $tests; do
94			name="$t on $transport with $bindoptions"
95			bin/smbtorture $TORTURE_OPTIONS \
96				$transport:$server[$bindoptions] \
97				$OPTIONS $t || on_error "$name"
98		done
99	done
100}
101
102bindoptions="padcheck connect sign seal ntlm,sign ntml,seal $VALIDATE bigendian"
103
104case $TESTGROUP in
105	RPC-DRSUAPI)	drsuapi_tests ;;
106	RPC-SPOOLSS)	spoolss_tests ;;
107	ncacn_ip_tcp)	ncacn_ip_tcp_tests $bindoptions ;;
108	ncacn_np)	ncacn_np_tests $bindoptions ;;
109	*)		echo "$TESTGROUP is not a known set of tests."
110			exit 1;
111			;;
112esac
113
114exit $all_errs
115