diff options
author | Marian Csontos <mcsontos@redhat.com> | 2017-12-12 12:14:15 +0100 |
---|---|---|
committer | Marian Csontos <mcsontos@redhat.com> | 2017-12-12 13:17:07 +0100 |
commit | 2f4c2a43d49d90875ea31b1507cd0dfcdb049e88 (patch) | |
tree | ddca797a7e2bc617c08e7ab3edd7cadae5c5490e | |
parent | b76c6951aa5c41b19fc34342ea2e946d7e0a3d24 (diff) | |
download | lvm2-2f4c2a43d49d90875ea31b1507cd0dfcdb049e88.tar.gz |
test: lvmdbusd is used for process name
lvmdbusd was started, but the process was not recognized by pgrep.
- configure does not make the script executable - set the flag
explicitly when running make check,
- process name changed to lvmdbusd. The previous python3 value
originated from the use of /usr/bin/env.
-rw-r--r-- | test/lib/aux.sh | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/test/lib/aux.sh b/test/lib/aux.sh index de63167ca..a436f8431 100644 --- a/test/lib/aux.sh +++ b/test/lib/aux.sh @@ -318,7 +318,7 @@ prepare_lvmdbusd() { # FIXME: This is not correct! Daemon is auto started. echo -n "## checking lvmdbusd is NOT running..." - if pgrep -f -l lvmdbusd | grep python3 ; then + if pgrep -f -l lvmdbusd | grep python3 || pgrep -x -l lvmdbusd ; then skip "Cannot run lvmdbusd while existing lvmdbusd process exists" fi echo ok @@ -327,6 +327,10 @@ prepare_lvmdbusd() { if test -z "${installed_testsuite+varset}"; then # NOTE: this is always present - additional checks are needed: daemon="$abs_top_builddir/daemons/lvmdbusd/lvmdbusd" + if ! test -x "$daemon" && chmod ugo+x "$daemon"; then + echo "Failed to make '$daemon' executable">&2 + return 1 + fi # Setup the python path so we can run export PYTHONPATH="$abs_top_builddir/daemons" else @@ -351,12 +355,9 @@ prepare_lvmdbusd() { sleep 1 echo -n "## checking lvmdbusd IS running..." - if ! pgrep -f -l lvmdbusd | grep python3; then - echo "Failed to start lvmdbusd daemon" - return 1 - fi + comm= # TODO: Is there a better check than wait 1 second and check pid? - if ! ps -p $pid -o comm= >/dev/null || [[ $(ps -p $pid -o comm=) != python3 ]]; then + if ! comm=$(ps -p $pid -o comm=) >/dev/null || [[ $comm != lvmdbusd ]]; then echo "Failed to start lvmdbusd daemon" return 1 fi |