aff1aa9dc79e26a3c6c499b93d46510af97a7e21
[samba.git] / testprogs / blackbox / common_test_fns.inc
1 # Common tests
2 # Pulled out of existing tests to prevent duplication.
3 #
4 test_smbclient() {
5         name="$1"
6         cmd="$2"
7         unc="$3"
8         shift
9         shift
10         shift
11         echo "test: $name"
12         $VALGRIND $smbclient $CONFIGURATION "$unc" -c "$cmd" $@
13         status=$?
14         if [ x$status = x0 ]; then
15                 echo "success: $name"
16         else
17                 echo "failure: $name"
18         fi
19         return $status
20 }
21
22 test_smbclient_expect_failure() {
23         name="$1"
24         cmd="$2"
25         unc="$3"
26         shift
27         shift
28         shift
29         echo "test: $name"
30         $VALGRIND $smbclient $CONFIGURATION "$unc" -c "$cmd" $@
31         status=$?
32         if [ x$status = x0 ]; then
33                 echo "failure: $name"
34         else
35                 echo "success: $name"
36         fi
37         return $status
38 }