From 1f50ba91a2a58890437924d8f72a27aecc2463d3 Mon Sep 17 00:00:00 2001 From: James Nunez Date: Fri, 2 Feb 2018 16:53:51 -0700 Subject: [PATCH] LU-10600 tests: clean up sanity tests 64d and 65k Several saity tests create files or modified the environment and does not clean up or return the environment to the original state. sanity test 64d fills and OST and does not clean up the file after the OST if full. sanity test 65k sets OSTs to be inactive and, on error, does not set the OST back to active. These two tests need to clean up after themselves. Test-Parameters: trivial testlist=sanity,sanity Signed-off-by: James Nunez Change-Id: I01bc376680798815c9dd398da7781c92c6b70b2f Reviewed-on: https://review.whamcloud.com/31159 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: John L. Hammond Reviewed-by: Saurabh Tandan Reviewed-by: Oleg Drokin --- lustre/tests/sanity.sh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 62f3478..e685f76 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -6310,6 +6310,9 @@ test_64d() { [[ $? -ne 0 ]] && break; sleep 2 done + + rm -f $DIR/$tfile + wait_delete_completed $LCTL set_param debug="$olddebug" 2> /dev/null || true } run_test 64d "check grant limit exceed" @@ -6450,6 +6453,19 @@ test_65j() { # bug6367 } run_test 65j "set default striping on root directory (bug 6367)=" +cleaup_65k() { + rm -rf $DIR/$tdir + wait_delete_completed + do_facet $SINGLEMDS "lctl set_param -n \ + osp.$ost*MDT0000.max_create_count=$max_count" + do_facet $SINGLEMDS "lctl set_param -n \ + osp.$ost*MDT0000.create_count=$count" + do_facet $SINGLEMDS lctl --device %$INACTIVE_OSC activate + echo $INACTIVE_OSC "is Activate" + + wait_osc_import_state mds ost$ostnum FULL +} + test_65k() { # bug11679 [ $PARALLEL == "yes" ] && skip "skip parallel run" && return [[ $OSTCOUNT -lt 2 ]] && skip_env "needs >= 2 OSTs" && return @@ -6493,7 +6509,8 @@ test_65k() { # bug11679 [ -f $DIR/$tdir/$idx ] && continue echo "$SETSTRIPE -i $idx -c 1 $DIR/$tdir/$idx" $SETSTRIPE -i $idx -c 1 $DIR/$tdir/$idx || - error "setstripe $idx should succeed" + { cleanup_65k; + error "setstripe $idx should succeed"; } rm -f $DIR/$tdir/$idx || error "rm $idx failed" done unlinkmany $DIR/$tdir/$tfile.$ostnum. 1000 -- 1.8.3.1