From 2f253abab679c21b41197379b23e36943e5995a7 Mon Sep 17 00:00:00 2001 From: James Nunez Date: Wed, 11 Dec 2013 09:50:21 -0700 Subject: [PATCH] LU-4343 tests: mkdir failing in sanity-hsm test 228 sanity-hsm test 228 calls mkdir on $tdir. Currently, the tdir variable is two directories. This is changed in LU-2524. Until LU-2524 lands, any call to mkdir with the tdir variable needs the "-p" flag. Also added removal of two files that the test creates and a new routine to create small files with dd using the sync flag. Signed-off-by: James Nunez Change-Id: Ic78a14625d8c45f405c013b96c84da909b9b9244 Reviewed-on: http://review.whamcloud.com/8542 Reviewed-by: John L. Hammond Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Faccini Bruno Reviewed-by: Oleg Drokin --- lustre/tests/sanity-hsm.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lustre/tests/sanity-hsm.sh b/lustre/tests/sanity-hsm.sh index 233db87..919d104 100644 --- a/lustre/tests/sanity-hsm.sh +++ b/lustre/tests/sanity-hsm.sh @@ -479,6 +479,12 @@ make_small() { path2fid $1 || error "cannot get fid on $1" } +make_small_sync() { + dd if=/dev/urandom of=$1 count=1 bs=1M conv=sync || + error "cannot create $1" + path2fid $1 || error "cannot get fid on $1" +} + cleanup_large_files() { local ratio=$(df -P $MOUNT | tail -1 | awk '{print $5}' | sed 's/%//g') @@ -3262,10 +3268,9 @@ test_228() { # test needs a running copytool copytool_setup - dd if=/dev/urandom of=$DIR/$tfile bs=1M count=1 conv=sync || - error "creating $DIR/$tfile" + local fid=$(make_small_sync $DIR/$tfile) $LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $DIR/$tfile - wait_request_state $(path2fid $DIR/$tfile) ARCHIVE SUCCEED + wait_request_state $fid ARCHIVE SUCCEED $LFS hsm_release $DIR/$tfile check_hsm_flags $DIR/$tfile "0x0000000d" @@ -3282,13 +3287,15 @@ test_228() { $LFS hsm_release $DIR/$tfile check_hsm_flags $DIR/$tfile "0x0000000d" - mkdir $DIR/$tdir + mkdir -p $DIR/$tdir || error "mkdir $tdir failed" tar cf - --sparse $DIR/$tfile | tar xvf - -C $DIR/$tdir || error "tar failed" cmp $DIR/$tfile $DIR/$tdir/$DIR/$tfile || error "comparing untarred $DIR/$tfile" + rm -f $DIR/$tfile $DIR/$tfile.2 || + error "rm $DIR/$tfile or $DIR/$tfile.2 failed" copytool_cleanup } run_test 228 "On released file, return extend to FIEMAP. For [cp,tar] --sparse" -- 1.8.3.1