summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorVenkatesh Somyajulu <vsomyaju@redhat.com>2013-01-28 14:09:39 +0530
committerAnand Avati <avati@redhat.com>2013-02-03 11:46:38 -0800
commit06a411edbeb84284c7564d8f82e8c2a77054360d (patch)
treeb9e26cb7693f2d2306f35d8e2fe99b5aa97e077f /tests
parente4811fd339dc6c77fb81c1bef3466a521c8c134b (diff)
test: Removed "for" loop of check_xattr function.
Change-Id: I902a5f86d72df3efb45dba09eaa2e8be8b65edf6 BUG: 802417 Signed-off-by: Venkatesh Somyajulu <vsomyaju@redhat.com> Reviewed-on: http://review.gluster.org/4435 Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/bugs/bug-802417.t62
1 files changed, 36 insertions, 26 deletions
diff --git a/tests/bugs/bug-802417.t b/tests/bugs/bug-802417.t
index c69af1d47c3..314141f6b6d 100755
--- a/tests/bugs/bug-802417.t
+++ b/tests/bugs/bug-802417.t
@@ -9,31 +9,7 @@ function write_file()
echo "$*" > "$path"
}
-function check_xattrs()
-{
- result=""
-
- for observer in 0 1 2; do
- obs_path=${B0}/${V0}-$observer/a_file
- for target in 0 1 2; do
- tgt_xattr="trusted.afr.${V0}-client-$target"
- actual=$(afr_get_changelog_xattr $obs_path $tgt_xattr)
- if [ $observer -ne 2 -a $target -eq 2 ]; then
- expected=0x000000020000000000000000
- else
- expected=0x000000000000000000000000
- fi
- if [ "$actual" = "$expected" ]; then
- result="${result}y"
- else
- result="${result}n"
- fi
- done
- done
-
- echo $result
-}
-
+cleanup;
TEST glusterd
TEST pidof glusterd
TEST $CLI volume info;
@@ -81,7 +57,41 @@ EXPECT_WITHIN 20 "1" afr_child_up_status $V0 2
TEST kill_brick ${V0} ${H0} ${B0}/${V0}-2
TEST ls -l ${M0}/a_file
-EXPECT "yyyyyyyyy" check_xattrs
+
+obs_path_0=${B0}/${V0}-0/a_file
+obs_path_1=${B0}/${V0}-1/a_file
+obs_path_2=${B0}/${V0}-2/a_file
+
+tgt_xattr_0="trusted.afr.${V0}-client-0"
+tgt_xattr_1="trusted.afr.${V0}-client-1"
+tgt_xattr_2="trusted.afr.${V0}-client-2"
+
+actual=$(afr_get_changelog_xattr $obs_path_0 $tgt_xattr_0)
+EXPECT "0x000000000000000000000000" echo $actual
+
+actual=$(afr_get_changelog_xattr $obs_path_0 $tgt_xattr_1)
+EXPECT "0x000000000000000000000000" echo $actual
+
+actual=$(afr_get_changelog_xattr $obs_path_0 $tgt_xattr_2)
+EXPECT "0x000000020000000000000000" echo $actual
+
+actual=$(afr_get_changelog_xattr $obs_path_1 $tgt_xattr_0)
+EXPECT "0x000000000000000000000000" echo $actual
+
+actual=$(afr_get_changelog_xattr $obs_path_1 $tgt_xattr_1)
+EXPECT "0x000000000000000000000000" echo $actual
+
+actual=$(afr_get_changelog_xattr $obs_path_1 $tgt_xattr_2)
+EXPECT "0x000000020000000000000000" echo $actual
+
+actual=$(afr_get_changelog_xattr $obs_path_2 $tgt_xattr_0)
+EXPECT "0x000000000000000000000000" echo $actual
+
+actual=$(afr_get_changelog_xattr $obs_path_2 $tgt_xattr_1)
+EXPECT "0x000000000000000000000000" echo $actual
+
+actual=$(afr_get_changelog_xattr $obs_path_2 $tgt_xattr_2)
+EXPECT "0x000000000000000000000000" echo $actual
if [ "$EXIT_EARLY" = "1" ]; then
exit 0;