Commit graph

944 commits

Author SHA1 Message Date
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
099246d67a wsd: unload when no Kit and nothing to upload
When the Kit dies and there is no data saved to
disk to upload, there is nothing to do but unload
DocBroker and log the fact.

With unit-test that simulates the situation by
killing the Kit of a modified document.

Change-Id: I7dcc0583c053d7166935d15d045fcf6624e43b4e
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-03-30 23:18:57 -04:00
Rash419
31d8822758 wsd: cleanup: moved all parsing related static methods and containers to HostUtil.cpp
Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: I8555522c6216f893b90ba4c27747314830f7abd2
2022-03-29 12:18:31 +02:00
Ashod Nakashian
fc187b9e1f wsd: test: correctly show the failing code in the assertion message
Change-Id: I99b3688398fb3667ce4e0f5050aa5ca79e2fd0d1
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-03-21 08:57:41 +00:00
Dennis Francis
3418f51ce4 test: make the test more specific
This is a follow up of feb672392 for the fix in 8af039251

Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: I6a1c754193cce4f7d11d17b9bbe1986a2b46ad86
2022-03-17 18:31:41 +05:30
Ashod Nakashian
9732689668 wsd: stop loading when low on disk space
For some reason the disk-space check wasn't
done for WOPI storage. Here we add the check
and bubble the exception up to stop loading.

UnitStorage has been updated and re-enabled.

Change-Id: I15a093554b662d6c0828da7683ca0190a8225fc9
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-03-16 08:31:54 -04:00
Ashod Nakashian
e5e67a71d7 wsd: wait longer when restarting forkit
Forkit takes significantly longer to start than
to fork. At the startup of WSD we do wait 4 times
as long for forkit than when forking kits.
Similarly, we should also wait that much when
forkit crashes and we recover.

This stabalizes the forkit crash tests, which
did fail rather frequently (in one example,
2 out of 10 runs had failed locally).

Change-Id: I990c8e595b64c34a8e202933be833c53d7ebfc01
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-03-16 08:31:54 -04:00
Rash419
d02dd19f33 wsd: use hostname, port and scheme in doc key
This allows us to use multiple hosts using same coolwsd instance.

added aliases configuration to coolwsd.xml to avoid
possibility of opening the same file as two if the
WOPI host is accessed using different aliases

Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: I32913015c15fd396cecc702b76e0dcaa8bcafad3
2022-03-16 11:32:59 +03:00
Dennis Francis
feb6723924 test: fail on subsequent error message
This is to guard against 'faileddocloading' or other error message(s)
sent after the correct 'passwordrequired:to-view' message when a
protected document is loaded without providing password.

Signed-off-by: Dennis Francis <dennis.francis@collabora.com>
Change-Id: I13b1d4a805916fc7a209464f63cb2ecf883b11c4
2022-03-14 12:56:20 +00:00
Ashod Nakashian
cfca251654 wsd: test: faster unit-test execution
All tests are now ordered to minimize
the time paralell runs take. And the
two longest-running tests are augmented
to take less time. They still take about
20x longer than the fast test, but they
do serve a purpose and we have 50+ other
tests to go through in parallel.

Total time is not much longer than the
longest test with -j8, at around 150
seconds, give or take, on an 8 core,
16 thread CPU.

Duplication in Makefile.am is reduced
with some minor clean ups.

Change-Id: I14530531485bf85d8b59e476aa933e5b2cc26c93
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-03-09 19:24:40 -05:00
Ashod Nakashian
d1a1c7fb1c wsd: test: reduce output from the test driver
Consolidate and reduce the messages printed
on stdout in the test driver, which also
makes interleaving the messages from
different tests less problematic.

Test output is more concise and cleaner now.

Change-Id: I4bb0de852a935614ebc3d9e663c5454cb10e404f
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-03-09 19:24:40 -05:00
Ashod Nakashian
a4b798c9f5 wsd: test: extend tile test timeout
Change-Id: I3ce128ca96b394e20dc6ad7b3179e786302128ca
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-03-09 19:24:40 -05:00
Ashod Nakashian
31ff5bbcac wsd: test: assert forced uploading when expected
Change-Id: I17f83a010b71fca13d325e298760c4107fb1a39a
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-03-09 19:24:40 -05:00
Ashod Nakashian
02f2860847 wsd: test: assert correct wopi GetFile and PutFile
Change-Id: I7e08d87eb382d67aed3ffaff32230e2c08d8c828
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-03-09 19:24:40 -05:00
Ashod Nakashian
e8319423b4 wsd: test: enable all conflict test scenarios
Change-Id: Ic1ae6804e90c99dfa0a8607a0d0d769a45353325
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-03-09 19:24:40 -05:00
Ashod Nakashian
b90638d436 wsd: test: ingest the doc content only when PutFile succeeds
Change-Id: I4d4accba34c2883b1cb4d6d43a40c89d2eb8a48f
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-03-09 19:24:40 -05:00
Ashod Nakashian
6b0d550b5b wsd: test: validate the number of wopi requests
We track the number of wopi requests done
during tests and compare with the expected,
in each test scenario. This ensures we don't
miss any expected/required wopi operation,
but also that we don't do more than the
necessary minimum.

