def test04_power_on_nodes(self): # BareMetal test bed uses a power strip that we can control via telnet # Need to add calls to that utility, for now, skipping power on baremetal_testbed = True if baremetal_testbed: log.info(" *** CDU power control not implemented yet, assuming nodes powered on outside this script") log.info(" *** Sleeping 90 seconds, allow physical nodes to power on") # Allow physical nodes some time to power on time.sleep(90) return # This powers on nodes via PDU or, if no PDU, power cycles nodes via IPMI to start discovery # ServerTech PDU case if pdu_lib.check_pdu_type() != "Unknown": log.info_5('**** PDU found, powering on PDU outlets') self.assertTrue(pdu_lib.pdu_control_compute_nodes("on"), 'Failed to power on all outlets') # Wait about 30 seconds for the outlets to all come on and nodes to DHCP fit_common.countdown(30) # no PDU case else: log.info_5('**** No supported PDU found, restarting nodes using IPMI.') # Check if some nodes are already discovered nodes = [] nodes = fit_common.node_select() if nodes: log.info_5(" Nodes already discovered, skipping ipmi power reset") log.info_5(" %s", nodes) else: # Power cycle all nodes via IPMI, display warning if no nodes found if fit_common.power_control_all_nodes("off") == 0: log.info_5('**** No BMC IP addresses found in arp table, continuing without node restart.') else: # power on all nodes under any circumstances fit_common.power_control_all_nodes("on")
def test02_power_on_nodes(self): # ServerTech PDU case if pdu_lib.check_pdu_type() != "Unknown": print '**** PDU found, powering on PDU outlets' self.assertTrue(pdu_lib.pdu_control_compute_nodes("on"), 'Failed to power on all outlets') # Wait about 30 seconds for the outlets to all come on and nodes to DHCP fit_common.countdown(30) # no PDU case else: print '**** No supported PDU found, restarting nodes using IMPI.' # Power off all nodes self.assertNotEqual(fit_common.power_control_all_nodes("off"), 0, 'No BMC IP addresses found') # Power on all nodes self.assertNotEqual(fit_common.power_control_all_nodes("on"), 0, 'No BMC IP addresses found')
def test04_power_on_nodes(self): # This powers on nodes via PDU or, if no PDU, power cycles nodes via IPMI to start discovery # ServerTech PDU case if pdu_lib.check_pdu_type() != "Unknown": log.info_5('**** PDU found, powering on PDU outlets') self.assertTrue(pdu_lib.pdu_control_compute_nodes("on"), 'Failed to power on all outlets') # Wait about 30 seconds for the outlets to all come on and nodes to DHCP fit_common.countdown(30) # no PDU case else: log.info_5('**** No supported PDU found, restarting nodes using IPMI.') # Power cycle all nodes via IPMI, display warning if no nodes found if fit_common.power_control_all_nodes("off") == 0: log.info_5('**** No BMC IP addresses found in arp table, continuing without node restart.') else: # power on all nodes under any circumstances fit_common.power_control_all_nodes("on")