~svn/ubuntu/raring/subversion/ppa

« back to all changes in this revision

Viewing changes to tools/test-scripts/svntest/svntest-run.sh

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-12-05 01:26:14 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051205012614-qom4xfypgtsqc2xq
Tags: 1.2.3dfsg1-3ubuntu1
Merge with the final Debian release of 1.2.3dfsg1-3, bringing in
fixes to the clean target, better documentation of the libdb4.3
upgrade and build fixes to work with swig1.3_1.3.27.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
EXEC_PATH="`dirname $0`"
 
4
BUILD_TYPE="$1"
 
5
RA_TYPE="$2"
 
6
FS_TYPE="$3"
 
7
 
 
8
# Source the configuration file.
 
9
. "$EXEC_PATH/svntest-config.sh"
 
10
 
 
11
# Compute local vars
 
12
LOG_FILE="$LOG_FILE_PREFIX.$BUILD_TYPE.$RA_TYPE.$FS_TYPE"
 
13
TEST="`$GUESS` $BUILD_TYPE $RA_TYPE $FS_TYPE"
 
14
REV="`$SVN st -v $SVN_REPO/README | $CUT -c 12-17 | $SED -e 's/^ *//'`"
 
15
 
 
16
# Prime and initialize the log file
 
17
$CP_F "$LOG_FILE_PREFIX.$BUILD_TYPE" $LOG_FILE
 
18
echo >> $LOG_FILE
 
19
echo "TEST: $REVPREFIX$REV on $TEST" >> $LOG_FILE
 
20
echo >> $LOG_FILE
 
21
 
 
22
# Check the build type
 
23
START "check build type" "Checking build type..."
 
24
case $BUILD_TYPE in
 
25
    shared) OBJ="$OBJ_SHARED" ;;
 
26
    static) OBJ="$OBJ_STATIC" ;;
 
27
    *)  echo "$BUILD_TYPE: unknown build type"
 
28
        echo "$BUILD_TYPE: unknown build type" >> $LOG_FILE
 
29
        FAIL ;;
 
30
esac
 
31
PASS
 
32
 
 
33
# Check the test type
 
34
START "check RA type" "Checking RA methd..."
 
35
case $RA_TYPE in
 
36
    ra_local) CHECK_TARGET="check" ;;
 
37
    ra_svn)   CHECK_TARGET="svncheck" ;;
 
38
    ra_dav)   CHECK_TARGET="davcheck" ;;
 
39
    *)  echo "$RA_TYPE: unknown RA type"
 
40
        echo "$RA_TYPE: unknown RA type" >> $LOG_FILE
 
41
        FAIL ;;
 
42
esac
 
43
PASS
 
44
 
 
45
# Check the FS type
 
46
START "check FS type" "Checking FS type..."
 
47
case $FS_TYPE in
 
48
    bdb)  CHECK_ARGS="FS_TYPE=bdb" ;;
 
49
    fsfs) CHECK_ARGS="FS_TYPE=fsfs" ;;
 
50
    *)  echo "$FS_TYPE: unknown FS type"
 
51
        echo "$FS_TYPE: unknown FS type" >> $LOG_FILE
 
52
        FAIL ;;
 
53
esac
 
54
PASS
 
55
 
 
56
# Check that the object directory exists, and that it contains the
 
57
# necessary executable files
 
58
START "check object directory" "Checking object directory..."
 
59
test -d $TEST_ROOT/$OBJ || FAIL; PASS
 
60
START "check svn executable" "Checking svn executable..."
 
61
test -x $TEST_ROOT/$OBJ/subversion/clients/cmdline/svn || FAIL; PASS
 
62
START "check svnadmin executable" "Checking svnadmin executable..."
 
63
test -x $TEST_ROOT/$OBJ/subversion/svnadmin/svnadmin || FAIL; PASS
 
64
START "check svnlook executable" "Checking svnlook executable..."
 
65
test -x $TEST_ROOT/$OBJ/subversion/svnlook/svnlook || FAIL; PASS
 
66
START "check svnserve executable" "Checking svnserve executable..."
 
67
test -x $TEST_ROOT/$OBJ/subversion/svnserve/svnserve || FAIL; PASS
 
68
START "check svnversion executable" "Checking svnversion executable..."
 
69
test -x $TEST_ROOT/$OBJ/subversion/svnversion/svnversion || FAIL; PASS
 
70
 
 
71
# Build has initially mounted ramdisk for us, but this
 
72
# script will at the end to do unmount, so check if it is mounted or not
 
73
# and if it is not, do initial fire up for it
 
74
if test "xyes" = "x$RAMDISK";
 
75
then
 
76
    reinitialize_ramdisk
 
77
fi
 
78
 
 
79
# Prepare the server
 