Change-Id: I2474f54987a6a12c396b6c0566324772ee3300e6
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-03-09 19:24:40 -05:00
Ashod Nakashian
319685d858 wsd: test: minor cleanup of conflict tests
Change-Id: Ib56aa5fa609b76ce450fdea21f955b2130600a6a
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-03-09 19:24:40 -05:00
Ashod Nakashian
015b088d79 wsd: test: minor improvements to run_unit.sh.in
* Reduce stdout messages.
* Print the gdb command with --unattended since its
  not useful to wait for gdb when running from gdb.
* Add comment about --unattended.

Change-Id: I2d173282abd9fc842483db70e04d5706edeb5a85
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-03-09 19:24:40 -05:00
Ashod Nakashian
5312e78aaa wsd: test: modernize and improve UnitWopiOwnertermination
Change-Id: I1fc096c80faf65f47bc8177055223cb1e81a9477
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-03-09 19:24:40 -05:00
Andras Timar
fd7726b6eb fix -Werror=unused-parameter
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I38ec47a4011c27674a527f69242ebf0c333db503
2022-03-04 13:07:37 +01: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
8b0f6b30e6 wsd: test: improve test logging
Change-Id: I96adcfa091ee599bcf8fdc305801b698374e1c25
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-02-24 07:38:13 -05:00
Ashod Nakashian
9b9b8202f7 wsd: test: minor cleanup COOL test socket helpers
Change-Id: Ib9f297963bf319e01c603c7c64f632a5e5278328
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-02-24 07:38:13 -05:00
Ashod Nakashian
73c5bdf04e wsd: test: minor cleanup in UnitWOPILock
Change-Id: I945716d314b98af4dbb6dd123e1406e2e6f94db8
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-02-24 07:38:13 -05:00
Ashod Nakashian
6c1766d156 wsd: test: extend the timeout of the conflict tests
Change-Id: I4171ec923a29ee22abc4e40267949829d40fc776
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-02-24 07:38:13 -05:00
Michael Meeks
0678082db4 Detect trace replay errors & exit and cleanup traces.
Change-Id: I15c04eb9eef02f3f6002c35dc5701b7dbe9a1398
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-02-21 15:37:05 +00:00
Michael Meeks
96b15bd704 Count and report on various internal exceptions.
An initial set of seven of these, easy to add more as/when needed.

Change-Id: I6c65e052d00f9eaa10adee3c9464043e4c594848
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2022-02-18 13:51:41 +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
df98f0c4f0 wsd: test: modernize UnitWOPIVersionRestore
Change-Id: I94d271b055d6666b59188284eee0b9bc0bd18744
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-02-17 18:52:48 -05:00
Ashod Nakashian
f8b05a0f83 wsd: support unattended runs
With --unattended, do not wait for a debugger
upon seg-faulting. This avoids the unnecessary wait
that prolongs failed unit-tests in automated runs.
Now run_unit.sh and Cypress Makefile set this flag.

Note that the wait only happens when in debug
builds, or when envar COOL_DEBUG is set. This
prevents us from waiting when running a debug
build where we can't see the output, or indeed
the run is on a CI build machine.

This flag can also be used by devs when reproducing
failures where there is no interest in attaching
a debugger. The logs are shorter and more
readable, too. At least in trace level.

Change-Id: Ice15482c6724abc47f5955402295198eb7f671ee
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-02-17 18:52:48 -05:00
Ashod Nakashian
17ef1a4b80 wsd: test: more consistent test logging
And some include cleanup.

Change-Id: I3807553bf2abe6d36c5cc521bc82e5b089ae91ea
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-02-17 18:52:48 -05:00
Ashod Nakashian
08702df63f wsd: add getSystemClockAsString helper
Change-Id: If6cfa07b48d0d08060987f831fa926f5cf9214a7
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-02-17 18:52:48 -05:00
Ashod Nakashian
3d04a857bd wsd: test: improved and simplify test logging
Build-time unit-test output is now only
displayed when the test fails. This is to
reduce noise while building when not helpful.

Change-Id: I273d97dae192a24e9a1ae9f662b0fcd7ff555b75
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-02-17 18:52:48 -05:00
Ashod Nakashian
6bf5771376 wsd: test: track wopi operations
Change-Id: Ibd65d3cc29e665510379e72abd7ff1e0f214cc91
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-02-17 18:52:48 -05:00
Ashod Nakashian
11dc26b9dc wsd: test: make WopiTestServer less public
Change-Id: Idf28f0a93cab0abcfdf3e518fa08bb06d6eaedd6
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-02-17 18:52:48 -05:00
Ashod Nakashian
39e29cf3dc wsd: test: remove inherited logic from UnitWOPIDocumentConflict
Change-Id: I433d0aaa661ad607fc029a52989d806e8364d037
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-02-17 18:52:48 -05:00
Ashod Nakashian
af77b68d97 wsd: limit store failure when unloading
When saving and/or uploading fails, we have
to give up after a certain number of retries.

A new config entry, per_document.limit_store_failures,
controls the number of consecutive failures
before giving up. This prevents locking-up
documents while uploading.

