Line | |
---|
1 | #!/bin/sh
|
---|
2 |
|
---|
3 | . selftest/test_functions.sh
|
---|
4 |
|
---|
5 | . selftest/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 | base_tests="BASE-UNLINK BASE-ATTR BASE-DELETE BASE-TCON BASE-OPEN BASE-CHKPATH"
|
---|
26 |
|
---|
27 | all_errs=0
|
---|
28 | err=0
|
---|
29 |
|
---|
30 | on_error() {
|
---|
31 | errstr=$1
|
---|
32 |
|
---|
33 | all_errs=`expr $all_errs + 1`
|
---|
34 | restore_snapshot $errstr "$VM_CFG_PATH"
|
---|
35 | }
|
---|
36 |
|
---|
37 | for t in $base_tests; do
|
---|
38 | test_name="$t / WINDOWS SERVER"
|
---|
39 | echo -e "\n$test_name SETUP PHASE"
|
---|
40 |
|
---|
41 | setup_share_test
|
---|
42 |
|
---|
43 | if [ $err_rtn -ne 0 ]; then
|
---|
44 | # If test setup fails, load VM snapshot and skip test.
|
---|
45 | on_error "\n$test_name setup failed, skipping test."
|
---|
46 | else
|
---|
47 | echo -e "\n$test_name setup completed successfully."
|
---|
48 |
|
---|
49 | $SMBTORTURE_BIN_PATH -U $username%$password \
|
---|
50 | -W $domain //$server/$SMBTORTURE_REMOTE_SHARE_NAME \
|
---|
51 | $t || err=1
|
---|
52 | if [ $err -ne 0 ]; then
|
---|
53 | on_error "\n$test_name failed."
|
---|
54 | else
|
---|
55 | echo -e "\n$test_name CLEANUP PHASE"
|
---|
56 | remove_share_test
|
---|
57 | if [ $err_rtn -ne 0 ]; then
|
---|
58 | # If cleanup fails, restore VM snapshot.
|
---|
59 | on_error "\n$test_name removal failed."
|
---|
60 | else
|
---|
61 | echo -e "\n$test_name removal completed successfully."
|
---|
62 | fi
|
---|
63 | fi
|
---|
64 | fi
|
---|
65 | done
|
---|
66 |
|
---|
67 | exit $all_errs
|
---|
Note:
See
TracBrowser
for help on using the repository browser.