本文整理匯總了Python中common.OpTestIPMI.OpTestIPMI.ipmi_set_boot_to_petitboot方法的典型用法代碼示例。如果您正苦於以下問題:Python OpTestIPMI.ipmi_set_boot_to_petitboot方法的具體用法?Python OpTestIPMI.ipmi_set_boot_to_petitboot怎麽用?Python OpTestIPMI.ipmi_set_boot_to_petitboot使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類common.OpTestIPMI.OpTestIPMI
的用法示例。
在下文中一共展示了OpTestIPMI.ipmi_set_boot_to_petitboot方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: OpTestFastReboot
# 需要導入模塊: from common.OpTestIPMI import OpTestIPMI [as 別名]
# 或者: from common.OpTestIPMI.OpTestIPMI import ipmi_set_boot_to_petitboot [as 別名]
class OpTestFastReboot():
## Initialize this object
# @param i_bmcIP The IP address of the BMC
# @param i_bmcUser The userid to log into the BMC with
# @param i_bmcPasswd The password of the userid to log into the BMC with
# @param i_bmcUserIpmi The userid to issue the BMC IPMI commands with
# @param i_bmcPasswdIpmi The password of BMC IPMI userid
# @param i_ffdcDir Optional param to indicate where to write FFDC
#
# "Only required for inband tests" else Default = None
# @param i_hostIP The IP address of the HOST
# @param i_hostuser The userid to log into the HOST
# @param i_hostPasswd The password of the userid to log into the HOST with
#
def __init__(self, i_bmcIP, i_bmcUser, i_bmcPasswd,
i_bmcUserIpmi, i_bmcPasswdIpmi, i_ffdcDir=None, i_hostip=None,
i_hostuser=None, i_hostPasswd=None):
self.cv_BMC = OpTestBMC(i_bmcIP, i_bmcUser, i_bmcPasswd, i_ffdcDir)
self.cv_IPMI = OpTestIPMI(i_bmcIP, i_bmcUserIpmi, i_bmcPasswdIpmi,
i_ffdcDir, i_hostip, i_hostuser, i_hostPasswd)
self.cv_HOST = OpTestHost(i_hostip, i_hostuser, i_hostPasswd, i_bmcIP)
self.cv_SYSTEM = OpTestSystem(i_bmcIP, i_bmcUser, i_bmcPasswd,
i_bmcUserIpmi, i_bmcPasswdIpmi, i_ffdcDir, i_hostip,
i_hostuser, i_hostPasswd)
self.util = OpTestUtil()
##
# @brief This function tests fast reset of power systems.
# It will check booting sequence when reboot command
# getting executed in both petitboot and host OS
#
# @return BMC_CONST.FW_SUCCESS or BMC_CONST.FW_FAILED
#
def test_opal_fast_reboot(self):
self.cv_SYSTEM.sys_bmc_power_on_validate_host()
self.cv_HOST.host_run_command(BMC_CONST.NVRAM_SET_FAST_RESET_MODE)
res = self.cv_HOST.host_run_command(BMC_CONST.NVRAM_PRINT_FAST_RESET_VALUE)
if "feeling-lucky" in res:
print "Setting the fast-reset mode successful"
else:
raise OpTestError("Failed to set the fast-reset mode")
self.con = self.cv_SYSTEM.sys_get_ipmi_console()
self.cv_IPMI.ipmi_host_login(self.con)
self.cv_IPMI.ipmi_host_set_unique_prompt(self.con)
self.cv_IPMI.run_host_cmd_on_ipmi_console("uname -a")
self.cv_IPMI.ipmi_set_boot_to_petitboot()
self.con.sendline("reboot")
self.con.expect(" RESET: Initiating fast reboot", timeout=60)
# Exiting to petitboot shell
self.con.expect('Petitboot', timeout=BMC_CONST.PETITBOOT_TIMEOUT)
self.con.expect('x=exit', timeout=10)
# Exiting to petitboot
self.con.sendcontrol('l')
self.con.send('\x1b[B')
self.con.send('\x1b[B')
self.con.send('\r')
self.con.expect('Exiting petitboot')
self.con.send('\r')
self.con.send('\x08')
self.cv_IPMI.ipmi_host_set_unique_prompt(self.con)
self.cv_IPMI.run_host_cmd_on_ipmi_console("uname -a")
self.con.sendline("reboot")
self.con.expect(" RESET: Initiating fast reboot", timeout=60)
# Exiting to petitboot shell
self.con.expect('Petitboot', timeout=BMC_CONST.PETITBOOT_TIMEOUT)
self.con.expect('x=exit', timeout=10)
print "fast-reset boots the system to runtime"
self.cv_IPMI.ipmi_set_boot_to_disk()
return BMC_CONST.FW_SUCCESS