summaryrefslogtreecommitdiff
path: root/test/integration/framework
Commit message (Collapse)AuthorAgeFilesLines
...
* fix various typos reported by spellintianDavid Kalnischkies2017-01-191-1/+1
| | | | | | | | Most of them in (old) code comments. The two instances of user visible string changes the po files of the manpages are fixed up as well. Gbp-Dch: Ignore Reported-By: spellintian
* allow warning generation for non-whitelisted optionsDavid Kalnischkies2016-12-311-0/+1
| | | | | | | | | | | | | | | The idea is simple: Each¹ Find*( call starts with a call check if the given option (with the requested type) exists in the whitelist. The whitelist is specified via our configure-index file so that we have a better chance at keeping it current. the whitelist is loaded via a special (undocumented for now) configuration stanza and if none is loaded the empty whitelist will make it so that no warnings are shown. Much needs to be done still, but that is as good a time as any to take a snapshot of the current state and release it into the wild given that it found some bugs already and has no practical effect on users. ¹ not all in this iteration, but many
* tests: cache the apt-key homedir used for Release signingDavid Kalnischkies2016-12-211-3/+26
| | | | | | | | | Importing a new secret key into gpg(2) can be increadibly slow which prolongs the test runs significantly – by caching the homedir we gain a significant speedbonus as reimporting already present keys seems like a far less costly operation. Git-Dch: Ignore
* optional write aptwebserver log to client specific filesDavid Kalnischkies2016-11-251-1/+1
| | | | | | | | | | | | The test test-handle-redirect-as-used-mirror-change serves multiple clients at the same time, so the order of the output is undefined and once in a while the two clients will intermix their lines causing the grep we perform on it later to fail making our tests fail. Solved by introducing client-specific logfiles which we all grep and sort the result to have the results more stable. Git-Dch: Ignore
* apt-ftparchive: Support NotAutomatic and ButAutomaticUpgrades fieldsJames Clarke2016-11-111-4/+10
| | | | | | | This also changes Acquire-By-Hash to be "yes" rather than "true", so it is consistent with dak's output. Closes: #272557
* travis: ignore profiling warning in test diffsDavid Kalnischkies2016-11-101-1/+14
| | | | | | | | | | | On Travis CI running tests with code coverage enabled sometimes generates lines like: profiling:/path/to/file.gcda:Merge mismatch for function 257 It would be nice if we could resolve this somehow as it garbles the statistics, but until then it is far more annoying that this causes test failures for no good reason. Gbp-Dch: Ignore
* reset HOME, USER(NAME), TMPDIR & SHELL in DropPrivilegesDavid Kalnischkies2016-11-091-3/+3
| | | | | | | | | We can't cleanup the environment like e.g. sudo would do as you usually want the environment to "leak" into these helpers, but some variables like HOME should really not have still the value of the root user – it could confuse the helpers (USER) and HOME isn't accessible anyhow. Closes: 842877
* test: Always install dpkg into our tests, regardless of MAJulian Andres Klode2016-09-071-7/+5
| | | | | | | | | | Even if we only configure a single architecture, install dpkg, so dpkg can assert multi arch correctly. This also has the nice side effect of making single architecture and multiple architecture test cases more uniform. This fixes a regression from f878d3a862128bc1385616751ae1d78246b1bd01 ("test: Assert multi-arch in the chroot").
* test: framework: Ensure copied status files have trailing linesJulian Andres Klode2016-09-071-0/+4
| | | | | | | If we copied one of the existing status files, we might not have a trailing newline, so let's add one. Gbp-Dch: ignore
* test: Pass -d to dpkg-buildpackageJulian Andres Klode2016-08-301-1/+1
| | | | | | | | | This works around an issue on Fedora where dpkg complains about missing build-essential: dpkg-checkbuilddeps: Unmet build dependencies: build-essential:native Gbp-Dch: ignore
* test, travis: Quieter testing with a new -qq modeJulian Andres Klode2016-08-291-0/+5
| | | | | | | | | | | | | | | Introduce a new -qq mode for our integration test framework, and make travis use it. The new -qq mode sets MSGLEVEL to 1. In MSGLEVEL=1, no messages are generated for passed tests, and all testcase filenames are printed in the same line. Also install first in travis, do not ls the installed output and run the install with chronic, so we only get output if it failed. Gbp-Dch: ignore
* randomize acquire order for same type index filesDavid Kalnischkies2016-08-291-0/+2
| | | | | | | | | | | | | | | Without randomizing the order in which we download the index files we leak needlessly information to the mirrors of which architecture is native or foreign on this system. More importantly, we leak the order in which description translations will be used which in most cases will e.g. have the native tongue first. Note that the leak effect in practice is limited as apt detects if a file it wants to download is already available in the latest version from a previous download and does not query the server in such cases. Combined with the fact that Translation files are usually updated infrequently and not all at the same time, so a mirror can never be sure if it got asked about all files the user wants.
* Merge branch 'portability/freebsd'Julian Andres Klode2016-08-271-39/+83
|\
| * test: Use :$(id -gn) instead of :root (when run as root)Julian Andres Klode2016-08-261-3/+3
| | | | | | | | | | | | | | On BSD systems, the root group is wheel, not root, so let's just use the default group here. Gbp-Dch: ignore
| * test: Assert multi-arch in the chrootJulian Andres Klode2016-08-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The host system might not have a dpkg installed, which makes dpkg fail with: dpkg not recorded as installed, cannot check for multi-arch support! That's entirely useless of course. We want to know if dpkg could support multi-arch in our chroot, so we pseudo-install dpkg into the chroot and pretend it's version is one version higher than the minimum dpkg version, so dpkg --assert-multi-arch works on recent dpkgs. Gbp-Dch: ignore
| * test: More portable check for dpkg versionsJulian Andres Klode2016-08-261-0/+3
| | | | | | | | | | | | | | This check should work regardless if dpkg was installed by dpkg or by a native package manager like RPM or pkg. Gbp-Dch: ignore
| * test: Use a file to determine TEST_DEFAULT_GROUPJulian Andres Klode2016-08-261-5/+2
| | | | | | | | | | | | | | This is more safe against sticky bits. For example, in FreeBSD all files created in /tmp have the group set to wheel. Gbp-Dch: ignore
| * test: Fix invalid quoting in variable expansionJulian Andres Klode2016-08-261-6/+6
| | | | | | | | | | | | | | This breaks the tests with FreeBSD's shell, and is not needed - it works fine without it. Gbp-Dch: ignore
| * test: Use printf "%b\n" instead of echo for strings with '\'Julian Andres Klode2016-08-261-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Use of echo with special characters is not portable. On a normal POSIX system, the behavior with backslash escaped strings is implementation-defined. On an XSI-conformant system, they must be interpreted. A way out is the printf command - printf "%b" specifies that the following argument is to be printed with backslash escapes interpreted. Gbp-Dch: ignore
| * test: Make sure we always find a dpkg in status fileJulian Andres Klode2016-08-261-8/+8
| | | | | | | | | | | | | | Especially on non-Debian platforms, dpkg might not list itself on the host system, and thus dpkg --assert-multi-arch fails. Gbp-Dch: ignore
| * test: Explicitly pass --admindir=var/lib/dpkg to dpkgJulian Andres Klode2016-08-261-0/+2
| | | | | | | | | | | | | | | | Our test suite assumes that dpkg's admindir is var/lib/dpkg. This might not always be true; for example, on FreeBSD, it is located at /var/db/dpkg. Gbp-Dch: ignore
| * test: Fix building of noopchrootJulian Andres Klode2016-08-261-1/+5
| | | | | | | | Gbp-Dch: ignore
| * test: Get rid of debhelper rules.tiny example depJulian Andres Klode2016-08-261-1/+13
| | | | | | | | Gbp-Dch: ignore
| * test: Allow stunnel to be used instead of stunnel4Julian Andres Klode2016-08-261-4/+9
| | | | | | | | | | | | This is needed for Fedora and FreeBSD. Gbp-Dch: ignore
| * test: Substitute GNU commands for other commands where availableJulian Andres Klode2016-08-261-2/+18
| | | | | | | | | | | | | | We are simply checking for gnuCMD and gCMD for each command we are interested in. Gbp-Dch: ignore
| * test: Use C locale instead of C.UTF-8Julian Andres Klode2016-08-261-1/+1
| | | | | | | | Gbp-Dch: ignore
| * Make directory paths configurableJulian Andres Klode2016-08-261-0/+5
| | | | | | | | | | | | | | This allows other vendors to use different paths, or to build your own APT in /opt for testing. Note that this uses + 1 in some places, as the paths we receive are absolute, but we need to strip of the initial /.
* | do not restore selections for already purged packagesDavid Kalnischkies2016-08-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In most cases apt was already skipping the (re)setting of packages as to be removed/purged if dpkg had told us that it already did, but we haven't dealt with it in the most obvious of the cases: Selections set for packages we touched in this operation which either restores selections even dpkg would have overridden or e.g. tries to restore a purge selection for a package which was just purged – does not happen with apt itself as it isn't using selections in this way, but higher frontends like aptitude do. The result in the later case is a warning printed by dpkg that we try to set selections for an unknown package, which is harmless per se, but can be confusing for users and we really shouldn't cause warnings in dpkg if we can help it. Reported-By: Guillem Jover on IRC
* | do fail on weakhash/loop earlier in acquireDavid Kalnischkies2016-08-241-0/+1
|/ | | | | | | | | | | | | | | | | The bugreport shows a segfault caused by the code not doing the correct magical dance to remove an item from inside a queue in all cases. We could try hard to fix this, but it is actually better and also easier to perform these checks (which cause instant failure) earlier so that they haven't entered queue(s) yet, which in return makes cleanup trivial. The result is that we actually end up failing "too early" as if we wouldn't be careful download errors would be logged before that process was even started. Not a problem for the acquire system, but likely to confuse users and programs alike if they see the download process producing errors before apt was technically allowed to do an acquire (it didn't, so no violation, but it looks like it to the untrained eye). Closes: 835195
* add the gpg-classic variant to the gpgv/gnupg or-groupDavid Kalnischkies2016-08-171-35/+10
| | | | | | We need to support partial upgrades anyhow, so we have to deal with the different versions and your tests try to ensure that we do, so we shouldn't make any explicit higher requirements.
* tests: set source directory for gdbDavid Kalnischkies2016-08-171-1/+1
| | | | | | Helps interactive gdb calls find the source code. Gbp-Dch: Ignore
* tests: copy 01autoremove from the right placeDavid Kalnischkies2016-08-111-2/+2
| | | | | | | | | | | | With cmake using BUILDDIRECTORY at this place is not only as wrong as it was before, but it might not even work always copying the system provided one which might or might not be current and hence fails tests needing it to be current like ./test-apt-move-and-forget-manual-sections We don't want to always use the one from the source directory through either like in autopkgtests. Gbp-Dch: Ignore
* test: Automatically discover CMake build directoryJulian Andres Klode2016-08-101-1/+21
| | | | | | | Look at the project root, and all directories directly below it and pick the directory with the newest CMakeCache.txt file. Gbp-Dch: ignore
* CMake: Switch integration tests and travis overJulian Andres Klode2016-08-061-8/+9
| | | | | | This early support seems a bit hacky, but it's a hard switch: The integration tests do not understand the old build system anymore afterwards. I don't really like that.
* use a configurable location for apport report storageDavid Kalnischkies2016-07-221-1/+1
| | | | | Hardcoding /var/crash means we can't test it properly and it isn't really our style.
* clean up default-stanzas from extended_states on writeDavid Kalnischkies2016-07-221-0/+8
| | | | | | | | | | The existing cleanup was happening only for packages which had a status change (install -> uninstalled) which is the most frequent but no the only case – you can e.g. set autobits explicitly with apt-mark. This would leave stanzas in the states file declaring a package to be manually installed – which is the default value for a package not listed at all, so we can just as well drop it from the file.
* tests: skip over -flags for first option in autotestsDavid Kalnischkies2016-07-221-1/+9
| | | | | | | Otherwise calls like "apt -q install" end up calling "aptautotest_apt_q" instead of "aptautotest_apt_install" Gbp-Dch: Ignore
* don't hardcode /var/lib/dpkg/status as dir::state::statusDavid Kalnischkies2016-07-191-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Theoretically it should be enough to change the Dir setting and have apt pick the dpkg/status file from that. Also, it should be consistently effected by RootDir. Both wasn't really the case through, so a user had to explicitly set it too (or ignore it and have or not have expected sideeffects caused by it). This commit tries to guess better the location of the dpkg/status file by setting dir::state::status to a naive "../dpkg/status", just that this setting would be interpreted as relative to the CWD and not relative to the dir::state directory. Also, the status file isn't really relative to the state files apt has in /var/lib/apt/ as evident if we consider that apt/ could be a symlink to someplace else and "../dpkg" not effected by it, so what we do here is an explicit replace on apt/ – similar to how we create directories if it ends in apt/ – with dpkg/. As this is a change it has the potential to cause regressions in so far as the dpkg/status file of the "host" system is no longer used if you set a "chroot" system via the Dir setting – but that tends to be intended and causes people to painfully figure out that they had to set this explicitly before, so that it now works more in terms of how the other Dir settings work (aka "as expected"). If using the host status file is really intended it is in fact easier to set this explicitely compared to setting the new "magic" location explicitely.
* tests: activate dpkg multi-arch even if test is single archDavid Kalnischkies2016-07-151-10/+14
| | | | | | | | | | | | | | Most tests are either multiarch, do not care for the specific architecture or do not interact with dpkg, so really effect by this is only test-external-installation-planner-protocol, but its a general issue that while APT can be told to treat any architecture as native dpkg has the native architecture hardcoded so if we run tests we must make sure that dpkg knows about the architecture we will treat as "native" in apt as otherwise dpkg will refuse to install packages from such an architecture. This reverts f883d2c3675eae2700e4cd1532c1a236cae69a4e as it complicates the test slightly for no practical gain after the generic fix.
* tests: fix external solver/planner directory setupDavid Kalnischkies2016-07-081-10/+7
| | | | | The setup didn't prepare the directories as expected by newer version of tthe external tests in an autopkgtests environment.
* don't change owner/perms/times through file:// symlinksDavid Kalnischkies2016-07-061-0/+9
| | | | | | | | | | | | | If we have files in partial/ from a previous invocation or similar such those could be symlinks created by file:// sources. The code is expecting only real files through and happily changes owner, modification times and permission on the file the symlink points to which tend to be files we have no business in touching in this way. Permissions of symlinks shouldn't be changed, changing owner is usually pointless to, but just to be sure we pick the easy way out and use lchown, check for symlinks before chmod/utimes. Reported-By: Mattia Rizzolo on IRC
* tests: allow setting environment in extra fileDavid Kalnischkies2016-07-051-0/+4
| | | | | | | | It can be handy to set apt options for the testcases which shouldn't be accidentally committed like external planner testing or workarounds for local setups. Gbp-Dch: Ignore
* use +0000 instead of UTC by default as timezone in outputDavid Kalnischkies2016-07-021-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | All apt versions support numeric as well as 3-character timezones just fine and its actually hard to write code which doesn't "accidently" accepts it. So why change? Documenting the Date/Valid-Until fields in the Release file is easy to do in terms of referencing the datetime format used e.g. in the Debian changelogs (policy §4.4). This format specifies only the numeric timezones through, not the nowadays obsolete 3-character ones, so in the interest of least surprise we should use the same format even through it carries a small risk of regression in other clients (which encounter repositories created with apt-ftparchive). In case it is really regressing in practice, the hidden option -o APT::FTPArchive::Release::NumericTimezone=0 can be used to go back to good old UTC as timezone. The EDSP and EIPP protocols use this 'new' format, the text interface used to communicate with the acquire methods does not for compatibility reasons even if none of our methods would be effected and I doubt any other would (in these instances the timezone is 'GMT' as that is what HTTP/1.1 requires). Note that this is only true for apt talking to methods, (libapt-based) methods talking to apt will respond with the 'new' format. It is therefore strongly adviced to support both also in method input.
* warn if apt-key is used in scripts/its output parsedDavid Kalnischkies2016-07-011-0/+1
| | | | | | | | | apt-key needs gnupg for most of its operations, but depending on it isn't very efficient as apt-key is hardly used by users – and scripts shouldn't use it to begin with as it is just a silly wrapper. To draw more attention on the fact that e.g. 'apt-key add' should not be used in favor of "just" dropping a keyring file into the trusted.gpg.d directory this commit implements the display of warnings.
* tests: deduplicate package creation framework codeDavid Kalnischkies2016-06-301-58/+38
| | | | Gbp-Dch: Ignore
* eipp: let apt make a plan, not make stuff planeDavid Kalnischkies2016-06-291-6/+7
| | | | | | | | | | | | | | Julian noticed on IRC that I fall victim to a lovely false friend by calling referring to a 'planer' all the time even through these are machines to e.g. remove splinters from woodwork ("make stuff plane"). The term I meant is written in german in this way (= with a single n) but in english there are two, aka: 'planner'. As that is unreleased code switching all instances without any transitional provisions. Also the reason why its skipped in changelog. Thanks: Julian Andres Klode Gbp-Dch: Ignore
* eipp: enable xz-compressed scenario loggingDavid Kalnischkies2016-06-271-5/+6
| | | | | | | | | | | | In 385d9f2f23057bc5808b5e013e77ba16d1c94da4 I implemented the storage of scenario files based on enabling this by default for EIPP, but I implemented it first optionally for EDSP to have it independent. The reasons mentioned in the earlier commit (debugging and bugreports) obviously apply here, especially as EIPP solutions aren't user approved, nearly impossible to verify before starting the execution and at the time of error the scenario has changed already, so that reproducing the issue becomes hard(er).
* eipp: provide the internal planer as an external oneDavid Kalnischkies2016-06-271-0/+3
| | | | | | Testing the current implementation can benefit from being able to be feed an EIPP request and produce a fully compliant response. It is also a great test for EIPP in general.
* eipp: implement version 0.1 of the protocolDavid Kalnischkies2016-06-271-1/+3
| | | | | | | | | | | | | | | | | | | | | | | The very first step in introducing the "external installation planer protocol" (short: EIPP) as part of my GSoC2016 project. The description reads: APT-based tools like apt-get, aptitude, synaptic, … work with the user to figure out how their system should look like after they are done installing/removing packages and their dependencies. The actual installation/removal of packages is done by dpkg with the constrain that dependencies must be fulfilled at any point in time (e.g. to run maintainer scripts). Historically APT has a super micro-management approach to this task which hasn't aged that well over the years mostly ignoring changes in dpkg and growing into an unmaintainable mess hardly anyone can debug and everyone fears to touch – especially as more and more requirements are tacked onto it like handling cycles and triggers, dealing with "important" packages first, package sources on removable media, touch minimal groups to be able to interrupt the process if needed (e.g. unattended-upgrades) which not only sky-rocket complexity but also can be mutually exclusive as you e.g. can't have minimal groups and minimal trigger executions at the same time.
* do not hang on piped input in PipedFileFdPrivateDavid Kalnischkies2016-06-101-2/+6
| | | | | This effects only compressors configured on the fly (rather then the inbuilt ones as they use a library).