<div dir="ltr">Hi, <div><br></div><div>I will update the patch and resend it tomorrow</div><div><br></div><div>Regards</div><div>Anders<br><br><div class="gmail_quote"><div dir="ltr">mån 14 maj 2018 kl 18:17 skrev Jonathan Rajotte-Julien <<a href="mailto:jonathan.rajotte-julien@efficios.com">jonathan.rajotte-julien@efficios.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Anders<br>
<br>
Thanks for proposing this patch.<br>
<br>
We will need more context here. Are those currently failing and exposing a<br>
problem?<br></blockquote><div>Yes, lttng-tools 2.10.4 is broken when having auto-load sessions, see<br><a href="https://lists.lttng.org/pipermail/lttng-dev/2018-May/028014.html">https://lists.lttng.org/pipermail/lttng-dev/2018-May/028014.html</a></div><div><br>I will add a longer commit message </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
See comments inline.<br>
<br>
<br>
On Mon, May 14, 2018 at 05:30:53PM +0200, Anders Wallin wrote:<br>
> Signed-off-by: Anders Wallin <<a href="mailto:wallinux@gmail.com" target="_blank">wallinux@gmail.com</a>><br>
> ---<br>
> tests/fast_regression | 1 +<br>
> .../regression/tools/save-load/test_autoload | 101 ++++++++++++++++++<br>
> 2 files changed, 102 insertions(+)<br>
> create mode 100755 tests/regression/tools/save-load/test_autoload<br>
> <br>
> diff --git a/tests/fast_regression b/tests/fast_regression<br>
> index bbce068f..2f02f872 100644<br>
> --- a/tests/fast_regression<br>
> +++ b/tests/fast_regression<br>
> @@ -13,6 +13,7 @@ regression/tools/snapshots/test_ust_fast<br>
> regression/tools/snapshots/test_ust_streaming<br>
> regression/tools/save-load/test_save<br>
> regression/tools/save-load/test_load<br>
> +regression/tools/save-load/test_autoload<br>
> regression/tools/mi/test_mi<br>
> regression/tools/wildcard/test_event_wildcard<br>
> regression/tools/crash/test_crash<br>
> diff --git a/tests/regression/tools/save-load/test_autoload b/tests/regression/tools/save-load/test_autoload<br>
> new file mode 100755<br>
> index 00000000..ea1210de<br>
> --- /dev/null<br>
> +++ b/tests/regression/tools/save-load/test_autoload<br>
> @@ -0,0 +1,101 @@<br>
> +#!/bin/bash<br>
> +#<br>
> +# Copyright (C) - 2014 David Goulet <<a href="mailto:dgoulet@efficios.com" target="_blank">dgoulet@efficios.com</a>><br>
<br>
I doubt dgoulet wrote this file :). Even if this was "copied" from another test<br>
plan the majority of the test plan was written/contributed by you.<br>
Your name and email should be there.<br></blockquote><div>Ok </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
> +#<br>
> +# This library is free software; you can redistribute it and/or modify it under<br>
> +# the terms of the GNU Lesser General Public License as published by the Free<br>
> +# Software Foundation; version 2.1 of the License.<br>
> +#<br>
> +# This library is distributed in the hope that it will be useful, but WITHOUT<br>
> +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS<br>
> +# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more<br>
> +# details.<br>
> +#<br>
> +# You should have received a copy of the GNU Lesser General Public License<br>
> +# along with this library; if not, write to the Free Software Foundation, Inc.,<br>
> +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA<br>
> +<br>
> +TEST_DESC="Load session(s)"<br>
<br>
Should reflect the overall test: "Auto load session(s)"<br></blockquote><div>OK </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
> +<br>
> +CURDIR=$(dirname $0)/<br>
> +CONFIG_DIR="${CURDIR}/configuration"<br>
> +TESTDIR=$CURDIR/../../../<br>
> +SESSIOND_BIN="lttng-sessiond"<br>
> +RELAYD_BIN="lttng-relayd"<br>
> +LTTNG_BIN="lttng"<br>
> +export LTTNG_SESSION_CONFIG_XSD_PATH=$(readlink -m ${TESTDIR}../src/common/config/)<br>
> +<br>
> +DIR=$(readlink -f $TESTDIR)<br>
> +<br>
> +NUM_TESTS=10<br>
> +<br>
> +source $TESTDIR/utils/utils.sh<br>
> +<br>
> +# MUST set TESTDIR before calling those functions<br>
> +plan_tests $NUM_TESTS<br>
> +<br>
> +print_test_banner "$TEST_DESC"<br>
> +<br>
> +function test_auto_load_file()<br>
> +{<br>
> + diag "Test auto load file"<br>
> +<br>
> + stop_lttng_sessiond<br>
<br>
The stop_lttng_sessiond should be moved at the end of each sub test.<br></blockquote><div>Ok, but I need one stop_lttng_session before the test, since it can't be any lttng_sessiond </div><div>running when starting the tests. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
> + export LTTNG_HOME=<br>
> +<br>
> + start_lttng_sessiond $CURDIR/load-42.lttng<br>
> + list_lttng_with_opts load-42<br>
<br>
Put stop_lttng_sessiond here.<br>
<br>
> +}<br>
> +<br>
> +function test_auto_load_dir()<br>
> +{<br>
> + diag "Test auto load directory"<br>
> +<br>
> + stop_lttng_sessiond<br>
> +<br>
> + export LTTNG_HOME=<br>
> + export LTTNG_DIR=/tmp/lttng_home<br>
<br>
Use "mktemp -d" here.<br></blockquote><div>OK </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
> + mkdir -p $LTTNG_DIR<br>
> + cp -f $CURDIR/load-42.lttng $LTTNG_DIR/<br>
> +<br>
> + start_lttng_sessiond $LTTNG_DIR<br>
> + list_lttng_with_opts load-42<br>
> +<br>
> + rm -rf $LTTNG_DIR<br>
> +}<br>
> +<br>
> +function test_auto_load_lttng_home()<br>
> +{<br>
> + diag "Test auto load by setting LTTNG_HOME"<br>
> +<br>
> + stop_lttng_sessiond<br>
> +<br>
> + export LTTNG_HOME=/tmp/lttng_home<br>
<br>
Use "mktemp -d" here.<br></blockquote><div>OK </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
> + mkdir -p $LTTNG_HOME/.lttng/sessions/auto<br>
> + cp -f $CURDIR/load-42.lttng $LTTNG_HOME/.lttng/sessions/auto<br>
> +<br>
> + start_lttng_sessiond<br>
> + list_lttng_with_opts load-42<br>
> +<br>
> + rm -rf $LTTNG_HOME/.lttng/sessions/auto<br>
<br>
Make sure to remove the complete LTTNG_HOME directory.<br></blockquote><div>OK </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
> +}<br>
> +<br>
> +TESTS=(<br>
> + test_auto_load_file<br>
> + test_auto_load_dir<br>
> + test_auto_load_lttng_home<br>
> +)<br>
> +<br>
> +for fct_test in ${TESTS[@]};<br>
> +do<br>
> + TRACE_PATH=$(mktemp -d)<br>
> +<br>
> + ${fct_test}<br>
> + if [ $? -ne 0 ]; then<br>
> + break;<br>
> + fi<br>
> + # Only delete if successful<br>
> + rm -rf $TRACE_PATH<br>
> +done<br>
> +<br>
> +stop_lttng_sessiond<br>
<br>
Remove this.<br></blockquote><div>OK </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
> -- <br>
> 2.17.0<br>
> <br>
> _______________________________________________<br>
> lttng-dev mailing list<br>
> <a href="mailto:lttng-dev@lists.lttng.org" target="_blank">lttng-dev@lists.lttng.org</a><br>
> <a href="https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev" rel="noreferrer" target="_blank">https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev</a><br>
<br>
-- <br>
Jonathan Rajotte-Julien<br>
EfficiOS<br>
</blockquote></div></div></div>