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