Includes a new unit-test.

Change-Id: I1296df1691fcaa982df9e861d34cb946a2eda860
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-02-09 19:35:19 -05:00
Ashod Nakashian
203a58f6d8 wsd: test: add SaveOnExit test
Refactor UnitWOPIDocumentConflict.cpp into
WOPIUploadConflictCommon.hpp and reuse for both
DocumentConflict and SaveOnExit tests.

Change-Id: I54ec1e37e5e9c6298b12a2b2e596363683fb2e34
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-02-08 20:46:01 -05:00
Ashod Nakashian
251df512ec wsd: test: add discarding after closing test to DocumentConflict
Change-Id: I9b2d100c4fcbeaa0def99332b71d8b22c51812f3
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-02-08 20:46:01 -05:00
Ashod Nakashian
4476818b86 wsd: test: rework and extend UnitWOPIDocumentConflict
Now we have multiple document conflict scenarios
that exercise different states of DocBroker and
verify correct behavior in all cases.

Change-Id: Ia1a65be686a0899776799c82c1ebfd405c92dcab
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-02-08 20:46:01 -05:00
Ashod Nakashian
d8c2578ec4 wsd: detect storage conflict with no clients
When the last client connection is closed,
there is UI (or user) to provide input
on the document conflict dialog. In this
case, we detect that the situation is final
and unresolvable and we simply give up.

We log a warning and dump the document state
before terminating.

Change-Id: I111a446b8743a0d16b7ed8b39751a419036c927f
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-02-08 20:46:01 -05:00
Ashod Nakashian
4b8d08bdd6 wsd: test: reduce UnitWOPISlow document size
Change-Id: Idf872404048918844704aa95f33fde299e64c409
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-02-04 10:26:49 -05:00
Ashod Nakashian
08461715cd wsd: test: stabilize UnitWOPILock
Transitioning the state must happen before
fiting the events that require the new state.

This was a source of random failures.

Also, improved other aspects and added
more assertions and logs.

Change-Id: I55d5a7d5f13eeedaff7f309402baaae37b0134d6
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-02-04 10:26:49 -05:00
Ashod Nakashian
f4aa05cbf9 test: modernize http response in tests and simplify
And improve some test logs.

Change-Id: Ia65de99b5682abe55f677c6afca40289087f45e5
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-02-04 10:26:49 -05:00
Ashod Nakashian
05dc8a0f84 test: improved state-machine helpers
Change-Id: I10c561ae4cf5e4471f1f9eafc9ffbb77badc7284
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-02-04 10:26:49 -05:00
Ashod Nakashian
5cab06bd88 wsd: test: improve lock tests
Change-Id: Ia864e094daf5d794ffdac411d5ea22c98049afa4
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-01-27 12:58:18 +03:00
Ashod Nakashian
8c7642b64a wsd: test: kill poco in pasteBlank
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit 49a74cc5e094d38abff172ed39752e3fdb2cfcc8)

Change-Id: Id5f544ca074590a7edffde57b1bdb865a7baba01
2022-01-27 12:58:18 +03:00
Miklos Vajna
f73f1656c7 unit-wopi-async-slow: increase timeout
When running this test against a debug core.git, then this test times
out for me. But if I increase the timeout, then it passes after 316s
just fine.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I1cd0d227dd9aac7279f991493b9aaa7c07468fdd
2022-01-19 10:18:26 -05:00
Ashod Nakashian
a5ab0f6f4e wsd: test: improve and disable TileCacheTests::testTileInvalidatedOutside
TileCacheTests::testTileInvalidatedOutside is failing
locally, even on very old tests, because the tileinvalidation
returned is EMPTY (i.e. everything is invalidated)
which isn't expected.

Change-Id: I5ff9a3771d95d7177b8a3aee260223c4a17f906a
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2022-01-11 09:28:03 +01:00
Ashod Nakashian
65d5a4f1a5 wsd: test: add slow save and upload test
Change-Id: I5c7e706a1ded7774c9da4545218ba9fa29fc9d81
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit 29c26c9afee593c20bc72a668ba0c3d5634aa35b)
2022-01-11 09:28:03 +01:00
Ashod Nakashian
ce6c3e0454 wsd: add endsWith helper with tests
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit 7e0ea08bacb0a589421feb7effa52d2a031ad16d)

Change-Id: Iac9223be5338d87861520ed7dd8cc1778727e3fd
2022-01-11 09:28:03 +01:00
Ashod Nakashian
bbcbaaf9cf wsd: test: kill poco in pasteBlank
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit ccf61dc1e9837b049c685dfeb961f588f33de30f)

Change-Id: Id5f544ca074590a7edffde57b1bdb865a7baba01
2022-01-11 09:28:03 +01:00
Ashod Nakashian
cdccf4d820 wsd: test: improved test state machine
This adds a better automatic test state
enum, with support for transitions.

It is intended to be used only in tests,
to simplify the writing of tests around
a state-machine.

Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit bf5e8a2d9f3b2fe99f5b46bcbd4c9e3e28853af5)