80
case $CHECK_TARGET in
 
81
    check)
 
82
        # Nothing to do here
 
83
        ;;
 
84
    svncheck)
 
85
        START "run svnserve" "Running svnserve..."
 
86
        $TEST_ROOT/$OBJ/subversion/svnserve/svnserve -d \
 
87
            -r $TEST_ROOT/$OBJ/subversion/tests/clients/cmdline \
 
88
            >> $LOG_FILE 2>&1
 
89
        test $? = 0 || FAIL
 
90
        PASS
 
91
 
 
92
        START "get svnserve pid" "Getting svnserve process ID..."
 
93
        USER_NAME="`$ID_UN`"
 
94
        SVNSERVE_PID="`$PS_U $USER_NAME | $GREP '[s]vnserve' \
 
95
                       | $SED -e 's/^ *//' | $CUT -f 1 -d ' ' -s`"
 
96
        test -n "$SVNSERVE_PID" || FAIL
 
97
        PASS
 
98
        ;;
 
99
    davcheck)
 
100
        START "run $HTTPD_NAME" "Running $HTTPD_NAME..."
 
101
        $CP_F "$TEST_ROOT/$HTTPD_NAME.conf" \
 
102
            "$INST_DIR/$HTTPD_NAME/conf/httpd.conf" || FAIL
 
103
 
 
104
        $CP_F "$TEST_ROOT/mod_dav_svn_$BUILD_TYPE.conf" \
 
105
            "$INST_DIR/$HTTPD_NAME/conf/mod_dav_svn.conf" || FAIL
 
106
 
 
107
        "$INST_DIR/$HTTPD_NAME/bin/apachectl" start \
 
108
            >> $LOG_FILE 2>&1
 
109
        test $? = 0 || FAIL
 
110
        PASS
 
111
        CHECK_ARGS="$CHECK_ARGS $RA_DAV_CHECK_ARGS"
 
112
        ;;
 
113
esac
 
114
 
 
115
# Kill the server
 
116
kill_svnserve() {
 
117
    case $CHECK_TARGET in
 
118
        check)
 
119
            # Nothing to do here
 
120
            ;;
 
121
        svncheck)
 
122
            START "kill svnserve" "Stopping svnserve..."
 
123
            $KILL $SVNSERVE_PID || FAIL
 
124
            PASS
 
125
            ;;
 
126
        davcheck)
 
127
            START "kill $HTTPD_NAME" "Stopping $HTTPD_NAME..."
 
128
            "$INST_DIR/$HTTPD_NAME/bin/apachectl" stop || \
 
129
                FAIL
 
130
            PASS
 
131
            ;;
 
132
    esac
 
133
 
 
134
    umount_ramdisk "$TEST_ROOT/$OBJ/subversion/tests"
 
135
}
 
136
 
 
137
# Test
 
138
ts_start=`$DATE +"%s"`
 
139
 
 
140
START "make $CHECK_TARGET" "Testing $RA_TYPE on $FS_TYPE..."
 
141
CHECK_LOG_FILE="$LOG_FILE_DIR/LOG_svn_check_${BUILD_TYPE}_${RA_TYPE}_${FS_TYPE}"
 
142
cd $TEST_ROOT/$OBJ
 
143
if test "$CHECK_TARGET" = "davcheck";
 
144
then
 
145
    # At the moment we can't give repository url with
 
146
    # make davcheck, so use check & BASE_URL here for the present
 
147
    $MAKE check $CHECK_ARGS > $CHECK_LOG_FILE 2>&1
 
148
else
 
149
    $MAKE $CHECK_TARGET $CHECK_ARGS > $CHECK_LOG_FILE 2>&1
 
150
fi
 
151
test $? = 0 || {
 
152
    FAIL_LOG $CHECK_LOG_FILE
 
153
    $CP "tests.log" \
 
154
        "$LOG_FILE_PREFIX.log.$BUILD_TYPE.$RA_TYPE.$FS_TYPE.$REV.failed" \
 
155
        >> $LOG_FILE 2>&1
 
156
 
 
157
    # Prepare the log file for the mailer
 
158
    $GZIP_C < "tests.log" \
 
159
            > "$LOG_FILE_DIR/tests.$BUILD_TYPE.$RA_TYPE.$FS_TYPE.log.gz"
 
160
    FAIL kill_svnserve
 
161
}
 
162
PASS
 
163
ts_stop=`$DATE +"%s"`
 
164
 
 
165
START "Timer: make $CHECK_TARGET $(($ts_stop - $ts_start)) sec" \
 
166
      "Timer: make $CHECK_TARGET $(($ts_stop - $ts_start)) sec"
 
167
PASS
 
168
 
 
169
kill_svnserve