Commit graph

150 commits

Author SHA1 Message Date
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
Henry Castro
8ea127407b loolwsd: test: replace std::regex 2016-04-25 18:07:55 -04:00
Michael Meeks
dc035c83b7 Unit test to catch / avoid unexpected inherited sockets. 2016-04-25 21:09:57 +01:00
Miklos Vajna
9ea85e8d1a httpwstest: fix -Werror,-Wshadow
Change-Id: I64482d921409e291f6f60bf7d963a516ba4e7550
2016-04-25 09:22:41 +02:00
Tor Lillqvist
246e341c66 There is a kill() system call 2016-04-25 09:25:23 +03:00
Tor Lillqvist
ada503d91e Bin unused variable 2016-04-25 09:15:25 +03:00
Tor Lillqvist
dcbb5eab33 Hmm, probably should remove all those commmented-out lines for consistency then
If there in fact was some good reason to have them, it is trivial to
add them back (with a comment telling why they are useful, thanks).
2016-04-25 08:25:32 +03:00
Tor Lillqvist
53de1935e3 Remove accidentally (?) committed commented-out line 2016-04-25 08:13:48 +03:00
Ashod Nakashian
afc152b0ce loolwsd: compiler fixes in the tests
GCC 5.x doesn't allow temporary strings in regex_match.

Change-Id: I4c62872661d6b78ce7e949cf524c7b2b36fb0197
Reviewed-on: https://gerrit.libreoffice.org/24357
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-25 02:14:30 +00:00
Henry Castro
9720ea3781 loolwsd: test: add testParams 2016-04-24 21:00:44 -04:00
Henry Castro
e06cf8ac16 loolwsd: test: add testLOleaflet 2016-04-24 16:41:51 -04:00
Henry Castro
05d9e5ae0c loolwsd: test: update testInsertDelete 2016-04-24 15:00:21 -04:00
Ashod Nakashian
56cf69c47f loolwsd: unittest to kill all children before loading
Change-Id: I90f28b792c56b9659c04bcc89042455a8a37b8fa
Reviewed-on: https://gerrit.libreoffice.org/24337
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-24 17:01:44 +00:00
Ashod Nakashian
bb8beee8e9 loolwsd: refactored killing of LoKit processes in unittests
Change-Id: Ia41adc977252049b1cd7d8936f0c4c8380516030
Reviewed-on: https://gerrit.libreoffice.org/24336
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-24 17:00:40 +00:00
Ashod Nakashian
48bdc1e97a loolwsd: silence unused-result gcc error
Change-Id: Ide71b0b585a2b822cedc93e0b4aae11ab4aa1b34
Reviewed-on: https://gerrit.libreoffice.org/24333
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-24 16:55:29 +00:00
Tor Lillqvist
b0cfa35018 Remove accidental superfluous indentation 2016-04-22 13:26:32 +03:00
Tor Lillqvist
232499f542 Add test that simultaneously requested tiles indeed were rendered just once
This test requires the renderid parameter to be present in the 'tile:'
response messages, and that is the case only when ENABLE_DEBUG, so we
can run the test only in a debug build.
2016-04-21 12:50:24 +03:00
Henry Castro
40daf0185a loolwsd: test: discovery 2016-04-20 23:09:04 -04:00
Henry Castro
11fbb33b56 loolwsd: test: simulate lokit crash test 2016-04-20 21:14:51 -04:00
Michael Meeks
a47355db2f Expand use of the TileBeingRendered structure.
Implement this for tilecombine, and do tile writes in each client's
thread separately. Add env-var. to trigger sleep, and tune it to 1
second; easily long enough to exercise this code-path.
2016-04-20 11:14:18 +01:00
Tor Lillqvist
f825fea9db operator '?:' has lower precedence than '+'; '+' will be evaluated first 2016-04-19 16:21:55 +03:00
Pranav Kant
3e93a212f0 loolwsd: Admin console unit tests
Change-Id: Id0baa51c2adb14b77080b5acd2abf0658ee54b2b
2016-04-19 14:40:03 +05:30
Ashod Nakashian
3878f3b515 loolwsd: initialization and resetting support in RegexListMatcher
Change-Id: Ic262cf9e4a21d30b6dfd9d9fc0d895f89d7d8e7b
Reviewed-on: https://gerrit.libreoffice.org/24232
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-19 01:41:00 +00:00
Ashod Nakashian
7d65e30595 loolwsd: regex matching class against whitelist/blacklist
With unittests.

Change-Id: Ibb14c493cc6de61b6497ab84e34e105481afe464
Reviewed-on: https://gerrit.libreoffice.org/24231
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-19 01:40:37 +00:00
Henry Castro
c29944a386 loolwsd: fix close after close
The closing handshake.
Either peer can send a control frame with data containing
a specified control sequence to begin the closing handshake.

Upon receiving such a frame, the other peer sends a
Close frame in response, if it hasn't already sent one.
2016-04-18 20:27:27 -04:00
Tor Lillqvist
311a748d45 Clean up jails of exited loolkit processes sooner
In loolforkit, whenever we have forked a new loolkit, also check if
any previously forked children have exited. Remove the jails of
those. (The loolkit process itself does not even try to remove all of
its jail, see 3aadd910c6e32c0e557671effa5a4c606cd6e8bf.)

In order to be able to notice exited child processes in loolforkit, we
no longer can set the action for SIGCHLD to SIG_IGN. That means that
exiting loolkit processes will be in the zombie state until loolforkit
picks up their exit status. As loolforkit does this check only in
connection with forking a new child, zombie loolkit processes will
hang around for some time, until the next loolkit process is
forked. Not sure if this is a problem.

countLoolKitProcesses() in httpwstest now needs to skip zombies.

Loolwsd still takes care of removing whatever jails are left when it
finishes.
2016-04-18 14:30:09 +03:00
Ashod Nakashian
385359824a loolwsd: unittest to validate correct doc reloading while unloading
Change-Id: Id956fc9e243c44ecd3914b448ab92f87e011d3ee
Reviewed-on: https://gerrit.libreoffice.org/24185
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-18 03:37:54 +00:00
Ashod Nakashian
53a2e3ba42 loolwsd: save on disconnection test enabled and functional
Change-Id: I604b0826674e981136ca7f8a9169a20eed9597d3
Reviewed-on: https://gerrit.libreoffice.org/24181
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-18 03:34:10 +00:00
Ashod Nakashian
2ee7d35fb8 loolwsd: reload test now actually reloads same document
Change-Id: I2ff724d3a3566f5fcb010ce46a6749e517afccd2
Reviewed-on: https://gerrit.libreoffice.org/24180
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-18 03:33:41 +00:00
Ashod Nakashian
8b5d702acb loolwsd: testBadRequest actually provokes connection error
Change-Id: Ibf12b6b45d6eb34e031ab689983ab3599a58caef
Reviewed-on: https://gerrit.libreoffice.org/24162
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-17 15:27:00 +00:00
Ashod Nakashian
a70c5300b1 loolwsd: childConnected event added to UnitWSD
Change-Id: I3d19465229b434d07f50290f08462e9c9c66a6ca
Reviewed-on: https://gerrit.libreoffice.org/24160
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-17 15:26:09 +00:00
Ashod Nakashian
0cf179ba57 loolwsd: run_unit.sh now finds abs_top_builddir and executes using bash
Change-Id: I3a341f5508ecf4cda51cc526d38d09cdbcaf09ff
Reviewed-on: https://gerrit.libreoffice.org/24157
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-04-17 15:20:43 +00:00