From e5d65ceaf24842e0ba765ae3c5310fe40ec9f71f Mon Sep 17 00:00:00 2001 From: wangchao <wangchao> Date: Tue, 3 Feb 2004 03:18:20 +0000 Subject: [PATCH] b=2603 r=shaver work with --mkfsoptions of ost in lmc and lconf --- lustre/tests/conf-sanity.sh | 32 ++++++++++++++++++++++++++++++++ lustre/tests/test-framework.sh | 2 +- lustre/utils/lconf | 2 +- lustre/utils/lmc | 8 ++++++-- 4 files changed, 40 insertions(+), 4 deletions(-) diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh index ea574417c2..2411b3584f 100644 --- a/lustre/tests/conf-sanity.sh +++ b/lustre/tests/conf-sanity.sh @@ -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" diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index f4678ebfb2..53ded7650a 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -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` diff --git a/lustre/utils/lconf b/lustre/utils/lconf index 3b26047638..37c6423129 100755 --- a/lustre/utils/lconf +++ b/lustre/utils/lconf @@ -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') diff --git a/lustre/utils/lmc b/lustre/utils/lmc index f8dabf4854..56bd00117c 100755 --- a/lustre/utils/lmc +++ b/lustre/utils/lmc @@ -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") -- GitLab