Commit graph

783 commits

Author SHA1 Message Date
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