X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Fconf-sanity.sh;h=ffd5b3033999062d3510fa6993fa75341989de0a;hb=2f8c65486df47bfe38068345603172d90c0861e6;hp=4212cab2f9afb9e2e17fe6582a7f2f8a9ea56db5;hpb=d30e2149ebec30dfae31f2acb4fed022d4359dc1;p=fs%2Flustre-release.git diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh index 4212cab..ffd5b30 100644 --- a/lustre/tests/conf-sanity.sh +++ b/lustre/tests/conf-sanity.sh @@ -25,11 +25,11 @@ init_test_env $@ gen_config() { rm -f $XMLCONFIG - add_mds mds --dev $MDSDEV --size $MDSSIZE - add_lov lov1 mds --stripe_sz $STRIPE_BYTES\ + add_mds mds1 --dev $MDSDEV --size $MDSSIZE + add_lov lov1 mds1 --stripe_sz $STRIPE_BYTES\ --stripe_cnt $STRIPES_PER_OBJ --stripe_pattern 0 add_ost ost --lov lov1 --dev $OSTDEV --size $OSTSIZE - add_client client mds --lov lov1 --path $MOUNT + add_client client mds1 --lov lov1 --path $MOUNT } gen_second_config() { @@ -39,16 +39,17 @@ gen_second_config() { add_lov lov2 mds2 --stripe_sz $STRIPE_BYTES\ --stripe_cnt $STRIPES_PER_OBJ --stripe_pattern 0 add_ost ost2 --lov lov2 --dev $OSTDEV --size $OSTSIZE - add_client client mds2 --lov lov2 --path $MOUNT2 + add_client client --mds mds2 --lov lov2 --path $MOUNT2 } start_mds() { - echo "start mds service on `facet_active_host mds`" - start mds --reformat $MDSLCONFARGS || return 94 + echo "start mds1 service on `facet_active_host mds1`" + start mds1 --reformat $MDSLCONFARGS || return 94 } + stop_mds() { - echo "stop mds service on `facet_active_host mds`" - stop mds $@ || return 97 + echo "stop mds1 service on `facet_active_host mds1`" + stop mds1 $@ || return 97 } start_ost() { @@ -58,7 +59,7 @@ start_ost() { stop_ost() { echo "stop ost service on `facet_active_host ost`" - stop ost $@ || return 98 + stop ost $@ || return 98 } mount_client() { @@ -86,7 +87,7 @@ setup() { cleanup() { umount_client $MOUNT || return 200 - stop_mds || return 201 + stop_mds || return 201 stop_ost || return 202 # catch case where these return just fine, but modules are still not unloaded /sbin/lsmod | grep -q portals @@ -115,7 +116,9 @@ build_test_filter #create single point mountpoint gen_config - +start_krb5_kdc || exit 1 +start_lsvcgssd || return 2 +start_lgssd || return 3 test_0() { start_ost @@ -141,7 +144,7 @@ test_2() { start_ost start_mds echo "start mds second time.." - start mds --reformat $MDSLCONFARGS + start mds1 --reformat $MDSLCONFARGS mount_client $MOUNT check_mount || return 43 @@ -182,7 +185,17 @@ test_5() { # cleanup may return an error from the failed # disconnects; for now I'll consider this successful # if all the modules have unloaded. - umount $MOUNT & + + # as MDS is down, umount without -f may cause blocking + # and this test will never finish. Blocking is possible + # as umount may want to cancel locks with RPC's and these + # RPC's will wait forever, as pinger thread will try to + # recover failed import endlessly. + # + # Thus, main point is: nobody should expect umount finish + # quickly and cleanly without -f flag when MDS or OST is + # down for sure. --umka + umount -f $MOUNT & UMOUNT_PID=$! sleep 2 echo "killing umount" @@ -191,16 +204,21 @@ test_5() { wait $UMOUNT_PID # cleanup client modules - $LCONF --cleanup --nosetup --node client_facet $XMLCONFIG > /dev/null + $LCONF --force --cleanup --nosetup --node client_facet $XMLCONFIG > /dev/null # stop_mds is a no-op here, and should not fail - stop_mds || return 4 - stop_ost || return 5 + stop_mds || return 4 + + # this should have --force flag specified, as umount -f + # will skip disconnect phase and thus OST will have one + # extra refcount what will cause class_cleanup() failure + # if --force is not specified. --umka + stop_ost --force || return 5 lsmod | grep -q portals && return 6 return 0 } -run_test 5 "force cleanup mds, then cleanup" +run_test 5 "force cleanup mds, then cleanup --force" test_5b() { start_ost @@ -209,16 +227,16 @@ test_5b() { [ -d $MOUNT ] || mkdir -p $MOUNT $LCONF --nosetup --node client_facet $XMLCONFIG > /dev/null - llmount $mds_HOST://mds_svc/client_facet $MOUNT && exit 1 + llmount -o nettype=$NETTYPE $mds_HOST://mds_svc/client_facet $MOUNT && exit 2 # cleanup client modules $LCONF --cleanup --nosetup --node client_facet $XMLCONFIG > /dev/null # stop_mds is a no-op here, and should not fail - stop_mds || return 2 - stop_ost || return 3 + stop_mds || return 3 + stop_ost || return 4 - lsmod | grep -q portals && return 3 + lsmod | grep -q portals && return 5 return 0 } @@ -230,20 +248,41 @@ test_5c() { [ -d $MOUNT ] || mkdir -p $MOUNT $LCONF --nosetup --node client_facet $XMLCONFIG > /dev/null - llmount $mds_HOST://wrong_mds_svc/client_facet $MOUNT && exit 1 + llmount -o nettype=$NETTYPE $mds_HOST://wrong_mds_svc/client_facet $MOUNT && return 2 # cleanup client modules $LCONF --cleanup --nosetup --node client_facet $XMLCONFIG > /dev/null - stop_mds || return 2 - stop_ost || return 3 + stop_mds || return 3 + stop_ost || return 4 - lsmod | grep -q portals && return 3 + lsmod | grep -q portals && return 5 return 0 } run_test 5c "cleanup after failed mount (bug 2712)" +test_5d() { + start_ost + start_mds + stop_ost --force + + [ -d $MOUNT ] || mkdir -p $MOUNT + $LCONF --nosetup --node client_facet $XMLCONFIG > /dev/null + llmount -o nettype=$NETTYPE $mds_HOST://mds1_svc/client_facet $MOUNT || return 1 + + umount $MOUNT || return 2 + # cleanup client modules + $LCONF --cleanup --nosetup --node client_facet $XMLCONFIG > /dev/null + + stop_mds || return 3 + + lsmod | grep -q portals && return 4 + return 0 + +} +run_test 5d "ost down, don't crash during mount attempt" + test_6() { setup manual_umount_client @@ -314,18 +353,18 @@ test_9() { # check lconf --ptldebug/subsystem overriding lmc --ptldebug/subsystem start_ost start_mds - CHECK_PTLDEBUG="`do_facet mds cat /proc/sys/portals/debug`" + CHECK_PTLDEBUG="`do_facet mds1 sysctl portals.debug | cut -d= -f2`" if [ $CHECK_PTLDEBUG = "3" ]; then echo "lconf --debug success" else echo "lconf --debug: want 3, have $CHECK_PTLDEBUG" return 1 fi - CHECK_SUBSYSTEM="`do_facet mds cat /proc/sys/portals/subsystem_debug`" - if [ $CHECK_SUBSYSTEM = "20" ]; then + CHECK_SUBSYS="`do_facet mds1 sysctl portals.subsystem_debug|cut -d= -f2`" + if [ $CHECK_SUBSYS = "20" ]; then echo "lconf --subsystem success" else - echo "lconf --subsystem: want 20, have $CHECK_SUBSYSTEM" + echo "lconf --subsystem: want 20, have $CHECK_SUBSYS" return 1 fi mount_client $MOUNT @@ -345,7 +384,7 @@ test_10() { OLDXMLCONFIG=$XMLCONFIG XMLCONFIG="broken.xml" [ -f "$XMLCONFIG" ] && rm -f $XMLCONFIG - facet="mds" + facet="mds1" rm -f ${facet}active add_facet $facet echo "the name for node and mds is the same" @@ -357,7 +396,7 @@ test_10() { add_ost ost --lov lov1 --dev $OSTDEV --size $OSTSIZE facet="client" add_facet $facet --lustre_upcall $UPCALL - do_lmc --add mtpt --node ${facet}_facet --mds mds_facet \ + do_lmc --add mtpt --node ${facet}_facet --mds mds1_facet \ --lov lov1 --path $MOUNT echo "mount lustre" @@ -377,15 +416,15 @@ test_11() { XMLCONFIG="conf11.xml" [ -f "$XMLCONFIG" ] && rm -f $XMLCONFIG - add_mds mds --dev $MDSDEV --size $MDSSIZE + add_mds mds1 --dev $MDSDEV --size $MDSSIZE add_ost ost --dev $OSTDEV --size $OSTSIZE - add_client client mds --path $MOUNT --ost ost_svc || return $? + add_client client mds1 --path $MOUNT --ost ost_svc || return $? echo "Default lov config success!" [ -f "$XMLCONFIG" ] && rm -f $XMLCONFIG - add_mds mds --dev $MDSDEV --size $MDSSIZE + add_mds mds1 --dev $MDSDEV --size $MDSSIZE add_ost ost --dev $OSTDEV --size $OSTSIZE - add_client client mds --path $MOUNT && return $? + add_client client mds1 --path $MOUNT && return $? echo "--add mtpt with neither --lov nor --ost will return error" echo "" @@ -482,17 +521,18 @@ test_13() { fi EXPECTEDMDS1UUID="e_longer_than_31characters_UUID" EXPECTEDMDS2UUID="longer_than_31characters_UUID_2" - FOUNDMDS1UUID=`awk -F"'" '//{print $2}' $XMLCONFIG` EXPECTEDSTRING="mkfsoptions>-Llabel_conf_14" @@ -573,9 +613,9 @@ test_15() { [ ! `cp $LUSTRE/utils/llmount $MOUNTLUSTRE` ] || return $? do_node `hostname` mkdir -p $MOUNT 2> /dev/null # load llite module on the client if it isn't in /lib/modules - do_node `hostname` lconf --nosetup --node client_facet $XMLCONFIG + do_node `hostname` $LCONF --nosetup --node client_facet $XMLCONFIG do_node `hostname` mount -t lustre -o nettype=$NETTYPE \ - `facet_active_host mds`:/mds_svc/client_facet $MOUNT ||return $? + `facet_active_host mds1`:/mds1_svc/client_facet $MOUNT ||return $? echo "mount lustre on $MOUNT with $MOUNTLUSTRE: success" [ -d /r ] && $LCTL modules > /r/tmp/ogdb-`hostname` check_mount || return 41 @@ -584,13 +624,19 @@ test_15() { [ -f "$MOUNTLUSTRE" ] && rm -f $MOUNTLUSTRE echo "mount lustre on ${MOUNT} without $MOUNTLUSTRE....." do_node `hostname` mount -t lustre -o nettype=$NETTYPE \ - `facet_active_host mds`:/mds_svc/client_facet $MOUNT &&return $? + `facet_active_host mds1`:/mds1_svc/client_facet $MOUNT &&return $? echo "mount lustre on $MOUNT without $MOUNTLUSTRE failed as expected" cleanup || return $? cleanup_15 } run_test 15 "zconf-mount without /sbin/mount.lustre (should return error)" +is_digit() { + local value=$1 + echo $value | grep -q "^[[:digit:]]*$" + return $? +} + test_16() { TMPMTPT="/mnt/conf16" @@ -601,7 +647,7 @@ test_16() { mount_client $MOUNT check_mount || return 41 cleanup || return $? - fi + fi echo "change the mode of $MDSDEV/OBJECTS,LOGS,PENDING to 555" [ -d $TMPMTPT ] || mkdir -p $TMPMTPT @@ -623,24 +669,49 @@ test_16() { EXPECTEDLOGSMODE=`debugfs -R "stat LOGS" $MDSDEV 2> /dev/null | awk '/Mode: /{print $6}'` EXPECTEDPENDINGMODE=`debugfs -R "stat PENDING" $MDSDEV 2> /dev/null | awk '/Mode: /{print $6}'` - if [ $EXPECTEDOBJECTSMODE = "0777" ]; then - echo "Success:Lustre change the mode of OBJECTS correctly" + # check if values are empty + test "x$EXPECTEDOBJECTSMODE" = "x" && EXPECTEDOBJECTSMODE="" + test "x$EXPECTEDLOGSMODE" = "x" && EXPECTEDLOGSMODE="" + test "x$EXPECTEDPENDINGMODE" = "x" && EXPECTEDPENDINGMODE="" + + # check if values are valid digits + is_digit $EXPECTEDOBJECTSMODE || { + echo "Invalid OBJECTS mode obtained from debugfs: $EXPECTEDOBJECTSMODE" + return 42 + } + + is_digit $EXPECTEDLOGSMODE || { + echo "Invalid LOGS mode obtained from debugfs: $EXPECTEDLOGSMODE" + return 42 + } + + is_digit $EXPECTEDPENDINGMODE || { + echo "Invalid PINDING mode obtained from debugfs: $EXPECTEDPENDINGMODE" + return 42 + } + + # check if values are those we expected + if [ "x$EXPECTEDOBJECTSMODE" = "x0777" ]; then + echo "Success: Lustre change the mode of OBJECTS correctly" else echo "Error: Lustre does not change the mode of OBJECTS properly" + echo "Expected value: 0777, actual one: $EXPECTEDOBJECTSMODE" return 1 fi - if [ $EXPECTEDLOGSMODE = "0777" ]; then - echo "Success:Lustre change the mode of LOGS correctly" + if [ "x$EXPECTEDLOGSMODE" = "x0777" ]; then + echo "Success: Lustre change the mode of LOGS correctly" else echo "Error: Lustre does not change the mode of LOGS properly" + echo "Expected value: 0777, actual one: $EXPECTEDLOGSMODE" return 1 fi - if [ $EXPECTEDPENDINGMODE = "0777" ]; then - echo "Success:Lustre change the mode of PENDING correctly" + if [ "x$EXPECTEDPENDINGMODE" = "x0777" ]; then + echo "Success: Lustre change the mode of PENDING correctly" else echo "Error: Lustre does not change the mode of PENDING properly" + echo "Expected value: 0777, actual one: $EXPECTEDPENDINGMODE" return 1 fi } @@ -661,11 +732,11 @@ test_17() { echo "Remove mds config log" [ -d $TMPMTPT ] || mkdir -p $TMPMTPT mount -o loop -t ext3 $MDSDEV $TMPMTPT || return $? - rm -f $TMPMTPT/LOGS/mds_svc || return $? + rm -f $TMPMTPT/LOGS/mds1_svc || return $? umount $TMPMTPT || return $? start_ost - start mds $MDSLCONFARGS && return 42 + start mds1 $MDSLCONFARGS && return 42 cleanup || return $? } run_test 17 "Verify failed mds_postsetup won't fail assertion (2936)" @@ -700,4 +771,7 @@ test_18() { } run_test 18 "check lconf creates large journals" +stop_lgssd +stop_lsvcgssd + equals_msg "Done"