Commit graph

88 commits

Author SHA1 Message Date
Michael Meeks
6bdf561049 Share the Kit environment setup code.
Particularly configuration layers so we can tweak mobile config
easily.

Add core source files from configmgr for breakpointing convenience in
the iOS project. Add loolkitconfig.xcu to the iOS app bundle. Use
${BRAND_BASE_DIR} instead of a compile-time LOOLWSD_CONFIGDIR literal
on iOS (because there is no compile-time constant path to the app
bundle). No "registry" directory directly in the app bundle any longer
on iOS, a corresponding change in core.git moved that stuff to be
under "share", like on other platforms.

Change-Id: I6672efc0505abf27297c4758118a20992b10ceb3
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88765
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2020-02-17 14:49:06 +01:00
Miklos Vajna
ea9c80b588 test: fix ODR-violation in SigUtil
==6642==ERROR: AddressSanitizer: odr-violation (0x0000024db3a0):
  [1] size=4 'SigUtil::SigHandlerTrap::SigHandling' ../common/SigUtil.cpp:113:38
  [2] size=4 'SigUtil::SigHandlerTrap::SigHandling' common/SigUtil.cpp:113:38
These globals were registered at these points:
  [1]:
    #0 0x68d7d8 in __asan_register_globals.part.13 lode/packages/llvm-472c6ef8b0f53061b049039f9775ab127beafbe4.src/compiler-rt/lib/asan/asan_globals.cc:365
    #1 0x7f4b7eeed83b in asan.module_ctor (online-san/test/../test/.libs/unit-base.so+0x6fd83b)

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

No need to include SigUtil for unit-base (invoked during 'make check'),
it's only needed for unittest_SOURCES (invoked during 'make').

Same for Log::IsShutdown(), 'vtable for Session', 'typeinfo name for
TileQueue', 'JWTAuth::_key', 'vtable for ClientSession',
'UnitBase::Global', 'SocketPoll::DefaultPollTimeoutMs' and
'SslContext::Instance'.

But don't just remove all wsd_sources from the new-style unit tests, as
that would lead to missing symbols:

[ loolwsd ] ERR  Failed to load online-san/test/../test/.libs/unit-base.so: online-san/test/../test/.libs/unit-base.so: undefined symbol: _Z20documentViewCallbackiPKcPv| common/Unit.cpp:40

