From: Emoly Liu Date: Wed, 4 Mar 2015 22:07:21 +0000 (+0800) Subject: LU-6345 test: compare /bin/sleep in sanity-hsm.sh test_30c X-Git-Tag: 2.7.51~33 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=79020798bdcc09477b0b4d05b1d35e2432909aab;hp=eebeee9afa368d62b9a0813652a4c14430bd8e35 LU-6345 test: compare /bin/sleep in sanity-hsm.sh test_30c In case /bin/sleep is modified during the test, we do a checksum at the beginning and the end of the test respectively, and won't mark the test a failure if the checksum has changed. Signed-off-by: Emoly Liu Change-Id: I1ff472ea6052e2df9ba9fd4c78a4cf53686e1ccd Reviewed-on: http://review.whamcloud.com/14025 Reviewed-by: Jian Yu Reviewed-by: Andreas Dilger Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/tests/sanity-hsm.sh b/lustre/tests/sanity-hsm.sh index 76a88ef..9ca5bc7 100755 --- a/lustre/tests/sanity-hsm.sh +++ b/lustre/tests/sanity-hsm.sh @@ -2207,6 +2207,7 @@ test_30c() { mkdir -p $DIR/$tdir local f=$DIR/$tdir/SLEEP + local slp_sum1=$(md5sum /bin/sleep) local fid=$(copy_file /bin/sleep $f) chmod 755 $f $LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f @@ -2223,7 +2224,12 @@ test_30c() { wait $pid [[ $? == 0 ]] || error "Execution failed during run" cmp /bin/sleep $f - [[ $? == 0 ]] || error "Binary overwritten during exec" + if [[ $? != 0 ]]; then + local slp_sum2=$(md5sum /bin/sleep) + # in case sleep file is modified during the test + [[ $slp_sum1 == $slp_sum2 ]] && + error "Binary overwritten during exec" + fi # cleanup # remove no try action mode