summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
...
* fix Alt-Filename handling of file methodDavid Kalnischkies2016-04-141-1/+3
| | | | | | | | | | A silly of-by-one error in the stripping of the extension to check for the uncompressed filename broken in an attempt to support all compressions in commit a09f6eb8fc67cd2d836019f448f18580396185e5. Fixing this highlights also mistakes in the handling of the Alt-Filename in libapt which would cause apt to remove the file from the repository (if root has the needed rights – aka the disk isn't readonly or similar)
* webserver: 416 errors aren't closing connectionsDavid Kalnischkies2016-04-131-1/+1
| | | | | | | | Breaking here lets our handler die which a client will fix by reconnecting… but that eats time needlessly and is simple the wrong handling, too. Git-Dch: Ignore
* stop handling items in doomed transactionsDavid Kalnischkies2016-04-071-1/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the previous commit we track the state of transactions, so we can now use our knowledge to avoid processing data for a transaction which was already closed (via an abort in this case). This is needed as multiple independent processes are interacting in the process, so there isn't a simple immediate full-engine stop and it would also be bad to teach each and every item how to check if its manager has failed subordinate and what to do in that case. In the pdiff case, which deals (potentially) with many items during its lifetime e.g. a hashsum mismatch in another file can abort the transaction the file we try to patch via pdiff belongs to. This causes some of the items (which are already done) to be aborted with it, but items still in the process of acquisition continue in the processing and will later try to use all the items together failing in strange ways as cleanup already happened. The chosen solution is to dry up the communication channels instead by ignoring new requests for data acquisition, canceling requests which are not assigned to a queue and not calling Done/Failed on items anymore. This means that e.g. already started or pending (e.g. pipelined) downloads aren't stopped and continue as normal for now, but they remain in partial/ and aren't processed further so the next update command will pick them up and put them to good use while the current process fails updating (for this transaction group) in an orderly fashion. Closes: 817240 Thanks: Barr Detwix & Vincent Lefevre for log files
* Allow lowering trust level of a hash via configJulian Andres Klode2016-03-281-4/+4
| | | | | | Introduces APT::Hashes::<NAME> with entries Untrusted and Weak which can be set to true to cause the hash to be treated as untrusted and/or weak.
* test-apt-update-reporting: Make more use of frameworkJulian Andres Klode2016-03-271-12/+16
| | | | | | | Use msgtest and testsuccess with a function instead of failing with a simple exit 1. This looks nicer. Gbp-Dch: ignore
* test-acquire-same-file-multiple-times: Delete files before retryingJulian Andres Klode2016-03-271-0/+1
| | | | | | This gets rid of byte-range requests and 416 responses. Gbp-Dch: ignore
* test-apt-download-progress: Use a larger file for testingJulian Andres Klode2016-03-271-3/+3
| | | | | | | This should make the test less flaky, as with a small file, we might have already received all the data before trying to apply rate limits which is a constant source of failure on the i386 Ubuntu autopkgtest.
* Do not mark packages for keep that we want to removeJulian Andres Klode2016-03-271-0/+39
| | | | | | | | | | | | | | | | | | | | | | If the package is marked for removal, keep it marked for removal and do not mark it for keep. If we mark it for keep, we some how later get to a different stage where it is marked for unpack instead of removal. In the example in the bug report, we would get a: SmartUnPack maas-region-controller-min:amd64 (replace version 2.0.0~alpha3+bzr4810-0ubuntu1 with Segmentation fault maas-region-controller-min:amd64 was marked for removal, but we changed it to keep and somehow it thinks that this is to be replaced now instead of removed (probably because the InstallVer != CandidateVer [with InstallVer = 0]). This fixes a regression introduced in release 1.2.7, commit: 0390edd5452b081f8efcf412f96d535a1d959457 Reported-by: LaMont Jones on IRC LP: #1562402
* drop confusing comma from no strong hash messageDavid Kalnischkies2016-03-251-1/+1
|
* handle gpgv's weak-digests ERRSIGDavid Kalnischkies2016-03-221-16/+45
| | | | | | | | | | | Our own gpgv method can declare a digest algorithm as untrusted and handles these as worthless signatures. If gpgv comes with inbuilt untrusted (which is called weak in official terminology) which it e.g. does for MD5 in recent versions we should handle it in the same way. To check this we use the most uncommon still fully trusted hash as a configureable one via a hidden config option to toggle through all of the three states a hash can be in.
* properly check for "all good sigs are weak"David Kalnischkies2016-03-212-35/+53
| | | | | | | | | | Using erase(pos) is invalid in our case here as pos must be a valid and derefenceable iterator, which isn't the case for an end-iterator (like if we had no good signature). The problem runs deeper still through as VALIDSIG is a keyid while GOODSIG is just a longid so comparing them will always fail. Closes: 818910
* tests: reenable basic auth test and add @ in usernameDavid Kalnischkies2016-03-193-7/+17
| | | | | | | | | | On launchpad #1558484 a user reports that @ in the authentication tokens parsing of sources.list isn't working in an older (precise) version. It isn't the recommended way of specifying passwords and co (auth.conf is), but we can at least test for regressions (and in this case test at all… who was that "clever" boy disabling a test with exit……… oh, nevermind. Git-Dch: Ignore
* cachefile: Only set members that were initialized successfullyJulian Andres Klode2016-03-191-0/+42
| | | | | | | | | | | Otherwise, things will just start failing later down the stack, because (a) the lazy getters do not check if building was successful and (b) any further getter call would return the invalid object anyway. Also initialize VS in pkgCache to nullptr by default. Closes: #818628
* test framework: Pass -n to lsof to speed up finding the https portJulian Andres Klode2016-03-171-1/+1
| | | | | | | | There is no point in resolving all addresses to their names, this just seriously slows the setup phase down. So just pass -n to not resolve names anymore. Gbp-Dch: ignore
* test-acquire-same-file-multiple-times: Run failing test up to 10 timesJulian Andres Klode2016-03-171-5/+11
| | | | | | | This should make the test less flaky and hopefully fix the failure on Ubuntu's armhf CI nodes. Gbp-Dch: ignore
* Make test-apt-download-progress less flakyJulian Andres Klode2016-03-171-8/+13
| | | | | | | | | | | | The test is a bit flaky. In order to get it less flaky, reduce the speed in each run. To compensate for issues, start with a higher speed level. Also increase the number of runs to 10. Furthermore, http get the same multiple-run loop, and the log files are changed to indicate the protocol being tested, as it's not obvious which one fails if it fails in quiet mode. Gbp-Dch: ignore
* do not strip epochs from state version stringsDavid Kalnischkies2016-03-162-32/+32
| | | | | | | | | | | The epoch stripping in this code is done since day one, but in other places we show a version epochs are not stripped. If epochs are present in packages they tend to be an important information which we can't just drop and especially can't drop "sometimes" as that confuses users and tools alike – so even if removing code in use for (close to) 18 years feels wrong, it is probably the right choice for consistency. Closes: 818162
* Report non-transient errors as errors, not as warningsJulian Andres Klode2016-03-1610-16/+16
| | | | | This makes it easier to understand what really is an error and what not.
* Get accurate progress reporting in apt update againMichael Vogt2016-03-163-6/+39
| | | | | | | | | | | | For the non-pdiff case, we have can have accurate progress reporting because after fetching the {,In}Release files we know how many IndexFiles will be fetched and what size they have. Therefore init the filesize early (in pkgAcqIndex::Init) and ensure that in Acquire::Pulse() looks at already downloaded bits when calculating the progress in Acquire::Pulse. Also improve debug output of Debug::acquire::progress
* tests: fix parallel execution to be working dir independentDavid Kalnischkies2016-03-161-1/+1
| | | | Git-Dch: Ignore
* Fix bug where the problemresolve can put a pkg into a heisenstateMichael Vogt2016-03-152-0/+49
| | | | | | | | | | | | | | | | The problemresolver will set the candidate version for pkg P back to the current version if it encounters an impossible to satisfy critical dependency on P. However it did not set the State of the package back as well which lead to a situation where P is neither in Keep,Install,Upgrade,Delete state. Note that this can not be tested via the traditional sh based framework. I added a python-apt based test for this. LP: #1550741 [jak@debian.org: Make the test not fail if apt_pkg cannot be imported]
* test: Move --weak-digest initialization to the right placeJulian Andres Klode2016-03-141-3/+6
| | | | | | | This was wrong and caused some issues because apt-key invoked host apt-config with our library. Gbp-Dch: ignore
* test: Use SHA512 digests for GPG, reject SHA1-based signaturesJulian Andres Klode2016-03-141-1/+5
| | | | | This makes the test suite safe if we ever need to reject SHA1 signatures in an update.
* enforce verify of filesize in 'apt-get source'David Kalnischkies2016-03-141-7/+39
| | | | | The structure we parse the data into has a dedicated size field, but it tends to be easier to handle it as a (very weak) checksum.
* don't use Desc.URI to calculate .diff/Index filenamesDavid Kalnischkies2016-03-141-1/+14
| | | | | | | The URI descibing an item can change via mirrors/redirectors which causes the .diff/Index files to get the wrong names in storage. Git-Dch: Ignore
* flush line-clearing on progress stop before post-invokeDavid Kalnischkies2016-03-141-2/+5
| | | | | | | | | All other interactions with std::cout are flushed directly, just in the stop case we hadn't done it – no problem expect if there is still output coming after apt is done like in the case of a post-invoke script producing output. Closes: 793672
* aptwebserver: fix html validation issuesDavid Kalnischkies2016-03-141-5/+5
| | | | | | | | Iceweasel^WFirefox complains about the missing encoding in its console which can be a bit annoying in interactive sessions, so fixing these issues has no effect on apt itself, but on the testers. Git-Dch: Ignore
* require $(HASH)-Download field in .diff/Index filesDavid Kalnischkies2016-03-141-36/+41
| | | | | | | | | | | | Now that we ignore SHA1-only files it makes sense to require also the provision of hashes for the compressed patches as this was introduced in the same patchset as support for non-SHA1 hashes in the file itself in dak and adding support in other archive creators (if they support pdiffs at all) will likely be in the same batch. The reason for the change itself is simple: If you are 'scared' enough about the security of SHA1, you shouldn't uncompress a file you haven't verified at all – after all, it could be exploiting a bug or a zip bomb.
* test: remove SHA1 support testing as unsupportedDavid Kalnischkies2016-03-141-71/+19
| | | | | | | | Given that we refuse to use SHA1-only .diff/Indexes no point in shipping and running code which pretends to check support for it which given that all these tests are run 3 times eats a noticeable amount of time. Git-Dch: Ignore
* Test that SHA1-only .diff/Index files are not usedJulian Andres Klode2016-03-131-2/+32
| | | | | Ensure that .diff/Index files that only contain SHA1 values and no SHA2 values are not used.
* Do not consider SHA1 usableJulian Andres Klode2016-03-135-19/+35
| | | | | SHA1 is not reasonably secure anymore, so we should not consider it usable anymore. The test suite is adjusted to account for this.
* Use native architecture instead of amd64 for build-dep-purge testJulian Andres Klode2016-03-101-9/+12
| | | | | | | | Using amd64 broke the test case on non-amd64 architectures. Query the native architecture from dpkg and use that instead. The definition of NATIVE is copied from the test test-architecture-specification-parsing.
* Fix several typosVeres Lajos2016-03-076-8/+8
| | | | | | | | | | | | | This effectively merges branch 'typofixes-vlajos-20150807' of github.com:vlajos/apt with the following commit: commit 13cacb3e2e2352ba701e769fc889e3344fabbf7e Author: Veres Lajos <vlajos@gmail.com> Date: Sun Aug 9 00:12:53 2015 +0100 typofix - https://github.com/vlajos/misspell_fixer It has been rebased for a better commit message.
* do not move not-failed pdiff-patches into CWD on failureDavid Kalnischkies2016-03-061-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | If a single pdiff fails, we have to fail the entire patching endeavour and fall back to getting the complete file instead. That is easy in serverside merged pdiffs as we get them one by one. For clientside we get them all at once through, which means that a failure in one has to stop the entire pipeline, which works as expected (as proven by the bugreporters as they don't even notice it happening). The problem is just that the first failing pdiff will do the cleanup, so another pdiff which happens to be successfully acquired after we processed the failure doesn't find the file it is supposed to use as a basename anymore, so the patch is renamed to what should be the unique extension and moved into the current working directory. Processing is then stopped as the patch realizes that it isn't the last one which completed downloading. On the plus side this means this is neither us using a bad temporary location nor a security problem. It "just" overrides unconditionally files in your current working directory (if you happen to have them named like a pdiff patch – a bit unlikely perhaps) and so drops files there which are never used again. I guess this was introduced in 4e3c5633b1e74b4f58b95f339cfbbf4cbf21ab3e for real as I made the need for the existence of the base file rather explicit, but the potential lingers in the code for far longer. Closes: #816837
* add test for apt-key 0xKEY and use parameter expansionDavid Kalnischkies2016-03-061-0/+11
| | | | | | | | | Fixed in f7bd44bae0d7cb7f9838490b5eece075da83899e already, but the commit misses the Closes tag and while we are at it we can add a simple regression test and micro-optimize it a bit. Thanks: James McCoy for the suggestion. Closes: 816691
* support APT::Get::Build-Dep-Automatic again in build-depDavid Kalnischkies2016-03-061-0/+24
| | | | | | | | | | | In a249b3e6fd798935a02b769149c9791a6fa6ef16 I dropped with the manual first resolver step also the support for installing build-deps as automatic in such a way that it behaved like this option was enabled by default. Restoring support for it means that we go back to mark build- dependencies as manually installed again by default and provide this option to keep them as automatically installed.
* tests: expect no output while compiling noopchrootDavid Kalnischkies2016-03-062-4/+8
| | | | | | This way we hopefully notice (new) warnings in this little helper. Git-Dch: Ignore
* deal with partially downloaded changelogsDavid Kalnischkies2016-03-061-0/+6
| | | | | | | | | | | | Changelogs are relatively small and we have no hashes for them, but we had partial support for them before, so lets stick to it. This also deletes the (partial) file before moving the downloaded file into its place – rename(2) should be doing this by itself, but testing on semaphoreci suggests that this isn't always the case (error is "Stale file handle") and we don't need an atomic replace here, so be explicit. Git-Dch: Ignore
* Fix crash with empty architecture listJulian Andres Klode2016-02-251-0/+13
| | | | | | If the architecture list is empty somehow, fail normally. LP: #1549819
* pass versioned provides to external solvers in EDSPDavid Kalnischkies2016-02-161-117/+163
| | | | | | The EDSP output generated by apt didn't include the versioned provides information so that every provides looked like an unversioned one in the eyes of an external resolver.
* always download changelogs into /tmp firstDavid Kalnischkies2016-02-111-17/+15
| | | | | | | | | | pkgAcqChangelog has the default behaviour of downloading a changelog to a temporary directory (inside /tmp, not /tmp directly), which is cleaned up on shutdown, but this can be overridden to store the changelog more permanently – but that caries a permission problem. For changelog we can 'easily' solve this by always downloading to a temporary directory and only move it out of there on done.
* use local changelog from /usr/share/doc if possibleDavid Kalnischkies2016-02-111-0/+23
| | | | | | | | | | | If pkgAcqChangelog is told to acquire the changelog for a version it will check first if this version is installed on the disk and if so will use the local changelog in /usr/share/doc (possibily/likely gz compressed) instead of downloading the file from the web. An option is provided to disable this, which is enabled by default for the Ubuntu vendor as they truncate the local changelogs – and for apts --print-uris action.
* test: use our special downloaded dir for 'source' resultDavid Kalnischkies2016-02-101-0/+2
| | | | | | | | | | | Otherwise the test run as root fails seeing the W: Can't drop privileges for downloading as file 'foo_1.tar.gz' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied) warning in a command which isn't supposed to warn. One trivial test, two fixups and still counting… Git-Dch: Ignore
* accept any tarball compression in 814139 testcaseDavid Kalnischkies2016-02-101-2/+2
| | | | | | | | Travis still uses a dpkg version which defaults to gz and as which compression is picked isn't all to important as long as one is just accept any. Git-Dch: Ignore
* test that seeking to a position earlier in the file worksJulian Andres Klode2016-02-101-0/+12
| | | | | | This tests the fix for #812994, #813000 Gbp-Dch: ignore
* get dpkg lock in build-dep if cache was invalid againDavid Kalnischkies2016-02-101-0/+58
| | | | | | | | | | | | | | | | Regression introduced in a249b3e6fd798935a02b769149c9791a6fa6ef16, which in the case of an invalid cache would build the first part unlocked and later pick up the (still unlocked) cache for further processing, so the system got never locked and apt would end up complaining about being unable to release the lock at shutdown. The far more common case of having a valid cache worked as expected and hence covered up the problem – especially as tests who would have noticed it are simulations only, which do not lock. Closes: 814139 Reported-By: Balint Reczey <balint@balintreczey.hu> Reported-By: Helmut Grohne <helmut@subdivi.de> on IRC
* test: Fix apt-key tests to work with current gpg 2.1Julian Andres Klode2016-02-041-1/+11
|
* avoid building dependency tree in 'source' commandDavid Kalnischkies2016-02-034-21/+4
| | | | | | We don't need the dependencies for obvious reasons and we don't need the candidate version either, so building a pkgDepCache is wasted effort, which we can stop doing now that build-dep cleared the path.
* use pkgCache::VS instead of pkgDepCache::VS()David Kalnischkies2016-02-032-22/+58
| | | | | | | | | | | | | | The later just calls the earlier, but the later needs the fullblown dependency cache to be initialized, which is a very costly operation and isn't done anymore that early in the run as we would need to throw away and rebuild it again after we got all the information about source pkgs. As we end up with a nullptr for the pkgDepCache, we use a slightly longer calling convention to make sure that we use the pkgCache directly, avoiding nullptr induced segfaults and costly operations. Git-Dch: Ignore Reported-By: Balint Reczey <balint@balintreczey.hu>
* support <libc>-<kernel>-<cpu> in architecture specsDavid Kalnischkies2016-01-312-0/+88
| | | | | | | | | | | | | | | | | | | APT has a different understanding than dpkg (#748936) what matches and what doesn't match an architecture specification as it isn't converting back (and forward) to Debian triplets. That has to eventually be solved some way or the other, but until that happens we change the matching in apt so that porters can continue their work on non-gnu libc-ports even if policy doesn't specify that yet (and dpkg just supporting it "by accident" via triplets). The initial patch was reformatted, fixed in terms of patterns containing "any-any", dealing with expanding an arch without libc to gnu while a pattern expands libc to any, the parsedepends test was fixed (the new if's were inserted one step too early) and another test just for the specifications added. Closes: #812212 Thanks: Bálint Réczey for initial patch