summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2013-08-16Add test for bug 507998Christopher Baines
2013-08-12let apt-key del work better with softlink and single key keyringsDavid Kalnischkies
Having fragement files means there is a good chance that there is one key per keyring, so deal with that as well as with setups in which keyrings are linked into trusted.gpg.d as we can't just modify those files (they might be in /usr for example).
2013-08-12ensure that testcases exiting because of set -e aren't successfulDavid Kalnischkies
Git-Dch: Ignore
2013-08-12make the keyring locations in apt-key configurableDavid Kalnischkies
Might come in handy for more than just a simple testcase.
2013-08-12fix output redirection orderDavid Kalnischkies
First redirect output to a file, then redirect other outputs to this output, not the other way around as this will not work. Git-Dch: Ignore
2013-08-12fix: --print-uris removes authenticationDavid Kalnischkies
The constructors of our (clear)sign-acquire-items move a pre-existent file for error-recovery away, which gets restored or discarded later as the acquire progresses, but --print-uris never really starts the acquire process, so the files aren't restored (as they should). To fix this both get a destructor which checks for signs of acquire doing anything and if it hasn't the file is restored. Note that these virtual destructors theoretically break the API, but only with classes extending the sign-acquire-items and nobody does this, as it would be insane for library users to fiddle with Acquire internals – and these classes are internals. Closes: 719263
2013-08-12add chronic-like testsuccess/testfailure helpersDavid Kalnischkies
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
2013-08-12test Release file handling with expired keysDavid Kalnischkies
Signing files with expired keys is not as easy as it sounds, so the framework jumps a few loops to do it, but it might come in handy to have an expired key around for later tests even if it is not that different from having no key in regards to APT behaviour. Git-Dch: Ignore
2013-08-08specific pins below 1000 cause downgradesDavid Kalnischkies
We start your quest by using the version of a package applying to a specific pin, but that version could very well be below the current version, which causes APT to suggest a downgrade even if it is advertised that it never does this below 1000. Its of course questionable what use a specific pin on a package has which has a newer version already installed, but reacting with the suggestion of a downgrade is really not appropriated (even if its kinda likely that this is actually the intend the user has – it could just as well be an outdated pin) and as pinning is complicated enough we should atleast do what is described in the manpage. So we look out for the specific pin and if we haven't seen it at the moment we see the installed version, we ignore the specific pin. Closes: 543966
2013-08-01prefer native arch over higher priority for providersColin Watson
The rational from the buglog: > The problem here is that the Priority field in one of the Packages files > is incorrect due to a mishap with reprepro configuration, […] the > amd64 version is Priority: standard but the arm64 version is Priority: > optional (and has a stray "optional: interpreters" field). > […] > However, Priority is a rather weak property of a package because it's > typically applied via overrides, and it's easy for maintainers of > third-party repositories to misconfigure them so that overrides aren't > applied correctly. It shouldn't be ranked ahead of choosing packages > from the native architecture. In this case, I have no user-mode > emulation for arm64 set up, so choosing m4:arm64 simply won't work. This effectly makes the priority the least interesting data point in chosing a provider, which is in line with the other checks we have already order above priority in the past and also has a certain appeal by the soft irony it provides. Closes: #718482
2013-08-01unset LANGUAGE for showing [Y/n] answer hintsDavid Kalnischkies
nl_langinfo is used to acquire the YESEXPR of the language used, but it will return the one from LC_MESSAGES, which might be different from the language chosen for display of the question (based on LANGUAGE) so this commit removes the [Y/n] help text from the questions itself and moves it to the prompt creation in which the usage of LC_MESSAGES is forced for it, so that the helptext shown actually represents the characters accepted as input for the question. There is still room for problems of course starting with an untranslated "[Y/n]" but a translated YESEXPR or the problem that the question is asked in a completely different language which might have a conflicting definition of [Y/n] input or the user simple ignores the helptext and assumes that an answer matching the question language is accepted, but the mayority of users will never have this problem to begin with, so we should be fine (or at least a bit finer than before). Closes nothing really, but should at least help a bit with bugs like deb:194614, deb:471102, lp:1205578, and countless others.
2013-07-26request absolute URIs from proxies again (0.9.9.3 regession)David Kalnischkies
Commit 2b9c9b7f28b18f6ae3e422020e8934872b06c9f3 not only removes keep-alive, but also changes the request URI send to proxies which are required to be absolute URIs rather than the usual absolute paths. Closes: 717891
2013-07-25pick up Translation-* even if only compressed availableDavid Kalnischkies
On CD-ROMs Translation-* files are only in compressed form included in the Release file. This used to work while we had no record of Translation-* files in the Release file at all as APT would have just guessed the (compressed) filename and accepted it (unchecked), but now that it checks for the presents of entries and if it finds records it expects the uncompressed to be verifiable. This commit relaxes this requirement again to fix the regression. We are still secure "enough" as we can validate the compressed file we have downloaded, so we don't loose anything by not requiring a hashsum for the uncompressed files to double-check them. Closes: 717665
2013-07-18fix 'apt-cache search' crash with missing descriptionDavid Kalnischkies
Beside the earlier fixed 'apt-cache show', 'showpkg' and 'search' deal with descriptions. 'showpkg' was fixed by fixing the cache generation for 'show', but 'search' still segfaulted. On the upside, it doesn't segfault any longer, on the downside, if a package has no description at all (aka: not in the Packages file and not in a Translation-* file) the package can't be found with 'search', even if we search only by name. That is a shortcoming in the code, but fixing it means rewriting it completely for dubious gain at best. So this commit just skips packages without a description and is done. Closes: 647590
2013-07-18skip all Description fields in apt-cache, not just firstDavid Kalnischkies
Given a Packages file like: […] Description: foo bar baz moo moo moo Multi-Arch: foreign Description-md5: 97e204a9f4ad8c681dbd54ec7c505251 […] We have to display the Multi-Arch flag field as well as the fields after the Description-md5, but not this field itself, as we already have one printed alongside the Description we display. Closes: 717254
2013-07-16fix if-clause to generate hook-info for 'rc' packagesDavid Kalnischkies
The code incorrectly skips printing of current version information, if the package has no current version (for APT, but for dpkg as it is the case for packages which are removed but not purged) by using an unintended "else if" rather than an "if". Closes: 717006
2013-07-11prevent MarkInstall of unsynced Multi-Arch:same siblingsDavid Kalnischkies
Multi-Arch: same packages can be co-installed, but need to have the same version for all installed packages (aka "siblings"). Otherwise the unsynced versions will fight against each other and the auto-install as wel as the problem resolver will later have to decide between holding the packages or to remove one of the siblings (usually a foreign) taking a bunch of packages (like the entire foreign setup) with them. The idea here is now to be more pro-active: MarkInstall will fail for a package if the siblings aren't synced, so we don't allow a situation in which a resolver has to decide if to hold or to remove-upgrade under the assumption that the remove-upgrade decision is always wrong and doesn't deserve to be explored (expect valid out-of-syncs of course). Thats a pretty bold move to take for a library which is used by different solvers so this check is done in IsInstallOk and can be overridden if front-ends want to.
2013-07-11implement arch+= and arch-= for sources.listDavid Kalnischkies
Default is to acquire all architectures from APT::Architectures which can be changed by arch=, but this isn't very flexible if you want "mostly" the default as you have to hardcode the architectures then, so arch-= and arch+= can be used to add/remove architectures from the default set. On a machine with 'amd64' and 'i386' configured the lines: deb [arch+=armel] http://example.org/debian wheezy rocks deb [arch-=amd64] http://example.org/debian jessie rocks will result in the download of: wheezy Packages for 'amd64', 'i386' and 'armel' jessie Packages for 'i386'
2013-07-11Version 3 for DPkg::Pre-Install-Pkgs with MultiArch infoDavid Kalnischkies
Adds on top of Version 2 to all displayed version numbers the architecture as well as the MultiArch flag for consumption by the hooks. Most of the time the architecture will be the same for both versions displayed, but packages might change from "all" to "any" (or back) between versions so we can't display the architecture for packages. Pseudo-Format for Version 3: <name> <version> <arch> <m-a-flag> <compare> <version> <arch> <m-a-flag> Examples: stuff - - none < 1 amd64 none **CONFIGURE** libsame 1 i386 same < 2 i386 same **CONFIGURE** stuff 2 i386 none > 1 i386 none **CONFIGURE** libsame 2 i386 same > - - none **REMOVE** toolkit 1 all foreign > - - none **REMOVE** Closes: #712116
2013-06-24simple fork and pidfile aptwebserverDavid Kalnischkies
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
2013-06-20trigger NODATA error for invalid InRelease filesDavid Kalnischkies
With the selfgrown splitting we got the problem of not recovering from networks which just reply with invalid data like those sending us login pages to authenticate with the network (e.g. hotels) back. The good thing about the InRelease file is that we know that it must be clearsigned (a Release file might or might not have a detached sig) so if we get a file but are unable to split it something is seriously wrong, so there is not much point in trying further. The Acquire system already looks out for a NODATA error from gpgv, so this adds a new error message sent to the acquire system in case the splitting we do now ourselves failed including this magic word. Closes: #712486
2013-06-20tests: accept an explaination for msgfailDavid Kalnischkies
Git-Dch: Ignore
2013-06-20simple URI rewrite rules config for webserverDavid Kalnischkies
we have a test which required traditionally lighttpd to be executed as it requires a webserver supporting some kind of URI rewriting. Now with some lines of code our own webserver can do this and the testcase can be enabled by default. This test hinted at the bug fixed in the previous commit, so having more tests which can easily be run is a good thing. Git-Dch: Ignore
2013-06-20add directory listing to the webserverDavid Kalnischkies
Git-Dch: Ignore
2013-06-20add a simple webserver for our testcasesDavid Kalnischkies
APT needs to acquire data in a secure fashion over an inherently unsecure way, known as the internet, while communicating with unreliable partners, known as webservers and proxies. For your integration tests we so far relied on 'normal' webservers, but all of them have certain quirks and none is able to provide us with all quirks which can be observed in the wild and we therefore have to test with, so this webserver isn't trying to be fast, secure or feature complete, but to provide all the quirks we need in a consistent way. This webserver also makes the APT project self-contained, as it is now able to generate, serve as well as acquire package indexes. ;) Git-Dch: Ignore
2013-06-20handle missing "Description" in apt-cache showDavid Kalnischkies
do not blindly assume that all packages stanzas have a "Description:" field in 'apt-cache show' as well as in the cache creation itself. We instead assume now that if the stanza has a Description, it will not be the first field as we look out for "\nDescription" to take care of MD5sum as well as (maybe ignored) translated Descriptions embedded in the package stanza. Closes: #712435
2013-06-09tests: add an interactive 'test' with multiple cdromsDavid Kalnischkies
Can't be used as a test as is, but shows how to build multiple CD-ROMs for tests and can be used to reproduce debbug #711456. Git-Dch: Ignore
2013-06-09ensure state-dir exists before coyping cdrom filesDavid Kalnischkies
We do the same in the acquire system which handles the 'normal' downloads, so do it here as well even though its unlikely anyone will ever notice (beside testcases of course …)
2013-06-09stop building l10n if strings are unchangedDavid Kalnischkies
The buildsystem tried to build l10n for test applications which never produced the output it expected causing it to try building it all the time.
2013-06-09tests: add expected port for cve-2013-105 testcaseDavid Kalnischkies
Git-Dch: Ignore
2013-06-09tests: trap-adding can be post- as well as prefixDavid Kalnischkies
For testcases it might sometimes be handy to add trap-actions before the general cleanup, e.g. if it has set directories read- only which rm doesn't want to remove even with --force applied (its fine with files though) Git-Dch: Ignore
2013-06-09fix support for multiple patterns in apt-cache searchDavid Kalnischkies
Patterns can appear in the name as well as in the description, they don't have to match all in the name/description only. Closes: 691453
2013-06-09do unpacks before configures in SmartConfigureDavid Kalnischkies
Splits the big loop over dependencies in SmartConfigure which unpacks and configures dependencies into two loops and reverse their order, so that all dependencies which need to be unpacked are handled first and only after that configures are issued for dependencies. This is needed as otherwise the unpack of a (new) dependency will be issued in between a configure call for two (or more) packages which form a loop, which means the configure calls aren't part of the same dpkg call and therefore dpkg bails out. Such tight loops should really be avoided as they are usually wrong – and in reality the dependencies in libreoffice were greatly simplified thanks to Rene Engelhard so the problem is gone for the benefit of all. Closes: 707578
2013-06-09try all providers in order if uninstallable in MarkInstallDavid Kalnischkies
2013-06-09fix priority sorting by prefering higher in MarkInstallDavid Kalnischkies
Used to work until a certain (here unnamed) person came along and used the wrong operator causing low-priority packages to be sorted above high-priority packages while choosing a provider in commit 2b5c35c7bb915dbd46fefd7c79f05364ba22f93b from Nov 2011
2013-05-08fix uri testMichael Vogt
2013-05-08merged patch from Daniel Hartwig to fix URI and proxy releated issuesMichael Vogt
2013-04-08merged lp:~mvo/apt/add-missing-dsc-hashesMichael Vogt
2013-04-02merged lp:~mvo/apt/fix-inrelease5Michael Vogt
2013-03-25merge patches from daniel to fix merge artifact and test failureMichael Vogt
2013-03-22merged lp:~mvo/apt/fix-tagfile-hashMichael Vogt
2013-03-22merged the debian-wheezy branchMichael Vogt
2013-03-18* apt-pkg/deb/debindexfile.cc,David Kalnischkies
apt-pkg/deb/deblistparser.cc: - use OpenMaybeClearSignedFile to be free from detecting and skipping clearsigning metadata in dsc and Release files We can't write a "clean" file to disk as not all acquire methods copy Release files before checking them (e.g. cdrom), so this reverts recombining, but uses the method we use for dsc files also in the two places we deal with Release files
2013-03-18 - add method to open (maybe) clearsigned files transparentlyDavid Kalnischkies
* ftparchive/writer.cc: - use OpenMaybeClearSignedFile to be free from detecting and skipping clearsigning metadata in dsc files
2013-03-18rename testcase to mention CVE number, make the code more consistent withDavid Kalnischkies
the rest and add some more tests (by fixing commented ones)
2013-03-18test/libapt/tagfile_test.cc: add missing "unistd.h" (thanks to Niels Thykier)Michael Vogt
2013-03-18fix pkgTagSection::Exists() and add testMichael Vogt
2013-03-18test/integration/framework: use EXIT_CODE to be consistent with the ↵Michael Vogt
run-tests code
2013-03-18report failures via exit and ensure we don't overflowMichael Vogt
2013-03-18* test/integration/framework:Michael Vogt
- continue after test failure but preserve exit status