[ "$SLOW" = "no" ] && EXCEPT_SLOW="$EXCEPT_SLOW 51b"
fi
-# Get the SLES version so we can make decisions on if a test should be run
+# Get the SLES distro version
#
# Returns a version string that should only be used in comparing
# strings returned by version_code()
-
sles_version_code()
{
local version=$(grep VERSION_ID /etc/os-release | cut -d'"' -f2)
version_code $sles_version
}
+# Check if we are running on Ubuntu or SLES so we can make decisions on
+# what tests to run
if [ -r /etc/SuSE-release ]; then
sles_version=$(sles_version_code)
[ $sles_version -lt $(version_code 11.4.0) ] &&
[ $sles_version -lt $(version_code 12.0.0) ] &&
# bug number for skipped test: LU-3703
ALWAYS_EXCEPT="$ALWAYS_EXCEPT 234"
+elif [ -r /etc/os-release ]; then
+ if grep -qi ubuntu /etc/os-release; then
+ ubuntu_version=$(version_code $(sed -n -e 's/"//g' \
+ -e 's/^VERSION=//p' \
+ /etc/os-release |
+ awk '{ print $1 }'))
+
+ if [[ $ubuntu_version -gt $(version_code 16.0.0) ]]; then
+ # bug number for skipped test:
+ # LU-10334 LU-10335 LU-10335 LU-10335
+ ALWAYS_EXCEPT+=" 103a 130a 130b 130c"
+ # LU-10335 LU-10335 LU-10365 LU-10366
+ ALWAYS_EXCEPT+=" 130d 130e 400a 410"
+ fi
+ fi
fi
FAIL_ON_ERROR=false
df $MOUNT > /dev/null 2>&1
[ $rc -eq 0 ] ||
error "e2fsck detected error for short/long symlink: rc=$rc"
+ rm -f $wdir/*
}
run_test 17m "run e2fsck against MDT which contains short/long symlink"
skip "OST < 2.10.55 doesn't limit grants enough" && return 0
local tgt=$($LCTL dl | grep "0000-osc-[^mM]" | awk '{print $4}')
+ local file=$DIR/$tfile
[[ $($LCTL get_param osc.${tgt}.import |
grep "connect_flags:.*grant_param") ]] || \
$LCTL set_param debug="$OLDDEBUG" 2> /dev/null || true
local max_cur_granted=$(($(want_grant $tgt) + $(grant_chunk $tgt)))
+ stack_trap "rm -f $file" EXIT
- $SETSTRIPE $DIR/$tfile -i 0 -c 1
- dd if=/dev/zero of=$DIR/$tfile bs=1M count=1000 &
+ $SETSTRIPE $file -i 0 -c 1
+ dd if=/dev/zero of=$file bs=1M count=1000 &
ddpid=$!
while true
[ ! -f $F77_TMP ] && setup_f77
- $SETSTRIPE -c 1 -i 0 $DIR/$tfile
+ local file=$DIR/$tfile
+ stack_trap "rm -f $file" EXIT
+
+ $SETSTRIPE -c 1 -i 0 $file
#define OBD_FAIL_OST_CHECKSUM_RECEIVE 0x21a
do_facet ost1 lctl set_param fail_loc=0x8000021a
set_checksums 1
- dd if=$F77_TMP of=$DIR/$tfile bs=1M count=$F77SZ ||
+ dd if=$F77_TMP of=$file bs=1M count=$F77SZ ||
error "write error: rc=$?"
do_facet ost1 lctl set_param fail_loc=0
set_checksums 0
#define OBD_FAIL_OST_CHECKSUM_SEND 0x21b
do_facet ost1 lctl set_param fail_loc=0x8000021b
set_checksums 1
- cmp $F77_TMP $DIR/$tfile || error "file compare failed"
+ cmp $F77_TMP $file || error "file compare failed"
do_facet ost1 lctl set_param fail_loc=0
set_checksums 0
}
test_83() {
local sfile="/boot/System.map-$(uname -r)"
+ [ ! -f $sfile ] && skip "No $sfile found" && return
# define OBD_FAIL_LLITE_PTASK_IO_FAIL 0x140d
$LCTL set_param fail_loc=0x140d
cp $sfile $DIR/$tfile || error "write failed"
test_101g_brw_size_test() {
local mb=$1
local pages=$((mb * 1048576 / $(page_size)))
+ local file=$DIR/$tfile
$LCTL set_param osc.*.max_pages_per_rpc=${mb}M ||
{ error "unable to set max_pages_per_rpc=${mb}M"; return 1; }
return 2
done
+ stack_trap "rm -f $file" EXIT
$LCTL set_param -n osc.*.rpc_stats=0
# 10 RPCs should be enough for the test
local count=10
- dd if=/dev/zero of=$DIR/$tfile bs=${mb}M count=$count ||
+ dd if=/dev/zero of=$file bs=${mb}M count=$count ||
{ error "dd write ${mb} MB blocks failed"; return 3; }
cancel_lru_locks osc
- dd of=/dev/null if=$DIR/$tfile bs=${mb}M count=$count ||
+ dd of=/dev/null if=$file bs=${mb}M count=$count ||
{ error "dd write ${mb} MB blocks failed"; return 4; }
# calculate number of full-sized read and write RPCs
fi
done
}
-run_test 103a "acl test ========================================="
+run_test 103a "acl test"
+
+test_103b() {
+ local U
+
+ for U in {0..511}; do
+ {
+ local O=$(printf "%04o" $U)
+
+ umask $(printf "%04o" $((511 ^ $O)))
+ $LFS setstripe -c 1 $DIR/$tfile.s$O
+ local S=$(printf "%04o" 0$(stat -c%a $DIR/$tfile.s$O))
+
+ (( $S == ($O & 0666) )) ||
+ error "lfs setstripe $DIR/$tfile.s$O '$S' != '$O'"
+
+ $LFS setstripe -E16M -c 1 -E1G -S4M $DIR/$tfile.p$O
+ S=$(printf "%04o" 0$(stat -c%a $DIR/$tfile.p$O))
+ (( $S == ($O & 0666) )) ||
+ error "lfs setstripe -E $DIR/$tfile.p$O '$S' != '$O'"
+
+ $LFS setstripe -N2 -c 1 $DIR/$tfile.m$O
+ S=$(printf "%04o" 0$(stat -c%a $DIR/$tfile.m$O))
+ (( $S == ($O & 0666) )) ||
+ error "lfs setstripe -N2 $DIR/$tfile.m$O '$S' != '$O'"
+ rm -f $DIR/$tfile.[smp]$0
+ } &
+ done
+ wait
+}
+run_test 103b "umask lfs setstripe"
test_103c() {
mkdir -p $DIR/$tdir
}
get_rename_size() {
- local size=$1
- local context=${2:-.}
- local sample=$(do_facet $SINGLEMDS $LCTL get_param mdt.*.rename_stats |
+ local size=$1
+ local context=${2:-.}
+ local sample=$(do_facet $SINGLEMDS $LCTL \
+ get_param mdt.$FSNAME-MDT0000.rename_stats |
grep -A1 $context |
awk '/ '${size}'/ {print $4}' | sed -e "s/,//g")
- echo $sample
+ echo $sample
}
test_133d() {
local testdir1=$DIR/${tdir}/stats_testdir1
local testdir2=$DIR/${tdir}/stats_testdir2
+ mkdir -p $DIR/${tdir}
do_facet $SINGLEMDS $LCTL set_param mdt.*.rename_stats=clear
- mkdir -p ${testdir1} || error "mkdir failed"
- mkdir -p ${testdir2} || error "mkdir failed"
+ lfs mkdir -i 0 -c 1 ${testdir1} || error "mkdir failed"
+ lfs mkdir -i 0 -c 1 ${testdir2} || error "mkdir failed"
createmany -o $testdir1/test 512 || error "createmany failed"
echo "source rename dir size: ${testdir1_size}"
echo "target rename dir size: ${testdir2_size}"
- local cmd="do_facet $SINGLEMDS $LCTL get_param mdt.*.rename_stats"
+ local cmd="do_facet $SINGLEMDS $LCTL "
+ cmd+="get_param mdt.$FSNAME-MDT0000.rename_stats"
+
eval $cmd || error "$cmd failed"
local samedir=$($cmd | grep 'same_dir')
local same_sample=$(get_rename_size $testdir1_size)
JOBENV=FAKE_JOBID
fi
fi
+LUSTRE_JOBID_SIZE=31 # plus NUL terminator
verify_jobstats() {
local cmd=($1)
[ "$JOBENV" = "FAKE_JOBID" ] &&
FAKE_JOBID=id.$testnum.$(basename ${cmd[0]}).$RANDOM
- JOBVAL=${!JOBENV}
+ JOBVAL=${!JOBENV:0:$LUSTRE_JOBID_SIZE}
[ "$JOBENV" = "nodelocal" ] && {
- FAKE_JOBID=id.$testnum.$(basename ${cmd[0]}).$RANDOM
+ FAKE_JOBID=id.$testnum.%e.$RANDOM
$LCTL set_param jobid_name=$FAKE_JOBID
- JOBVAL=$FAKE_JOBID
+ JOBVAL=${FAKE_JOBID/\%e/$(basename ${cmd[0]})}
}
log "Test: ${cmd[*]}"
- log "Using JobID environment variable $JOBENV=$JOBVAL"
+ log "Using JobID environment $($LCTL get_param -n jobid_var)=$JOBVAL"
if [ $JOBENV = "FAKE_JOBID" ]; then
FAKE_JOBID=$JOBVAL ${cmd[*]}
# all files are created on OST0000
for facet in $facets; do
local stats="*.$(convert_facet2label $facet).job_stats"
+
+ # strip out libtool wrappers for in-tree executables
if [ $(do_facet $facet lctl get_param $stats |
- grep -c $JOBVAL) -ne 1 ]; then
+ sed -e 's/\.lt-/./' | grep -c $JOBVAL) -ne 1 ]; then
do_facet $facet lctl get_param $stats
error "No jobstats for $JOBVAL found on $facet::$stats"
fi
[[ $JOBID_VAR = disable ]] && skip "jobstats is disabled" && return
local old_jobenv=$($LCTL get_param -n jobid_var)
- if [ $old_jobenv != $JOBENV ]; then
- jobstats_set $JOBENV
- stack_trap "do_facet mgs \
- $LCTL conf_param $FSNAME.sys.jobid_var=$old_jobenv" EXIT
- fi
+ [ $old_jobenv != $JOBENV ] && jobstats_set $JOBENV
+ stack_trap "do_facet mgs \
+ $LCTL conf_param $FSNAME.sys.jobid_var=$old_jobenv" EXIT
changelog_register
[ $jobids -eq 0 ] ||
error "Unexpected jobids when jobid_var=$JOBENV"
fi
+
+ lctl set_param jobid_var=USER jobid_name="S.%j.%e.%u.%h.E"
+ JOBENV="JOBCOMPLEX"
+ JOBCOMPLEX="S.$USER.touch.$(id -u).$(hostname).E"
+
+ verify_jobstats "touch $DIR/$tfile" $SINGLEMDS
}
run_test 205 "Verify job stats"