Change-Id: I8805dad57ca3c71c26cc30236d4832710e1717f9
2022-01-11 09:28:03 +01:00
Ashod Nakashian
aad22ee83c wsd: test: better logging
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit ec3613ba2df43cffe6baafafa41e5337a43070aa)

Change-Id: I5e245d0ac5c185943586d6aec651f606f8e23bb8
2022-01-11 09:28:03 +01:00
Ashod Nakashian
f780209ad7 wsd: test: use dynamic memory for large buffers
Change-Id: I8ebcf0a9393366ca5b3005ab719d9ee093a12e83
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit b34c46cb2a316b9ec9b5a76a5ff9d0d73a22587f)
2022-01-11 09:28:03 +01:00
Luboš Luňák
1dfb6d3866 handle properly "EMPTY" invalidatetiles message (T32137)
ChildSession::loKitCallback() may generate a message in the format
"invalidatetiles: EMPTY, 0". Handle it properly in tests.

Signed-off-by: Luboš Luňák <l.lunak@centrum.cz>
Change-Id: If8009be3c4ce031466ed304df7028848a8ab960f
2021-12-13 22:08:25 +01:00
Luboš Luňák
a5de33496c make stringifyHexLine() simply work on std::string
Trying to construct a string using sprintf() and std::stringstream
is unnecessarily complicated for something as simple as this,
and it shows up in my profiling. This commit makes the hex values
change to uppercase because that's what hexFromByte() returns,
but I don't think it matters.

Signed-off-by: Luboš Luňák <l.lunak@collabora.com>
Change-Id: I31c7b8e7cf4c2a495eca0bf03ae4cab53b26a04b
2021-12-07 13:44:40 +01:00
Luboš Luňák
9a54a5d68e actually require C++17
When I did the previous "C++17" commit I removed C++11 and C++14
from the checked list, but I missed the fact that the code checked
for C++17/14/11 and then did nothing with it. So actually do use
the detected required C++ standard.

Signed-off-by: Luboš Luňák <l.lunak@collabora.com>
Change-Id: Ia82d14d11f81456abed7ee2609903afe5366f5e7
2021-12-07 13:42:06 +01:00
Mert Tumer
f1f2a4a9a9 unit test for save-as files with encoding characters in the name
this test ensures that double encoded filenames are not a problem.
file names can already be encoded like a%20b and this was causing
problems and fixed with #3786

Signed-off-by: Mert Tumer <mert.tumer@collabora.com>
Change-Id: Ibaf0456f26c3a2e8d3c2863c2b925c7a5b9fc79c
2021-12-06 12:19:38 +03:00
Ashod Nakashian
847c997595 wsd: test: killpoco web-sockets in testHandshake
Improves the stability of this test, which
for some reason has been very unstable.
Poco's receiveFrame would return -1 without
throwing any error or indicating what's wrong.
Retrying didn't help.

Change-Id: I26b4917884e97422aa19f3e5105730ded4a45f94
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-11-23 09:31:46 +01:00
Ashod Nakashian
dc8ebc0460 wsd: test: tollerate extra tiles on invalidation
Change-Id: I87a3d073e31c1328db369ce911baff0be20826b1
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-11-23 09:31:46 +01:00
Ashod Nakashian
de78487758 wsd: test: support logging passing test assertions
By configuring with --enable-logging-test-asserts,
which is enabled by default, passing assertions
in tests will be logged.

Can be disabled with --disable-logging-test-asserts
and enabled for individual translation-units via
    #define LOK_LOG_ASSERTIONS 1

This should help with debugging failures that
happen at some arbitrary point in a test.
Logs should now be more readable, as in most cases
extra logs aren't needed to trace the test progression.
That is, the assertions become self-documenting.

Change-Id: I5498331cac63bfe6ab09566697ca324a064c4dbf
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-11-23 09:31:46 +01:00
Ashod Nakashian
2ff5c2d1ab wsd: test: more informative string assertion in TileQueueTests
The _STR version of the assertion gives a very informative
output in case of a failure, such as the following:

Expected: [1970-01-01T00:10:00.000000Z]
Actual:   [1970-01-01T00:00:00.000000Z]
          [              ^            ]

With minor cleanups.

Change-Id: I592d883c3967dc34473f8a58c5208c00b519edc0
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-11-23 09:31:46 +01:00
Ashod Nakashian
4c884a003a wsd: test: safer assertions without side-effects
The default behavior of LOK_ASSERT is that of assert,
which is to evaluate the argument(s) multiple times.

This obviously has side-effects, and is therefore
problematic. It seems it's not safe to assume all
uses of assertion is aware of this side-effect.

To prevent side-effect issues, now the LOK_ASSERT
family of macros evaluate the arguments only once.

