Commit Graph

134 Commits (7268248481f598afd46bca612b0ef3ddda84b0d1)

Author SHA1 Message Date
Ashod Nakashian 7268248481 wsd: test: give up attempting to connect if the test finished
Some tests are designed to exercise the reconnection
logic. Once the test validates that the correct
reconnection logic is used, the test is considered
finished. In those cases, we need to break the
test framework's retry logic.

Change-Id: Ie0bb5dcc430a954910c2af4817a500f5b576bd4c
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-04-27 14:14:28 +02:00
Michael Meeks 1b6af5e28d killpoco: remove lots of redundant JSON includes.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I976c5b8d6763cbbf0ee5cadfa2f7335ec719fe85
2024-04-25 09:06:13 +02:00
Michael Meeks a355e9b4ee remove random static mutex guard.
Presumably originally introduced to protect the static FileDeleter,
which has internal protection of its own now; cf. commit

1ae9ce8ad2

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: Id3266d7f08a9f7bd620df49850242a250fc73903
2024-04-22 08:50:38 +01:00
Ashod Nakashian fe3c3bc135 wsd: test: move WebSocketSession under test
WebSocketSession is used exclusively for tests,
so it's best that it is located in the test
directory.

Change-Id: I88333d619902df7991c3f26b94ed309246446ae0
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-03-21 09:08:51 +00:00
Neil Guertin f82915ebcb Move kit pid helper functions to one file
Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: If77b8ac3c7493f4d44b510ec54b68292856f89d5
2024-03-09 16:36:39 +00:00
Michael Meeks 0b91bacdc8 killpoco: reduce scope and number of various includes.
Change-Id: Ic3eb409fbb11cc665f0f3a55bb7a4e59cbd28f8b
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2024-03-06 20:56:55 -05:00
Neil Guertin 8717fa6d90 Fix for unit-httpws failure
Fix race condition in testSaveOnDisconnect by waiting for kit process to
stop instead of just counting total kit processes

Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: I6bda6b114070123a1366bc04eac1873f19928ac0
2024-03-06 09:10:32 +00:00
Aron Budea ff61e2a58a C++17 Remove checks on std::filesystem
Should be fully supported on compilers now.

Except leave this workaround in place for now:
b30757417b

Signed-off-by: Aron Budea <aron.budea@collabora.com>
Change-Id: I6e19ec034b3c64e66f5bf5ff1f436f94514fabd0
2024-02-22 11:16:28 +01:00
Ashod Nakashian 0b47d8fc2a wsd: test: wait longer to load exoticlocale test
For some reason, the exoticlocale test takes
significantly longer to load. It often times
out when the CPU throttles or when it's
too loaded. Extending the timeout eliminates
the issue for me (no timeout over 175 runs).

Change-Id: I07cb099776af38206c0567f603cb6cc424eb0b93
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-02-09 15:13:40 +00:00
Caolán McNamara 5432562801 getTempFileCopyPath is only used by tests so move to test-only code
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I7c8a122425c689edb3eeb8c80e08470eac347bcc
2024-02-01 10:01:08 +00:00
Michael Meeks fa80ecd2d0 sockets should use CLOEXEC ticket cool#8016
Change-Id: I5f59ed9446a1fda301bb4791f98ca7c1c137e606
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2024-01-29 21:01:39 +00:00
Caolán McNamara 5a01a21e27 cid#336285 Dereference null return value
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Ia0506d22a928fc810110895f3b00db33e3c28c5c
2023-12-11 09:25:59 +01:00
Michael Meeks 7183a3d3de spdx: improve machine and human readability of headers.
Change-Id: Ice934380029bf27054e830fffc07a5d037d1430f
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2023-11-14 19:36:31 +00:00
Ashod Nakashian 7e1a23f47a wsd: test: helper to wait for any of the given messages
Change-Id: Ice48f59202306134dbafb411b8078f416e56b1c0
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-10-24 09:20:32 +02:00
Ashod Nakashian 692fcdc401 wsd: test: wait for 'statusindicator: find' instead of 'ready'
This returns from the connect helper sooner,
shaving some time from each connection.

Change-Id: I29e2637c16b9e2574cbfb99779551d7ae1c8c2f0
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-09-25 19:29:12 -04:00
Ashod Nakashian 75ae9894b9 wsd: Util::make_unique -> std::make_unique
Change-Id: I1063913f91571ea6ad95386a3da6a4072574d155
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-08-03 08:40:20 +02:00
Michael Meeks f41a8bed3e deltas: more unit tests for wire-id fun.
This should catch the case where one view should get an empty
update delta, and the other should get a new keyframe tile.

Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I3ad8f564cc45d80186430b463214ffcf092346f3
2023-07-18 09:43:34 +02:00
Ashod Nakashian 76ab3785c2 wsd: test: break connectLOKit when shutdown is signaled
Change-Id: Ic4869f782fe41ba2cb626ad0e4ebc6fc6a667725
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-31 07:40:11 -04:00
Ashod Nakashian 1d482cf5cf wsd: test: selectAll and deleteAll improvements
It seems we no longer always issues textselection:
message after these uno commands, so we end up
waiting and retrying for the longest time.

