Commit graph

181 commits

Author SHA1 Message Date
Ashod Nakashian
2b02caa0b5 loolwsd: getResponseMessage that can return large binary payloads
Change-Id: Ie2cd3db5abdf00a04a6970825359095608fdb660
Reviewed-on: https://gerrit.libreoffice.org/24645
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-05-04 10:37:59 +00:00
Ashod Nakashian
a760c71ed6 loolwsd: tests should print progress and errors to cerr
Change-Id: I07341ef26de877b01f6dff0d8df81be4e1b4bed2
Reviewed-on: https://gerrit.libreoffice.org/24644
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-05-04 10:37:42 +00:00
Ashod Nakashian
cdb5f9c2da loolwsd: moved tile tests to TileCacheTests.cpp
Change-Id: I6bc681772104615b79bbe3a21ccaead01abde4dd
Reviewed-on: https://gerrit.libreoffice.org/24642
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-05-04 10:37:10 +00:00
Jan Holesovsky
b0af4bb3f9 Disable this test, it's unreliable.
For me, it is deadlocking - while we are waiting on the condition variable,
the tear down of the actual LOK / document is not progressing, because it is
waiting on something.

I was unable to get to the bottom of this in a reasonable time, so just
disabled the test for the moment; Ash is working on a similar problem I think,
so let's see if his solution helps here too (or can be applied the same way or
something).
2016-05-04 11:36:09 +02:00
Jan Holesovsky
030b59a5af Redirect stdout to the log too.
Without this, the unit-prefork gives unpredictable results depending on
whether the entire unit test run output is redirected to another logfile or
not (as then the stdout is inherited, and points to an unexpected place).

Maybe we should just exclude the fd 0, 1, 2 from the testing; but this is good
enough for now.
2016-05-03 14:51:40 +02:00
Tor Lillqvist
bfcf9756f5 Don't assert on PING frames that we send
UnitPrefork got what I assume is one of those PING frames that
ChildProcess::isAlive() sends before the actual reply when it sent the
"unit-memdump" message, and did not like it. Uncommenting the line
that outputs the "memory stats" message it expects showed:

Got memory stats 'PING'

Followed by:

