2006-10-24 05:18:07 +04:00
#!/bin/sh
2007-04-30 00:37:59 +04:00
. selftest/test_functions.sh
2006-10-24 05:18:07 +04:00
2007-04-30 00:37:59 +04:00
. selftest/win/wintest_functions.sh
2006-10-24 05:18:07 +04:00
# This variable is defined in the per-hosts .fns file.
. $WINTESTCONF
if [ $# -lt 4 ] ; then
cat <<EOF
Usage: test_net.sh SERVER USERNAME PASSWORD DOMAIN
EOF
exit 1;
fi
server = " $1 "
username = " $2 "
password = " $3 "
domain = " $4 "
shift 4
2007-02-22 01:50:55 +03:00
export SMBTORTURE_REMOTE_HOST = $server
2009-11-25 03:25:02 +03:00
raw_tests = "RAW-QFILEINFO RAW-SFILEINFO-BASE RAW-MKDIR RAW-SEEK RAW-OPEN RAW-WRITE RAW-UNLINK RAW-READ RAW-CLOSE RAW-IOCTL RAW-RENAME RAW-EAS RAW-STREAMS"
2006-10-24 05:18:07 +04:00
# This test fails: RAW-QFSINFO
all_errs = 0
2007-02-22 01:50:55 +03:00
err = 0
on_error( ) {
errstr = $1
all_errs = ` expr $all_errs + 1`
2007-02-23 21:01:18 +03:00
restore_snapshot " $errstr " " $VM_CFG_PATH "
2007-02-22 01:50:55 +03:00
}
2006-10-24 05:18:07 +04:00
for t in $raw_tests ; do
test_name = " $t / WINDOWS SERVER "
echo -e " \n $test_name SETUP PHASE "
setup_share_test
if [ $err_rtn -ne 0 ] ; then
# If test setup fails, load VM snapshot and skip test.
2007-02-22 01:50:55 +03:00
on_error " \n $test_name setup failed, skipping test. "
2006-10-24 05:18:07 +04:00
else
echo -e " \n $test_name setup completed successfully. "
2007-02-22 01:50:55 +03:00
$SMBTORTURE_BIN_PATH -U $username %$password -W $domain \
//$server /$SMBTORTURE_REMOTE_SHARE_NAME \
$t || err = 1
if [ $err -ne 0 ] ; then
on_error " \n $test_name failed. "
2006-10-24 05:18:07 +04:00
else
echo -e " \n $test_name CLEANUP PHASE "
remove_share_test
if [ $err_rtn -ne 0 ] ; then
# If cleanup fails, restore VM snapshot.
2007-02-23 21:01:18 +03:00
on_error " \n $test_name removal failed. "
2006-10-24 05:18:07 +04:00
else
echo -e " \n $test_name removal completed successfully. "
fi
fi
fi
done
2007-02-22 01:50:55 +03:00
exit $all_errs