Commit graph

110 commits

Author SHA1 Message Date
Michael Meeks
81aa1a0782 test: print out the correct way to run all-local test.
Change-Id: I2a9a90beff7b2dc689dc2de7df86404018b514fb
2019-09-05 14:10:20 +01:00
Miklos Vajna
d0db456dc3 test: avoid ODR violation in UnitCopyPaste
As far as I understand, it is not necessary to link symbols of the wsd
process into unit-copy-paste.so, since we link it with the -module
libtool flag and then load it using dlopen, see
<https://www.gnu.org/software/libtool/manual/html_node/Building-modules.html#Building-modules>.

It seems this is the only test that links ${test_base_source}.

This fixes the following ODR violation:

==18174==ERROR: AddressSanitizer: odr-violation (0x000002090b20):
  [1] size=40 'SigHandlerTrap' ../common/SigUtil.cpp:76:12
  [2] size=40 'SigHandlerTrap' common/SigUtil.cpp:76:12
These globals were registered at these points:
  [1]:
    #0 0x5f9a68 in __asan_register_globals.part.13 /home/vmiklos/git/libreoffice/lode/packages/llvm-472c6ef8b0f53061b049039f9775ab127beafbe4.src/compiler-rt/lib/asan/asan_globals.cc:365
    #1 0x7f60335f1e4b in asan.module_ctor (/home/vmiklos/git/libreoffice/online-san/test/../test/.libs/unit-copy-paste.so+0x60ae4b)

  [2]:
    #0 0x5f9a68 in __asan_register_globals.part.13 /home/vmiklos/git/libreoffice/lode/packages/llvm-472c6ef8b0f53061b049039f9775ab127beafbe4.src/compiler-rt/lib/asan/asan_globals.cc:365
    #1 0xe2bd5e in asan.module_ctor (/home/vmiklos/git/libreoffice/online-san/loolwsd+0xe2bd5e)

Change-Id: Ic990a1885777e198e59cbc85156c7e5231bac524
2019-08-14 09:05:23 +02:00
Michael Meeks
9726ce6f77 Various copy/paste fixes, unit test passing, parsing of result.
Change-Id: I9168853dd011e86896c3bd474a4d05ee82c0e336
2019-08-05 21:18:12 -04:00
Michael Meeks
245e509413 clipboard: start of rotating clipboard key management.
Change-Id: I8caab267ec5391e2cd7cb20907fa080111cc70dd
2019-08-05 21:16:37 -04:00
Michael Meeks
c36da1cd97 Implement getClipboard and start of a unit test.
includes Change-Id: I47d38f9285c855dcc6fbeeb73d35f22a46a30c05

Change-Id: I60b84bef1cf832ec5c191d664afd90a080b7ffbc
2019-08-05 20:25:49 -04:00
Henry Castro
760864870f wsd: introduce "TemplateSource" WOPI property
Change-Id: I9df1d5d0d4be7fe10ee15c40c36195c86ccf857e
Reviewed-on: https://gerrit.libreoffice.org/76190
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2019-07-24 12:10:15 +02:00
Tor Lillqvist
199c6e2918 Revert "Get rid of use of GNU libtool" and its follow-up
The change causes problems for people on various sad distros. Oh well,
whatever.

This reverts commit bd00d9fd05.
This reverts commit 054a9cdb04.

Change-Id: Ie439e4c655d02b6f34bdd1a9c1c5b6db6048b653
2019-05-27 10:25:51 +03:00
Tor Lillqvist
054a9cdb04 Fix build issue with --enable-ssl after my previous commit
Don't include the net/Ssl.cpp in the same WsdSources.cpp as the
others, as our CRYPTO_dynlock_value definition is different from
Poco's.

Change-Id: I0fffcec09bcda387e8d7c3ba973a1681b11309fd
2019-05-24 12:08:54 +03:00
Tor Lillqvist
bd00d9fd05 Get rid of use of GNU libtool
It is is complicated enough to build the iOS app. Requiring GNU
libtool brings with it the risk of polluting the command environment
as there already is a completely different command in macOS with the
same name, /usr/bin/libtool. And as GNU libtool was used only to build
the unit tests for the "normal" server-based Online that are built and
run only on Linux anyway, we don't really need any of the
"portability" that GNU libtool brings.

