Whamcloud - gitweb
b=2603
authorwangchao <wangchao>
Tue, 3 Feb 2004 03:18:20 +0000 (03:18 +0000)
committerwangchao <wangchao>
Tue, 3 Feb 2004 03:18:20 +0000 (03:18 +0000)
r=shaver

work with --mkfsoptions of ost in lmc and lconf

lustre/tests/conf-sanity.sh
lustre/tests/test-framework.sh
lustre/utils/lconf
lustre/utils/lmc

index ea57441..2411b35 100644 (file)
@@ -435,4 +435,36 @@ test_13() {
 }
 run_test 13 "check new_uuid of lmc operating correctly"
 
+test_14() {
+        rm -f $XMLCONFIG
+
+        # create xml file with --mkfsoptions for ost
+        echo "create xml file with --mkfsoptions for ost"
+        add_mds mds --dev $MDSDEV --size $MDSSIZE
+        add_lov lov1 mds --stripe_sz $STRIPE_BYTES\
+            --stripe_cnt $STRIPES_PER_OBJ --stripe_pattern 0
+        add_ost ost --lov lov1 --dev $OSTDEV --size $OSTSIZE \
+            --mkfsoptions -V
+        add_client client mds --lov lov1 --path $MOUNT
+
+        FOUNDSTRING=`awk -F"<" '/<mkfsoptions>/{print $2}' $XMLCONFIG`
+        EXPECTEDSTRING="mkfsoptions>-V"
+        if [ $EXPECTEDSTRING != $FOUNDSTRING ]; then
+                echo "Error:expected string: $EXPECTEDSTRING; found: $FOUNDSTRING"
+                return 1
+        fi
+        echo "Success:mkfsoptions for ost written to xml file correctly."
+
+        # mount lustre to test lconf mkfsoptions-parsing
+        echo "mount lustre"
+        start_ost
+        start_mds
+        mount_client $MOUNT || return $?
+        cleanup
+        echo "lconf mkfsoptions-parsing for ost success"
+
+        gen_config
+}
+run_test 14 "test mkfsoptions of ost for lmc and lconf"
+
 equals_msg "Done"
index f4678eb..53ded76 100644 (file)
@@ -88,7 +88,7 @@ zconf_mount() {
        # this is so cheating
        $LCONF --nosetup --node client_facet $XMLCONFIG
        $LUSTRE/utils/llmount `facet_host mds`:/mds_svc/client_facet $mnt \
-            -o nettype=$NETTYPE 
+            -o nettype=$NETTYPE || return $?
     fi
 
     [ -d /r ] && $LCTL modules > /r/tmp/ogdb-`hostname`
index 3b26047..37c6423 100755 (executable)
@@ -1550,7 +1550,7 @@ class OSD(Module):
         self.size = self.db.get_val_int('devsize', 0)
         self.journal_size = self.db.get_val_int('journalsize', 0)
         self.inode_size = self.db.get_val_int('inodesize', 0)
-        self.mkfsoptions = self.db.get_val_int('mkfsoptions', '')
+        self.mkfsoptions = self.db.get_val('mkfsoptions', '')
         self.fstype = self.db.get_val('fstype', '')
         self.nspath = self.db.get_val('nspath', '')
         target_uuid = self.db.get_first_ref('target')
index f8dabf4..56bd001 100755 (executable)
@@ -359,7 +359,7 @@ class GenConfig:
         return ldlm
 
     def osd(self, name, uuid, fs, osdtype, devname, format, ost_uuid,
-            node_uuid, dev_size=0, journal_size=0, inode_size=0, nspath=""):
+            node_uuid, dev_size=0, journal_size=0, inode_size=0, nspath="", mkfsoptions=""):
         osd = self.newService("osd", name, uuid)
         osd.setAttribute('osdtype', osdtype)
         osd.appendChild(self.ref("target", ost_uuid))
@@ -375,6 +375,8 @@ class GenConfig:
                 self.addElement(osd, "journalsize", "%s" % (journal_size))
             if inode_size:
                 self.addElement(osd, "inodesize", "%s" % (inode_size))
+            if mkfsoptions:
+                self.addElement(osd, "mkfsoptions", mkfsoptions)
         if nspath:
             self.addElement(osd, "nspath", nspath)
         return osd
@@ -748,12 +750,14 @@ def add_ost(gen, lustre, options):
         fstype = ''
         journal_size = ''
         inode_size = ''
+        mkfsoptions = ''
     else:
         devname = get_option(options, 'dev') # can be unset for bluearcs
         size = get_option(options, 'size')
         fstype = get_option(options, 'fstype')
         journal_size = get_option(options, 'journal_size')
         inode_size = get_option(options, 'inode_size')
+        mkfsoptions = get_option(options, 'mkfsoptions')
         
     nspath = get_option(options, 'nspath')
 
@@ -789,7 +793,7 @@ def add_ost(gen, lustre, options):
 
     osd = gen.osd(osdname, osd_uuid, fstype, osdtype, devname,
                   get_format_flag(options), ost_uuid, node_uuid, size,
-                  journal_size, inode_size, nspath)
+                  journal_size, inode_size, nspath, mkfsoptions)
 
     node = findByName(lustre, node_name, "node")