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'))
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'))
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" ), )
# 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)