diff options
author | David Kalnischkies <david@kalnischkies.de> | 2015-06-15 23:06:56 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2015-06-15 23:35:55 +0200 |
commit | 9d2a8a7388cf3b0bbbe92f6b0b30a533e1167f40 (patch) | |
tree | 7cd6b13d7f0f8f26850cb44a88e70935ee86e68f /test/integration/test-bug-738785-switch-protocol | |
parent | 1eb1836f4b5397497bd34f0cf516e6e4e73117bf (diff) |
condense parallel requests with the same hashes to one
It shouldn't be too common, but sometimes people have multiple mirrors
in the sources or otherwise repositories with the same content. Now that
we gracefully can handle multiple requests to the same URI, we can also
fold multiple requests with the same expected hashes into one. Note that
this isn't trying to find oppertunities for merging, but just merges if
it happens to encounter the oppertunity for it.
This is most obvious in the new testcase actually as it needs to delay
the action to give the acquire system enough time to figure out that
they can be merged.
Diffstat (limited to 'test/integration/test-bug-738785-switch-protocol')
-rwxr-xr-x | test/integration/test-bug-738785-switch-protocol | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/test/integration/test-bug-738785-switch-protocol b/test/integration/test-bug-738785-switch-protocol index 539080200..e86f28824 100755 --- a/test/integration/test-bug-738785-switch-protocol +++ b/test/integration/test-bug-738785-switch-protocol @@ -39,18 +39,15 @@ cd - >/dev/null testsuccess aptget install apt -y testdpkginstalled 'apt' -# create a copy of all methods, expect https -eval `aptconfig shell METHODS Dir::Bin::Methods/d` -COPYMETHODS='usr/lib/apt/methods' -mv rootdir/${COPYMETHODS} rootdir/${COPYMETHODS}.bak -mkdir -p rootdir/$COPYMETHODS -cd rootdir/$COPYMETHODS -find $METHODS \! -type d | while read meth; do - ln -s $meth +# install a slowed down file: otherwise its to fast to reproduce combining +NEWMETHODS="$(readlink -f rootdir)/usr/lib/apt/methods" +OLDMETHODS="$(readlink -f rootdir/usr/lib/apt/methods)" +rm $NEWMETHODS +mkdir $NEWMETHODS +for METH in $(find $OLDMETHODS ! -type d); do + ln -s $OLDMETHODS/$(basename $METH) $NEWMETHODS done -rm https -cd - >/dev/null -echo "Dir::Bin::Methods \"${COPYMETHODS}\";" >> aptconfig.conf +rm $NEWMETHODS/https cd downloaded testfailureequal "E: The method driver $(readlink -f './../')/rootdir/usr/lib/apt/methods/https could not be found. @@ -59,8 +56,7 @@ testfailure test -e apt_1.0_all.deb cd - >/dev/null # revert to all methods -rm -rf rootdir/$COPYMETHODS -mv rootdir/${COPYMETHODS}.bak rootdir/${COPYMETHODS} +ln -s $OLDMETHODS/https $NEWMETHODS # check that downgrades from https to http are not allowed webserverconfig 'aptwebserver::support::http' 'true' |