local file=$HSM_ARCHIVE/$1
do_facet $SINGLEAGT mkdir -p $(dirname $file)
do_facet $SINGLEAGT dd if=/dev/urandom of=$file count=32 bs=1000000 ||
- error "cannot create $file"
+ file_creation_failure dd $file $?
}
copy2archive() {
path2fid() {
$LFS path2fid $1 | tr -d '[]'
+ return ${PIPESTATUS[0]}
}
get_hsm_flags() {
local f=$1
local u=$2
+ local st
if [[ $u == "user" ]]; then
- local st=$($RUNAS $LFS hsm_state $f)
+ st=$($RUNAS $LFS hsm_state $f)
else
- local st=$($LFS hsm_state $f)
u=root
+ st=$($LFS hsm_state $f)
fi
[[ $? == 0 ]] || error "$LFS hsm_state $f failed (run as $u)"
get_hsm_archive_id() {
local f=$1
- local st=$($LFS hsm_state $f)
+ local st
+ st=$($LFS hsm_state $f)
[[ $? == 0 ]] || error "$LFS hsm_state $f failed"
local ar=$(echo $st | grep "archive_id" | cut -f5 -d" " |
[[ $st == $fl ]] || error "hsm flags on $f are $st != $fl"
}
+file_creation_failure() {
+ local cmd=$1
+ local f=$2
+ local err=$3
+
+ df $MOUNT $MOUNT2 >&2
+ error "cannot create $f with $cmd, status=$err"
+}
+
copy_file() {
local f=
f=${f/$DIR/$DIR2}
fi
rm -f $f
- cp $1 $f || error "cannot copy $1 to $f"
+ cp $1 $f || file_creation_failure cp $f $?
+
path2fid $f || error "cannot get fid on $f"
}
make_small() {
local file2=${1/$DIR/$DIR2}
dd if=/dev/urandom of=$file2 count=2 bs=1M conv=fsync ||
- error "cannot create $file2"
+ file_creation_failure dd $file2 $?
+
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"
+ file_creation_failure dd $1 $?
path2fid $1 || error "cannot get fid on $1"
}
[ $? != 0 ] && return $?
dd if=/dev/urandom of=$file2 count=5 bs=$sz conv=fsync ||
- error "cannot create $file2"
+ file_creation_failure dd $file2 $?
+
path2fid $1 || error "cannot get fid on $1"
}
# size is not a multiple of 1M to avoid stripe
# aligment
dd if=/dev/urandom of=$file2 count=39 bs=1000000 conv=fsync ||
- error "cannot create $file2"
+ file_creation_failure dd $file2 $?
+
path2fid $1 || error "cannot get fid on $1"
}
# size is a multiple of 1M to have stripe
# aligment
dd if=/dev/urandom of=$file2 count=33 bs=1M conv=fsync ||
- error "cannot create $file2"
+ file_creation_failure dd $file2 $?
path2fid $1 || error "cannot get fid on $1"
}
# Copy timeout is 100s. 105MB => 105s
dd if=/dev/urandom of=$file2 count=103 bs=1M conv=fsync ||
- error "cannot create $file2"
+ file_creation_failure dd $file2 $?
path2fid $1 || error "cannot get fid on $1"
}
local cmd="$LCTL get_param -n ${MDT_PREFIX}${mdtidx}.hsm.actions"
cmd+=" | awk '/'$fid'.*action='$request'/ {print \\\$13}' | cut -f2 -d="
- wait_result $mds "$cmd" $state 100 ||
+ wait_result $mds "$cmd" $state 200 ||
error "request on $fid is not $state on $mds"
}
error "user could not change hsm flags"
dd if=/etc/passwd of=$f.append bs=1 count=3\
conv=notrunc oflag=append status=noxfer ||
- error "could not append to test file"
+ file_creation_failure dd $f.append $?
check_hsm_flags $f.append "0x00000003"
# Modify a file sets it dirty
error "user could not change hsm flags"
dd if=/dev/zero of=$f.modify bs=1 count=3\
conv=notrunc status=noxfer ||
- error "could not modify test file"
+ file_creation_failure dd $f.modify $?
check_hsm_flags $f.modify "0x00000003"
# Open O_TRUNC sets dirty
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
$LFS setstripe -c 2 $f
- local fid=$(make_large_for_striping $f)
+ local fid
+ fid=$(make_large_for_striping $f)
[ $? != 0 ] && skip "not enough free space" && return
local FILE_CRC=$(md5sum $f)
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
- local fid=$(make_large_for_progress $f)
+ local fid
+ fid=$(make_large_for_progress $f)
[ $? != 0 ] && skip "not enough free space" && return
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
- local fid=$(make_large_for_progress $f)
+ local fid
+ fid=$(make_large_for_progress $f)
[ $? != 0 ] && skip "not enough free space" && return
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
- local fid=$(make_large_for_progress $f)
+ local fid
+ fid=$(make_large_for_progress $f)
[ $? != 0 ] && skip "not enough free space" && return
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
- local fid=$(make_large_for_progress $f)
+ local fid
+ fid=$(make_large_for_progress $f)
[ $? != 0 ] && skip "not enough free space" && return
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
- local fid=$(make_large_for_progress_aligned $f)
+ local fid
+ fid=$(make_large_for_progress_aligned $f)
[ $? != 0 ] && skip "not enough free space" && return
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
- local fid=$(make_large_for_progress $f)
+ local fid
+ fid=$(make_large_for_progress $f)
[ $? != 0 ] && skip "not enough free space" && return
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
- local fid=$(make_large_for_progress $f)
+ local fid
+ fid=$(make_large_for_progress $f)
[ $? != 0 ] && skip "not enough free space" && return
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
local f=$DIR/$tdir/$tfile
local f1=$DIR/$tdir/$tfile-1
- local fid=$(make_large_for_progress $f)
+ local fid
+ fid=$(make_large_for_progress $f)
[ $? != 0 ] && skip "not enough free space" && return
local fid1=$(copy_file /etc/passwd $f1)
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
- local fid=$(make_large_for_progress $f)
+ local fid
+ fid=$(make_large_for_progress $f)
[ $? != 0 ] && skip "not enough free space" && return
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
- local fid=$(make_large_for_progress $f)
+ local fid
+ fid=$(make_large_for_progress $f)
[ $? != 0 ] && skip "not enough free space" && return
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f ||
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
- local fid=$(make_large_for_progress $f)
+ local fid
+ fid=$(make_large_for_progress $f)
[ $? != 0 ] && skip "not enough free space" && return
local mdtidx=0
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
- local fid=$(make_large_for_progress $f)
+ local fid
+ fid=$(make_large_for_progress $f)
[ $? != 0 ] && skip "not enough free space" && return
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f ||
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
- local fid=$(make_large_for_progress $f)
+ local fid
+ fid=$(make_large_for_progress $f)
[ $? != 0 ] && skip "not enough free space" && return
# if cdt is on, it can serve too quickly the request
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
- local fid=$(make_large_for_cancel $f)
+ local fid
+ fid=$(make_large_for_cancel $f)
[ $? != 0 ] && skip "not enough free space" && return
# test with cdt on is made in test_221
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
- local fid=$(make_large_for_progress $f)
+ local fid
+ fid=$(make_large_for_progress $f)
[ $? != 0 ] && skip "not enough free space" && return
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
- local fid=$(make_large_for_cancel $f)
+ local fid
+ fid=$(make_large_for_cancel $f)
[ $? != 0 ] && skip "not enough free space" && return
changelog_setup
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
- local fid=$(make_large_for_progress $f)
+ local fid
+ fid=$(make_large_for_progress $f)
[ $? != 0 ] && skip "not enough free space" && return
changelog_setup
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
- local fid=$(make_large_for_progress $f)
+ local fid
+ fid=$(make_large_for_progress $f)
[ $? != 0 ] && skip "not enough free space" && return
changelog_setup
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
- local fid=$(make_large_for_cancel $f)
+ local fid
+ fid=$(make_large_for_cancel $f)
[ $? != 0 ] && skip "not enough free space" && return
cdt_disable