Change-Id: I47b15b9830585ae58e4400fcf760051506ab69dd
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2023-05-02 19:54:31 -04:00
Ashod Nakashian f396786e28 wsd: test: break connectLOKit retries when terminating
Without this, we may end up retrying a dozen times
before giving up, all when the test is complete.

This happened rarely when the test in question didn't
care to wait for the connection to finish. Such a test
exists for wopi redirections; UnitWOPIHttpRedirect.

Change-Id: Ied43119c91343be812d7c1a2be86ba8d21b4f021
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-08-02 09:24:46 -04:00
Ashod Nakashian b1ddb1aa55 wsd: test: cleanup test helpers
Change-Id: I68d43ab78fe0a4a11b07f72c9cd7aab9500398c8
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-08-02 09:24:46 -04:00
Ashod Nakashian 8fed0fed8a wsd: test: killpoco test helpers
Change-Id: Iaf2a8cf195e29b1215076733ae268422d7384f34
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-08-02 09:24:46 -04:00
Ashod Nakashian 712e40a3f9 wsd: test: replace hard-coded test timeouts
Compile-time constants are far superior
to hard-coded magic numbers and they
make changing them trivial. We need that
when we enable profiling.

Change-Id: I9ee42fabf3feb1feecb9b76ebca663007e263680
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-08-02 09:24:46 -04:00
Ashod Nakashian b972c7e0a1 wsd: test: clang-tidy some args
Change-Id: If9dcbfb2e3eab5617fee60b8f233e400e3d38916
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-08-02 09:24:46 -04:00
Ashod Nakashian ed6565502c wsd: test: killpoco for UnitCalc
We now use our http::Socket and SocketPoll
instead of Poco.

Change-Id: I2ed85129b9a58d49f19bea0b2e4f8f09b7b36f5f
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-07-25 14:02:00 +01:00
Ashod Nakashian acbf32aef5 wsd: test: killpoco for UnitRenderShape
We now use our http::Socket and SocketPoll
instead of Poco.

Change-Id: Ied70aff99ecd61571c13974d0cfb63e6ab5bda47
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-07-25 14:02:00 +01:00
Ashod Nakashian 1d96fe827a wsd: test: remove default testname arg from helpers
Change-Id: Iecbc2c1fa2a7568aedeaa0b089c3ca0a584488f5
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-07-25 14:02:00 +01:00
Ashod Nakashian 96adaa15d1 wsd: kill coolwsd_fuzzer
coolwsd_fuzzer predates actual fuzzing
with libfuzzer and is currently unsused.

Change-Id: Id095b165943ba14dbf525ddc607ad329f5d952d4
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-04-20 07:12:03 -04:00
Ashod Nakashian 480fb7b931 wsd: move tokenizer helpers into StringVector
In an attempt to reduce the size of Util.{c,h}pp
which has grown to contain all sorts of unrelated
helpers, we move StringVector helpers into
the StringVector.{c,h}pp files.

This makes the code better organized.

Change-Id: I152f341606807ae66253415b951bc9f89b09df57
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-04-12 07:39:07 -04:00
Miklos Vajna b04bb490f1 test: increase buffer size in SocketProcessor()
The webframe buffer size used to be READ_BUFFER_SIZE (64k), but that's
no longer enough in unit-uno-command since
<a20e761cb1>
(jsdialog: fix toolboxes with children, 2022-03-17) if you have enough
fonts installed locally, because one toolbox in Writer is the font
dropdown, and that lists all the fonts you have.

getResponseMessage() already uses this increased buffer size, so this
also improves consistency.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ic2ad0e8e7443365395b16618d6c82465252ba455
2022-04-08 08:22:05 +02:00
Michael Meeks 8c6720cb5a Unit test for &lang=es-419 style code, disliked by boost gettext.
Change-Id: I2f1c39d03d61ef2074fe6e946a79fc2f07ffd27b
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-03-02 16:26:36 +00: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 74cf0857d9 wsd: test: CPPUNIT_ASSERT -> LOK_ASSERT
Reduce direct dependency on CPPUNIT further.

Change-Id: I9ca39c20a9c64f983aed1a6488446e0b7f21cffe
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-02-17 18:52:48 -05:00
Ashod Nakashian bbcbaaf9cf wsd: test: kill poco in pasteBlank
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit ccf61dc1e9)

