In sanity-hsm test script, there were several places where the
bash's local built-in was used with assignments from a command
substitution and command's exit code was tested after.
This is a wrong usage since the 'local' builtin does not propagate
the exit code.
Signed-off-by: Bruno Faccini <bruno.faccini@intel.com>
Change-Id: I4257e55ec61ed0c4e48812407b5cf82ab316b701
Reviewed-on: http://review.whamcloud.com/13159
Tested-by: Jenkins
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Nunez <james.a.nunez@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
get_hsm_flags() {
local f=$1
local u=$2
get_hsm_flags() {
local f=$1
local u=$2
if [[ $u == "user" ]]; then
if [[ $u == "user" ]]; then
- local st=$($RUNAS $LFS hsm_state $f)
+ st=$($RUNAS $LFS hsm_state $f)
- local st=$($LFS hsm_state $f)
+ st=$($LFS hsm_state $f)
fi
[[ $? == 0 ]] || error "$LFS hsm_state $f failed (run as $u)"
fi
[[ $? == 0 ]] || error "$LFS hsm_state $f failed (run as $u)"
get_hsm_archive_id() {
local f=$1
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" " |
[[ $? == 0 ]] || error "$LFS hsm_state $f failed"
local ar=$(echo $st | grep "archive_id" | cut -f5 -d" " |
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
$LFS setstripe -c 2 $f
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)
[ $? != 0 ] && skip "not enough free space" && return
local FILE_CRC=$(md5sum $f)
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
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
[ $? != 0 ] && skip "not enough free space" && return
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
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
[ $? != 0 ] && skip "not enough free space" && return
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
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
[ $? != 0 ] && skip "not enough free space" && return
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
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
[ $? != 0 ] && skip "not enough free space" && return
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
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
[ $? != 0 ] && skip "not enough free space" && return
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
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
[ $? != 0 ] && skip "not enough free space" && return
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
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
[ $? != 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 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)
[ $? != 0 ] && skip "not enough free space" && return
local fid1=$(copy_file /etc/passwd $f1)
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
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
[ $? != 0 ] && skip "not enough free space" && return
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
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 ||
[ $? != 0 ] && skip "not enough free space" && return
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f ||
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
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
[ $? != 0 ] && skip "not enough free space" && return
local mdtidx=0
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
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 ||
[ $? != 0 ] && skip "not enough free space" && return
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f ||
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
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
[ $? != 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
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
[ $? != 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
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
[ $? != 0 ] && skip "not enough free space" && return
$LFS hsm_archive --archive $HSM_ARCHIVE_NUMBER $f
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
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
[ $? != 0 ] && skip "not enough free space" && return
changelog_setup
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
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
[ $? != 0 ] && skip "not enough free space" && return
changelog_setup
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
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
[ $? != 0 ] && skip "not enough free space" && return
changelog_setup
mkdir -p $DIR/$tdir
local f=$DIR/$tdir/$tfile
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
[ $? != 0 ] && skip "not enough free space" && return
cdt_disable