Commit graph

33 commits

Author SHA1 Message Date
Tomaž Vajngerl
6c69202b18 fix build of HttpRequestTests when SSL is disabled
We can't test SSL when SSL is disabled.

Signed-off-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>
Change-Id: I231a3c7d32f848870e90594e2d1151d3a0911f9a
2022-04-04 10:05:19 +02:00
Ashod Nakashian
11f31b0ba4 wsd: test SSL hostname
Change-Id: I0895d90d2c9be8a76afd209446ae39cd33fa5d2e
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-04-01 10:33:55 +01:00
Ashod Nakashian
52f2600cf9 wsd: test: embue all tests with a name and unify logs
Now the remaining tests that didn't have a name
get one and the logs are unified between old-
and new-style tests. Mostly.

This makes sure that all logs and assertions
properly log the test name and make test
failures easier to debug and fix.

Change-Id: Id159ffacc81642a6ec594c5143498408adab67cf
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-02-17 18:52:48 -05:00
Ashod Nakashian
347fd43f7c wsd: chunked transfer and tests
Change-Id: I07f7f126891f4d6b5137b45bf91cbcaa11796cda
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit 866cb8f2f25e958f834adc51e2191fb60e2e85b9)
2021-09-26 17:02:01 -04:00
Ashod Nakashian
24acdaf89b wsd: throw when an invalid URL is used to create an http session
Change-Id: I2d2eb90badf4f02ec4f2e4c4071fc76b23a92928
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit c16ad4447004a72226df7761fb377014c242ea4e)
2021-09-13 09:40:09 -04:00
Ashod Nakashian
0d59630b48 wsd: killpoco: cert verification
Change-Id: Ie9bc96183d1e416ef4b9b455eefb1f9249b2f695
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-07-18 21:14:48 -04:00
Ashod Nakashian
f702c4efab wsd: support certificate verification
Change-Id: I912595f104e24dc66da9cf06bc211cb0c50c9ff0
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-07-18 21:14:48 -04:00
Ashod Nakashian
ca798b3187 wsd: test: http: inject good and bad responses
Change-Id: I000feb781f3b235cb94c6555ad3a04cbef8c7fde
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-06-13 21:57:43 -04:00
Aron Budea
9bf17cd902 Fix build with --disable-ssl
After 358b30a682.

Signed-off-by: Aron Budea <aron.budea@collabora.com>
Change-Id: I53ab88b240bde8fcd09dd916cf156dc251452b26
2021-05-04 23:35:21 +02:00
Ashod Nakashian
5f739b265e wsd: test: include fixup
GCC 6.3 isn't happy otherwise.

Change-Id: Ie95bfa6208d25eda14d6a0bf4264cf23beae9394
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-05-02 22:35:39 -04:00
Ashod Nakashian
358b30a682 wsd: test: fully enable loopback testing of http
Change-Id: Ia54f80bd76b2b7188608dd8df7947139564255dd
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-27 08:09:49 -04:00
Ashod Nakashian
786e07addf wsd: test: improve 500 GET test
This fixes a rare race-condition and thereby
improved the reliability of this test.

Change-Id: If308c6e28cd7de7a70adbfd99f6f6623ff990e5d
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-11 01:05:20 -04:00
Ashod Nakashian
2bb07adb54 wsd: http: simplify syncRequest to return Response
Since the return value of syncRequest and syncDownload
was derived from Response anyway, there is no reason
to have multiple values for callers to look at.

This simplifies the API.

Change-Id: I0f136e515dd0ef6eda84f6a7cd662b260809d2f1
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-07 11:36:10 -04:00
Ashod Nakashian
49a13798eb wsd: http: parse the host and validate
Change-Id: I3ad1bcf51d59295e411a949a714bb680ff789f34
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-07 11:36:10 -04:00
Ashod Nakashian
251f436049 wsd: test: http: loopback to echo server and random data
Change-Id: Icb57f7658aa88ff748121996187077b105a8389b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-03 19:57:03 -04:00
Ashod Nakashian
0d0dbaea79 wsd: test: http: support external regression-test server
Change-Id: I82b4ab126e85be5b414f7dac138fdb7e1780cf9a
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-03 19:57:03 -04:00
Ashod Nakashian
257f8d5753 wsd: test: http: improve GET test validation
Change-Id: I6f7b1f2180a0923b85a625d460437fbb6a05097a
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-03 19:57:03 -04:00
Ashod Nakashian
fbf42a63b9 wsd: test: http: name increase test timeout
Reduces the chance of transient timeouts
due to network issues or load.

