Whamcloud - gitweb
LU-10347 tests: suspend the copytool in sanity-hsm/test_252 92/30492/7
authorQuentin Bouget <quentin.bouget@cea.fr>
Tue, 12 Dec 2017 12:09:19 +0000 (12:09 +0000)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 9 Feb 2018 05:57:54 +0000 (05:57 +0000)
The copytool does not have to, and should not, process the archive
request emitted in test_252 of sanity-hsm: the test needs the request
to time out.

This patch suspends the copytool until the request times out.

Test-Parameters: trivial testlist=sanity-hsm
Signed-off-by: Quentin Bouget <quentin.bouget@cea.fr>
Change-Id: I54d114eafb85b75e7f9160806cd3298bfa186b19
Reviewed-on: https://review.whamcloud.com/30492
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Faccini Bruno <bruno.faccini@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/sanity-hsm.sh

index f244cd1..3906279 100755 (executable)
@@ -4729,36 +4729,27 @@ test_251() {
 run_test 251 "Coordinator request timeout"
 
 test_252() {
-       # test needs a running copytool
-       copytool setup -b 1
-
        mkdir -p $DIR/$tdir
        local f=$DIR/$tdir/$tfile
-       local fid=$(make_custom_file_for_progress $f 103 1048576)
+       local fid=$(create_empty_file "$f")
 
-       cdt_disable
        # to have a short test
-       local old_timeout=$(get_hsm_param active_request_timeout)
-       stack_trap "set_hsm_param active_request_timeout $old_timeout" EXIT
-       set_hsm_param active_request_timeout 20
-       # to be sure the cdt will wake up frequently so
-       # it will be able to cancel the "old" request
-       local old_loop_period=$(get_hsm_param loop_period)
-       stack_trap "set_hsm_param loop_period $old_loop_period" EXIT
-       set_hsm_param loop_period 2
-       cdt_enable
+       stack_trap "set_hsm_param loop_period $(get_hsm_param loop_period)" EXIT
+       set_hsm_param loop_period 1
 
-       # clear locks to avoid extra delay caused by flush/cancel
-       # and thus prevent early copytool death to timeout.
-       cancel_lru_locks osc
+       copytool_setup
+       copytool_suspend
 
        $LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
        wait_request_state $fid ARCHIVE STARTED
        rm -f $f
 
-       # wait but less than active_request_timeout+grace_delay
-       sleep 25
+       stack_trap "set_hsm_param active_request_timeout \
+                   $(get_hsm_param active_request_timeout)" EXIT
+       set_hsm_param active_request_timeout 1
+
        wait_request_state $fid ARCHIVE CANCELED
+       copytool_continue
 }
 run_test 252 "Timeout'ed running archive of a removed file should be canceled"