summaryrefslogtreecommitdiffstats
path: root/tests/basic/namespace.t
diff options
context:
space:
mode:
authorVarsha Rao <varao@redhat.com>2018-02-27 11:33:30 +0530
committerAtin Mukherjee <amukherj@redhat.com>2018-02-27 18:31:38 +0530
commit07372c3729578cd8580209eac3ea7a981efeba3e (patch)
treebb60db7a72566e996b635f09bf634b10e0ecd207 /tests/basic/namespace.t
parent5196bfa6e633475a3f5b8d413e2d1e7c870b28f2 (diff)
downloadglusterfs-07372c3729578cd8580209eac3ea7a981efeba3e.tar.gz
glusterfs-07372c3729578cd8580209eac3ea7a981efeba3e.tar.xz
glusterfs-07372c3729578cd8580209eac3ea7a981efeba3e.zip
tests/basic/namespace: Check if brick multiplex is enabled
This patch fixes the namespace test failure when brick multiplexing is enabled. By changing the log file name, when brick multiplexing is enabled. As only one log file generated for all bricks. Change-Id: Ide941946e5e1b2676e7139e1b5bf6b93b93c0815 Signed-off-by: Varsha Rao <varao@redhat.com>
Diffstat (limited to 'tests/basic/namespace.t')
-rw-r--r--tests/basic/namespace.t23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/basic/namespace.t b/tests/basic/namespace.t
index ea473abbc1..7f4fe2c926 100644
--- a/tests/basic/namespace.t
+++ b/tests/basic/namespace.t
@@ -10,12 +10,35 @@ NAMESPACE_HASH=28153613
NAMESPACE2_HASH=3926991974
NAMESPACE3_HASH=3493960770
+function check_brick_multiplex() {
+ $CLI volume info|grep "cluster.brick-multiplex" &>/dev/null
+ rt=$?
+ cnt="$(ls /var/log/glusterfs/bricks|wc -l)"
+
+ if [ $rt -eq 0 ]; then
+ local ret=$($CLI volume info|grep "cluster.brick-multiplex"|cut -d" " -f2)
+
+ if [ $ret = "on" ] || [ $cnt -eq 1 ]; then
+ echo "Y"
+ else
+ echo "N"
+ fi
+ else
+ echo "N"
+ fi
+}
+
function check_samples() {
local FOP_TYPE=$1
local NS_HASH=$2
local FILE=$3
local BRICK=$4
local GFID="$(getfattr -n trusted.gfid -e text --only-values $B0/$BRICK$FILE | xxd -p)"
+ local val="$(check_brick_multiplex)"
+
+ if [ $val = "Y" ]; then
+ BRICK="${V0}0"
+ fi
grep -i "ns_$OP" /var/log/glusterfs/bricks/d-backends-$BRICK.log |
grep -- $NS_HASH | sed 's/\-//g' | grep -- $GFID