Whamcloud - gitweb
b=15902
[fs/lustre-release.git] / lustre / tests / conf-sanity.sh
index 6f9ba5d..0af727b 100644 (file)
@@ -11,11 +11,8 @@ set -e
 
 ONLY=${ONLY:-"$*"}
 
-# bug number for skipped test: 13739 19280
-HEAD_EXCEPT="                  32a    50e 50f"
-
 # bug number for skipped test:
-ALWAYS_EXCEPT=" $CONF_SANITY_EXCEPT $HEAD_EXCEPT"
+ALWAYS_EXCEPT=" $CONF_SANITY_EXCEPT"
 # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
 
 SRCDIR=`dirname $0`
@@ -950,7 +947,7 @@ start32 () {
 
        echo "Starting local ${facet}: $@ $device ${MOUNT%/*}/${facet}"
        mount -t lustre $@ ${device} ${MOUNT%/*}/${facet}
-       RC=$?
+       local RC=$?
        if [ $RC -ne 0 ]; then
                echo "mount -t lustre $@ ${device} ${MOUNT%/*}/${facet}"
                echo "Start of ${device} of local ${facet} failed ${RC}"
@@ -979,62 +976,51 @@ test_32a() {
        [ -n "$CLIENTONLY" -o -n "$CLIENTMODSONLY" ] && skip "client only testing" && return 0
        [ "$NETTYPE" = "tcp" ] || { skip "NETTYPE != tcp" && return 0; }
        [ -z "$TUNEFS" ] && skip "No tunefs" && return 0
-       local DISK1_8=$LUSTRE/tests/disk1_8.tgz
-       [ ! -r $DISK1_8 ] && skip "Cannot find $DISK1_8" && return 0
 
-       mkdir -p $TMP/$tdir
-       tar xjvf $DISK1_8 -C $TMP/$tdir || \
+       local DISK1_8=$LUSTRE/tests/disk1_8.tar.bz2
+       [ ! -r $DISK1_8 ] && skip "Cannot find $DISK1_8" && return 0
+       local tmpdir=$TMP/conf32a
+       mkdir -p $tmpdir
+       tar xjvf $DISK1_8 -C $tmpdir || \
                { skip "Cannot untar $DISK1_8" && return 0; }
 
        load_modules
-       lctl set_param debug=$PTLDEBUG
+       $LCTL set_param debug=$PTLDEBUG
 
        $TUNEFS $tmpdir/mds || error "tunefs failed"
 
        # nids are wrong, so client wont work, but server should start
-       start32 mds $tmpdir/mds "-o loop,exclude=lustre-OST0000" && \
+       start32 mds1 $tmpdir/mds "-o loop,exclude=lustre-OST0000" && \
                trap cleanup_32 EXIT INT || return 3
 
-       local UUID=$(lctl get_param -n mds.lustre-MDT0000.uuid)
+       local UUID=$($LCTL get_param -n mdt.lustre-MDT0000.uuid)
        echo MDS uuid $UUID
-       [ "$UUID" == "mdsA_UUID" ] || error "UUID is wrong: $UUID"
+       [ "$UUID" == "lustre-MDT0000_UUID" ] || error "UUID is wrong: $UUID"
 
-       $TUNEFS --mgsnode=`hostname` $tmpdir/ost1 || error "tunefs failed"
+       $TUNEFS --mgsnode=$HOSTNAME $tmpdir/ost1 || error "tunefs failed"
        start32 ost1 $tmpdir/ost1 "-o loop" || return 5
-       UUID=$(lctl get_param -n obdfilter.lustre-OST0000.uuid)
+       UUID=$($LCTL get_param -n obdfilter.lustre-OST0000.uuid)
        echo OST uuid $UUID
-       [ "$UUID" == "ost1_UUID" ] || error "UUID is wrong: $UUID"
+       [ "$UUID" == "lustre-OST0000_UUID" ] || error "UUID is wrong: $UUID"
 
        local NID=$($LCTL list_nids | head -1)
 
        echo "OSC changes should return err:"
-       $LCTL conf_param lustre-OST0000.osc.max_dirty_mb=15 && return 7
-       $LCTL conf_param lustre-OST0000.failover.node=$NID && return 8
+       $LCTL conf_param lustre-OST0000.osc.max_dirty_mb=15 || return 7
+       $LCTL conf_param lustre-OST0000.failover.node=$NID || return 8
+
        echo "ok."
        echo "MDC changes should succeed:"
        $LCTL conf_param lustre-MDT0000.mdc.max_rpcs_in_flight=9 || return 9
        $LCTL conf_param lustre-MDT0000.failover.node=$NID || return 10
        echo "ok."
 
-       # With a new good MDT failover nid, we should be able to mount a client
-       # (but it cant talk to OST)
-       local mountopt="-o exclude=lustre-OST0000"
-
-       local device=`h2$NETTYPE $HOSTNAME`:/lustre
-       echo "Starting local client: $HOSTNAME: $mountopt $device $MOUNT"
-       mount -t lustre $mountopt $device $MOUNT || return 1
-
-       local old=$(lctl get_param -n mdc.*.max_rpcs_in_flight)
-       local new=$((old + 5))
-       lctl conf_param lustre-MDT0000.mdc.max_rpcs_in_flight=$new
-       wait_update $HOSTNAME "lctl get_param -n mdc.*.max_rpcs_in_flight" $new || return 11
-
        cleanup_32
 
        # mount a second time to make sure we didnt leave upgrade flag on
        load_modules
        $TUNEFS --dryrun $tmpdir/mds || error "tunefs failed"
-       start32 mds $tmpdir/mds "-o loop,exclude=lustre-OST0000" && \
+       start32 mds1 $tmpdir/mds "-o loop,exclude=lustre-OST0000" && \
                trap cleanup_32 EXIT INT || return 12
 
        cleanup_32
@@ -1051,13 +1037,13 @@ test_32b() {
 
        local DISK1_8=$LUSTRE/tests/disk1_8.tar.bz2
        [ ! -r $DISK1_8 ] && skip "Cannot find $DISK1_8" && return 0
-       local tmpdir=$TMP/$tdir
+       local tmpdir=$TMP/conf32b
        mkdir -p $tmpdir
        tar xjvf $DISK1_8 -C $tmpdir || \
                { skip "Cannot untar $DISK1_8" && return ; }
 
        load_modules
-       lctl set_param debug=$PTLDEBUG
+       $LCTL set_param debug=$PTLDEBUG
        local NEWNAME=lustre
 
        # writeconf will cause servers to register with their current nids
@@ -1065,19 +1051,23 @@ test_32b() {
        start32 mds1 $tmpdir/mds "-o loop" && \
                trap cleanup_32 EXIT INT || return 3
 
-       local UUID=$(lctl get_param -n mdt.${NEWNAME}-MDT0000.uuid)
+       local UUID=$($LCTL get_param -n mdt.${NEWNAME}-MDT0000.uuid)
        echo MDS uuid $UUID
        [ "$UUID" == "${NEWNAME}-MDT0000_UUID" ] || error "UUID is wrong: $UUID"
 
-       $TUNEFS --mgsnode=`hostname` --writeconf --fsname=$NEWNAME $tmpdir/ost1 || error "tunefs failed"
+       $TUNEFS --mgsnode=$HOSTNAME --writeconf --fsname=$NEWNAME $tmpdir/ost1 || error "tunefs failed"
        start32 ost1 $tmpdir/ost1 "-o loop" || return 5
-       UUID=$(lctl get_param -n obdfilter.${NEWNAME}-OST0000.uuid)
+       UUID=$($LCTL get_param -n obdfilter.${NEWNAME}-OST0000.uuid)
        echo OST uuid $UUID
        [ "$UUID" == "${NEWNAME}-OST0000_UUID" ] || error "UUID is wrong: $UUID"
 
+       local NID=$($LCTL list_nids | head -1)
+
        echo "OSC changes should succeed:"
+
        $LCTL conf_param ${NEWNAME}-OST0000.osc.max_dirty_mb=15 || return 7
        $LCTL conf_param ${NEWNAME}-OST0000.failover.node=$NID || return 8
+
        echo "ok."
        echo "MDC changes should succeed:"
        $LCTL conf_param ${NEWNAME}-MDT0000.mdc.max_rpcs_in_flight=9 || return 9
@@ -1091,10 +1081,10 @@ test_32b() {
        echo "Starting local client: $HOSTNAME: $device $MOUNT"
        mount -t lustre $device $MOUNT || return 1
 
-       local old=$(lctl get_param -n mdc.*.max_rpcs_in_flight)
+       local old=$($LCTL get_param -n mdc.*.max_rpcs_in_flight)
        local new=$((old + 5))
-       lctl conf_param ${NEWNAME}-MDT0000.mdc.max_rpcs_in_flight=$new
-       wait_update $HOSTNAME "lctl get_param -n mdc.*.max_rpcs_in_flight" $new || return 11
+       $LCTL conf_param ${NEWNAME}-MDT0000.mdc.max_rpcs_in_flight=$new
+       wait_update $HOSTNAME "$LCTL get_param -n mdc.*.max_rpcs_in_flight" $new || return 11
 
        [ "$(cksum $MOUNT/passwd | cut -d' ' -f 1,2)" == "94306271 1478" ] || return 12
        echo "ok."
@@ -1561,6 +1551,23 @@ run_test 43 "check root_squash and nosquash_nids"
 umount_client $MOUNT
 cleanup_nocli
 
+test_44() { # 16317
+        setup
+        check_mount || return 2
+        UUID=$($LCTL get_param llite.${FSNAME}*.uuid | cut -d= -f2)
+        STATS_FOUND=no
+        UUIDS=$(do_facet mds "$LCTL get_param mdt.${FSNAME}*.exports.*.uuid")
+        for VAL in $UUIDS; do
+                NID=$(echo $VAL | cut -d= -f1)
+                CLUUID=$(echo $VAL | cut -d= -f2)
+                [ "$UUID" = "$CLUUID" ] && STATS_FOUND=yes && break
+        done
+        [ "$STATS_FOUND" = "no" ] && error "stats not found for client"
+        cleanup
+        return 0
+}
+run_test 44 "mounted client proc entry exists"
+
 test_45() { #17310
         setup
         check_mount || return 2
@@ -1581,8 +1588,27 @@ test_45() { #17310
 }
 run_test 45 "long unlink handling in ptlrpcd"
 
+cleanup_46a() {
+       trap 0
+       local rc=0
+       local count=5
+
+       umount_client $MOUNT2 || rc=$?
+       umount_client $MOUNT || rc=$?
+       while [ $count -gt 0 ]; do
+               stop ost${count} -f || rc=$?
+               let count=count-1
+       done    
+       stop_mds || rc=$? 
+       # writeconf is needed after the test, otherwise,
+       # we might end up with extra OSTs
+       writeconf || rc=$?
+       cleanup_nocli || rc=$?
+       return $rc
+}
+
 test_46a() {
-       OSTCOUNT=6
+       [ $OSTCOUNT -lt 5 ] && skip "skipping test for too few OSTs" && return
        reformat
        start_mds || return 1
        #first client should see only one ost
@@ -1590,6 +1616,7 @@ test_46a() {
         wait_osc_import_state mds ost FULL
        #start_client
        mount_client $MOUNT || return 3
+       trap cleanup_46a EXIT ERR
 
        start_ost2 || return 4
        start ost3 `ostdevname 3` $OST_MOUNT_OPTS || return 5
@@ -1617,14 +1644,8 @@ test_46a() {
        # will be deadlock
        stat $MOUNT/widestripe || return 12
 
-       umount_client $MOUNT2 || return 13
-       umount_client $MOUNT || return 14
-       stop ost5 -f || return 20
-       stop ost4 -f || return 21
-       stop ost3 -f || return 22
-       stop_ost2 || return 23
-       stop_ost || return 24
-       stop_mds || return 25
+       cleanup_46a || { echo "cleanup_46a failed!" && return 13; }
+       return 0
 }
 run_test 46a "handle ost additional - wide striped file"
 
@@ -1918,8 +1939,9 @@ test_50f() {
            sleep $(( $TIMEOUT+1 ))
            kill -0 $pid
            [ $? -ne 0 ] && error "process isn't sleep"
-           start_ost2 || error "Unable to start OST1"
+           start_ost2 || error "Unable to start OST2"
            wait $pid || error "statfs failed"
+           stop_ost2 || error "Unable to stop OST2"
        fi
 
        umount_client $MOUNT || error "Unable to unmount client"