diff options
author | David Kalnischkies <david@kalnischkies.de> | 2016-11-24 12:14:39 +0100 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2016-11-25 00:15:13 +0100 |
commit | e1ae0531bfad0fce8590c26d1e38825df22d812a (patch) | |
tree | 54b648fe14a8d64778f2fc01050543a31f6c45f8 /test/integration/test-handle-redirect-as-used-mirror-change | |
parent | 0123ce7171b09ead5a07567fbd33c53f609f6560 (diff) |
optional write aptwebserver log to client specific files
The test test-handle-redirect-as-used-mirror-change serves multiple
clients at the same time, so the order of the output is undefined and
once in a while the two clients will intermix their lines causing the
grep we perform on it later to fail making our tests fail.
Solved by introducing client-specific logfiles which we all grep and
sort the result to have the results more stable.
Git-Dch: Ignore
Diffstat (limited to 'test/integration/test-handle-redirect-as-used-mirror-change')
-rwxr-xr-x | test/integration/test-handle-redirect-as-used-mirror-change | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/test/integration/test-handle-redirect-as-used-mirror-change b/test/integration/test-handle-redirect-as-used-mirror-change index 2655f713c..254bdd54a 100755 --- a/test/integration/test-handle-redirect-as-used-mirror-change +++ b/test/integration/test-handle-redirect-as-used-mirror-change @@ -21,23 +21,30 @@ Get:3 http://0.0.0.0:${APTHTTPPORT} unstable/main all Packages [$(stat -c %s apt Get:4 http://0.0.0.0:${APTHTTPPORT} unstable/main Translation-en [$(stat -c %s aptarchive/dists/unstable/main/i18n/Translation-en.gz) B] Reading package lists..." aptget update +grepwebserverlogs() { + testsuccess grep -h "$1" aptarchive/webserver.log.client*.log + shift + sort rootdir/tmp/testsuccess.output > aptwebserver.log + testfileequal 'aptwebserver.log' "$@" +} + # ensure we asked the redirector only once -testsuccessequal "Location: http://0.0.0.0:${APTHTTPPORT}/dists/unstable/InRelease" grep '^Location:' aptarchive/webserver.log +grepwebserverlogs '^Location:' "Location: http://0.0.0.0:${APTHTTPPORT}/dists/unstable/InRelease" testsuccessequal "Hit:1 http://0.0.0.0:${APTHTTPPORT} unstable InRelease Reading package lists..." aptget update -testsuccessequal "Location: http://0.0.0.0:${APTHTTPPORT}/dists/unstable/InRelease -Location: http://0.0.0.0:${APTHTTPPORT}/dists/unstable/InRelease" grep '^Location:' aptarchive/webserver.log +grepwebserverlogs '^Location:' "Location: http://0.0.0.0:${APTHTTPPORT}/dists/unstable/InRelease +Location: http://0.0.0.0:${APTHTTPPORT}/dists/unstable/InRelease" rm -rf rootdir/var/lib/apt/lists testsuccess apt update -o Debug::Acquire::http=1 -o Acquire::SameMirrorForAllIndexes=0 -testsuccessequal "Location: http://0.0.0.0:${APTHTTPPORT}/dists/unstable/InRelease +grepwebserverlogs '^Location:' "Location: http://0.0.0.0:${APTHTTPPORT}/dists/unstable/InRelease Location: http://0.0.0.0:${APTHTTPPORT}/dists/unstable/InRelease Location: http://0.0.0.0:${APTHTTPPORT}/dists/unstable/InRelease -Location: http://0.0.0.0:${APTHTTPPORT}/dists/unstable/main/source/Sources.gz Location: http://0.0.0.0:${APTHTTPPORT}/dists/unstable/main/binary-all/Packages.gz -Location: http://0.0.0.0:${APTHTTPPORT}/dists/unstable/main/i18n/Translation-en.gz" grep '^Location:' aptarchive/webserver.log +Location: http://0.0.0.0:${APTHTTPPORT}/dists/unstable/main/i18n/Translation-en.gz +Location: http://0.0.0.0:${APTHTTPPORT}/dists/unstable/main/source/Sources.gz" cd downloaded testsuccess apthelper download-file "http://localhost:${APTHTTPPORT}/redirectme/dists/unstable/InRelease" inrelease |