From 8acca65e72f7724d23c18f44693a269d95a664c5 Mon Sep 17 00:00:00 2001 From: N Balachandran Date: Thu, 14 Feb 2019 17:48:26 +0530 Subject: tests/dht: Remove hardcoded brick paths The tests assumed that the file is created on a particular brick.This need not be the case in all scenarios and has been removed. Change-Id: Id420f43d7f72d983a7c6f16ea8fed273d46c4824 updates: bz#1672480 Signed-off-by: N Balachandran --- tests/bugs/distribute/bug-1161311.t | 6 ++++-- tests/bugs/distribute/bug-1193636.t | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/bugs/distribute/bug-1161311.t b/tests/bugs/distribute/bug-1161311.t index 0fe4fa37b0..9ae4fac342 100755 --- a/tests/bugs/distribute/bug-1161311.t +++ b/tests/bugs/distribute/bug-1161311.t @@ -91,6 +91,8 @@ done ## into separate bricks when brick count is 3 TEST mv $M0/dir1/FILE2 $M0/dir1/FILE1 +brick_loc=$(get_backend_paths $M0/dir1/FILE1) + # unmount and remount the volume EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0 TEST glusterfs -s $H0 --volfile-id $V0 $M0; @@ -100,7 +102,7 @@ TEST $CLI volume rebalance $V0 start force # Wait for FILE to get the sticky bit on, so that file is under # active rebalance, before creating the links -TEST checksticky $B0/${V0}3/dir1/FILE1 +TEST checksticky $brick_loc # Create the links ## FILE3 FILE5 FILE7 have hashes, c8c91469 566d26ce 22ce7eba @@ -121,7 +123,7 @@ cd / # Ideally for this test to have done its job, the file should still be # under migration, so check the sticky bit again -TEST checksticky $B0/${V0}3/dir1/FILE1 +TEST checksticky $brick_loc # Wait for rebalance to complete EXPECT_WITHIN $REBALANCE_TIMEOUT "completed" rebalance_status_field $V0 diff --git a/tests/bugs/distribute/bug-1193636.t b/tests/bugs/distribute/bug-1193636.t index ccde02edc7..b377910336 100644 --- a/tests/bugs/distribute/bug-1193636.t +++ b/tests/bugs/distribute/bug-1193636.t @@ -41,11 +41,13 @@ dd if=/dev/zero of=$M0/dir1/FILE2 bs=64k count=10240 # act on the file TEST mv $M0/dir1/FILE2 $M0/dir1/FILE1 +brick_loc=$(get_backend_paths $M0/dir1/FILE1) + build_tester $(dirname $0)/bug-1193636.c TEST $CLI volume rebalance $V0 start force -TEST checksticky $B0/${V0}3/dir1/FILE1 +TEST checksticky $brick_loc TEST setfattr -n "user.test1" -v "test1" $M0/dir1/FILE1 TEST setfattr -n "user.test2" -v "test1" $M0/dir1/FILE1 -- cgit