Change-Id: I5827264ca7fcd77a7d7f5ad787353c6a7beb4fab
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-11-23 09:31:46 +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
4d8b974df9 loolwsd -> coolwsd in run_unit.sh.in
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: Ie266dafb8bbd267c1ed134af056cd1733d6c3d0a
2021-11-17 18:08:19 +03:00
Mert Tumer
5ebabf9f58 rename: loolwsd -> coolwsd only binary
Signed-off-by: Mert Tumer <mert.tumer@collabora.com>
Change-Id: Ia44f7f96bcad7200031ad87f6a6fdd3e361f2808
2021-11-17 18:08:19 +03: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
Andras Timar
9a88a95097 --disable-lool-user-checking was renamed to --disable-cool-user-checking at some places, now replace it everywhere
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I881f8b7adfbb396da8beb07c4d0300a153ecd304
2021-11-17 09:56:09 +01:00
Henry Castro
cc8a84af60 config: rename 'lool' -> 'cool'
.
Change-Id: I13596547abac424482096a9af13c6785a8e2b897
Signed-off-by: Henry Castro <hcastro@collabora.com>
2021-11-17 09:19:04 +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
Mert Tumer
b17dc4c789 Unit test for X-WOPI-Lock
Signed-off-by: Mert Tumer <mert.tumer@collabora.com>
Change-Id: I68ce373390a71d4df31716a8a2aa98c96dcb9647
2021-11-15 23:18:37 -05:00
Ashod Nakashian
36c12dd49c wsd: always subscribe when proactively rendering tiles
When issuing tile render requests proactively (upon
getting invalidatetile event), if the registered
request has no subscriber, TileCache::saveTileAndNotify
simply drops the tiles!

New call sequence:
ClientSession::handleTileInvalidation
    docBroker->handleTileCombinedRequest
	tileCache().subscribeToTileRendering //< fix

The end result was that we rendered tiles only
to discard them, potentially leaving the clients with
stale tiles (unless they requested new tiles themselves).
If they do request them, we still benefit from the cached
copies of the internal requests we had issued (and dropped).
The issue is that we are wasting an opportunity for efficiency
and relying on the client to request tiles when we normally
push on invalidation, adding latency and being inconsistent.

Change-Id: I4d3aa3739c5324ffca15c80b20dce29ac03eef73
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-11-15 11:40:05 +01:00
Henry Castro
0310a29826 test: rename loleaflet -> cool
Change-Id: I7becbab62266ac42af8217ff9c04cac466ec6905
Signed-off-by: Henry Castro <hcastro@collabora.com>
2021-11-10 17:18:56 +01:00
Henry Castro
d9870bdff0 test: rename loleaflet -> browser
Change-Id: I1c361fdf76b3e610b9377758af7ae666437759f8
Signed-off-by: Henry Castro <hcastro@collabora.com>
2021-11-10 17:18:56 +01:00
Henry Castro
e0fe47be5f rename loleaflet.html -> cool.html
Change-Id: Iaa28f1269f8192755ec323396ae4ff054529f412
Signed-off-by: Henry Castro <hcastro@collabora.com>
2021-11-10 17:18:56 +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
Nnamani Ezinne Martina
3a5383cc30 Trace: Writer and Impress: Generated loolstress traces
Created trace for adding and editing slides and shapes in Impress. Also re-typing and adding bullet points using large Writer file

Signed-off-by: Nnamani Ezinne Martina <nnamani.ezinne@collabora.com>
Change-Id: I3541295fada230338acb934409c2bcb80730354b
Signed-off-by: Nnamani Ezinne Martina <nnamani.ezinne@collabora.com>
2021-11-04 13:02:04 +00: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
Julius Härtl
570c31d1a1 wsd: Allow to pass ui defaults for drawings
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Change-Id: Ie311ca6b7578ead6f7c7d61fe993d4ecdc9a4386
2021-10-29 16:30:43 +02:00
Luboš Luňák
897c5df270 make Socket use Buffer for input buffer too
SteamSocket::eraseFirstInputBytes() removes from the beginning
of std::vector, which is generally slow. If the buffer becomes
too big, which it may under a load, then the function will get
slow, which in turn will likely lead to the buffer getting even
bigger because of accumulated backlog.

The Buffer class is optimized for removal at the beginning,
so use it instead of std::vector, including some API additions
for it to be an in-place replacement where it's used.

Signed-off-by: Luboš Luňák <l.lunak@collabora.com>
Change-Id: I4cf7ec56c908c7d3df391dc3f8e230ad32abb162
2021-10-26 12:11:58 +02:00
Hugo Peixoto
aba9bf5597 Fix typo in comment
Signed-off-by: Hugo Peixoto <hugo.peixoto@gmail.com>
Change-Id: Icb6f788956d4c21573e54c5e66a0beb6197425e2
2021-10-18 17:30:05 +02:00
Hugo Peixoto
2bdb7ed56f Fix bug in StringVector::startsWith and add tests
The startsWith method that receives a StringToken was doing a bounds
check on the wrong parameter. This caused most calls to return false.

This commit adds some tests to both versions of StringVector::startsWith.

