summaryrefslogtreecommitdiff
path: root/test/integration/test-apt-update-ims
Commit message (Collapse)AuthorAgeFilesLines
* rework errors and warnings around insecure repositoriesDavid Kalnischkies2015-11-041-4/+7
| | | | | | | | | | | | | | | | Insecure (aka unsigned) repositories are bad, period. We want to get right of them finally and as a first step we are printing scary warnings. This is already done, this commit just changes the messages to be more consistent and prevents them from being displayed if authenticity is guaranteed some other way (as indicated with trusted=yes). The idea is to first print the pure fact like "repository isn't signed" as a warning (and later as an error), while giving an explaination in a immediately following notice (which is displayed only in quiet level 0: so in interactive use, not in scripts and alike). Closes: 796549
* tests: don't use hardcoded port for http and httpsDavid Kalnischkies2015-09-151-34/+34
| | | | | | This allows running tests in parallel. Git-Dch: Ignore
* tests: use more 'native' instead of 'amd64' if possibleDavid Kalnischkies2015-09-141-1/+1
| | | | | | | | | | The tests usually run on amd64 boxes, but once in a while I run it on a (slow) armel box as well, which has its fair share of problems with some tests, but at least the low hanging fruits can be dealt with: Do not assume that amd64 is the native dpkg architecture – instead use whatever dpkg thinks is native as architecture for the test. Git-Dch: Ignore
* avoid using global PendingError to avoid failing too often too soonDavid Kalnischkies2015-09-141-0/+3
| | | | | | | | | | | | | | | | | | | Our error reporting is historically grown into some kind of mess. A while ago I implemented stacking for the global error which is used in this commit now to wrap calls to functions which do not report (all) errors via return, so that only failures in those calls cause a failure to propergate down the chain rather than failing if anything (potentially totally unrelated) has failed at some point in the past. This way we can avoid stopping the entire acquire process just because a single source produced an error for example. It also means that after the acquire process the cache is generated – even if the acquire process had failures – as we still have the old good data around we can and should generate a cache for (again). There are probably more instances of this hiding, but all these looked like the easiest to work with and fix with reasonable (aka net-positive) effects.
* condense parallel requests with the same hashes to oneDavid Kalnischkies2015-06-151-0/+18
| | | | | | | | | | | | | 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.
* show item ID in Hit, Ign and Err lines as wellDavid Kalnischkies2015-06-151-18/+18
| | | | | | | | 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.
* treat older Release files than we already have as an IMSHitDavid Kalnischkies2015-05-181-7/+5
| | | | | | | | | | | | | | | | | | | | | Valid-Until protects us from long-living downgrade attacks, but not all repositories have it and an attacker could still use older but still valid files to downgrade us. While this makes it sounds like a security improvement now, its a bit theoretical at best as an attacker with capabilities to pull this off could just as well always keep us days (but in the valid period) behind and always knows which state we have, as we tell him with the If-Modified-Since header. This is also why this is 'silently' ignored and treated as an IMSHit rather than screamed at the user as this can at best be an annoyance for attackers. An error here would 'regularily' be encountered by users by out-of-sync mirrors serving a single run (e.g. load balancer) or in two consecutive runs on the other hand, so it would just help teaching people ignore it. That said, most of the code churn is caused by enforcing this additional requirement. Crisscross from InRelease to Release.gpg is e.g. very unlikely in practice, but if we would ignore it an attacker could sidestep it this way.
* a hit on Release files means the indexes will be hits tooDavid Kalnischkies2015-04-191-45/+105
| | | | | | | | | | | | | | | | | | 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).
* fix variable naming typo used in debug outputDavid Kalnischkies2014-11-081-1/+1
| | | | Git-Dch: Ignore
* promote filesize to a hashstringDavid Kalnischkies2014-10-241-1/+1
| | | | | | | | | It is a very simple hashstring, which is why it isn't contributing to the usability of a list of them, but it is also trivial to check and calculate, so it doesn't hurt checking it either as it can combined even with the simplest other hashes greatly complicate attacks on them as you suddenly need a same-size hash collision, which is usually a lot harder to achieve.
* testcases: do not allow warnings in testsuccessDavid Kalnischkies2014-10-201-6/+9
| | | | | | | | | | Adds a new testwarning which tests for zero exit and the presents of a warning in the output, failing if either is not the case or if an error is found, too. This allows us to change testsuccess to accept only totally successful executions (= without warnings) which should help finding regressions. Git-Dch: Ignore
* check lists/ content in tests doing rollbackDavid Kalnischkies2014-10-201-2/+2
| | | | Git-Dch: Ignore
* autorun permission tests for all apt-get update callsDavid Kalnischkies2014-10-201-3/+2
| | | | | | | | Adds some infrastructure to run tests automatically for certain commands. The first command being 'apt-get update' (and 'apt update') which check for correct permission and owner of the files in lists/. Git-Dch: Ignore
* Add new configallowinsecurerepositories to the test frameworkMichael Vogt2014-10-141-0/+2
| | | | | | | Add a new configallowinsecurerepositories that controls the value of Acquire::AllowInsecureRepositories for the tests. Set it to "false" for most of the testsuite and only enable it where its really needed. We want to switch the default for this post-jessie.
* fix compile and tests errorDavid Kalnischkies2014-10-131-1/+2
| | | | | | I am pretty sure I did that before committing broken stuff… Git-Dch: Ignore
* display errortext for all Err as well as Ign logsDavid Kalnischkies2014-10-071-1/+4
| | | | | | | consistently using Item::Failed in all specializec classes helps setting up some information bits otherwise unset, so some errors had an empty reason as an error. Ign is upgraded to display the error message we ignored to further help in understanding what happens.
* Rework pkgAcqMeta{Index,Sig,ClearSig}::Done() for readabilityMichael Vogt2014-10-061-4/+22
| | | | | | Move common code out but do not use subclassing for ::Done to make it easier to understand what each class is doing when its done
* cleanup around pkgAcqMetaSig and improved testsMichael Vogt2014-10-021-5/+29
|
* fix leftover files from Acquire::GzipIndexMichael Vogt2014-10-011-7/+22
|
* add ims check verifyMichael Vogt2014-08-021-0/+3
|
* make i-m-s work againMichael Vogt2014-08-011-0/+22