3 # A shell script to connect to a windows host over telnet,
4 # setup for a smbtorture test,
6 # and remove the previously configured directory and share.
7 # Copyright Brad Henry <brad@samba.org> 2006
8 # Released under the GNU GPL v2 or later.
10 . script
/tests
/test_functions.sh
12 . script
/tests
/wintest_functions.sh
14 # This variable is defined in the per-hosts .fns file.
17 # Index variable to count the total number of tests which fail.
20 export SMBTORTURE_REMOTE_HOST
=`perl -I$WINTEST_DIR $WINTEST_DIR/vm_get_ip.pl`
21 if [ -z $SMBTORTURE_REMOTE_HOST ]; then
22 # Restore snapshot to ensure VM is in a known state, then exit.
23 restore_snapshot
"Test failed to get the IP address of the windows host."
27 $WINTEST_DIR/wintest_base.sh
$SMBTORTURE_REMOTE_HOST $SMBTORTURE_USERNAME \
28 $SMBTORTURE_PASSWORD $SMBTORTURE_WORKGROUP \
29 || all_errs
=`expr $all_errs + $?`
31 $WINTEST_DIR/wintest_raw.sh
$SMBTORTURE_REMOTE_HOST $SMBTORTURE_USERNAME \
32 $SMBTORTURE_PASSWORD $SMBTORTURE_WORKGROUP \
33 || all_errs
=`expr $all_errs + $?`
35 rpc_tests
="RPC-WINREG RPC-ASYNCBIND RPC-ATSVC RPC-DSSETUP RPC-EPMAPPER"
36 rpc_tests
="$rpc_tests RPC-INITSHUTDOWN RPC-LSA-GETUSER RPC-MULTIBIND RPC-ROT"
37 rpc_tests
="$rpc_tests RPC-SECRETS RPC-SRVSVC RPC-SVCCTL RPC-WKSSVC"
39 for t
in $rpc_tests; do
40 test_name
="$t / WINDOWS SERVER"
43 testit
"$test_name" $SMBTORTURE_BIN_PATH \
44 -U $SMBTORTURE_USERNAME%$SMBTORTURE_PASSWORD \
45 -W $SMBTORTURE_WORKGROUP \
46 ncacn_np
:$SMBTORTURE_REMOTE_HOST \
47 $t || all_errs
=`expr $all_errs + 1`
48 if [ $old_errs -lt $all_errs ]; then
49 restore_snapshot
"\n$test_name failed."
53 test_name
="WINDOWS CLIENT / SAMBA SERVER SHARE"
55 cat $WINTEST_DIR/common.exp
> $TMPDIR/client_test.exp
56 cat $WINTEST_DIR/wintest_client.exp
>> $TMPDIR/client_test.exp
59 expect
$TMPDIR/client_test.exp || all_errs
=`expr $all_errs + 1`
61 if [ $old_errs -lt $all_errs ]; then
62 # Restore snapshot to ensure VM is in a known state.
63 restore_snapshot
"\n$test_name failed."
64 echo "Snapshot restored."
66 rm -f $TMPDIR/client_test.exp