* [PATCH lttng-tools] Tests: Added autoloading session test cases
@ 2018-05-14 15:30 Anders Wallin
0 siblings, 0 replies; 7+ messages in thread
From: Anders Wallin @ 2018-05-14 15:30 UTC (permalink / raw)
To: lttng-dev
Signed-off-by: Anders Wallin <wallinux@gmail.com>
---
tests/fast_regression | 1 +
.../regression/tools/save-load/test_autoload | 101 ++++++++++++++++++
2 files changed, 102 insertions(+)
create mode 100755 tests/regression/tools/save-load/test_autoload
diff --git a/tests/fast_regression b/tests/fast_regression
index bbce068f..2f02f872 100644
--- a/tests/fast_regression
+++ b/tests/fast_regression
@@ -13,6 +13,7 @@ regression/tools/snapshots/test_ust_fast
regression/tools/snapshots/test_ust_streaming
regression/tools/save-load/test_save
regression/tools/save-load/test_load
+regression/tools/save-load/test_autoload
regression/tools/mi/test_mi
regression/tools/wildcard/test_event_wildcard
regression/tools/crash/test_crash
diff --git a/tests/regression/tools/save-load/test_autoload b/tests/regression/tools/save-load/test_autoload
new file mode 100755
index 00000000..ea1210de
--- /dev/null
+++ b/tests/regression/tools/save-load/test_autoload
@@ -0,0 +1,101 @@
+#!/bin/bash
+#
+# Copyright (C) - 2014 David Goulet <dgoulet@efficios.com>
+#
+# This library is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the Free
+# Software Foundation; version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+TEST_DESC="Load session(s)"
+
+CURDIR=$(dirname $0)/
+CONFIG_DIR="${CURDIR}/configuration"
+TESTDIR=$CURDIR/../../../
+SESSIOND_BIN="lttng-sessiond"
+RELAYD_BIN="lttng-relayd"
+LTTNG_BIN="lttng"
+export LTTNG_SESSION_CONFIG_XSD_PATH=$(readlink -m ${TESTDIR}../src/common/config/)
+
+DIR=$(readlink -f $TESTDIR)
+
+NUM_TESTS=10
+
+source $TESTDIR/utils/utils.sh
+
+# MUST set TESTDIR before calling those functions
+plan_tests $NUM_TESTS
+
+print_test_banner "$TEST_DESC"
+
+function test_auto_load_file()
+{
+ diag "Test auto load file"
+
+ stop_lttng_sessiond
+ export LTTNG_HOME=
+
+ start_lttng_sessiond $CURDIR/load-42.lttng
+ list_lttng_with_opts load-42
+}
+
+function test_auto_load_dir()
+{
+ diag "Test auto load directory"
+
+ stop_lttng_sessiond
+
+ export LTTNG_HOME=
+ export LTTNG_DIR=/tmp/lttng_home
+ mkdir -p $LTTNG_DIR
+ cp -f $CURDIR/load-42.lttng $LTTNG_DIR/
+
+ start_lttng_sessiond $LTTNG_DIR
+ list_lttng_with_opts load-42
+
+ rm -rf $LTTNG_DIR
+}
+
+function test_auto_load_lttng_home()
+{
+ diag "Test auto load by setting LTTNG_HOME"
+
+ stop_lttng_sessiond
+
+ export LTTNG_HOME=/tmp/lttng_home
+ mkdir -p $LTTNG_HOME/.lttng/sessions/auto
+ cp -f $CURDIR/load-42.lttng $LTTNG_HOME/.lttng/sessions/auto
+
+ start_lttng_sessiond
+ list_lttng_with_opts load-42
+
+ rm -rf $LTTNG_HOME/.lttng/sessions/auto
+}
+
+TESTS=(
+ test_auto_load_file
+ test_auto_load_dir
+ test_auto_load_lttng_home
+)
+
+for fct_test in ${TESTS[@]};
+do
+ TRACE_PATH=$(mktemp -d)
+
+ ${fct_test}
+ if [ $? -ne 0 ]; then
+ break;
+ fi
+ # Only delete if successful
+ rm -rf $TRACE_PATH
+done
+
+stop_lttng_sessiond
--
2.17.0
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH lttng-tools] Tests: Added autoloading session test cases
[not found] ` <20180517205041.23774-2-wallinux@gmail.com>
@ 2018-06-06 0:22 ` Jérémie Galarneau
0 siblings, 0 replies; 7+ messages in thread
From: Jérémie Galarneau @ 2018-06-06 0:22 UTC (permalink / raw)
To: Anders Wallin; +Cc: lttng-dev
Merged in master, stable-2.10, and stable-2.9.
Thanks!
Jérémie
On Thu, May 17, 2018 at 10:50:41PM +0200, Anders Wallin wrote:
> lttng-sessiond can auto load sessions at startup;
> - with "--load" option to lttng-sessiond, load one file
> or all sessions files in that directory
> - from session files in $LTTNG_HOME/.lttng/sessions/auto/
> - from session files in $sysconfdir/lttng/sessions/auto
>
> This test case validate the two first scenarios.
>
> Signed-off-by: Anders Wallin <wallinux@gmail.com>
> ---
> tests/fast_regression | 1 +
> .../regression/tools/save-load/test_autoload | 107 ++++++++++++++++++
> 2 files changed, 108 insertions(+)
> create mode 100755 tests/regression/tools/save-load/test_autoload
>
> diff --git a/tests/fast_regression b/tests/fast_regression
> index bbce068f..2f02f872 100644
> --- a/tests/fast_regression
> +++ b/tests/fast_regression
> @@ -13,6 +13,7 @@ regression/tools/snapshots/test_ust_fast
> regression/tools/snapshots/test_ust_streaming
> regression/tools/save-load/test_save
> regression/tools/save-load/test_load
> +regression/tools/save-load/test_autoload
> regression/tools/mi/test_mi
> regression/tools/wildcard/test_event_wildcard
> regression/tools/crash/test_crash
> diff --git a/tests/regression/tools/save-load/test_autoload b/tests/regression/tools/save-load/test_autoload
> new file mode 100755
> index 00000000..26193be6
> --- /dev/null
> +++ b/tests/regression/tools/save-load/test_autoload
> @@ -0,0 +1,107 @@
> +#!/bin/bash
> +#
> +# Copyright (C) - 2018 Anders Wallin <wallinux@gmail.com>
> +#
> +# This library is free software; you can redistribute it and/or modify it under
> +# the terms of the GNU Lesser General Public License as published by the Free
> +# Software Foundation; version 2.1 of the License.
> +#
> +# This library is distributed in the hope that it will be useful, but WITHOUT
> +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
> +# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
> +# details.
> +#
> +# You should have received a copy of the GNU Lesser General Public License
> +# along with this library; if not, write to the Free Software Foundation, Inc.,
> +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
> +
> +TEST_DESC="Auto load session(s)"
> +
> +CURDIR=$(dirname $0)/
> +CONFIG_DIR="${CURDIR}/configuration"
> +TESTDIR=$CURDIR/../../../
> +SESSIOND_BIN="lttng-sessiond"
> +RELAYD_BIN="lttng-relayd"
> +LTTNG_BIN="lttng"
> +export LTTNG_SESSION_CONFIG_XSD_PATH=$(readlink -m ${TESTDIR}../src/common/config/)
> +
> +DIR=$(readlink -f $TESTDIR)
> +
> +NUM_TESTS=10
> +
> +source $TESTDIR/utils/utils.sh
> +
> +# MUST set TESTDIR before calling those functions
> +plan_tests $NUM_TESTS
> +
> +print_test_banner "$TEST_DESC"
> +
> +function test_auto_load_file()
> +{
> + diag "Test auto load file"
> +
> + export LTTNG_HOME=
> +
> + start_lttng_sessiond $CURDIR/load-42.lttng
> + list_lttng_with_opts load-42
> + stop_lttng_sessiond
> +}
> +
> +function test_auto_load_dir()
> +{
> + diag "Test auto load directory"
> +
> + export LTTNG_HOME=
> + export LTTNG_DIR=$(mktemp -d)
> + cp -f $CURDIR/load-42.lttng $LTTNG_DIR/
> +
> + start_lttng_sessiond $LTTNG_DIR
> + list_lttng_with_opts load-42
> + stop_lttng_sessiond
> +
> + rm -rf $LTTNG_DIR
> +}
> +
> +function test_auto_load_lttng_home()
> +{
> + diag "Test auto load by setting LTTNG_HOME"
> +
> + export LTTNG_HOME=$(mktemp -d)
> + mkdir -p $LTTNG_HOME/.lttng/sessions/auto
> + cp -f $CURDIR/load-42.lttng $LTTNG_HOME/.lttng/sessions/auto
> +
> + start_lttng_sessiond
> + list_lttng_with_opts load-42
> + stop_lttng_sessiond
> +
> + rm -rf $LTTNG_HOME
> +}
> +
> +TESTS=(
> + test_auto_load_file
> + test_auto_load_dir
> + test_auto_load_lttng_home
> +)
> +
> +# Need to be sure that no lttng-sessiond is running
> +# - "stop_lttng_sessiond" is using the SESSIOND_PIDS created with
> +# "start_lttng_sessiond"
> +# - "sigstop_lttng_sessiond" keep lttng-runas dangling
> +# - "stop_lttng_sessiond SIGKILL" will leave kernel modules loaded
> +# The code below are killing all lttng-* programs and remove the
> +# the lttng kernel modules
> +SESSIOND_PIDS=$(pgrep $SESSIOND_MATCH)
> +kill $SESSIOND_PIDS
> +stop_lttng_sessiond
> +
> +for fct_test in ${TESTS[@]};
> +do
> + TRACE_PATH=$(mktemp -d)
> +
> + ${fct_test}
> + if [ $? -ne 0 ]; then
> + break;
> + fi
> + # Only delete if successful
> + rm -rf $TRACE_PATH
> +done
> --
> 2.17.0
>
> _______________________________________________
> lttng-dev mailing list
> lttng-dev@lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH lttng-tools] Tests: Added autoloading session test cases
[not found] ` <20180517205041.23774-1-wallinux@gmail.com>
@ 2018-05-17 20:50 ` Anders Wallin
[not found] ` <20180517205041.23774-2-wallinux@gmail.com>
1 sibling, 0 replies; 7+ messages in thread
From: Anders Wallin @ 2018-05-17 20:50 UTC (permalink / raw)
To: lttng-dev
lttng-sessiond can auto load sessions at startup;
- with "--load" option to lttng-sessiond, load one file
or all sessions files in that directory
- from session files in $LTTNG_HOME/.lttng/sessions/auto/
- from session files in $sysconfdir/lttng/sessions/auto
This test case validate the two first scenarios.
Signed-off-by: Anders Wallin <wallinux@gmail.com>
---
tests/fast_regression | 1 +
.../regression/tools/save-load/test_autoload | 107 ++++++++++++++++++
2 files changed, 108 insertions(+)
create mode 100755 tests/regression/tools/save-load/test_autoload
diff --git a/tests/fast_regression b/tests/fast_regression
index bbce068f..2f02f872 100644
--- a/tests/fast_regression
+++ b/tests/fast_regression
@@ -13,6 +13,7 @@ regression/tools/snapshots/test_ust_fast
regression/tools/snapshots/test_ust_streaming
regression/tools/save-load/test_save
regression/tools/save-load/test_load
+regression/tools/save-load/test_autoload
regression/tools/mi/test_mi
regression/tools/wildcard/test_event_wildcard
regression/tools/crash/test_crash
diff --git a/tests/regression/tools/save-load/test_autoload b/tests/regression/tools/save-load/test_autoload
new file mode 100755
index 00000000..26193be6
--- /dev/null
+++ b/tests/regression/tools/save-load/test_autoload
@@ -0,0 +1,107 @@
+#!/bin/bash
+#
+# Copyright (C) - 2018 Anders Wallin <wallinux@gmail.com>
+#
+# This library is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the Free
+# Software Foundation; version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+TEST_DESC="Auto load session(s)"
+
+CURDIR=$(dirname $0)/
+CONFIG_DIR="${CURDIR}/configuration"
+TESTDIR=$CURDIR/../../../
+SESSIOND_BIN="lttng-sessiond"
+RELAYD_BIN="lttng-relayd"
+LTTNG_BIN="lttng"
+export LTTNG_SESSION_CONFIG_XSD_PATH=$(readlink -m ${TESTDIR}../src/common/config/)
+
+DIR=$(readlink -f $TESTDIR)
+
+NUM_TESTS=10
+
+source $TESTDIR/utils/utils.sh
+
+# MUST set TESTDIR before calling those functions
+plan_tests $NUM_TESTS
+
+print_test_banner "$TEST_DESC"
+
+function test_auto_load_file()
+{
+ diag "Test auto load file"
+
+ export LTTNG_HOME=
+
+ start_lttng_sessiond $CURDIR/load-42.lttng
+ list_lttng_with_opts load-42
+ stop_lttng_sessiond
+}
+
+function test_auto_load_dir()
+{
+ diag "Test auto load directory"
+
+ export LTTNG_HOME=
+ export LTTNG_DIR=$(mktemp -d)
+ cp -f $CURDIR/load-42.lttng $LTTNG_DIR/
+
+ start_lttng_sessiond $LTTNG_DIR
+ list_lttng_with_opts load-42
+ stop_lttng_sessiond
+
+ rm -rf $LTTNG_DIR
+}
+
+function test_auto_load_lttng_home()
+{
+ diag "Test auto load by setting LTTNG_HOME"
+
+ export LTTNG_HOME=$(mktemp -d)
+ mkdir -p $LTTNG_HOME/.lttng/sessions/auto
+ cp -f $CURDIR/load-42.lttng $LTTNG_HOME/.lttng/sessions/auto
+
+ start_lttng_sessiond
+ list_lttng_with_opts load-42
+ stop_lttng_sessiond
+
+ rm -rf $LTTNG_HOME
+}
+
+TESTS=(
+ test_auto_load_file
+ test_auto_load_dir
+ test_auto_load_lttng_home
+)
+
+# Need to be sure that no lttng-sessiond is running
+# - "stop_lttng_sessiond" is using the SESSIOND_PIDS created with
+# "start_lttng_sessiond"
+# - "sigstop_lttng_sessiond" keep lttng-runas dangling
+# - "stop_lttng_sessiond SIGKILL" will leave kernel modules loaded
+# The code below are killing all lttng-* programs and remove the
+# the lttng kernel modules
+SESSIOND_PIDS=$(pgrep $SESSIOND_MATCH)
+kill $SESSIOND_PIDS
+stop_lttng_sessiond
+
+for fct_test in ${TESTS[@]};
+do
+ TRACE_PATH=$(mktemp -d)
+
+ ${fct_test}
+ if [ $? -ne 0 ]; then
+ break;
+ fi
+ # Only delete if successful
+ rm -rf $TRACE_PATH
+done
--
2.17.0
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH lttng-tools] Tests: Added autoloading session test cases
[not found] <20180515084505.794-1-wallinux@gmail.com>
@ 2018-05-17 20:50 ` Anders Wallin
[not found] ` <20180517205041.23774-1-wallinux@gmail.com>
1 sibling, 0 replies; 7+ messages in thread
From: Anders Wallin @ 2018-05-17 20:50 UTC (permalink / raw)
To: lttng-dev
Update the first stop of lttng-session to kill all running lttng-sessiond
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH lttng-tools] Tests: Added autoloading session test cases
@ 2018-05-15 8:45 Anders Wallin
0 siblings, 0 replies; 7+ messages in thread
From: Anders Wallin @ 2018-05-15 8:45 UTC (permalink / raw)
To: lttng-dev
lttng-sessiond can auto load sessions at startup;
- with "--load" option to lttng-sessiond, load one file
or all sessions files in that directory
- from session files in $LTTNG_HOME/.lttng/sessions/auto/
- from session files in $sysconfdir/lttng/sessions/auto
This test case validate the two first scenarios.
Signed-off-by: Anders Wallin <wallinux@gmail.com>
---
tests/fast_regression | 1 +
.../regression/tools/save-load/test_autoload | 98 +++++++++++++++++++
2 files changed, 99 insertions(+)
create mode 100755 tests/regression/tools/save-load/test_autoload
diff --git a/tests/fast_regression b/tests/fast_regression
index bbce068f..2f02f872 100644
--- a/tests/fast_regression
+++ b/tests/fast_regression
@@ -13,6 +13,7 @@ regression/tools/snapshots/test_ust_fast
regression/tools/snapshots/test_ust_streaming
regression/tools/save-load/test_save
regression/tools/save-load/test_load
+regression/tools/save-load/test_autoload
regression/tools/mi/test_mi
regression/tools/wildcard/test_event_wildcard
regression/tools/crash/test_crash
diff --git a/tests/regression/tools/save-load/test_autoload b/tests/regression/tools/save-load/test_autoload
new file mode 100755
index 00000000..b9972bc6
--- /dev/null
+++ b/tests/regression/tools/save-load/test_autoload
@@ -0,0 +1,98 @@
+#!/bin/bash
+#
+# Copyright (C) - 2018 Anders Wallin <wallinux@gmail.com>
+#
+# This library is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Lesser General Public License as published by the Free
+# Software Foundation; version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+TEST_DESC="Auto load session(s)"
+
+CURDIR=$(dirname $0)/
+CONFIG_DIR="${CURDIR}/configuration"
+TESTDIR=$CURDIR/../../../
+SESSIOND_BIN="lttng-sessiond"
+RELAYD_BIN="lttng-relayd"
+LTTNG_BIN="lttng"
+export LTTNG_SESSION_CONFIG_XSD_PATH=$(readlink -m ${TESTDIR}../src/common/config/)
+
+DIR=$(readlink -f $TESTDIR)
+
+NUM_TESTS=10
+
+source $TESTDIR/utils/utils.sh
+
+# MUST set TESTDIR before calling those functions
+plan_tests $NUM_TESTS
+
+print_test_banner "$TEST_DESC"
+
+function test_auto_load_file()
+{
+ diag "Test auto load file"
+
+ export LTTNG_HOME=
+
+ start_lttng_sessiond $CURDIR/load-42.lttng
+ list_lttng_with_opts load-42
+ stop_lttng_sessiond
+}
+
+function test_auto_load_dir()
+{
+ diag "Test auto load directory"
+
+ export LTTNG_HOME=
+ export LTTNG_DIR=$(mktemp -d)
+ cp -f $CURDIR/load-42.lttng $LTTNG_DIR/
+
+ start_lttng_sessiond $LTTNG_DIR
+ list_lttng_with_opts load-42
+ stop_lttng_sessiond
+
+ rm -rf $LTTNG_DIR
+}
+
+function test_auto_load_lttng_home()
+{
+ diag "Test auto load by setting LTTNG_HOME"
+
+ export LTTNG_HOME=$(mktemp -d)
+ mkdir -p $LTTNG_HOME/.lttng/sessions/auto
+ cp -f $CURDIR/load-42.lttng $LTTNG_HOME/.lttng/sessions/auto
+
+ start_lttng_sessiond
+ list_lttng_with_opts load-42
+ stop_lttng_sessiond
+
+ rm -rf $LTTNG_HOME
+}
+
+TESTS=(
+ test_auto_load_file
+ test_auto_load_dir
+ test_auto_load_lttng_home
+)
+
+stop_lttng_sessiond
+
+for fct_test in ${TESTS[@]};
+do
+ TRACE_PATH=$(mktemp -d)
+
+ ${fct_test}
+ if [ $? -ne 0 ]; then
+ break;
+ fi
+ # Only delete if successful
+ rm -rf $TRACE_PATH
+done
--
2.17.0
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH lttng-tools] Tests: Added autoloading session test cases
[not found] ` <20180514161658.GB9461@joraj-alpa>
@ 2018-05-14 20:52 ` Anders Wallin
0 siblings, 0 replies; 7+ messages in thread
From: Anders Wallin @ 2018-05-14 20:52 UTC (permalink / raw)
To: Jonathan Rajotte-Julien; +Cc: lttng-dev
[-- Attachment #1.1: Type: text/plain, Size: 5756 bytes --]
Hi,
I will update the patch and resend it tomorrow
Regards
Anders
mån 14 maj 2018 kl 18:17 skrev Jonathan Rajotte-Julien <
jonathan.rajotte-julien@efficios.com>:
> Hi Anders
>
> Thanks for proposing this patch.
>
> We will need more context here. Are those currently failing and exposing a
> problem?
>
Yes, lttng-tools 2.10.4 is broken when having auto-load sessions, see
https://lists.lttng.org/pipermail/lttng-dev/2018-May/028014.html
I will add a longer commit message
>
> See comments inline.
>
>
> On Mon, May 14, 2018 at 05:30:53PM +0200, Anders Wallin wrote:
> > Signed-off-by: Anders Wallin <wallinux@gmail.com>
> > ---
> > tests/fast_regression | 1 +
> > .../regression/tools/save-load/test_autoload | 101 ++++++++++++++++++
> > 2 files changed, 102 insertions(+)
> > create mode 100755 tests/regression/tools/save-load/test_autoload
> >
> > diff --git a/tests/fast_regression b/tests/fast_regression
> > index bbce068f..2f02f872 100644
> > --- a/tests/fast_regression
> > +++ b/tests/fast_regression
> > @@ -13,6 +13,7 @@ regression/tools/snapshots/test_ust_fast
> > regression/tools/snapshots/test_ust_streaming
> > regression/tools/save-load/test_save
> > regression/tools/save-load/test_load
> > +regression/tools/save-load/test_autoload
> > regression/tools/mi/test_mi
> > regression/tools/wildcard/test_event_wildcard
> > regression/tools/crash/test_crash
> > diff --git a/tests/regression/tools/save-load/test_autoload
> b/tests/regression/tools/save-load/test_autoload
> > new file mode 100755
> > index 00000000..ea1210de
> > --- /dev/null
> > +++ b/tests/regression/tools/save-load/test_autoload
> > @@ -0,0 +1,101 @@
> > +#!/bin/bash
> > +#
> > +# Copyright (C) - 2014 David Goulet <dgoulet@efficios.com>
>
> I doubt dgoulet wrote this file :). Even if this was "copied" from another
> test
> plan the majority of the test plan was written/contributed by you.
> Your name and email should be there.
>
Ok
>
> > +#
> > +# This library is free software; you can redistribute it and/or modify
> it under
> > +# the terms of the GNU Lesser General Public License as published by
> the Free
> > +# Software Foundation; version 2.1 of the License.
> > +#
> > +# This library is distributed in the hope that it will be useful, but
> WITHOUT
> > +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
> FITNESS
> > +# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
> for more
> > +# details.
> > +#
> > +# You should have received a copy of the GNU Lesser General Public
> License
> > +# along with this library; if not, write to the Free Software
> Foundation, Inc.,
> > +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
> > +
> > +TEST_DESC="Load session(s)"
>
> Should reflect the overall test: "Auto load session(s)"
>
OK
>
> > +
> > +CURDIR=$(dirname $0)/
> > +CONFIG_DIR="${CURDIR}/configuration"
> > +TESTDIR=$CURDIR/../../../
> > +SESSIOND_BIN="lttng-sessiond"
> > +RELAYD_BIN="lttng-relayd"
> > +LTTNG_BIN="lttng"
> > +export LTTNG_SESSION_CONFIG_XSD_PATH=$(readlink -m
> ${TESTDIR}../src/common/config/)
> > +
> > +DIR=$(readlink -f $TESTDIR)
> > +
> > +NUM_TESTS=10
> > +
> > +source $TESTDIR/utils/utils.sh
> > +
> > +# MUST set TESTDIR before calling those functions
> > +plan_tests $NUM_TESTS
> > +
> > +print_test_banner "$TEST_DESC"
> > +
> > +function test_auto_load_file()
> > +{
> > + diag "Test auto load file"
> > +
> > + stop_lttng_sessiond
>
> The stop_lttng_sessiond should be moved at the end of each sub test.
>
Ok, but I need one stop_lttng_session before the test, since it can't be
any lttng_sessiond
running when starting the tests.
>
> > + export LTTNG_HOME=
> > +
> > + start_lttng_sessiond $CURDIR/load-42.lttng
> > + list_lttng_with_opts load-42
>
> Put stop_lttng_sessiond here.
>
> > +}
> > +
> > +function test_auto_load_dir()
> > +{
> > + diag "Test auto load directory"
> > +
> > + stop_lttng_sessiond
> > +
> > + export LTTNG_HOME=
> > + export LTTNG_DIR=/tmp/lttng_home
>
> Use "mktemp -d" here.
>
OK
>
> > + mkdir -p $LTTNG_DIR
> > + cp -f $CURDIR/load-42.lttng $LTTNG_DIR/
> > +
> > + start_lttng_sessiond $LTTNG_DIR
> > + list_lttng_with_opts load-42
> > +
> > + rm -rf $LTTNG_DIR
> > +}
> > +
> > +function test_auto_load_lttng_home()
> > +{
> > + diag "Test auto load by setting LTTNG_HOME"
> > +
> > + stop_lttng_sessiond
> > +
> > + export LTTNG_HOME=/tmp/lttng_home
>
> Use "mktemp -d" here.
>
OK
>
> > + mkdir -p $LTTNG_HOME/.lttng/sessions/auto
> > + cp -f $CURDIR/load-42.lttng $LTTNG_HOME/.lttng/sessions/auto
> > +
> > + start_lttng_sessiond
> > + list_lttng_with_opts load-42
> > +
> > + rm -rf $LTTNG_HOME/.lttng/sessions/auto
>
> Make sure to remove the complete LTTNG_HOME directory.
>
OK
>
> > +}
> > +
> > +TESTS=(
> > + test_auto_load_file
> > + test_auto_load_dir
> > + test_auto_load_lttng_home
> > +)
> > +
> > +for fct_test in ${TESTS[@]};
> > +do
> > + TRACE_PATH=$(mktemp -d)
> > +
> > + ${fct_test}
> > + if [ $? -ne 0 ]; then
> > + break;
> > + fi
> > + # Only delete if successful
> > + rm -rf $TRACE_PATH
> > +done
> > +
> > +stop_lttng_sessiond
>
> Remove this.
>
OK
>
> > --
> > 2.17.0
> >
> > _______________________________________________
> > lttng-dev mailing list
> > lttng-dev@lists.lttng.org
> > https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>
> --
> Jonathan Rajotte-Julien
> EfficiOS
>
[-- Attachment #1.2: Type: text/html, Size: 8433 bytes --]
[-- Attachment #2: Type: text/plain, Size: 156 bytes --]
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH lttng-tools] Tests: Added autoloading session test cases
[not found] <20180514153053.27665-1-wallinux@gmail.com>
@ 2018-05-14 16:16 ` Jonathan Rajotte-Julien
[not found] ` <20180514161658.GB9461@joraj-alpa>
1 sibling, 0 replies; 7+ messages in thread
From: Jonathan Rajotte-Julien @ 2018-05-14 16:16 UTC (permalink / raw)
To: Anders Wallin; +Cc: lttng-dev
Hi Anders
Thanks for proposing this patch.
We will need more context here. Are those currently failing and exposing a
problem?
See comments inline.
On Mon, May 14, 2018 at 05:30:53PM +0200, Anders Wallin wrote:
> Signed-off-by: Anders Wallin <wallinux@gmail.com>
> ---
> tests/fast_regression | 1 +
> .../regression/tools/save-load/test_autoload | 101 ++++++++++++++++++
> 2 files changed, 102 insertions(+)
> create mode 100755 tests/regression/tools/save-load/test_autoload
>
> diff --git a/tests/fast_regression b/tests/fast_regression
> index bbce068f..2f02f872 100644
> --- a/tests/fast_regression
> +++ b/tests/fast_regression
> @@ -13,6 +13,7 @@ regression/tools/snapshots/test_ust_fast
> regression/tools/snapshots/test_ust_streaming
> regression/tools/save-load/test_save
> regression/tools/save-load/test_load
> +regression/tools/save-load/test_autoload
> regression/tools/mi/test_mi
> regression/tools/wildcard/test_event_wildcard
> regression/tools/crash/test_crash
> diff --git a/tests/regression/tools/save-load/test_autoload b/tests/regression/tools/save-load/test_autoload
> new file mode 100755
> index 00000000..ea1210de
> --- /dev/null
> +++ b/tests/regression/tools/save-load/test_autoload
> @@ -0,0 +1,101 @@
> +#!/bin/bash
> +#
> +# Copyright (C) - 2014 David Goulet <dgoulet@efficios.com>
I doubt dgoulet wrote this file :). Even if this was "copied" from another test
plan the majority of the test plan was written/contributed by you.
Your name and email should be there.
> +#
> +# This library is free software; you can redistribute it and/or modify it under
> +# the terms of the GNU Lesser General Public License as published by the Free
> +# Software Foundation; version 2.1 of the License.
> +#
> +# This library is distributed in the hope that it will be useful, but WITHOUT
> +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
> +# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
> +# details.
> +#
> +# You should have received a copy of the GNU Lesser General Public License
> +# along with this library; if not, write to the Free Software Foundation, Inc.,
> +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
> +
> +TEST_DESC="Load session(s)"
Should reflect the overall test: "Auto load session(s)"
> +
> +CURDIR=$(dirname $0)/
> +CONFIG_DIR="${CURDIR}/configuration"
> +TESTDIR=$CURDIR/../../../
> +SESSIOND_BIN="lttng-sessiond"
> +RELAYD_BIN="lttng-relayd"
> +LTTNG_BIN="lttng"
> +export LTTNG_SESSION_CONFIG_XSD_PATH=$(readlink -m ${TESTDIR}../src/common/config/)
> +
> +DIR=$(readlink -f $TESTDIR)
> +
> +NUM_TESTS=10
> +
> +source $TESTDIR/utils/utils.sh
> +
> +# MUST set TESTDIR before calling those functions
> +plan_tests $NUM_TESTS
> +
> +print_test_banner "$TEST_DESC"
> +
> +function test_auto_load_file()
> +{
> + diag "Test auto load file"
> +
> + stop_lttng_sessiond
The stop_lttng_sessiond should be moved at the end of each sub test.
> + export LTTNG_HOME=
> +
> + start_lttng_sessiond $CURDIR/load-42.lttng
> + list_lttng_with_opts load-42
Put stop_lttng_sessiond here.
> +}
> +
> +function test_auto_load_dir()
> +{
> + diag "Test auto load directory"
> +
> + stop_lttng_sessiond
> +
> + export LTTNG_HOME=
> + export LTTNG_DIR=/tmp/lttng_home
Use "mktemp -d" here.
> + mkdir -p $LTTNG_DIR
> + cp -f $CURDIR/load-42.lttng $LTTNG_DIR/
> +
> + start_lttng_sessiond $LTTNG_DIR
> + list_lttng_with_opts load-42
> +
> + rm -rf $LTTNG_DIR
> +}
> +
> +function test_auto_load_lttng_home()
> +{
> + diag "Test auto load by setting LTTNG_HOME"
> +
> + stop_lttng_sessiond
> +
> + export LTTNG_HOME=/tmp/lttng_home
Use "mktemp -d" here.
> + mkdir -p $LTTNG_HOME/.lttng/sessions/auto
> + cp -f $CURDIR/load-42.lttng $LTTNG_HOME/.lttng/sessions/auto
> +
> + start_lttng_sessiond
> + list_lttng_with_opts load-42
> +
> + rm -rf $LTTNG_HOME/.lttng/sessions/auto
Make sure to remove the complete LTTNG_HOME directory.
> +}
> +
> +TESTS=(
> + test_auto_load_file
> + test_auto_load_dir
> + test_auto_load_lttng_home
> +)
> +
> +for fct_test in ${TESTS[@]};
> +do
> + TRACE_PATH=$(mktemp -d)
> +
> + ${fct_test}
> + if [ $? -ne 0 ]; then
> + break;
> + fi
> + # Only delete if successful
> + rm -rf $TRACE_PATH
> +done
> +
> +stop_lttng_sessiond
Remove this.
> --
> 2.17.0
>
> _______________________________________________
> lttng-dev mailing list
> lttng-dev@lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
--
Jonathan Rajotte-Julien
EfficiOS
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2018-06-06 0:22 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-14 15:30 [PATCH lttng-tools] Tests: Added autoloading session test cases Anders Wallin
[not found] <20180514153053.27665-1-wallinux@gmail.com>
2018-05-14 16:16 ` Jonathan Rajotte-Julien
[not found] ` <20180514161658.GB9461@joraj-alpa>
2018-05-14 20:52 ` Anders Wallin
2018-05-15 8:45 Anders Wallin
[not found] <20180515084505.794-1-wallinux@gmail.com>
2018-05-17 20:50 ` Anders Wallin
[not found] ` <20180517205041.23774-1-wallinux@gmail.com>
2018-05-17 20:50 ` Anders Wallin
[not found] ` <20180517205041.23774-2-wallinux@gmail.com>
2018-06-06 0:22 ` Jérémie Galarneau
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.