Commit Graph

11 Commits

Author SHA1 Message Date
Alexander Larsson
0c6bb85cb6 flatpak-http: Restructure the soup http implementation
This miniminzes the soup implementation by moving it out of the
highlevel multiple-retry entry points and simplifying the
lower level part to use only one shared helper.

This will also make it easier to replace the soup specific
parts.
2022-06-16 13:49:45 +02:00
Alexander Larsson
aa6d9550c1 Merge pull request #3476 from alexlarsson/drop-p2p
Drop support p2p in favour of simpler side-loading scheme
2020-03-25 09:54:41 +01:00
Matthew Leeds
384c68d77a test-http-utils.sh: Fix a few typos 2020-03-20 15:52:50 -07:00
Alexander Larsson
b1fdf6c4ef tests: Add and use "ok" helper
This allows us to print some separators for the logs also.

tests: Convert more tests to ok helper
2020-03-20 15:37:10 +01:00
Alexander Larsson
227cde12ba tests: Redo httpd server setup
Rather than this weird shell loop with a timeout and polling we
move the httpd spawning entirely into the python code, and use
a pipe to synchronize the spawning. This way we can also use
the shell job control to properly clean up any running processes
from the test suite.

Additionally, this adds some (lame) support for token handling in the
test webserver, where you for any file foo can create a foo.need_token
containing a token that is needed for that file.
2019-10-09 14:25:44 +02:00
Alexander Larsson
2b6641575d tests: Convert all tests to python3
Python2 is pretty much dead, lets make us only use python3.
2019-10-07 11:38:24 +02:00
Alexander Larsson
5ab1b99d62 tests: Run in /tmp
These days we don't really need xattrs for the tests to run,
so move the test runs to /tmp, which brings down make check time
from 5 to 3.5 minutes on my machine.

Closes: #2170
Approved by: alexlarsson
2018-10-03 13:19:35 +00:00
Simon McVittie
3224e26b0a Make test scripts bilingual Python 2/Python 3
Signed-off-by: Simon McVittie <smcv@debian.org>
Forwarded: https://github.com/flatpak/flatpak/pull/1990

Closes: #1990
Approved by: alexlarsson
2018-08-27 10:36:28 +00:00
Simon McVittie
13fee9a9ee tests: Look for httpcache in ${test_builddir}, not PATH
For installed-tests, the installed test directory is not on the PATH.
To make this easier, put the uninstalled binary in tests/, so that
in both build-time and installed tests, it is in ${test_builddir}.

Signed-off-by: Simon McVittie <smcv@debian.org>

Closes: #1989
Approved by: alexlarsson
2018-08-27 10:26:08 +00:00
Owen W. Taylor
c4c06b7be4 Allow using a compressed cache for HTTP downloads
Add a new flag for flatpak_cache_http_uri() that adds Accept-Encoding: gzip
to the request, and if the result is returned compressed, stores the data
compressed. If the data result is return uncompressed, it's compressed.

Closes: #1910
Approved by: alexlarsson
2018-08-09 12:49:35 +00:00
Owen W. Taylor
951aed561a Add flatpak_cache_http_uri: cache downloads based on HTTP headers
Add a new function, flatpak_cache_http_uri() that when passed an URL and
a local destination location, either a) downloads the content and stores
it at the destination location, storing HTTP cache header information
like Last-Modified, Etag into user xattrs (if available) or a separate
file or b) if the downloaded content is already present, checks the
header information to decide whether the downloaded content can be used
or needs to be revalidated witha conditional request.

Tests are added that use a special case test server that adds HTTP caching
headers and reacts to them based on query parameters. A small test binary
'httpcache' is added for the tests to use.

Closes: #1910
Approved by: alexlarsson
2018-08-09 12:49:35 +00:00