Without GNU libtool, we compile all the $(wsd_sources) (see
test/Makefile.am) that the unit-* tests use into a single object file,
WsdSources.o. (Because they need to be compiled as PIC we can't use
the already compiled object files for the Online server programs.)
This required some additional minor changes to a few source files.

Change-Id: I20a2c523170376fa4c1a0d9d8d6b693a9779376f
Reviewed-on: https://gerrit.libreoffice.org/72840
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
2019-05-24 09:50:16 +02:00
Henry Castro
898c47fbb4 wsd: fix the exception "Bad URI syntax"
if the file name has '%' character it throws
exception "Bad URI syntax", so use the encoded
file name string

Change-Id: I6a8d841761b46ac49a6c79956ba215e1affa53e5
Reviewed-on: https://gerrit.libreoffice.org/72385
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
(cherry picked from commit b934c70f4f1f9f3ee4f873570633a3b1ec931652)
Reviewed-on: https://gerrit.libreoffice.org/72890
2019-05-24 08:57:36 +02:00
Michael Meeks
4f804a48fe Initial HTTP Expect: 100-continue implementation.
Change-Id: Ic9aa59cac5103151d91f6eb59d12313e545c7916
2019-05-22 02:56:11 +01:00
merttumer
0dbf9bcf27 Added RenameFile Support for WOPI
This patch concerns rename file operation when the integration
supports it
Signed-off-by: merttumer <mert.tumer@collabora.com>

Change-Id: Ibb4f615b91dda2491bfcd4d4738198d69eca4e6f
Reviewed-on: https://gerrit.libreoffice.org/71587
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
Signed-off-by: merttumer <mert.tumer@collabora.com>
2019-05-13 22:29:40 +03:00
Michael Meeks
956f8bf5e8 Unipoll: move event processing into the same thread.
Change-Id: I15aff3b5f18201eca915da94dbaa05148026e244
2019-05-10 14:43:27 +01:00
Michael Meeks
66ac62429c TileCache: switch to in-memory, rather than persistent.
Remove significant complexity; if we need it later lets do it more simply
serializing when we start / finish a session.

Turn off caching for mobile - possibly should kill for single-user too.

Change-Id: I5ea56088ddbb61f22fe7920f8c9ac7440cb3296a
2019-02-15 12:10:16 +01:00
Michael Meeks
92cf5707cf Add calc / typing unit test.
Change-Id: Ib62ad6e1a720bdfce41ed5520d7396e83c8f5a91
2019-02-13 18:24:36 +01:00
Tomaž Vajngerl
73c8fa9d09 Extract Authorization out of Auth and put it into common
This is needed so we can use this inside ChildSession.

Change-Id: I88f2cc767412fd52dbb242938f0f9897d4277639
Reviewed-on: https://gerrit.libreoffice.org/63836
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2018-11-29 21:47:13 +01:00
Michael Meeks
fa74404019 Add a time limit for badly behaved / huge document load / conversions.
Also improve debug printing of load times in dumpstate.

Change-Id: Ib3fd70dffb57588cd90bd928c4be9890cee8bc65
2018-11-08 01:27:40 +00:00
Tor Lillqvist
3d408d4338 Actually run the fakesockettest
Sad that this Makefile.am is so complicated, and that this needs to be
added explicitly like this.

Change-Id: I8b1b25761eb723e124cab96479f49478d3a75194
2018-11-01 12:10:47 +02:00
Tor Lillqvist
02d3ac47ee Add a Cppunit test for the FakeSocket API
Based on Mobile/TestFakeSocket/TestFakeSocket/main.mm. Needs work,
does not really test the interesting semantic corner cases that have
been fixed only recently.

Change-Id: Ie2f3dbd2b478ab3acb4bfef0e0d3031c817d0f37
2018-11-01 11:51:34 +02:00
Jan Holesovsky
98ed24257b Move the functionality from connectToMonitor() to SocketPoll.
Change-Id: Iab2ac09638323f5e59f7a2ea0d880f52989ad64d
2018-05-18 15:16:40 +02:00
Andras Timar
c3afdf32e4 add png files for DeltaTests::testDeltaSequence to dist tarball
Change-Id: Ib8007ce17e71e7a343dc3572364788e6f2c3efa2
2018-03-07 13:48:56 +01:00
Pranav Kant
39f11ab4f7 document conflict: unit test
Change-Id: I4ea310fe5adb198bc7b5e083f6bd4b0431c0cdef
2018-02-09 00:22:57 +05:30
Pranav Kant
5bd4d67818 versionrestore: unit test; checks if wsd saves a modified document
See comment for more details

