diff options
author | Mohammed Rafi KC <rkavunga@redhat.com> | 2015-04-24 15:33:25 +0530 |
---|---|---|
committer | Kaleb KEITHLEY <kkeithle@redhat.com> | 2015-05-05 09:01:59 -0700 |
commit | 1306237c092ee8f927f16cae1b2b430a13e0a34f (patch) | |
tree | 8d0666f697fb1c692f655e3ffb1b9e26480856fa /tests/basic | |
parent | 3bbca6b368782b99b80558841894942f802a44a2 (diff) |
tiering: Send both attach-tier and tier-start together
After attaching tier, we have to start tier rebalance process.
This patch is to trigger tier start along with attch-tier.
Change-Id: I39380f95123f0087a82213ef263f9f33adcc5adc
BUG: 1214222
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Reviewed-on: http://review.gluster.org/10363
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Dan Lambright <dlambrig@redhat.com>
Diffstat (limited to 'tests/basic')
-rwxr-xr-x | tests/basic/tier/bug-1214222-directories_miising_after_attach_tier.t | 67 | ||||
-rwxr-xr-x | tests/basic/tier/tier.t | 18 |
2 files changed, 77 insertions, 8 deletions
diff --git a/tests/basic/tier/bug-1214222-directories_miising_after_attach_tier.t b/tests/basic/tier/bug-1214222-directories_miising_after_attach_tier.t new file mode 100755 index 00000000000..028bc6a47d0 --- /dev/null +++ b/tests/basic/tier/bug-1214222-directories_miising_after_attach_tier.t @@ -0,0 +1,67 @@ +#!/bin/bash + +. $(dirname $0)/../../include.rc +. $(dirname $0)/../../volume.rc + +LAST_BRICK=3 +CACHE_BRICK_FIRST=4 +CACHE_BRICK_LAST=5 +DEMOTE_TIMEOUT=12 +PROMOTE_TIMEOUT=5 + +function confirm_tier_removed { + $CLI system getspec $V0 | grep $1 + if [ $? == 0 ]; then + echo "1" + else + echo "0" + fi +} + +function confirm_vol_stopped { + $CLI volume stop $1 + if [ $? == 0 ]; then + echo "0" + else + echo "1" + fi +} + +LAST_BRICK=1 +CACHE_BRICK=2 +DEMOTE_TIMEOUT=12 +PROMOTE_TIMEOUT=5 +MIGRATION_TIMEOUT=10 +cleanup + + +TEST glusterd +TEST pidof glusterd + +TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{0..$LAST_BRICK} +TEST $CLI volume start $V0 +TEST $GFS --volfile-id=/$V0 --volfile-server=$H0 $M0; + +# Basic operations. +cd $M0 +TEST stat . +TEST mkdir d1 +TEST [ -d d1 ] +TEST touch file1 +TEST [ -e file1 ] + +TEST $CLI volume attach-tier $V0 replica 2 $H0:$B0/${V0}$CACHE_BRICK_FIRST $H0:$B0/${V0}$CACHE_BRICK_LAST +TEST $CLI volume set $V0 features.ctr-enabled on + +#check whether the directory's and files are present on mount or not. +TEST [ -d d1 ] +TEST [ -e file1 ] + +TEST $CLI volume detach-tier $V0 start +TEST $CLI volume detach-tier $V0 commit + +EXPECT "0" confirm_tier_removed ${V0}${CACHE_BRICK_FIRST} + +EXPECT_WITHIN $REBALANCE_TIMEOUT "0" confirm_vol_stopped $V0 + +cleanup diff --git a/tests/basic/tier/tier.t b/tests/basic/tier/tier.t index 8bee3bbd998..afe1e8cf053 100755 --- a/tests/basic/tier/tier.t +++ b/tests/basic/tier/tier.t @@ -65,9 +65,18 @@ TEST pidof glusterd TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{0..$LAST_BRICK} # testing bug 1215122, ie should fail if replica count and bricks are not compatible. TEST ! $CLI volume attach-tier $V0 replica 5 $H0:$B0/${V0}$CACHE_BRICK_FIRST $H0:$B0/${V0}$CACHE_BRICK_LAST -TEST $CLI volume attach-tier $V0 replica 2 $H0:$B0/${V0}$CACHE_BRICK_FIRST $H0:$B0/${V0}$CACHE_BRICK_LAST + TEST $CLI volume start $V0 +TEST $CLI volume set $V0 cluster.tier-demote-frequency 4 +TEST $CLI volume set $V0 cluster.tier-promote-frequency 4 +TEST $CLI volume set $V0 cluster.read-freq-threshold 0 +TEST $CLI volume set $V0 cluster.write-freq-threshold 0 +TEST $CLI volume set $V0 performance.quick-read off +TEST $CLI volume set $V0 performance.io-cache off TEST $CLI volume set $V0 features.ctr-enabled on + +TEST $CLI volume attach-tier $V0 replica 2 $H0:$B0/${V0}$CACHE_BRICK_FIRST $H0:$B0/${V0}$CACHE_BRICK_LAST + TEST $GFS --volfile-id=/$V0 --volfile-server=$H0 $M0; # Basic operations. @@ -88,13 +97,6 @@ TEST file_on_fast_tier d1/data.txt #TEST setfattr -n trusted.distribute.migrate-data d1/data.txt #TEST file_on_slow_tier d1/data.txt -TEST $CLI volume set $V0 cluster.tier-demote-frequency 4 -TEST $CLI volume set $V0 cluster.tier-promote-frequency 4 -TEST $CLI volume set $V0 cluster.read-freq-threshold 0 -TEST $CLI volume set $V0 cluster.write-freq-threshold 0 -TEST $CLI volume set $V0 performance.quick-read off -TEST $CLI volume set $V0 performance.io-cache off -TEST $CLI volume rebalance $V0 tier start uuidgen > d1/data2.txt uuidgen > d1/data3.txt EXPECT "0" file_on_fast_tier d1/data2.txt |