本文整理汇总了Python中common.OpTestHost.OpTestHost.host_enable_single_core方法的典型用法代码示例。如果您正苦于以下问题:Python OpTestHost.host_enable_single_core方法的具体用法?Python OpTestHost.host_enable_single_core怎么用?Python OpTestHost.host_enable_single_core使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common.OpTestHost.OpTestHost
的用法示例。
在下文中一共展示了OpTestHost.host_enable_single_core方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: OpTestHMIHandling
# 需要导入模块: from common.OpTestHost import OpTestHost [as 别名]
# 或者: from common.OpTestHost.OpTestHost import host_enable_single_core [as 别名]
#.........这里部分代码省略.........
# BMC_CONST.TFMR_PARITY_ERROR
# BMC_CONST.TFMR_HDEC_PARITY_ERROR
# BMC_CONST.TFMR_DEC_PARITY_ERROR
# BMC_CONST.TFMR_PURR_PARITY_ERROR
# BMC_CONST.TFMR_SPURR_PARITY_ERROR
#
# @return BMC_CONST.FW_SUCCESS or raise OpTestError
#
def testTFMR_Errors(self, i_error):
l_error = i_error
for l_pair in self.l_dic:
l_chip = l_pair[0]
for l_core in l_pair[1]:
l_reg = "1%s013281" % l_core
l_cmd = "./putscom -c %s %s %s;echo $?" % (l_chip, l_reg, l_error)
self.cv_IPMI.run_host_cmd_on_ipmi_console("dmesg -C")
l_res = self.cv_IPMI.run_host_cmd_on_ipmi_console(l_cmd)
time.sleep(10)
if l_res[-1] == "0":
print "Injected TFMR error %s" % l_error
elif l_res[-1] == "1":
continue
else:
if any("Kernel panic - not syncing" in line for line in l_res):
l_msg = "TFMR error injection: Kernel got panic"
elif any("Petitboot" in line for line in l_res):
l_msg = "System reached petitboot:TFMR error injection recovery failed"
elif any("ISTEP" in line for line in l_res):
l_msg = "System started booting: TFMR error injection recovery failed"
else:
l_msg = "Failed to inject TFMR error %s " % l_error
print l_msg
raise OpTestError(l_msg)
l_res = self.cv_IPMI.run_host_cmd_on_ipmi_console("dmesg")
if any("Timer facility experienced an error" in line for line in l_res) and \
any("Severe Hypervisor Maintenance interrupt [Recovered]" in line for line in l_res):
print "Timer facility experienced an error and got recovered"
else:
l_msg = "HMI handling failed to log message"
raise OpTestError(l_msg)
time.sleep(BMC_CONST.HMI_TEST_CASE_SLEEP_TIME)
return BMC_CONST.FW_SUCCESS
##
# @brief This function tests chip TOD related error injections and check
# the corresponding error got recovered. And this error injection
# happening on a random chip. This tod errors should test on systems
# having more than one processor socket(chip). On single chip system
# TOD error recovery won't work.
#
# @param i_error @type string: this is the type of error want to inject
# These errors represented in common/OpTestConstants.py file.
#
# @return BMC_CONST.FW_SUCCESS or raise OpTestError
#
def test_tod_errors(self, i_error):
l_error = i_error
l_pair = random.choice(self.l_dic)
# Get random chip id
l_chip = l_pair[0]
l_cmd = "./putscom -c %s %s %s;echo $?" % (l_chip, BMC_CONST.TOD_ERROR_REG, l_error)
self.cv_IPMI.run_host_cmd_on_ipmi_console("dmesg -C")
l_res = self.cv_IPMI.run_host_cmd_on_ipmi_console(l_cmd)
time.sleep(10)
# As of now putscom command to TOD register will fail with return code -1.
# putscom indirectly call getscom to read the value again.
# But getscom to TOD error reg there is no access
# TOD Error reg has only WO access and there is no read access
if l_res[-1] == "1":
print "Injected TOD error %s" % l_error
else:
if any("Kernel panic - not syncing" in line for line in l_res):
print "TOD ERROR Injection-kernel got panic"
elif any("login:" in line for line in l_res):
print "System booted to host OS without any kernel panic message"
elif any("Petitboot" in line for line in l_res):
print "System reached petitboot without any kernel panic message"
elif any("ISTEP" in line for line in l_res):
print "System started booting without any kernel panic message"
else:
l_msg = "TOD: PSS Hamming distance error injection failed"
raise OpTestError(l_msg)
l_res = self.cv_IPMI.run_host_cmd_on_ipmi_console("dmesg")
if any("Timer facility experienced an error" in line for line in l_res) and \
any("Severe Hypervisor Maintenance interrupt [Recovered]" in line for line in l_res):
print "Timer facility experienced an error and got recovered"
else:
l_msg = "HMI handling failed to log message"
raise OpTestError(l_msg)
time.sleep(BMC_CONST.HMI_TEST_CASE_SLEEP_TIME)
return BMC_CONST.FW_SUCCESS
##
# @brief This function enables a single core
#
# @return BMC_CONST.FW_SUCCESS or raise OpTestError
#
def host_enable_single_core(self):
self.cv_HOST.host_enable_single_core()