Commit graph

106 commits

Author SHA1 Message Date
Miklos Vajna
c646be30b6 UnitPrefork: fix -Werror,-Winconsistent-missing-override
Change-Id: Iba10362ead68427ea5ca6a9988708e3cd6710f17
2017-03-17 12:25:38 +01:00
Michael Meeks
bb3fa00631 UnitPrefork - restore most of the functionality.
No need for the memory reporting bits now that Admin gets this right.
2017-03-16 19:13:14 +00:00
Michael Meeks
2c14723e58 UnitFonts - disable.
Now we use the forkit, font lists are always the same in kit & forkit.
2017-03-16 18:33:03 +00:00
Michael Meeks
8749f4f2e3 Cleanup unit test hooks. 2017-03-16 18:32:12 +00:00
Michael Meeks
6d6dc45850 Remove un-necesssary and inefficient wakeupWorld.
While message emplacement happens in the DocumentBroker poll, we
can be sure that the next iteration of the poll will call
hasQueuedWrites before polling.
2017-03-15 12:07:34 +00:00
Michael Meeks
44ec90343e SenderQueue - remove condition, and waiting. 2017-03-15 10:20:43 +00:00
Ashod Nakashian
851195215a wsd: log testHandshake traffic
Change-Id: Iee79dfe2e7987838a528d5705cbb0d476f73dce7
Reviewed-on: https://gerrit.libreoffice.org/35117
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-03-13 04:10:26 +00:00
Ashod Nakashian
d1f201c63c wsd: testHandshake test doc filename includes test name
Change-Id: Id741daca14a7590ae66ee2206be99c35fe10fc33
Reviewed-on: https://gerrit.libreoffice.org/35112
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-03-13 04:08:11 +00:00
Ashod Nakashian
57e7d22e28 wsd: logging and formatting cleanup
Change-Id: I5bfbd517c37b6df864d181abe7c70857815b9ece
Reviewed-on: https://gerrit.libreoffice.org/35082
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-03-11 19:50:08 +00:00
Michael Meeks
0eaef6c896 config.h - get includes right: must always be the first include. 2017-03-10 10:47:43 +01:00
Michael Meeks
c84f9738fd Disable new-style unit tests for now. 2017-03-10 10:47:43 +01:00
Michael Meeks
fa6b756346 signal handling: keep track of all socket poll wakeups & wakeup.
Instead of waiting for polls to timeout; wake them up.
2017-03-10 10:47:42 +01:00
Jan Holesovsky
759895a8d7 nb: This file is not needed any more.
Change-Id: Ic73ddcc61495889fd36eb6f23f41c1bd45eb85c6
2017-03-10 10:47:42 +01:00
Ashod Nakashian
fa0771921d nb: enable testCloseAfterClose
Change-Id: I4150c547c3859e22c6628cd8d65e470b71d8cad4
2017-03-10 10:47:41 +01:00
Ashod Nakashian
88bbc303dc nb: unittest improvements
Change-Id: Ife4ed343d54137f254077d4f194157120cf82bad
2017-03-10 10:47:41 +01:00
Ashod Nakashian
17fc91e220 nb: process POST requests
These are really GET requests that aren't
WebSocket upgrade. Should rename to something
less misleading.

Re-enabled testSlideShow which depended on this.

Change-Id: I52b7f67b650fcdcbae7c2bff020b756099263141
2017-03-10 10:47:41 +01:00
Ashod Nakashian
c845890630 nb: log the test name where possible
Helps troubleshoot failed tests faster.

Change-Id: I12172bcdd46403b902bf440b919916263cb1a02b
2017-03-10 10:47:41 +01:00
Ashod Nakashian
f08d9c9ec1 nb: handle bad requests with 400 response
Change-Id: I15ecc06a933a88f5ccdd0acfd16aac8b357f29df
2017-03-10 10:47:41 +01:00
Ashod Nakashian
70b5aad1a6 nb: for now disable the broken WS tests
Change-Id: I2fdb5ce976f0c29a89fbcaa4e25a14c73644dd83
2017-03-10 10:47:40 +01:00
Ashod Nakashian
46ccfb165f nb: testLoad -> testLoadSimple
Change-Id: Ief4292f3c7bf8cd6866a83518998d250ebc03355
2017-03-10 10:47:40 +01:00
Jan Holesovsky
a1a46c240e nb: Use the non-blocking socket in the loolwsd.
This so far only builds, but I did not even try to run it yet.

Change-Id: Iceacb5fc5c8994726508e8ea00bd495d758391a8
2017-03-10 10:47:39 +01:00
Ashod Nakashian
6a3242ce96 wsd: no tabs
Change-Id: I0537f7437328cb758e691d8e0ddc12d78da11f6a
Reviewed-on: https://gerrit.libreoffice.org/34353
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-03-10 10:47:37 +01:00
Andras Timar
738792d5ff use key.pem from source directory for unit tests 2017-02-28 22:54:03 +01:00
Ashod Nakashian
6cd1d511be wsd: avoid segfault when handling invalid paste command
The payload of paste can't have length 0.

