r19471: Move BASE and RAW tests to their own scripts. Run the same set of tests as...
[Samba/ekacnet.git] / source4 / script / tests / win / wintest_base.sh
blobfa436a4af8f9ef552af584a1ba6da62a03ba9d96
1 #!/bin/sh
3 . script/tests/test_functions.sh
5 . script/tests/win/wintest_functions.sh
7 # This variable is defined in the per-hosts .fns file.
8 . $WINTESTCONF
10 if [ $# -lt 4 ]; then
11 cat <<EOF
12 Usage: test_net.sh SERVER USERNAME PASSWORD DOMAIN
13 EOF
14 exit 1;
17 server="$1"
18 username="$2"
19 password="$3"
20 domain="$4"
21 shift 4
23 base_tests="BASE-UNLINK BASE-ATTR BASE-DELETE BASE-TCON BASE-OPEN BASE-CHKPATH"
25 all_errs=0
27 for t in $base_tests; do
28 test_name="$t / WINDOWS SERVER"
29 echo -e "\n$test_name SETUP PHASE"
31 setup_share_test
33 if [ $err_rtn -ne 0 ]; then
34 # If test setup fails, load VM snapshot and skip test.
35 restore_snapshot "\n$test_name setup failed, skipping test."
36 else
37 echo -e "\n$test_name setup completed successfully."
38 old_errs=$all_errs
40 testit "$test_name" $SMBTORTURE_BIN_PATH \
41 -U $username%$password \
42 -W $domain //$server/$SMBTORTURE_REMOTE_SHARE_NAME \
43 $t || all_errs=`expr $all_errs + 1`
44 if [ $old_errs -lt $all_errs ]; then
45 restore_snapshot "\n$test_name failed."
46 else
47 echo -e "\n$test_name CLEANUP PHASE"
48 remove_share_test
49 if [ $err_rtn -ne 0 ]; then
50 # If cleanup fails, restore VM snapshot.
51 restore_snapshot "\n$test_name removal failed."
52 else
53 echo -e "\n$test_name removal completed successfully."
57 done
59 testok $0 $all_errs