From 87e1428b792ad2a2a49db71924438a37a4537e6a Mon Sep 17 00:00:00 2001 From: Aditya Pandit Date: Tue, 20 Oct 2015 12:20:11 +0530 Subject: [PATCH] LU-7317 tests: Called the error function where it was missing. There were bunch of files where error function was missing Found this by executing grep '|| "' ./*.sh -r and grep '&& "' ./*sh -r in lustre/tests directory. Called the error function for those messages. Seagate-bug-id: MRP-3028 Change-Id: I204008234e36dcb49e28e5256b93bbb0bbaeaea5 Signed-off-by: Aditya Pandit Signed-off-by: Ashish Purkar Reviewed-on: http://review.whamcloud.com/16888 Reviewed-by: Jian Yu Tested-by: Jenkins Reviewed-by: James Nunez Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/tests/replay-ost-single.sh | 2 +- lustre/tests/sanity-hsm.sh | 2 +- lustre/tests/sanity-lfsck.sh | 14 ++++++++------ lustre/tests/sanity-quota.sh | 20 ++++++++++---------- lustre/tests/sanity.sh | 30 +++++++++++++++--------------- lustre/tests/sanityn.sh | 2 +- 6 files changed, 36 insertions(+), 34 deletions(-) diff --git a/lustre/tests/replay-ost-single.sh b/lustre/tests/replay-ost-single.sh index ac9f543..c02d9fa 100755 --- a/lustre/tests/replay-ost-single.sh +++ b/lustre/tests/replay-ost-single.sh @@ -395,7 +395,7 @@ run_test 8e "Verify that ptlrpc resends request on -EINPROGRESS" test_9() { [ $(lustre_version_code ost1) -ge $(version_code 2.6.54) ] || { skip "Need OST version at least 2.6.54"; return; } - $SETSTRIPE -i 0 -c 1 $DIR/$tfile || "setstripe failed" + $SETSTRIPE -i 0 -c 1 $DIR/$tfile || error "setstripe failed" replay_barrier ost1 # do IO dd if=/dev/zero of=$DIR/$tfile count=1 bs=1M > /dev/null || diff --git a/lustre/tests/sanity-hsm.sh b/lustre/tests/sanity-hsm.sh index aba7228..b6b29e6b 100755 --- a/lustre/tests/sanity-hsm.sh +++ b/lustre/tests/sanity-hsm.sh @@ -2160,7 +2160,7 @@ test_24d() { wait_request_state $fid1 RESTORE SUCCEED $LFS hsm_release $file1 || error "cannot release '$file1'" - dd if=$file2 of=/dev/null bs=1M || "cannot read '$file2'" + dd if=$file2 of=/dev/null bs=1M || error "cannot read '$file2'" $LFS hsm_release $file2 && error "release should fail on read-only mount" diff --git a/lustre/tests/sanity-lfsck.sh b/lustre/tests/sanity-lfsck.sh index aa8b385..55b0f5d 100644 --- a/lustre/tests/sanity-lfsck.sh +++ b/lustre/tests/sanity-lfsck.sh @@ -3296,7 +3296,8 @@ test_26a() { rm -f $DIR/$tdir/d0/foo || error "(4) Fail to unlink $DIR/$tdir/d0/foo" do_facet $SINGLEMDS $LCTL set_param fail_loc=0 - ls -ail $DIR/$tdir/d0/foo > /dev/null 2>&1 && "(5) 'ls' should fail" + ls -ail $DIR/$tdir/d0/foo > /dev/null 2>&1 && + error "(5) 'ls' should fail" echo "Trigger namespace LFSCK to repair the missing remote name entry" $START_NAMESPACE -r -A || @@ -3343,7 +3344,8 @@ test_26b() { rmdir $DIR/$tdir/d0/foo || error "(3) Fail to rmdir $DIR/$tdir/d0/foo" do_facet $SINGLEMDS $LCTL set_param fail_loc=0 - ls -ail $DIR/$tdir/d0/foo > /dev/null 2>&1 && "(4) 'ls' should fail" + ls -ail $DIR/$tdir/d0/foo > /dev/null 2>&1 && + error "(4) 'ls' should fail" echo "Trigger namespace LFSCK to repair the missing remote name entry" $START_NAMESPACE -r -A || @@ -3392,7 +3394,7 @@ test_27a() { do_facet $SINGLEMDS $LCTL set_param fail_loc=0 rm -rf $DIR/$tdir/d0 || error "(5) Fail to unlink the dir d0" - ls -ail $DIR/$tdir/d0 > /dev/null 2>&1 && "(6) 'ls' should fail" + ls -ail $DIR/$tdir/d0 > /dev/null 2>&1 && error "(6) 'ls' should fail" echo "Trigger namespace LFSCK to repair the lost parent" $START_NAMESPACE -r -A || @@ -3444,7 +3446,7 @@ test_27b() { do_facet $SINGLEMDS $LCTL set_param fail_loc=0 rmdir $DIR/$tdir/d0 || error "(4) Fail to unlink the dir d0" - ls -ail $DIR/$tdir/d0 > /dev/null 2>&1 && "(5) 'ls' should fail" + ls -ail $DIR/$tdir/d0 > /dev/null 2>&1 && error "(5) 'ls' should fail" echo "Trigger namespace LFSCK to repair the missing remote name entry" $START_NAMESPACE -r -A || @@ -3681,7 +3683,7 @@ test_29c() { local foofid=$($LFS path2fid $DIR/$tdir/d0/foo) $LFS fid2path $DIR $foofid local count2=$($LFS fid2path $DIR $foofid | wc -l) - [ $count2 -eq 2 ] || "(6) Fail to inject error: $count2" + [ $count2 -eq 2 ] || error "(6) Fail to inject error: $count2" echo "Trigger namespace LFSCK to repair the nlink count" $START_NAMESPACE -r -A || @@ -3770,7 +3772,7 @@ test_30() { mount_client $MOUNT || error "(17) Fail to start client!" - stat $DIR/$tdir/foo/f0 || "(18) f0 is not recovered" + stat $DIR/$tdir/foo/f0 || error "(18) f0 is not recovered" ls -ail $MOUNT/.lustre/lost+found/ diff --git a/lustre/tests/sanity-quota.sh b/lustre/tests/sanity-quota.sh index 76305d7..3cd052c 100755 --- a/lustre/tests/sanity-quota.sh +++ b/lustre/tests/sanity-quota.sh @@ -402,7 +402,7 @@ test_1() { trap cleanup_quota_test EXIT # enable ost quota - set_ost_qtype "ug" || "enable ost quota failed" + set_ost_qtype "ug" || error "enable ost quota failed" # test for user log "User quota (block hardlimit:$LIMIT MB)" @@ -487,7 +487,7 @@ test_2() { trap cleanup_quota_test EXIT # enable mdt quota - set_mdt_qtype "ug" || "enable mdt quota failed" + set_mdt_qtype "ug" || error "enable mdt quota failed" # test for user log "User quota (inode hardlimit:$LIMIT files)" @@ -1223,7 +1223,7 @@ test_7e() { $RUNAS createmany -m $TESTFILE $((ilimit + 1)) && quota_error u $TSTUSR "create succeeded, expect EDQUOT" - $RUNAS unlinkmany $TESTFILE $ilimit || "unlink files failed" + $RUNAS unlinkmany $TESTFILE $ilimit || error "unlink files failed" wait_delete_completed sync_all_data || true @@ -1243,8 +1243,8 @@ test_7e() { $RUNAS createmany -m $TESTFILE $((ilimit + 1)) || quota_error -u $TSTUSR "create failed, expect success" - $RUNAS unlinkmany $TESTFILE $((ilimit + 1)) || "unlink failed" - rmdir $DIR/${tdir}-1 || "unlink remote dir failed" + $RUNAS unlinkmany $TESTFILE $((ilimit + 1)) || error "unlink failed" + rmdir $DIR/${tdir}-1 || error "unlink remote dir failed" cleanup_quota_test resetquota -u $TSTUSR @@ -1357,7 +1357,7 @@ test_10() { error "set limit for root group successfully, expect failure" # root user can overrun quota - set_ost_qtype "ug" || "enable ost quota failed" + set_ost_qtype "ug" || error "enable ost quota failed" $LFS setquota -u $TSTUSR -b 0 -B 2M -i 0 -I 0 $DIR || error "set quota failed" @@ -1379,7 +1379,7 @@ test_11() { setup_quota_test || error "setup quota failed with $?" trap cleanup_quota_test EXIT - set_mdt_qtype "ug" || "enable mdt quota failed" + set_mdt_qtype "ug" || error "enable mdt quota failed" $LFS setquota -u $TSTUSR -b 0 -B 0 -i 0 -I 1 $DIR || error "set quota failed" @@ -1409,7 +1409,7 @@ test_12a() { setup_quota_test || error "setup quota failed with $?" trap cleanup_quota_test EXIT - set_ost_qtype "u" || "enable ost quota failed" + set_ost_qtype "u" || error "enable ost quota failed" quota_show_check b u $TSTUSR $LFS setquota -u $TSTUSR -b 0 -B "$blimit"M -i 0 -I 0 $DIR || @@ -1455,7 +1455,7 @@ test_12b() { $LFS mkdir -i 1 $DIR/${tdir}-1 || error "create remote dir failed" chmod 0777 $DIR/${tdir}-1 - set_mdt_qtype "u" || "enable mdt quota failed" + set_mdt_qtype "u" || error "enable mdt quota failed" quota_show_check f u $TSTUSR $LFS setquota -u $TSTUSR -b 0 -B 0 -i 0 -I $ilimit $DIR || @@ -1495,7 +1495,7 @@ test_13(){ setup_quota_test || error "setup quota failed with $?" trap cleanup_quota_test EXIT - set_ost_qtype "u" || "enable ost quota failed" + set_ost_qtype "u" || error "enable ost quota failed" quota_show_check b u $TSTUSR $LFS setquota -u $TSTUSR -b 0 -B 10M -i 0 -I 0 $DIR || diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index c8b46c8..dfc8ba7 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -9282,14 +9282,14 @@ test_133a() { # verify mdt stats first. mkdir ${testdir} || error "mkdir failed" check_stats $SINGLEMDS "mkdir" 1 - touch ${testdir}/${tfile} || "touch failed" + touch ${testdir}/${tfile} || error "touch failed" check_stats $SINGLEMDS "open" 1 check_stats $SINGLEMDS "close" 1 [ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.8.54) ] && { - mknod ${testdir}/${tfile}-pipe p || "mknod failed" + mknod ${testdir}/${tfile}-pipe p || error "mknod failed" check_stats $SINGLEMDS "mknod" 2 } - rm -f ${testdir}/${tfile}-pipe || "pipe remove failed" + rm -f ${testdir}/${tfile}-pipe || error "pipe remove failed" check_stats $SINGLEMDS "unlink" 1 rm -f ${testdir}/${tfile} || error "file remove failed" check_stats $SINGLEMDS "unlink" 2 @@ -9318,7 +9318,7 @@ test_133b() { remote_mds_nodsh && skip "remote MDS with nodsh" && return local testdir=$DIR/${tdir}/stats_testdir mkdir -p ${testdir} || error "mkdir failed" - touch ${testdir}/${tfile} || "touch failed" + touch ${testdir}/${tfile} || error "touch failed" cancel_lru_locks mdc # clear stats. @@ -9623,7 +9623,7 @@ test_134a() { local nsdir="ldlm.namespaces.*-MDT0000-mdc-*" local unused=$($LCTL get_param -n $nsdir.lock_unused_count) - [ $unused -eq 0 ] || "$unused locks are not cleared" + [ $unused -eq 0 ] || error "$unused locks are not cleared" local nr=1000 createmany -o $DIR/$tdir/f $nr || @@ -12428,16 +12428,16 @@ run_test 222a "AGL for ls should not trigger CLIO lock failure ================" test_222b () { [ $PARALLEL == "yes" ] && skip "skip parallel run" && return - rm -rf $DIR/$tdir - test_mkdir -p $DIR/$tdir - $SETSTRIPE -c 1 -i 0 $DIR/$tdir - createmany -o $DIR/$tdir/$tfile 10 - cancel_lru_locks mdc - cancel_lru_locks osc - #define OBD_FAIL_LDLM_AGL_DELAY 0x31a - $LCTL set_param fail_loc=0x31a - rm -r $DIR/$tdir || "AGL for rmdir failed" - $LCTL set_param fail_loc=0 + rm -rf $DIR/$tdir + test_mkdir -p $DIR/$tdir + $SETSTRIPE -c 1 -i 0 $DIR/$tdir + createmany -o $DIR/$tdir/$tfile 10 + cancel_lru_locks mdc + cancel_lru_locks osc + #define OBD_FAIL_LDLM_AGL_DELAY 0x31a + $LCTL set_param fail_loc=0x31a + rm -r $DIR/$tdir || error "AGL for rmdir failed" + $LCTL set_param fail_loc=0 } run_test 222b "AGL for rmdir should not trigger CLIO lock failure =============" diff --git a/lustre/tests/sanityn.sh b/lustre/tests/sanityn.sh index 61de75c..8979e98 100755 --- a/lustre/tests/sanityn.sh +++ b/lustre/tests/sanityn.sh @@ -3457,7 +3457,7 @@ test_81() { touch d0/0 || error "create 0 failed" mv d0/0 d1/0 || error "rename d0/0 d1/0 failed" stat d0/0 && error "stat mv filed succeed" - mv $DIR2/$tdir/d1/0 $DIR2/$tdir/d0/0 || "rename d1/0 d0/0 failed" + mv $DIR2/$tdir/d1/0 $DIR2/$tdir/d0/0 || error "rename d1/0 d0/0 failed" stat d0/0 || error "stat failed" local t=$(ls -ai $DIR1/$tdir/d0 | sort -u | wc -l) -- 1.8.3.1