Exemple #1
0
 def setUp(self):
     self.temp_cib = get_tmp_file("tier1_cluster_upgrade")
     write_file_to_tmpfile(rc("cib-empty-1.2.xml"), self.temp_cib)
     self.pcs_runner = PcsRunner(self.temp_cib.name)
Exemple #2
0
 def fixture_conf_qdevice_heuristics(self):
     write_file_to_tmpfile(coro_qdevice_heuristics_conf, self.temp_conf)
Exemple #3
0
 def setUp(self):
     # pylint: disable=invalid-name
     self.temp_cib = get_tmp_file("tier1_status_resource_stonith_status")
     write_file_to_tmpfile(self.cib_file, self.temp_cib)
     self.pcs_runner = PcsRunner(self.temp_cib.name)
Exemple #4
0
 def setUp(self):
     # pylint: disable=invalid-name
     self.temp_cib = get_tmp_file("tier1_tag")
     write_file_to_tmpfile(tags_cib, self.temp_cib)
     self.pcs_runner = PcsRunner(self.temp_cib.name)
Exemple #5
0
    def assert_success_legacy(self, update_keyword):
        write_file_to_tmpfile(empty_cib, self.temp_cib)
        warning_lines = []
        if not update_keyword:
            warning_lines.append(
                "Warning: This command is deprecated and will be removed. "
                f"Please use 'pcs {' '.join(self.cli_command)} update' instead.\n"
            )
        warning_lines.append(
            "Warning: Defaults do not apply to resources which override "
            "them with their own defined values\n")
        warnings = "".join(warning_lines)

        command = self.cli_command[:]
        if update_keyword:
            command.append("update")

        self.assert_effect(
            command + "name1=value1 name2=value2 name3=value3".split(),
            dedent(f"""\
                <{self.cib_tag}>
                    <meta_attributes id="{self.cib_tag}-meta_attributes">
                        <nvpair id="{self.cib_tag}-meta_attributes-name1"
                            name="name1" value="value1"
                        />
                        <nvpair id="{self.cib_tag}-meta_attributes-name2"
                            name="name2" value="value2"
                        />
                        <nvpair id="{self.cib_tag}-meta_attributes-name3"
                            name="name3" value="value3"
                        />
                    </meta_attributes>
                </{self.cib_tag}>
            """),
            output=warnings,
        )

        self.assert_effect(
            command + "name2=value2A name3=".split(),
            dedent(f"""\
                <{self.cib_tag}>
                    <meta_attributes id="{self.cib_tag}-meta_attributes">
                        <nvpair id="{self.cib_tag}-meta_attributes-name1"
                            name="name1" value="value1"
                        />
                        <nvpair id="{self.cib_tag}-meta_attributes-name2"
                            name="name2" value="value2A"
                        />
                    </meta_attributes>
                </{self.cib_tag}>
            """),
            output=warnings,
        )

        self.assert_effect(
            command + "name1= name2=".split(),
            dedent(f"""\
                <{self.cib_tag}>
                    <meta_attributes id="{self.cib_tag}-meta_attributes" />
                </{self.cib_tag}>
            """),
            output=warnings,
        )
Exemple #6
0
 def setUp(self):
     self.temp_cib = get_tmp_file("tier1_properties_unset")
     write_file_to_tmpfile(empty_cib, self.temp_cib)
     self.pcs_runner = PcsRunner(self.temp_cib.name)
Exemple #7
0
 def setUp(self):
     self.temp_cib = get_tmp_file("tier1_alert_cib_upgrade")
     write_file_to_tmpfile(old_cib, self.temp_cib)
     self.pcs_runner = PcsRunner(self.temp_cib.name)
Exemple #8
0
 def setUp(self):
     self.temp_cib = get_tmp_file("tier1_node_attribute")
     write_file_to_tmpfile(empty_cib, self.temp_cib)
     self.pcs_runner = PcsRunner(self.temp_cib.name)
Exemple #9
0
 def test_status_no_resources_default_command_hide_inactive(self):
     self.pcs_runner.corosync_conf_opt = self.corosync_conf
     write_file_to_tmpfile(rc("cib-empty.xml"), self.temp_cib)
     self.assert_pcs_success(
         ["status", "--hide-inactive"], stdout_start=self.no_resources_status
     )
