Whamcloud - gitweb
land lustre part of b_hd_sec on HEAD.
[fs/lustre-release.git] / lustre / tests / conf-sanity.sh
index 586e870..acab312 100644 (file)
@@ -45,10 +45,12 @@ gen_second_config() {
 start_mds() {
        echo "start mds1 service on `facet_active_host mds1`"
        start mds1 --reformat $MDSLCONFARGS  || return 94
+       start_lsvcgssd || return 501
 }
 stop_mds() {
        echo "stop mds1 service on `facet_active_host mds1`"
        stop mds1 $@  || return 97
+       stop_lsvcgssd
 }
 
 start_ost() {
@@ -63,6 +65,7 @@ stop_ost() {
 
 mount_client() {
        local MOUNTPATH=$1
+       start_lgssd || return 502
        echo "mount lustre on ${MOUNTPATH}....."
        zconf_mount `hostname`  $MOUNTPATH  || return 96
 }
@@ -71,11 +74,13 @@ umount_client() {
        local MOUNTPATH=$1
        echo "umount lustre on ${MOUNTPATH}....."
        zconf_umount `hostname`  $MOUNTPATH || return 97
+       stop_lgssd
 }
 
 manual_umount_client(){
        echo "manual umount lustre on ${MOUNTPATH}...."
        do_facet  client "umount $MOUNT"
+       stop_lgssd
 }
 
 setup() {
@@ -115,6 +120,7 @@ build_test_filter
 #create single point mountpoint
 
 gen_config
+start_krb5_kdc || exit 1
 
 
 test_0() {
@@ -189,6 +195,7 @@ test_5() {
        kill -TERM $UMOUNT_PID
        echo "waiting for umount to finish"
        wait $UMOUNT_PID
+       stop_lgssd
 
        # cleanup client modules
        $LCONF --cleanup --nosetup --node client_facet $XMLCONFIG > /dev/null
@@ -209,10 +216,12 @@ test_5b() {
 
        [ -d $MOUNT ] || mkdir -p $MOUNT
        $LCONF --nosetup --node client_facet $XMLCONFIG > /dev/null
+       start_lgssd || return 1
        llmount $mds_HOST://mds1_svc/client_facet $MOUNT  && exit 1
 
        # cleanup client modules
        $LCONF --cleanup --nosetup --node client_facet $XMLCONFIG > /dev/null
+       stop_lgssd
        
        # stop_mds is a no-op here, and should not fail
        stop_mds || return 2
@@ -230,15 +239,17 @@ test_5c() {
 
        [ -d $MOUNT ] || mkdir -p $MOUNT
        $LCONF --nosetup --node client_facet $XMLCONFIG > /dev/null
-        llmount $mds_HOST://wrong_mds1_svc/client_facet $MOUNT  && return 1
+       start_lgssd || return 1
+        llmount $mds_HOST://wrong_mds1_svc/client_facet $MOUNT  && return 2
 
        # cleanup client modules
        $LCONF --cleanup --nosetup --node client_facet $XMLCONFIG > /dev/null
+       stop_lgssd
        
-       stop_mds || return 2
-       stop_ost || return 3
+       stop_mds || return 3
+       stop_ost || return 4
 
-       lsmod | grep -q portals && return 4
+       lsmod | grep -q portals && return 5
        return 0
 
 }
@@ -251,11 +262,13 @@ test_5d() {
 
        [ -d $MOUNT ] || mkdir -p $MOUNT
        $LCONF --nosetup --node client_facet $XMLCONFIG > /dev/null
+       start_lgssd || return 1
        llmount $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_lgssd
 
        stop_mds || return 3
 
@@ -613,6 +626,12 @@ test_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"
                                                                                                                              
@@ -645,24 +664,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="<empty>"
+       test "x$EXPECTEDLOGSMODE" = "x" && EXPECTEDLOGSMODE="<empty>"
+       test "x$EXPECTEDPENDINGMODE" = "x" && EXPECTEDPENDINGMODE="<empty>"
+
+       # 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
 }