Whamcloud - gitweb
LU-14399 hsm: process hsm_actions in coordinator
[fs/lustre-release.git] / lustre / tests / conf-sanity.sh
index 5205d4b..7a9a105 100644 (file)
@@ -2100,11 +2100,10 @@ t32_test() {
                shall_cleanup_lustre=true
                $r $LCTL set_param debug="$PTLDEBUG"
 
-               # Leave re-enabling this to a separate patch for LU-11558
-               # t32_verify_quota $SINGLEMDS $fsname $tmp/mnt/lustre || {
-               #       error_noexit "verify quota failed"
-               #       return 1
-               #}
+               t32_verify_quota $SINGLEMDS $fsname $tmp/mnt/lustre || {
+                       error_noexit "verify quota failed"
+                       return 1
+               }
 
                if $r test -f $tmp/list; then
                        #
@@ -8672,6 +8671,18 @@ test_120() { # LU-11130
 }
 run_test 120 "cross-target rename should not create bad symlinks"
 
+test_121(){
+       stopall
+       start_mgsmds || error "MGS MDS Start failed"
+       fail mgs
+       stop_mds || error "Stopping MDSes failed"
+       #failback
+       start_mds
+       fail mgs
+       stop_mds || error "Stopping MDSes failed"
+}
+run_test 121 "failover MGS"
+
 test_122a() {
        [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs"
        [[ "$OST1_VERSION" -ge $(version_code 2.11.53) ]] ||
@@ -8737,6 +8748,7 @@ test_122b() {
                        error "unlinkmany failed unlink $files files"
        done
        sync
+       touch $DIR/$tdir/$tfile
        do_facet ost1 sync
        #we need a write req during recovery for ofd_seq_load
        replay_barrier ost1
@@ -9029,10 +9041,7 @@ test_123F() {
        echo "Writeconf"
        writeconf_all
        echo "Remounting"
-       mountmgs
-       mountmds
-       mountoss
-       mountcli
+       setup_noconfig
 
        # Reapply the config from before
        echo "Setting configuration parameters"
@@ -9312,6 +9321,23 @@ test_128()
 }
 run_test 128 "Force using remote logs with --nolocallogs"
 
+test_129()
+{
+       stopall
+       start_mds || error "MDS start failed"
+       format_ost 1
+       start ost1 $(ostdevname 1) $OST_MOUNT_OPTS &&
+               error "start ost1 should fail" || true
+       start ost1 $(ostdevname 1) $OST_MOUNT_OPTS &&
+               error "second start ost1 should fail" || true
+       do_facet ost1 "$TUNEFS --writeconf $(ostdevname 1)"
+       start ost1 $(ostdevname 1) $OST_MOUNT_OPTS ||
+               error "start ost1 failed"
+       stop ost1
+       stop_mds
+}
+run_test 129 "attempt to connect an OST with the same index should fail"
+
 test_130()
 {
        [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs"
@@ -9324,6 +9350,75 @@ test_130()
 }
 run_test 130 "re-register an MDT after writeconf"
 
+test_131() {
+       [ "$mds1_FSTYPE" == "ldiskfs" ] || skip "ldiskfs only test"
+       do_facet mds1 $DEBUGFS -R features $(mdsdevname 1) |
+               grep -q project || skip "skip project quota not supported"
+
+       local projid
+
+       setupall
+       test_mkdir -c $MDSCOUNT -p $DIR/$tdir
+       $LFS project -p 1000 $DIR/$tdir || error "set dir project id failed"
+       createmany -o $DIR/$tdir/f 512
+       for ((i = 0; i < 512; ++i)); do
+               $LFS project -p $i $DIR/$tdir/f${i} ||
+                       error "set f${i} project id failed"
+       done
+
+       test_mkdir -c $MDSCOUNT -p $DIR/$tdir.inherit
+       $LFS project -p 1001 -s $DIR/$tdir.inherit
+       createmany -o $DIR/$tdir.inherit/f 128
+       (( $($LFS project $DIR/$tdir.inherit/f* |
+               awk '$1 == 1001 { print }' | wc -l) == 128 )) ||
+                       error "files did not inherit projid 1001"
+
+       stopall
+
+       for i in $(seq $MDSCOUNT); do
+               mds_backup_restore mds$i ||
+                       error "Backup/restore on mds$i failed"
+       done
+
+       setupall
+
+       projid=($($LFS project -d $DIR/$tdir))
+       [ ${projid[0]} == "1000" ] ||
+               error "projid expected 1000 not ${projid[0]}"
+       for ((i = 0; i < 512; ++i)); do
+               projid=($($LFS project $DIR/$tdir/f${i}))
+               [ ${projid[0]} == "$i" ] ||
+                       error "projid expected $i not ${projid[0]}"
+       done
+
+       (( $($LFS project $DIR/$tdir.inherit/f* |
+               awk '$1 == 1001 { print }' | wc -l) == 128 )) ||
+                       error "restore did not copy projid 1001"
+}
+run_test 131 "MDT backup restore with project ID"
+
+test_132() {
+       local err_cnt
+       local err_cnt2
+
+       reformat
+       combined_mgs_mds || start_mgs || error "unable to start MGS"
+       start_mdt 1 || error "unable to start mdt1"
+
+       err_cnt=$(do_facet mds1 dmesg | grep -c "cannot take the layout locks")
+       stop_mdt 1 || error "stop mdt1 failed"
+
+       [ "$mds1_FSTYPE" == zfs ] && import_zpool mds1
+       do_facet mds1 $TUNEFS --param mdt.hsm_control=enabled $(mdsdevname 1) ||
+               error "tunefs failed"
+       start_mdt 1 || error "cannot start mdt1"
+
+       err_cnt2=$(do_facet mds1 dmesg | grep -c "cannot take the layout locks")
+       [ $err_cnt -eq $err_cnt2 ] || error "Can not take the layout lock"
+       stop_mdt 1 || error "stop mdt1 failed"
+}
+run_test 132 "hsm_actions processed after failover"
+
 if ! combined_mgs_mds ; then
        stop mgs
 fi