Debian Codegraph @

debian/tests/svnserve

raw
1 #!/bin/sh
2 set -ex
3
4 cd "$AUTOPKGTEST_TMP"
5 REPO=$(pwd)/repo
6 WC=$(pwd)/wc
7 PID=$(pwd)/pid
8
9 svnadmin create "$REPO"
10 cat > "$REPO"/conf/svnserve.conf <<EOF
11 [general]
12 anon-access = read
13 auth-access = write
14 password-db = passwd
15 realm = Test Repo
16 EOF
17 cat > "$REPO"/conf/passwd <<EOF
18 [users]
19 user = password
20 EOF
21
22 trap 'kill $(cat "$PID")' EXIT
23 svnserve --pid-file "$PID" -r "$REPO" -d
24
25 svn checkout --non-interactive svn://localhost/ "$WC"
26
27 cd "$WC"
28 echo 'Hello, world!' > hello
29 svn add hello
30 if svn commit --non-interactive -mdep8; then
31 echo 'Anonymous commit unexpectedly worked' >&2
32 fi
33 svn commit --non-interactive --username user --password password -mdep8
34
35 result=$(svn cat --non-interactive svn://localhost/hello)
36
37 test "$result" = "Hello, world!"