bccu#1909 - loolwsd command line options vs. config file and package upgrades

Unit tests updated with new command-line arguments.

Change-Id: I1a391255c44d4d22b8304129634ef7d16b606bce
Reviewed-on: https://gerrit.libreoffice.org/26683
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
This commit is contained in:
Ashod Nakashian 2016-06-26 16:36:19 -04:00 committed by Ashod Nakashian
parent d281813c06
commit e8cd9e35d3
2 changed files with 26 additions and 14 deletions

View file

@ -88,7 +88,7 @@ public:
return true;
}
void getMemory(const std::shared_ptr<Poco::Net::WebSocket> &socket,
bool getMemory(const std::shared_ptr<Poco::Net::WebSocket> &socket,
size_t &totalPSS, size_t &totalDirty)
{
std::unique_lock<std::mutex> lock(_mutex);
@ -100,10 +100,12 @@ public:
{
_failure = "Timed out waiting for child to respond to unit-memdump.";
Log::error(_failure);
return false;
}
totalPSS = _totalPSS;
totalDirty = _totalDirty;
return true;
}
virtual void newChild(const std::shared_ptr<Poco::Net::WebSocket> &socket) override
@ -121,7 +123,12 @@ public:
// Skip the last one as it's not completely initialized yet.
for (size_t i = 0; i < _childSockets.size() - 1; ++i)
{
getMemory(_childSockets[i], totalPSSKb, totalDirtyKb);
Log::info() << "Getting memory of child #" << i + 1 << " of " << _childSockets.size() << Log::end;
if (!getMemory(_childSockets[i], totalPSSKb, totalDirtyKb))
{
exitTest(TestResult::TEST_FAILED);
return;
}
}
Log::info() << "Memory use total " << totalPSSKb << "k shared "
@ -143,6 +150,7 @@ public:
}
else
{
Log::error("UnitPrefork success.");
exitTest(TestResult::TEST_OK);
}
}

View file

@ -50,10 +50,12 @@ echo > $test_output
if test "z$tst" == "z"; then
echo "executing external tests"
${valgrind} \
${abs_top_builddir}/loolwsd --systemplate="$systemplate_path" \
--lotemplate="$lo_path" \
--childroot="$jails_path" \
--allowlocalstorage > "$tst_log" 2>&1 &
${abs_top_builddir}/loolwsd --o:sys_template_path="$systemplate_path" \
--o:lo_template_path="$lo_path" \
--o:child_root_path="$jails_path" \
--o:storage.filesystem[@allow]=true \
--o:admin_console.username=admin --o:admin_console.password=admin \
> "$tst_log" 2>&1 &
echo " executing test"
@ -78,11 +80,11 @@ if test "z$tst" == "z"; then
else # newer unit tests.
echo "Running $tst | $tst_log ...";
if ${valgrind} \
${abs_top_builddir}/loolwsd --systemplate="$systemplate_path" \
--lotemplate="$lo_path" \
--childroot="$jails_path" \
--allowlocalstorage \
--admincreds="admin/admin" \
${abs_top_builddir}/loolwsd --o:sys_template_path="$systemplate_path" \
--o:lo_template_path="$lo_path" \
--o:child_root_path="$jails_path" \
--o:storage.filesystem[@allow]=true \
--o:admin_console.username=admin --o:admin_console.password=admin \
--unitlib=".libs/$tst.so" > "$tst_log" 2>&1; then
echo "Test $tst passed."
echo ":test-result: PASS $tst" >> $test_output
@ -90,9 +92,11 @@ else # newer unit tests.
cat "$tst_log"
echo "============================================================="
echo "Test failed on unit: $tst re-run with:"
echo " $ gdb --args ../loolwsd --systemplate=\"$systemplate_path\" \\"
echo " --lotemplate=\"$lo_path\" \\"
echo " --childroot=\"$jails_path\" --allowlocalstorage --admincreds="admin/admin" \\"
echo " $ gdb ${abs_top_builddir}/loolwsd --o:sys_template_path=\"$systemplate_path\" \\"
echo " --o:lo_template_path=\"$lo_path\" \\"
echo " --o:child_root_path=\"$jails_path\" \\"
echo " --o:storage.filesystem[@allow]=true \\"
echo " --o:admin_console.username=admin --o:admin_console.password=admin \\"
echo " --unitlib=\".libs/$tst.so\""
echo "============================================================="
echo ":test-result: FAIL $tst" >> $test_output