Commit graph

669 commits

Author SHA1 Message Date
Miklos Vajna
1ff7f2704b unit-crash: avoid socket deletion before _socketPoll completes the async shutdown
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ibb9f7d7681d502d06de92c2f5d8305c3f27a76c0
2021-04-22 09:55:03 +02:00
Miklos Vajna
e56e8ec30c test: tolerate missing minor core version
ProductVersion used to be "6.4" with core.git distro/collabora/cp-6.4,
but core.git distro/collabora/co-2021 sets it to just "2021".

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I08c1204c42bba21c8036975138e3d999b7357bdf
2021-04-19 11:20:45 +02:00
Michael Meeks
2fcc5451d7 Avoid errno == ERANGE poisoning numerical conversions.
Change-Id: I0156310257caf7c578fb273393566a0970b3bb1f
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2021-04-16 22:43:17 +01:00
Ashod Nakashian
37e6ed0a51 wsd: test: dump clipboard state in test to the log
Change-Id: I337703d899ef6e85a9a0960d4cce8c174fc2f2f6
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-12 09:06:38 -04:00
Ashod Nakashian
bf64465b4e wsd: test: killpoco in tile cache test
Change-Id: I0ad05b5b496c8b184b3bc4bd9c7b9e7167e26fc3
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-12 09:06:38 -04:00
Ashod Nakashian
ad52aea7ba wsd: test: killpoco in crashtest
Change-Id: Iad87dcb6c25271df75a5b397bb94bb1aecfc7d38
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-12 09:06:38 -04:00
Ashod Nakashian
4333845728 wsd: test: killpoco in httpwstest
Change-Id: Ief228862d882ae96650708e30442693cc127f0c9
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-12 09:06:38 -04:00
Ashod Nakashian
0b6eec8234 wsd: test: killpoco in httpwstest
Change-Id: Ief228862d882ae96650708e30442693cc127f0c9
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-11 18:43:36 -04:00
Ashod Nakashian
92fa2fd081 wsd: test: improved UnitLoad test
Change-Id: I231b20793f4bb10f7560d0d59e345021062567c0
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-11 18:43:36 -04:00
Ashod Nakashian
7a997afb5a wsd: test: WebSocketSession helper
Change-Id: I472282af94797ac59c6752bfd784c72012bec84f
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-11 18:43:36 -04:00
Ashod Nakashian
da28578087 wsd: test: fixup helpers
Change-Id: I0ab30977bc7bf6556665c41a92d7dd586d519e50
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-11 18:43:36 -04:00
Ashod Nakashian
849b744896 wsd: test: more parallel test execution and simpler Makefile
Change-Id: Ieacbfe9bedd90a7b1f55dac84d3fdffa22918e1b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-11 10:04:01 -04:00
Ashod Nakashian
cff7841e65 wsd: test: log more in UnitHTTP
Change-Id: I6418ed43a177ecbf702ce388df749274ac290460
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-11 01:05:20 -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
3a07b60b40 wsd: test: helpers for http::WebSocketSession in tests
Change-Id: I4c34add289160b3ff9af9f0f3d8cddecfffd1031
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-11 01:05:20 -04:00
Ashod Nakashian
f94886fbe5 wsd: test: use WebSocketSession in UnitLoadTorture
Change-Id: I85f5df232d550bb6a6aafaa48fac512fd92fce84
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-11 01:05:20 -04:00
Ashod Nakashian
fecf32d872 wsd: test: use WebSocketSession::create in unit test
Change-Id: Ib4aecd163237220f80ff9e169c4a463ef2c08983
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-11 01:05:20 -04:00
Ashod Nakashian
eb2424feb9 wsd: WebSocketSession create helper and shutdown member
Change-Id: I1cdf3f4f763a66972c9c84cec6a80f380ebcc2db
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-11 01:05:20 -04:00
Ashod Nakashian
7b2a0da05b wsd: WebSocketSession handshake and wait for message
With improved test.

Change-Id: I137a35195a81a4d2fbf530be3805e5350cb78644
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-11 01:05:20 -04:00
Ashod Nakashian
4c759357d7 wsd: test: new document-load test with WebSocketSession
Change-Id: I6253091a9fc20fce6b263d0e62a137e5de942671
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-11 01:05:20 -04:00
Ashod Nakashian
f791e5bab6 wsd: test: new WebSocket load Test using http::Request
Change-Id: I4a7c854c14d17f87bb319f516d8f428749b137b4
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-11 01:05:20 -04:00
Ashod Nakashian
84798e0b04 wsd: test: unit-http is part of group0
This was accidentally removed. However,
we do want to remove this grouping logic
so that the tests execute faster.
Unfortunately, without the grouping some
tests fail randomly. Specifically, UnitHTTP
had an implicit dependency on the jail temp
to be created before it ran, lest it failed.
This is now fixed in the previous commit,
which paves the way to removing the grouping.

