Example #1
0
    def test_success_standard_provider(self):
        self.mock_runner.run.return_value = (
            "\n".join([
                "ping",
                "SystemHealth",
                "SysInfo",
                "HealthCPU",
                "Dummy",
                "",
            ]),
            "",
            0,
        )

        self.assertEqual(
            ra_list.list_resource_agents(
                self.mock_runner, StandardProviderTuple("ocf", "pacemaker")),
            [
                "Dummy",
                "HealthCPU",
                "ping",
                "SysInfo",
                "SystemHealth",
            ],
        )
        self.assert_runner("ocf:pacemaker")
Example #2
0
    def test_success_standard(self):
        self.mock_runner.run.return_value = (
            "\n".join([
                "docker",
                "Dummy",
                "dhcpd",
                "Dummy",
                "ethmonitor",
                "",
            ]),
            "",
            0,
        )

        self.assertEqual(
            ra_list.list_resource_agents(self.mock_runner,
                                         StandardProviderTuple("ocf")),
            [
                "dhcpd",
                "docker",
                "Dummy",
                "ethmonitor",
            ],
        )
        self.assert_runner("ocf")
Example #3
0
 def test_bad_standard(self):
     self.mock_runner.run.return_value = (
         "",
         "No agents found for standard=nonsense, provider=*",
         1,
     )
     self.assertEqual(
         ra_list.list_resource_agents(self.mock_runner,
                                      StandardProviderTuple("nonsense")),
         [],
     )
     self.assert_runner("nonsense")
Example #4
0
    def test_filter_hidden_agents(self):
        self.mock_runner.run.return_value = (
            "\n".join([
                "fence_na",
                "fence_wti",
                "fence_scsi",
                "fence_vmware_helper",
                "fence_nss_wrapper",
                "fence_node",
                "fence_vmware_soap",
                "fence_virt",
                "fence_pcmk",
                "fence_sanlockd",
                "fence_xvm",
                "fence_ack_manual",
                "fence_legacy",
                "fence_check",
                "fence_tool",
                "fence_kdump_send",
                "fence_virtd",
                "",
            ]),
            "",
            0,
        )

        self.assertEqual(
            ra_list.list_resource_agents(self.mock_runner,
                                         StandardProviderTuple("stonith")),
            [
                "fence_scsi",
                "fence_virt",
                "fence_vmware_soap",
                "fence_wti",
                "fence_xvm",
            ],
        )
        self.assert_runner("stonith")