diff options
Diffstat (limited to 'tests/bugs/quota/bug-1038598.t')
-rw-r--r-- | tests/bugs/quota/bug-1038598.t | 51 |
1 files changed, 10 insertions, 41 deletions
diff --git a/tests/bugs/quota/bug-1038598.t b/tests/bugs/quota/bug-1038598.t index 10fdb23424f..7d69a98cbd4 100644 --- a/tests/bugs/quota/bug-1038598.t +++ b/tests/bugs/quota/bug-1038598.t @@ -14,37 +14,6 @@ TEST $CLI volume info; TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{1,2}; -function hard_limit() -{ - local QUOTA_PATH=$1; - $CLI volume quota $V0 list $QUOTA_PATH | grep "$QUOTA_PATH" | awk '{print $2}' -} - -function soft_limit() -{ - local QUOTA_PATH=$1; - $CLI volume quota $V0 list $QUOTA_PATH | grep "$QUOTA_PATH" | awk '{print $3}' -} - -function usage() -{ - local QUOTA_PATH=$1; - $CLI volume quota $V0 list $QUOTA_PATH | grep "$QUOTA_PATH" | awk '{print $4}' -} - -function sl_exceeded() -{ - local QUOTA_PATH=$1; - $CLI volume quota $V0 list $QUOTA_PATH | grep "$QUOTA_PATH" | awk '{print $6}' -} - -function hl_exceeded() -{ - local QUOTA_PATH=$1; - $CLI volume quota $V0 list $QUOTA_PATH | grep "$QUOTA_PATH" | awk '{print $7}' - -} - EXPECT "$V0" volinfo_field $V0 'Volume Name'; EXPECT 'Created' volinfo_field $V0 'Status'; EXPECT '2' brick_count $V0 @@ -60,26 +29,26 @@ TEST glusterfs -s $H0 --volfile-id $V0 $M0; TEST mkdir -p $M0/test_dir TEST $CLI volume quota $V0 limit-usage /test_dir 10MB 50 -EXPECT "10.0MB" hard_limit "/test_dir"; -EXPECT "50%" soft_limit "/test_dir"; +EXPECT "10.0MB" quota_hard_limit "/test_dir"; +EXPECT "50%" quota_soft_limit "/test_dir"; TEST $QDD $M0/test_dir/file1.txt 256 16 -EXPECT "4.0MB" usage "/test_dir"; -EXPECT 'No' sl_exceeded "/test_dir"; -EXPECT 'No' hl_exceeded "/test_dir"; +EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "4.0MB" quotausage "/test_dir"; +EXPECT 'No' quota_sl_exceeded "/test_dir"; +EXPECT 'No' quota_hl_exceeded "/test_dir"; TEST $QDD $M0/test_dir/file1.txt 256 24 -EXPECT "6.0MB" usage "/test_dir"; -EXPECT 'Yes' sl_exceeded "/test_dir"; -EXPECT 'No' hl_exceeded "/test_dir"; +EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "6.0MB" quotausage "/test_dir"; +EXPECT 'Yes' quota_sl_exceeded "/test_dir"; +EXPECT 'No' quota_hl_exceeded "/test_dir"; #set timeout to 0 so that quota gets enforced without any lag TEST $CLI volume set $V0 features.hard-timeout 0 TEST $CLI volume set $V0 features.soft-timeout 0 TEST ! $QDD $M0/test_dir/file1.txt 256 60 -EXPECT 'Yes' sl_exceeded "/test_dir"; -EXPECT 'Yes' hl_exceeded "/test_dir"; +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 |