Change-Id: If79537c4ca61926f06015ad6827a473d18a2a79f
2018-02-08 19:57:20 +05:30
Pranav Kant
5476774af1 wsd: Use a close request flag to break out of doc broker poll thread
... instead of directly stop()ing it. The close request approach also
makes sure that outgoing document is saved to storage.

Change-Id: I44f61db00dbd326dec80f59f4a2cbb617048aa94
Reviewed-on: https://gerrit.libreoffice.org/49122
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2018-02-07 14:30:33 +01:00
Michael Meeks
42d264eeb0 Start of Delta unit-tests.
Change-Id: I1a25f5347c0d7430000146bb585a041d363bcf37
2017-11-22 15:55:03 +00:00
Jan Holesovsky
7ff432a370 tdf#99744 SaveAs: Reimplementation of the PutRelativeFile going through Kit.
This is necessary so that changing of the file type works.

Includes a unit test.

Change-Id: Id01d44e555b6bac1002ff950de461fd330602f63
2017-10-26 11:11:38 +02:00
Jan Holesovsky
3141cfc99b PutFile ext: X-LOOL-WOPI-IsModifiedByUser unit test.
Change-Id: I0b1ffc74dbbc771f0dcb68f87d46af3ba469ae9e
Reviewed-on: https://gerrit.libreoffice.org/42855
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-09-27 16:37:16 +02:00
Michael Meeks
2c1508c309 Implement more reliable in-process short-cuts.
Change-Id: Icdfa71affad147c29df175ae687cbecc3f1f171b
2017-09-19 21:17:13 +01:00
Michael Meeks
def0350379 Re-factor pid hunting code into test.cpp where we can do better.
Prepare the ground for using WSD hooks for this.

Change-Id: I5c3e32396b335ad189472ab3a51044372ee304b2
2017-09-19 21:16:44 +01:00
Jan Holesovsky
d78c0b164b unit tests: Really bail out on error; and no need for a tempfile.
Change-Id: I53c1ab62bf9293217a5cada54c358292364ed60a
2017-08-17 14:04:22 +02:00
Jan Holesovsky
afcfac4bef access_header: Infrastructure for providing custom headers for authentication.
Change-Id: I52e61dc01dbad0d501471e663aaf364d9bc23c52
Reviewed-on: https://gerrit.libreoffice.org/41223
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-08-17 13:40:57 +02:00
Jan Holesovsky
cef217ea24 wsd: Fix the OAuth unit test.
Trying to combine the Poco's http server together with our polling loop leads
only to problem; so instead let's introduce a hook where we can do the WOPI
serving directly in the unit test.

Change-Id: Id3fec6ff93c3ad652aa4e0fc6309c5b7639728cb
2017-08-09 22:27:49 +02:00
Henry Castro
a262b7d7ba wsd: OAuth token passing
MS-WOPI:
"The following HTTP header MUST be included in all WOPI requests."
"Authorization "Bearer" and <token>"

Change-Id: Ie5327286e93b86a49a0248ff5886bf3ea99df768
2017-08-03 17:11:00 -04:00
Michael Meeks
73a87493f0 Use WireIds instead of long hashes to identify tiles efficiently.
Changes protocol to use 'wid' instead of 'hash' everywhere. Wire-ids
are monotonically increasing integers that can be mapped to hash
values for all of the hash values and tiles we cache internally.

Change-Id: Ibcb25817bab0f453e93d52a6f99d3ff65059e47d
2017-06-20 21:49:44 +01:00
Michael Meeks
097cc58d53 Run old-style unit tests as a new-style unit test.
This moves the code into the same process, for easier logging & debugging.

Disabled initially.