Assertion `tokens.count() == 2' failed.

Fix by factoring out the handling of PING frames, PONG frames, and the
pseudo-PONG frames that we send ourselves in reply to PING frames into
a new function IoUtil::receiveFrame(). Use that in a couple of
places. (Probably should use in many more places.)

Getting past this then leads to later cppunit tests again being run,
and their failures then again showing up...
2016-05-03 09:50:38 +03:00
Ashod Nakashian
cf717152a7 loolwsd: bin_PROGRAMS -> noinst_PROGRAMS
Change-Id: Idfcfc9d21edafd094aa7c50b300b298e1ddfe6f5
Reviewed-on: https://gerrit.libreoffice.org/24598
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-05-02 23:54:50 +00:00
Jan Holesovsky
511b6c1039 Reduce #ifdef ENABLE_SSL's. 2016-05-02 18:41:57 +02:00
Jan Holesovsky
e2be97f14a Centralize the server URI. 2016-05-02 18:25:58 +02:00
Jan Holesovsky
c3cb14d258 Centralize the server URI. 2016-05-02 18:19:08 +02:00
Jan Holesovsky
b3dd2f31f9 Update the gdb command to match reality. 2016-05-02 15:03:16 +02:00
Jan Holesovsky
9df5ccc517 Make this unit test running without SSL too. 2016-05-02 15:03:16 +02:00
Ashod Nakashian
516bad1942 loolwsd: TileCache whitebox tests
New unittests to verify TileCache logic on the unit level.

Change-Id: Ia36181e850b349abb88ba5f04f1e5244771bacc6
Reviewed-on: https://gerrit.libreoffice.org/24574
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-05-01 17:18:35 +00:00
Ashod Nakashian
b916543eef loolwsd: tests can be built with running using 'make'
Indeed, tests are built when invoking make in loolwsd
directory, thereby helping catch build errors in test
before committing.

Change-Id: I34cffcb5d0aed6485e578cf20f64217bee337d23
Reviewed-on: https://gerrit.libreoffice.org/24573
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-05-01 17:17:46 +00:00
Ashod Nakashian
461fd40b49 loolwsd: more support for TileCache unittest
Change-Id: I7b09fdde8179c855bbb1545f3a2188be1c929d20
Reviewed-on: https://gerrit.libreoffice.org/24571
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-05-01 17:17:05 +00:00
Ashod Nakashian
d16f44d7a2 loolwsd: TileCache unittest, hooks, and events
Change-Id: Id9e0539d2f920f15b0d0cb8e5924e480ed6d1e87
Reviewed-on: https://gerrit.libreoffice.org/24570
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-05-01 17:16:31 +00:00
Michael Meeks
012593e375 Unit test cleanups. 2016-04-30 18:15:50 +01:00
Ashod Nakashian
59b475570d loolwsd: no need to sleep before running tests
Since lokit process counting waits until WSD
is ready (i.e. until it has created lokit processes,)
there is no need to sleep explicitly anymore.
Provided, of course, we always call the lokit
process counter before running any tests, which we
currently do.

Change-Id: Idf7ad925688251f1c81ef8628530714d2dc92d9c
Reviewed-on: https://gerrit.libreoffice.org/24528
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-30 14:37:36 +00:00
Ashod Nakashian
fd99834147 loolwsd: always run the lokit process count tests
Change-Id: I47365609850c23843624f714d6600f07629461ae
Reviewed-on: https://gerrit.libreoffice.org/24527
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-30 14:37:06 +00:00
Ashod Nakashian
4be73e5934 loolwsd: minor improvement to testing socket flags
Change-Id: I87d4d6a22fccef97bf69fce249ec0374db417714
Reviewed-on: https://gerrit.libreoffice.org/24502
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-29 21:20:11 +00:00
Ashod Nakashian
a007a7c1d4 loolwsd: improved LoKit process counting
Change-Id: I514ece4ce7f401a8996bc115ab00ddb7a8bec90d
Reviewed-on: https://gerrit.libreoffice.org/24501
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-29 21:19:46 +00:00
Jan Holesovsky
2b9295e8d7 countLoolKitProcesses() is more reliable here. 2016-04-29 22:02:21 +02:00
Jan Holesovsky
ce691601dd Need a longer default timeout for the httpwstest.cpp. 2016-04-29 22:02:21 +02:00
Ashod Nakashian
0e4c624f0b loolwsd: minor improvement to test assertions
Change-Id: I40da725919ae775d039217c258ecd28a743b5bc1
Reviewed-on: https://gerrit.libreoffice.org/24484
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-29 03:40:13 +00:00
Ashod Nakashian
42a88e2362 loolwsd: fix load test regression
Change-Id: Icadd22306f61338698aedb1b6b5d4e02246d9a4e
Reviewed-on: https://gerrit.libreoffice.org/24482
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-29 03:39:22 +00:00
Ashod Nakashian
472f959bec loolwsd: more sharing of common test code
Change-Id: Id49118eb38633127327fc16e5f49137255e78425
Reviewed-on: https://gerrit.libreoffice.org/24481
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-29 03:38:53 +00:00
Ashod Nakashian
c6380f5820 loolwsd: test logging cleanup
Change-Id: Ie2fa40eab6fec4cfe9819d75f1c35efd835b11b7
Reviewed-on: https://gerrit.libreoffice.org/24480
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-29 03:37:51 +00:00
Ashod Nakashian
7f17561f7a loolwsd: test SocketProcessor supports timeout
Change-Id: I1cf277c67840f35a0f79884c9b1c644b0769b5fd
Reviewed-on: https://gerrit.libreoffice.org/24479
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-29 03:37:20 +00:00
Ashod Nakashian
40d694d9ef loolwsd: moved loolkit process counting to own file and minimized wait
Change-Id: Ib7950fe7d97ca3484aadb1d7a7492ad1a88e375a
Reviewed-on: https://gerrit.libreoffice.org/24478
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-29 03:36:49 +00:00
Ashod Nakashian
c164096c53 loolwsd: factored out common test helpers
Change-Id: Iad2794f1b458f04bdd1fb9d3f965afd91adbade8
Reviewed-on: https://gerrit.libreoffice.org/24477
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-29 03:36:00 +00:00
Ashod Nakashian
575e093076 loolwsd: editlock and takeedit tests
Change-Id: Ie2458aed1da0624f1769b6b75f134cb0fed0db75
Reviewed-on: https://gerrit.libreoffice.org/24475
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-29 01:09:24 +00:00
Ashod Nakashian
f44660aa99 loolwsd: unittest cleanups
Change-Id: Ib9b915c7ca2df03afba7f4e1fb37b8fff846a474
Reviewed-on: https://gerrit.libreoffice.org/24473
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-29 01:07:30 +00:00
Ashod Nakashian
cf54d0d87e loolwsd: test helpers and more code sharing
Change-Id: I87e4ad23f9c2761a7a2acab4139b458696e07e64
Reviewed-on: https://gerrit.libreoffice.org/24468
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-28 22:20:10 +00:00
Henry Castro
49e6eb287b loolwsd: test: fix wrong file name 2016-04-28 14:01:28 -04:00
Jan Holesovsky
407b41afb9 Decrease verbosity of this the http server test.
And also check that we've had a hit in loleaflet.html.
2016-04-28 18:35:22 +02:00
Jan Holesovsky
28b7aee356 No need for a standalone httptestutils.hpp any more. 2016-04-28 18:17:37 +02:00
Jan Holesovsky
8e266391f1 Merge the http get and post tests into one file, and reduce copy/paste. 2016-04-28 18:08:07 +02:00
Jan Holesovsky
f283b045a9 The http tests are actually integration tests, not unit tests. 2016-04-28 17:45:18 +02:00
Jan Holesovsky
7d2aaa8910 Log the exact test file that has been used. 2016-04-28 12:35:56 +02:00
Tor Lillqvist
2dde26c2ff Add rant 2016-04-28 09:28:54 +03:00
Henry Castro
6378016586 loolwsd: test: add testClientPartCalc 2016-04-27 16:48:30 -04:00
Henry Castro
daa3d69f9e loolwsd: test: update 2016-04-27 14:30:19 -04:00
Henry Castro
33eff1fe31 loolwsd: test: add testClientPartImpress 2016-04-27 13:51:23 -04:00
Tor Lillqvist
ee7f8c158a Actually we want to check only for it starting with the expected string
As this assert fails at the moment (it did even before my previous
commit), I can't be 100% sure it is correct now. So sue me. Or revert
both my changes.
2016-04-27 14:19:01 +03:00
Tor Lillqvist
8480cad8ee Use CPPUNIT_ASSERT_EQUAL
It is useful to see the expected and actual values when the assertion
fails.
2016-04-27 14:08:34 +03:00
Jan Holesovsky
f5abfcde68 Improve test to be able to see the message directly.
The test was unreliable, but any change there made it reliable, so not sure
yet what was the root cause - but at least this should help seeing the
brokeness once it appears again.
2016-04-26 11:54:20 +02:00
Jan Holesovsky
2f561802b3 The branding files do not have to be present, skip them.
Clean up tons of copy'n'paste when at that...
2016-04-26 11:32:01 +02:00
Tor Lillqvist
42dcd6ea99 Why log a string that we even expect to be junk?
WebSocket::receiveFrame() does not null-terminate the buffer even when
it successfully reads something into it, even less when it
doesn't. (Why would it, as it is perferctly fine to transmit WebSocket
(binary) frames that contain zero bytes.) So the 'received' string was
always full of random bytes.
2016-04-26 08:20:59 +03:00
Henry Castro
47917fb8c9 loolwsd: test: add testLinks 2016-04-25 21:40:24 -04:00
Henry Castro
7317345a2b loolwsd: test: add testScripts 2016-04-25 21:01:46 -04:00