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