Now we silently skip such cases, although perhaps we
should be more strict and disconnect the offending
client.

Change-Id: Iaa2e7373277f9e7d85209aec56a2f8ee0ef7e801
Reviewed-on: https://gerrit.libreoffice.org/34112
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-02-10 07:02:26 +00:00
Jan Holesovsky
5873d15c62 fuzzer: Use the dummy LOK implementation when fuzzing.
Now it is possible to use:

  ./loolwsd_fuzzer --config-file=loolwsd.xml --o:storage.filesystem[@allow]=true --o:logging.level=fatal --fuzz=/tmp/looltrace

Ie. no need to specify the LibreOffice install location.  Ideally worth
disabling the logging output too, to gain higher performance.

Change-Id: I4fa5f275cd4f4a52fe2cd07e658cea726f6f31c2
2017-02-08 11:54:50 +01:00
Jan Holesovsky
964ae25ccf fuzzer: Factor out the replay functionality to a separate file.
Change-Id: Ief946b1703ef1ca0b17de3467dce66b4c3da2601
2017-02-08 08:35:13 +01:00
Pranav Kant
53bdbce4c1 Disable these tiled comment rendering related tests
We have enabled LOK_FEATURE_NO_TILED_ANNOTATIONS flag already
in Kit.cpp, which means these tests, which assume comments are
rendered as tiles, are no longer relevant, so lets disable them
for now. Surely sometime in future they would completely be
removed and replaced by new tests that assume comments are *not*
rendered in tiles and rather are added/modified/removed by using
comments API. See LOK_CALLBACK_COMMENT for details.

Change-Id: I48b7a0a0aa116d164a3654618ab0e95252d29cf3
2017-02-04 22:33:35 +05:30
Ashod Nakashian
b9a7e1ef03 wsd: improved test and cosmetics
Change-Id: I25a0a27c12394f41af8e021b72627b1c0537a166
Reviewed-on: https://gerrit.libreoffice.org/33862
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-02-03 07:08:43 +00:00
Ashod Nakashian
e325bc2978 wsd: ensure test doc is closed before reloading
This reduces the chance for random test failures.

Change-Id: I961a502d57a3cb4946b3b7febc6e6b03e7f36aa1
Reviewed-on: https://gerrit.libreoffice.org/33858
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-02-03 07:05:23 +00:00
Ashod Nakashian
016a85b643 wsd: allow testing higher MAX_DOCUMENTS and MAX_CONNECTIONS
Change-Id: I678af51871c2b145ce91c1646315a00ea1ac60fa
Reviewed-on: https://gerrit.libreoffice.org/33676
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-30 02:11:47 +00:00
Ashod Nakashian
c2d8e7bb4c wsd: unittest max views
Change-Id: I832e2d3e004001c271089382c5e1241b07572eb7
Reviewed-on: https://gerrit.libreoffice.org/33675
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-30 02:11:30 +00:00
Ashod Nakashian
1ba7c0209a wsd: cosmetics
Change-Id: I58a9e579e228d7b4a1e1b5686988aeff8da9922f
Reviewed-on: https://gerrit.libreoffice.org/33674
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-30 02:11:13 +00:00
Ashod Nakashian
9a8fe7054a wsd: more time to count lool processes
In unittests we need to count the
number of lool processes. This can
take a long time depending on how many
they are and if they are exiting or
new ones being created.

New logic is to reset the timeout
when the numbers are changing until
it settles on either the expected
(when we return), or some other value.

Change-Id: Ia8fcc7ef60586ebec6d8a280174b4dd2eae0ccc4
Reviewed-on: https://gerrit.libreoffice.org/33672
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-30 02:08:39 +00:00
Ashod Nakashian
3816b0c8eb wsd: faster and more informative tile tests
Change-Id: Ifcd179600ca1b019f43a86eaf0fd11a5d8a6177a
Reviewed-on: https://gerrit.libreoffice.org/33667
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-30 02:03:54 +00:00
Jan Holesovsky
da93cd416b Temporarily disable, these tests are affected by the order of invalidates.
Change-Id: Icd08629315417f3ca8f2c5560271a12c62309956
2017-01-27 19:17:42 +01:00
Jan Holesovsky
c44f7b8a76 Revert "loolwsd: improved MessageQueue"
Now we don't get a situation where there would be a tremendous amount of
invalidates & tile render requests piled in the queue, so we can do it
deterministic again.

The only thing that could potentially pile in the queue are the keypresses
events sent from the clients, but that is a different problem anyway.

This reverts commit c326228774.

