Commit graph

196 commits

Author SHA1 Message Date
Ashod Nakashian
b3acb4001d loolwsd: add tests to validate Impress page changes
Validate the pages before/after insert/delete and
undo/redo operations.

Change-Id: I16aa14f022a8bb0a4b126ea9bc222b788dc7d2dc
Reviewed-on: https://gerrit.libreoffice.org/24747
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-05-08 04:33:27 +00:00
Ashod Nakashian
710134e1be loolwsd: cleanup Impress InsertDelete test
Change-Id: I9dfc5ee36797d0b6a8bff7b5c7e54007c6115bb0
Reviewed-on: https://gerrit.libreoffice.org/24746
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-05-08 04:32:34 +00:00
Ashod Nakashian
f02deef936 loolwsd: proper logging in Prefork Unit and other cleanups
Change-Id: I23017d3d34edb3608cfe8bc0b5c5eaa340231033
Reviewed-on: https://gerrit.libreoffice.org/24743
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-05-08 04:27:09 +00:00
Ashod Nakashian
641038ef47 loolwsd: noisy failure when test can't collect stats
Change-Id: I6a1693954d84d175478b08f3a49e07e9447e1517
Reviewed-on: https://gerrit.libreoffice.org/24742
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-05-08 04:26:36 +00:00
Ashod Nakashian
5c47a42fea loolwsd: handle socket errors in Prefork Unit
Change-Id: Idc5a2ea776e0b8f0cde43526d690468e1969e611
Reviewed-on: https://gerrit.libreoffice.org/24741
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-05-08 04:26:00 +00:00
Ashod Nakashian
4369cb1ff3 loolwsd: UnitPrefork times out while waiting on child to respond
This prevents deadlocking in case of test failure.

Change-Id: I3026311e9a67543a26acb0316546e6b5aacf61dc
Reviewed-on: https://gerrit.libreoffice.org/24738
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-05-08 04:18:36 +00:00
Henry Castro
e03d4f7b77 loolwsd: fix -Werror=shadow 2016-05-05 14:53:34 -04:00
Henry Castro
4d52c200c5 loolwsd: test: add testSlideShow 2016-05-04 16:19:47 -04:00
Ashod Nakashian
25c550ff8e loolwsd: test that slow/hung clients don't block others
Change-Id: I16697ab3afd1d209a77d48506604ec7babc1bfff
Reviewed-on: https://gerrit.libreoffice.org/24655
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-05-04 12:38:09 +00:00
Jan Holesovsky
68ed15628d Another place that hardcodes the URI. 2016-05-04 13:56:39 +02:00
Jan Holesovsky
f40167cd6e Initialize the _url correctly. 2016-05-04 13:39:32 +02:00
Jan Holesovsky
191ee00f2c Run the tests on ports that do not conflict with a 'normal' loolwsd.
For the moment, it will allow running 'make check' that does not conflict with
an already running loolwsd (eg. from 'make run').  Later we can consider
running more tests in parallel.
2016-05-04 13:39:32 +02:00
Jan Holesovsky
f6f4681556 Use a separate client port for running the tests.
So that they can run in parallel to a 'production' loolwsd (like one from
'make run' or so) in the future; for the moment it is not possible, as the
MASTER_PORT is hardcoded.
2016-05-04 13:39:32 +02:00
Jan Holesovsky
4935bf14b4 LOOL_TEST_CLIENT_PORT env. var for overriding the client port in the tests.
And some further reduction of #ifdef ENABLE_SSL's...
2016-05-04 13:39:32 +02:00
Ashod Nakashian
bc58536113 loolwsd: new tiles unittest
Change-Id: Id63f1ae03c1d33dec666c43d64042838df10c29d
Reviewed-on: https://gerrit.libreoffice.org/24646
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-05-04 10:38:27 +00:00
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