summaryrefslogtreecommitdiff
path: root/test/integration/framework
Commit message (Collapse)AuthorAgeFilesLines
* merge debian/sid into debian/experimentalDavid Kalnischkies2015-03-161-3/+2
|\
| * 128 KiB DSC files ought to be enough for everyoneDavid Kalnischkies2015-01-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Your mileage may vary, but don't worry: There is more than one way to do it, but our one size fits all is not a bigger hammer, but an entire roundhouse kick! So brace yourself for the tl;dr: The limit is gone.* Beware: This fixes also the problem that a double newline is unconditionally added 'later' which is an overcommitment in case the dsc filesize is limit-2 <= x <= limit. * limited to numbers fitting into an unsigned long long. Closes: 774893
| * always run 'dpkg --configure -a' at the end of our dpkg callingsDavid Kalnischkies2014-12-231-13/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dpkg checks now for dependencies before running triggers, so that packages can now end up in trigger states (especially those we are not touching at all with our calls) after apt is done running. The solution to this is trivial: Just tell dpkg to configure everything after we have (supposely) configured everything already. In the worst case this means dpkg will have to run a bunch of triggers, usually it will just do nothing though. The code to make this happen was already available, so we just flip a config option here to cause it to be run. This way we can keep pretending that triggers are an implementation detail of dpkg. --triggers-only would supposely work as well, but --configure is more robust in regards to future changes to dpkg and something we will hopefully make use of in future versions anyway (as it was planed at the time this and related options were implemented). Note that dpkg currently has a workaround implemented to allow upgrades to jessie to be clean, so that the test works before and after. Also note that test (compared to the one in the bug) drops the await test as its is considered a loop by dpkg now. Closes: 769609
| * do not make PTY slave the controlling terminalDavid Kalnischkies2014-12-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we have no controlling terminal opening a terminal will make this terminal our controller, which is a serious problem if this happens to be the pseudo terminal we created to run dpkg in as we will close this terminal at the end hanging ourself up in the process… The offending open is the one we do to have at least one slave fd open all the time, but for good measure, we apply the flag also to the slave fd opening in the child process as we set the controlling terminal explicitely here. This is a regression from 150bdc9ca5d656f9fba94d37c5f4f183b02bd746 with the slight twist that this usecase was silently broken before in that it wasn't logging the output in term.log (as a pseudo terminal wasn't created). Closes: 772641
| * dispose http(s) 416 error page as non-contentDavid Kalnischkies2014-12-221-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Real webservers (like apache) actually send an error page with a 416 response, but our client didn't expect it leaving the page on the socket to be parsed as response for the next request (http) or as file content (https), which isn't what we want at all… Symptom is a "Bad header line" as html usually doesn't parse that well to an http-header. This manifests itself e.g. if we have a complete file (or larger) in partial/ which isn't discarded by If-Range as the server doesn't support it (or it is just newer, think: mirror rotation). It is a sort-of regression of 78c72d0ce22e00b194251445aae306df357d5c1a, which removed the filesize - 1 trick, but this had its own problems… To properly test this our webserver gains the ability to reply with transfer-encoding: chunked as most real webservers will use it to send the dynamically generated error pages. (The tests and their binary helpers had to be slightly modified to apply, but the patch to fix the issue itself is unchanged.) Closes: 768797
| * close leaking slave fd after setting up pty magicDavid Kalnischkies2014-11-281-14/+64
| | | | | | | | | | | | | | The fd moves out of scope here anyway, so we should close it properly instead of leaking it which will tickle down to dpkg maintainer scripts. Closes: 767774
* | rework dpkg-wrapping in test frameworkDavid Kalnischkies2015-03-081-19/+25
| | | | | | | | | | | | | | | | We are able to run maintainer scripts if needed before, but we need to set ADMINDIR to be able to call dpkg tools like dpkg-trigger inside of them. Git-Dch: Ignore
* | dispose http(s) 416 error page as non-contentDavid Kalnischkies2014-12-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Real webservers (like apache) actually send an error page with a 416 response, but our client didn't expect it leaving the page on the socket to be parsed as response for the next request (http) or as file content (https), which isn't what we want at all… Symptom is a "Bad header line" as html usually doesn't parse that well to an http-header. This manifests itself e.g. if we have a complete file (or larger) in partial/ which isn't discarded by If-Range as the server doesn't support it (or it is just newer, think: mirror rotation). It is a sort-of regression of 78c72d0ce22e00b194251445aae306df357d5c1a, which removed the filesize - 1 trick, but this had its own problems… To properly test this our webserver gains the ability to reply with transfer-encoding: chunked as most real webservers will use it to send the dynamically generated error pages. Closes: 768797
* | always run 'dpkg --configure -a' at the end of our dpkg callingsDavid Kalnischkies2014-12-071-13/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dpkg checks now for dependencies before running triggers, so that packages can now end up in trigger states (especially those we are not touching at all with our calls) after apt is done running. The solution to this is trivial: Just tell dpkg to configure everything after we have (supposely) configured everything already. In the worst case this means dpkg will have to run a bunch of triggers, usually it will just do nothing though. The code to make this happen was already available, so we just flip a config option here to cause it to be run. This way we can keep pretending that triggers are an implementation detail of dpkg. --triggers-only would supposely work as well, but --configure is more robust in regards to future changes to dpkg and something we will hopefully make use of in future versions anyway (as it was planed at the time this and related options were implemented). Closes: 769609
* | correct architecture detection for 'rc' packages for purgeDavid Kalnischkies2014-12-071-6/+18
| | | | | | | | | | | | | | | | | | We were already considering these cases, but the code was flawed, so that packages changing architectures are incorrectly handled and hence the wrong architecture is used to call dpkg with, so that dpkg says the package isn't installed (which it isn't for the requested architecture). Closes: 770898
* | close leaking slave fd after setting up pty magicDavid Kalnischkies2014-11-181-13/+58
| | | | | | | | | | | | | | The fd moves out of scope here anyway, so we should close it properly instead of leaking it which will tickle down to dpkg maintainer scripts. Closes: 767774
* | fix file ownership tests to work on kfreebsdDavid Kalnischkies2014-11-181-3/+11
| | | | | | | | | | | | While on linux files are created in /tmp with $USER:$USER, on my kfreebsd testmachine they are created with $USER:root, so we pull some strings here to make it work on both.
* | create our cache and lib directory always with mode 755David Kalnischkies2014-11-181-2/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | We autocreate for a while now the last two directories in /var/lib/apt/lists (similar for /var/cache/apt/archives) which is very nice for systems having any of those on tmpfs or other non-persistent storage. This also means though that this creation is effected by the default umask, so for people with aggressive umasks like 027 the directories will be created with 750, which means all non-root users are left out, which is usually exactly what we want then this umask is set, but the cache and lib directories contain public knowledge. There isn't any need to protect them from viewers and they render apt completely useless if not readable.
* | various small additional tests and testcasesDavid Kalnischkies2014-11-181-1/+1
| | | | | | | | | | | | | | | | | | Usually they don't provide a lot in terms of what they test, but they help in covering many lines from strictly anecdotal commands (stats, moo) and error messages, so that stuff which really needs to be tested, but isn't is better visible in coverage reports. Git-Dch: Ignore
* | disable the lock disabling in the testsDavid Kalnischkies2014-11-091-2/+1
| | | | | | | | | | | | | | We create our own directories here and work without root in them, so we can also test the locking with them as it is how we usually operate. Git-Dch: Ignore
* | enhance apt-extracttemplates testDavid Kalnischkies2014-11-091-0/+1
| | | | | | | | | | | | | | | | | | The tool checks for debconf version before printing the info it extracts, so that it doesn't extract data which can't be interpreted before debconf is upgraded. It is only fair to check for this behaviour in the tests. Git-Dch: Ignore
* | streamline display of --help in all toolsDavid Kalnischkies2014-11-091-0/+2
| | | | | | | | | | | | | | By convention, if I run a tool with --help or --version I expect it to exit successfully with the usage, while if I do call it wrong (like without any parameters) I expect the usage message shown with a non-zero exit.
* | tests: enhance output of grep and test failsDavid Kalnischkies2014-10-261-27/+45
| | | | | | | | Git-Dch: Ignore
* | tests: support 'installed' release in insertpackageDavid Kalnischkies2014-10-231-22/+28
| | | | | | | | | | | | | | | | | | | | It is sometimes handy to have an installed package also in the archive, but this was until now harder than it should as you had to duplicate the lines, which is especially dangerous while writing the tests as it easily happens that these two lines divert and so the same-but-different version detection kicks in. Git-Dch: Ignore
* | switch tests to Translation-en usageDavid Kalnischkies2014-10-231-4/+10
| | | | | | | | | | | | | | | | We can use either and some tests exercise this, but the default should be what we want to use and that is a split out long description file which is properly mentioned in the Release file. Git-Dch: Ignore
* | add test for Basic Authentication schemeDavid Kalnischkies2014-10-231-10/+21
| | | | | | | | Git-Dch: Ignore
* | chown finished partial files earlierDavid Kalnischkies2014-10-231-14/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | test if TMPDIR is accessible before usingDavid Kalnischkies2014-10-201-0/+4
| | | | | | | | | | | | | | | | | | | | Private temporary directories as created by e.g. libpam-tmpdir are nice, but they are also very effective in preventing our priviledge dropping to work as TMPDIR will be set to a directory only root has access to, so working with it as _apt will fail. We circumvent this by extending our check for a usable TMPDIR setting by checking access rights. Closes: 765951
* | testcases: do not allow warnings in testsuccessDavid Kalnischkies2014-10-201-2/+32
| | | | | | | | | | | | | | | | | | | | Adds a new testwarning which tests for zero exit and the presents of a warning in the output, failing if either is not the case or if an error is found, too. This allows us to change testsuccess to accept only totally successful executions (= without warnings) which should help finding regressions. Git-Dch: Ignore
* | check for failure message in testsuccess/failureDavid Kalnischkies2014-10-201-4/+25
| | | | | | | | | | | | | | | | These functions check the exit code of the command, but for apt commands we can go further and require an error message for non-zero exits and none for zero exits. Git-Dch: Ignore
* | check lists/ content in tests doing rollbackDavid Kalnischkies2014-10-201-0/+9
| | | | | | | | Git-Dch: Ignore
* | autorun permission tests for all apt-get update callsDavid Kalnischkies2014-10-201-3/+39
| | | | | | | | | | | | | | | | Adds some infrastructure to run tests automatically for certain commands. The first command being 'apt-get update' (and 'apt update') which check for correct permission and owner of the files in lists/. Git-Dch: Ignore
* | aborted reverify restores file owner and permissionDavid Kalnischkies2014-10-201-22/+32
| | | | | | | | | | | | | | | | | | | | If we get an IMS hit for an InRelease file we use the file we already have and pass it into reverification, but this changes the permissions and on abort of the transaction they weren't switched back. This is now done, additionally, every file in partial which hasn't failed gets permission and owner changed for root access as well, as it is very well possible that the next invocation will (re)use these files.
* | testcases runable as rootDavid Kalnischkies2014-10-151-5/+26
| | | | | | | | | | | | | | Running the testcases is usually not a good idea, but it can be handy to check if the privilege dropping works. Git-Dch: Ignore
* | Add new configallowinsecurerepositories to the test frameworkMichael Vogt2014-10-141-0/+9
| | | | | | | | | | | | | | Add a new configallowinsecurerepositories that controls the value of Acquire::AllowInsecureRepositories for the tests. Set it to "false" for most of the testsuite and only enable it where its really needed. We want to switch the default for this post-jessie.
* | fix compile and tests errorDavid Kalnischkies2014-10-131-1/+1
| | | | | | | | | | | | I am pretty sure I did that before committing broken stuff… Git-Dch: Ignore
* | trusted=yes sources are secure, we just don't know whyDavid Kalnischkies2014-10-131-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not require a special flag to be present to update trusted=yes sources as this flag in the sources.list is obviously special enough. Note that this is just disabling the error message, the user will still be warned about all the (possible) failures the repository generated, it is just triggering the acceptance of the warnings on a source-by-source level. Similarily, the trusted=no flag doesn't require the user to pass additional flags to update, if the repository looks fine in the view of apt it will update just fine. The unauthenticated warnings will "just" be presented then the data is used. In case you wonder: Both was the behavior in previous versions, too.
* | do not show IP in output of testcasesDavid Kalnischkies2014-10-071-0/+3
| | | | | | | | | | | | | | | | | | On travis-ci connect.cc detects a rotation, triggering it store the IP which is later appended to the error message, which is all nice and great if we deal with a real server, but in the testcases it just triggers failures as strings do not match. Git-Dch: Ignore
* | don't show ErrorText for Ign by defaultDavid Kalnischkies2014-10-071-1/+5
| | | | | | | | | | | | | | | | Some distributions (or repositories) do not have as much "Ign-discipline" as I would like to, so that could be pretty distracting for our users if enabled by default. It is handy for testcases though. Git-Dch: Ignore
* | Merge remote-tracking branch 'upstream/debian/experimental' into ↵Michael Vogt2014-10-071-0/+3
|\ \ | | | | | | | | | | | | | | | | | | feature/acq-trans Conflicts: apt-pkg/acquire-item.cc
* | | display errortext for all Err as well as Ign logsDavid Kalnischkies2014-10-071-4/+9
| | | | | | | | | | | | | | | | | | | | | consistently using Item::Failed in all specializec classes helps setting up some information bits otherwise unset, so some errors had an empty reason as an error. Ign is upgraded to display the error message we ignored to further help in understanding what happens.
* | | use _apt:root only for partial directoriesDavid Kalnischkies2014-10-071-5/+17
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using a different user for calling methods is intended to protect us from methods running amok (via remotely exploited bugs) by limiting what can be done by them. By using root:root for the final directories and just have the files in partial writeable by the methods we enhance this in sofar as a method can't modify already verified data in its parent directory anymore. As a side effect, this also clears most of the problems you could have if the final directories are shared without user-sharing or if these directories disappear as they are now again root owned and only the partial directories contain _apt owned files (usually none if apt isn't running) and the directory itself is autocreated with the right permissions.
* | Merge branch 'debian/sid' into debian/experimentalMichael Vogt2014-09-291-0/+30
|\| | | | | | | | | Conflicts: apt-pkg/acquire-item.cc
| * rewrite compressed indexes test to check with all compressorsDavid Kalnischkies2014-09-251-0/+30
| | | | | | | | Git-Dch: Ignore
* | add --readonly option for apt-key advDavid Kalnischkies2014-09-271-2/+2
| | | | | | | | | | | | | | | | Some advanced commands can be executed without the keyring being modified like --verify, so this adds an option to disable the mergeback and uses it for our gpg calling code. Git-Dch: Ignore
* | add --secret-keyring option for apt-keyDavid Kalnischkies2014-09-271-3/+3
| | | | | | | | | | | | | | | | | | For some advanced usecases it might be handy to specify the secret keyring to be used (e.g. as it is used in the testcases), but specifying it via a normal option for gnupg might not be available forever: http://lists.gnupg.org/pipermail/gnupg-users/2013-August/047180.html Git-Dch: Ignore
* | use apt-key to wrap gpg calls in testcasesDavid Kalnischkies2014-09-271-31/+9
| | | | | | | | | | | | | | beside testing apt-key a bit it also avoids duplicating gpghome setup code in apt-key and the test framework Git-Dch: Ignore
* | use apt-key adv (+ gnupg) instead of gpgv for verifyDavid Kalnischkies2014-09-271-0/+1
| | | | | | | | | | | | | | | | apt-key does the keyring merge as we need it, so we just call it instead of reimplementing it to do the merging before gpgv. This means we don't use gpgv anymore (we never depended on it explicitly - bad style), but it also means that the message in apt-cdrom add is a bit less friendly as it says loudly "untrusted key", but for a one-time command its okay.
* | Merge branch 'debian/sid' into debian/experimentalMichael Vogt2014-09-231-2/+8
|\| | | | | | | | | | | | | | | | | Conflicts: apt-pkg/acquire-item.cc apt-pkg/acquire-item.h apt-pkg/cachefilter.h configure.ac debian/changelog
| * detect terminal output with 'test -t' in testsDavid Kalnischkies2014-09-071-1/+1
| | | | | | | | | | | | | | | | Instead of trying to inspect /proc and the fds inside we use "test -t 1" instead as this is available and working on kfreebsd as well – not that something breaks if we wouldn't, but we like color. Git-Dch: Ignore
| * support regular expressions in 'apt search'David Kalnischkies2014-09-071-1/+7
| | | | | | | | | | apt-cache search supported this since ever and in the code for apt was a fixme indicating this should be added here as well, so here we go.
* | Merge branch 'debian/sid' into debian/experimentalMichael Vogt2014-07-081-29/+29
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: apt-pkg/deb/deblistparser.cc doc/po/apt-doc.pot doc/po/de.po doc/po/es.po doc/po/fr.po doc/po/it.po doc/po/ja.po doc/po/pl.po doc/po/pt.po doc/po/pt_BR.po po/da.po po/mr.po po/vi.po
| * use printf instead of echo in testing frameworkMichele Orrù2014-07-071-29/+29
| | | | | | | | | | | | | | | | | | The behaviour of echo "\tA\t" differs between dash/zsh which interprets the \t as tab and bash which prints it literally. Similar things happen for other escape sequences – without the -e flag. Switching to printf makes this more painless^Wportable, so that the tests are also working correctly with bash as sh. (commit message by committer, patch otherwise unmodified)
* | Merge branch 'debian/sid' into debian/experimentalMichael Vogt2014-06-181-0/+8
|\| | | | | | | | | Conflicts: debian/changelog
| * fix test-apt-ftparchive-cachedb-lp1274466 and apt-internal-solver testsMichael Vogt2014-06-111-2/+2
| |