summaryrefslogtreecommitdiff
path: root/test/integration
Commit message (Collapse)AuthorAgeFilesLines
* Handle JSON hooks that just close the file/exit and fix some other errorsJulian Andres Klode2018-06-271-0/+87
| | | | | | | | | | | | | | JSON hooks might disappear and the common idiom to work around hooks disappearing is to check for the hook in the shell snippet that is in the apt.conf file and if it does not exist, do nothing. This caused APT to fail however, expecting it to acknowledge the handshake. Ignoring ECONNRESET on handshakes solves the problem. The error case, and the other error cases also did not stop execution of the hook, causing more errors to pile up. Fix this by directly going to the closing part of the code. LP: #1776218
* Don't show acquire warning for "hidden" componentsDavid Kalnischkies2018-05-282-8/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Merge branch 'feature/morevolatilesupport' into 'master'Julian Andres Klode2018-05-243-6/+204
|\ | | | | | | | | more volatile: build-dep foo.deb/release & show foo.deb See merge request apt-team/apt!14
| * Support local files as arguments in show commandDavid Kalnischkies2018-05-111-5/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | Now that --with-source is supported in show we can go a little further and add the "syntactic sugar" of supporting deb-files on the commandline directly to give users an alternative to remembering dpkg -I for deb files & as a bonus apt also works on changes files. Most of the code churn is actually to deal with cases probably not too common in reality like mixing packages and deb-files on the commandline and getting the right order for these multiple records. Closes: 883206
| * Support --with-source in show & search commandsDavid Kalnischkies2018-05-111-6/+30
| |
| * Support release selector for volatile files as wellDavid Kalnischkies2018-05-111-0/+94
| | | | | | | | | | | | | | | | | | | | The syntax is a bit awkward, but it is the same as for a package name and introducing another syntax wouldn't really help usability, so with apt install ./foo.deb/experimental you will get the dependencies of foo satisfied by your default release, but if this wouldn't satisfy the version requirements the candidate for this dependency is switched to the version from the experimental release. The same applies for apt build-dep ./foo.dsc/stable-backports which was the initial request.
| * Extend apt build-dep pkg/release to switch dep as neededDavid Kalnischkies2018-05-111-0/+59
| | | | | | | | | | | | apt install pkg/release follows versioned dependencies in the candidate switching if the current candidate does not satisfy the dependency, so for uniformity the same should be supported in build-dep.
* | Merge branch 'feature/byhashviaalturl' into 'master'Julian Andres Klode2018-05-242-2/+5
|\ \ | | | | | | | | | | | | Don't force the same mirror for by-hash URIs See merge request apt-team/apt!15
| * | Handle by-hash URI construction more centrallyDavid Kalnischkies2018-05-111-0/+2
| | | | | | | | | | | | | | | | | | | | | Individual items shouldn't concern themselves with these alternative locations, we can deal with this more efficiently within the infrastructure created for other alternative URIs now avoiding the need to implement this in each item.
| * | Drop alternative URIs we got a hash-based fail fromDavid Kalnischkies2018-05-112-2/+3
| |/ | | | | | | | | | | | | | | | | | | | | If we got a file but it produced a hash error, mismatched size or similar we shouldn't fallback to alternative URIs as they likely result in the same error. If we can we should instead use another mirror. We used to be a lot stricter by stopping all trys for this file if we got a non-404 (or a hash-based) failure, but that is too hard as we really want to try other mirrors (if we have them) in the hope that they have the expected and correct files.
* | Extend test-apt-get-autoremove to check debug outputFilipe Brandenburger2018-05-211-0/+25
| | | | | | | | | | | | | | | | Run `apt-get autoremove -o Debug::pkgAutoRemove=yes` and confirm the logged reason for packages to be kept is correct. Only check for specific debug lines containing 'MarkPackage:' in order to prevent new debug logging to break the test case.
* | Fix hidden test failure if not called via sudoDavid Kalnischkies2018-05-192-2/+2
| | | | | | | | | | | | | | | | id: '': no such user ./test-bug-611729-mark-as-manual: 59: [: Illegal number: Regression-of: 68842e1741a5005b1e3f0a07deffd737c65e3294 Gbp-Dch: Ignore
* | tests: Do not expect requested-by if sudo was invoked by rootJulian Andres Klode2018-05-162-2/+2
|/ | | | | If sudo was invoked by root, SUDO_UID will be 0, and apt will not print a Requested-By line.
* Fix various typos reported by spellcheckersDavid Kalnischkies2018-05-052-3/+3
| | | | | Reported-By: codespell & spellintian Gbp-Dch: Ignore
* Merge branch 'pu/heavy-hooks' into 'master'Julian Andres Klode2018-04-151-0/+122
|\ | | | | | | | | json-based hooks for apt cli tools See merge request apt-team/apt!10
| * Introduce experimental new hooks for command-line toolsJulian Andres Klode2018-04-151-0/+122
| | | | | | | | | | | | | | | | | | This allows third-party package managers like snap or flatpak to hook in and suggest alternatives if packages could not be found, for example. This is still highly experimental and the protocol might change in future versions.
* | 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
| |
* | Use https for Ubuntu changelogsJulian Andres Klode2018-03-151-4/+4
|/ | | | We just enabled https on changelogs.ubuntu.com, let's use it.
* Merge branch 'pu/not-valid-before' into 'master'Julian Andres Klode2018-02-192-0/+48
|\ | | | | | | | | 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-192-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | ensure correct file permissions for auxfilesDavid Kalnischkies2018-02-191-6/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The interesting takeaway here is perhaps that 'chmod +w' is effected by the umask – obvious in hindsight of course. The usual setup helps with hiding that applying that recursively on all directories (and files) isn't correct. Ensuring files will not be stored with the wrong permissions even if in strange umask contexts is trivial in comparison. Fixing the test also highlighted that it wasn't bulletproof as apt will automatically fix the permissions of the directories it works with, so for this test we actually need to introduce a shortcut in the code. Reported-By: Ubuntu autopkgtest CI
* | 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
* | add apt-helper drop-privs command…David Kalnischkies2018-02-191-0/+7
| |
* | Work around test-method-mirror failure by setting umask at startJulian Andres Klode2018-02-191-0/+2
|/ | | | This fixes a test failure on autopkgtest.
* allow the apt/lists/auxfiles/ directory to be missingDavid Kalnischkies2018-01-192-4/+40
| | | | | | | | | | 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
* Introduce inrelease-path option for sources.listJulian Andres Klode2018-01-171-0/+28
| | | | | | | | | | | | | | Allow specifying an alternative path to the InRelease file, so you can have multiple versions of a repository, for example. Enabling this option disables fallback to Release and Release.gpg, so setting it to InRelease can be used to ensure that only that will be tried. We add two test cases: One for checking that it works, and another for checking that the fallback does not happen. Closes: #886745
* add a testcase for the mirror methodDavid Kalnischkies2018-01-031-0/+190
| | | | Gbp-Dch: Ignore
* allow a method to request auxiliary filesDavid Kalnischkies2018-01-033-2/+6
| | | | | | | | | | | | | | | | | | | | 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.]
* refactor message generation for methodsDavid Kalnischkies2018-01-031-1/+1
| | | | | | The format isn't too hard to get right, but it gets funny with multiline fields (which we don't really have yet) and its just easier to deal with it once and for all which can be reused for more messages later.
* do not remap current files if nullptrs in cache generationDavid Kalnischkies2017-12-241-0/+47
| | | | | | | | | | | | | | If the cache needs to grow to make room to insert volatile files like deb files into the cache we were remapping null-pointers making them non-null-pointers in the process causing trouble later on. Only the current Releasefile pointer can currently legally be a nullpointer as volatile files have no release file they belong to, but for safety the pointer to the current Packages file is equally guarded. The option APT::Cache-Start can be used to workaround this problem. Reported-By: Mattia Rizzolo on IRC
* relax test to accept various connection failuresDavid Kalnischkies2017-12-141-3/+2
| | | | | | | | | | | For the failure propagation testing we try to connect to a port which isn't open – you would think that this has a rather limited set of failure modes but it turns out that there are various ways this can fail, so instead of trying to guess all error message we just accept any. Reported-By: travis-ci Gbp-Dch: Ignore
* implement fallback to alternative URIs for all itemsDavid Kalnischkies2017-12-132-1/+19
| | | | | | | | 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-132-4/+41
| | | | | | | 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).
* don't auto-switch candidate if installed is good enoughDavid Kalnischkies2017-12-131-0/+24
| | | | | | | If we perform candidate switching in requests like "apt install foo/bar" we should first check if the dependencies of foo from release bar are already satisfied by what is already installed before checking if the candidate (or switched candidate) would.
* if insecure repo is allowed continue on all http errorsDavid Kalnischkies2017-12-132-3/+25
| | | | | | | | | | | | | | | | | If a InRelease file fails to download with a non-404 error we assumed there is some general problem with repository like a webportal or your are blocked from access (wrong auth, Tor, …). Turns out some server like S3 return 403 if a file doesn't exist. Allowing this in general seems like a step backwards as 403 is a reasonable response if auth failed, so failing here seems better than letting those users run into problems. What we can do is show our insecure warnings through and allow the failures for insecure repos: If the repo is signed it is easy to add an InRelease file and if not you are setup for trouble anyhow. References: cbbf185c3c55effe47f218a07e7b1f324973a8a6
* 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.
* support COLUMNS environment variable in apt toolsDavid Kalnischkies2017-11-192-4/+26
| | | | | | | apt usually gets the width of the window from the terminal or failing that has a default value, but especially for testing it can be handy to control the size as you can't be sure that variable sized content will always be linebreaked as expected in the testcases.
* allow multivalue fields in deb822 sources to be foldedDavid Kalnischkies2017-11-191-0/+92
| | | | | | | | | | | | | | | The documentation said "spaces", but there is no real reason to be so strict and only allow spaces to separate values as that only leads to very long lines if e.g. multiple URIs are specified which are again hard to deal with from a user PoV which the deb822 format is supposed to avoid. It also deals with multiple consecutive spaces and strange things like tabs users will surely end up using in the real world. The old behviour on encountering folded lines is the generation of URIs which end up containing all these whitespace characters which tends to mess really bad with output and further processing. Closes: 881875
* Prevent overflow in Installed-Size (and Size) in apt showJulian Andres Klode2017-10-281-0/+12
| | | | | | | | | | | Installed-Size for linux-image-4.13.0-1-amd64-dbg and friends are larger than 4 GB, but read as a signed integer - that's fine so far, as the value is in KB, but it's multiplied with 1024 which overflows. So let's read it as unsigned long long instead. While we're at it, also use unsigned long long for Size, in case that is bigger than 2 GB.
* Fix testsuite for and add new fields from dpkg 1.19Julian Andres Klode2017-10-202-2/+6
| | | | | | | | | | | tagfile-order.c: Add missing fields from dpkg 1.19 For binary packages, this is Build-Essential; for source packages, it is Description. test-bug-718329-...: Ignore control.tar.*, changes in dpkg 1.19 test-apt-extracttemplates: Fix for dpkg 1.19
* ignore unsupported key formats in apt-keyDavid Kalnischkies2017-10-052-41/+66
| | | | | | | | | | | | | | | | | | | 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
* allow empty build-dependency fields in the parserDavid Kalnischkies2017-09-261-0/+1
| | | | | | | | | | | APT used to parse only wellformed files produced by repository creation tools which removed empty files as pointless before apt would see them. Now that apt can be told to parse e.g. debian/control files directly, it needs to be a little more accepting through: We had this with comments already, now let it deal with the far more trivial empty fields. Closes: #875363
* proper error reporting for v3 onion servicesDavid Kalnischkies2017-09-261-4/+24
| | | | | | | | | APT connects just fine to any .onion address given, only if the connect fails somehow it will perform checks on the sanity of which in this case is checking the length as they are well defined and as the strings are arbitrary a user typing them easily mistypes which apt should can be slightly more helpful in figuring out by saying the onion hasn't the required length.
* Drop curl method and apt-transport-https packageJulian Andres Klode2017-09-241-6/+0
| | | | | This automatically removes any old apt-transport-https, as apt now Breaks it unversioned.
* ftparchive: Do not pass through disabled hashes in SourcesJulian Andres Klode2017-09-093-2/+42
| | | | | | | | | | | | | | | | When writing a Sources files hashes that were already present in the .dsc were always copied through (or modified), even if disabled. Remove them instead when they are disabled, otherwise we end up with hashes for tarballs and stuff but not for dsc files (as the dsc obviously does not hash itself). Also adjust the tests: test-compressed-indexes relied on Files being present in showsrc, and test-apt-update-weak-hashes expected the tarball to be downloaded when an archive only has MD5 and we are requiring SHA256 because that used to work because the tarball was always included. Closes: #872963
* add test for bug 870675 (hang on unsupported method)David Kalnischkies2017-09-091-0/+26
| | | | | | | Commit e250a8d8d8ef2f8f8c5e2041f7645c49fba7aa36 implemented the fix and should have included already this testcase for it. Gbp-Dch: Ignore
* test: Workaround gpgv warningJulian Andres Klode2017-09-091-2/+2
| | | | gpgv: WARNING: This key is not suitable for signing in --compliance=gnupg mode