Signed-off-by: Hugo Peixoto <hugo.peixoto@gmail.com>
Change-Id: Icd4c648d681723ac66dba3c6a42ab7920850c619
2021-10-18 08:18:14 +02:00
Hugo Peixoto
f157b1eec1 Remove unused Poco/Timestamp include
Signed-off-by: Hugo Peixoto <hugo.peixoto@gmail.com>
Change-Id: Ic8a9796a5a3995d06852c61e17963868d5dd5831
2021-10-15 13:59:31 +02:00
Miklos Vajna
95c700ff47 Test JsonUtil::escapeJSONValue()
Follow-up to commit d1bc6911b5 (Escape
strings in JSON, 2021-10-13).

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: If8d21d6ebcf080f8893dedbebcd42aaad3b921a1
2021-10-14 11:58:07 +02: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
Nnamani Ezinne Martina
2dff3309a5 Trace: Mobile - Generated loolstress traces
Using mobile device, created traces for text document, Spreadsheet and Impress files in real editing sessions

Signed-off-by: Nnamani Ezinne Martina <nnamani.ezinne@collabora.com>
Change-Id: Ie1afa80b87963999a5a3520d67fb411624b7fdc9
2021-10-06 15:31:58 +01:00
Nnamani Ezinne Martina
e9eb99dd6a Trace: Generated loolstress traces
Created traces for text document, Spreadsheet and Impress files using real editing sessions

Signed-off-by: Nnamani Ezinne Martina <nnamani.ezinne@collabora.com>
Change-Id: I99e290b1cc9c2d14e1341a211190d7d2a64b2ea4
2021-10-06 09:50:08 +01:00
Michael Meeks
72f8f5d30e stress: store and dump some statistics.
Change-Id: Ied5eb12888b1466c155ecfd291785a95ea897db9
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2021-10-02 21:24:15 +01:00
Ashod Nakashian
a9aba05b04 wsd: test: correct include order for operator resolution
Change-Id: Iba571f2dc36857b5ea5493efe90b21c16c86d45d
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-09-27 09:25:40 -04:00
Ashod Nakashian
e652c99efe test: visual marker for mismatched strings in failed tests
Change-Id: Ic826cdc41292c4d2bb85fbcc169584392ce58c8b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-09-26 17:02:01 -04: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
9e5043db47 wsd: http: reason phrase is optional
Change-Id: I1bd402b26081a8ff35178c836a5eaa22fd47d033
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit 0134e3329c8ea9cd6793fb125585e289b2082cf0)
2021-09-26 17:02:01 -04:00
Michael Meeks
930f8e2ca7 Export traces with offset timestamps to assist editing.
Change-Id: Ia9354826fb454e77ad6d2cf3714e43e6e3d06d26
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2021-09-16 09:06:16 +01:00
Michael Meeks
eeb4dfd77e Compiler with recent cppunit.
test/lokassert.hpp:16:22: note: 'operator<<' should be declared prior to the call site

Change-Id: I7533490e64b1181b3349d0966b42eba4dcc88f05
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2021-09-13 19:53:47 +01:00
Michael Meeks
886a89a380 Another longer trace.
Change-Id: Id3162eeae864b645451ea2f6af8f8030a4bcdfe1
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2021-09-13 14:54:00 +01:00
Ashod Nakashian
0e6a8cbfae wsd: improved dehexifying of URLs
Change-Id: Ib51e2e61432a7ac634d5b8577f75b57507b0ad60
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit 90516342d154434c3a7ad3d245b00a16b8bb5716)
2021-09-13 09:40:09 -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
6ae7864b5e wsd: hexified URL support
Change-Id: I44c46da58e0f807354aaa201ef44d3ecf50f9a07
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit 6b5cbce94c41883c7f11c28f4277083798318bf7)
2021-09-13 09:40:09 -04:00
Ashod Nakashian
28687c0bbf wsd: hexifying helpers and tests
Change-Id: I2f7fa4e6ade3361db612dbb9aa68e4d28b3905d9
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit 348ca073abe2c980f746324589bc58bf5550dc4b)
2021-09-13 09:40:09 -04:00
Tomaž Vajngerl
b31eb2ab92 New POST service to render a search result + unit and integ. tests
This adds a new service render-search-result, which renders an
image of the position where, the search fund a hit. The search
result contains the information in which object or paragraph,
which is just the node id and node type from the document model.

The service takes the document and the search result (xml file)
as the input and returns a PNG image as the output.

Signed-off-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>

Change-Id: Iffc158c5b0a3c9a63f8d05830314c9bc1616b3b1
Signed-off-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>
2021-09-13 10:36:15 +02:00
Michael Meeks
5411d8fc7c Add simple writer trace.
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
Change-Id: I98ad8e399fcdcacda7fb441f6367652f7facb5bc
2021-09-10 22:45:29 +01:00
Miklos Vajna
3186597097 log: avoid logging after shutdown on all log levels
This can happen on an assertion failure, and causes noise while looking
for real memory errors.

Also disable an unstable test, it's not clear that it passes depending
on how loaded the machine is (just increasing timeouts doesn't seem to
help).

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I049bd0a06f41e2d43702ec12a2c35944bc5200d8
2021-08-12 10:02:48 +02:00
Gökay ŞATIR
db3925f34f RenderingOptions Test: Updated due to status message's update.
Signed-off-by: Gökay ŞATIR <gokaysatir@gmail.com>
Change-Id: Iee592cb9f842ba30b1c9afa819a7e42e04cc8295
2021-07-25 11:58:34 +03:00
Henry Castro
ba652f8dbb test: adjust "assertHTTPFilesExist" function.
So it can be easy to analyze the backtrace of the
failing assertion.

