Which was the case before commit
5d57f5aef3 (storage.ssl.enable should be
in sync with ssl.enable by default, 2019-10-11), otherwise we fail to
connect to the test wsd, since its certificate is typically not trusted.
With this
make check CPPUNIT_TEST_NAME="unit-copy-paste"
passes again.
Change-Id: If3a8a293831313e74eacc1cbc092922d2c72f08c
It was not very useful to let this setting configurable by the user.
On the other hand, old path in config file caused issues after
upgrade. It is better to decide the location of LOKit core
during compilation. From now on the --with-lo-path configure
option is compulsory.
Change-Id: Icdcbc21bde5dad329fdb6e30ed17efde6b0e73de
Reviewed-on: https://gerrit.libreoffice.org/79943
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
The part number in case of writer has no actual meaning, since
for writer we have only one part (the whole document).
It seems the code is not consistent in that it is 0 or 1.
Change-Id: I9e56079f7861f7e0d5794e6f711045cd9448dfa7
Reviewed-on: https://gerrit.libreoffice.org/79851
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Util added getHttpTime
WhiteBoxTests added test for getHttpTime
Change-Id: Ifb6a3fb2dc9b059b925e7b881362b72759a8b56b
Reviewed-on: https://gerrit.libreoffice.org/79754
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
No longer is it necessary to run with --verbose
in case we need --debugrun.
Also, by default the log level is now warning instead
of error, which should hopefully be more useful in
troubleshooting issues (or at least to force us
better categorize log messages).
Change-Id: Iad4279ecf3bf77780adcd786d4f46d9c964f302d
Reviewed-on: https://gerrit.libreoffice.org/79351
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Now the wsd docbroker thread and its peer kit
thread are trivial to match, since they are called
docbroker_xxx and kitbroker_xxx (where xxx is the
instance ID) respectively.
Also, label spare kit instances as kit_spare_xxx
to differentiate from ones with actual documents,
where xxx is a running counter to differentiate
spare instances from one another.
Now we are able to easily see (and count) the number
of spare kit instances, and match wsd and kit threads
handling a given document.
Unit-test logic updated to reflect the new thread
naming scheme.
Change-Id: I154dc8f200fbe0e65f3f5984e6dad2cef1b52e22
Reviewed-on: https://gerrit.libreoffice.org/79328
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
And also others, pointed out by IWYU.
Finally, it's not needed to force-enable HTTPS after all, it seems.
Change-Id: I4d9984d2485b1519bd5a9cc44834735e09a87058
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
==18134==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 8 byte(s) in 1 object(s) allocated from:
#0 0x514db8 in operator new(unsigned long) /git/libreoffice/lode/packages/llvm-472c6ef8b0f53061b049039f9775ab127beafbe4.src/compiler-rt/lib/asan/asan_new_delete.cc:105
#1 0x9f836c in runClientTests(bool, bool) /git/libreoffice/online-san/test/test.cpp:113:28
#2 0x9f7975 in main /git/libreoffice/online-san/test/test.cpp:77:12
Change-Id: Ib93625e2a77e37733b9bb052dd73ec3333bc2a71
When .uno:ModifiedStatus is received, now Doc_ModifiedStatus
is fired to inform the client of the modified state of the document.
This is useful in case the integration needs to prompt the user to save
before closing the document (which they can catch with the onunload or
onbeforeunload events in the browser, as well as with our
UI_Close when the default handler is disabled).
Includes working sample and documentation.
Change-Id: Ief30483e2f078b0aa9f3c006a1ecb4093375174c
Reviewed-on: https://gerrit.libreoffice.org/74891
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
Clients often need to handle certain commands themselves.
This is especially true for Action_Save and Action_Close.
A new postMessage command, Disable_Default_UIAction, is
now available to support disabling/enabling the default
action for certain commands (as of this patch, only
Action_Save and Action_Close are supported).
The actions in question issue a notification and,
when the default handler is disabled, the client
is expected to handle the notification for which
they disabled the default handler and act as necessary.
See reference.html for more details.
Change-Id: Ia6ce4e2d7578f79cc2069097e0b968e6c4aeabd1
Reviewed-on: https://gerrit.libreoffice.org/74136
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
Added functions to get file timestamp and to convert
chrono timestamp in ISO8601 fraction format and some
test cases.
Change-Id: I58961a31f7262b367cff9f33cffdec7571a2f8f7
In case we fail to open the document, try again in 2 seconds (same value
as in HTTPServerTest::testConvertTo()). This seems to be needed fore
core.git dbgutil builds, but don't do that unconditionally, in case the
sleep is not needed for optimized core.git.
Change-Id: I4585d1f273bfa5fffc4b02bc6107f27a2c9e1280
Normally we use getgrp() to find out which lool* processes are ours when
running 'make check', to support running multiple of these in parallel.
However, in case you try to debug a failure, it's handy to start loolwsd
manually and invoke ./test manually in two different shells.
So add a switch which allows this: the result is that the failing test
doesn't fail early in an uninteresting way (complaining that it can't
find any loolkit processes) but fails the same way as during 'make
check'.
Let's call this --debugrun, since core has similar
gb_UITest_DEBUGRUN/gb_JunitTest_DEBUGRUN switches, which also allow
connecting to an already running "main" process.
Change-Id: Ic7e29eb143ae70f199ef3a09ec9d6b6f8ee0650d
In case we fail to send the request, try again in 2 seconds (same value
as the session timeout) before giving up. This seems to be needed for
core.git dbgutil builds; but don't do that unconditionally, in case the
sleep is not needed for optimized core.git.
Change-Id: Ie9ad8c066b7988ca37729f797c4b8dbb0ae2cbd6
After commit 8e118889cb (wsd: leaflet:
support statusupdate: messages to sync clients, 2019-08-17), which added
a new hiddenparts= key, but forgot to adapt tests accordingly.
Change-Id: Ia5baefff37b88f5b173d65ae80a126f94b420cb0
Better hashing algorithm based on FNV-1a.
Adds support for salting the hash, and
for providing salt via configuration.
More unit-tests added, and better formatting.
Change-Id: I2be42675d0cdbaa73c3d7faed99e07631a9c20fc
Reviewed-on: https://gerrit.libreoffice.org/70034
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/71091
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
==16414==ERROR: AddressSanitizer: dynamic-stack-buffer-overflow on address 0x7f81f8df5510 at pc 0x0000005eb5a4 bp 0x7f81f8df54b0 sp 0x7f81f8df4c60
READ of size 23 at 0x7f81f8df5510 thread T3 (websrv_poll)
#0 0x5eb5a3 in __interceptor_strlen.part.34 /home/vmiklos/git/libreoffice/lode/packages/llvm-472c6ef8b0f53061b049039f9775ab127beafbe4.src/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:365
#1 0x7f8201d22e47 in std::char_traits<char>::length(char const*) /home/vmiklos/git/libreoffice/lode/packages/gccbuild/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/char_traits.h:320
#2 0x7f8201d22e47 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) /home/vmiklos/git/libreoffice/lode/packages/gccbuild/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.h:511
#3 0x7f81fcaa59c3 in WopiTestServer::handleHttpRequest(Poco::Net::HTTPRequest const&, Poco::MemoryInputStream&, std::shared_ptr<StreamSocket>&) /home/vmiklos/git/libreoffice/online-san/test/./WopiTestServer.hpp:237:28
Problem was that the test code assumed a 0-terminated buffer, but that
was not the reality. So specify the buffer size explicitly.
Change-Id: I9a9edfe5623a1136aa77c381d1d3d8b8e1ca2258
re-factor ClientSession state to be a simpler state machine.
Have a nice disconnect / disconnected handshake on view close.
Change-Id: Ie933cc5c7dfab46c66f4d38a4d75c459aa1cff87
It seems to me that in this case the test was poor, if other
invalidation types are expected, then this one should be fine, too.
Change-Id: Iae7597eef081acdfb5d6f9152747204a71bd2b66