|
1 #!/bin/sh |
|
2 # |
|
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
|
4 # |
|
5 # Copyright 2018 Olaf Wintermann. All rights reserved. |
|
6 # |
|
7 # Redistribution and use in source and binary forms, with or without |
|
8 # modification, are permitted provided that the following conditions are met: |
|
9 # |
|
10 # 1. Redistributions of source code must retain the above copyright |
|
11 # notice, this list of conditions and the following disclaimer. |
|
12 # |
|
13 # 2. Redistributions in binary form must reproduce the above copyright |
|
14 # notice, this list of conditions and the following disclaimer in the |
|
15 # documentation and/or other materials provided with the distribution. |
|
16 # |
|
17 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
|
18 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
|
19 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
|
20 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
|
21 # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
|
22 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
|
23 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
|
24 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
|
25 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
|
26 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
|
27 # POSSIBILITY OF SUCH DAMAGE. |
|
28 # |
|
29 |
|
30 if [ $# -lt 1 ]; |
|
31 then |
|
32 echo "usage:" $0 "<dav-binary>" |
|
33 exit 1 |
|
34 fi |
|
35 |
|
36 # check if dav binary exists |
|
37 which $1 > /dev/null |
|
38 if [ $? -ne 0 ]; |
|
39 then |
|
40 exit 1 |
|
41 fi |
|
42 |
|
43 DAV_BIN=$1 |
|
44 export DAV_BIN |
|
45 |
|
46 # check for test repository |
|
47 TEST_REPO=`$DAV_BIN list-repos | grep dav-test-repo` |
|
48 if [ $TEST_REPO != "dav-test-repo" ]; |
|
49 then |
|
50 echo "A dav repository with the name 'dav-test-repo' is needed." |
|
51 exit 1 |
|
52 fi |
|
53 |
|
54 |
|
55 |
|
56 # clean test repo |
|
57 $DAV_BIN rm dav-test-repo/tests/ 2> /dev/null |
|
58 |
|
59 # |
|
60 # ok, begin the tests |
|
61 # |
|
62 |
|
63 # info |
|
64 printf "TEST: dav info ... " |
|
65 ./test-dav-info.sh |
|
66 if [ $? -ne 0 ]; then |
|
67 exit 2 |
|
68 fi |
|
69 echo ok |
|
70 |
|
71 # mkcol |
|
72 printf "TEST: dav mkcol ... " |
|
73 ./test-dav-mkcol.sh |
|
74 if [ $? -ne 0 ]; then |
|
75 exit 2 |
|
76 fi |
|
77 echo ok |