diff options
Diffstat (limited to 'tests/bugs/quota')
22 files changed, 57 insertions, 546 deletions
diff --git a/tests/bugs/quota/afr-quota-xattr-mdata-heal.t b/tests/bugs/quota/afr-quota-xattr-mdata-heal.t index cac06a52960..ebfa5545728 100644 --- a/tests/bugs/quota/afr-quota-xattr-mdata-heal.t +++ b/tests/bugs/quota/afr-quota-xattr-mdata-heal.t @@ -5,7 +5,6 @@ cleanup; TEST glusterd -TEST pidof glusterd TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{0,1} TEST $CLI volume start $V0 TEST glusterfs --volfile-id=/$V0 --volfile-server=$H0 $M0 --attribute-timeout=0 --entry-timeout=0 @@ -138,6 +137,4 @@ EXPECT "$acl_access_val" echo $(getfattr -d -m. -e hex $B0/${V0}0/d | grep syste EXPECT "$acl_file_val" echo $(getfattr -d -m. -e hex $B0/${V0}0/d | grep trusted.SGI_ACL_FILE) EXPECT "$acl_access_val" echo $(getfattr -d -m. -e hex $B0/${V0}1/d | grep system.posix_acl_access) EXPECT "$acl_file_val" echo $(getfattr -d -m. -e hex $B0/${V0}1/d | grep trusted.SGI_ACL_FILE) -TEST $CLI volume stop $V0 -EXPECT "1" get_aux cleanup diff --git a/tests/bugs/quota/bug-1023974.t b/tests/bugs/quota/bug-1023974.t deleted file mode 100644 index 2fb93320045..00000000000 --- a/tests/bugs/quota/bug-1023974.t +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash - -# This regression test tries to ensure renaming a directory with content, and -# no limit set, is accounted properly, when moved into a directory with quota -# limit set. - -. $(dirname $0)/../../include.rc -. $(dirname $0)/../../volume.rc - -cleanup; - -QDD=$(dirname $0)/quota -# compile the test write program and run it -build_tester $(dirname $0)/../../basic/quota.c -o $QDD - -TEST glusterd -TEST pidof glusterd; -TEST $CLI volume info; - -TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{1,2,3,4,5,6}; -TEST $CLI volume start $V0; - -TEST $CLI volume quota $V0 enable; - -TEST glusterfs --volfile-id=$V0 --volfile-server=$H0 $M0; - -TEST mkdir -p $M0/1/2; -TEST $CLI volume quota $V0 limit-usage /1/2 100MB 70%; -TEST $CLI volume quota $V0 hard-timeout 0 -TEST $CLI volume quota $V0 soft-timeout 0 - -#The corresponding write(3) should fail with EDQUOT ("Disk quota exceeded") -TEST ! $QDD $M0/1/2/file 256 408 -TEST mkdir -p $M0/1/3; -TEST $QDD $M0/1/3/file 256 408 - -#The corresponding rename(3) should fail with EDQUOT ("Disk quota exceeded") -TEST ! mv $M0/1/3/ $M0/1/2/3_mvd; - -TEST $CLI volume stop $V0 -EXPECT "1" get_aux - -rm -f $QDD - -cleanup; diff --git a/tests/bugs/quota/bug-1035576.t b/tests/bugs/quota/bug-1035576.t index e3d32d107d0..cbc1b69ebb3 100644 --- a/tests/bugs/quota/bug-1035576.t +++ b/tests/bugs/quota/bug-1035576.t @@ -9,7 +9,6 @@ cleanup; TEST glusterd -TEST pidof glusterd TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{0,1} TEST $CLI volume start $V0 #Lets disable perf-xls so that lookup would reach afr @@ -18,8 +17,10 @@ TEST $CLI volume set $V0 performance.io-cache off TEST $CLI volume set $V0 performance.write-behind off TEST $CLI volume set $V0 performance.stat-prefetch off TEST $CLI volume set $V0 performance.read-ahead off -TEST $CLI volume set $V0 background-self-heal-count 0 TEST $CLI volume set $V0 self-heal-daemon off +TEST $CLI volume set $V0 cluster.data-self-heal on +TEST $CLI volume set $V0 cluster.metadata-self-heal on +TEST $CLI volume set $V0 cluster.entry-self-heal on TEST $CLI volume quota $V0 enable TEST kill_brick $V0 $H0 $B0/${V0}0 @@ -49,6 +50,4 @@ TEST cat $M0/a/f #Now that data self-heal is done quota size value should be same quota_size_val0=$(get_hex_xattr trusted.glusterfs.quota.size $B0/${V0}0/a) TEST [ $quota_size_val0 == $quota_size_val1 ] -TEST $CLI volume stop $V0 -EXPECT "1" get_aux cleanup diff --git a/tests/bugs/quota/bug-1038598.t b/tests/bugs/quota/bug-1038598.t index 7d69a98cbd4..108e14cb8d8 100644 --- a/tests/bugs/quota/bug-1038598.t +++ b/tests/bugs/quota/bug-1038598.t @@ -9,8 +9,6 @@ QDD=$(dirname $0)/quota build_tester $(dirname $0)/../../basic/quota.c -o $QDD TEST glusterd -TEST pidof glusterd -TEST $CLI volume info; TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{1,2}; @@ -19,7 +17,6 @@ EXPECT 'Created' volinfo_field $V0 'Status'; EXPECT '2' brick_count $V0 TEST $CLI volume start $V0; -EXPECT 'Started' volinfo_field $V0 'Status'; TEST $CLI volume quota $V0 enable sleep 5 @@ -49,8 +46,6 @@ TEST $CLI volume set $V0 features.soft-timeout 0 TEST ! $QDD $M0/test_dir/file1.txt 256 60 EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT 'Yes' quota_sl_exceeded "/test_dir"; EXPECT 'Yes' quota_hl_exceeded "/test_dir"; -TEST $CLI volume stop $V0 -EXPECT "1" get_aux rm -f $QDD diff --git a/tests/bugs/quota/bug-1040423.t b/tests/bugs/quota/bug-1040423.t deleted file mode 100755 index c6dbdb1ff81..00000000000 --- a/tests/bugs/quota/bug-1040423.t +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/bash - -. $(dirname $0)/../../include.rc -. $(dirname $0)/../../volume.rc - -cleanup - -function _init() { -# Start glusterd -TEST glusterd; -TEST pidof glusterd; -TEST $CLI volume info; - -# Lets create volume -TEST $CLI volume create $V0 $H0:$B0/${V0}{1,2}; - -## Verify volume is created -EXPECT "$V0" volinfo_field $V0 'Volume Name'; -EXPECT 'Created' volinfo_field $V0 'Status'; - -#Start volume and verify -TEST $CLI volume start $V0; -EXPECT 'Started' volinfo_field $V0 'Status'; -TEST glusterfs --volfile-id=$V0 --volfile-server=$H0 $M0 - -#Enable Quota -TEST $CLI volume quota $V0 enable - -#As quotad consumes some time to connect to brick process we invoke sleep -sleep 10; - -#set limit of 1GB of quota on root -TEST $CLI volume quota $V0 limit-usage / 1GB -} - -function get_hardlimit() -{ - VOLUME=$1 - - $CLI volume quota $VOLUME list | tail -1 | sed "s/ \{1,\}/ /g" | - cut -d' ' -f 2 -} - -function check_fattrs { - -touch $M0/file1; - -#This confirms that pgfid is also filtered -TEST ! "getfattr -d -e hex -m . $M0/file1 | grep pgfid "; - -#just check for quota xattr are visible or not -TEST ! "getfattr -d -e hex -m . $M0 | grep quota"; - -#setfattr should fail -TEST ! setfattr -n trusted.glusterfs.quota.limit-set -v 10 $M0; - -#remove xattr should fail -TEST ! setfattr -x trusted.glusterfs.quota.limit-set $M0; - -#check if list command still shows the correct value or not - -EXPECT "1.0GB" get_hardlimit $V0 - -} - -_init; -check_fattrs; -TEST $CLI volume stop $V0 -EXPECT "1" get_aux -cleanup diff --git a/tests/bugs/quota/bug-1049323.t b/tests/bugs/quota/bug-1049323.t deleted file mode 100755 index 95ef91d4272..00000000000 --- a/tests/bugs/quota/bug-1049323.t +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash -. $(dirname $0)/../../include.rc -. $(dirname $0)/../../volume.rc - -cleanup; - -function _init() -{ -# Start glusterd -TEST glusterd; -TEST pidof glusterd; -TEST $CLI volume info; - -#Create a volume -TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{1,2}; - -#Verify volume is created -EXPECT "$V0" volinfo_field $V0 'Volume Name'; -EXPECT 'Created' volinfo_field $V0 'Status'; - -#Start volume and verify -TEST $CLI volume start $V0; -EXPECT 'Started' volinfo_field $V0 'Status'; -TEST glusterfs --volfile-id=$V0 --volfile-server=$H0 $M0 - -#Enable Quota -TEST $CLI volume quota $V0 enable - -##Wait for the auxiliary mount to comeup -sleep 3; -} - -function create_data() -{ -#set some limit on the volume -TEST $CLI volume quota $V0 limit-usage / 50MB; - -#Auxiliary mount should be there before stopping the volume -EXPECT "0" get_aux; - -TEST $CLI volume stop $V0; - -#Aux mount should have been removed -EXPECT "1" get_aux; - -} - - -_init; -create_data; -cleanup; diff --git a/tests/bugs/quota/bug-1087198.t b/tests/bugs/quota/bug-1087198.t index 44aa1b75e7a..618a46b957d 100644 --- a/tests/bugs/quota/bug-1087198.t +++ b/tests/bugs/quota/bug-1087198.t @@ -17,6 +17,8 @@ . $(dirname $0)/../../volume.rc . $(dirname $0)/../../nfs.rc +#G_TESTDEF_TEST_STATUS_CENTOS6=NFS_TEST + cleanup; QDD=$(dirname $0)/quota @@ -26,19 +28,14 @@ build_tester $(dirname $0)/../../basic/quota.c -o $QDD #1 ## Step 1 TEST glusterd -TEST pidof glusterd -TEST $CLI volume info; TEST $CLI volume create $V0 $H0:$B0/brick{1..4}; -EXPECT 'Created' volinfo_field $V0 'Status'; - +TEST $CLI volume set $V0 nfs.disable false TEST $CLI volume start $V0; -EXPECT 'Started' volinfo_field $V0 'Status'; EXPECT_WITHIN $NFS_EXPORT_TIMEOUT "1" is_nfs_export_available; TEST mount_nfs $H0:/$V0 $N0 noac,nolock - QUOTA_LIMIT_DIR="quota_limit_dir" BRICK_LOG_DIR="`gluster --print-logdir`/bricks" @@ -83,7 +80,6 @@ TEST grep -e "\"Usage is above soft limit:.*used by /\"" -- $BRICK_LOG_DIR/* EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $N0 TEST $CLI volume stop $V0 -EXPECT "1" get_aux rm -f $QDD diff --git a/tests/bugs/quota/bug-1100050.t b/tests/bugs/quota/bug-1100050.t deleted file mode 100644 index 65a1250f246..00000000000 --- a/tests/bugs/quota/bug-1100050.t +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -. $(dirname $0)/../../include.rc -. $(dirname $0)/../../volume.rc - -cleanup; - -TEST glusterd; -TEST pidof glusterd; - -TEST gluster volume create $V0 stripe 2 $H0:$B0/{1,2} force; -TEST gluster volume start $V0; -TEST glusterfs --volfile-server=$H0 --volfile-id=$V0 $M0; - -TEST gluster volume quota $V0 enable; - -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "Y" quotad_up_status; - -TEST mkdir $M0/dir; - -TEST gluster volume quota $V0 limit-usage /dir 10MB; - -TEST mkdir $M0/dir/subdir; - -TEST $CLI volume stop $V0 -EXPECT "1" get_aux -cleanup; diff --git a/tests/bugs/quota/bug-1104692.t b/tests/bugs/quota/bug-1104692.t index 3acffa4720c..9640996135f 100755 --- a/tests/bugs/quota/bug-1104692.t +++ b/tests/bugs/quota/bug-1104692.t @@ -5,7 +5,6 @@ cleanup; TEST glusterd -TEST pidof glusterd TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}0 $H0:$B0/${V0}1 $H0:$B0/${V0}2 $H0:$B0/${V0}3 TEST $CLI volume start $V0 @@ -24,10 +23,4 @@ TEST $CLI volume quota $V0 limit-usage /limit_one/limit_two/limit_three 1GB TEST $CLI volume quota $V0 limit-usage /limit_four 1GB TEST $CLI volume quota $V0 limit-usage /limit_one/limit_five 1GB -#Cleanup -EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0 -TEST $CLI volume stop $V0 -EXPECT "1" get_aux -TEST $CLI volume delete $V0 - cleanup; diff --git a/tests/bugs/quota/bug-1153964.t b/tests/bugs/quota/bug-1153964.t index cf5b07c1329..2e449d3ba00 100644 --- a/tests/bugs/quota/bug-1153964.t +++ b/tests/bugs/quota/bug-1153964.t @@ -4,6 +4,8 @@ . $(dirname $0)/../../volume.rc . $(dirname $0)/../../nfs.rc +#G_TESTDEF_TEST_STATUS_CENTOS6=NFS_TEST + function rename_loop() { local i=0 @@ -41,12 +43,10 @@ function createFile_and_checkLimit() cleanup; TEST glusterd -TEST pidof glusterd TEST $CLI volume create $V0 $H0:$B0/${V0}1 $H0:$B0/${V0}2 -EXPECT 'Created' volinfo_field $V0 'Status' +TEST $CLI volume set $V0 nfs.disable false TEST $CLI volume start $V0 -EXPECT 'Started' volinfo_field $V0 'Status' TEST $CLI volume quota $V0 enable EXPECT 'on' volinfo_field $V0 'features.quota' @@ -78,6 +78,4 @@ TEST rm -rf $N0/test_dir/ EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $N0 -TEST $CLI volume stop $V0 -EXPECT "1" get_aux cleanup; diff --git a/tests/bugs/quota/bug-1178130.t b/tests/bugs/quota/bug-1178130.t index f75bcd4f03c..ccd6b792cf8 100644 --- a/tests/bugs/quota/bug-1178130.t +++ b/tests/bugs/quota/bug-1178130.t @@ -14,8 +14,6 @@ QDD=$(dirname $0)/quota build_tester $(dirname $0)/../../basic/quota.c -o $QDD TEST glusterd -TEST pidof glusterd; -TEST $CLI volume info; TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{1,2}; TEST $CLI volume start $V0; @@ -41,10 +39,6 @@ EXPECT_WITHIN $HEAL_TIMEOUT "0" STAT "$B0/${V0}2/file2" #usage should remain same after rename and self-heal operation EXPECT "10.0MB" quotausage "/" -TEST $CLI volume stop $V0 -TEST $CLI volume delete $V0 -EXPECT "1" get_aux - rm -f $QDD cleanup; diff --git a/tests/bugs/quota/bug-1202244-support-inode-quota.t b/tests/bugs/quota/bug-1202244-support-inode-quota.t deleted file mode 100644 index 438bbad7b2f..00000000000 --- a/tests/bugs/quota/bug-1202244-support-inode-quota.t +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash - -. $(dirname $0)/../../include.rc -. $(dirname $0)/../../volume.rc - -function get_quota_value() -{ - local LIST_TYPE=$1 - local LIMIT_PATH=$2; - $CLI volume quota $V0 $LIST_TYPE $LIMIT_PATH | grep "$LIMIT_PATH"\ - | awk '{print $2}' -} - -cleanup; - -TEST glusterd; -TEST pidof glusterd; - -TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{1,2}; -TEST $CLI volume start $V0; -TEST glusterfs --volfile-server=$H0 --volfile-id=$V0 $M0; - -TEST $CLI volume quota $V0 enable; -EXPECT "on" volinfo_field $V0 'features.quota' -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "Y" quotad_up_status; - -TEST mkdir $M0/dir; - -TEST $CLI volume quota $V0 limit-usage /dir 10MB; -EXPECT "10.0MB" get_quota_value "list" "/dir" - -TEST $CLI volume quota $V0 limit-objects /dir 10; -EXPECT "10" get_quota_value "list-objects" "/dir" - -TEST $CLI volume quota $V0 remove /dir; -EXPECT "" get_quota_value "list" "/dir" - -TEST $CLI volume quota $V0 remove-objects /dir; -EXPECT "" get_quota_value "list-objects" "/dir" - -TEST $CLI volume stop $V0 -EXPECT "1" get_aux - -cleanup; diff --git a/tests/bugs/quota/bug-1213364-disable-deem-statfs-when-quota-disable.t b/tests/bugs/quota/bug-1213364-disable-deem-statfs-when-quota-disable.t deleted file mode 100644 index aaf4a315949..00000000000 --- a/tests/bugs/quota/bug-1213364-disable-deem-statfs-when-quota-disable.t +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -. $(dirname $0)/../../include.rc -. $(dirname $0)/../../volume.rc - -cleanup; - -TEST glusterd -TEST pidof glusterd - -TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{1,2}; -EXPECT 'Created' volinfo_field $V0 'Status'; - -TEST $CLI volume start $V0; -EXPECT 'Started' volinfo_field $V0 'Status'; - -TEST $CLI volume quota $V0 enable -EXPECT 'on' volinfo_field $V0 'features.quota' -EXPECT 'on' volinfo_field $V0 'features.quota-deem-statfs' - -TEST $CLI volume quota $V0 disable -EXPECT 'off' volinfo_field $V0 'features.quota' -EXPECT '' volinfo_field $V0 'features.quota-deem-statfs' - -cleanup; diff --git a/tests/bugs/quota/bug-1235182.t b/tests/bugs/quota/bug-1235182.t index 2f963e664c6..6091146cb97 100644 --- a/tests/bugs/quota/bug-1235182.t +++ b/tests/bugs/quota/bug-1235182.t @@ -14,7 +14,6 @@ QDD=$(dirname $0)/quota build_tester $(dirname $0)/../../basic/quota.c -o $QDD TEST glusterd -TEST pidof glusterd; TEST $CLI volume info; TEST $CLI volume create $V0 $H0:$B0/${V0}; @@ -44,18 +43,19 @@ for i in {1..50}; do #rename to different dir TEST_IN_LOOP mkdir $M0/$ii TEST_IN_LOOP mv -f $M0/$i/f$ii $M0/$ii/f$ii; + stat $M0/$ii/f$ii >/dev/null done echo "Wait for process with pid $PID to complete" wait $PID echo "Process with pid $PID finished" -EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "100.0MB" quotausage "/" +EXPECT_WITHIN $PROCESS_UP_TIMEOUT "0" STAT $M0/51/f51 -TEST $CLI volume stop $V0 -TEST $CLI volume delete $V0 -EXPECT "1" get_aux +EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "100.0MB" quotausage "/" rm -f $QDD cleanup; +#G_TESTDEF_TEST_STATUS_CENTOS6=BAD_TEST,BUG=000000 +#G_TESTDEF_TEST_STATUS_NETBSD7=BAD_TEST,BUG=000000 diff --git a/tests/bugs/quota/bug-1240991.t b/tests/bugs/quota/bug-1240991.t deleted file mode 100644 index 2a1a6d1868e..00000000000 --- a/tests/bugs/quota/bug-1240991.t +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -# This regression test tries to ensure renaming a directory with content, and -# no limit set, is accounted properly, when moved into a directory with quota -# limit set. - -. $(dirname $0)/../../include.rc -. $(dirname $0)/../../volume.rc - -cleanup; - -TEST glusterd -TEST pidof glusterd; -TEST $CLI volume info; - -TEST $CLI volume create $V0 $H0:$B0/${V0} -TEST $CLI volume start $V0; - -TEST $CLI volume quota $V0 enable; - -TEST glusterfs --volfile-id=$V0 --volfile-server=$H0 $M0; - -TEST $CLI volume quota $V0 hard-timeout 0 -TEST $CLI volume quota $V0 soft-timeout 0 - -TEST mkdir -p $M0/dir/dir1 -TEST $CLI volume quota $V0 limit-objects /dir 20 - -TEST mkdir $M0/dir/dir1/d{1..5} -TEST touch $M0/dir/dir1/f{1..5} -TEST mv $M0/dir/dir1 $M0/dir/dir2 - -#Number of files under /dir is 5 -EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "5" quota_object_list_field "/dir" 4 - -#Number of directories under /dir is 7 -EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "7" quota_object_list_field "/dir" 5 - -TEST $CLI volume stop $V0 -TEST $CLI volume delete $V0 -EXPECT "1" get_aux - -cleanup; diff --git a/tests/bugs/quota/bug-1243798.t b/tests/bugs/quota/bug-1243798.t index 9917b5dc7a1..fa6abeb08fb 100644 --- a/tests/bugs/quota/bug-1243798.t +++ b/tests/bugs/quota/bug-1243798.t @@ -4,17 +4,15 @@ . $(dirname $0)/../../volume.rc . $(dirname $0)/../../nfs.rc +#G_TESTDEF_TEST_STATUS_CENTOS6=NFS_TEST + cleanup; TEST glusterd -TEST pidof glusterd -TEST $CLI volume info; TEST $CLI volume create $V0 $H0:$B0/$V0 -EXPECT 'Created' volinfo_field $V0 'Status'; - +TEST $CLI volume set $V0 nfs.disable false TEST $CLI volume start $V0; -EXPECT 'Started' volinfo_field $V0 'Status'; EXPECT_WITHIN $NFS_EXPORT_TIMEOUT "1" is_nfs_export_available; TEST mount_nfs $H0:/$V0 $N0 noac,nolock @@ -44,7 +42,5 @@ echo Hello > $N0/dir1/dir2/file EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "2" quota_object_list_field "/dir1" 5 EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $N0 -TEST $CLI volume stop $V0 -EXPECT "1" get_aux cleanup; diff --git a/tests/bugs/quota/bug-1260545.t b/tests/bugs/quota/bug-1260545.t index b3e9eb42a9c..46808022f01 100644 --- a/tests/bugs/quota/bug-1260545.t +++ b/tests/bugs/quota/bug-1260545.t @@ -10,7 +10,6 @@ QDD=$(dirname $0)/quota build_tester $(dirname $0)/../../basic/quota.c -o $QDD TEST glusterd -TEST pidof glusterd; TEST $CLI volume info; TEST $CLI volume create $V0 $H0:$B0/${V0}1 $H0:$B0/${V0}2; @@ -20,12 +19,11 @@ TEST $CLI volume quota $V0 enable; TEST glusterfs --volfile-id=$V0 --volfile-server=$H0 $M0; -TEST $CLI volume quota $V0 limit-usage / 10MB +TEST $CLI volume quota $V0 limit-usage / 11MB TEST $CLI volume quota $V0 hard-timeout 0 TEST $CLI volume quota $V0 soft-timeout 0 TEST $QDD $M0/f1 256 40 -TEST ! $QDD $M0/f2 256 40 EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "10.0MB" quotausage "/" @@ -51,10 +49,5 @@ TEST [ `echo $var | awk '{print $6}'` = "0" ] EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "10.0MB" quotausage "/" -rm -f $M0/f1 -TEST $CLI volume stop $V0 -TEST $CLI volume delete $V0 -EXPECT "1" get_aux - rm -f $QDD cleanup; diff --git a/tests/bugs/quota/bug-1287996.t b/tests/bugs/quota/bug-1287996.t index d75b7a26897..2f46ee1ca2d 100644 --- a/tests/bugs/quota/bug-1287996.t +++ b/tests/bugs/quota/bug-1287996.t @@ -18,7 +18,4 @@ TEST $CLI_1 volume quota $V0 enable TEST $CLI_1 peer probe $H2; EXPECT_WITHIN $PROBE_TIMEOUT 1 check_peers - -TEST $CLI_1 volume stop $V0 -TEST $CLI_1 volume delete $V0 cleanup; diff --git a/tests/bugs/quota/bug-1288474.t b/tests/bugs/quota/bug-1288474.t deleted file mode 100755 index 2ead6ef4d74..00000000000 --- a/tests/bugs/quota/bug-1288474.t +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -. $(dirname $0)/../../include.rc -. $(dirname $0)/../../volume.rc -. $(dirname $0)/../../tier.rc - -NUM_BRICKS=2 - -function create_dist_tier_vol () { - mkdir $B0/cold - mkdir $B0/hot - TEST $CLI volume create $V0 $H0:$B0/cold/${V0}{0..$1} - TEST $CLI volume start $V0 - TEST $CLI volume tier $V0 attach $H0:$B0/hot/${V0}{0..$1} -} - -cleanup; - -#Basic checks -TEST glusterd -TEST pidof glusterd -TEST $CLI volume info - -#Create and start a tiered volume -create_dist_tier_vol $NUM_BRICKS - -TEST $CLI volume quota $V0 enable -TEST $CLI volume quota $V0 limit-usage / 10MB - -EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "10.0MB" quota_list_field "/" 5 - -#check quota list after detach tier -TEST $CLI volume detach-tier $V0 start -sleep 1 -TEST $CLI volume detach-tier $V0 force -EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "10.0MB" quota_list_field "/" 5 - -#check quota list after attach tier -rm -rf $B0/hot -mkdir $B0/hot -TEST $CLI volume tier $V0 attach $H0:$B0/hot/${V0}{0..$1} -EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "10.0MB" quota_list_field "/" 5 - -TEST $CLI volume stop $V0 -TEST $CLI volume delete $V0 - -cleanup; - diff --git a/tests/bugs/quota/bug-1292020.t b/tests/bugs/quota/bug-1292020.t new file mode 100644 index 00000000000..b70047ae3f9 --- /dev/null +++ b/tests/bugs/quota/bug-1292020.t @@ -0,0 +1,28 @@ +#!/bin/bash + +. $(dirname $0)/../../include.rc +. $(dirname $0)/../../volume.rc + +function write_sample_data () { + dd if=/dev/zero of=$M0/f1 bs=256k count=400 2>&1 | + egrep -i 'exceeded|no space' && echo 'passed' +} + +cleanup; + +TEST glusterd; +TEST pidof glusterd; + +TEST $CLI volume create $V0 $H0:$B0/$V0 +TEST $CLI volume start $V0; +TEST $CLI volume quota $V0 enable; +TEST $CLI volume quota $V0 limit-usage / 1 + +TEST glusterfs --volfile-server=$H0 --volfile-id=$V0 $M0; + + +EXPECT_WITHIN 30 "passed" write_sample_data + +TEST $CLI volume stop $V0 +TEST $CLI volume delete $V0 +cleanup; diff --git a/tests/bugs/quota/bug-1293601.t b/tests/bugs/quota/bug-1293601.t index 9b8a13a61e5..741758b73f5 100644 --- a/tests/bugs/quota/bug-1293601.t +++ b/tests/bugs/quota/bug-1293601.t @@ -4,32 +4,30 @@ . $(dirname $0)/../../volume.rc cleanup; -TESTS_EXPECTED_IN_LOOP=1044 TEST glusterd -TEST pidof glusterd TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{1,2,3,4} TEST $CLI volume start $V0 +EXPECT_WITHIN $PROCESS_UP_TIMEOUT "4" online_brick_count TEST $CLI volume quota $V0 enable -TEST $CLI volume quota $V0 limit-usage / 2MB TEST glusterfs --volfile-server=$H0 --volfile-id=$V0 $M0; -for i in {1..1024}; do - TEST_IN_LOOP dd if=/dev/zero of=$M0/f$i bs=1k count=1 +for i in {1..512}; do + dd if=/dev/zero of=$M0/f$i bs=1k count=1 done -EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "1.0MB" quotausage "/" - -for i in {1..10}; do - TEST_IN_LOOP $CLI volume quota $V0 disable - TEST_IN_LOOP $CLI volume quota $V0 enable +mkdir $M0/dir1 +for i in {513..1024}; do + dd if=/dev/zero of=$M0/dir1/f$i bs=1k count=1 done -TEST $CLI volume quota $V0 limit-usage / 2MB EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "1.0MB" quotausage "/" -TEST $CLI volume stop $V0 -TEST $CLI volume delete $V0 +TEST $CLI volume quota $V0 disable +TEST $CLI volume quota $V0 enable + +EXPECT_WITHIN 60 "1.0MB" quotausage "/" + cleanup; diff --git a/tests/bugs/quota/inode-quota.t b/tests/bugs/quota/inode-quota.t deleted file mode 100644 index edc2c1de512..00000000000 --- a/tests/bugs/quota/inode-quota.t +++ /dev/null @@ -1,121 +0,0 @@ -#!/bin/bash - -. $(dirname $0)/../../include.rc -. $(dirname $0)/../../volume.rc -. $(dirname $0)/../../nfs.rc - -cleanup; - -QDD=$(dirname $0)/quota -# compile the test write program and run it -build_tester $(dirname $0)/../../basic/quota.c -o $QDD - -TESTS_EXPECTED_IN_LOOP=9 - -TEST glusterd -TEST pidof glusterd - -# -------------------------------------------------- -# Create, start and mount a volume with single brick -# -------------------------------------------------- - -TEST $CLI volume create $V0 $H0:$B0/{V0} -EXPECT "$V0" volinfo_field $V0 'Volume Name' -EXPECT 'Created' volinfo_field $V0 'Status' - -TEST $CLI volume start $V0 -EXPECT 'Started' volinfo_field $V0 'Status' - -TEST $GFS -s $H0 --volfile-id $V0 $M0 -TEST mkdir -p $M0/test_dir - -#-------------------------------------------------------- -# Enable quota of the volume and set hard and soft timeout -#------------------------------------------------------ - -TEST $CLI volume quota $V0 enable -EXPECT 'on' volinfo_field $V0 'features.quota' -TEST $CLI volume quota $V0 soft-timeout 0 -EXPECT '0' volinfo_field $V0 'features.soft-timeout' -TEST $CLI volume quota $V0 hard-timeout 0 -EXPECT '0' volinfo_field $V0 'features.hard-timeout' - - -#------------------------------------------------------- -# Set and remove quota limits on the directory and -# verify if the limits are being reflected properly -#------------------------------------------------------ - -TEST $CLI volume quota $V0 limit-usage /test_dir 100MB -EXPECT "100.0MB" quota_list_field "/test_dir" 2 - -TEST $CLI volume quota $V0 limit-objects /test_dir 100 -EXPECT "100" quota_object_list_field "/test_dir" 2 - -TEST $CLI volume quota $V0 remove /test_dir -EXPECT "" quota_list_field "/test_dir" 2 - -# Need to verify this once -#TEST $CLI volume quota $V0 remove-objects /test_dir -#EXPECT "" quota_object_list_field "/test_dir" 2 - -# Set back the limits - -TEST $CLI volume quota $V0 limit-usage /test_dir 10MB -EXPECT "10.0MB" quota_list_field "/test_dir" 2 - -TEST $CLI volume quota $V0 limit-objects /test_dir 10 -EXPECT "10" quota_object_list_field "/test_dir" 2 - -#----------------------------------------------------- -# Check the quota enforcement mechanism for usage -#----------------------------------------------------- - -# try creating a 8MB file and it should fail -TEST $QDD $M0/test_dir/test1.txt 256 32 -EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "8.0MB" quotausage "/test_dir" -TEST rm -f $M0/test_dir/test1.txt -EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "0Bytes" quotausage "/test_dir" - -# try creating a 15MB file and it should not succeed -TEST ! $QDD $M0/test_dir/test2.txt 256 60 -TEST rm -f $M0/test_dir/test2.txt -EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "0Bytes" quotausage "/test_dir" - - -#------------------------------------------------------ -# Check the quota enforcement mechanism for object count -#------------------------------------------------------- - -# Try creating 9 files and it should succeed as object limit -# is set to 10, since directory where limit is set is accounted -# as well. - -for i in {1..9}; do - TEST_IN_LOOP touch $M0/test_dir/test$i.txt -done -EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "9" quota_object_list_field "/test_dir" 4 - -# Check available limit -EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "0" quota_object_list_field "/test_dir" 6 - -# Check if hard-limit exceeded -EXPECT "Yes" quota_object_list_field "/test_dir" 8 - -# Check if soft-limit exceeded -EXPECT "Yes" quota_object_list_field "/test_dir" 7 - -# Creation of 11th file should throw out an error -TEST ! touch $M0/test_dir/test11.txt - -TEST rm -rf $M0/test_dir/test* -EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "0" quota_object_list_field "/test_dir" 4 - -TEST $CLI volume quota $V0 remove-objects /test_dir - -TEST $CLI volume stop $V0 -EXPECT "1" get_aux -TEST $CLI volume delete $V0 - -rm -f $QDD -cleanup; |