Exemple #10
0
 def setUp(self):
     self.temp_cib = get_tmp_file("tier1_status_xml_status")
     write_file_to_tmpfile(rc("cib-empty.xml"), self.temp_cib)
     self.pcs_runner = PcsRunner(self.temp_cib.name)
Exemple #11
0
 def test_status_no_resources_default_command_hide_inactive(self):
     write_file_to_tmpfile(rc("cib-empty.xml"), self.temp_cib)
     self.assert_pcs_success(
         self.command[:-1] + ["--hide-inactive"],
         stdout_full=self.no_active_resources_msg,
     )
Exemple #12
0
 def test_status_no_resources_default_command(self):
     write_file_to_tmpfile(rc("cib-empty.xml"), self.temp_cib)
     self.assert_pcs_success(
         self.command[:-1], stdout_full=self.no_resources_msg
     )
Exemple #13
0
 def test_status_no_resources_with_node_hide_inactive(self):
     write_file_to_tmpfile(rc("cib-empty.xml"), self.temp_cib)
     self.assert_pcs_success(
         self.command + ["node=rh-1", "--hide-inactive"],
         stdout_full=self.no_active_resources_msg,
     )
Exemple #14
0
 def setUp(self):
     self.temp_cib = get_tmp_file("tier1_node_maintenance")
     write_file_to_tmpfile(rc("cib-empty-with3nodes.xml"), self.temp_cib)
     self.pcs_runner = PcsRunner(self.temp_cib.name)
Exemple #15
0
 def setUp(self):
     self.temp_cib = get_tmp_file("tier1_bundle_show")
     write_file_to_tmpfile(self.empty_cib, self.temp_cib)
     self.pcs_runner = PcsRunner(self.temp_cib.name)
     self.pcs_runner.mock_settings = get_mock_settings(
         "crm_resource_binary")
Exemple #16
0
 def setUp(self):
     self.temp_cib = get_tmp_file("tier1_node_utilization_set")
     write_file_to_tmpfile(empty_cib, self.temp_cib)
     self.pcs_runner = PcsRunner(self.temp_cib.name)
Exemple #17
0
 def setUp(self):
     self.temp_cib = get_tmp_file("tier1_misc")
     write_file_to_tmpfile(rc("cib-empty-1.2.xml"), self.temp_cib)
     self.pcs_runner = PcsRunner(self.temp_cib.name)
     self.pcs_runner.mock_settings = get_mock_settings(
         "crm_resource_binary")
Exemple #18
0
 def setUp(self):
     super().setUp()
     write_file_to_tmpfile(empty_cib, self.temp_cib)
Exemple #19
0
 def setUp(self):
     self.temp_cib = get_tmp_file("tier0_statust_stonith_warning")
     write_file_to_tmpfile(self.empty_cib, self.temp_cib)
     self.pcs_runner = PcsRunner(self.temp_cib.name)
Exemple #20
0
 def setUp(self):
     self.temp_cib = get_tmp_file("tier1_cib_resource_manage_unmanage")
     write_file_to_tmpfile(self.empty_cib, self.temp_cib)
     self.pcs_runner = PcsRunner(self.temp_cib.name)
Exemple #21
0
 def setUp(self):
     self.temp_cib = get_tmp_file("tier1_misc")
     write_file_to_tmpfile(rc("cib-empty.xml"), self.temp_cib)
     self.pcs_runner = PcsRunner(self.temp_cib.name)
     self.allowed_roles = format_list(const.PCMK_ROLES)
Exemple #22
0
 def setUp(self):
     # pylint cannot know this will be mixed into a TetsCase class
     # pylint: disable=invalid-name
     self.temp_cib = get_tmp_file("tier1_booth_delete_remove")
     write_file_to_tmpfile(EMPTY_CIB, self.temp_cib)
     self.pcs_runner = PcsRunner(self.temp_cib.name)
Exemple #23
0
 def setUp(self):
     self.temp_cib = get_tmp_file("tier1_test_resource_common")
     write_file_to_tmpfile(self.empty_cib, self.temp_cib)
     self.pcs_runner = PcsRunner(self.temp_cib.name)