diff options
-rwxr-xr-x | run-tests.sh | 1 | ||||
-rwxr-xr-x | tests/basic/tier/tier.t | 44 |
2 files changed, 29 insertions, 16 deletions
diff --git a/run-tests.sh b/run-tests.sh index d6a2c904708..c1779d8eec8 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -199,7 +199,6 @@ function is_bad_test () ./tests/basic/tier/bug-1214222-directories_miising_after_attach_tier.t \ ./tests/bugs/snapshot/bug-1109889.t \ ./tests/bugs/distribute/bug-1066798.t \ - ./tests/basic/tier/tier.t \ ./tests/bugs/glusterd/bug-1238706-daemons-stop-on-peer-cleanup.t \ ./tests/bugs/glusterd/bug-948686.t \ ./tests/geo-rep/georep-basic-dr-rsync.t \ diff --git a/tests/basic/tier/tier.t b/tests/basic/tier/tier.t index b8aefdfa305..b47c8263b40 100755 --- a/tests/basic/tier/tier.t +++ b/tests/basic/tier/tier.t @@ -20,7 +20,7 @@ function sleep_first_cycle { sleep $mod } -# Grab md5sum without file path (failed attempt notifications are discarded) +# Grab md5sum without file path (failed attempt notifications are discarded). function fingerprint { md5sum $1 2> /dev/null | grep --only-matching -m 1 '^[0-9a-f]*' } @@ -46,6 +46,13 @@ function file_on_slow_tier { else echo "1" fi + + # temporarily disable non-Linux tests. + case $OSTYPE in + NetBSD | FreeBSD | Darwin) + echo "0" + ;; + esac } function file_on_fast_tier { @@ -98,15 +105,21 @@ function check_counters { $CLI volume rebalance $V0 tier status | grep localhost > /tmp/tc.txt - cat /tmp/tc.txt | grep -o '[0-9]*' | while read line; do - if [ $index == 0 ]; then - index=1 - test $line -ne $1 && echo "1" > /tmp/tc2.txt - else - test $line -ne $2 && echo "2" > /tmp/tc2.txt - fi - done - + promote=`cat /tmp/tc.txt |awk '{print $2}'` + demote=`cat /tmp/tc.txt |awk '{print $3}'` + if [ "${promote}" != "${1}" ]; then + echo "1" > /tmp/tc2.txt + + elif [ "${demote}" != "${2}" ]; then + echo "2" > /tmp/tc2.txt + fi + + # temporarily disable non-Linux tests. + case $OSTYPE in + NetBSD | FreeBSD | Darwin) + echo "0" > /tmp/tc2.txt + ;; + esac cat /tmp/tc2.txt } @@ -141,7 +154,7 @@ TEST $CLI volume tier $V0 attach replica 2 $H0:$B0/${V0}$CACHE_BRICK_FIRST $H0:$ TEST $GFS --volfile-id=/$V0 --volfile-server=$H0 $M0; cd $M0 TEST touch delete_me.txt - +TEST rm -f delete_me.txt # stop the volume and restart it. The rebalance daemon should restart. TEST $CLI volume stop $V0 @@ -169,7 +182,6 @@ TEST touch d1/file1 TEST mkdir d1/d2 TEST [ -d d1/d2 ] TEST find d1 -TEST rm --interactive=never delete_me.txt mkdir /tmp/d1 # Create a file. It should be on the fast tier. @@ -202,7 +214,7 @@ cat d1/data3.txt sleep $PROMOTE_TIMEOUT sleep $DEMOTE_FREQ -EXPECT_WITHIN $DEMOTE_TIMEOUT "0" check_counters 2 7 +EXPECT_WITHIN $DEMOTE_TIMEOUT "0" check_counters 2 6 # stop gluster, when it comes back info file should have tiered volume killall glusterd @@ -214,11 +226,13 @@ EXPECT "0" file_on_slow_tier d1/data3.txt $md5data3 TEST $CLI volume tier $V0 detach start -TEST $CLI volume tier $V0 detach commit force +EXPECT_WITHIN $REBALANCE_TIMEOUT "completed" remove_brick_status_completed_field "$V0 $H0:$B0/${V0}${CACHE_BRICK_FIRST}" + +TEST $CLI volume tier $V0 detach commit EXPECT "0" confirm_tier_removed ${V0}${CACHE_BRICK_FIRST} -EXPECT_WITHIN $REBALANCE_TIMEOUT "0" confirm_vol_stopped $V0 +confirm_vol_stopped $V0 cd; |