summaryrefslogtreecommitdiff
path: root/test/integration/framework
Commit message (Collapse)AuthorAgeFilesLines
* Set PATH=/usr/sbin:/usr/bin:/sbin:/bin when running dpkgJulian Andres Klode2018-12-101-0/+3
| | | | | | | | | This avoids a lot of problems from local installations of scripting languages and other stuff in /usr/local for which maintainer scripts are not prepared. [v3: Inherit PATH during tests, check overrides work] [v2: Add testing]
* Support subkeys properly in Signed-By optionsDavid Kalnischkies2018-09-111-0/+1
| | | | | | | | If we limit a file to be signed by a certain key it should usually accept also being signed by any of this keys subkeys instead of requiring each subkey to be listed explicitly. If the later is really wanted we support now also the same syntax as gpg does with appending an exclamation mark at the end of the fingerprint to force no mapping.
* Unset more environment variables in test frameworkDavid Kalnischkies2018-09-111-2/+5
| | | | | | | | | It is an uphill battle to "reset" the environment to a clean state without making it needlessly hard to use 'good' environment variables, so we just try a little harder here without really trying for completeness. Gbp-Dch: Ignore
* Don't show acquire warning for "hidden" componentsDavid Kalnischkies2018-05-281-8/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit d7c92411dc1f4c6be098d1425f9c1c075e0c2154 introduced a warning for non-existent files from components not mentioned in Components to hint users at a mispelling or the disappearance of a component. The debian-installer subcomponent isn't actively advertised in the Release file through, so if apt ends up in acquiring a file which doesn't exist for this component (like Translation files) apt would produce a warning: W: Skipping acquire of configured file 'main/debian-installer/i18n/Translation-en' as repository 'http://deb.debian.org/debian buster InRelease' doesn't have the component 'main/debian-installer' (component misspelt in sources.list?) We prevent this in the future by checking if any file exists from this component which results in the warning to be produced still for the intended cases and silence it on the d-i case. This could potentially cause the warning not to be produced in cases it should be if some marginal file remains, but as this message is just a hint and the setup a bit pathological lets ignore it for now. There is also the possibility of having no file present as they would all be 0-length files and being a "hidden" component, but that would be easy to workaround from the repository side and isn't really actively used at the moment in the wild. Closes: #879591
* tests: Prevent stunnel4 from binding on IPv6David Kalnischkies2018-05-281-1/+1
| | | | | | | | Hardcoding the IPv4 address 127.0.0.1 stops stunnel4 from also binding on IPv6 as well which not only binds on another port but confuses our crude port extraction by splitting on ':' with ::1. Gbp-Dch: Ignore
* Fix various typos reported by spellcheckersDavid Kalnischkies2018-05-051-1/+1
| | | | | Reported-By: codespell & spellintian Gbp-Dch: Ignore
* Merge branch 'pu/zstd' into 'master'Julian Andres Klode2018-04-151-0/+2
|\ | | | | | | | | pu/zstd See merge request apt-team/apt!8
| * apt-pkg: Add support for zstdJulian Andres Klode2018-03-121-0/+2
| | | | | | | | | | | | | | zstd is a compression algorithm developed by facebook. At level 19, it is about 6% worse in size than xz -6, but decompression is multiple times faster, saving about 40% install time, especially with eatmydata on cloud instances.
* | test: export GCOV_ERROR_FILE=/dev/null to make it fail less/no testsJulian Andres Klode2018-04-061-0/+3
|/
* Merge branch 'pu/not-valid-before' into 'master'Julian Andres Klode2018-02-191-0/+2
|\ | | | | | | | | Check that Date of Release file is not in the future See merge request apt-team/apt!3
| * Check that Date of Release file is not in the futureJulian Andres Klode2018-02-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | By restricting the Date field to be in the past, an attacker cannot just create a repository from the future that would be accepted as a valid update for a repository. This check can be disabled by Acquire::Check-Date set to false. This will also disable Check-Valid-Until and any future date related checking, if any - the option means: "my computers date cannot be trusted." Modify the tests to allow repositories to be up to 10 hours in the future, so we can keep using hours there to simulate time changes.
* | tests: set debhelper compat 10 and R³ by defaultDavid Kalnischkies2018-02-191-2/+3
|/ | | | | | | | | The testpackages hardly need debhelper at all, so any version would do, and they build without root rights by definition, but declaring it explicitly can't hurt and in the case of debhelper it would be sad if our testcases break one day because the old compat level is removed. Gbp-Dch: Ignore
* allow the apt/lists/auxfiles/ directory to be missingDavid Kalnischkies2018-01-191-1/+5
| | | | | | | | | | apt 1.6~alpha6 introduced aux requests to revamp the implementation of a-t-mirror. This already included the potential of running as non-root, but the detection wasn't complete resulting in errors or could produce spurious warnings along the way if the directory didn't exist yet. References: ef9677831f62a1554a888ebc7b162517d7881116 Closes: 887624
* allow a method to request auxiliary filesDavid Kalnischkies2018-01-031-0/+2
| | | | | | | | | | | | | | | | | | | | If a method needs a file to operate like e.g. mirror needs to get a list of mirrors before it can redirect the the actual requests to them. That could easily be solved by moving the logic into libapt directly, but by allowing a method to request other methods to do something we can keep this logic contained in the method and allow e.g. also methods which perform binary patching or similar things. Previously they would need to implement their own acquire system inside the existing one which in all likelyhood will not support the same features and methods nor operate with similar security compared to what we have already running 'above' the requesting method. That said, to avoid methods producing conflicts with "proper" files we are downloading a new directory is introduced to keep the auxiliary files in. [The message magic number 351 is a tribute to the german Grundgesetz article 35 paragraph 1 which defines that all authorities of the state(s) help each other on request.]
* implement fallback to alternative URIs for all itemsDavid Kalnischkies2017-12-131-1/+1
| | | | | | | | For deb files we always supported falling back from one server to the other if one failed to download the deb, but that was hardwired in the handling of this specific item. Moving this alongside the retry infrastructure we can implement it for all items and allow methods to use this as well by providing additional URIs in a redirect.
* implement Acquire::Retries support for all itemsDavid Kalnischkies2017-12-131-4/+4
| | | | | | | Moving the Retry-implementation from individual items to the worker implementation not only gives every file retry capability instead of just a selected few but also avoids needing to implement it in each item (incorrectly).
* tests: Improve handling profiling messages on CIJulian Andres Klode2017-11-221-10/+12
| | | | | | | | | | | We did not strip away profiling messages when we were diffing from stdin (-). Just always write temporary files and strip from them. We also had a problem when stripping ...profiling: from a line and the next line starts with profiling. Split the sed into two calls so we first remove complete profiling: lines before fixing the ...profiling: cases.
* ignore unsupported key formats in apt-keyDavid Kalnischkies2017-10-051-1/+5
| | | | | | | | | | | | | | | | | | | gpg2 generates keyboxes by default and users end up putting either those or armored files into the trusted.gpg.d directory which apt tools neither expect nor can really work with without fortifying backward compatibility (at least under the ".gpg" extension). A (short) discussion about how to deal with keyboxes happened in https://lists.debian.org/deity/2017/07/msg00083.html As the last message in that thread is this changeset lets go ahead with it and see how it turns out. The idea is here simply that we check the first octal of a gpg file to have one of three accepted values. Testing on my machines has always produced just one of these, but running into those values on invalid files is reasonabily unlikely to not worry too much. Closes: #876508
* test: Workaround gpgv warningJulian Andres Klode2017-09-091-2/+2
| | | | gpgv: WARNING: This key is not suitable for signing in --compliance=gnupg mode
* fail early in http if server answer is too small as wellDavid Kalnischkies2017-07-261-0/+14
| | | | | | | | | Failing on too much data is good, but we can do better by checking for exact filesizes as we know with hashsums how large a file should be, so if we get a file which has a size we do not expect we can drop it directly, regardless of if the file is larger or smaller than what we expect which should catch most cases which would end up as hashsum errors later now a lot sooner.
* travis: ignore profiling warning in progress linesDavid Kalnischkies2017-06-271-2/+2
| | | | | | | | | | On Travis CI running tests with code coverage enabled sometimes generates profiling lines, which we filter out for a while now, but that misses lines generated showing progress still causing test failures, so more sed logic is added in the hopes to ignore them. Extends: 58608941e6b58a46109b7cd875716b3d8054c4bf Gbp-Dch: Ignore
* make the create-test-data script great againDavid Kalnischkies2017-06-261-1/+1
| | | | | | | | Changes in the past to the buildsystem and the testing framework broke this little helper script – lets fix those problems to restore functionality. Gbp-Dch: Ignore
* Call update from apt-key test for a strange path testDavid Kalnischkies2017-06-261-1/+4
| | | | | | | | | | We setup a "horrible" environment in the apt-key testcase to check all kinds of things, but we really should be making also at least a simple apt update call, as that in turn will call apt-key which is how apt-key is used in the non-testcase world, so that calling should be able to deal with such environments as well. Gbp-Dch: Ignore
* tests: fix gpg-agent killing in testcasesDavid Kalnischkies2017-06-261-1/+1
| | | | | | | We want to kill the agent if its home directory exists at that location, not if it isn't there (leaving an army of processes around). Gbp-Dch: Ignore
* 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