Whamcloud - gitweb
LU-10600 tests: clean up sanity tests 64d and 65k 59/31159/4
authorJames Nunez <james.a.nunez@intel.com>
Fri, 2 Feb 2018 23:53:51 +0000 (16:53 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 27 Feb 2018 03:47:20 +0000 (03:47 +0000)
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 <james.a.nunez@intel.com>
Change-Id: I01bc376680798815c9dd398da7781c92c6b70b2f
Reviewed-on: https://review.whamcloud.com/31159
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Saurabh Tandan <saurabh.tandan@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/sanity.sh

index 62f3478..e685f76 100755 (executable)
@@ -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