MUNLINK=${MUNLINK:-munlink}
SOCKETSERVER=${SOCKETSERVER:-socketserver}
SOCKETCLIENT=${SOCKETCLIENT:-socketclient}
-IOPENTEST1=${IOPENTEST1:-iopentest1}
-IOPENTEST2=${IOPENTEST2:-iopentest2}
MEMHOG=${MEMHOG:-memhog}
DIRECTIO=${DIRECTIO:-directio}
ACCEPTOR_PORT=${ACCEPTOR_PORT:-988}
[ "$SLOW" = "no" ] && EXCEPT_SLOW="24o 24v 27m 36f 36g 36h 51b 51c 60c 63 64b 68 71 73 77f 78 101 103 115 120g 124b"
-SANITYLOG=${TESTSUITELOG:-$TMP/$(basename $0 .sh).log}
FAIL_ON_ERROR=false
cleanup() {
exit 0
fi
-[ "$SANITYLOG" ] && rm -f $SANITYLOG || true
-
check_and_setup_lustre
DIR=${DIR:-$MOUNT}
}
run_test 29 "IT_GETATTR regression ============================"
-test_30() {
+test_30a() { # was test_30
+ cp `which ls` $DIR || cp /bin/ls $DIR
+ $DIR/ls / || error
+ rm $DIR/ls
+}
+run_test 30a "execute binary from Lustre (execve) =============="
+
+test_30b() {
cp `which ls` $DIR || cp /bin/ls $DIR
- $DIR/ls /
+ chmod go+rx $DIR/ls
+ $RUNAS $DIR/ls / || error
rm $DIR/ls
}
-run_test 30 "run binary from Lustre (execve) ==================="
+run_test 30b "execute binary from Lustre as non-root ==========="
+
+test_30c() { # b=22376
+ cp `which ls` $DIR || cp /bin/ls $DIR
+ chmod a-rw $DIR/ls
+ cancel_lru_locks mdc
+ cancel_lru_locks osc
+ $RUNAS $DIR/ls / || error
+ rm -f $DIR/ls
+}
+run_test 30c "execute binary from Lustre without read perms ===="
test_31a() {
$OPENUNLINK $DIR/f31 $DIR/f31 || error
}
run_test 39l "directory atime update ==========================="
+test_39m() {
+ touch $DIR1/$tfile
+ sleep 2
+ local far_past_mtime=$(date -d "May 29 1953" +%s)
+ local far_past_atime=$(date -d "Dec 17 1903" +%s)
+
+ touch -m -d @$far_past_mtime $DIR1/$tfile
+ touch -a -d @$far_past_atime $DIR1/$tfile
+
+ for (( i=0; i < 2; i++ )) ; do
+ local timestamps=$(stat -c "%X %Y" $DIR1/$tfile)
+ [ "$timestamps" = "$far_past_atime $far_past_mtime" ] || \
+ error "atime or mtime set incorrectly"
+
+ cancel_lru_locks osc
+ if [ $i = 0 ] ; then echo "repeat after cancel_lru_locks"; fi
+ done
+
+
+}
+run_test 39m "test atime and mtime before 1970"
+
test_40() {
dd if=/dev/zero of=$DIR/f40 bs=4096 count=1
$RUNAS $OPENFILE -f O_WRONLY:O_TRUNC $DIR/f40 && error
}
run_test 54e "console/tty device works in lustre ======================"
-test_55() {
- rm -rf $DIR/d55
- mkdir $DIR/d55
- client_only && skip "Not a server" && return
- mount -t $FSTYPE -o loop,iopen $EXT2_DEV $DIR/d55 || error "mounting"
- touch $DIR/d55/foo
- $IOPENTEST1 $DIR/d55/foo $DIR/d55 || error "running $IOPENTEST1"
- $IOPENTEST2 $DIR/d55 || error "running $IOPENTEST2"
- echo "check for $EXT2_DEV. Please wait..."
- rm -rf $DIR/d55/*
- $UMOUNT $DIR/d55 || error "unmounting"
-}
-run_test 55 "check iopen_connect_dentry() ======================"
+#The test_55 used to be iopen test and it was removed by bz#24037.
+#run_test 55 "check iopen_connect_dentry() ======================"
test_56a() { # was test_56
rm -rf $DIR/d56
sync
sleep 1
df $dir #make sure we get new statfs data
- local MDSFREE=$(do_facet $mymds lctl get_param -n osd.*MDT000$((num -1)).kbytesfree)
+ local MDSFREE=$(do_facet $mymds \
+ lctl get_param -n osd*.*MDT000$((num -1)).kbytesfree)
local MDCFREE=$(lctl get_param -n mdc.*MDT000$((num -1))-mdc-*.kbytesfree)
echo "opening files to create objects/EAs"
local FILE
sleep 1 #make sure we get new statfs data
df $dir
- local MDSFREE2=$(do_facet $mymds lctl get_param -n osd.*MDT000$((num -1)).kbytesfree)
+ local MDSFREE2=$(do_facet $mymds \
+ lctl get_param -n osd*.*MDT000$((num -1)).kbytesfree)
local MDCFREE2=$(lctl get_param -n mdc.*MDT000$((num -1))-mdc-*.kbytesfree)
if [ "$MDCFREE2" -lt "$((MDCFREE - 8))" ]; then
if [ "$MDSFREE" != "$MDSFREE2" ]; then
}
run_test 71 "Running dbench on lustre (don't segment fault) ===="
-test_72() { # bug 5695 - Test that on 2.6 remove_suid works properly
+test_72a() { # bug 5695 - Test that on 2.6 remove_suid works properly
check_kernel_version 43 || return 0
[ "$RUNAS_ID" = "$UID" ] && skip_env "RUNAS_ID = UID = $UID -- skipping" && return
true
rm -f $DIR/f72
}
-run_test 72 "Test that remove suid works properly (bug5695) ===="
+run_test 72a "Test that remove suid works properly (bug5695) ===="
+
+test_72b() { # bug 24226 -- keep mode setting when size is not changing
+ local perm
+
+ [ "$RUNAS_ID" = "$UID" ] && \
+ skip_env "RUNAS_ID = UID = $UID -- skipping" && return
+ [ "$RUNAS_ID" -eq 0 ] && \
+ skip_env "RUNAS_ID = 0 -- skipping" && return
+
+ # Check that testing environment is properly set up. Skip if not
+ FAIL_ON_ERROR=false check_runas_id_ret $RUNAS_ID $RUNAS_ID $RUNAS || {
+ skip_env "User $RUNAS_ID does not exist - skipping"
+ return 0
+ }
+ touch $DIR/${tfile}-f{g,u}
+ mkdir $DIR/${tfile}-d{g,u}
+ chmod 770 $DIR/${tfile}-{f,d}{g,u}
+ chmod g+s $DIR/${tfile}-{f,d}g
+ chmod u+s $DIR/${tfile}-{f,d}u
+ for perm in 777 2777 4777; do
+ $RUNAS chmod $perm $DIR/${tfile}-fg && error "S/gid file allowed improper chmod to $perm"
+ $RUNAS chmod $perm $DIR/${tfile}-fu && error "S/uid file allowed improper chmod to $perm"
+ $RUNAS chmod $perm $DIR/${tfile}-dg && error "S/gid dir allowed improper chmod to $perm"
+ $RUNAS chmod $perm $DIR/${tfile}-du && error "S/uid dir allowed improper chmod to $perm"
+ done
+ true
+}
+run_test 72b "Test that we keep mode setting if without file data changed (bug 24226)"
# bug 3462 - multiple simultaneous MDC requests
test_73() {
awk '/lustre_inode_cache/ {print $2; exit}' /proc/slabinfo
}
+get_inode_slab_tunables() {
+ awk '/lustre_inode_cache/ {print $9," ",$10," ",$11; exit}' /proc/slabinfo
+}
+
+set_inode_slab_tunables() {
+ echo "lustre_inode_cache $1" > /proc/slabinfo
+}
+
test_76() { # Now for bug 20433, added originally in bug 1443
+ local SLAB_SETTINGS=`get_inode_slab_tunables`
+ local CPUS=`getconf _NPROCESSORS_ONLN`
+ # we cannot set limit below 1 which means 1 inode in each
+ # per-cpu cache is still allowed
+ set_inode_slab_tunables "1 1 0"
cancel_lru_locks osc
BEFORE_INODES=`num_inodes`
echo "before inodes: $BEFORE_INODES"
AFTER_INODES=`num_inodes`
echo "after inodes: $AFTER_INODES"
local wait=0
- while [ $AFTER_INODES -gt $BEFORE_INODES ]; do
+ while [ $((AFTER_INODES-1*CPUS)) -gt $BEFORE_INODES ]; do
sleep 2
AFTER_INODES=`num_inodes`
wait=$((wait+2))
error "inode slab grew from $BEFORE_INODES to $AFTER_INODES"
fi
done
+ set_inode_slab_tunables "$SLAB_SETTINGS"
}
run_test 76 "confirm clients recycle inodes properly ===="
}
run_test 200g "lfs df a pool ============================================"
+test_200h() { # b=24039
+ mkdir -p $POOL_DIR || error "unable to create $POOL_DIR"
+
+ local file="/..$POOL_DIR/$tfile-1"
+ $SETSTRIPE -p $POOL $file || error "unable to create $file"
+
+ cd $POOL_DIR
+ $SETSTRIPE -p $POOL $tfile-2 || \
+ error "unable to create $tfile-2 in $POOL_DIR"
+}
+run_test 200h "Create files in a pool with relative pathname ============"
+
test_201a() {
remote_mgs_nodsh && skip "remote MGS with nodsh" && return
TGT=$($LCTL get_param -n lov.$FSNAME-*.pools.$POOL | head -1)
}
run_test 900 "umount should not race with any mgc requeue thread"
-log "cleanup: ======================================================"
+complete $(basename $0) $SECONDS
check_and_cleanup_lustre
if [ "$I_MOUNTED" != "yes" ]; then
lctl set_param debug="$OLDDEBUG" 2> /dev/null || true
fi
-
-echo '=========================== finished ==============================='
-[ -f "$SANITYLOG" ] && cat $SANITYLOG && grep -q FAIL $SANITYLOG && exit 1 || true
-echo "$0: completed"
+exit_status