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
2022-02-23 14:02:44 +03:00
cat <<EOF
2023-09-05 07:21:34 +03:00
Usage: wintest_base.sh SERVER USERNAME PASSWORD DOMAIN
2006-10-24 05:18:07 +04:00
EOF
2022-02-23 14:02:44 +03:00
exit 1
2006-10-24 05:18:07 +04:00
fi
server = " $1 "
username = " $2 "
password = " $3 "
domain = " $4 "
shift 4
2007-02-22 01:50:55 +03:00
export SMBTORTURE_REMOTE_HOST = $server
2006-10-24 05:18:07 +04:00
base_tests = "BASE-UNLINK BASE-ATTR BASE-DELETE BASE-TCON BASE-OPEN BASE-CHKPATH"
all_errs = 0
2007-02-22 01:50:55 +03:00
err = 0
2022-02-23 14:02:44 +03:00
on_error( )
{
2007-02-22 01:50:55 +03:00
errstr = $1
2022-02-23 14:02:44 +03:00
all_errs = $( expr $all_errs + 1)
2007-02-22 01:50:55 +03:00
restore_snapshot $errstr " $VM_CFG_PATH "
}
2006-10-24 05:18:07 +04:00
for t in $base_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 \
2006-10-24 05:18:07 +04:00
-W $domain //$server /$SMBTORTURE_REMOTE_SHARE_NAME \
2007-02-22 01:50:55 +03:00
$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-22 01:50:55 +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