Change-Id: Icdcf55b1404f858eba1d499bd65719a0e2da21db
Signed-off-by: Henry Castro <hcastro@collabora.com>
2021-07-23 10:19:42 -04:00
Henry Castro
e22f8f92f3 test: run test with capabilities disabled
Otherwise the unit test will take too much time
to fail.

Change-Id: I9a85a79ad2ced5d220394cdf71a7f703265e50ef
Signed-off-by: Henry Castro <hcastro@collabora.com>
2021-07-22 11:52:26 -04:00
Tor Lillqvist
69cf591e02 Test the merging semantics harder
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: Ie203c80d2a4b8536ed9150d0df1618b13d6bdb45
2021-07-22 13:41:53 +03:00
Tor Lillqvist
96f22d6691 Add unit test of the new merging functionality in MessageQueue
Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I69a2bb99d870a1904c89f8d48ba3d742dbd1f082
2021-07-22 13:41:53 +03:00
Henry Castro
bfcd88faf7 test: fix deleting log files
if make is killed or interrupted during the execution
of their recipes, the target is not deleted.  So there is
an opportunity to check the logs, why are taking to long
time to finish the test.

Change-Id: I6e8176a48ff721ecb2b2efc01b1f149907dd359b
Signed-off-by: Henry Castro <hcastro@collabora.com>
2021-07-21 11:38:36 -04:00
Tor Lillqvist
7483ae1c82 Check directly that the result is exactly what we expect
At least I didn't fully understand what the old code actually was
checking.

Also, use sizeof instead of magic numbers.

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I01602a2e256b1fbe39793c9f1439e025461c5a72
2021-07-21 13:25:23 +03:00
Tor Lillqvist
9de5ebbb1f Don't use the obsolete 'type' parameter in 'textinput' messages
Our JS code does not send 'textinput' messages with a 'type' parameter
either, so it is pointless to do it in a unit test.

(We still have code that checks for the 'type' parameter in received
'textinput' messages. That is pointless, too, and should be removed.)

Also, document what testWriterTyping() apparently is doing.

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I4954379339f14e4a310a76788521001048d84e37
2021-07-21 12:24:31 +03:00
Ashod Nakashian
187caefbfd wsd: test: improve modify test
Change-Id: Ic6f3f81b5481340e5e3350152228f40654460a86
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-07-18 21:14:48 -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
f63d077916 wsd: ssl certificate verification requirements
Change-Id: I72ffa586310296f1986276c3007672c41146c92b
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
938f8f9dc1 wsd: test: detect multiple uploads in test
Change-Id: I3bba2f2ea814481531a1cd5e867a54e0cbb9df49
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-07-17 22:58:23 -04:00
Ashod Nakashian
84e9732e79 wsd: test close-after-modify to confirm no data loss
Change-Id: I538b0529b318d8a0609798dc0eecadb49861e188
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-07-17 22:58:23 -04:00
Ashod Nakashian
8ff82c007b wsd: test: correct logging of phase change
Change-Id: If71e5c5a6d6b4fd03d3f4fc98ba59d8ad55d8b0b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-07-17 22:58:23 -04:00
Szymon Kłos
c61bcca1c9 Rename fileId to redirectionCount
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I78af251eab6871109de77de23b0e7ad0ab4d667f
2021-07-12 08:44:39 +02:00
Szymon Kłos
27799f23eb HTTP 302 - updates after review
Change-Id: Iaac4384385e05f33472b6678422b4a444319b59c
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
2021-07-12 08:44:39 +02:00
Szymon Kłos
fef43e237a HTTP 302 Found - block redirection loops
Change-Id: I686a801a7003d14210a0319d421b326b7f8c107a
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
2021-07-12 08:44:39 +02:00
Szymon Kłos
3330293e57 HTTP 302 Found - redirrect support for downloadDocument
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I7030159c1d745f877f927e21bea7caba25c1eb8b
2021-07-12 08:44:39 +02:00
Szymon Kłos
850f3cee71 HTTP 302 Found - remember the correct resource address
remember correct URI so all the following communication
(eg. downloading the file, upload) will be performed on new location.

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Id14c5209eb1d9ffc7c24d7e02f0c7c32a60568b7
2021-07-12 08:44:39 +02:00
Szymon Kłos
f8bea2e9c5 HTTP 302 Found - redirrect support for getWOPIFileInfo
With some loadbalancers it may happen that HTTP 302 Found
response with redirect location will appear.

