) from pcs.test.tools.pcs_runner import ( pcs, PcsRunner, ) from pcs.test.tools.pcs_unittest import TestCase empty_cib = rc("cib-empty.xml") temp_cib = rc("temp-cib.xml") # target-pattern attribute was added in pacemaker 1.1.13 with validate-with 2.3. # However in pcs this was implemented much later together with target-attribute # support. In that time pacemaker 1.1.12 was quite old. To keep tests simple we # do not run fencing topology tests on pacemaker older that 1.1.13 even if it # supports targeting by node names. skip_unless_fencing_level_supported = skip_unless_pacemaker_version( (1, 1, 13), "fencing levels") # target-attribute and target-value attributes were added in pacemaker 1.1.14 # with validate-with 2.4. fencing_level_attribute_supported = is_minimum_pacemaker_version(1, 1, 14) skip_unless_fencing_level_attribute_supported = skip_unless_pacemaker_version( (1, 1, 14), "fencing levels with attribute targets") class StonithDescribeTest(TestCase, AssertPcsMixin): def setUp(self): self.pcs_runner = PcsRunner(temp_cib) def test_success(self): self.assert_pcs_success("stonith describe fence_apc", stdout_start="""\ fence_apc - Fence agent for APC over telnet/ssh
from pcs.test.tools.misc import ( get_test_resource as rc, skip_unless_pacemaker_version, outdent, ) from pcs.test.tools.assertions import AssertPcsMixin from pcs.test.tools.pcs_runner import PcsRunner from pcs.test.tools import pcs_unittest as unittest old_cib = rc("cib-empty.xml") empty_cib = rc("cib-empty-2.5.xml") temp_cib = rc("temp-cib.xml") skip_unless_alerts_supported = skip_unless_pacemaker_version( (1, 1, 15), "alerts" ) class PcsAlertTest(unittest.TestCase, AssertPcsMixin): def setUp(self): shutil.copy(empty_cib, temp_cib) self.pcs_runner = PcsRunner(temp_cib) @skip_unless_alerts_supported class AlertCibUpgradeTest(unittest.TestCase, AssertPcsMixin): def setUp(self): shutil.copy(old_cib, temp_cib) self.pcs_runner = PcsRunner(temp_cib) def test_cib_upgrade(self):