74b1de
From a4f01ad90a0c0dfd0655da509c5ed2a11a507cc3 Mon Sep 17 00:00:00 2001
74b1de
From: Mohit Agrawal <moagrawal@redhat.com>
74b1de
Date: Mon, 17 Jun 2019 11:10:42 +0530
74b1de
Subject: [PATCH 326/335] tests: subdir-mount.t is failing for brick_mux
74b1de
 regrssion
74b1de
74b1de
To avoid the failure wait to run hook script S13create-subdir-mounts.sh
74b1de
after executed add-brick command by test case.
74b1de
74b1de
This is required as a dependency for the bz referenced below.
74b1de
74b1de
Backport of https://review.gluster.org/c/glusterfs/+/22877
74b1de
74b1de
Change-Id: I063b6d0f86a550ed0a0527255e4dfbe8f0a8c02e
74b1de
BUG: 1686800
74b1de
Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
74b1de
Reviewed-on: https://code.engineering.redhat.com/gerrit/185857
74b1de
Tested-by: RHGS Build Bot <nigelb@redhat.com>
74b1de
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
74b1de
---
74b1de
 tests/features/subdir-mount.t | 11 ++++++++---
74b1de
 1 file changed, 8 insertions(+), 3 deletions(-)
74b1de
74b1de
diff --git a/tests/features/subdir-mount.t b/tests/features/subdir-mount.t
74b1de
index 8401946..a02bd6b 100644
74b1de
--- a/tests/features/subdir-mount.t
74b1de
+++ b/tests/features/subdir-mount.t
74b1de
@@ -85,12 +85,17 @@ TEST $CLI volume start $V0
74b1de
 TEST $GFS --subdir-mount /subdir1/subdir1.1/subdir1.2 -s $H0 --volfile-id $V0 $M2
74b1de
 TEST stat $M2
74b1de
 
74b1de
+initcnt=`grep -i create-subdir-mounts /var/log/glusterfs/glusterd.log  | wc -l`
74b1de
 # mount shouldn't fail even after add-brick
74b1de
 TEST $CLI volume add-brick $V0 replica 2 $H0:$B0/${V0}{5,6};
74b1de
 
74b1de
-# Give time for client process to get notified and use the new
74b1de
-# volfile after add-brick
74b1de
-sleep 1
74b1de
+# Wait to execute create-subdir-mounts.sh script by glusterd
74b1de
+newcnt=`grep -i create-subdir-mounts /var/log/glusterfs/glusterd.log  | wc -l`
74b1de
+while [ $newcnt -eq $initcnt ]
74b1de
+do
74b1de
+   newcnt=`grep -i create-subdir-mounts /var/log/glusterfs/glusterd.log  | wc -l`
74b1de
+   sleep 1
74b1de
+done
74b1de
 
74b1de
 # Existing mount should still be active
74b1de
 mount_inode=$(stat --format "%i" "$M2")
74b1de
-- 
74b1de
1.8.3.1
74b1de