Strengthen sanity-hsm sub-tests using large files by skipping
then if not enough space instead to fail.
Also re-enable test_251, and test_[200,221,223b] (for LU-4178),
who have all been wrongly disabled because of their multiple
failures on an auto-test node with very low disk space for the
Servers VMs!!
Also fix a bug in sanity/test_56w that should not be run if
$OSTCOUNT < 2, that was triggered due to my very restictive
test environment osscount/ostcount=1 to limit the Lustre FS size
as much as possible.
Test-Parameters: ostcount=1 ostsizegb=1 envdefinitions=SLOW=yes
Test-Parameters: osscount=1 mdscount=1 testlist=sanity-hsm
Signed-off-by: Bruno Faccini <bruno.faccini@intel.com>
Change-Id: I26bc36e4304a916f29149e6ad19306ed59c9a616
Reviewed-on: http://review.whamcloud.com/12456
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: James Nunez <james.a.nunez@intel.com>
ONLY=${ONLY:-"$*"}
# bug number for skipped test: LU-3815
ALWAYS_EXCEPT="$SANITY_HSM_EXCEPT 34 35 36"
ONLY=${ONLY:-"$*"}
# bug number for skipped test: LU-3815
ALWAYS_EXCEPT="$SANITY_HSM_EXCEPT 34 35 36"
-# bug number for skipped test:LU-4178
-ALWAYS_EXCEPT="$ALWAYS_EXCEPT 200 221 223b"
-# bug number for skipped test:LU-3852
-ALWAYS_EXCEPT="$ALWAYS_EXCEPT 251"
# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
[ $ratio -gt 50 ] && find $MOUNT -size +10M -exec rm -f {} \;
}
[ $ratio -gt 50 ] && find $MOUNT -size +10M -exec rm -f {} \;
}
+check_enough_free_space() {
+ local nb=$1
+ local unit=$2
+ local need=$((nb * unit /1024))
+ local free=$(df -kP $MOUNT | tail -1 | awk '{print $4}')
+ (( $need >= $free )) && return 1
+ return 0
+}
+
make_large_for_striping() {
local file2=${1/$DIR/$DIR2}
local sz=$($LCTL get_param -n lov.*-clilov-*.stripesize | head -n1)
cleanup_large_files
make_large_for_striping() {
local file2=${1/$DIR/$DIR2}
local sz=$($LCTL get_param -n lov.*-clilov-*.stripesize | head -n1)
cleanup_large_files
+ check_enough_free_space 5 $sz
+ [ $? != 0 ] && return $?
+
dd if=/dev/urandom of=$file2 count=5 bs=$sz conv=fsync ||
error "cannot create $file2"
path2fid $1 || error "cannot get fid on $1"
dd if=/dev/urandom of=$file2 count=5 bs=$sz conv=fsync ||
error "cannot create $file2"
path2fid $1 || error "cannot get fid on $1"
+ check_enough_free_space 39 1000000
+ [ $? != 0 ] && return $?
+
# big file is large enough, so copy time is > 30s
# so copytool make 1 progress
# size is not a multiple of 1M to avoid stripe
# big file is large enough, so copy time is > 30s
# so copytool make 1 progress
# size is not a multiple of 1M to avoid stripe
+ check_enough_free_space 33 1048576
+ [ $? != 0 ] && return $?
+
# big file is large enough, so copy time is > 30s
# so copytool make 1 progress
# size is a multiple of 1M to have stripe
# big file is large enough, so copy time is > 30s
# so copytool make 1 progress
# size is a multiple of 1M to have stripe
+ check_enough_free_space 103 1048576
+ [ $? != 0 ] && return $?
+
# Copy timeout is 100s. 105MB => 105s
dd if=/dev/urandom of=$file2 count=103 bs=1M conv=fsync ||
error "cannot create $file2"
# Copy timeout is 100s. 105MB => 105s
dd if=/dev/urandom of=$file2 count=103 bs=1M conv=fsync ||
error "cannot create $file2"
local f=$DIR/$tdir/$tfile
$LFS setstripe -c 2 $f
local fid=$(make_large_for_striping $f)
local f=$DIR/$tdir/$tfile
$LFS setstripe -c 2 $f
local fid=$(make_large_for_striping $f)
+ [ $? != 0 ] && skip "not enough free space" && return
+
local FILE_CRC=$(md5sum $f)
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
local FILE_CRC=$(md5sum $f)
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
local fid=$(make_large_for_progress $f)
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
local fid=$(make_large_for_progress $f)
+ [ $? != 0 ] && skip "not enough free space" && return
+
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
wait_request_state $fid ARCHIVE SUCCEED
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
wait_request_state $fid ARCHIVE SUCCEED
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
local fid=$(make_large_for_progress $f)
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
local fid=$(make_large_for_progress $f)
+ [ $? != 0 ] && skip "not enough free space" && return
+
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
wait_request_state $fid ARCHIVE SUCCEED
$LFS hsm_release $f
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
wait_request_state $fid ARCHIVE SUCCEED
$LFS hsm_release $f
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
local fid=$(make_large_for_progress $f)
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
local fid=$(make_large_for_progress $f)
+ [ $? != 0 ] && skip "not enough free space" && return
+
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
wait_request_state $fid ARCHIVE SUCCEED
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
wait_request_state $fid ARCHIVE SUCCEED
local f=$DIR/$tdir/$tfile
local fid=$(make_large_for_progress $f)
local f=$DIR/$tdir/$tfile
local fid=$(make_large_for_progress $f)
+ [ $? != 0 ] && skip "not enough free space" && return
+
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
wait_request_state $fid ARCHIVE SUCCEED
$LFS hsm_release $f
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
wait_request_state $fid ARCHIVE SUCCEED
$LFS hsm_release $f
local f=$DIR/$tdir/$tfile
local fid=$(make_large_for_progress_aligned $f)
local f=$DIR/$tdir/$tfile
local fid=$(make_large_for_progress_aligned $f)
+ [ $? != 0 ] && skip "not enough free space" && return
+
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
wait_request_state $fid ARCHIVE SUCCEED
$LFS hsm_release $f
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
wait_request_state $fid ARCHIVE SUCCEED
$LFS hsm_release $f
local f=$DIR/$tdir/$tfile
local fid=$(make_large_for_progress $f)
local f=$DIR/$tdir/$tfile
local fid=$(make_large_for_progress $f)
+ [ $? != 0 ] && skip "not enough free space" && return
+
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
wait_request_state $fid ARCHIVE SUCCEED
$LFS hsm_release $f
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
wait_request_state $fid ARCHIVE SUCCEED
$LFS hsm_release $f
local f=$DIR/$tdir/$tfile
local fid=$(make_large_for_progress $f)
local f=$DIR/$tdir/$tfile
local fid=$(make_large_for_progress $f)
+ [ $? != 0 ] && skip "not enough free space" && return
+
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
wait_request_state $fid ARCHIVE SUCCEED
$LFS hsm_release $f
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
wait_request_state $fid ARCHIVE SUCCEED
$LFS hsm_release $f
local f=$DIR/$tdir/$tfile
local f1=$DIR/$tdir/$tfile-1
local fid=$(make_large_for_progress $f)
local f=$DIR/$tdir/$tfile
local f1=$DIR/$tdir/$tfile-1
local fid=$(make_large_for_progress $f)
+ [ $? != 0 ] && skip "not enough free space" && return
+
local fid1=$(copy_file /etc/passwd $f1)
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
wait_request_state $fid ARCHIVE SUCCEED
local fid1=$(copy_file /etc/passwd $f1)
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
wait_request_state $fid ARCHIVE SUCCEED
local f=$DIR/$tdir/$tfile
local fid=$(make_large_for_progress $f)
local f=$DIR/$tdir/$tfile
local fid=$(make_large_for_progress $f)
+ [ $? != 0 ] && skip "not enough free space" && return
+
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
wait_request_state $fid ARCHIVE SUCCEED
$LFS hsm_release $f
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
wait_request_state $fid ARCHIVE SUCCEED
$LFS hsm_release $f
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
local fid=$(make_large_for_progress $f)
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
local fid=$(make_large_for_progress $f)
+ [ $? != 0 ] && skip "not enough free space" && return
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f ||
error "could not archive file"
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f ||
error "could not archive file"
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
local fid=$(make_large_for_progress $f)
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
local fid=$(make_large_for_progress $f)
+ [ $? != 0 ] && skip "not enough free space" && return
local mdtidx=0
local mdt=${MDT_PREFIX}${mdtidx}
local mdtidx=0
local mdt=${MDT_PREFIX}${mdtidx}
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
local fid=$(make_large_for_progress $f)
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
local fid=$(make_large_for_progress $f)
+ [ $? != 0 ] && skip "not enough free space" && return
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f ||
error "could not archive file"
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f ||
error "could not archive file"
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
local fid=$(make_large_for_progress $f)
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
local fid=$(make_large_for_progress $f)
+ [ $? != 0 ] && skip "not enough free space" && return
+
# if cdt is on, it can serve too quickly the request
cdt_disable
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER --data $DATA $f
# if cdt is on, it can serve too quickly the request
cdt_disable
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER --data $DATA $f
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
local fid=$(make_large_for_cancel $f)
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
local fid=$(make_large_for_cancel $f)
+ [ $? != 0 ] && skip "not enough free space" && return
+
# test with cdt on is made in test_221
cdt_disable
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
# test with cdt on is made in test_221
cdt_disable
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
local fid=$(make_large_for_progress $f)
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
local fid=$(make_large_for_progress $f)
+ [ $? != 0 ] && skip "not enough free space" && return
+
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
wait_request_state $fid ARCHIVE SUCCEED
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
wait_request_state $fid ARCHIVE SUCCEED
local f=$DIR/$tdir/$tfile
local fid=$(make_large_for_cancel $f)
local f=$DIR/$tdir/$tfile
local fid=$(make_large_for_cancel $f)
+ [ $? != 0 ] && skip "not enough free space" && return
local f=$DIR/$tdir/$tfile
local fid=$(make_large_for_progress $f)
local f=$DIR/$tdir/$tfile
local fid=$(make_large_for_progress $f)
+ [ $? != 0 ] && skip "not enough free space" && return
changelog_setup
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
changelog_setup
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
local fid=$(make_large_for_progress $f)
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
local fid=$(make_large_for_progress $f)
+ [ $? != 0 ] && skip "not enough free space" && return
changelog_setup
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
changelog_setup
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
local fid=$(make_large_for_cancel $f)
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
local fid=$(make_large_for_cancel $f)
+ [ $? != 0 ] && skip "not enough free space" && return
cdt_disable
# to have a short test
cdt_disable
# to have a short test
run_test 56v "check 'lfs find -mdt match with lfs getstripe -M' ======="
test_56w() {
run_test 56v "check 'lfs find -mdt match with lfs getstripe -M' ======="
test_56w() {
+ [[ $OSTCOUNT -lt 2 ]] && skip_env "$OSTCOUNT < 2 OSTs -- skipping" &&
+ return
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return
TDIR=$DIR/${tdir}w
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return
TDIR=$DIR/${tdir}w