Change-Id: Id48b5649ba14deb0a2159ca59e321c7d0ae66dad
2017-06-02 18:33:26 +01:00
Jan Holesovsky
b9d1fde746 Run fc-cache before running the unit tests too.
Change-Id: I5d0cc0a1299cfdf1dc0e421d5fab8e2705a258ff
2017-04-05 15:45:39 +02:00
Michael Meeks
b9f18e63a3 UnitStorage - first cut at restoring this. 2017-03-31 17:06:47 +01:00
Michael Meeks
68bbd40bdc UnitTimeout: repair unit test timeout fidelity. 2017-03-31 16:00:32 +01:00
Michael Meeks
b70b171304 Tests: enable tilecache test and bin socket buffer size test. 2017-03-31 15:55:14 +01:00
Pranav Kant
453a452ff9 Makefile: Simplify and link zlib properly
Without this, online doesn't link, atleast for me. The problem seems to
be because in presence of target specific _LDFLAGS, AM_LDFLAGS is
ignored and it is only the latter where we are specifying ZLIB_LIBS.

Further, since the LDFLAGS values are same for all targets, we can
simplify here and rather use AM_LDFLAGS and remove all target specific
LDFLAGS.

Change-Id: I2f1c30c7f34b32c638a4ac60fab709b32f1e6c9a
Reviewed-on: https://gerrit.libreoffice.org/35959
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-03-31 09:17:56 +00:00
Michael Meeks
f20e931b29 Re-enable UnitPrefork. 2017-03-30 21:59:05 +01:00
Henry Castro
1cc621f2af test: remove duplicate common/Util.cpp
Change-Id: I65cfd6a0460a09f7ed3708082127a2ff939e7622
2017-03-30 15:37:21 -04:00
Michael Meeks
ae0dba1088 Cleanup prctl / gettid system-call thrash on logging.
Makes the strace look much prettier.
2017-03-30 18:14:40 +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
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
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
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
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
8099b84c3e loolwsd: run whitebox unittests with make check
Change-Id: I4354e1f42f33a5b2181a895077e1e16abb4e2c99
Reviewed-on: https://gerrit.libreoffice.org/32154
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-12-19 05:44:40 +00:00
Pranav Kant
0e043853ea tdf#104695: Unit test for missing tiles due to low socket buffer size
Change-Id: I278c5d532cb9b6340dee71a4b66410b32a164704
Reviewed-on: https://gerrit.libreoffice.org/32072
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
2016-12-16 10:25:15 +00:00
Pranav Kant
dd498ed079 Bin this unit test
This was added while debugging some problem with forward slashes
in docurl in websocket endpoint automatically being decoded on
some machines. But it turned out it was due to the apache server
setting. So, this test serves no purpose now and tests something
really obvious.

Change-Id: I4658354d53c481cf7554804383892f501bc408cd
2016-12-16 11:33:18 +05:30
Ashod Nakashian
fe38e0e1e6 loolwsd: per-socket dedicated sending thread
To avoid degrading performance for everyone
because of a single slow/bad connection, we
send data to clients each in its own thread.

Change-Id: I6f980c25a404c4d05bcdb1979849ea3d2776c7b9
Reviewed-on: https://gerrit.libreoffice.org/31984
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-12-14 04:21:20 +00:00
Ashod Nakashian
0b42af6d8d loolwsd: move SenderQueue to wsd
Change-Id: I33af4d1b2bbf0305cbc5fa6f05266d126f1bb803
Reviewed-on: https://gerrit.libreoffice.org/31884
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-12-12 05:20:43 +00:00
Ashod Nakashian
233cb94eff loolwsd: SenderQueue to hold messages to send to clients
This adds SenderQueue and a wrapper of messages to
send back to clients.

Currently no threading takes place, but the messages
are pumped through the queue nonetheless.

Change-Id: Id9997539c0a2a351cbf406f649c268dd3643e88e
Reviewed-on: https://gerrit.libreoffice.org/31883
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-12-12 05:19:04 +00:00
Michael Meeks
51949df882 Unit test to avoid assert returning. 2016-12-08 17:47:21 +00:00
Michael Meeks
c1a398977f Adapt makefiles, includes etc. to new locations. 2016-11-25 09:58:57 +00:00
Michael Meeks
cca657c8f2 Apply the pre-branch rename script to re-organize the source. 2016-11-25 09:58:48 +00:00
Renamed from loolwsd/test/Makefile.am (Browse further)