示例#1
0
 def test_return_host_from_resource_id(self):
     self.assertEqual(
         "R",
         remote_node.get_host(etree.fromstring("""
             <primitive class="ocf" id="R" provider="pacemaker"
                 type="remote"
             />
         """))
     )
示例#2
0
 def test_return_host_when_there(self):
     self.assertEqual(
         "HOST",
         remote_node.get_host(etree.fromstring("""
             <primitive class="ocf" id="R" provider="pacemaker" type="remote"
             >
                 <instance_attributes>
                     <nvpair name="server" value="HOST"/>
                 </instance_attributes>
             </primitive>
         """))
     )
示例#3
0
 def test_return_none_when_host_not_found(self):
     self.assertIsNone(remote_node.get_host(etree.fromstring("""
         <primitive class="ocf" id="R" provider="heartbeat" type="dummy"/>
     """)))