本文整理汇总了Python中common.OpTestIPMI.OpTestIPMI.ipmi_get_occ_status方法的典型用法代码示例。如果您正苦于以下问题:Python OpTestIPMI.ipmi_get_occ_status方法的具体用法?Python OpTestIPMI.ipmi_get_occ_status怎么用?Python OpTestIPMI.ipmi_get_occ_status使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common.OpTestIPMI.OpTestIPMI
的用法示例。
在下文中一共展示了OpTestIPMI.ipmi_get_occ_status方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: OpTestEnergyScale
# 需要导入模块: from common.OpTestIPMI import OpTestIPMI [as 别名]
# 或者: from common.OpTestIPMI.OpTestIPMI import ipmi_get_occ_status [as 别名]
#.........这里部分代码省略.........
if int(self.cv_SYSTEM.sys_wait_for_standby_state(BMC_CONST.SYSTEM_STANDBY_STATE_DELAY)) == 0:
print "System is in standby/Soft-off state"
else:
l_msg = "System failed to reach standby/Soft-off state"
raise OpTestError(l_msg)
self.cv_IPMI.ipmi_sdr_clear()
print self.cv_IPMI.ipmi_get_power_limit()
self.cv_IPMI.ipmi_set_power_limit(l_power_limit_high)
self.cv_IPMI.ipmi_activate_power_limit()
self.cv_IPMI.ipmi_deactivate_power_limit()
print self.cv_IPMI.ipmi_get_power_limit()
self.cv_IPMI.ipmi_activate_power_limit()
print self.cv_IPMI.ipmi_get_power_limit()
self.cv_IPMI.ipmi_deactivate_power_limit()
self.cv_IPMI.ipmi_set_power_limit(l_power_limit_low)
self.cv_IPMI.ipmi_activate_power_limit()
print self.cv_IPMI.ipmi_get_power_limit()
self.cv_IPMI.ipmi_set_power_limit(l_power_limit_high)
self.cv_IPMI.ipmi_get_power_limit()
print "Get All dcmi readings at power off"
self.run_ipmi_cmd(BMC_CONST.IPMI_DCMI_DISCOVER)
self.run_ipmi_cmd(BMC_CONST.IPMI_DCMI_POWER_READING)
self.run_ipmi_cmd(BMC_CONST.IPMI_DCMI_POWER_GET_LIMIT)
self.run_ipmi_cmd(BMC_CONST.IPMI_DCMI_SENSORS)
self.run_ipmi_cmd(BMC_CONST.IPMI_DCMI_GET_MC_ID_STRING)
self.run_ipmi_cmd(BMC_CONST.IPMI_DCMI_GET_TEMP_READING)
self.run_ipmi_cmd(BMC_CONST.IPMI_DCMI_GET_CONF_PARAM)
self.run_ipmi_cmd(BMC_CONST.IPMI_DCMI_OOB_DISCOVER)
print "Performing a IPMI Power ON Operation"
# Perform a IPMI Power ON Operation
self.cv_IPMI.ipmi_power_on()
self.cv_SYSTEM.sys_check_host_status()
self.util.PingFunc(self.cv_HOST.ip, BMC_CONST.PING_RETRY_POWERCYCLE)
l_status = self.cv_IPMI.ipmi_get_occ_status()
print l_status
if BMC_CONST.OCC_DEVICE_ENABLED in l_status:
print "OCC's are up and active"
else:
l_msg = "OCC's are not in active state"
raise OpTestError(l_msg)
print self.cv_IPMI.ipmi_get_power_limit()
print "Get All dcmi readings at runtime"
self.run_ipmi_cmd(BMC_CONST.IPMI_DCMI_DISCOVER)
self.run_ipmi_cmd(BMC_CONST.IPMI_DCMI_POWER_READING)
self.run_ipmi_cmd(BMC_CONST.IPMI_DCMI_POWER_GET_LIMIT)
self.run_ipmi_cmd(BMC_CONST.IPMI_DCMI_SENSORS)
self.run_ipmi_cmd(BMC_CONST.IPMI_DCMI_GET_MC_ID_STRING)
self.run_ipmi_cmd(BMC_CONST.IPMI_DCMI_GET_TEMP_READING)
self.run_ipmi_cmd(BMC_CONST.IPMI_DCMI_GET_CONF_PARAM)
self.run_ipmi_cmd(BMC_CONST.IPMI_DCMI_OOB_DISCOVER)
##
# @brief This function will test Energy scale features at standby state
# 1. Power OFF the system.
# 2. Power On the system to boot to host OS
# 2. Validate below Energy scale features at runtime state
# ipmitool dcmi power get_limit :Get the configured power limits.
# ipmitool dcmi power set_limit limit <value> :Power Limit Requested in Watts.
# ipmitool dcmi power activate :Activate the set power limit.
# ipmitool dcmi power deactivate :Deactivate the set power limit.
# 3. Once platform power limit activated execute below dcmi commands at runtime state.
# ipmitool dcmi discover :This command is used to discover
# supported capabilities in DCMI.
# ipmitool dcmi power reading :Get power related readings from the system.
# ipmitool dcmi power get_limit :Get the configured power limits.
示例2: OpTestOCC
# 需要导入模块: from common.OpTestIPMI import OpTestIPMI [as 别名]
# 或者: from common.OpTestIPMI.OpTestIPMI import ipmi_get_occ_status [as 别名]
#.........这里部分代码省略.........
l_msg = "System failed to reach standby/Soft-off state"
raise OpTestError(l_msg)
self.cv_IPMI.ipmi_power_on()
self.cv_SYSTEM.sys_check_host_status()
if self.check_occ_status() == BMC_CONST.FW_FAILED:
l_msg = "OCC's are not in active state after rebooting"
raise OpTestError(l_msg)
for i in range(1, BMC_CONST.OCC_RESET_RELOAD_COUNT):
print "*******************OCC Reset count %d*******************" % i
print "OPAL-PRD: OCC Enable"
self.cv_HOST.host_run_command(BMC_CONST.OCC_ENABLE)
print "OPAL-PRD: OCC DISABLE"
self.cv_HOST.host_run_command(BMC_CONST.OCC_DISABLE)
print "OPAL-PRD: OCC RESET"
self.cv_HOST.host_run_command(BMC_CONST.OCC_RESET)
time.sleep(60)
if self.check_occ_status() == BMC_CONST.FW_FAILED:
l_msg = "OCC's are not in active state"
raise OpTestError(l_msg)
print "OPAL-PRD: occ query reset reload count"
self.cv_HOST.host_run_command(BMC_CONST.OCC_QUERY_RESET_COUNTS)
print "OPAL-PRD: occ reset reset/reload count"
self.cv_HOST.host_run_command(BMC_CONST.OCC_SET_RESET_RELOAD_COUNT)
print "OPAL-PRD: occ query reset reload count"
self.cv_HOST.host_run_command(BMC_CONST.OCC_QUERY_RESET_COUNTS)
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)) == 0:
print "System is in standby/Soft-off state"
else:
l_msg = "System failed to reach standby/Soft-off state"
raise OpTestError(l_msg)
self.cv_IPMI.ipmi_power_on()
self.cv_SYSTEM.sys_check_host_status()
if self.check_occ_status() == BMC_CONST.FW_FAILED:
l_msg = "OCC's are not in active state after rebooting"
raise OpTestError(l_msg)
##
# @brief This function is used to test OCC Enable and Disable funtionality in BMC based systems.
# There is no limit for occ enable and disable, as of now doing 10 times in a loop.
#
# @return BMC_CONST.FW_SUCCESS or raise OpTestError
#
def test_occ_enable_disable_functionality(self):
self.cv_SYSTEM.sys_bmc_power_on_validate_host()
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)) == 0:
print "System is in standby/Soft-off state"
else:
l_msg = "System failed to reach standby/Soft-off state"
raise OpTestError(l_msg)
self.cv_IPMI.ipmi_power_on()
self.cv_SYSTEM.sys_check_host_status()
if self.check_occ_status() == BMC_CONST.FW_FAILED:
l_msg = "OCC's are not in active state"
raise OpTestError(l_msg)
for count in range(1,10):
print "OPAL-PRD: OCC Enable"
self.cv_HOST.host_run_command(BMC_CONST.OCC_ENABLE)
print "OPAL-PRD: OCC Disable"
self.cv_HOST.host_run_command(BMC_CONST.OCC_DISABLE)
time.sleep(60)
if self.check_occ_status() == BMC_CONST.FW_FAILED:
l_msg = "OCC's are not in active state"
#raise OpTestError(l_msg)
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)) == 0:
print "System is in standby/Soft-off state"
else:
l_msg = "System failed to reach standby/Soft-off state"
raise OpTestError(l_msg)
self.cv_IPMI.ipmi_power_on()
self.cv_SYSTEM.sys_check_host_status()
if self.check_occ_status() == BMC_CONST.FW_FAILED:
l_msg = "OCC's are not in active state"
raise OpTestError(l_msg)
##
# @brief This function is used to get OCC status enable/disable.
#
# @return BMC_CONST.FW_SUCCESS - OCC's are active or
# BMC_CONST.FW_FAILED - OCC's are not in active state
#
def check_occ_status(self):
l_status = self.cv_IPMI.ipmi_get_occ_status()
print l_status
if BMC_CONST.OCC_DEVICE_ENABLED in l_status:
print "OCC's are up and active"
return BMC_CONST.FW_SUCCESS
else:
print "OCC's are not in active state"
return BMC_CONST.FW_FAILED