Change-Id: I286aa0035546f0c409dddb86654256fce2eb1983
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-02 13:58:06 -04:00
Ashod Nakashian
7f8ddf0079 wsd: http: support creating http::Session from URIs
A full URI with scheme can now be used to
create http::Session instances.

Change-Id: I3e556e3e1aa247ccb93749d9bd6736a15290f442
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-02 13:58:06 -04:00
Ashod Nakashian
38f2707881 wsd: test: http: improve HttpRequestTests
Change-Id: Ideaf8f1cad492fda6eab57bcefefac861a05e28a
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-22 10:09:22 -04:00
Ashod Nakashian
5749d7457d wsd: http: improve StatusLine
And update unit-tests.

Change-Id: I29bcb8232c77d3c0c1fe316854417726671765f1
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-22 10:09:22 -04:00
Ashod Nakashian
1f978d9b50 wsd: cleanup Poco headers
Change-Id: I1eec2301576fc2f1cde40389b1f858f80b1204c0
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-22 10:09:22 -04:00
Ashod Nakashian
f7d5428f3c wsd: test: better http tests
Change-Id: I9cb6b91790951dcb20ccd6f3f4746d66aed5b72b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-22 10:09:22 -04:00
Ashod Nakashian
72e2b1ac9a wsd: http: better test assertions
Change-Id: Ifccbc6f7a85515ca1d372755df28409fa5d7a26b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-16 08:27:46 -04:00
Ashod Nakashian
78fe04a58d wsd: better http poll thread name
Change-Id: I60a4ee09fcfb1bd34b44a21253ecac78f3d6830f
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-16 08:27:46 -04:00
Ashod Nakashian
e7d336afbd wsd: test: HttpRequestTests improved
Change-Id: I143f2e172c6134a793839154e898ab3f63cf3390
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-16 08:27:46 -04:00
Ashod Nakashian
96f542a3be wsd: resuable http test helpers
Change-Id: Ib3419ad221bf957fb04d1a8112a2b1dc2ea549bd
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-03-11 09:15:40 -05:00
Ashod Nakashian
88cc2d58b6 wsd: test: http::Request with invalid host
Change-Id: I88196c38a49d7e70479ea4b1a077447560c001bd
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-02-22 14:24:36 -05:00
Ashod Nakashian
190141e942 wsd: test: disable external http regression tests
These are not needed to be executed on an ongoing
basis, only when modifying the http code.

As the external service is only used to verify
the initial implementation, it will also get
replaced with an internal (loopback) one.

Disabling for now to avoid noise when randomly
failing, due to network or other reasons.

Change-Id: I54f5203c39e48ba442313698d519b035200b41e5
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-01-29 09:09:58 -05:00
Miklos Vajna
b04f498ff4 test: avoid http status 512 and higher when interacting with poco
The last enumerator in Poco::Net::HTTPResponse::HTTPStatus is 511.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Id183916729c8d13f63fe0d6e0d7ca7e84c8afaeb
2021-01-28 16:40:00 +01:00
Ashod Nakashian
24edfa2b62 wsd: test: move HttpRequestTests to 'make check'
These tests require network setup and therefore
can be problematic for `make run`.

Change-Id: I8747a505e15edc91964b290a5476a24069b7d538
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-01-26 20:02:04 -05:00
Tamás Zolnai
227b5f64fa Fix ENABLE_SSL condition.
Signed-off-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Change-Id: I0f6a4dac4aff05be65b5a0735b5ff0c67fc4f7a0
2021-01-26 14:40:46 +01:00
Ashod Nakashian
72e9f3d2d6 wsd: asynchronous HTTP/1.1 implementation
This implements HTTP/1.1 per RFC 7230, partially.

Unit-tests are provided with documentation on usage.

This is desgined to serve as the http implementation
throughout loolwsd, for both synchronous and
asynchronous requests.

Change-Id: Iaf1b8c5fcb8cec032445e27c9f70d2fb807aa4dc
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-01-21 12:36:41 +01:00