Also add dummy, run-every-build test to validate wopi like proofs.
Change-Id: Ic2dc647a8d61693ae87b6523aaa30632979fd5d6
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91854
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Not deleting each other's jails mails all the difference.
For now parallelize in smaller groups; some of the tests are
quite heavy resource-wise.
Change-Id: I04e5cdf66ba20cbd4f9f05b9d630141814eb3801
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90982
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
This test sometimes failed on me just because the load was aborted due
to the timeout, doubling the limit makes the problem go away.
Change-Id: Ided724d67a513391b86836065d4e627581857a92
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90771
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Because the new-style tests are intrustive,
the exception that CppUnit throws on assertion
failures is caught and processed with the
application logic, which is far from ideal,
because it's very difficult to find the
cause of failure.
What we'd like is a way to control what happens
when an test assertion fails, such that we can
properly log/print the failure, and even break
in the debugger.
The new macros allow us to control the behavior
at compile-time and have added flexibility.
For now, they log an assertion failure before
invoking the CPPUNIT macro, and support a
compile-time directive to assert, which is
useful for breaking in the debugger.
Change-Id: If464ba246e3ec747f31496a4215cb73ef735dfaf
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/87625
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Don't check the full URL, but just test some parts of it.
Change-Id: I5367bf4f41dc26f311e03de7ce06349f744d0b85
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90428
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Essentially we want to be able to separate low-level socket code
for eg. TCP vs. UDS, from Protocol handling: eg. WebSocketHandler
and client sessions themselves which handle and send messages
which now implement the simple MessageHandlerInterface.
Some helpful renaming too:
s/SocketHandlerInterface/ProtocolHandlerInterface/
Change-Id: I58092b5e0b5792fda47498fb2c875851eada461d
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90138
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Allows comparing tokens with C strings without a heap allocation. Do the
same when comparing two tokens from two different StringVectors.
And use it at all places where operator ==() has an argument, which is a
StringVector::operator []() result.
Change-Id: Id36eff96767ab99b235ecbd12fb14446a3efa869
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90201
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
This is meant to reduce lots of small allocations and instead have
pointers into the single string for the various tokens instead.
This has a few requirements, though:
1) It's no longer OK to modify the tokens, changing their length would
invalidate the start/length of other tokens. Rework
DocumentBroker::load() to avoid such mutation.
2) The iterators no longer expose zero-terminated strings, so
Poco::cat() doesn't work anymore: add an own cat() instead and use that
in e.g. ChildSession. The own cat() has the benefit that it won't read
past the end of the array if the begin index is out of bounds to add
more safety.
(This nicely works towards killing Poco usage in general.)
3) If zero-terminated strings for all individual tokens is needed, a
copy has to be made, as done in spawnProcess().
(For all of these requirements, the build fails if there are problems.)
Change-Id: Iea40e4400e630b2d669f5c72aea85cb40edf9a2c
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89711
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
The bulk of this commit just changes std::vector<std::string> to
StringVector when we deal with tokens from a websocket message.
The less boring part of it is the new StringVector class, which is a
wrapper around std::vector<std::string>, and provides the same API,
except that operator[] returns a string, not a string&, and this allows
returning an empty string in case that prevents reading past the end of
the underlying array.
This means in case client code forgets to check size() before invoking
operator[], we don't crash. (See the ~3 previous commits which fixed
such crashes.)
Later the ctor could be changed to take a single underlying string to
avoid lots of tiny allocations, that's not yet done in this commit.
Change-Id: I8a6082143a8ac0b65824f574b32104d7889c184f
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89687
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Now that we don't re-compress PNG images since core.git commit
8fc1b60f62c213a0476f3acc9f89cd5eccbf335d (sw SVG export: try to reuse
original bitmap data for JPG and PNG bitmaps, 2020-02-27).
Change-Id: I869ae0a21f834e6f05bf9b897b15cf3392320cd8
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89621
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
This test case is covered by cypress tests. See
shape_properties_spec.js. Those tests will fail if
SVG rendering is broken.
Change-Id: I1a3434f9696c6a323a23ded0b1b2816d74373c7a
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89590
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Sometimes the text content comes with the first recieve,
sometimes we need a second recieve to get that.
Don't fail when we get the content for the first recieve.
Change-Id: I3078995cae3c0cfefdd5f2b8eae8bad4003ec2fd
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89347
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Logs from test are now more atomic (less interleaving).
And each integration-test (old-style tests running from
new-style tests) will now print clearly when it begins
and when it fails, making it easier to find failures.
Misc other minor cleanups in test logging.
Change-Id: Iff664e42a04d1c6dbf1332b2884c35183ef85e21
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89309
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
We are running make -j2 check with Jenkins now.
Which fails with these unit tests. Let's just
serialize all, so we can test cypress test
parallelization.
Change-Id: Ib1ed21581c88cd86cbd13ef5c6b8b98abaef1da5
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89211
Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
I think this is the last case where sanitizers cause enough slowdown
that the test fails due to a timeout. The new limit is 4 minutes, the
test passes for me in 2m20s with sanitizers.
Change-Id: I7fccb593d67908bfaeba8eb8715d00cce48e84fb
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88916
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
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>
Sometimes unit-each-view fails on me in a situation like this:
21:00:13.331257 [ loolwsd ] TRC debug, testEachView: waiting for message, timeout after 20s| UnitEachView.cpp:66
21:00:20.429615 [ loolwsd ] TRC debug, testEachView: response is empty, will fail| UnitEachView.cpp:72
I.e. for some reason ws.poll() returns after 7 seconds, even if the
timeout at test/UnitEachView.cpp is clearly 20 seconds.
Fix the problem by trying again in case we got no data -- we'll still
break from the loop on timeout.
Change-Id: I913ecd692f350b9deb38705a0a2d24e8b3c799a0
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88846
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
This restores commit 5c8a224e2d, which
disabled the unstable testReloadWhileDisconnecting testcase. Later this
was reverted by commit 4fc7bc76db, but
nothing was really done to improve the stability, so go back to disabled
for now. (Till somebody has time to debug & fix the root cause here.)
Change-Id: I26ea40a81cf9e2673f2397221c85e6f9dedc4052
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88669
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
With this, the test passes under sanitizers as well.
Change-Id: I777e177d4f171328744cf83386276752d51700cc
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88584
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
So we can see how stable the cypress tests are. Now other unit
tests under tests folder are failing randomly, so it's hard to
monitor the cypress tests.
Enable one unstable unit test, which was disabled for the same
reason.
Change-Id: Ib1646de1647c9a2bdb769bbb6b92a5794dd7a598
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88559
Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Half of the Jenkins build fails beacuse of this test.
Error message, we've got during run:
uncaught exception of type std::exception (or derived).
- error: cmd=storage kind=loadfailed
Change-Id: I42bb502a5aac96218b4ca772c1d0def398144797
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88443
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
This now failed under sanitizers due to a timeout. Make the new limit 2
minutes, sanitizers require 51 seconds for me (so we did not fit into
the 30 seconds default).
Change-Id: Ib8edb002b50e55b605152be5d50574c396964c25
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88424
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
This now failed under sanitizers due to a timeout. Double the limit;
asan typically causes a 2x slowdown.
Change-Id: I943c6f900371ff4c05c760d3d993829d54264941
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/87716
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
==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>
This is not needed, the commandline to run the test is printed on
failure.
Change-Id: Ia4da4344ede4ad8c1627a5560f1bc1264f4203c7
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/87288
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
This was removed in commit 0599db3576
(copyFile: de-poco-ize and handle EINTR and short writes., 2020-01-18),
probably by accident.
Change-Id: I36bed5851fbfa0c37a007bedb6f318aaf4d8c64a
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/87233
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Miklos Vajna <vmiklos@collabora.com>
When trying to open a link normally from help->Online help
nothing happens but the popup is closed.
When trying to open a like forcefully in new tab
from help->online help it crashes the server.
Change-Id: I7e0944ebe521002625a84e155e379ed7e25d2309
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/85466
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
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>
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>
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>
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>
And disable a test that passes for me locally but fails on Jenkins.
Change-Id: Ifcdcedbac259247d784ce66185f95bfbe634381f
Reviewed-on: https://gerrit.libreoffice.org/84603
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
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
Depending on timing, this failed with the following error:
wsd-14400-14411 [ docbroker_001 ] WRN Will not load document marked to destroy. DocKey: [/tmp/connectNoLoad_27c61e41_hello.odt].| wsd/DocumentBroker.cpp:520
Make sure we don't try to load the same document again when the cleanup
for the previous session is not done yet.
Change-Id: I354999fa934df665b48dca314d2b77ab95c84ec0
There were two problems here:
- there are much more headers than the one stated in "start", and as the
name implies, that's only the start of the headers, so assert it's a
matching prefix instead of full match
- the second case got the condition wrong, assert states what is the
assumption, does not check for an error state
With these, this test passes again.
Change-Id: I39f644849fc4808d73d1f95e2cda57d9465aacbf
Use std::vector instead of a C array, where the elements are initialized
with zero values by default.
Change-Id: I3c69b588e2a2c3deba052eae35da87a3d085491e
"/hosting/discovery/" added in addition to "/hosting/discovery"
Change-Id: I33f7fda9981d8d4e95ca5d69d3d6b3da1e4b0eeb
Reviewed-on: https://gerrit.libreoffice.org/83169
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
For an array, memset(array, ...) and memset(&array, ...) do the same
thing - but given that there has to be the sizeof(array), the former
is probably more readable / obvious here.
Change-Id: I7e329cb1dcabb564e26857b0c7d9f88431bb4ede
Reviewed-on: https://gerrit.libreoffice.org/82601
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Miklos Vajna <vmiklos@collabora.com>
removed use of Poco::StringTokenizer from the test directory using LOOLProtocol::tokenize and std::vecor<std::string>
Change-Id: I20fc2e0ef0d0d8fc959fee7972aa095f2581c181
Reviewed-on: https://gerrit.libreoffice.org/82565
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
This was originally moved in commit
b97789eb76 (Convert paste testcase to a
new-style one, 2019-10-18), then
194db8ed45 (test: improve stability of a
number of tests, 2019-10-12) restored a duplicate of this, probably due
to a mismerge.
Change-Id: Ie76266ddb85c58bb2370640025b91af980656908
Assuming that the test has to be adapted, and it's not like it caught
real badness.
Change-Id: Id0e6bc134aefdeb46d281ae6b2a5fbc9ae70e8a4
Reviewed-on: https://gerrit.libreoffice.org/82414
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Miklos Vajna <vmiklos@collabora.com>
This started to reliably fail for me recently.
I think the problem was that deleteAll() also listened for incoming
messages, so while waiting for textselection:, perhaps it processed (and
ignored) invalidatetiles:.
As a consequence, once deleteAll() returned and testUnresponsiveClient()
started to wait for invalidatetiles:, the test may or may not failed,
depending on the order of messages.
Fix the problem by just dispatching the SelectAll and Delete commands,
then waiting for invalidatetiles:.
Change-Id: I33f096e7dcb7f9daf1968dcb50d8a5f53824f5bd
Using double caused all sorts of rounding issues,
especially with random unit-test failures.
Luckily, we don't need doubles and can do everything
with integers.
Also added a new function to print time_point as
iso8601 string, for logging and convenience.
Change-Id: I1c2040c02d1143282dbde0dadef32613b77c330d
Reviewed-on: https://gerrit.libreoffice.org/81578
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Extend the timeout, as often DNS lookup takes several seconds
and that delays the response from WSD.
Reviewed-on: https://gerrit.libreoffice.org/81198
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
(cherry picked from commit ae085428dfb11b7965b73df0f40ac4fd1ec98a75)
Change-Id: Ie51bff31782fa33eb5559d28af1477e1947382a3
Reviewed-on: https://gerrit.libreoffice.org/81574
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Sometimes core renderes with sub-pixel differences
(the crosshair at the corners of the Writer pages
show line anti-aliasing differences). This causes
failure of the tests that count the tile deduplication.
We now tolerate when we get an unchanged tile twice,
assuming it was due to such a rendering difference,
but we re-trigger another change and this time we
don't expect any extra tiles, no more than two
variations of the anti-aliased crosshair was
observed.
We also move some duplicate code into utility
functions to improve readability and reuse.
Reviewed-on: https://gerrit.libreoffice.org/81196
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
(cherry picked from commit 9603597fd1aaecb27893792cfd2d243e450b58b8)
Change-Id: I1a66732dd3443bfbd770d8dc65721571dfa08615
Reviewed-on: https://gerrit.libreoffice.org/81572
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
There are numerous race conditions between issuing
action and getting the events. This causes a
mismatch, such that the events from SelectAll
is received when waiting for the events for a
subsequent action (say, Delete).
To make matters worse, sometimes Core issues
an invalidation whilst sending the events for
an action, and this completely messes our
accounting of what events we expect.
This latter could also be an issue with real
clients, however it's less likely to be
disruptive. Still, it is possible that
the client doesn't get key events
because Core had a hiccup, which breaks
the tests.
For the tests at least, the solution is to
re-issue the last action, such that we make
sure that we move forward only when the correct
event is received, or we timeout waiting.
The end results is that tests now don't fail
nearly as often as they used to.
Reviewed-on: https://gerrit.libreoffice.org/80894
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
(cherry picked from commit 050403daf04d6b36ef850006ba4a15eab6be9afc)
Change-Id: Ib1a658846061990649987ca083915a49c1fb092a
Reviewed-on: https://gerrit.libreoffice.org/81565
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
When polling for tile messages, the last wait
(which will timeout) by default will be 10 seconds.
This is too long to make the tests fast enough, and
also results in the internal cache from evicting
tiles in some cases.
Reviewed-on: https://gerrit.libreoffice.org/80897
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
(cherry picked from commit e173427bd9ca5939339994180f5b51ea11393050)
Change-Id: I6c2b80022ffcef2b21c99dd57bca61e7daaadc86
Reviewed-on: https://gerrit.libreoffice.org/81568
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
The SVG can have self-closing tags, which wasn't accounted
for. This meant the actual SVG didn't match the expected.
Reviewed-on: https://gerrit.libreoffice.org/80895
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
(cherry picked from commit 93abce99d02aa417feeae12f9232b0be83a74e35)
Change-Id: I749ba7f59351cf635fdc1cd30b3be5260b3c6b16
Reviewed-on: https://gerrit.libreoffice.org/81566
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Useful to match with the timestamps in WSD
and align events when investigating test failures
(or when trying to figure out the activity matching
certain actions/commands).
Reviewed-on: https://gerrit.libreoffice.org/80893
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
(cherry picked from commit b06ea528fe9dac854a18d4a9255ac598830dbb2c)
Change-Id: I73a0eb8e55ee7ca1b8935bd42468f53d7a82f80b
Reviewed-on: https://gerrit.libreoffice.org/81564
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
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
Now with the "Unipoll" concept all this locking is unnecessary as the
kit process is single-threaded, and actually it is harmful as the bug
shows.
Michael explains in chat:
But in fact - we should be a single threaded kit process there now. We
are protected by the solar-mutex (which is recursive) while our
locking is not. This was the whole point of the Unipoll refactor: to
remove the extra threads, complex queues, etc. etc. I just left the
mutexes. Even a recursive mutex won't work there; since it needs to be
drop-able and transferable to another (LOK internal thread) in Yield,
so - we should remove them.
Change-Id: I7d1e1dfb0e20f14134be5f81da057539b0f86ab9
Reviewed-on: https://gerrit.libreoffice.org/75849
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Fails with core.git commit ad8f4c4432e0c5c052b6f87977d1ad8663debe09 (vcl
lok: pre-load graphic libraries, 2019-07-04) reverted, which fixed TIFF
loading in the preload case (running in a chroot, no code available in
the chroot).
Change-Id: Ic46da0abcb13c4dd6fc1ce697b93e0b3062077d7
The change causes problems for people on various sad distros. Oh well,
whatever.
This reverts commit bd00d9fd05.
This reverts commit 054a9cdb04.
Change-Id: Ie439e4c655d02b6f34bdd1a9c1c5b6db6048b653
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