Whamcloud - gitweb
LU-4748 test: get one single qos_threshold_rr number
[fs/lustre-release.git] / lustre / tests / sanity.sh
index 5efd974..94dd3cd 100644 (file)
@@ -198,6 +198,7 @@ test_4() {
        local MDTIDX=1
        local remote_dir=remote_dir
 
+       [ $MDSCOUNT -ge 2 ] && skip "skip now for LU-4690" && return #LU-4690
        test_mkdir $DIR/$remote_dir ||
                error "Create remote directory failed"
 
@@ -6548,6 +6549,25 @@ test_102n() { # LU-4101 mdt: protect internal xattrs
 }
 run_test 102n "silently ignore setxattr on internal trusted xattrs"
 
+test_102p() { # LU-4703 setxattr did not check ownership
+       local testfile=$DIR/$tfile
+
+       [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.5.56) ] &&
+               skip "MDS needs to be at least 2.5.56" && return
+
+       touch $testfile
+
+       echo "setfacl as user..."
+       $RUNAS setfacl -m "u:$RUNAS_ID:rwx" $testfile
+       [ $? -ne 0 ] || error "setfacl by $RUNAS_ID was allowed on $testfile"
+
+       echo "setfattr as user..."
+       setfacl -m "u:$RUNAS_ID:---" $testfile
+       $RUNAS setfattr -x system.posix_acl_access $testfile
+       [ $? -ne 0 ] || error "setfattr by $RUNAS_ID was allowed on $testfile"
+}
+run_test 102p "check setxattr(2) correctly fails without permission"
+
 run_acl_subtest()
 {
     $LUSTRE/tests/acl/run $LUSTRE/tests/acl/$1.test
@@ -6924,14 +6944,17 @@ test_116b() { # LU-2093
        [ $PARALLEL == "yes" ] && skip "skip parallel run" && return
 #define OBD_FAIL_MDS_OSC_CREATE_FAIL     0x147
        local old_rr
-       old_rr=$(do_facet $SINGLEMDS lctl get_param -n lov.*mdtlov*.qos_threshold_rr)
-       do_facet $SINGLEMDS lctl set_param lov.*mdtlov*.qos_threshold_rr 0
+       old_rr=$(do_facet $SINGLEMDS lctl get_param -n \
+               lo*.$FSNAME-MDT0000-mdtlov.qos_threshold_rr | head -1)
+       do_facet $SINGLEMDS lctl set_param \
+               lo*.$FSNAME-MDT0000-mdtlov.qos_threshold_rr=0
        mkdir -p $DIR/$tdir
        do_facet $SINGLEMDS lctl set_param fail_loc=0x147
        createmany -o $DIR/$tdir/f- 20 || error "can't create"
        do_facet $SINGLEMDS lctl set_param fail_loc=0
        rm -rf $DIR/$tdir
-       do_facet $SINGLEMDS lctl set_param lov.*mdtlov*.qos_threshold_rr $old_rr
+       do_facet $SINGLEMDS lctl set_param \
+               lo*.$FSNAME-MDT0000-mdtlov.qos_threshold_rr=$old_rr
 }
 run_test 116b "QoS shouldn't LBUG if not enough OSTs found on the 2nd pass"