* [PATCH lttng-tools 2/2] Tests: Make warn_processes.sh more portable
[not found] <1465489291-20269-1-git-send-email-mjeanson@efficios.com>
@ 2016-06-09 16:21 ` Michael Jeanson
2016-06-14 18:55 ` [PATCH lttng-tools 1/2] Fix: add missing script to dist Jérémie Galarneau
1 sibling, 0 replies; 3+ messages in thread
From: Michael Jeanson @ 2016-06-09 16:21 UTC (permalink / raw)
To: lttng-dev; +Cc: jgalar
Options to pgrep aren't standardised across coreutils
implementations, use a more common option.
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
---
tests/Makefile.am | 2 +-
tests/utils/Makefile.am | 2 +-
tests/utils/warn_lttng_processes.sh | 23 -----------------------
tests/utils/warn_processes.sh | 25 +++++++++++++++++++++++++
4 files changed, 27 insertions(+), 25 deletions(-)
delete mode 100755 tests/utils/warn_lttng_processes.sh
create mode 100755 tests/utils/warn_processes.sh
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 58caeb1..3600e99 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -5,7 +5,7 @@ if BUILD_TESTS
SUBDIRS += . utils regression unit stress destructive
if HAS_PGREP
check-am:
- $(top_srcdir)/tests/utils/warn_lttng_processes.sh $(PGREP)
+ $(top_srcdir)/tests/utils/warn_processes.sh $(PGREP)
endif
else
@echo "========================================="
diff --git a/tests/utils/Makefile.am b/tests/utils/Makefile.am
index bd79d20..9d327e0 100644
--- a/tests/utils/Makefile.am
+++ b/tests/utils/Makefile.am
@@ -1,6 +1,6 @@
SUBDIRS = . tap testapp
-EXTRA_DIST = utils.sh test_utils.py babelstats.pl warn_lttng_processes.sh
+EXTRA_DIST = utils.sh test_utils.py babelstats.pl warn_processes.sh
dist_noinst_SCRIPTS = utils.sh test_utils.py babelstats.pl
noinst_LTLIBRARIES = libtestutils.la
diff --git a/tests/utils/warn_lttng_processes.sh b/tests/utils/warn_lttng_processes.sh
deleted file mode 100755
index 939163b..0000000
--- a/tests/utils/warn_lttng_processes.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/bash
-
-if [ x$LTTNG_TOOLS_TESTS_DISABLE_WARN_LTTNG_PROCESSES == x1 ]; then
- exit
-fi
-
-color_warn='\E[1;33m'
-color_reset='\E[0m'
-color_bold='\E[1m'
-
-lttng_processes="$("$1" 'lttng|gen-ust-.+' -a | grep -v "$(basename "$0")")"
-
-if [ $? -eq 0 ]; then
- pids="$(cut -d ' ' -f 1 <<< "$lttng_processes" | tr '\n' ' ')"
-
- echo -e "${color_warn}Warning: the following LTTng processes were detected running on the system:$color_reset"
- echo
- echo "$lttng_processes"
- echo
- echo -e "Here's how to kill them: ${color_bold}kill -9 $pids$color_reset"
- echo -e "${color_warn}If you leave them alive, some tests could fail.$color_reset"
- echo
-fi
diff --git a/tests/utils/warn_processes.sh b/tests/utils/warn_processes.sh
new file mode 100755
index 0000000..fee1d0f
--- /dev/null
+++ b/tests/utils/warn_processes.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+PGREP="$1"
+
+if [ x$LTTNG_TOOLS_TESTS_DISABLE_WARN_LTTNG_PROCESSES == x1 ]; then
+ exit
+fi
+
+color_warn='\E[1;33m'
+color_reset='\E[0m'
+color_bold='\E[1m'
+
+lttng_processes="$("$PGREP" -l 'lttng|gen-ust-.+')"
+
+if [ $? -eq 0 ]; then
+ pids="$(cut -d ' ' -f 1 <<< "$lttng_processes" | tr '\n' ' ')"
+
+ echo -e "${color_warn}Warning: the following LTTng processes were detected running on the system:$color_reset"
+ echo
+ echo "$lttng_processes"
+ echo
+ echo -e "Here's how to kill them: ${color_bold}kill -9 $pids$color_reset"
+ echo -e "${color_warn}If you leave them alive, some tests could fail.$color_reset"
+ echo
+fi
--
2.7.4
_______________________________________________
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] 3+ messages in thread
* Re: [PATCH lttng-tools 1/2] Fix: add missing script to dist
[not found] <1465489291-20269-1-git-send-email-mjeanson@efficios.com>
2016-06-09 16:21 ` [PATCH lttng-tools 2/2] Tests: Make warn_processes.sh more portable Michael Jeanson
@ 2016-06-14 18:55 ` Jérémie Galarneau
1 sibling, 0 replies; 3+ messages in thread
From: Jérémie Galarneau @ 2016-06-14 18:55 UTC (permalink / raw)
To: Michael Jeanson; +Cc: lttng-dev, Jeremie Galarneau
Both patches merged, thanks!
Jérémie
On Thu, Jun 9, 2016 at 12:21 PM, Michael Jeanson <mjeanson@efficios.com> wrote:
> Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
> ---
> tests/utils/Makefile.am | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/utils/Makefile.am b/tests/utils/Makefile.am
> index 4208648..bd79d20 100644
> --- a/tests/utils/Makefile.am
> +++ b/tests/utils/Makefile.am
> @@ -1,6 +1,6 @@
> SUBDIRS = . tap testapp
>
> -EXTRA_DIST = utils.sh test_utils.py babelstats.pl
> +EXTRA_DIST = utils.sh test_utils.py babelstats.pl warn_lttng_processes.sh
> dist_noinst_SCRIPTS = utils.sh test_utils.py babelstats.pl
> noinst_LTLIBRARIES = libtestutils.la
>
> --
> 2.7.4
>
--
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH lttng-tools 1/2] Fix: add missing script to dist
@ 2016-06-09 16:21 Michael Jeanson
0 siblings, 0 replies; 3+ messages in thread
From: Michael Jeanson @ 2016-06-09 16:21 UTC (permalink / raw)
To: lttng-dev; +Cc: jgalar
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
---
tests/utils/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/utils/Makefile.am b/tests/utils/Makefile.am
index 4208648..bd79d20 100644
--- a/tests/utils/Makefile.am
+++ b/tests/utils/Makefile.am
@@ -1,6 +1,6 @@
SUBDIRS = . tap testapp
-EXTRA_DIST = utils.sh test_utils.py babelstats.pl
+EXTRA_DIST = utils.sh test_utils.py babelstats.pl warn_lttng_processes.sh
dist_noinst_SCRIPTS = utils.sh test_utils.py babelstats.pl
noinst_LTLIBRARIES = libtestutils.la
--
2.7.4
_______________________________________________
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] 3+ messages in thread
end of thread, other threads:[~2016-06-14 18:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <1465489291-20269-1-git-send-email-mjeanson@efficios.com>
2016-06-09 16:21 ` [PATCH lttng-tools 2/2] Tests: Make warn_processes.sh more portable Michael Jeanson
2016-06-14 18:55 ` [PATCH lttng-tools 1/2] Fix: add missing script to dist Jérémie Galarneau
2016-06-09 16:21 Michael Jeanson
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.