예제 #1
0
파일: test_ucsm.py 프로젝트: zhangrb/maas
    def test_power_query_calls_power_state_ucsm(self):
        system_id, url, username, password, uuid, context = (
            self.make_parameters())
        ucsm_power_driver = UCSMPowerDriver()
        power_state_ucsm = self.patch(ucsm_module, 'power_state_ucsm')
        power_state_ucsm.return_value = 'off'
        expected_result = ucsm_power_driver.power_query(system_id, context)

        self.expectThat(power_state_ucsm,
                        MockCalledOnceWith(url, username, password, uuid))
        self.expectThat(expected_result, Equals('off'))
예제 #2
0
파일: test_ucsm.py 프로젝트: zhangrb/maas
    def test_power_off_calls_power_control_ucsm(self):
        system_id, url, username, password, uuid, context = (
            self.make_parameters())
        ucsm_power_driver = UCSMPowerDriver()
        power_control_ucsm = self.patch(ucsm_module, 'power_control_ucsm')
        ucsm_power_driver.power_off(system_id, context)

        self.assertThat(
            power_control_ucsm,
            MockCalledOnceWith(url,
                               username,
                               password,
                               uuid,
                               maas_power_mode='off'))
예제 #3
0
    def test_power_on_calls_power_control_ucsm(self):
        (
            system_id,
            url,
            username,
            password,
            uuid,
            context,
        ) = self.make_parameters()
        ucsm_power_driver = UCSMPowerDriver()
        power_control_ucsm = self.patch(ucsm_module, "power_control_ucsm")
        ucsm_power_driver.power_on(system_id, context)

        self.assertThat(
            power_control_ucsm,
            MockCalledOnceWith(
                url, username, password, uuid, maas_power_mode="on"
            ),
        )
예제 #4
0
# Register all the power drivers.
power_drivers = [
    AMTPowerDriver(),
    APCPowerDriver(),
    DLIPowerDriver(),
    HMCPowerDriver(),
    IPMIPowerDriver(),
    LXDPowerDriver(),
    ManualPowerDriver(),
    MoonshotIPMIPowerDriver(),
    MSCMPowerDriver(),
    MicrosoftOCSPowerDriver(),
    NovaPowerDriver(),
    OpenBMCPowerDriver(),
    RECSPowerDriver(),
    RedfishPowerDriver(),
    SeaMicroPowerDriver(),
    UCSMPowerDriver(),
    VirshPowerDriver(),
    VMwarePowerDriver(),
    WedgePowerDriver(),
]
for driver in power_drivers:
    PowerDriverRegistry.register_item(driver.name, driver)


# Pod drivers are also power drivers.
for driver_name, driver in PodDriverRegistry:
    PowerDriverRegistry.register_item(driver_name, driver)