From 3adf9cad47532d9ebf7ae3e4e618dfe7100008fb Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Tue, 13 Sep 2016 13:44:04 +1000 Subject: [PATCH] ctdb-tests: Factor out new local daemons functions ps_ctdbd Useful for being able to ensure that tests are doing what is expected. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12254 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- ctdb/tests/simple/28_zero_eventscripts.sh | 7 +------ ctdb/tests/simple/scripts/local_daemons.bash | 10 ++++++++++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ctdb/tests/simple/28_zero_eventscripts.sh b/ctdb/tests/simple/28_zero_eventscripts.sh index 7c03ae496810..fc31c4a2c121 100755 --- a/ctdb/tests/simple/28_zero_eventscripts.sh +++ b/ctdb/tests/simple/28_zero_eventscripts.sh @@ -35,11 +35,6 @@ CTDB_EVENT_SCRIPT_DIR="$empty_dir" daemons_start wait_until_ready -# If this fails to find processes then the tests fails, so look at -# full command-line so this will work with valgrind. Note that the -# output could be generated with pgrep's -a option but it doesn't -# exist in older versions. -ps -p $(pgrep -f '\' | xargs | sed -e 's| |,|g') -o args ww +ps_ctdbd -echo echo "Good, that seems to work!" diff --git a/ctdb/tests/simple/scripts/local_daemons.bash b/ctdb/tests/simple/scripts/local_daemons.bash index fb1e7e1cd5f6..2d6ec56b80f2 100644 --- a/ctdb/tests/simple/scripts/local_daemons.bash +++ b/ctdb/tests/simple/scripts/local_daemons.bash @@ -173,3 +173,13 @@ _restart_ctdb_all () daemons_stop daemons_start } + +ps_ctdbd () +{ + # If this fails to find processes then the tests fails, so + # look at full command-line so this will work with valgrind. + # Note that the output could be generated with pgrep's -a + # option but it doesn't exist in older versions. + ps -p $(pgrep -f '\' | xargs | sed -e 's| |,|g') -o args ww + echo +} -- 2.34.1