grep -q 'Enterprise Server 10' /etc/SuSE-release 2> /dev/null &&
ALWAYS_EXCEPT="$ALWAYS_EXCEPT 11 14" || true
-# Tests that fail on uml
-[ "$UML" = "true" ] && EXCEPT="$EXCEPT 7"
-
# It will be ported soon.
EXCEPT="$EXCEPT 22"
. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
init_logging
-[ "$SLOW" = "no" ] && EXCEPT_SLOW="12 23 33a"
+[ $(facet_fstype $SINGLEMDS) = "zfs" ] &&
+# bug number for skipped test: LU-2840 LU-2189 LU-2776
+ ALWAYS_EXCEPT="$ALWAYS_EXCEPT 21 36 51a"
+
+[ "$SLOW" = "no" ] && EXCEPT_SLOW="33a"
FAIL_ON_ERROR=false
OSTCOUNT=$($LCTL get_param -n lov.$LOVNAME.numobd)
assert_DIR
-rm -rf $DIR1/[df][0-9]* $DIR1/lnk
+rm -rf $DIR1/[df][0-9]* $DIR1/lnk $DIR/[df].${TESTSUITE}*
SAMPLE_FILE=$TMP/$(basename $0 .sh).junk
dd if=/dev/urandom of=$SAMPLE_FILE bs=1M count=1
cleanup_21() {
trap 0
- umount $DIR1/d21
+ umount $DIR1/$tdir
}
test_21() { # Bug 5907
- test_mkdir $DIR1/d21
- mount /etc $DIR1/d21 --bind || error "mount failed" # Poor man's mount.
+ test_mkdir $DIR1/$tdir
+ mount /etc $DIR1/$tdir --bind || error "mount failed" # Poor man's mount.
trap cleanup_21 EXIT
- rmdir -v $DIR1/d21 && error "Removed mounted directory"
- rmdir -v $DIR2/d21 && echo "Removed mounted directory from another mountpoint, needs to be fixed"
- test -d $DIR1/d21 || error "Mounted directory disappeared"
+ rmdir -v $DIR1/$tdir && error "Removed mounted directory"
+ rmdir -v $DIR2/$tdir && echo "Removed mounted directory from another mountpoint, needs to be fixed"
+ test -d $DIR1/$tdir || error "Mounted directory disappeared"
cleanup_21
- test -d $DIR2/d21 || test -d $DIR1/d21 && error "Removed dir still visible after umount"
+ test -d $DIR2/$tdir || test -d $DIR1/$tdir && error "Removed dir still visible after umount"
true
}
run_test 21 " Try to remove mountpoint on another dir ===="
#bug 11549 - permanently turn test off in b1_5
run_test 29 "lock put race between glimpse and enqueue ========="
-test_30() { #bug #11110
+test_30() { #bug #11110, LU-2523
test_mkdir -p $DIR1/$tdir
cp -f /bin/bash $DIR1/$tdir/bash
/bin/sh -c 'sleep 1; rm -f $DIR2/$tdir/bash;
cp /bin/bash $DIR2/$tdir' &
- local err=$($DIR1/$tdir/bash -c 'sleep 2;
- openfile -f O_RDONLY /proc/$$/exe >& /dev/null; echo $?')
+ $DIR1/$tdir/bash -c 'sleep 2;
+ openfile -f O_RDONLY /proc/$$/exe >& /dev/null; echo $?'
wait
- [ $err -ne 116 ] &&
- error_ignore 12900 "return code ($err) != -ESTALE" && return
true
}
local stat=0
for mds in ${mdts//,/ }; do
varsvc=${mds}_svc
- dev=$(basename $(do_facet $mds lctl get_param -n osd*.${!varsvc}.mntdev))
- val=$(do_facet $mds "procfile=/proc/fs/jbd/$dev/info;
-[ -f \\\$procfile ] || procfile=/proc/fs/jbd2/$dev/info;
-[ -f \\\$procfile ] || procfile=/proc/fs/jbd2/${dev}\:\\\*/info;
-cat \\\$procfile | head -1;")
+ dev=$(basename $(do_facet $mds "lctl get_param -n osd*.${!varsvc}.mntdev|\
+ xargs readlink -f" ))
+ val=$(do_facet $mds "cat /proc/fs/jbd*/${dev}{,:*,-*}/info 2>/dev/null|\
+ head -1")
val=${val%% *};
stat=$(( stat + val))
done
test_33a() {
remote_mds_nodsh && skip "remote MDS with nodsh" && return
- [ -n "$CLIENTS" ] || { skip "Need two or more clients" && return 0; }
- [ $CLIENTCOUNT -ge 2 ] || \
- { skip "Need two or more clients, have $CLIENTCOUNT" && return 0; }
+ [ -z "$CLIENTS" ] && skip "Need two or more clients, have $CLIENTS" && return 0
+ [ $CLIENTCOUNT -lt 2 ] &&
+ skip "Need two or more clients, have $CLIENTCOUNT" && return 0
local nfiles=${TEST33_NFILES:-10000}
local param_file=$TMP/$tfile-params
+ local fstype=$(facet_fstype $SINGLEMDS)
save_lustre_params $(comma_list $(mdts_nodes)) "mdt.*.commit_on_sharing" > $param_file
local COS
- local jbdold
- local jbdnew
+ local jbdold="N/A"
+ local jbdnew="N/A"
local jbd
for COS in 0 1; do
for i in 1 2 3; do
do_nodes $CLIENT1,$CLIENT2 "mkdir -p $DIR1/$tdir-\\\$(hostname)-$i"
- jbdold=$(print_jbd_stat)
+ [ $fstype = ldiskfs ] && jbdold=$(print_jbd_stat)
echo "=== START createmany old: $jbdold transaction"
local elapsed=$(do_and_time "do_nodes $CLIENT1,$CLIENT2 createmany -o $DIR1/$tdir-\\\$(hostname)-$i/f- -r $DIR2/$tdir-\\\$(hostname)-$i/f- $nfiles > /dev/null 2>&1")
- jbdnew=$(print_jbd_stat)
- jbd=$(( jbdnew - jbdold ))
+ [ $fstype = ldiskfs ] && jbdnew=$(print_jbd_stat)
+ [ $fstype = ldiskfs ] && jbd=$(( jbdnew - jbdold ))
echo "=== END createmany new: $jbdnew transaction : $jbd transactions nfiles $nfiles time $elapsed COS=$COS"
- avgjbd=$(( avgjbd + jbd ))
+ [ $fstype = ldiskfs ] && avgjbd=$(( avgjbd + jbd ))
avgtime=$(( avgtime + elapsed ))
done
eval cos${COS}_jbd=$((avgjbd / 3))
echo $locks
}
+cleanup_34() {
+ local i
+ trap 0
+ do_nodes $(comma_list $(osts_nodes)) \
+ "lctl set_param -n fail_loc=0 2>/dev/null || true"
+ for i in $(seq $OSTCOUNT); do
+ wait_osc_import_state client ost$i FULL
+ done
+}
+
test_34() { #16129
local OPER
local lock_in
local lock_out
+ trap cleanup_34 EXIT RETURN
for OPER in notimeout timeout ; do
rm $DIR1/$tfile 2>/dev/null
lock_in=$(get_ost_lock_timeouts)
fi
fi
done
+ cleanup_34
}
run_test 34 "no lock timeout under IO"
i=0
SIZE=50
let SIZE_B=SIZE*1024*1024
+ sync; sleep 5; sync # wait for delete thread
while [ $i -le 10 ]; do
lctl mark "start test"
- local before=$($LFS df | awk '{ if ($1 ~/^filesystem/) \
- { print $5; exit} }')
+ local before=$(lfs_df $MOUNT1 | awk '/^filesystem/{ print $4; exit }')
dd if=/dev/zero of=$DIR1/$tdir/$tfile bs=1M count=$SIZE ||
error "dd $DIR1/$tdir/$tfile ${SIZE}MB failed"
sync # sync data from client cache
sync_all_data # sync data from server cache (delayed allocation)
- sleep 1
- local after_dd=$($LFS df | awk '{ if ($1 ~/^filesystem/) \
- { print $5; exit} }')
+ sleep 2
+ local after_dd=$(lfs_df $MOUNT1 | awk '/^filesystem/{ print $4; exit }')
multiop_bg_pause $DIR2/$tdir/$tfile O_r${SIZE_B}c || return 3
read_pid=$!
rm -f $DIR1/$tdir/$tfile
kill -USR1 $read_pid
wait $read_pid
wait_delete_completed
- local after=$($LFS df | awk '{ if ($1 ~/^filesystem/) \
- { print $5; exit} }')
+ local after=$(lfs_df $MOUNT1 | awk '/^filesystem/{ print $4; exit }')
echo "*** cycle($i) *** before($before) after_dd($after_dd)" \
"after($after)"
# this free space! not used
- if [ $after_dd -ge $after ]; then
- error "space leaked"
- return 1;
- fi
+ (( $after_dd <= $after)) ||
+ error "space leaked after_dd:$after_dd > after:$after"
let i=i+1
done
}
mv $DIR1/$tfile $DIR1/$tfile-2 &
PID1=$!
sleep 1
- stat $DIR2/$tfile > /dev/null && "stat must fail"
+ stat $DIR2/$tfile > /dev/null && error "stat must fail"
check_pdo_conflict $PID1 && { wait $PID1; error "getattr isn't blocked"; }
rm -r $DIR1/*
return 0
# open and sleep 2 seconds then read
$MULTIOP $DIR2/$tfile o_2r${filesize}c &
local pid=$!
- sleep 0.1
+ sleep 1
# create the layout of testing file
dd if=$origfile of=$DIR1/$tfile conv=notrunc > /dev/null
$LCTL set_param fail_loc=0x1404
stat -c %s $DIR2/$tfile |tee $tmpfile &
local pid=$!
- sleep 0.1
+ sleep 1
# create layout of testing file
dd if=/dev/zero of=$DIR1/$tfile bs=1k count=1 conv=notrunc > /dev/null
echo "Setting layout ..."
$LFS setstripe -c $OSTCOUNT $DIR1/$tfile &
pid=$!
- sleep 0.1
+ sleep 1
# get layout of this file should wait until dd is finished
local stripecnt=`$LFS getstripe -c $DIR2/$tfile`
}
run_test 60 "Verify data_version behaviour"
-test_70() {
+test_70a() {
local test_dir=$tdir/test_dir
mkdir -p $DIR1/$tdir
cd $DIR2/$tdir || error "exit directory"
}
-run_test 70 "cd directory && rm directory"
+run_test 70a "cd directory && rm directory"
+
+test_70b() { # LU-2781
+ local i
+ mkdir -p $DIR1/$tdir
+
+ touch $DIR1/$tdir/file
+ for ((i = 0; i < 32; i++)); do
+ $LFS rm_entry $DIR1/$tdir/non_existent_dir &>/dev/null
+ done
+ rm $DIR1/$tdir/file || error "cannot remove file after rm_entry"
+
+ touch $DIR1/$tdir/file
+ $LFS mkdir -i0 $DIR1/$tdir/test_dir
+ $LFS rm_entry $DIR1/$tdir/test_dir &>/dev/null
+ rm -rf $DIR1/$tdir/test_dir ||
+ error "cannot remove directory after rm_entry"
+ rm $DIR1/$tdir/file || error "cannot remove file after rm_entry"
+}
+run_test 70b "remove files after calling rm_entry"
log "cleanup: ======================================================"