Change-Id: If18f7faf8ed0677b718db48781b387c7b37d6b0b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-11 01:05:20 -04:00
Ashod Nakashian
0459ca4a1e wsd: test: convert cerr to proper logging in UnitHTTP
Change-Id: I0fc59375d92a0947f7e3478438f4d6b30c7bde65
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-07 11:36:10 -04:00
Ashod Nakashian
050e142260 killpoco: use http::Request in UnitHosting
Change-Id: I6ac23d18496735994b4059923a667cdce07c4db5
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-07 11:36:10 -04:00
Ashod Nakashian
94325c8319 killpoco: use http::Request in HTTPServerTest
Change-Id: I6e0afedf971dc6a5e4d4396ea9ab9fbcb96aa858
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-07 11:36:10 -04:00
Ashod Nakashian
41275f0423 wsd: http: new syncRequest with timeout and new helper
Change-Id: I64a5d6f0984b9f35fe0224683527d80cf77fff99
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-07 11:36:10 -04:00
Ashod Nakashian
9d5f8fc73e wsd: http: improved parseUri and new parseUrl with tests
Change-Id: Icee821ab6176d17e08bfc6bc581eaf4b3986da60
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-07 11:36:10 -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
29b4866dcd killpoco: use http::Request in UnitHosting
Change-Id: I4455ad24d9ac3c2e2d6f22f402649b187ef2ff23
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-07 11:36:10 -04:00
Ashod Nakashian
455a71ab9c wsd: test: http: more parseUri tests
Change-Id: I85fc927a0d27bb774570ff8d04c009d02ca6cd83
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
9a2acf2558 wsd: test: better loggin in UnitCopyPaste
Change-Id: Idf684249b87b9b73d21fd6ee101364bf49ae7a5d
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-07 11:36:10 -04:00
Ashod Nakashian
f74234a354 wsd: test: log before asserting
Change-Id: Ic6769159a5f91bd59ccca578f1e80a880b6de344
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-07 11:36:10 -04:00
Ashod Nakashian
885b5ab0b7 wsd: test new unit-httplib test for http tests
Change-Id: Id22a83620a2ef6543d27f7426d79d78d093168ba
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-07 11:36:10 -04:00
Dennis Francis
ac6ba02ade test: calc has 0-alpha empty tiles which are not black
A black tile pixel is 0xff000000 (alpha channel must be 255) should not
be confused with empty Calc tile pixels whose alpha is 0. This is true
since we disabled grid+background painting in core and do it in client
canvas.

Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: I94eac4748f28a4d9a01c4a3b73b71f2ce7efc5ea
2021-04-07 13:59:06 +05:30
Miklos Vajna
f38e0db765 test helpers: fix -Werror,-Wreturn-type
./test/helpers.hpp:211:1: error: non-void function does not return a value in all control paths [-Werror,-Wreturn-type]

Perhaps it could go further and even call LOK_ASSERT_FAIL().

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I4f68f6d290bcb0a832ea71153d5f699d5366def9
2021-04-07 10:27:07 +02:00
Ashod Nakashian
e2253257ef wsd: test: http: use Response in the test server
Change-Id: I6e4960d11fc11c509c858cdcb0e68c3ba629da58
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-03 19:57:03 -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
bfc877546b wsd: test: http: echo server
The server, upon request via /echo URL,
returns in the body of the response whatever
is sent in the URL past the "/echo/" prefix.

And use socket::flush() where possible.

Change-Id: Idbb9b70cde69b9030f3f7768185f7ecf0ea321fd
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-03 19:57:03 -04:00
Ashod Nakashian
bf13f90a3a wsd: test: http: more mature http test server
Change-Id: I1ee85847da6c58922c220b7d6cdf675d8e8e4f81
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-03 19:57:03 -04:00
Ashod Nakashian
8e81559b50 wsd: test: http: use Response instead of crafting strings
Change-Id: Ia072d34d7ea309d1d50782710c70a9539c95a777
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-03 19:57:03 -04:00
Ashod Nakashian
ea7376df34 wsd: test: http: simplify http test server
Change-Id: I41b025bfa7bbc127f844a202c2047624ea40aa2d
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
4d413af916 wsd: test: http: improve http test server
Change-Id: Id1e19b857d9c82f953746dbfbcd1a19c7f3cc792
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
8638970918 wsd: test: retry poco requests and check body
Change-Id: I42c59208f5df8cba039f8fe96e134787ab5a1ca0
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-03 19:57:03 -04:00
Ashod Nakashian
6e75fca0b1 wsd: test: http: add HttpTestServer
To be used as a loopback http test server.

Change-Id: Ifb6109f9d49d8cedb8e8502fed8bf426898201a2
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
f3b151132c wsd: test: use chrono for readable and safe time durations
Change-Id: I0e1b380af4cff8e364564d287c8291b206622f38
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-02 13:18:41 -04:00