Change-Id: Id5f544ca074590a7edffde57b1bdb865a7baba01
2022-01-11 09:28:03 +01:00
Andras Timar f07ff8c7e0 rename: remaining lool->cool changes
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: Ib7d4e804bebe52dead8d53b0e0bbaed0f08bf3d0
2021-11-18 14:14:11 +01:00
Andras Timar de3e09fde0 rename wsd protocol command 'loolclient' to 'coolclient'
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I506fe74bc5ebf183ed21721b40a45210373abf06
2021-11-17 11:59:35 +01:00
Henry Castro 85ba63ddce misc: more renames 'lool' -> 'cool'
Change-Id: Ic9fbae88d92921b9081e7067347852e385f45af3
Signed-off-by: Henry Castro <hcastro@collabora.com>
2021-11-17 09:17:46 +01:00
Henry Castro dc1bca91cf test: rename 'lool' -> 'cool'
Change-Id: I26acf7d9d7bc154b5b06aec9bc062e206cbffc52
Signed-off-by: Henry Castro <hcastro@collabora.com>
2021-11-17 09:17:16 +01:00
Miklos Vajna b148f15f40 test: fix sanitizers detection
The old code worked for "gcc -fsanitize=address", but the sanitizers
tinderbox builds with "clang -fsanitize=address".

Follow-up to commit f67b8901dd (test:
double the timeout in isDocumentLoaded() for sanitizers, 2021-11-03).

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I4b802ec0d3d20516e3d58cc1c65d7e1422632b2b
2021-11-09 08:23:45 +01:00
Miklos Vajna f67b8901dd test: double the timeout in isDocumentLoaded() for sanitizers
Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I8627f16fb7ad67561312d3053d855bab8008ab75
2021-11-03 17:19:34 +01:00
Miklos Vajna 11adfc6f05 test: log timeout limit when the document fails to load
The sanitizers tinderbox regularly times out, and it's good to know if
the timeout value is an agressive one or the load is really that slow.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I2903481ea9efde68aca3f4ec00bd6e7e2d3b840a
2021-11-02 11:25:59 +01:00
Miklos Vajna f1de84a230 test: increase timeout in isDocumentLoaded()
https://cpci.cbg.collabora.co.uk:8080/job/online-master-sanitizer/2513/console
and in general
https://cpci.cbg.collabora.co.uk:8080/job/online-master-sanitizer/
regularly fails with a timeout, allow it to actually catch real badness.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ic3862bc44d507afd34903be87f1019fc6d0e4b58
2021-10-12 11:13:26 +02:00
Michael Meeks b043b6213d Move LOOLWebSocket into test/ - where it can be slowly removed.
Change-Id: I388690261d323377648a1502b927e73f862ad802
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2021-10-11 13:40:20 +01: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 866cb8f2f2)
2021-09-26 17:02:01 -04:00
Ashod Nakashian 5a310a2232 wsd: separate client SSL context from the server
Change-Id: I4d86f733a16e6c76340b18ff836831ebe6acfd4d
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-06-23 23:39:34 -04:00
Michael Meeks 783ccd97b1 Avoid 'DEL' in random strings.
Change-Id: I5385dfd2c7cf7b7638e11191c5320d0bc4e04a48
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2021-06-22 11:02:46 +01:00
Ashod Nakashian 17cdf3766d wsd: test: improve the stability of UnitCopyPaste
The .uno:Copy command has to get executed before
we can read the clipboard. Since .uno commands
are executed asynchronously, it possible to
invoke getClipboard before having the data
copied into it, thereby failing the test.

Here we wait for the first sign that the
.uno commands have been executed, although
we can't know if they have finished or not.

This improves the test reliability significantly.

Change-Id: I7da1e4a32092c05dfb533571ea50d5edbc07f554
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-27 08:09:49 -04:00
Ashod Nakashian 5f6a717b8b wsd: test: simplify and reuse some helpers
Change-Id: I652a77523559f1dd123b56e1a776a8fc64a96bda
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-27 08:09:49 -04:00
Ashod Nakashian 1159286fb2 wsd: test: killpoco in TileCacheTests
TileCacheTests now completely uses
async WebSockets. It is both more
stable and faster (by about 20-25%).

Change-Id: I6da0fd12ddf671a7ad666561249b6fb1c5d32a01
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-27 08:09:49 -04:00
Ashod Nakashian b47c81e7a8 wsd: improved WebSocketSession interface
SocketPoll is captured as weak_ptr into
WebSocketSession and a much better shutdown
support is now available. The new logic
can do async-shutdown after flushing and
will do sync-shutdown if SocketPoll is
no longer around.

Change-Id: Ia206cab58a13f20f7aeb3a6d8c57afee731c8231
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-27 08:09:49 -04:00