From ec6a4f3c7413f4fee054d0d8af49b2dad42a2c5f Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Thu, 9 Jun 2016 12:21:31 -0400 Subject: [PATCH] Tests: Make warn_processes.sh more portable MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Options to pgrep aren't standardised across coreutils implementations, use a more common option. Signed-off-by: Michael Jeanson Signed-off-by: Jérémie Galarneau --- tests/Makefile.am | 2 +- tests/utils/Makefile.am | 2 +- tests/utils/{warn_lttng_processes.sh => warn_processes.sh} | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) rename tests/utils/{warn_lttng_processes.sh => warn_processes.sh} (87%) diff --git a/tests/Makefile.am b/tests/Makefile.am index 58caeb159..3600e99d8 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 bd79d20e3..9d327e0ec 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_processes.sh similarity index 87% rename from tests/utils/warn_lttng_processes.sh rename to tests/utils/warn_processes.sh index 939163b39..fee1d0f58 100755 --- a/tests/utils/warn_lttng_processes.sh +++ b/tests/utils/warn_processes.sh @@ -1,5 +1,7 @@ #!/bin/bash +PGREP="$1" + if [ x$LTTNG_TOOLS_TESTS_DISABLE_WARN_LTTNG_PROCESSES == x1 ]; then exit fi @@ -8,7 +10,7 @@ color_warn='\E[1;33m' color_reset='\E[0m' color_bold='\E[1m' -lttng_processes="$("$1" 'lttng|gen-ust-.+' -a | grep -v "$(basename "$0")")" +lttng_processes="$("$PGREP" -l 'lttng|gen-ust-.+')" if [ $? -eq 0 ]; then pids="$(cut -d ' ' -f 1 <<< "$lttng_processes" | tr '\n' ' ')" -- 2.34.1