summaryrefslogtreecommitdiff
path: root/test/integration/test-pdiff-usage
Commit message (Collapse)AuthorAgeFilesLines
* tests: support spaces in path and TMPDIRDavid Kalnischkies2015-12-191-57/+57
| | | | | | | 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: try to support spaces in TMPDIRDavid Kalnischkies2015-09-141-1/+1
| | | | | | | | Not all tests work yet, most notable the cdrom tests, but those require changes in libapt itself to have a proper fix and what we have fixed so far is good enough progress for now. Git-Dch: Ignore
* tests: use SHA1 checksum only by default in testsDavid Kalnischkies2015-09-141-0/+1
| | | | | | | | | This is mostly a small speedup for the testcases, but it is also handy to document which tests actually deal with a specific hash compared to those which 'just' need some hash which can be important while adding new hashes. Git-Dch: Ignore
* various changes to increase test-coverageDavid Kalnischkies2015-09-141-8/+0
| | | | | | | And of course, testing obscure things ends up showing obscure 'bugs' or better shortcomings/inconsitencies, so lets fix them with the tests. Git-Dch: Ignore
* implement PDiff patching for compressed filesDavid Kalnischkies2015-08-281-16/+21
| | | | | | | | | | | | | | | | | | Some additional files like 'Contents' are very big and should therefore kept compressed on the disk, which apt-file did in the past. It also implemented pdiff patching of these files by un- and recompressing these files on-the-fly, with this commit we can do the same – but we can do this in both pdiff patching styles (client and server merging) and secured by hashes. Hashes are in so far slightly complicated as we can't compare the hashes of the compressed files as we might compress them differently than the server would (different compressor versions, options, …), so we must compare the hashes of the uncompressed content. While this commit has changes in public headers, the classes it changes are marked as hidden, so nobody can use them directly, which means the ABI break is internal only.
* show item ID in Hit, Ign and Err lines as wellDavid Kalnischkies2015-06-151-1/+1
| | | | | | | | Again, consistency is the main sellingpoint here, but this way it is now also easier to explain that some files move through different stages and lines are printed for them hence multiple times: That is a bit hard to believe if the number is changing all the time, but now that it keeps consistent.
* support hashes for compressed pdiff filesDavid Kalnischkies2015-06-091-2/+44
| | | | | | | | At the moment we only have hashes for the uncompressed pdiff files, but via the new '$HASH-Download' field in the .diff/Index hashes can be provided for the .gz compressed pdiff file, which apt will pick up now and use to verify the download. Now, we "just" need a buy in from the creators of repositories…
* add more parsing error checking for rredDavid Kalnischkies2015-06-091-1/+2
| | | | | | | The rred parser is very accepting regarding 'invalid' files. Given that we can't trust the input it might be a bit too relaxed. In any case, checking for more errors can't hurt given that we support only a very specific subset of ed commands.
* check patch hashes in rred worker instead of in the handlerDavid Kalnischkies2015-06-091-0/+2
| | | | | | | | | | | | | | | | rred is responsible for unpacking and reading the patch files in one go, but we currently only have hashes for the uncompressed patch files, so the handler read the entire patch file before dispatching it to the worker which would read it again – both with an implicit uncompress. Worse, while the workers operate in parallel the handler is the central orchestration unit, so having it busy with work means the workers do (potentially) nothing. This means rred is working with 'untrusted' data, which is bad. Yet, having the unpack in the handler meant that the untrusted uncompress was done as root which isn't better either. Now, we have it at least contained in a binary which we can harden a bit better. In the long run, we want hashes for the compressed patch files through to be safe.
* improve partial/ cleanup in abort and failure casesDavid Kalnischkies2015-05-111-1/+1
| | | | | | | | | | | | | | 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.
* a hit on Release files means the indexes will be hits tooDavid Kalnischkies2015-04-191-11/+4
| | | | | | | | | | | | | | | | | | If we get a IMSHit for the Transaction-Manager (= the InRelease file or as its still supported fallback Release + Release.gpg combo) we can assume that every file we would queue based on this manager, but already have locally is current and hence would get an IMSHit, too. We therefore save us and the server the trouble and skip the queuing in this case. Beside speeding up repetative executions of 'apt-get update' this way we also avoid hitting hashsum errors if the indexes are in fact already updated, but the Release file isn't yet as it is the case on well behaving mirrors as Release files is updated last. The implementation is a bit harder than the theory makes it sound as we still have to keep reverifying the Release files (e.g. to detect now expired once to avoid an attacker being able to silently stale us) and have to handle cases in which the Release file hits, but some indexes aren't present (e.g. user added a new foreign architecture).
* test exitcode as well as string equalityDavid Kalnischkies2015-03-161-6/+6
| | | | | | | | We use test{success,failure} now all over the place in the framework, so its only consequencial to do this in the situations in which we test for a specific output as well. Git-Dch: Ignore
* reenable patchsize limit option for pdiffsDavid Kalnischkies2014-11-081-0/+34
| | | | | | | | One word: "doh!" Commit f6d4ab9ad8a2cfe52737ab620dd252cf8ceec43d disabled the check to prevent apt from downloading bigger patches than the index it tries to patch. Happens rarly of course, but still. Detected by scan-build complaining about a dead assignment. To make up for the mistake a test is included as well.
* Merge remote-tracking branch 'upstream/debian/experimental' into ↵Michael Vogt2014-10-071-7/+43
|\ | | | | | | | | | | | | feature/acq-trans Conflicts: apt-pkg/acquire-item.cc
| * support parsing of all hashes for pdiffDavid Kalnischkies2014-09-301-6/+42
| | | | | | | | | | | | | | | | | | | | | | The fileformat of a pdiff index stores currently only SHA1 hashes. With this change, we look for all other hashes we support as well and take what we get, so that we can work after the release of jessie to get right of SHA1 if we want to. Note that the completely patched file is and was checked against the hashes collected from the Release file, so this transition isn't mission critical.
* | make pdiff transactional (but at the cost of a CopyFile()Michael Vogt2014-09-231-0/+1
|/
* use HashStringList in the acquire systemDavid Kalnischkies2014-05-091-6/+0
| | | | | | | | | | | | | It is not very extensible to have the supported Hashes hardcoded everywhere and especially if it is part of virtual method names. It is also possible that a method does not support the 'best' hash (yet), so we might end up not being able to verify a file even though we have a common subset of supported hashes. And those are just two of the cases in which it is handy to have a more dynamic selection. The downside is that this is a MAJOR API break, but the HashStringList has a string constructor for compatibility, so with a bit of luck the few frontends playing with the acquire system directly are okay.
* always cleanup patchfiles at the end of rred callDavid Kalnischkies2014-02-101-7/+21
| | | | | | | | | With APT::Get::List-Cleanup disabled the ed-style patch files are lingering in the lists/ directory otherwise. That was kinda okay in the old none-client-merge as the filename was always the same so it was constantly overridden, but now with different names for client-merge quiet a few could pill up on the system and are used by the next call as it picks them up based on the filename.
* integrate Anthonys rred with POC for client-side mergeDavid Kalnischkies2014-01-151-7/+16
| | | | | | | | | | | | | Providing the benefits of both without the downsides :) (ABI breaks or external dependencies) For this Anthonys rred is equipped with: - magic-filename-pickup of patches rather than explicit messages - use of FileFd instead of FILE* to get on-the-fly uncompress of the gzip compressed pdiff patches The acquire code in turn stops checking for apt-file's helper as our own rred is now clever enough for our needs.
* implement POC client-side merging of pdiffs via apt-fileDavid Kalnischkies2013-12-131-20/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The idea of pdiffs is to avoid downloading the hole file by patching the existing index. This works very well, but becomes slow if a lot of patches needs to be applied to reconstruct an up-to-date index and in recent years more and more dinstall (or similar) runs are executed creating more and more pdiffs in the same amount of time, so pdiffs became less useful. The solution is simple: Reduce the amount of patches (which are very small) which need to be applied on top of the index we have available (which is usually pretty big). This can be done in two ways: Either merge the patches on the server-side so that the client has to download only one patch or the patches are all downloaded and merged on the client-side. The first needs a client who is doing one step at a time who can also skip patches if it needs (APT supports this for a long time now). The later is implemented by this commit, but depends on the server NOT merging the patches and the patches being in a strict order in which no patch is skipped. This is traditionally the case for dak, but other repository creators support merging – e.g. reprepro (which helpfully adds a flag indicating that the patches are merged). To support both or even mixes a client needs more information which isn't available for now. This POC uses the external diffindex-rred included in apt-file to do the heavy lifting of merging & applying all patches in one pass, hence to test this feature apt-file needs to be installed.
* configurable compression for testcasesDavid Kalnischkies2013-08-281-3/+1
| | | | | | | | Compressing files in 4 different styles eats test-time for no practical gain if we don't test them explicitly, so default to just building 'gz' compressed files as it is the simplest compression algorithm supported Git-Dch: Ignore
* add chronic-like testsuccess/testfailure helpersDavid Kalnischkies2013-08-121-2/+2
| | | | | | | | | | For many commands the output isn't stable (like then dpkg is called) but the exitcode is, so this helper enhances the common && msgpass || msgfail by generating automatically a msgtest and showing the output of the command in case of failure instead of discarding it unconditionally, the later being chronic-like behaviour Git-Dch: Ignore
* simple fork and pidfile aptwebserverDavid Kalnischkies2013-06-241-1/+1
| | | | | | | | | | | Forking only after being ready to accept clients avoids running races with the tests which sometimes failed on the first 'apt-get update' (or similar) with the previous background-start and hope for the best… The commit fixes also some oversight output-order changes in regards to Description-md5 and (I-M-S) race conditions in various tests. Git-Dch: Ignore
* fix the remaining lzma calls with xz --format=lzma in the testcasesDavid Kalnischkies2012-04-111-1/+1
|
* do not add Index file by hand now that ftparchive does it by itselfDavid Kalnischkies2011-01-241-9/+2
|
* * methods/rred.cc:David Kalnischkies2011-01-151-0/+1
| | | | | - operate optional on gzip compressed pdiffs * apt-pkg/acquire-item.cc: - don't uncompress downloaded pdiff files before feeding it to rred
* tests/integration/test-*: remove a bunch of "local" that are used outside ↵Michael Vogt2010-10-131-1/+1
| | | | funtions (bash complains)
* * apt-pkg/acquire-item.cc:David Kalnischkies2010-08-211-0/+51
- don't use ReadOnlyGzip mode for PDiffs as this mode doesn't work in combination with the AddFd methods of our hashclasses Add also 2 testcases: one to test pdiffs in general and one to test the handling of compressed indexes.