summaryrefslogtreecommitdiff
path: root/test/integration/test-partial-file-support
Commit message (Collapse)AuthorAgeFilesLines
* 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