summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* make ?installed pattern match installed version only when narrowedJulian Andres Klode2023-01-131-0/+6
| | | | | | | | This is the correct behavior, but it was overlooked when aptitude patterns where ported. I remember wondering about this, but I checked the aptitude code and saw a check that CurrentVer != 0 or something and then apparently did not notice another implementation for version matching.
* Merge branch 'pu/clean-apt-key-tmp' into 'main'Julian Andres Klode2022-10-311-0/+5
|\ | | | | | | | | Actually delete temporary apt-key.*.asc helper files See merge request apt-team/apt!266
| * Actually delete temporary apt-key.*.asc helper filesJulian Andres Klode2022-10-311-0/+5
| | | | | | | | | | | | | | During development there was an if (0) there for debugging purposes that unfortunately stayed in and caused files to accumulate. LP: #1995247
* | Merge branch 'feature/optional-dpkg-status' into 'main'Julian Andres Klode2022-10-2828-101/+115
|\ \ | |/ |/| | | | | Allow apt to run if no dpkg/status file exists See merge request apt-team/apt!257
| * Allow apt to run if no dpkg/status file existsDavid Kalnischkies2022-09-0212-27/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not having a dpkg/status file used to be a hard error which from a boostrap perspective is suspect as in the beginning, there is no status so you would need to touch it into existence. We make a difference between factual non-existence and inaccessibility to catch mistakes in which the file is not readable for some reason, the testcase test-bug-254770-segfault-if-cache-not-buildable is an example of this. Note that apt has already figured out at this point that this is a Debian-like system which should have a dpkg/status file. This change does not effect the auto-detection and is not supposed to.
| * Avoid dealing with a fake dpkg stanza in the testsDavid Kalnischkies2022-09-0217-74/+96
| | | | | | | | | | | | | | | | We needed a fake dpkg in our status file for dpkg --assert-multi-arch to work in the past, but recent dpkg versions do not require this anymore, so we can remove this somewhat surprising hackery in favour of better hidden hackery we only use if we work with an older dpkg (e.g. on current Debian stable).
* | Merge branch 'pu/phased-updates-fixes-2022-09-23' into 'main'Julian Andres Klode2022-09-283-29/+30996
|\ \ | | | | | | | | | | | | phased update improvements See merge request apt-team/apt!262
| * | full-upgrade: Mark phased upgrades for keep before anything elseJulian Andres Klode2022-09-282-0/+30936
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By marking them at the end, we might make other decisions that depend on the new phased updates, confusing the solver. Run the marking at the start too. The EDSP test file from Jeremy was modified to include Machine-ID and Phased-Update-Percentage fields and then filtered to mostly exclude packages irrelevant to the test case by running grep-dctrl \( -FRequest "EDSP 0.5" -o -FInstalled yes \ -oFPhased-Update-Percentage 10 \) \ -a --not -FArchitecture i386 LP: #1990586
| * | Check state of dependency, not dependee in dependency keep backJulian Andres Klode2022-09-281-29/+60
| |/ | | | | | | | | | | | | | | When iterating over I's dependencies (which are called Pkg), we accidentally checked if I was Protected() instead of Pkg when deciding whether Pkg can be kept back. LP: #1990684
* | Merge branch 'fix/install-pkg-order' into 'main'Julian Andres Klode2022-09-212-1/+82
|\ \ | | | | | | | | | | | | Respect users pkg order on `apt install` for resolving See merge request apt-team/apt!256
| * | Respect users pkg order on `apt install` for resolvingDavid Kalnischkies2022-09-022-1/+82
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The command line is evaluated in two steps: First all packages given are marked for install and as a second step the resolver is started on all of them in turn to get their dependencies installed. This is done so a user can provide a non-default choice on the command line and have it respected regardless of where on the command line it appears. On the other hand, the order in which dependencies are resolved can matter, so instead of using a "random" order, we now do this in the order given on the command line, so if you e.g. have a meta package pulling in non-default choices and mention it first the choices are respected predictably instead of depending on first appearance of the package name while creating the binary cache. I might have "broken" this more than a decade ago while introducing the reworked command line parsing for Multi-Arch, which also brought in the split into the two steps mentioned above which was the far more impactful 'respect user choice' change. This one should hardly matter in practice, but as the tests show, order can have surprising side effects.
* / interactive-helper: Undefine _FORTIFY_SOURCEKhem Raj2022-09-161-0/+1
|/ | | | | | | This ensures that it compiles when clang compiler is passing -DFORTIFY_SOURCES=2 Signed-off-by: Khem Raj <raj.khem@gmail.com>
* Add flag to disable upgrade by source and test caseJulian Andres Klode2022-07-241-0/+53
|
* Upgrade all binaries in a source packageJulian Andres Klode2022-07-241-7/+9
| | | | | | | | | Schedule all other binaries in the source package for upgrade if the candidate version belongs to the same source version as the package we are upgrading. This will significantly reduce the risk of partial upgrades and should make life a lot easier.
* Add test casesJulian Andres Klode2022-07-112-0/+10856
|
* Mark broken reverse depends for upgradeJulian Andres Klode2022-07-111-2/+1
| | | | | | | | | | | | Currently the solver handles cases where a Breaks b (<< 1) and if we install that a, upgrades b. However, where b Depends a (= 1), b was removed again. This addresses the problem by iterating over installed reverse dependencies of upgrades and upgrading them so that both cases work roughly similarly. LP: #1974196
* test-phased-updates-upgrade: Tests with argumentsJulian Andres Klode2022-06-301-0/+70
| | | | | | Pass some package names to upgrade to see that that works Gbp-Dch: ignore
* policy: Do not override negative pins with 1 due to phasingJulian Andres Klode2022-06-281-0/+27
| | | | | | | | | | | | | If a package is already pinned to a negative value, we should not override this with a positive 1. This causes packages to be installable that were pinned to -1, which is not intended. For this, implement phasing as a ceiling of 1 for the pin instead of a fixed 1 value. An alternative would have been to fix it to NEVER_PIN, but that would mean entirely NEW packages would not be installable while phasing which is not the intention either. LP: #1978125
* (Temporarily) Rewrite phased updates using a keep-back approachJulian Andres Klode2022-06-282-0/+257
| | | | | | | | | | | | | | | | | | | | | | | | | | This is a lot closer to the original implementation in update-manager, but still has a couple of differences that might cause bugs: - When checking whether a version is a security update, we only check versions in between and not any later version. This happens mostly because we do not know the suite, so we just check if there is any version between the installed version and our target that is a security update - We only keep already installed packages, as we run before the resolver. update-manager first runs the resolver, and then marks for keep all packages that were upgraded or newly installed that are phasing (afaict). This approach has a significant caveat that if you have version 1 installed from a release pocket, version 2 is in security, and version 3 is phasing in updates, that it installs version 3 rather than 2 from security as the policy based implementation does. It also means that apt install does not respect phasing and would always install version 3 in such a scenario. LP: #1979244
* Include our config.h in all C++ files to avoid ODR violationsDavid Kalnischkies2022-05-075-1/+11
| | | | | | | Some of our headers use APT_COMPILING_APT trickery to avoid exposing too broadly details we don't want external clients to know and make use of. The flip-side is that this can lead to different compilation units seeing different definitions if they aren't all using the same config.
* Ignore stty failures in testcasesDavid Kalnischkies2022-05-071-2/+2
| | | | | | | | | | We use 'stty sane' to combat against stepped output and co caused by (especially) failed tests, but it does so many things that it occasionally fails to reset some bits in the parallel interaction we have with it which fails the tests without a real problem in apt… Ideally we would be better at stitching the output together, but for the time being lets ignore these failures instead to stabilize the tests.
* Link interactive helpers against system libapt for autopkgtestDavid Kalnischkies2022-05-075-40/+48
| | | | | | Building the library just so we can build the helpers against it is not only wasteful but as we are supposed to test the system we can use that as an additional simple smoke test before the real testing starts.
* Merge branch 'fix/tagfilekeys' into 'main'Julian Andres Klode2022-05-062-28/+66
|\ | | | | | | | | Consistently dealing with fields via pkgTagSection::Key See merge request apt-team/apt!233
| * Parse Checksum fields via pkgTagSection::Key, tooDavid Kalnischkies2022-04-011-1/+1
| | | | | | | | | | | | | | We abstract hashes a fair bit to be able to add new ones eventually, which lead us to building the field names on the fly. We can do better through by keeping a central place for these names, too, which even helps in reducing code as we don't need the MD5 → Files dance anymore.
| * Do not order long obsoleted fields anymoreDavid Kalnischkies2022-04-011-1/+1
| | | | | | | | | | | | The dependency relation fields old names were deprecated in 1995 as the new ones were introduced. That seems barely long enough now as a transition period.
| * Drop support for long obsoleted Suggests alias: OptionalDavid Kalnischkies2022-04-011-1/+1
| | | | | | | | | | dpkg-dev stopped recognizing it in 2007 (1.14.7) while building packages. The rename itself happened in 1995 (0.93.72).
| * Document tagfile-keys.h as internal to aptDavid Kalnischkies2022-04-011-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous regime of the file was to sort it on insert, but that changes the values in the generated enum, which is fine as long as we only use it in libapt itself, but breaks on other users. The header was always intended to be private to apt itself, so we just document this here now and lay the ground work to have the file in the future only appended to, so that it remains sufficiently ABI stable that we can use it outside the library in our apt tools. We also remove some fields apt is unlikely to need or only uses in certain cases outside of any (speed) critical path to have enough room to add more fields soon as currently we are limited to 128 fields max and it would be sad if we use up that allowance entirely already.
| * Use extra-environment to point to dpkg/dak sourcesDavid Kalnischkies2022-04-011-25/+26
| | | | | | | | | | | | | | | | | | The hack is 7 years by now, so in an attempt to make that slightly cleaner lets move this to proper variables that can be assigned via an extra-environment file sources by the framework rather than relying on my user name and locate in public. Gbp-Dch: Ignore
| * Do not unique the field names in test to catch duplicatesDavid Kalnischkies2022-04-011-3/+9
| | | | | | | | | | | | | | It happens to the best, so it might happen for us, too, one day. Better to catch it directly instead. Gbp-Dch: Ignore
* | Only protect two kernels, not last installed oneJulian Andres Klode2022-04-071-16/+6
|/ | | | | | | | | | | | The kernel autoremoval algorithm was written to accomodate for Ubuntu's boot partition sizing, which was written to accomodate 3 kernels - 2 installed ones + a new one being unpacked. It seems that when the algorithm was designed, it was overlooked that it actually kept 3 kernels. LP: #1968154
* Fix build failure with gcc-12 due to missing includeDavid Kalnischkies2022-03-211-0/+1
| | | | | | | apt/test/interactive-helper/aptwebserver.cc: In function ‘std::string HTMLEncode(std::string)’: error: variable ‘constexpr const std::array<std::array<const char*, 2>, 6> htmlencode’ has initializer but incomplete type Reported-By: Helmut Grohne on IRC
* gpgv: Fix legacy fallback on unavailable keysJulian Andres Klode2022-03-071-0/+8
| | | | | | | | | | | | | | | | | | | | | If a repository is signed with multiple keys, apt 2.4.0 would ignore the fallback result if some keys were still missing, causing signature verification to fail. Rework the logic such that when checking if fallback was "succesful", missing keys are ignored - it only matters if we managed to verify one key now, whether good or bad. Likewise, simplify the logic when to do the fallback: If there was a bad signature in trusted.gpg.d, do NOT fallback at all - this is a minor security issue, as a key in trusted.gpg.d could fail silently with a bad signature, and then a key in trusted.gpg might allow the signature to succeed (as trusted.gpg.d key is then missing). Only fallback if we are missing a good signature, and there are keys we have not yet checked.
* Warn if the legacy trusted.gpg keyring is used for verificationJulian Andres Klode2022-02-221-0/+27
| | | | | With apt-key going away, people need to manage key files, rather than keys, so they need to know if any keys are in the legacy keyring.
* Allow --solver apt to work on apt satisfyDavid Kalnischkies2022-02-101-27/+62
| | | | | | | | | Our EDSP code is confused by the spaces in the package name, so we adopt a naming scheme similar to build-dep here instead of trying to teach EDSP to somehow encode the spaces as that is probably even more confusing for onlookers than this invalid package name is. Reported-By: Johannes Schauer Marin Rodrigues on IRC
* Silence ar by warping it in a testsuccess callDavid Kalnischkies2022-02-021-3/+3
| | | | | | | | The -q flag isn't quiet – it means quick – so ar happily prints an "ar: creating test.deb" which is harmless, but also pointless and it is the only testcase who produces output. Gbp-Dch: Ignore
* Enable tests commented out with no longer true fixmeDavid Kalnischkies2022-02-021-6/+5
| | | | | | | | Pinning and its display was reworked years ago, but the test and especially the comment never got the memo. References: a91aae406112df1d8fe16d00212333a20210f674 Gbp-Dch: Ignore
* Remove useless use of awkDavid Kalnischkies2022-02-021-6/+6
| | | | | | I have no idea what I was thinking 12 years ago. Gbp-Dch: Ignore
* Use moreutils parallel even if GNU parallel is installedDavid Kalnischkies2022-02-021-0/+2
| | | | | | | | GNU parallel diverts moreutils implementation away. As we us moreutils features just installing parallel breaks the test runner hence. We have this already for another naming scheme, so fixing this is easy enough. Gbp-Dch: Ignore
* Add a --full mode to apt showJulian Andres Klode2022-01-211-0/+14
| | | | | This adds back the missing fields that we do not show any other way.
* test/integration/test-policy-pinning: test listing multiple package in ↵Johannes Schauer Marin Rodrigues2022-01-031-0/+56
| | | | Package: field
* add pattern to select packages by codename (closes: #1002646)Johannes Schauer Marin Rodrigues2021-12-261-0/+5
|
* Support more than exact release matches in 'source'David Kalnischkies2021-11-231-0/+65
| | | | | | | | | | | | | | | | | The Debian 11 release notes elevate matching with regex to a documented and much used feature, which it previously wasn't. For binary packages this is not a problem, but source packages are special and it turns out that matching by release is here an exact string match only. A bit of refactoring later we can reuse the code we use for Packages files also for Release files, which is what we have for Sources files as those files itself have no representation in the cache. This means that we do not support matching based on components (c=main) in source, but we didn't before and we can cross that bridge if anyone notices… Closes: #998444
* Do not remove Essential/Protected due to dependenciesJulian Andres Klode2021-11-173-3/+27
| | | | | | | | Suggesting the removal of Essential and Protected packages as a solution leads to situations where YouTubers end up removing their desktop. Let's not remove such packages ourselves.
* Merge branch 'feature/install-versioned-provides' into 'main'Julian Andres Klode2021-10-192-0/+100
|\ | | | | | | | | Allow =version and /release selectors on virtual packages See merge request apt-team/apt!121
| * Allow =version and /release selector on virtual packagesDavid Kalnischkies2020-05-271-0/+74
| | | | | | | | | | | | | | | | | | | | | | We already have code for figuring out if a virtual package is only provided by a single provider (and otherwise show a list) we can auto-select for the user, so we can adapt that to work with versioned provides as well and while at it also release selectors. The code tries to keep ABI backward compatible and hence turns relatively ugly as we need a parameter (the selector) to be passed around without adding a parameter or new virtual methods.
| * Allow version selection to match versioned self-providesDavid Kalnischkies2020-05-271-0/+26
| | | | | | | | | | Edgecase of an edgecase at best, but it works just fine as a dependency, so it should really work on the commandline as well.
* | Add support for embedding PGP keys into Signed-By in deb822 sourcesJulian Andres Klode2021-10-181-0/+35
| | | | | | | | | | | | Extend the Signed-By field to handle embedded public key blocks, this allows shipping self-contained .sources files, making it substantially easier to provide third party repositories.
* | Merge branch 'pu/ifrange' into 'main'Julian Andres Klode2021-10-182-1/+92
|\ \ | | | | | | | | | | | | Add AllowRange option to disable HTTP Range usage See merge request apt-team/apt!188
| * | Use exact If-Range match in our test webserverDavid Kalnischkies2021-09-162-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | RFC7233 3.2 If-Range specifies the comparison to be an exact match, not a less or equal, which makes no sense in this context anyhow. Our server exists only to write our tests against it so this isn't much of a practical issue. I did confirm with a crashing server that no test (silently) depends on this or exhibits a different behaviour not explicitly checked for.
| * | Disable HTTP Range usage if varnish < 6.4 is involvedDavid Kalnischkies2021-09-161-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Debian buster (oldstable) ships 6.1 while bullseye (stable) ships 6.5 and so the later is 'fixed'. Upstream declares 6.0 still as supported. It might be still a while we encounter "bad" versions in the wild, so if we can detect and work around the issue at runtime automatically we can save some users from running into "persistent" partial files. References: https://varnish-cache.org/docs/6.4/whats-new/changes-6.4.html#changes-in-behavior