Whamcloud - gitweb
LU-7151 tests: fix sanity test_205 on SLES12
[fs/lustre-release.git] / lustre / tests / sanity.sh
index 2c239e4..61d6591 100755 (executable)
@@ -8729,7 +8729,7 @@ test_129() {
        has_warning=0
 
        rm -rf $DIR/$tdir
-       test_mkdir -p $DIR/$tdir
+       mkdir -p $DIR/$tdir
 
        # block size of mds1
        local MDT_DEV=$(mdsdevname ${SINGLEMDS//mds/})
@@ -8738,9 +8738,6 @@ test_129() {
        set_dir_limits $MAX $MAX
        local I=$(stat -c%s "$DIR/$tdir")
        local J=0
-       local STRIPE_COUNT=1
-       [[ $MDSCOUNT -ge 2 ]] && STRIPE_COUNT=$($LFS getdirstripe -c $DIR/$tdir)
-       MAX=$((MAX*STRIPE_COUNT))
        while [[ $I -le $MAX ]]; do
                $MULTIOP $DIR/$tdir/$J Oc
                rc=$?
@@ -8754,8 +8751,9 @@ test_129() {
                if [ $rc -eq $EFBIG -o $rc -eq $ENOSPC ]; then
                        set_dir_limits 0 0
                        echo "return code $rc received as expected"
-                       multiop $DIR/$tdir/$J Oc ||
-                               error_exit "multiop failed w/o dir size limit"
+
+                       createmany -o $DIR/$tdir/$J_file_ 1000 ||
+                               error_exit "create failed w/o dir size limit"
 
                        check_mds_dmesg '"has reached"' ||
                                error_exit "has reached message should be output"
@@ -11793,6 +11791,7 @@ test_205() { # Job stats
        cmd="dd if=/dev/zero of=$DIR/$tfile bs=1M count=1 oflag=sync"
        verify_jobstats "$cmd" "ost1"
        # read
+       cancel_lru_locks osc
        cmd="dd if=$DIR/$tfile of=/dev/null bs=1M count=1 iflag=direct"
        verify_jobstats "$cmd" "ost1"
        # truncate
@@ -14240,6 +14239,26 @@ test_300p() {
 }
 run_test 300p "create striped directory without space"
 
+test_300q() {
+       [ $PARALLEL == "yes" ] && skip "skip parallel run" && return
+       [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return
+
+       local fd=$(free_fd)
+       local cmd="exec $fd<$tdir"
+       cd $DIR
+       $LFS mkdir -c $MDSCOUNT $tdir || error "create $tdir fails"
+       eval $cmd
+       cmd="exec $fd<&-"
+       trap "eval $cmd" EXIT
+       cd $tdir || error "cd $tdir fails"
+       rmdir  ../$tdir || error "rmdir $tdir fails"
+       mkdir local_dir && error "create dir succeeds"
+       $LFS setdirstripe -i1 remote_dir && error "create remote dir succeeds"
+       eval $cmd
+       return 0
+}
+run_test 300q "create remote directory under orphan directory"
+
 prepare_remote_file() {
        mkdir $DIR/$tdir/src_dir ||
                error "create remote source failed"
@@ -14371,17 +14390,42 @@ test_400b() { # LU-1606, LU-5011
 }
 run_test 400b "packaged headers can be compiled"
 
-test_401() { #LU-7437
+test_401a() { #LU-7437
        #count the number of parameters by "list_param -R"
        local params=$($LCTL list_param -R '*' 2>/dev/null | wc -l)
        #count the number of parameters by listing proc files
-       local procs=$(find -L $proc_dirs -mindepth 1 -printf '%P\n' 2>/dev/null |
+       local procs=$(find -L $proc_dirs -mindepth 1 -printf '%P\n' 2>/dev/null|
                      sort -u | wc -l)
 
        [ $params -eq $procs ] ||
                error "found $params parameters vs. $procs proc files"
+
+       # test the list_param -D option only returns directories
+       params=$($LCTL list_param -R -D '*' 2>/dev/null | wc -l)
+       #count the number of parameters by listing proc directories
+       procs=$(find -L $proc_dirs -mindepth 1 -type d -printf '%P\n' 2>/dev/null |
+               sort -u | wc -l)
+
+       [ $params -eq $procs ] ||
+               error "found $params parameters vs. $procs proc files"
+}
+run_test 401a "Verify if 'lctl list_param -R' can list parameters recursively"
+
+test_401b() {
+       local save=$($LCTL get_param -n jobid_var)
+       local tmp=testing
+
+       $LCTL set_param foo=bar jobid_var=$tmp bar=baz &&
+               error "no error returned when setting bad parameters"
+
+       local jobid_new=$($LCTL get_param -n foe jobid_var baz)
+       [[ "$jobid_new" == "$tmp" ]] || error "jobid tmp $jobid_new != $tmp"
+
+       $LCTL set_param -n fog=bam jobid_var=$save bat=fog
+       local jobid_old=$($LCTL get_param -n foe jobid_var bag)
+       [[ "$jobid_old" == "$save" ]] || error "jobid new $jobid_old != $save"
 }
-run_test 401 "Verify if 'lctl list_param -R' can list parameters recursively"
+run_test 401b "Verify 'lctl {get,set}_param' continue after error"
 
 test_402() {
        $LFS setdirstripe -i 0 $DIR/$tdir || error "setdirstripe -i 0 failed"