summaryrefslogtreecommitdiff
path: root/test/integration/framework
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2013-10-23 16:32:48 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2013-11-30 12:38:26 +0100
commitf2c0ec8bdb00b44de240190dae39fa255b6c85de (patch)
tree591dfd0e481786b9a23eca954d75e768011824a0 /test/integration/framework
parent8523b22fbcc6ca2ad004a9133559212908b768ed (diff)
tests: add a webserverconfig method to abstract config
The URI to use to set a config option is a bit arcane to write/remember and checking if the setting was successful doubly so. Git-Dch: Ignore
Diffstat (limited to 'test/integration/framework')
-rw-r--r--test/integration/framework16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/integration/framework b/test/integration/framework
index 6a2a78c83..89b5bb0e4 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -792,6 +792,22 @@ signreleasefiles() {
msgdone "info"
}
+webserverconfig() {
+ msgtest "Set webserver config option '${1}' to" "$2"
+ downloadfile "http://localhost:8080/_config/set/${1}/${2}" '/dev/null' >/dev/null
+ local DOWNLOG='download-testfile.log'
+ rm -f "$DOWNLOG"
+ local STATUS="$(mktemp)"
+ addtrap "rm $STATUS;"
+ downloadfile "http://localhost:8080/_config/find/aptwebserver::last-status-code" "$STATUS" > "$DOWNLOG"
+ if [ "$(cat "$STATUS")" = '200' ]; then
+ msgpass
+ else
+ cat >&2 "$DOWNLOG"
+ msgfail "Statuscode was $(cat "$STATUS")"
+ fi
+}
+
rewritesourceslist() {
local APTARCHIVE="file://$(readlink -f "${TMPWORKINGDIRECTORY}/aptarchive")"
for LIST in $(find rootdir/etc/apt/sources.list.d/ -name 'apt-test-*.list'); do