(Seen during make check's unit-base.)

Change-Id: I305185f6437c5b4887d8e09a592e578a94f2659c
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/87323
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-01-24 10:34:00 +01:00
Michael Meeks
f0bfe402fd test: forcibly serialize more
Change-Id: I2fd370c5bdd440e3be2c065f9b834ffa4e7f856b
2020-01-21 15:07:54 +00:00
Michael Meeks
50deb943bd test: simplify and remove obsolete /proc grokking code.
Change-Id: I482c56dd76067019d83196aa305d14703e25bb44
2020-01-21 15:07:54 +00:00
Michael Meeks
9126a641a9 test: switch to using ClientPortNumber to allow parallelism.
Change-Id: Ifef3bce1b217605000300b240ea74df4d264e0df
2020-01-21 15:07:54 +00:00
Michael Meeks
43d0de1234 test: serialize tests for now.
Change-Id: I6309976f324a66a57baf4678e49c0c1e09b9dc48
2020-01-21 15:07:54 +00:00
Michael Meeks
8f91659ae0 test: dung out redundant LOOL_TEST_CLIENT_PORT.
And cleanup other related oddities.

Change-Id: I2d179a2ece6a8553e10e406ad4e5da08a2ff58e5
2020-01-21 15:07:54 +00:00
Michael Meeks
9dfac6dab1 test: switch to parallel tests based on Unit framework.
Increase a few timeouts, bin old-style standalone unit tests,
fix a number of bugs.

Change-Id: Ia3d59466ecb9a9443807ba3445d04dd5f77e3dba
2020-01-21 15:07:54 +00:00
Miklos Vajna
e2fa8c43a1 Convert some of the integration-http-server tests to new-style ones
So that they are in-process, which means it's easier to debug when they
fail.

Change-Id: I164b97be0bc487a02d4b2a872b9c0e40791056cd
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/86951
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-01-17 09:16:41 +01:00
Miklos Vajna
d10bbef749 Convert the WS error tests to a new-style one
So that they are in-process, which means it's easier to debug when they fail.

Change-Id: Icb3d7a7d0ffa7371eb3056b5de7144137c0acb8a
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/86463
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-01-09 08:59:09 +01:00
Miklos Vajna
743edbc9e8 Convert some closing tests to a new-style one
So that they are in-process, which means it's easier to debug when they
fail.

Change-Id: I5abaf6a5be4e21167fb1248c8c23dbc3b94c4303
Reviewed-on: https://gerrit.libreoffice.org/85573
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-12-20 09:46:47 +01:00
Miklos Vajna
9680084f6b Convert some insert/delete tests to a new-style one
So that they are in-process, which means it's easier to debug when they
fail.

Change-Id: I4938d00337dead52345036f7b186f5a759f26b82
Reviewed-on: https://gerrit.libreoffice.org/85427
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-12-18 22:18:08 +01:00
Miklos Vajna
b5f78fe73d Convert some Calc tests to a new-style one
So that they are in-process, which means it's easier to debug when they
fail.

Also, in UnitLoad, give up on trying to avoid the sleep after
disconnecting, it seems the old condition was not reliable.

Change-Id: I972a3319887a70eeea2585104ed1e762830ca505
2019-12-06 08:51:51 +01:00
Miklos Vajna
fe04d685db Convert cursor tests to a new-style one
So that they are in-process, which means it's easier to debug when they
fail.

Change-Id: I0fb1e798875c479e0aeb5f709ef630def5349126
2019-12-02 09:11:39 +01:00
Ashod Nakashian
717d3132b2 test: improve unit-tests
Change-Id: I2fd499886616809975d769632b183354d7feb32f
Reviewed-on: https://gerrit.libreoffice.org/83046
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2019-11-25 17:05:49 +01:00
Miklos Vajna
4358087be2 test: fix typo, unit-load should invoke code from UnitLoad.cpp
Change-Id: I47354f1d68075bc12a2e96832aeaa5f49ecb1d9a
2019-11-25 15:00:44 +01:00
Miklos Vajna
0580f51f85 Convert doc load tests to a new-style one
So that they are in-process, which means it's easier to debug when they
fail.

Change-Id: I2dcef46ec76e1f971172d1c29adf09103cfeaa7b
2019-11-22 09:07:33 +01:00
Miklos Vajna
703eb28a97 Convert "uno command" tests to a new-style one
So that they are in-process, which means it's easier to debug when they
fail.

Change-Id: I79eaa8014deda25ae31b0ad5ff38a8023ef0ae3e
2019-11-18 08:56:41 +01:00
Miklos Vajna
ee61bc6fb8 Convert "client session" tests to a new-style one
So that they are in-process, which means it's easier to debug when they
fail.

Change-Id: Ia95b077b46538788c0bbc7cafebfd9019512d2ab
2019-11-14 08:40:59 +01:00
Miklos Vajna
3cf185a576 Convert "each view" tests to a new-style one
So that they are in-process, which means it's easier to debug when they
fail.

Change-Id: Ia16009f6047acdba531a7bfc50419dfb8ad0ca29
2019-11-12 08:47:47 +01:00
mert
e09b5f4226 Added Unit Test for new Watermarking feature
Change-Id: Id30015731d7ea562bfeb63fc70ffc6813945e492
Reviewed-on: https://gerrit.libreoffice.org/81674
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2019-11-10 23:42:47 +01:00
Miklos Vajna
cd75e2c5f4 Convert render shape tests to a new-style one
So that they are in-process, which means it's easier to debug when they
fail.

Change-Id: I4acbfaa32f6c771d860c0ff2782024b176690ee5
2019-11-04 08:34:44 +01:00
Miklos Vajna
cf19ee6ce5 Convert password protected test to a new-style one
So that they are in-process, which means it's easier to debug when they
fail.

Change-Id: Ie57d028314fec1994f603097cf408cbda2fee8f4
2019-10-28 09:12:32 +01:00
Miklos Vajna
cdec2c7870 Convert rendering options to a new-style one
So that they are in-process, which means it's easier to debug when they
fail.

Change-Id: I817812eaeaffea4de8bb3a90466d815d4047372c
2019-10-25 08:54:46 +02:00
Miklos Vajna
1bff9e7bf8 Convert load torture testcase to a new-style one
So that they are in-process, which means it's easier to debug when they
fail.

Change-Id: I6b33887fbe8dd6071ee767f24d4776a694fb62f7
2019-10-21 09:04:12 +02:00
Miklos Vajna
b97789eb76 Convert paste testcase to a new-style one
Change-Id: Ie4d8c2431bc12b94af83b802d4a627cbfb7a72e0
2019-10-18 09:06:53 +02:00
Miklos Vajna
a6eff7ed2d Convert large paste testcase to a new-style one
And fix run_unit.sh to to do the quoting properly, so -la does not match
the \.la pattern.

Change-Id: I6fd81166abc43f87d82123c104ee4e74238bd714
2019-10-08 08:51:03 +02:00
Miklos Vajna
08f5d74f63 Convert TIFF load testcase to a new-style one
This was originally added in commit
c2c7982e5e (Add TIFF load testcase,
2019-07-04), and still fails without the core.git fix.

Change-Id: I798b82ea8212dfeafc162e4b73f6fff707ac3de2
2019-09-12 23:10:04 +02:00
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