From 74cf4e1920db1edae6728cfe632e4ca7aea5be59 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Tue, 19 Aug 2014 16:14:03 -0700 Subject: porting: `pidof` portability for OSX/FreeBSD - Provide a portable `pidof` just to be used specifically with glusterfs regression tests on OSX and FreeBSD. This was written after countless hrs of effort to get a sane `pidof` working on either of the environments. `pidof` comes at the wake of lack of proper procfs support and also incompatible way of handling process names since glusterd/glusterfs are symbolic links to 'glusterfsd' - tests/utils/* directory should be part of 'PATH' to avoid abspath calculation using $(dirname) - cleanup() - rpcinfo command prints error on FreeBSD/OSX fix it Change-Id: I35f86273624cb279da1c8fae056ca27669e251d8 BUG: 1131713 Signed-off-by: Harshavardhana Reviewed-on: http://review.gluster.org/8499 Reviewed-by: Jeff Darcy Tested-by: Gluster Build System --- run-tests.sh | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'run-tests.sh') diff --git a/run-tests.sh b/run-tests.sh index 8db2ce7035c..bcf2a69a5cc 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -60,6 +60,14 @@ function check_dependencies() MISSING="$MISSING pidof" fi + # check for psutil python package + test `uname -s` == "Darwin" || test `uname -s` == "FreeBSD" && { + pip show psutil | grep -q psutil >/dev/null 2>&1 + if [ $? -ne 0 ]; then + MISSING="$MISSING psutil" + fi + } + ## If dependencies are missing, warn the user and abort if [ "x$MISSING" != "x" ]; then test "x${force}" != "xyes" && echo "Aborting." -- cgit