本文整理汇总了Python中common.OpTestSystem.OpTestSystem.sys_cold_reset_bmc方法的典型用法代码示例。如果您正苦于以下问题:Python OpTestSystem.sys_cold_reset_bmc方法的具体用法?Python OpTestSystem.sys_cold_reset_bmc怎么用?Python OpTestSystem.sys_cold_reset_bmc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common.OpTestSystem.OpTestSystem
的用法示例。
在下文中一共展示了OpTestSystem.sys_cold_reset_bmc方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: OpTestMCColdResetEffects
# 需要导入模块: from common.OpTestSystem import OpTestSystem [as 别名]
# 或者: from common.OpTestSystem.OpTestSystem import sys_cold_reset_bmc [as 别名]
class OpTestMCColdResetEffects():
## 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, i_ffdcDir)
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()
self.opTestSensors = OpTestSensors(i_bmcIP, i_bmcUser, i_bmcPasswd,
i_bmcUserIpmi, i_bmcPasswdIpmi, i_ffdcDir, i_hostip,
i_hostuser, i_hostPasswd)
##
# @brief This function will test BMC Cold reset vs Host FW status
# 1. When system is in runtime issue BMC Cold reset.
# 2. Check Host FW services and drivers.
# 3. Run sensors command
# 4. Get list of chips
# 5. This is expected to fail.
# https://github.com/open-power/op-build/issues/482
# 6. Reboot the system at the end of test.
#
# @return BMC_CONST.FW_SUCCESS or BMC_CONST.FW_FAILED
#
def test_bmc_cold_reset_effects(self):
print "Test BMC Cold reset effects versus Host Firmware Status"
self.cv_SYSTEM.sys_bmc_power_on_validate_host()
print "Issue BMC Cold reset"
result = True
try:
self.cv_SYSTEM.sys_cold_reset_bmc()
l_dir = BMC_CONST.SKIBOOT_WORKING_DIR
self.cv_HOST.host_clone_skiboot_source(l_dir)
self.cv_HOST.host_compile_xscom_utilities(l_dir)
l_con = self.cv_SYSTEM.sys_get_ipmi_console()
self.cv_IPMI.ipmi_host_login(l_con)
self.cv_IPMI.ipmi_host_set_unique_prompt(l_con)
self.cv_IPMI.run_host_cmd_on_ipmi_console("uname -a")
self.cv_IPMI.run_host_cmd_on_ipmi_console("cd %s/external/xscom-utils/; ./getscom -l" % l_dir)
self.opTestSensors.test_hwmon_driver()
self.cv_SYSTEM.sys_ipmi_close_console(l_con)
except:
result = False
pass
print "Gathering the OPAL msg logs"
self.cv_HOST.host_gather_opal_msg_log()
self.cv_IPMI.ipmi_power_off()
self.cv_SYSTEM.sys_bmc_power_on_validate_host()
if result is False:
raise OpTestError("MC Cold reset vs Host FW Test failed")
示例2: OpTestSystemBootSequence
# 需要导入模块: from common.OpTestSystem import OpTestSystem [as 别名]
# 或者: from common.OpTestSystem.OpTestSystem import sys_cold_reset_bmc [as 别名]
#.........这里部分代码省略.........
self.util.PingFunc(self.cv_HOST.ip, BMC_CONST.PING_RETRY_POWERCYCLE)
self.cv_IPMI.clear_ssh_keys(self.cv_HOST.ip)
print "Gathering the OPAL msg logs"
self.cv_HOST.host_gather_opal_msg_log()
return BMC_CONST.FW_SUCCESS
##
# @brief This function will test system auto reboot policy always-off.
# It has below steps
# 1. Do a system Power OFF(Host should go down)
# 2. Set auto reboot policy to off(chassis policy always-off)
# 3. Issue a BMC Cold reset.
# 4. After BMC comes up, expect the system to not boot.
# 5. Issue a Power ON of the system
# 6. Check for system status and gather OPAL msg log.
#
# @return BMC_CONST.FW_SUCCESS or raise OpTestError
#
def testSystemPowerPolicyOff(self):
self.cv_SYSTEM.sys_bmc_power_on_validate_host()
print "Testing System Power Policy:always-off"
print "Performing a IPMI Power OFF Operation"
# Perform a IPMI Power OFF Operation(Immediate Shutdown)
self.cv_IPMI.ipmi_power_off()
if int(self.cv_SYSTEM.sys_wait_for_standby_state(BMC_CONST.SYSTEM_STANDBY_STATE_DELAY)) == BMC_CONST.FW_SUCCESS:
print "System is in standby/Soft-off state"
else:
l_msg = "System failed to reach standby/Soft-off state"
raise OpTestError(l_msg)
print "Setting the system power policy to always-off"
self.cv_IPMI.ipmi_set_power_policy("always-off")
# Perform a BMC Cold Reset Operation
if int(self.cv_SYSTEM.sys_cold_reset_bmc()) == BMC_CONST.FW_SUCCESS:
print "System auto reboot policy for always-off works as expected"
print "System Power status not changed"
print "Performing a IPMI Power ON Operation"
# Perform a IPMI Power ON Operation
self.cv_IPMI.ipmi_power_on()
else:
print "Power restore policy failed"
l_msg = "Fail: chassis policy always-off making the system to auto boot"
print l_msg
self.cv_SYSTEM.sys_check_host_status()
self.util.PingFunc(self.cv_HOST.ip, BMC_CONST.PING_RETRY_POWERCYCLE)
self.cv_IPMI.clear_ssh_keys(self.cv_HOST.ip)
print "Gathering the OPAL msg logs"
self.cv_HOST.host_gather_opal_msg_log()
return BMC_CONST.FW_SUCCESS
##
# @brief This function will test system auto reboot policy always-on.
# It has below steps
# 1. Do a system Power OFF(Host should go down)
# 2. Set auto reboot policy to on(chassis policy always-on)
# 3. Issue a BMC Cold reset.
# 4. After BMC comes up, Here expect the system to boot,
# If not power policy is not working as expected
# 5. Check for system status and gather OPAL msg log.
#
# @return BMC_CONST.FW_SUCCESS or raise OpTestError
#
def testSystemPowerPolicyOn(self):
self.cv_SYSTEM.sys_bmc_power_on_validate_host()
print "Testing System Power Policy:Always-ON"