Change-Id: I98e199eab0187bf5f47ce322ac1b1b2e3b976b85
2017-01-26 11:49:29 +01:00
Jan Holesovsky
3c9f4e1e1f Deduplicate & remove obsolete invalidations from the queue.
There's no point in trying to paint something we know will be obsolete anyway.

Change-Id: I14f61f389b114f2cda1f97e5223b31fa2f01b06c
2017-01-26 11:49:29 +01:00
Ashod Nakashian
f1de0d0481 wsd: MessagePayload -> Message
Change-Id: Ie65f7c707785dbbf85a2f98abf082fbc3ee7a64b
Reviewed-on: https://gerrit.libreoffice.org/33428
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-23 05:47:03 +00:00
Ashod Nakashian
6b17f96318 wsd: refactor MessagePayload into own file
Change-Id: Ifc0d2abd2e94d4a1b58915664fb0545dca6e96cc
Reviewed-on: https://gerrit.libreoffice.org/33427
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-23 05:45:23 +00:00
Ashod Nakashian
16eb196820 wsd: each Message object now has a unique ID for logging purposes
Change-Id: I5f3c3afec57f3d9336e0994a1d87421281028d79
Reviewed-on: https://gerrit.libreoffice.org/33426
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-23 05:42:34 +00:00
Ashod Nakashian
0f73bd9bf2 wsd: improved testConnectNoLoad
Change-Id: I8eff5b4862067444c8623582dc4f3baa585f164e
Reviewed-on: https://gerrit.libreoffice.org/33425
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-23 05:41:46 +00:00
Tor Lillqvist
32b92dcd91 Bin default values for parameters that were defaulted at just one call site
Change-Id: I965b0be1ad4f706a06d06d5c6c3f940c1b3cc33c
2017-01-16 14:05:10 +02:00
Tor Lillqvist
2f900a3a1d Skip unit-oob.la for now as loading it fails with an undefined symbol
Which is not odd, as it seems to be a forkit process that tries to load
unit-oob.so, and the symbol in question,
UnitWSD::testHandleRequest(UnitWSD::TestRequest,
UnitHTTPServerRequest&, UnitHTTPServerResponse&), is in LOOWSD.cpp.
Oh well. Whatever.

Change-Id: I0e0409b7247acdcd00e830d6fa63e73f27ea6c3a
2017-01-16 11:23:58 +02:00
Ashod Nakashian
42b11e21af wsd: unittest for document load failure validation
Change-Id: I798fa411ab0fcefa6ae1d85e69d8d77f5ca5c919
Reviewed-on: https://gerrit.libreoffice.org/33142
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-16 06:27:00 +00:00
Ashod Nakashian
2be0d16e7b wsd: improved crash kit test
Change-Id: Iddc056383aa37bfe278d4f4003b56696b8f2bf13
Reviewed-on: https://gerrit.libreoffice.org/33118
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-16 01:48:43 +00:00
Ashod Nakashian
8cbf478bfe wsd: improved getErrorCode
Change-Id: I89b36b5e69cbbe05ac7b1730633d695bc5185823
Reviewed-on: https://gerrit.libreoffice.org/33117
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-16 01:45:03 +00:00
Ashod Nakashian
0e5a75c46b wsd: exit the kit only when no more sessions exist
Change-Id: I26cd8876fd564f537dac4fb1748aee5b4dbdff04
Reviewed-on: https://gerrit.libreoffice.org/33114
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-01-16 01:43:08 +00:00
Tor Lillqvist
bc19f90dd4 Don't send a tile that hasn't changed even if client asks for it
The server tells the client the hash of each tile it sends (calculated
from the contents of the tile, not its PNG encoding). When the client
asks for a tile to be refreshed, it tells the server what the hash of
the existing tile is. If the server notices that the tile contents
hasn't actually changed, it doesn't PNG encode it and doesn't send it
to the client.

The intent is that this will reduce load on the server and also avoid
unnecessary tile traffic.

Change-Id: Ia06ca68655ea984ed4319f24f4470afda322eccf
2017-01-11 23:25:21 +02:00
Tor Lillqvist
29fc49acf2 Bump the message first line abbreviation limit to 500 characters
If we are logging a message, we want to see the first line of it in
its entirety if possible. Especially now with more parameters being
added to tile messages, 120 was not enough to see the added
interesting ones.

Bin the silly test that used knowledge of what the limit is. We should
not test a coindidental arbitrary number that is not a documented part
of an API. If we want to test the default abbreviation functionality,
we need to at least make that default limit (now 500) public in
Protocol.hpp.

Change-Id: Iea59ba46e8331e2a839c792146f123fed9df2b82
2017-01-11 23:25:21 +02:00
Tomaž Vajngerl
d24fb462d7 Test password protected OOXML and Binary MSO documents
Change-Id: Ie871ea72f2670bcb23c25697bb669128ded851d9
2017-01-10 12:44:20 +01:00