summaryrefslogtreecommitdiff
path: root/test/integration/test-partial-file-support
Commit message (Collapse)AuthorAgeFilesLines
* Drop alternative URIs we got a hash-based fail fromDavid Kalnischkies2018-05-111-1/+1
| | | | | | | | | | | If we got a file but it produced a hash error, mismatched size or similar we shouldn't fallback to alternative URIs as they likely result in the same error. If we can we should instead use another mirror. We used to be a lot stricter by stopping all trys for this file if we got a non-404 (or a hash-based) failure, but that is too hard as we really want to try other mirrors (if we have them) in the hope that they have the expected and correct files.
* don't sent Range requests if we know its not acceptedDavid Kalnischkies2016-08-161-1/+7
| | | | | | If the server told us in a previous request that it isn't supporting Ranges with bytes via an Accept-Ranges header missing bytes, we don't try to formulate requests using Ranges.
* use the same redirection handling for http and httpsDavid Kalnischkies2016-08-101-0/+3
| | | | | | | | cURL which backs our https implementation can handle redirects on its own, but by dealing with them on our own we gain finer control over which redirections will be performed (we don't like https → http) and by whom so that redirections to other hosts correctly spawn a new https method dealing with these instead of letting the current one deal with it.
* Do not consider SHA1 usableJulian Andres Klode2016-03-131-1/+1
| | | | | SHA1 is not reasonably secure anymore, so we should not consider it usable anymore. The test suite is adjusted to account for this.
* tests: support spaces in path and TMPDIRDavid Kalnischkies2015-12-191-4/+4
| | | | | | | This doesn't allow all tests to run cleanly, but it at least allows to write tests which could run successfully in such environments. Git-Dch: Ignore
* tests: don't use hardcoded port for http and httpsDavid Kalnischkies2015-09-151-2/+2
| | | | | | This allows running tests in parallel. Git-Dch: Ignore
* detect 416 complete file in partial by expected hashDavid Kalnischkies2015-05-121-2/+8
| | | | | | | If we have the expected hashes we can check with them if the file we have in partial we got a 416 for is the expected file. We detected this with same-size before, but not every server sends a good Content-Range header with a 416 response.
* improve partial/ cleanup in abort and failure casesDavid Kalnischkies2015-05-111-12/+11
| | | | | | | | | | | | | | Especially pdiff-enhanced downloads have the tendency to fail for various reasons from which we can recover and even a successful download used to leave the old unpatched index in partial/. By adding a new method responsible for making the transaction of an individual file happen we can at specialisations especially for abort cases to deal with the cleanup. This also helps in keeping the compressed indexes around if another index failed instead of keeping the decompressed files, which we wouldn't pick up in the next call.
* dispose http(s) 416 error page as non-contentDavid Kalnischkies2014-12-091-6/+56
| | | | | | | | | | | | | | | | | | | | Real webservers (like apache) actually send an error page with a 416 response, but our client didn't expect it leaving the page on the socket to be parsed as response for the next request (http) or as file content (https), which isn't what we want at all… Symptom is a "Bad header line" as html usually doesn't parse that well to an http-header. This manifests itself e.g. if we have a complete file (or larger) in partial/ which isn't discarded by If-Range as the server doesn't support it (or it is just newer, think: mirror rotation). It is a sort-of regression of 78c72d0ce22e00b194251445aae306df357d5c1a, which removed the filesize - 1 trick, but this had its own problems… To properly test this our webserver gains the ability to reply with transfer-encoding: chunked as most real webservers will use it to send the dynamically generated error pages. Closes: 768797
* chown finished partial files earlierDavid Kalnischkies2014-10-231-15/+16
| | | | | | | | | | | | | | | | | partial files are chowned by the Item baseclass to let the methods work with them. Now, this baseclass is also responsible for chowning the files back to root instead of having various deeper levels do this. The consequence is that all overloaded Failed() methods now call the Item::Failed base as their first step. The same is done for Done(). The effect is that even in partial files usually don't belong to _apt anymore, helping sneakernets and reducing possibilities of a bad method modifying files not belonging to them. The change is supported by the framework not only supporting being run as root, but with proper permission management, too, so that privilege dropping can be tested with them.
* improve debug output in case downloadfile failsDavid Kalnischkies2014-03-131-29/+14
| | | | Git-Dch: Ignore
* tests: add a webserverconfig method to abstract configDavid Kalnischkies2013-11-301-4/+2
| | | | | | | 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
* tests: enhance https support in the testcasesDavid Kalnischkies2013-11-301-5/+7
| | | | Git-Dch: Ignore
* handle complete responses to https range requestsDavid Kalnischkies2013-10-011-0/+107
Servers might respond with a complete file either because they don't support Ranges at all or the If-Range condition isn't statisfied, so we have to parse the headers curl gets ourself to seek or truncate the file we have so far. This also finially adds the testcase testing a bunch of partial situations for both, http and https - which is now all green. Closes: 617643, 667699 LP: 1157943