summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Hernandez <xhernandez@datalab.es>2014-07-10 10:19:06 +0200
committerVijay Bellur <vbellur@redhat.com>2014-07-11 00:12:01 -0700
commit6b4702897bd56e29db4db06f8cf896f89df1133c (patch)
tree37011f50741f81f020cea4e86f894f81d49ee68c
parent6532a65b56a652622612a6edcd03fff90fbeff0f (diff)
tests: Fixed spurious failure in bug-887098-gmount-crash.t
This script was trying to see if the mount process died by doing a 'ps ax' and a grep of the original pid in the results. After that the pid of the first line returned by grep was compared to the original pid. This method can lead to false negatives because it's possible that the original pid appears in some other part of the 'ps ax' list. This patch uses get_mount_process_pid() from volume.rc to check if the process is still alive. Change-Id: I0285366e601a146793c47e9c1156a4bb36d6fcb3 BUG: 1092850 Signed-off-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-on: http://review.gluster.org/8286 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
-rw-r--r--tests/bugs/bug-887098-gmount-crash.t10
1 files changed, 2 insertions, 8 deletions
diff --git a/tests/bugs/bug-887098-gmount-crash.t b/tests/bugs/bug-887098-gmount-crash.t
index cfe1c97fb0f..5a6a9fdb931 100644
--- a/tests/bugs/bug-887098-gmount-crash.t
+++ b/tests/bugs/bug-887098-gmount-crash.t
@@ -16,18 +16,12 @@ TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{1,2,3,4};
EXPECT "$V0" volinfo_field $V0 'Volume Name';
EXPECT 'Created' volinfo_field $V0 'Status';
-function pidgrep()
-{
- ps ax | grep "$1" | grep -v grep | awk '{print $1}' | head -1
-}
-
-
## Start volume and verify
TEST $CLI volume start $V0;
EXPECT 'Started' volinfo_field $V0 'Status';
TEST glusterfs -s $H0 --volfile-id=$V0 --acl $M0
-MOUNT_PID=`ps ax |grep "glusterfs -s $H0 --volfile-id=$V0 --acl $M0" | grep -v grep | awk '{print $1}' | head -1`
+MOUNT_PID=$(get_mount_process_pid $V0)
for i in {1..25};
do
@@ -35,7 +29,7 @@ do
cp -RPp $M0/tmp_$i $M0/newtmp_$i && cat /etc/hosts > $M0/newtmp_$i/newfile
done
-EXPECT "$MOUNT_PID" pidgrep $MOUNT_PID
+EXPECT "$MOUNT_PID" get_mount_process_pid $V0
TEST rm -rf $M0/*
EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0