From 79020798bdcc09477b0b4d05b1d35e2432909aab Mon Sep 17 00:00:00 2001 From: Emoly Liu Date: Thu, 5 Mar 2015 06:07:21 +0800 Subject: [PATCH 1/1] 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 --- lustre/tests/sanity-hsm.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 -- 1.8.3.1