def fixture_resources_status_output(nodes="rh-1 rh-2", inactive=True): if not inactive: if is_pacemaker_21_without_20_compatibility(): return outdent("""\ * x1 (ocf:pacemaker:Dummy): Started rh-1 """) return outdent("""\ * x1 (ocf::pacemaker:Dummy): Started rh-1 """) if is_pacemaker_21_without_20_compatibility(): return outdent(f"""\ * not-in-tags (ocf:pacemaker:Dummy): Stopped * x1 (ocf:pacemaker:Dummy): Started rh-1 * x2 (ocf:pacemaker:Dummy): Stopped * x3 (ocf:pacemaker:Dummy): Stopped * y1 (ocf:pacemaker:Dummy): Stopped * Clone Set: y2-clone [y2]: * Stopped: [ {nodes} ] """) return outdent(f"""\ * not-in-tags (ocf::pacemaker:Dummy): Stopped * x1 (ocf::pacemaker:Dummy): Started rh-1 * x2 (ocf::pacemaker:Dummy): Stopped * x3 (ocf::pacemaker:Dummy): Stopped * y1 (ocf::pacemaker:Dummy): Stopped * Clone Set: y2-clone [y2]: * Stopped: [ {nodes} ] """)
def test_resource_id_with_node_changed_arg_order(self): if is_pacemaker_21_without_20_compatibility(): stdout_full = " * x1 (ocf:pacemaker:Dummy): Started rh-1\n" else: stdout_full = " * x1 (ocf::pacemaker:Dummy): Started rh-1\n" self.assert_pcs_success( self.command + ["node=rh-1", "x1"], stdout_full=stdout_full, )
def test_resource_id_with_node_stopped(self): if is_pacemaker_21_without_20_compatibility(): stdout_full = " * x2 (ocf:pacemaker:Dummy): Stopped\n" else: stdout_full = " * x2 (ocf::pacemaker:Dummy): Stopped\n" self.assert_pcs_success( self.command + ["x2", "node=rh-1"], stdout_full=stdout_full, )
def test_tag_id_with_node(self): if is_pacemaker_21_without_20_compatibility(): stdout_full = outdent("""\ * fence-rh-2 (stonith:fence_xvm): Stopped * x3 (ocf:pacemaker:Dummy): Stopped * y1 (ocf:pacemaker:Dummy): Stopped """) else: stdout_full = outdent("""\ * fence-rh-2 (stonith:fence_xvm): Stopped * x3 (ocf::pacemaker:Dummy): Stopped * y1 (ocf::pacemaker:Dummy): Stopped """) self.assert_pcs_success( self.command + ["tag-mixed-stonith-devices-and-resources", "node=rh-2"], stdout_full=stdout_full, )