X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Ftests%2Fsanity-hsm.sh;h=20675d7f531ae4b99241bbc6bc2b8ee3ed50e219;hp=d3c9e89646c0dc4c60bbc0a7971fefc3d4460774;hb=f671890c1c6ef021581f6de6b9047a9b4d988d25;hpb=7a985f7e613e176f45d6b89aa5e7861203394bc8 diff --git a/lustre/tests/sanity-hsm.sh b/lustre/tests/sanity-hsm.sh index d3c9e89..20675d7 100644 --- a/lustre/tests/sanity-hsm.sh +++ b/lustre/tests/sanity-hsm.sh @@ -1824,6 +1824,41 @@ test_30b() { } run_test 30b "Restore at exec (release case)" +test_30c() { + needclients 2 || return 0 + + # test needs a running copytool + copytool_setup + + mkdir -p $DIR/$tdir + local f=$DIR/$tdir/SLEEP + local fid=$(copy_file /bin/sleep $f) + chmod 755 $f + $LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f + wait_request_state $fid ARCHIVE SUCCEED + $LFS hsm_release $f + check_hsm_flags $f "0x0000000d" + # set no retry action mode + cdt_set_no_retry + do_node $CLIENT2 "$f 10" & + local pid=$! + sleep 3 + echo 'Hi!' > $f + [[ $? == 0 ]] && error "Update during exec of released file must fail" + wait $pid + [[ $? == 0 ]] || error "Execution failed during run" + cmp /bin/sleep $f + [[ $? == 0 ]] || error "Binary overwritten during exec" + + # cleanup + # remove no try action mode + cdt_clear_no_retry + check_hsm_flags $f "0x00000009" + + copytool_cleanup +} +run_test 30c "Update during exec of released file must fail" + restore_and_check_size() { local f=$1 local fid=$2