[ "$SLOW" = "no" ] && EXCEPT_SLOW="24o 24v 27m 36f 36g 36h 51b 60c 63 64b 68 71 73 77f 78 101a 103 115 120g 124b"
+[ $(facet_fstype $SINGLEMDS) = "zfs" ] &&
+# bug number for skipped test: LU-2834 LU-1593 LU-2610 LU-2833 LU-1957 LU-2805
+ ALWAYS_EXCEPT="$ALWAYS_EXCEPT 18 34h 40 48a 180 184c"
+
FAIL_ON_ERROR=false
cleanup() {
}
run_test 31m "link to file: the same, non-existing, dir==============="
+test_31n() {
+ [ -e /proc/self/fd/173 ] && echo "skipping, fd 173 is in use" && return
+ touch $DIR/$tfile || error "cannot create '$DIR/$tfile'"
+ nlink=$(stat --format=%h $DIR/$tfile)
+ [ ${nlink:--1} -eq 1 ] || error "nlink is $nlink, expected 1"
+ exec 173<$DIR/$tfile
+ trap "exec 173<&-" EXIT
+ nlink=$(stat --dereference --format=%h /proc/self/fd/173)
+ [ ${nlink:--1} -eq 1 ] || error "nlink is $nlink, expected 1"
+ rm $DIR/$tfile || error "cannot remove '$DIR/$tfile'"
+ nlink=$(stat --dereference --format=%h /proc/self/fd/173)
+ [ ${nlink:--1} -eq 0 ] || error "nlink is $nlink, expected 0"
+ exec 173<&-
+}
+run_test 31n "check link count of unlinked file"
+
cleanup_test32_mount() {
trap 0
$UMOUNT $DIR/$tdir/ext2-mountpoint
local sz=1000
dd if=/dev/zero of=$DIR/$tfile bs=1M count=10 || error
+ sync # Flush the cache so that multiop below does not block on cache
+ # flush when getting the group lock
$MULTIOP $DIR/$tfile OG${gid}T${sz}g${gid}c &
MULTIPID=$!
sleep 2
}
run_test 133e "Verifying OST {read,write}_bytes nid stats ================="
+test_133f() {
+ local proc_dirs="/proc/fs/lustre/ /proc/sys/lnet/ /proc/sys/lustre/"
+ local facet
+
+ # First without trusting modes.
+ find $proc_dirs \
+ -exec cat '{}' \; &> /dev/null
+
+ # Second verifying readability.
+ find $proc_dirs \
+ -type f \
+ -readable \
+ -exec cat '{}' \; > /dev/null ||
+ error "proc file read failed"
+
+ for facet in $SINGLEMDS ost1; do
+ do_facet $facet find $proc_dirs \
+ -not -name req_history \
+ -exec cat '{}' \\\; &> /dev/null
+
+ do_facet $facet find $proc_dirs \
+ -not -name req_history \
+ -type f \
+ -readable \
+ -exec cat '{}' \\\; > /dev/null ||
+ error "proc file read failed"
+ done
+}
+run_test 133f "Check for LBUGs/Oopses/unreadable files in /proc"
+
test_140() { #bug-17379
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return
test_mkdir -p $DIR/$tdir || error "Creating dir $DIR/$tdir"
test_184c() {
check_swap_layouts_support && return 0
- dir0=$DIR/$tdir/$testnum
+ local dir0=$DIR/$tdir/$testnum
mkdir -p $dir0 || error "creating dir $dir0"
- ref1=$dir0/ref1
- ref2=$dir0/ref2
- file1=$dir0/file1
- file2=$dir0/file2
+
+ local ref1=$dir0/ref1
+ local ref2=$dir0/ref2
+ local file1=$dir0/file1
+ local file2=$dir0/file2
# create a file large enough for the concurent test
dd if=/dev/urandom of=$ref1 bs=1M count=$((RANDOM % 50 + 20))
dd if=/dev/urandom of=$ref2 bs=1M count=$((RANDOM % 50 + 20))
echo "ref file size: ref1(`stat -c %s $ref1`), ref2(`stat -c %s $ref2`)"
cp $ref2 $file2
- dd if=$ref1 of=$file1 bs=64k &
+ dd if=$ref1 of=$file1 bs=16k &
+ local DD_PID=$!
+
sleep 0.$((RANDOM % 5 + 1))
$LFS swap_layouts $file1 $file2
- rc=$?
+ local rc=$?
wait $DD_PID
[[ $? == 0 ]] || error "concurrent write on $file1 failed"
[[ $rc == 0 ]] || error "swap of $file1 and $file2 failed"
remaining=$((remaining - copied))
echo "Copied $copied bytes before swapping layout..."
- cmp -n $copied $file1 $ref2 ||
+ cmp -n $copied $file1 $ref2 | grep differ &&
error "Content mismatch [0, $copied) of ref2 and file1"
cmp -n $copied $file2 $ref1 ||
error "Content mismatch [0, $copied) of ref1 and file2"