summaryrefslogtreecommitdiff
path: root/debian/tests/svnserve
blob: ec44556cfa6f39b288cd35dc931d289ede993cc7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
set -ex

cd "$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!"