From 8434f627fa779a6353a1b8a6f6bc3f97117c92b1 Mon Sep 17 00:00:00 2001 From: Niu Yawei Date: Mon, 15 Oct 2012 03:47:23 -0400 Subject: [PATCH] LU-2174 test: improve error message In sanity-quota.sh, if the testing user/group isn't existing, print error message to inform user to create them. Check free space for test_0. Signed-off-by: Niu Yawei Change-Id: Ie08250d665b305b140315f76391fd5161a6fbdd5 Reviewed-on: http://review.whamcloud.com/4268 Tested-by: Hudson Reviewed-by: Johann Lombardi Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/tests/sanity-quota.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/lustre/tests/sanity-quota.sh b/lustre/tests/sanity-quota.sh index 58cd433..ced8a285 100644 --- a/lustre/tests/sanity-quota.sh +++ b/lustre/tests/sanity-quota.sh @@ -99,12 +99,15 @@ lustre_fail() { RUNAS="runas -u $TSTID -g $TSTID" RUNAS2="runas -u $TSTID2 -g $TSTID2" -FAIL_ON_ERROR=true check_runas_id $TSTID $TSTID $RUNAS -FAIL_ON_ERROR=true check_runas_id $TSTID2 $TSTID2 $RUNAS2 DD="dd if=/dev/zero bs=1M" FAIL_ON_ERROR=false +check_runas_id_ret $TSTUSR $TSTUSR $RUNAS || + error "Please create user $TSTUSR($TSTID) and group $TSTUSR($TSTID)" +check_runas_id_ret $TSTUSR2 $TSTUSR2 $RUNAS2 || + error "Please create user $TSTUSR2($TSTID2) and group $TSTUSR2($TSTID2)" + # clear quota limits for a user or a group # usage: resetquota -u username # resetquota -g groupname @@ -351,12 +354,17 @@ test_quota_performance() { # test basic quota performance b=21696 test_0() { - setup_quota_test - trap cleanup_quota_test EXIT - local MB=100 # 100M [ "$SLOW" = "no" ] && MB=10 + local free_space=$(lfs df | grep "filesystem summary" | \ + awk '{print $5}') + [ $free_space -le $((MB * 1024)) ] && + skip "not enough space ${free_space} KB, " \ + "required $((MB * 1024)) KB" && return + setup_quota_test + trap cleanup_quota_test EXIT + set_ost_qtype "none" || error "disable ost quota failed" test_quota_performance $MB -- 1.8.3.1