r22572: Don't manually set objectGUID values
[sfrench/samba-autobuild/.git] / source4 / script / tests / win / wintest_raw.sh
1 #!/bin/sh
2
3 . script/tests/test_functions.sh
4
5 . script/tests/win/wintest_functions.sh
6
7 # This variable is defined in the per-hosts .fns file.
8 . $WINTESTCONF
9
10 if [ $# -lt 4 ]; then
11 cat <<EOF
12 Usage: test_net.sh SERVER USERNAME PASSWORD DOMAIN
13 EOF
14 exit 1;
15 fi
16
17 server="$1"
18 username="$2"
19 password="$3"
20 domain="$4"
21 shift 4
22
23 export SMBTORTURE_REMOTE_HOST=$server
24
25 raw_tests="RAW-QFILEINFO RAW-SFILEINFO RAW-MKDIR RAW-SEEK RAW-OPEN RAW-WRITE RAW-UNLINK RAW-READ RAW-CLOSE RAW-IOCTL RAW-RENAME RAW-EAS RAW-STREAMS"
26 # This test fails: RAW-QFSINFO
27
28 all_errs=0
29 err=0
30
31 on_error() {
32         errstr=$1
33         all_errs=`expr $all_errs + 1`
34
35         restore_snapshot "$errstr" "$VM_CFG_PATH"
36 }
37
38 for t in $raw_tests; do
39         test_name="$t / WINDOWS SERVER"
40         echo -e "\n$test_name SETUP PHASE"
41
42         setup_share_test
43
44         if [ $err_rtn -ne 0 ]; then
45                 # If test setup fails, load VM snapshot and skip test.
46                 on_error "\n$test_name setup failed, skipping test."
47         else
48                 echo -e "\n$test_name setup completed successfully."
49
50                 $SMBTORTURE_BIN_PATH -U $username%$password -W $domain \
51                         //$server/$SMBTORTURE_REMOTE_SHARE_NAME \
52                         $t || err=1
53                 if [ $err -ne 0 ]; then
54                         on_error "\n$test_name failed."
55                 else
56                         echo -e "\n$test_name CLEANUP PHASE"
57                         remove_share_test
58                         if [ $err_rtn -ne 0 ]; then
59                                 # If cleanup fails, restore VM snapshot.
60                                 on_error "\n$test_name removal failed."
61                         else
62                                 echo -e "\n$test_name removal completed successfully."
63                         fi
64                 fi
65         fi
66 done
67
68 exit $all_errs