[ "$1" ] && FAIL_LOC=$1 || FAIL_LOC=0
mkdir -p $DIR/d27/nospc
rmdir $DIR/d27/nospc
- lctl set_param fail_loc=$FAIL_LOC
+ do_nodes $(comma_list $(osts_nodes)) lctl set_param fail_loc=$FAIL_LOC
}
exhaust_precreations() {
OSTIDX=$1
- OST=$(lctl get_param -n lov.${LOVNAME}.target_obd |
- grep ${OSTIDX}": " | \
- awk '{print $2}' | sed -e 's/_UUID$//')
+
+ OST=$(lfs osts | grep ${OSTIDX}": " | \
+ awk '{print $2}' | sed -e 's/_UUID$//')
# on the mdt's osc
- last_id=$(lctl get_param -n osc.*${OST}-osc-MDT0000.prealloc_last_id)
- next_id=$(lctl get_param -n osc.*${OST}-osc-MDT0000.prealloc_next_id)
+ last_id=$(do_facet $SINGLEMDS lctl get_param -n osc.*${OST}-osc-MDT0000.prealloc_last_id)
+ next_id=$(do_facet $SINGLEMDS lctl get_param -n osc.*${OST}-osc-MDT0000.prealloc_next_id)
- mkdir -p $DIR/d27/${OST}
+ mkdir -p $DIR/d27/${OST}
$SETSTRIPE $DIR/d27/${OST} -i $OSTIDX -c 1
#define OBD_FAIL_OST_ENOSPC 0x215
- lctl set_param fail_loc=0x215
+ do_facet ost$((OSTIDX + 1)) lctl set_param fail_loc=0x215
echo "Creating to objid $last_id on ost $OST..."
createmany -o $DIR/d27/${OST}/f $next_id $((last_id - next_id + 2))
- lctl get_param -n osc.*${OST}-osc-MDT0000.prealloc* | grep '[0-9]'
+ do_facet $SINGLEMDS lctl get_param -n osc.*${OST}-osc-MDT0000.prealloc* | grep '[0-9]'
reset_enospc $2
}
test_27n() {
[ "$OSTCOUNT" -lt "2" ] && skip "too few OSTs" && return
- remote_mds && skip "remote MDS" && return
+ remote_mds_nodsh && skip "remote MDS with nodsh" && return
+ remote_ost_nodsh && skip "remote OST with nodsh" && return
reset_enospc
rm -f $DIR/d27/f27n
test_27o() {
[ "$OSTCOUNT" -lt "2" ] && skip "too few OSTs" && return
- remote_mds && skip "remote MDS" && return
+ remote_mds_nodsh && skip "remote MDS with nodsh" && return
+ remote_ost_nodsh && skip "remote OST with nodsh" && return
reset_enospc
rm -f $DIR/d27/f27o
test_27p() {
[ "$OSTCOUNT" -lt "2" ] && skip "too few OSTs" && return
- remote_mds && skip "remote MDS" && return
+ remote_mds_nodsh && skip "remote MDS with nodsh" && return
+ remote_ost_nodsh && skip "remote OST with nodsh" && return
reset_enospc
rm -f $DIR/d27/f27p
test_27q() {
[ "$OSTCOUNT" -lt "2" ] && skip "too few OSTs" && return
- remote_mds && skip "remote MDS" && return
+ remote_mds_nodsh && skip "remote MDS with nodsh" && return
+ remote_ost_nodsh && skip "remote OST with nodsh" && return
reset_enospc
rm -f $DIR/d27/f27q
test_27r() {
[ "$OSTCOUNT" -lt "2" ] && skip "too few OSTs" && return
- remote_mds && skip "remote MDS" && return
+ remote_mds_nodsh && skip "remote MDS with nodsh" && return
+ remote_ost_nodsh && skip "remote OST with nodsh" && return
reset_enospc
rm -f $DIR/d27/f27r
test_27u() { # bug 4900
[ "$OSTCOUNT" -lt "2" ] && skip "too few OSTs" && return
- remote_mds && skip "remote MDS" && return
+ remote_ost_nodsh && skip "remote OST with nodsh" && return
#define OBD_FAIL_MDS_OSC_PRECREATE 0x13d
test_27v() { # bug 4900
[ "$OSTCOUNT" -lt "2" ] && skip "too few OSTs" && return
- remote_mds && skip "remote MDS" && return
+ remote_mds_nodsh && skip "remote MDS with nodsh" && return
+ remote_ost_nodsh && skip "remote OST with nodsh" && return
exhaust_all_precreations
run_test 36f "utime on file racing with OST BRW write =========="
test_36g() {
- remote_ost && skip "remote OST" && return
+ remote_ost_nodsh && skip "remote OST with nodsh" && return
+
+ mkdir -p $DIR/$tdir
export FMD_MAX_AGE=`do_facet ost1 lctl get_param -n obdfilter.*.client_cache_seconds 2> /dev/null | head -n 1`
FMD_BEFORE="`awk '/ll_fmd_cache/ { print $2 }' /proc/slabinfo`"
- touch $DIR/d36/$tfile
+ touch $DIR/$tdir/$tfile
sleep $((FMD_MAX_AGE + 12))
FMD_AFTER="`awk '/ll_fmd_cache/ { print $2 }' /proc/slabinfo`"
[ "$FMD_AFTER" -gt "$FMD_BEFORE" ] && \
run_test 52b "immutable flag test (should return errors) ======="
test_53() {
- remote_mds && skip "remote MDS" && return
+ remote_mds_nodsh && skip "remote MDS with nodsh" && return
+ remote_ost_nodsh && skip "remote OST with nodsh" && return
+
+ local param
+ local ostname
+ local mds_last
+ local ost_last
+ local ostnum
# only test MDT0000
- for value in `lctl get_param osc.*-osc-MDT0000.prealloc_last_id` ; do
+ for value in $(do_facet $SINGLEMDS lctl get_param osc.*-osc-MDT0000.prealloc_last_id) ; do
param=`echo ${value[0]} | cut -d "=" -f1`
+ mds_last=$(do_facet $SINGLEMDS lctl get_param -n $param)
ostname=`echo $param | cut -d "." -f2 | cut -d - -f 1-2`
- ost_last=`lctl get_param -n obdfilter.$ostname.last_id | head -n 1`
- mds_last=`lctl get_param -n $param`
+ ost_last=$(do_facet ost$ostnum lctl get_param -n obdfilter.$ostname.last_id | head -n 1)
echo "$ostname.last_id=$ost_last ; MDS.last_id=$mds_last"
if [ $ost_last != $mds_last ]; then
error "$ostname.last_id=$ost_last ; MDS.last_id=$mds_last"
test_57a() {
# note test will not do anything if MDS is not local
- remote_mds && skip "remote MDS" && return
+ remote_mds_nodsh && skip "remote MDS with nodsh" && return
+
local MNTDEV="osd.*MDT*.mntdev"
- DEV=$(lctl get_param -n $MNTDEV)
+ DEV=$(do_facet $SINGLEMDS lctl get_param -n $MNTDEV)
[ -z "$DEV" ] && error "can't access $MNTDEV"
- for DEV in `lctl get_param -n $MNTDEV`; do
- dumpe2fs -h $DEV > $TMP/t57a.dump || error "can't access $DEV"
+ for DEV in $(do_facet $SINGLEMDS lctl get_param -n $MNTDEV); do
+ do_facet $SINGLEMDS dumpe2fs -h $DEV > $TMP/t57a.dump || error "can't access $DEV"
DEVISIZE=`awk '/Inode size:/ { print $3 }' $TMP/t57a.dump`
[ "$DEVISIZE" -gt 128 ] || error "inode size $DEVISIZE"
rm $TMP/t57a.dump
test_65k() { # bug11679
[ "$OSTCOUNT" -lt 2 ] && skip "too few OSTs" && return
- remote_mds_nodsh && skip "remote MDS" && return
+ remote_mds_nodsh && skip "remote MDS with nodsh" && return
echo "Check OST status: "
MDS_OSCS=`do_facet $SINGLEMDS lctl dl | awk '/[oO][sS][cC].*md[ts]/ { print $4 }'`
# bug5265, obdfilter oa2dentry return -ENOENT
# #define OBD_FAIL_OST_ENOENT 0x217
test_69() {
- [ $(lctl get_param -n devices | grep -c obdfilter) -eq 0 ] && \
- skip "skipping test for remote OST" && return
+ remote_ost_nodsh && skip "remote OST with nodsh" && return
f="$DIR/$tfile"
- touch $f
+ $SETSTRIPE $f -c 1 -i 0
$DIRECTIO write ${f}.2 0 1 || error "directio write error"
- lctl set_param fail_loc=0x217
+ do_facet ost1 lctl set_param fail_loc=0x217
truncate $f 1 # vmtruncate() will ignore truncate() error.
$DIRECTIO write $f 0 2 && error "write succeeded, expect -ENOENT"
- lctl set_param fail_loc=0
+ do_facet ost1 lctl set_param fail_loc=0
$DIRECTIO write $f 0 2 || error "write error"
cancel_lru_locks osc
$DIRECTIO read $f 0 1 || error "read error"
- lctl set_param fail_loc=0x217
+ do_facet ost1 lctl set_param fail_loc=0x217
$DIRECTIO read $f 1 1 && error "read succeeded, expect -ENOENT"
- lctl set_param fail_loc=0
+ do_facet ost1 lctl set_param fail_loc=0
rm -f $f
}
run_test 69 "verify oa2dentry return -ENOENT doesn't LBUG ======"
run_test 77f "repeat checksum error on write (expect error) ===="
test_77g() { # bug 10889
- [ $(lctl get_param -n devices | grep -c obdfilter) -eq 0 ] && \
- skip "remote OST" && return
+ remote_ost_nodsh && skip "remote OST with nodsh" && return
+
[ ! -f $F77_TMP ] && setup_f77
+
+ $SETSTRIPE $DIR/f77g -c 1 -i 0
#define OBD_FAIL_OST_CHECKSUM_RECEIVE 0x21a
- lctl set_param fail_loc=0x8000021a
+ do_facet ost1 lctl set_param fail_loc=0x8000021a
set_checksums 1
- dd if=$F77_TMP of=$DIR/f77 bs=1M count=$F77SZ || \
+ dd if=$F77_TMP of=$DIR/f77g bs=1M count=$F77SZ || \
error "write error: rc=$?"
- lctl set_param fail_loc=0
+ do_facet ost1 lctl set_param fail_loc=0
set_checksums 0
}
run_test 77g "checksum error on OST write ======================"
test_77h() { # bug 10889
- [ $(lctl get_param -n devices | grep -c obdfilter) -eq 0 ] && \
- skip "remote OST" && return
- [ ! -f $DIR/f77 ] && skip "requires 77g - skipping" && return
+ remote_ost_nodsh && skip "remote OST with nodsh" && return
+
+ [ ! -f $DIR/f77g ] && skip "requires 77g - skipping" && return
cancel_lru_locks osc
#define OBD_FAIL_OST_CHECKSUM_SEND 0x21b
- lctl set_param fail_loc=0x8000021b
+ do_facet ost1 lctl set_param fail_loc=0x8000021b
set_checksums 1
- cmp $F77_TMP $DIR/f77 || error "file compare failed"
- lctl set_param fail_loc=0
+ cmp $F77_TMP $DIR/f77g || error "file compare failed"
+ do_facet ost1 lctl set_param fail_loc=0
set_checksums 0
}
run_test 77h "checksum error on OST read ======================="
run_test 78 "handle large O_DIRECT writes correctly ============"
test_79() { # bug 12743
- [ $(lctl get_param -n devices | grep -c obdfilter) -eq 0 ] &&
- skip "skipping test for remote OST" && return
-
wait_delete_completed
- BKTOTAL=`lctl get_param -n obdfilter.*.kbytestotal | awk 'BEGIN{total=0}; {total+=$1}; END{print total}'`
- BKFREE=`lctl get_param -n obdfilter.*.kbytesfree | awk 'BEGIN{free=0}; {free+=$1}; END{print free}'`
- BKAVAIL=`lctl get_param -n obdfilter.*.kbytesavail | awk 'BEGIN{avail=0}; {avail+=$1}; END{print avail}'`
+ BKTOTAL=$(calc_osc_kbytes kbytestotal)
+ BKFREE=$(calc_osc_kbytes kbytesfree)
+ BKAVAIL=$(calc_osc_kbytes kbytesavail)
+
STRING=`df -P $MOUNT | tail -n 1 | awk '{print $2","$3","$4}'`
DFTOTAL=`echo $STRING | cut -d, -f1`
DFUSED=`echo $STRING | cut -d, -f2`
test_116() {
[ "$OSTCOUNT" -lt "2" ] && skip "$OSTCOUNT < 2 OSTs" && return
- remote_mds && skip "remote MDS" && return
echo -n "Free space priority "
lctl get_param -n lov.*-clilov-*.qos_prio_free
test_118b()
{
- remote_ost_nodsh && skip "remote OST" && return
+ remote_ost_nodsh && skip "remote OST with nodsh" && return
reset_async
test_118c()
{
- remote_ost_nodsh && skip "remote OST" && return
+ remote_ost_nodsh && skip "remote OST with nodsh" && return
reset_async
test_118d()
{
- remote_ost_nodsh && skip "remote OST" && return
+ remote_ost_nodsh && skip "remote OST with nodsh" && return
reset_async
run_test 118g "Don't stay in wait if we got local -ENOMEM =========="
test_118h() {
- remote_ost_nodsh && skip "remote OST" && return
+ remote_ost_nodsh && skip "remote OST with nodsh" && return
reset_async
run_test 118h "Verify timeout in handling recoverables errors =========="
test_118i() {
- remote_ost_nodsh && skip "remote OST" && return
+ remote_ost_nodsh && skip "remote OST with nodsh" && return
reset_async
run_test 118i "Fix error before timeout in recoverable error =========="
test_118j() {
- remote_ost_nodsh && skip "remote OST" && return
+ remote_ost_nodsh && skip "remote OST with nodsh" && return
reset_async
test_118k()
{
+ remote_ost_nodsh && skip "remote OSTs with nodsh" && return
+
#define OBD_FAIL_OST_BRW_WRITE_BULK 0x20e
set_nodes_failloc "$(osts_nodes)" 0x20e
mkdir -p $DIR/$tdir
}
test_129() {
[ "$FSTYPE" != "ldiskfs" ] && skip "not needed for FSTYPE=$FSTYPE" && return 0
+ remote_mds_nodsh && skip "remote MDS with nodsh" && return
EFBIG=27
MAX=16384
}
test_200a() {
+ remote_mds_nodsh && skip "remote MDS with nodsh" && return
do_facet mgs $LCTL pool_new $FSNAME.$POOL
do_facet mgs $LCTL get_param -n lov.$FSNAME-MDT0000-mdtlov.pools.$POOL
[ $? == 0 ] || error "Pool creation of $POOL failed"
run_test 200a "Create new pool =========================================="
test_200b() {
+ remote_mds_nodsh && skip "remote MDS with nodsh" && return
TGT=$(seq -f $FSNAME-OST%04g_UUID $TGTPOOL_FIRST $TGTPOOL_STEP \
$TGTPOOL_MAX | tr '\n' ' ')
do_facet mgs $LCTL pool_add $FSNAME.$POOL \
run_test 200b "Add targets to a pool ===================================="
test_200c() {
+ remote_mds_nodsh && skip "remote MDS with nodsh" && return
mkdir -p $POOL_DIR
$SETSTRIPE -c 2 -p $POOL $POOL_DIR
[ $? = 0 ] || error "Cannot set pool $POOL to $POOL_DIR"
run_test 200c "Set pool on a directory ================================="
test_200d() {
+ remote_mds_nodsh && skip "remote MDS with nodsh" && return
res=$($GETSTRIPE $POOL_DIR | grep pool: | cut -f8 -d " ")
[ "$res" = $POOL ] || error "Pool on $POOL_DIR is not $POOL"
}
run_test 200d "Check pool on a directory ==============================="
test_200e() {
+ remote_mds_nodsh && skip "remote MDS with nodsh" && return
failed=0
for i in $(seq -w 1 $(($TGT_COUNT * 3)))
do
run_test 200e "Check files allocation from directory pool =============="
test_200f() {
+ remote_mds_nodsh && skip "remote MDS with nodsh" && return
mkdir -p $POOL_FILE
failed=0
for i in $(seq -w 1 $(($TGT_COUNT * 3)))
run_test 200f "Create files in a pool ==================================="
test_200g() {
+ remote_mds_nodsh && skip "remote MDS with nodsh" && return
TGT=$(do_facet mgs $LCTL get_param -n lov.$FSNAME-MDT0000-mdtlov.pools.$POOL | head -1)
do_facet mgs $LCTL pool_remove $FSNAME.$POOL $TGT
res=$(do_facet mgs $LCTL get_param -n lov.$FSNAME-MDT0000-mdtlov.pools.$POOL | grep $TGT)
run_test 200g "Remove a target from a pool ============================="
test_200h() {
+ remote_mds_nodsh && skip "remote MDS with nodsh" && return
for TGT in $(do_facet mgs $LCTL get_param -n lov.$FSNAME-MDT0000-mdtlov.pools.$POOL)
do
do_facet mgs $LCTL pool_remove $FSNAME.$POOL $TGT
run_test 200h "Remove all targets from a pool =========================="
test_200i() {
+ remote_mds_nodsh && skip "remote MDS with nodsh" && return
do_facet mgs $LCTL pool_destroy $FSNAME.$POOL
res=$(do_facet mgs "$LCTL get_param -n lov.$FSNAME-MDT0000-mdtlov.pools.$POOL 2>/dev/null")
[ "$res" = "" ] || error "Pool $FSNAME.$POOL is not destroyed"