Commit graph

736 commits

Author SHA1 Message Date
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
Ashod Nakashian
20eb076977 wsd: test: safe header reader
Change-Id: I932c9be5152e9317da6af746f7f56d96898c9b5b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-05-02 22:35:39 -04:00
Ashod Nakashian
c251cbe0a1 wsd: test: log UnitHosting activity
Change-Id: Ifdf5a11a97e9e29483a32fe3271442b309a4eadd
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-05-02 22:35:39 -04:00
Ashod Nakashian
68912b264e wsd: test: assertPutFileRequest returns the http response
This is optional, but when provided it's what the caller will
get, so that a given test can simulate different responses
from the WOPI-like host.

Change-Id: Iba5513174dc94757be09640d3fdb08b46af4a960
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-05-02 22:35:39 -04:00
Ashod Nakashian
a3db633489 wsd: test: use http objects instead of manual strings
Change-Id: Ic6d478c8de4075383006be452564e213f03bb4bb
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-05-02 22:35:39 -04:00
Ashod Nakashian
406310834a wsd: test: http::Header parsing tests
Change-Id: I4b399c7ccd3559b8efed2d1e911a3d2d5e869f35
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit 152b5e6363989ac4889127f64844d22496fa5d2a)
2021-05-02 22:35:39 -04:00
Miklos Vajna
656eb310bb Fix Debian 8 / gcc-4.9 warnings
net/HttpRequest.cpp:126:19: error: declaration of 'end' shadows a member of 'this' [-Werror=shadow]

kit/Kit.cpp:163:29: error: missing initializer for member 'statfs::f_bsize' [-Werror=missing-field-initializers]

kit/Kit.cpp:171:14: error: 'OVERLAYFS_SUPER_MAGIC' was not declared in this scope

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ibbd35ab5af3adad403ed22a0aeb70917b9e21970
2021-04-30 10:38:09 +02:00
Ashod Nakashian
3decba7eec wsd: specify the minimum bytes we can write to the socket
When writing to the socket, it's always more efficient
to fill the buffer up to the hardware limit for each
write. This is doubly important for efficiency with
SSL, due to the overhead of encrypting multiple
small buffers instead of one large one.

Currently we don't write more than one message
at a time, primarily due to limitations in
the Poco sockets in the unit-tests, which
have a hard time consuming multiple WS frames
with a single poll (subsequent calls to poll
doesn't enter signalled state until new data
arrives, possibly because the data is read and
buffered internally, making the whole scheme
of using poll unreliable and meaningless).

Change-Id: Ic2e2cf1babfb5ab4116efd93f392977ba234d92b
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-04-27 17:48:23 -04:00
Miklos Vajna
d3c9e07ff3 StringVector: add a way to get a string-number pair out of this ...
... without copying the token.

And use it in TileDesc::parse(), which is known to be a hot path.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I0dcf2eb26c93254cdc6a1c11f9708daf213a825d
2021-04-27 15:31:21 +02:00