summaryrefslogtreecommitdiff
path: root/test/integration/test-bug-738785-switch-protocol
Commit message (Collapse)AuthorAgeFilesLines
* Reset failure reason when connection was successfulJulian Andres Klode2017-06-301-1/+1
| | | | | | | | | | | | When APT was trying multiple addresses, any later error somewhere else would be reported with ConnectionRefused or ConnectionTimedOut as the FailReason because that was set by early connect attempts. This causes APT to handle the failures differently, leading to some weirdly breaking test cases (like the changed one). Add debugging to the previously failing test case so we can find out when something goes wrong there again.
* allow methods to be disabled and redirected via configDavid Kalnischkies2016-08-101-18/+2
| | | | | | | | | | To prevent accidents like adding http-sources while using tor+http it can make sense to allow disabling methods. It might even make sense to allow "redirections" and adding "symlinked" methods via configuration. This could e.g. allow using different options for certain sources by adding and configuring a "virtual" new method which picks up the config based on the name it was called with like e.g. http does if called as tor+http.
* implement generic config fallback for methodsDavid Kalnischkies2016-08-101-1/+1
| | | | | | | | | | The https method implemented for a long while now a hardcoded fallback to the same options in http, which, while it works, is rather inflexible if we want to allow the methods to use another name to change their behavior slightly, like apt-transport-tor does to https – most of the diff being s#https#tor#g which then fails to do the full circle fallthrough tor -> https -> http for https sources. With this config infrastructure this could be implemented now.
* test: Pass -maxdepth 1 when running find in methods dirJulian Andres Klode2016-08-061-1/+1
| | | | | This fixes a test failures in the cmake branch which contains sub directories in the methods output dir.
* tests: support spaces in path and TMPDIRDavid Kalnischkies2015-12-191-2/+2
| | | | | | | This doesn't allow all tests to run cleanly, but it at least allows to write tests which could run successfully in such environments. Git-Dch: Ignore
* use @CHANGEPATH@ as placeholder in changelog URI templatesDavid Kalnischkies2015-12-021-1/+1
| | | | | | | | | This should make it more obvious that CHANGEPATH is a placeholder which apt will replace with a package specific path rather than a string constant. Mail-Reference: <87d1upgvaf.fsf@deep-thought.43-1.org> Mail-Archive: https://lists.debian.org/debian-dak/2015/12/msg00005.html
* tests: use quiet level 0 by default in testsDavid Kalnischkies2015-11-191-1/+1
| | | | Git-Dch: Ignore
* tests: don't use hardcoded port for http and httpsDavid Kalnischkies2015-09-151-9/+8
| | | | | | This allows running tests in parallel. Git-Dch: Ignore
* tests: try to support spaces in TMPDIRDavid Kalnischkies2015-09-141-6/+9
| | | | | | | | Not all tests work yet, most notable the cdrom tests, but those require changes in libapt itself to have a proper fix and what we have fixed so far is good enough progress for now. Git-Dch: Ignore
* condense parallel requests with the same hashes to oneDavid Kalnischkies2015-06-151-13/+9
| | | | | | | | | | | | | It shouldn't be too common, but sometimes people have multiple mirrors in the sources or otherwise repositories with the same content. Now that we gracefully can handle multiple requests to the same URI, we can also fold multiple requests with the same expected hashes into one. Note that this isn't trying to find oppertunities for merging, but just merges if it happens to encounter the oppertunity for it. This is most obvious in the new testcase actually as it needs to delay the action to give the acquire system enough time to figure out that they can be merged.
* provide a public interface for acquiring changelogsDavid Kalnischkies2015-06-151-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Provided is a specialized acquire item which given a version can figure out the correct URI to try by itself and if not provides an error message alongside with static methods to get just the URI it would try to download if it should just be displayed or similar such. The URI is constructed as follows: Release files can provide an URI template in the "Changelogs" field, otherwise we lookup a configuration item based on the "Label" or "Origin" of the Release file to get a (hopefully known) default value for now. This template should contain the string CHANGEPATH which is replaced with the information about the version we want the changelog for (e.g. main/a/apt/apt_1.1). This middleway was choosen as this path part was consistent over the three known implementations (+1 defunct), while the rest of the URI varies widely between them. The benefit of this construct is that it is now easy to get changelogs for Debian packages on Ubuntu and vice versa – even at the moment where the Changelogs field is present nowhere. Strictly better than what apt-get had before as it would even fail to get changelogs from security… Now it will notice that security identifies as Origin: Debian and pick this setting (assuming again that no Changelogs field exists). If on the other hand security would ship its changelogs in a different location we could set it via the Label option overruling Origin. Closes: 687147, 739854, 784027, 787190
* test exitcode as well as string equalityDavid Kalnischkies2015-03-161-2/+2
| | | | | | | | We use test{success,failure} now all over the place in the framework, so its only consequencial to do this in the situations in which we test for a specific output as well. Git-Dch: Ignore
* tests: enhance output of grep and test failsDavid Kalnischkies2014-10-261-1/+1
| | | | Git-Dch: Ignore
* chown finished partial files earlierDavid Kalnischkies2014-10-231-7/+5
| | | | | | | | | | | | | | | | | partial files are chowned by the Item baseclass to let the methods work with them. Now, this baseclass is also responsible for chowning the files back to root instead of having various deeper levels do this. The consequence is that all overloaded Failed() methods now call the Item::Failed base as their first step. The same is done for Done(). The effect is that even in partial files usually don't belong to _apt anymore, helping sneakernets and reducing possibilities of a bad method modifying files not belonging to them. The change is supported by the framework not only supporting being run as root, but with proper permission management, too, so that privilege dropping can be tested with them.
* testcases runable as rootDavid Kalnischkies2014-10-151-1/+7
| | | | | | | Running the testcases is usually not a good idea, but it can be handy to check if the privilege dropping works. Git-Dch: Ignore
* Use Acquire::Allow{InsecureRepositories,DowngradeToInsecureRepositories}Michael Vogt2014-10-011-1/+1
| | | | | | | | | | | The configuration key Acquire::AllowInsecureRepositories controls if apt allows loading of unsigned repositories at all. The configuration Acquire::AllowDowngradeToInsecureRepositories controls if a signed repository can ever become unsigned. This should really never be needed but we provide it to avoid having to mess around in /var/lib/apt/lists if there is a use-case for this (which I can't think of right now).
* test fixesMichael Vogt2014-09-261-1/+1
|
* add a testcase to check for forbidden https→http downgradesDavid Kalnischkies2014-02-141-1/+11
| | | | Git-Dch: Ignore
* honor option to disable pulses for the testcasesDavid Kalnischkies2014-02-141-1/+2
| | | | Git-Dch: Ignore
* disable https->http redirects in libcurlMichael Vogt2014-02-141-1/+1
| | | | This change prevents changing the protocol from https to http.
* allow http protocol to switch to httpsDavid Kalnischkies2014-02-141-0/+52
switch protocols at random is a bad idea if e.g. http can switch to file, so we limit the possibilities to http to http and http to https. As very few people (less than 1% according to popcon) have https installed this likely changes nothing in terms of failure. The commit is adding a friendly hint which package needs to be installed though.