summaryrefslogtreecommitdiff
path: root/test/interactive-helper
Commit message (Collapse)AuthorAgeFilesLines
* tests: don't use hardcoded port for http and httpsDavid Kalnischkies2015-09-151-3/+30
| | | | | | This allows running tests in parallel. Git-Dch: Ignore
* add c++11 override marker to overridden methodsDavid Kalnischkies2015-08-101-1/+1
| | | | | | | | | C++11 adds the 'override' specifier to mark that a method is overriding a base class method and error out if not. We hide it in the APT_OVERRIDE macro to ensure that we keep compiling in pre-c++11 standards. Reported-By: clang-modernize -add-override -override-macros Git-Dch: Ignore
* Merge branch 'debian/sid' into debian/experimentalMichael Vogt2015-05-221-3/+5
|\ | | | | | | | | | | | | | | | | Conflicts: apt-pkg/pkgcache.h debian/changelog methods/https.cc methods/server.cc test/integration/test-apt-download-progress
| * Add regression test for LP: #1445239Michael Vogt2015-05-221-0/+2
| | | | | | | | | | | | | | Add a regression test that reproduced the hang of apt when a partial file is present. Git-Dch: ignore
| * Fix endless loop in apt-get update that can cause disk fillupMichael Vogt2015-05-221-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The apt http code parses Content-Length and Content-Range. For both requests the variable "Size" is used and the semantic for this Size is the total file size. However Content-Length is not the entire file size for partital file requests. For servers that send the Content-Range header first and then the Content-Length header this can lead to globbing of Size so that its less than the real file size. This may lead to a subsequent passing of a negative number into the CircleBuf which leads to a endless loop that writes data. Thanks to Anton Blanchard for the analysis and initial patch. LP: #1445239
* | detect 416 complete file in partial by expected hashDavid Kalnischkies2015-05-121-3/+6
| | | | | | | | | | | | | | If we have the expected hashes we can check with them if the file we have in partial we got a 416 for is the expected file. We detected this with same-size before, but not every server sends a good Content-Range header with a 416 response.
* | a hit on Release files means the indexes will be hits tooDavid Kalnischkies2015-04-191-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we get a IMSHit for the Transaction-Manager (= the InRelease file or as its still supported fallback Release + Release.gpg combo) we can assume that every file we would queue based on this manager, but already have locally is current and hence would get an IMSHit, too. We therefore save us and the server the trouble and skip the queuing in this case. Beside speeding up repetative executions of 'apt-get update' this way we also avoid hitting hashsum errors if the indexes are in fact already updated, but the Release file isn't yet as it is the case on well behaving mirrors as Release files is updated last. The implementation is a bit harder than the theory makes it sound as we still have to keep reverifying the Release files (e.g. to detect now expired once to avoid an attacker being able to silently stale us) and have to handle cases in which the Release file hits, but some indexes aren't present (e.g. user added a new foreign architecture).
* | handle servers closing encoded connections correctlyDavid Kalnischkies2015-04-191-7/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Servers who advertise that they close the connection get the 'Closes' encoding flag, but this conflicts with servers who response with a transfer-encoding (e.g. encoding) as it is saved in the same flag. We have a better flag for the keep-alive (or not) of the connection anyway, so we check this instead of the encoding. This is in practice not much of a problem as real servers we talk to are HTTP1.1 servers (with keep-alive) and there isn't much point in doing chunked encoding if you are going to close anyway, but our simple testserver stumbles over this if pressed and its a bit cleaner, too. Git-Dch: Ignore
* | derive more of https from http methodDavid Kalnischkies2015-03-161-44/+44
| | | | | | | | | | | | | | | | | | Bug #778375 uncovered that https wasn't properly integrated in the class family tree of http as it was supposed to be leading to a NULL pointer dereference. Fixing this 'properly' was deemed to much diff for practically no gain that late in the release, so commit 0c2dc43d4fe1d026650b5e2920a021557f9534a6 just fixed the synptom, while this commit here is fixing the cause plus adding a test.
* | merge debian/sid into debian/experimentalDavid Kalnischkies2015-03-161-1/+2
|\|
| * dispose http(s) 416 error page as non-contentDavid Kalnischkies2014-12-221-65/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | dispose http(s) 416 error page as non-contentDavid Kalnischkies2014-12-091-71/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | promote filesize to a hashstringDavid Kalnischkies2014-10-241-1/+3
| | | | | | | | | | | | | | | | | | It is a very simple hashstring, which is why it isn't contributing to the usability of a list of them, but it is also trivial to check and calculate, so it doesn't hurt checking it either as it can combined even with the simplest other hashes greatly complicate attacks on them as you suddenly need a same-size hash collision, which is usually a lot harder to achieve.
* | add test for Basic Authentication schemeDavid Kalnischkies2014-10-231-4/+71
| | | | | | | | Git-Dch: Ignore
* | Merge branch 'debian/sid' into debian/experimentalMichael Vogt2014-05-076-37/+60
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: apt-pkg/cachefilter.h apt-pkg/contrib/fileutl.cc apt-pkg/contrib/netrc.h apt-pkg/deb/debsrcrecords.cc apt-pkg/init.h apt-pkg/pkgcache.cc debian/apt.install.in debian/changelog
| * cleanup headers and especially #includes everywhereDavid Kalnischkies2014-03-136-19/+37
| | | | | | | | | | | | | | | | Beside being a bit cleaner it hopefully also resolves oddball problems I have with high levels of parallel jobs. Git-Dch: Ignore Reported-By: iwyu (include-what-you-use)
| * warning: unused parameter ‘foo’ [-Wunused-parameter]David Kalnischkies2014-03-131-1/+6
| | | | | | | | | | Reported-By: gcc -Wunused-parameter Git-Dch: Ignore
| * warning: type qualifiers ignored on function return type [-Wignored-qualifiers]David Kalnischkies2014-03-131-1/+1
| | | | | | | | | | Reported-By: gcc -Wignored-qualifiers Git-Dch: Ignore
| * warning: no previous declaration for foobar() [-Wmissing-declarations]David Kalnischkies2014-03-133-17/+17
| | | | | | | | | | Git-Dch: Ignore Reported-By: gcc -Wmissing-declarations
* | Merge branch 'debian/sid' into debian/experimentalMichael Vogt2014-02-273-121/+344
|\| | | | | | | | | | | | | | | Conflicts: apt-private/private-list.cc configure.ac debian/apt.install.in debian/changelog
| * report https download start only if we really get itDavid Kalnischkies2014-02-141-4/+16
| | | | | | | | | | | | Reporting it via progress means that e.g. a redirect will trigger it, too, so you get a Get & Hit while http only reports a Hit as it should be.
| * correct some style/performance/warnings from cppcheckDavid Kalnischkies2014-01-161-5/+4
| | | | | | | | | | | | | | | | The most "visible" change is from utime to utimensat/futimens as the first one isn't part of POSIX anymore. Reported-By: cppcheck Git-Dch: Ignore
| * tests: add a webserverconfig method to abstract configDavid Kalnischkies2013-11-301-1/+1
| | | | | | | | | | | | | | The URI to use to set a config option is a bit arcane to write/remember and checking if the setting was successful doubly so. Git-Dch: Ignore
| * webserver: use pthreads to handle multiple clientsDavid Kalnischkies2013-11-302-163/+201
| | | | | | | | | | | | | | | | | | | | | | | | Clients like browsers prefer to open many connections and keep them open for a while, so that pages with lot of subelements would take a while to load (if at all), by using threads as all servers do some way or another we can resolve this. libapt is not intended to be pthread-safe and stuff like the storage of the last return code doesn't make too much sense if multiple clients interact with us, but it is good enough for now and an other interesting (mis)use of libapt in general. Git-Dch: Ignore
| * webserver: strip parameters from filenameDavid Kalnischkies2013-11-301-1/+9
| | | | | | | | | | | | | | Again, not (currently) used by the tests itself, but in interactive usage of the webserver itself. Git-Dch: Ignore
| * webserver: add directoryIndex support defaulting to index.htmlDavid Kalnischkies2013-11-301-3/+15
| | | | | | | | Git-Dch: Ignore
| * webserver: implement ~user access to ~user/public_html/David Kalnischkies2013-11-301-1/+25
| | | | | | | | | | | | | | pretty much useless for the testcases, but handy to test the webserver itself in 'real world' environments Git-Dch: Ignore
| * webserver: spurious newline after data confuses curlDavid Kalnischkies2013-11-301-9/+9
| | | | | | | | | | | | | | | | Webserver wrongly sends an additional newline after the data which causes curl to believe that the next request on this socket has no header data and so includes all headers in the data output. Git-Dch: Ignore
| * add Range and If-Range support in the webserverDavid Kalnischkies2013-09-301-1/+63
| | | | | | | | Git-Dch: Ignore
| * access _config via GET requests in the webserverDavid Kalnischkies2013-09-301-3/+71
| | | | | | | | Git-Dch: Ignore
* | Merge branch 'debian/sid' into debian/experimentalMichael Vogt2013-08-152-124/+175
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: apt-pkg/contrib/strutl.cc apt-pkg/deb/dpkgpm.cc configure.ac debian/changelog doc/po/apt-doc.pot po/apt-all.pot po/ar.po po/ast.po po/bg.po po/bs.po po/ca.po po/cs.po po/cy.po po/da.po po/de.po po/dz.po po/el.po po/es.po po/eu.po po/fi.po po/fr.po po/gl.po po/hu.po po/it.po po/ja.po po/km.po po/ko.po po/ku.po po/lt.po po/mr.po po/nb.po po/ne.po po/nl.po po/nn.po po/pl.po po/pt.po po/pt_BR.po po/ro.po po/ru.po po/sk.po po/sl.po po/sv.po po/th.po po/tl.po po/uk.po po/vi.po po/zh_CN.po po/zh_TW.po test/integration/framework test/integration/test-bug-602412-dequote-redirect test/integration/test-ubuntu-bug-346386-apt-get-update-paywall test/interactive-helper/aptwebserver.cc test/interactive-helper/makefile
| * request absolute URIs from proxies again (0.9.9.3 regession)David Kalnischkies2013-07-261-8/+28
| | | | | | | | | | | | | | | | Commit 2b9c9b7f28b18f6ae3e422020e8934872b06c9f3 not only removes keep-alive, but also changes the request URI send to proxies which are required to be absolute URIs rather than the usual absolute paths. Closes: 717891
| * simple fork and pidfile aptwebserverDavid Kalnischkies2013-06-241-0/+37
| | | | | | | | | | | | | | | | | | | | | | Forking only after being ready to accept clients avoids running races with the tests which sometimes failed on the first 'apt-get update' (or similar) with the previous background-start and hope for the best… The commit fixes also some oversight output-order changes in regards to Description-md5 and (I-M-S) race conditions in various tests. Git-Dch: Ignore
| * trigger NODATA error for invalid InRelease filesDavid Kalnischkies2013-06-201-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the selfgrown splitting we got the problem of not recovering from networks which just reply with invalid data like those sending us login pages to authenticate with the network (e.g. hotels) back. The good thing about the InRelease file is that we know that it must be clearsigned (a Release file might or might not have a detached sig) so if we get a file but are unable to split it something is seriously wrong, so there is not much point in trying further. The Acquire system already looks out for a NODATA error from gpgv, so this adds a new error message sent to the acquire system in case the splitting we do now ourselves failed including this magic word. Closes: #712486
| * simple URI rewrite rules config for webserverDavid Kalnischkies2013-06-201-0/+16
| | | | | | | | | | | | | | | | | | | | | | we have a test which required traditionally lighttpd to be executed as it requires a webserver supporting some kind of URI rewriting. Now with some lines of code our own webserver can do this and the testcase can be enabled by default. This test hinted at the bug fixed in the previous commit, so having more tests which can easily be run is a good thing. Git-Dch: Ignore
| * add directory listing to the webserverDavid Kalnischkies2013-06-201-0/+121
| | | | | | | | Git-Dch: Ignore
| * add a simple webserver for our testcasesDavid Kalnischkies2013-06-202-0/+350
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | APT needs to acquire data in a secure fashion over an inherently unsecure way, known as the internet, while communicating with unreliable partners, known as webservers and proxies. For your integration tests we so far relied on 'normal' webservers, but all of them have certain quirks and none is able to provide us with all quirks which can be observed in the wild and we therefore have to test with, so this webserver isn't trying to be fast, secure or feature complete, but to provide all the quirks we need in a consistent way. This webserver also makes the APT project self-contained, as it is now able to generate, serve as well as acquire package indexes. ;) Git-Dch: Ignore
| * stop building l10n if strings are unchangedDavid Kalnischkies2013-06-091-0/+1
| | | | | | | | | | | | The buildsystem tried to build l10n for test applications which never produced the output it expected causing it to try building it all the time.
* | add (partial) partial request support for the webserverDavid Kalnischkies2012-07-121-8/+63
| |
* | add option to send Content-Type based on file extensionDavid Kalnischkies2012-07-111-0/+12
| |
* | make the server a little more robust against write errors (e.g. broken pipe)David Kalnischkies2012-07-111-4/+11
| |
* | rework parsing of the first request-line to be more robustDavid Kalnischkies2012-07-111-31/+75
| |
* | add simple url rewriting to the webserverDavid Kalnischkies2012-07-111-2/+17
| |
* | ensure that directories are accessed with a slash at the end of the urlDavid Kalnischkies2012-07-111-7/+33
| |
* | http get requests need to be dequotedDavid Kalnischkies2012-07-101-0/+2
| |
* | include our usual config.h in the webserverDavid Kalnischkies2012-07-101-6/+8
| |
* | implement directory listing in your webserverDavid Kalnischkies2012-07-101-4/+91
| |
* | reformat the aptwebserver code to look more like the rest of APTDavid Kalnischkies2012-07-101-45/+44
| |
* | cleanup, thanks to donkult for his feedbackMichael Vogt2012-07-101-1/+1
| |
* | always send content-length via the new addDataHeaders() to ensure w3m/curl ↵Michael Vogt2012-07-101-12/+22
| | | | | | | | are happy too for 404 pages and to comply with the http 1.1 spec