diff options
-rw-r--r-- | debian/tests/control | 4 | ||||
-rwxr-xr-x | debian/tests/svnserve | 37 |
2 files changed, 41 insertions, 0 deletions
diff --git a/debian/tests/control b/debian/tests/control index 7bbf1c4..d404e47 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -1,3 +1,7 @@ Tests: libapache2-mod-svn Depends: libapache2-mod-svn, apache2, subversion, wget Restrictions: needs-root allow-stderr + +Tests: svnserve +Depends: subversion +Restrictions: allow-stderr diff --git a/debian/tests/svnserve b/debian/tests/svnserve new file mode 100755 index 0000000..0765978 --- /dev/null +++ b/debian/tests/svnserve @@ -0,0 +1,37 @@ +#!/bin/sh +set -ex + +cd ${ADTTMP:-$AUTOPKGTEST_TMP} +REPO=$(pwd)/repo +WC=$(pwd)/wc +PID=$(pwd)/pid + +svnadmin create "$REPO" +cat > "$REPO"/conf/svnserve.conf <<EOF +[general] +anon-access = read +auth-access = write +password-db = passwd +realm = Test Repo +EOF +cat > "$REPO"/conf/passwd <<EOF +[users] +user = password +EOF + +trap 'kill $(cat "$PID")' EXIT +svnserve --pid-file "$PID" -r "$REPO" -d + +svn checkout --non-interactive svn://localhost/ "$WC" + +cd "$WC" +echo 'Hello, world!' > hello +svn add hello +if svn commit --non-interactive -mdep8; then + echo 'Anonymous commit unexpectedly worked' >&2 +fi +svn commit --non-interactive --username user --password password -mdep8 + +result=$(svn cat --non-interactive svn://localhost/hello) + +test "$result" = "Hello, world!" |