2 . wvtest-bup.sh || exit $?
7 TOP="$(WVPASS pwd)" || exit $?
8 tmpdir="$(WVPASS wvmktempdir)" || exit $?
9 export BUP_DIR="$tmpdir/bup"
16 wait-for-server-start()
18 curl --unix-socket ./socket http://localhost/
20 while test $curl_status -eq 7; do
22 curl --unix-socket ./socket http://localhost/
25 WVPASSEQ $curl_status 0
31 if test -z "$(type -p curl)"; then
32 WVSTART 'curl does not appear to be installed; skipping test'
36 WVPASS bup-python -c "import socket as s; s.socket(s.AF_UNIX).bind('socket')"
37 curl -s --unix-socket ./socket http://localhost/foo
38 if test $? -ne 7; then
39 WVSTART 'curl does not appear to support --unix-socket; skipping test'
43 if ! bup-python -c 'import tornado' 2> /dev/null; then
44 WVSTART 'unable to import tornado; skipping test'
51 WVPASS echo '¡excitement!' > src/data
52 WVPASS echo -e 'whee \x80\x90\xff' > "$(echo -ne 'src/whee \x80\x90\xff')"
54 WVPASS bup save -n '¡excitement!' --strip src
56 "$TOP/bup" web unix://socket &
60 WVPASS curl --unix-socket ./socket \
61 'http://localhost/%C2%A1excitement%21/latest/data' > result
62 WVPASS curl --unix-socket ./socket \
63 'http://localhost/%C2%A1excitement%21/latest/whee%20%80%90%ff' > result2
64 WVPASSEQ "$(curl --unix-socket ./socket http://localhost/static/styles.css)" \
65 "$(cat "$TOP/lib/web/static/styles.css")"
67 WVPASSEQ '¡excitement!' "$(cat result)"
68 WVPASS cmp "$(echo -ne 'src/whee \x80\x90\xff')" result2
69 WVPASS kill -s TERM "$web_pid"
70 WVPASS wait "$web_pid"
72 WVPASS rm -r "$tmpdir"