Change-Id: I7bac807761423adcd827cf775bd1d3d2ba87a6cc
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
2021-07-12 08:44:39 +02:00
Gökay Şatır
a583a3fef7 Remove test pdf files.
Signed-off-by: Gökay Şatır <gokay.satir@collabora.com>
Change-Id: Ic875596fa13ed256b11ab5f864796011a72f57a7
2021-07-09 21:05:40 +03:00
Gökay Şatır
84cfb013f8 Draw: Enable PDF scrolling for tile section.
Signed-off-by: Gökay Şatır <gokay.satir@collabora.com>
Change-Id: I306fe4e4b5ed90f18df5537ce8ee7d90d4614092
2021-07-09 21:05:40 +03:00
Michael Meeks
b3f71ce3a9 perf-test: fire up six views concurrently and position on bookmarks.
Change-Id: If506c3ef7d87492aa13e78b8a6408abf1edca61d
2021-06-24 13:35:55 +03: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
Tor Lillqvist
4c68a97ce5 Re-factor Trace Event stuff for improved functionality and thread safety
Write to the Trace Event JSON file in just one place, protected by a
mutex.

Handle metadata events separately. We want them to propagate to the
output if Event Trace generation is just enabled, regardless whether
it has been turned on or not.

We can send the metadata for the Kit process only after we have opened
the docuemnt as sending a Trace Event to WSD uses the (singleton)
Document object in Kit.

Introduce some new functions for the above and adapt callers
appropriately.

Generate a Complete event for the handling of one image tile, from
setting the src attribute of the Image object to finishing the onload
function.

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I5978e0fb2495e0d2dc479bf861eb4ac7da03fa50
2021-06-21 12:43:17 +03:00
Tor Lillqvist
d6569159b7 Output a Trace Event metadata event identifying each named thread
Move the generic dummy implementation of
TraceEvent::emitOneRecording() to a source file of its own. (That is
the one which is used in test and tool executables.)

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I81cab07e5a6852b42d278a5446c13c3825cf546e
2021-06-21 12:43:17 +03:00
Ashod Nakashian
13543f45d6 wsd: test: add async upload test to modify after fail
This adds a test case for modifying the document after
the previous upload failed and verifying that the
subsequent save also uploads the modified document.

Change-Id: I05e17842399f9af48a029fdde72ce15c023bee3f
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-06-19 17:44:59 -04:00
Ashod Nakashian
bd3b862148 wsd: test: add async upload test on closing
Tests uploading on document closing when
the previous upload had failed.

Change-Id: Iceeed041bd4e84ba8096be245b4fce1af496eb8f
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-06-19 17:44:59 -04:00
Michael Meeks
b31b44167f Largeish performance test document.
Change-Id: I7839f85e584ed04a2984c3076f70c3a266ee0d8c
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2021-06-14 09:31:46 +01: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
Ashod Nakashian
0fa12e8e76 wsd: add hexify-data utility
Using for fuzzing and integration testing.

With unit-tests.

Change-Id: I23f8c619e239310d92c74c4d5e4157afb52a5e56
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-06-13 21:57:43 -04:00
Ashod Nakashian
cdff32de64 wsd: test: log state transition in UnitWOPITemplate
Change-Id: Ifad0fd432470ac6775573b12fff83d53cd93b346
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-06-13 21:57:43 -04:00
Tor Lillqvist
8cef48a0fa Introduce a generic TraceEvent class and instant events here, too
Modelled on how it is done in core. ProfileZone is derived from
NamedEvent which is derived from TraceEvent. Here we don't keep any
separate ProfileZone.hpp, though.

This was needed to introduce generation of "instant" events here, too.

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I6583134e96001641c50339deb4197fca6ab7d5d5
2021-06-02 09:04:21 +03:00
Tor Lillqvist
929e466c91 Re-work the ProfileZone implementation here
Don't bother collecting them into a vector, like in core. Instead,
just call a static member function ProfileZone::addOneRecording() for
each Event Trace object (string) to be emitted. That function then
needs to be implemented separately in each executable. In WSD it logs
the object to the Event Trace file. In Kit it sends it to WSD for
logging. In Unit tests we use a dummy implementation.

(If Event Trace logging is not enabled at all in loolwsd.xml (the
default), nothing is done, of course.)

When receiving the "traceeventrecording start" or "traceeventrecording
stop" message from the client, turn ProfileZone recoring on or off in
the WSD and Kit process. (Probably in WSD the flag should be
per-client.)

Change-Id: Ie1127d65dd44ed77e7eeab4b0f0a90cce95dc4a2
Signed-off-by: Tor Lillqvist <tml@collabora.com>
2021-05-31 10:56:19 +03:00
Tor Lillqvist
809c78480d The convention is to call the processes 'WSD', 'ForKit', and 'Kit'
I.e., not in upper case. I was misunderstanding.

Change-Id: I3275446cba0eb954b5ef398d3406d0543c2fb7e7
Signed-off-by: Tor Lillqvist <tml@collabora.com>
2021-05-25 10:41:11 +03:00
Michael Meeks
5c345a1d14 Message: cleanup message parsing of payloads.
Change-Id: Id11a702590539ff4f20fa56272beeb6d91b9e7bd
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2021-05-05 02:51:54 +01: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
cb26329ae4 wsd: test: add the seconds suffix to the output
Change-Id: Ia5d30882224dce22dff66a34f79b25d25cc64348
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-05-02 22:35:39 -04:00
Ashod Nakashian
e5ce46ca82 wsd: test: log the fake wopi response
Change-Id: I4fa1dc8c6b318ba330eab47f76accd0ca2e0e867
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-05-02 22:35:39 -04:00