Send Linux-ha-cvs mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
or, via email, send a message with subject or body 'help' to
        [EMAIL PROTECTED]

You can reach the person managing the list at
        [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Linux-ha-cvs digest..."


Today's Topics:

   1. Linux-HA CVS: cts by panjiam from 
      ([email protected])


----------------------------------------------------------------------

Message: 1
Date: Mon, 27 Feb 2006 02:19:43 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: cts by panjiam from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : panjiam
Host    : 
Project : linux-ha
Module  : cts

Dir     : linux-ha/cts


Modified Files:
        CM_LinuxHAv2.py.in CTSlab.py.in Makefile.am 
Added Files:
        CIB.py.in 


Log Message:
moved the CIB data from CM_LinuxHAv2.py.in into CIB.py.in
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/cts/CM_LinuxHAv2.py.in,v
retrieving revision 1.136
retrieving revision 1.137
diff -u -3 -r1.136 -r1.137
--- CM_LinuxHAv2.py.in  21 Feb 2006 14:38:08 -0000      1.136
+++ CM_LinuxHAv2.py.in  27 Feb 2006 09:19:42 -0000      1.137
@@ -33,6 +33,8 @@
 from xml.dom.minidom import *
 from CTSaudits import ClusterAudit
 from CTStests import *
+from CIB import *
+
 #######################################################################
 #
 #  LinuxHA v2 dependent modules
@@ -118,185 +120,7 @@
         self.check_transitions = 0
         self.check_elections = 0
         self.CIBsync = {}
-        cib_prefix='''
-<cib cib_feature_revision="1" have_quorum="false">
-   <configuration>
-     <crm_config>'''
-        cib_options="""
-        <nvpair id="c-pref-1" name="transition_idle_timeout" value="3m"/>
-        <nvpair id="c-pref-2" name="symmetric_cluster" value="true"/>
-        <nvpair id="c-pref-3" name="short_resource_names" value="%d"/>
-        <nvpair id="c-pref-4" name="stop_orphan_resources" value="false"/>
-        <nvpair id="c-pref-5" name="stop_orphan_actions" value="false"/>
-        <nvpair id="c-pref-6" name="remove_after_stop" value="false"/>
-        <nvpair id="c-pref-7" name="is_managed_default" value="true"/>
-        <nvpair id="c-pref-8" name="no_quorum_policy" value="stop"/>
-        <nvpair id="c-pref-9" name="default_resource_stickiness" 
value="0"/>""" % self.use_short_names
-        cib_glue_1='''
-     </crm_config>
-     <nodes/>
-     <resources>'''
-        cib_glue_2='''
-     </resources>
-     <constraints>'''
-        cib_suffix='''
-     </constraints>
-   </configuration>
-   <status/>
-</cib>
-'''
-        resources=''' '''
-        constraints=''' '''
-        cib_fencing = ""
-        if self.Env["CIBResource"] == 1:
-            self.log("Enabling DC resource")
-            resources='''
-       <primitive id="DcIPaddr" class="ocf" type="IPaddr" provider="heartbeat" 
is_managed="1">
-         <operations>
-           <op id="DcIPaddr-1" name="monitor" interval="5s" timeout="20s"/>
-           <op id="DcIPaddr-2" name="start" timeout="40s"/>
-         </operations>
-         <instance_attributes>
-           <attributes>
-             <nvpair id="DcIPaddr-1" name="ip" value="%s"/>
-           </attributes>
-         </instance_attributes>
-       </primitive>''' % self.Env["IPBase"]
-            if self.cluster_monitor == 1:
-                resources=resources+'''
-       <primitive id="cluster_mon" class="ocf" type="ClusterMon" 
provider="heartbeat" is_managed="1">
-         <operations>
-           <op id="cluster_mon-1" name="monitor" interval="5s" timeout="20s" 
prereq="nothing"/>
-           <op id="cluster_mon-2" name="start" timeout="20s" prereq="nothing"/>
-         </operations>
-         <instance_attributes>
-           <attributes>
-             <nvpair id="cluster_mon-1" name="htmlfile" 
value="/suse/abeekhof/Export/cluster.html"/>
-             <nvpair id="cluster_mon-2" name="update" value="10"/>
-             <nvpair id="cluster_mon-3" name="extra_options" value="-n -r"/>
-             <nvpair id="cluster_mon-4" name="user" value="abeekhof"/>
-           </attributes>
-         </instance_attributes>
-       </primitive>'''
-            # DcIPaddr cant run anywhere but the DC
-            constraints='''
-      <rsc_location id="run_DcIPaddr" rsc="DcIPaddr">
-        <rule id="cant_run_DcIPaddr" score="-INFINITY" boolean_op="and">
-          <expression id="dc_ip_expr" attribute="#is_dc" operation="eq" 
value="false"/>
-        </rule>
-      </rsc_location>'''
-
-           fields = string.split(self.Env["IPBase"], '.')
-           fields[3] = str(int(fields[3])+1)
-           ip1 = string.join(fields, '.')
-           fields[3] = str(int(fields[3])+1)
-           ip2 = string.join(fields, '.')
-           fields[3] = str(int(fields[3])+1)
-           ip3 = string.join(fields, '.')
-           self.Env["IPBase"] = ip3
-           group_resource=("""
-       <group id="group-1">
-         <primitive id="%s" class="ocf" type="IPaddr" provider="heartbeat">
-           <operations>
-             <op id="%s-1" name="monitor" interval="5s" timeout="20s"/>
-           </operations>
-           <instance_attributes>
-             <attributes>
-               <nvpair id="%s-1" name="ip" value="%s"/>
-             </attributes>
-           </instance_attributes>
-         </primitive>
-         <primitive id="%s" class="ocf" type="IPaddr" provider="heartbeat">
-           <operations>
-             <op id="%s-1" name="monitor" interval="5s" timeout="20s"/>
-           </operations>
-           <instance_attributes>
-             <attributes>
-               <nvpair id="%s-1" name="ip" value="%s"/>
-             </attributes>
-           </instance_attributes>
-         </primitive>
-         <primitive id="%s" class="ocf" type="IPaddr" provider="heartbeat">
-           <operations>
-             <op id="%s-1" name="monitor" interval="5s" timeout="20s"/>
-           </operations>
-           <instance_attributes>
-             <attributes>
-               <nvpair id="%s-1" name="ip" value="%s"/>
-             </attributes>
-           </instance_attributes>
-         </primitive>
-       </group>""" %  ("child_"+ip1, "child_"+ip1, "child_"+ip1, ip1,
-                       "child_"+ip2, "child_"+ip2, "child_"+ip2, ip2,
-                       "child_"+ip3, "child_"+ip3, "child_"+ip3, ip3))
-           resources = resources + group_resource
-
-            if self.cluster_monitor == 1:
-                constraints=constraints+'''
-      <rsc_location id="run_cluster_mon" rsc="cluster_mon">
-        <rule id="cant_run_cluster_mon" score="-INFINITY" boolean_op="and">
-          <expression id="mon_expr" attribute="#is_dc" operation="eq" 
value="false"/>
-        </rule>
-      </rsc_location>'''
-            fields = string.split(self.Env["IPBase"], '.')
-            for node in self.Env["nodes"]:
-                # These resources prefer to run on the node with the same name
-                fields[3] = str(int(fields[3])+1)
-                ip = string.join(fields, '.')
-                self.Env["IPBase"] = ip
-                node_resource=("""
-       <primitive id="%s" class="ocf" type="IPaddr" provider="heartbeat" 
is_managed="1">
-         <operations>
-           <op id="%s-1" name="monitor" interval="5s" timeout="20s"/>
-           <op id="%s-2" name="start" timeout="40s"/>
-         </operations>
-         <instance_attributes>
-           <attributes>
-             <nvpair id="%s-1" name="ip" value="%s"/>
-           </attributes>
-         </instance_attributes>
-       </primitive>""" %("rsc_"+node, "rsc_"+node, "rsc_"+node, "rsc_"+node, 
ip))
-                resources = resources + node_resource
-                node_constraint=("""
-      <rsc_location id="run_%s" rsc="%s">
-        <rule id="pref_run_%s" score="100" boolean_op="and">
-          <expression id="%s_loc_expr" attribute="#uname" operation="eq" 
value="%s"/>
-        </rule>
-      </rsc_location>""" % ("rsc_"+node, "rsc_"+node, "rsc_"+node, 
"rsc_"+node, node))
-                constraints = constraints + node_constraint
-            
-            # always add the fencing resource so that we test incarnations
-            nodelist = ""
-            for node in self.Env["nodes"]:
-                nodelist += node + " "
-            stonith_resource=("""
-       <clone id="DoFencing">
-         <instance_attributes>
-           <attributes>
-             <nvpair id="DoFencing-1" name="clone_max" value="%d"/>
-             <nvpair id="DoFencing-2" name="clone_node_max" value="1"/>
-           </attributes>
-         </instance_attributes>
-         <primitive id="child_DoFencing" class="stonith" type="ssh">
-           <operations>
-             <op id="DoFencing-1" name="monitor" interval="20s" timeout="40s" 
prereq="nothing"/>
-             <op id="DoFencing-2" name="start" timeout="20s" prereq="nothing"/>
-           </operations>
-           <instance_attributes>
-             <attributes>
-               <nvpair id="child_DoFencing-1" name="hostlist" value="%s"/>
-             </attributes>
-           </instance_attributes>
-         </primitive>
-       </clone>""" %(len(self.Env["nodes"]), nodelist))
-            resources = resources + stonith_resource
-
-            if self.Env["DoFencing"] == 1:
-                cib_options=cib_options + '''
-        <nvpair id="stonith_enabled" name="stonith_enabled" value="true"/>'''
-
-        self.default_cts_cib=cib_prefix + cib_options + cib_glue_1 + \
-               resources + cib_glue_2 + constraints + cib_suffix
+        self.default_cts_cib=CIB(self).cib()
         self.debug(self.default_cts_cib)
     
     def errorstoignore(self):
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/cts/CTSlab.py.in,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -3 -r1.49 -r1.50
--- CTSlab.py.in        25 Feb 2006 06:53:59 -0000      1.49
+++ CTSlab.py.in        27 Feb 2006 09:19:42 -0000      1.50
@@ -519,6 +519,8 @@
     SuppressCib = 1
     DoBSC = 0
     ListTests = 0
+    ResourceClass = "ocf"
+
     #
     # The values of the rest of the parameters are now properly derived from
     # the configuration files.
@@ -638,6 +640,9 @@
        elif args[i] == "--syslog-facility" or args[i] == "--facility":
            skipthis=1
            LogFacility = args[i+1]
+       elif args[i] == "--resource-class":
+           skipthis=1
+           ResourceClass = args[i+1]
        else:
            NumIter=int(args[i])
           
@@ -682,6 +687,8 @@
     Environment["DoBSC"] = DoBSC
     Environment["use_logd"] = 0
     Environment["logfacility"] = LogFacility
+    Environment["ResourceClass" ] = ResourceClass
+
     if config.Parameters.has_key("use_logd"):
        Environment["use_logd"] = 1
     
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/cts/Makefile.am,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- Makefile.am 21 Sep 2005 06:44:57 -0000      1.9
+++ Makefile.am 27 Feb 2006 09:19:42 -0000      1.10
@@ -31,6 +31,7 @@
                        CTSproxy.py             \
                        CTStests.py             \
                        extracttests.py         \
-                       OCFIPraTest.py
+                       OCFIPraTest.py          \
+                       CIB.py
 
 hard_DATA =            README




------------------------------

_______________________________________________
Linux-ha-cvs mailing list
[email protected]
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs


End of Linux-ha-cvs Digest, Vol 27, Issue 99
********************************************

Reply via email to