diff options
author | James McCoy <jamessan@debian.org> | 2018-08-03 23:59:35 -0400 |
---|---|---|
committer | James McCoy <jamessan@debian.org> | 2018-08-04 12:27:23 -0400 |
commit | 165304763003bfee49907baeab1c8e7e80f20bd2 (patch) | |
tree | d2146ba6d02dc7c946884acd320d63c0dbf33ae4 /debian | |
parent | df3de444e242ee50b0997d15b30b8927fa487c12 (diff) |
debian/tests: Add a basic test for svnserve
Signed-off-by: James McCoy <jamessan@debian.org>
Diffstat (limited to 'debian')
-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!" |