summaryrefslogtreecommitdiffstats
path: root/tests/basic/quota.t
diff options
context:
space:
mode:
Diffstat (limited to 'tests/basic/quota.t')
-rwxr-xr-xtests/basic/quota.t18
1 files changed, 10 insertions, 8 deletions
diff --git a/tests/basic/quota.t b/tests/basic/quota.t
index 7a3aaee2bcf..5552c4fdc3d 100755
--- a/tests/basic/quota.t
+++ b/tests/basic/quota.t
@@ -8,6 +8,10 @@
cleanup;
+QDD=$(dirname $0)/quota
+# compile the test write program and run it
+build_tester $(dirname $0)/quota.c -o $QDD
+
TESTS_EXPECTED_IN_LOOP=19
TEST glusterd
@@ -72,22 +76,20 @@ TEST $CLI volume quota $V0 hard-timeout 0
## Verify quota enforcement
## -----------------------------
-# compile the test write program and run it
-TEST $CC $(dirname $0)/quota.c -o $(dirname $0)/quota;
# Try to create a 12MB file which should fail
-TEST ! $(dirname $0)/quota $M0/test_dir/1.txt "12582912"
+TEST ! $QDD $M0/test_dir/1.txt 256 48
TEST rm $M0/test_dir/1.txt
# wait for marker's accounting to complete
EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "0Bytes" usage "/test_dir"
-TEST dd if=/dev/urandom of=$M0/test_dir/2.txt bs=1024k count=8
+TEST $QDD $M0/test_dir/2.txt 256 32
EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "8.0MB" usage "/test_dir"
TEST rm $M0/test_dir/2.txt
EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "0Bytes" usage "/test_dir"
## rename tests
-TEST dd if=/dev/urandom of=$M0/test_dir/2 bs=1024k count=8
+TEST $QDD $M0/test_dir/2 256 32
EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "8.0MB" usage "/test_dir"
TEST mv $M0/test_dir/2 $M0/test_dir/0
EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "8.0MB" usage "/test_dir"
@@ -144,8 +146,7 @@ done
#53-62
for i in `seq 1 9`; do
- TEST_IN_LOOP dd if=/dev/urandom of="$M0/$TESTDIR/dir1/10MBfile$i" \
- bs=1024k count=10;
+ TEST_IN_LOOP $QDD "$M0/$TESTDIR/dir1/10MBfile$i" 256 40
done
# 63-64
@@ -160,7 +161,7 @@ EXPECT_WITHIN $REBALANCE_TIMEOUT "0" rebalance_completed
## <Try creating data beyond limit>
## --------------------------------
for i in `seq 1 200`; do
- dd if=/dev/urandom of="$M0/$TESTDIR/dir1/1MBfile$i" bs=1024k count=1 \
+ $QDD of="$M0/$TESTDIR/dir1/1MBfile$i" 256 4\
2>&1 | egrep -v '(No space left|Disc quota exceeded)'
done
@@ -194,4 +195,5 @@ EXPECT 'Stopped' volinfo_field $V0 'Status';
TEST $CLI volume delete $V0;
TEST ! $CLI volume info $V0;
+rm -f $QDD
cleanup;