summaryrefslogtreecommitdiff
path: root/tests/prepare.sh
blob: f2fc3b839b8d49bfdc5ea23d53e13038d885bf46 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/sh

set -e

if test "x${srcdir}" = "x"; then
	srcdir=.
fi

if test "x${top_builddir}" = "x"; then
	top_builddir=..
fi

tmpdir="${top_builddir}/tests/tmp/lighttpd"

# create test-framework
rm -rf "${tmpdir}"
mkdir -p "${tmpdir}/servers/www.example.org/pages/"
mkdir -p "${tmpdir}/servers/www.example.org/pages/dummydir/"
mkdir -p "${tmpdir}/servers/www.example.org/pages/~test รค_/"
mkdir -p "${tmpdir}/servers/www.example.org/pages/go/"
mkdir -p "${tmpdir}/servers/www.example.org/pages/expire/"
mkdir -p "${tmpdir}/servers/www.example.org/pages/indexfile/"
mkdir -p "${tmpdir}/servers/123.example.org/pages/"
mkdir -p "${tmpdir}/servers/a.example.org/pages/a/"
mkdir -p "${tmpdir}/servers/b.example.org/pages/b/"
mkdir -p "${tmpdir}/logs/"
mkdir -p "${tmpdir}/cache/"
mkdir -p "${tmpdir}/cache/compress/"

# copy everything into the right places
cp "${srcdir}/docroot/www/"*.html \
   "${srcdir}/docroot/www/"*.php \
   "${srcdir}/docroot/www/"*.pl \
   "${srcdir}/docroot/www/"*.fcgi \
   "${srcdir}/docroot/www/"*.shtml \
   "${srcdir}/docroot/www/"*.txt \
   "${tmpdir}/servers/www.example.org/pages/"
cp "${srcdir}/docroot/www/go/"*.php "${tmpdir}/servers/www.example.org/pages/go/"
cp "${srcdir}/docroot/www/expire/"*.txt "${tmpdir}/servers/www.example.org/pages/expire/"
cp "${srcdir}/docroot/www/indexfile/"*.php "${tmpdir}/servers/www.example.org/pages/indexfile/"
cp "${srcdir}/docroot/www/indexfile/"*.pl "${tmpdir}/servers/www.example.org/pages/indexfile/"
cp "${srcdir}/docroot/123/"*.txt \
   "${srcdir}/docroot/123/"*.html \
   "${srcdir}/docroot/123/"*.php \
   "${srcdir}/docroot/123/"*.bla \
   "${tmpdir}/servers/123.example.org/pages/"
cp "${srcdir}/lighttpd.user" "${tmpdir}/"
cp "${srcdir}/lighttpd.htpasswd" "${tmpdir}/"
cp "${srcdir}/var-include-sub.conf" "${tmpdir}/../"
touch "${tmpdir}/servers/www.example.org/pages/image.jpg" \
      "${tmpdir}/servers/www.example.org/pages/image.JPG" \
      "${tmpdir}/servers/www.example.org/pages/Foo.txt" \
      "${tmpdir}/servers/www.example.org/pages/a" \
      "${tmpdir}/servers/www.example.org/pages/index.html~"
echo "12345" > "${tmpdir}/servers/www.example.org/pages/range.pdf"

printf "%-40s" "preparing infrastructure"

exit 0