diff options
author | David Kalnischkies <kalnischkies@gmail.com> | 2013-06-15 15:45:22 +0200 |
---|---|---|
committer | David Kalnischkies <kalnischkies@gmail.com> | 2013-06-20 10:53:58 +0200 |
commit | fbd29dd60a195a5c252ba1d28366d52d60447560 (patch) | |
tree | ab34b0daafff25df5da54c6828be1b7bb7c0f08f /test/integration | |
parent | 709038652854b71895e06caed2b028b389acefd6 (diff) |
add a simple webserver for our testcases
APT needs to acquire data in a secure fashion over an inherently
unsecure way, known as the internet, while communicating with
unreliable partners, known as webservers and proxies.
For your integration tests we so far relied on 'normal' webservers,
but all of them have certain quirks and none is able to provide us
with all quirks which can be observed in the wild and we therefore
have to test with, so this webserver isn't trying to be fast, secure
or feature complete, but to provide all the quirks we need in a
consistent way.
This webserver also makes the APT project self-contained, as it is now
able to generate, serve as well as acquire package indexes. ;)
Git-Dch: Ignore
Diffstat (limited to 'test/integration')
-rw-r--r-- | test/integration/framework | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/test/integration/framework b/test/integration/framework index 5c50498a2..9db4a1017 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -718,12 +718,20 @@ signreleasefiles() { } changetowebserver() { - if which weborf > /dev/null; then - weborf -xb aptarchive/ 2>&1 > /dev/null & + local LOG='/dev/null' + if test -x ${BUILDDIRECTORY}/aptwebserver; then + cd aptarchive + LD_LIBRARY_PATH=${BUILDDIRECTORY} ${BUILDDIRECTORY}/aptwebserver "$@" >$LOG 2>&1 & + addtrap "kill $!;" + cd - > /dev/null + elif [ $# -gt 0 ]; then + msgdie 'Need the aptwebserver when passing arguments for the webserver' + elif which weborf > /dev/null; then + weborf -xb aptarchive/ >$LOG 2>&1 & addtrap "kill $!;" elif which gatling > /dev/null; then cd aptarchive - gatling -p 8080 -F -S 2>&1 > /dev/null & + gatling -p 8080 -F -S >$LOG 2>&1 & addtrap "kill $!;" cd - > /dev/null elif which lighttpd > /dev/null; then @@ -731,11 +739,10 @@ changetowebserver() { server.port = 8080 server.stat-cache-engine = \"disable\"" > lighttpd.conf lighttpd -t -f lighttpd.conf >/dev/null || msgdie 'Can not change to webserver: our lighttpd config is invalid' - lighttpd -D -f lighttpd.conf 2>/dev/null >/dev/null & + lighttpd -D -f lighttpd.conf >$LOG 2>&1 & addtrap "kill $!;" else - msgdie 'You have to install weborf or lighttpd first' - return 1 + msgdie 'You have to build aptwerbserver or install a webserver' fi local APTARCHIVE="file://$(readlink -f ./aptarchive)" for LIST in $(find rootdir/etc/apt/sources.list.d/ -name 'apt-test-*.list'); do |