本文整理汇总了Python中common.OpTestHost.OpTestHost.host_compile_xscom_utilities方法的典型用法代码示例。如果您正苦于以下问题:Python OpTestHost.host_compile_xscom_utilities方法的具体用法?Python OpTestHost.host_compile_xscom_utilities怎么用?Python OpTestHost.host_compile_xscom_utilities使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common.OpTestHost.OpTestHost
的用法示例。
在下文中一共展示了OpTestHost.host_compile_xscom_utilities方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: OpTestPrdDriver
# 需要导入模块: from common.OpTestHost import OpTestHost [as 别名]
# 或者: from common.OpTestHost.OpTestHost import host_compile_xscom_utilities [as 别名]
#.........这里部分代码省略.........
def test_prd_for_fir(self, FIR, FIMR, ERROR):
chip_id = "0x" + self.random_chip
print chip_id
print "OPAL-PRD: Injecting error 0x%x on FIR: %s" % (ERROR, FIR)
# Read Local Fault Isolation register
l_cmd = "./getscom -c %s %s" % (chip_id, FIR)
l_res = self.cv_IPMI.run_host_cmd_on_ipmi_console(l_cmd)
# Reading Local Fault Isolation mask register
l_cmd = "./getscom -c %s %s" % (chip_id, FIMR)
l_res = self.cv_IPMI.run_host_cmd_on_ipmi_console(l_cmd)
print l_res
# Changing the FIMR value to un-masked value.
LEN = 16
l_len = len(l_res[-1])
l_val = hex(int(("0x" + "0"*(LEN - l_len) + l_res[-1]), 16)& (ERROR ^ 0xffffffffffffffff))
# Writing the same value to Local Fault Isolation mask register again
l_cmd = "./putscom -c %s %s %s" % (chip_id, BMC_CONST.PBA_FAULT_ISOLATION_MASK_REGISTER, l_val)
l_res = self.cv_IPMI.run_host_cmd_on_ipmi_console(l_cmd)
# Inject a core error on FIR
l_cmd = "./putscom -c %s %s %s" % (chip_id, FIR, hex(ERROR))
l_res = self.cv_IPMI.run_host_cmd_on_ipmi_console(l_cmd)
time.sleep(30)
# Read Local Fault Isolation register again
l_cmd = "./getscom -c %s %s" % (chip_id, FIR)
l_res = self.cv_IPMI.run_host_cmd_on_ipmi_console(l_cmd)
print l_res
# Check FIR got cleared by opal-prd
if l_res[-1] == BMC_CONST.FAULT_ISOLATION_REGISTER_CONTENT:
print "Opal-prd handles core hardware error"
else:
l_msg = "Opal-prd not clearing hardware errors in runtime"
print l_msg
raise OpTestError(l_msg)
# Reading the Local Fault Isolation Mask Register again
l_cmd = "./getscom -c %s %s" % (chip_id, FIMR)
l_res = self.cv_IPMI.run_host_cmd_on_ipmi_console(l_cmd)
print l_res
# check for IPOLL mask register value to see opal-prd cleared the value
l_cmd = "./getscom -c %s %s" % (chip_id, BMC_CONST.IPOLL_MASK_REGISTER)
l_res = self.cv_IPMI.run_host_cmd_on_ipmi_console(l_cmd)
if l_res[-1] == BMC_CONST.IPOLL_MASK_REGISTER_CONTENT:
print "Opal-prd cleared the IPOLL MASK REGISTER"
return BMC_CONST.FW_SUCCESS
else:
l_msg = "Opal-prd is not clearing the IPOLL MASK REGISTER after injecting core FIR error"
print l_msg
raise OpTestError(l_msg)
##
# @brief This is a common function for all the PRD test cases. This will be executed before
# any test case starts. Basically this provides below requirements.
# 1. Validates all required host commands
# 2. It will clone skiboot source repository
# 3. Compile the necessary tools -xscom-utils(getscom and putscom)
# 4. Get the list Of Chips.
# Ex: ['00000000', '00000001', '00000010']
# 5. generate a random chip.
#
# @return BMC_CONST.FW_SUCCESS or raise OpTestError
#
def test_init(self):
# Get OS level
self.cv_HOST.host_get_OS_Level()
# Check whether git and gcc commands are available on host
self.cv_HOST.host_check_command("git", "gcc")
# It will clone skiboot source repository
self.cv_HOST.host_clone_skiboot_source(BMC_CONST.CLONE_SKIBOOT_DIR)
# Compile the necessary tools xscom-utils and gard utility
self.cv_HOST.host_compile_xscom_utilities(BMC_CONST.CLONE_SKIBOOT_DIR)
# Getting list of processor chip Id's(executing getscom -l to get chip id's)
l_res = self.cv_HOST.host_run_command("cd %s/external/xscom-utils/; ./getscom -l" % BMC_CONST.CLONE_SKIBOOT_DIR)
l_res = l_res.splitlines()
l_chips = []
for line in l_res:
matchObj = re.search("(\d{8}).*processor", line)
if matchObj:
l_chips.append(matchObj.group(1))
if not l_chips:
l_msg = "Getscom failed to list processor chip id's"
raise OpTestError(l_msg)
l_chips.sort()
print l_chips # ['00000000', '00000001', '00000010']
self.random_chip = random.choice(l_chips)
# Below will be useful for debug purposes to compare chip information
l_res = self.cv_HOST.host_read_msglog_core()
print l_res
示例2: OpTestHMIHandling
# 需要导入模块: from common.OpTestHost import OpTestHost [as 别名]
# 或者: from common.OpTestHost.OpTestHost import host_compile_xscom_utilities [as 别名]
class OpTestHMIHandling():
## 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()
##
# @brief This is a common function for all the hmi test cases. This will be executed before
# any test case starts. Basically this provides below requirements.
# 1. Validates all required host commands
# 2. It will clone skiboot source repository
# 3. Compile the necessary tools xscom-utils and gard utility to test HMI.
# 4. Get the list Of Chips and cores in the form of dictionary.
# Ex: [['00000000', ['4', '5', '6', 'c', 'd', 'e']], ['00000001', ['4', '5', '6', 'c', 'd', 'e']], ['00000010', ['4', '5', '6', 'c', 'd', 'e']]]
# 5. In-order to inject HMI errors on cpu's, cpu should be running,
# so disabling the sleep states 1 and 2 of all CPU's.
#
# @return BMC_CONST.FW_SUCCESS or raise OpTestError
#
def test_init(self):
self.cv_SYSTEM.sys_bmc_power_on_validate_host()
# Get OS level
self.l_oslevel = self.cv_HOST.host_get_OS_Level()
# Check whether git and gcc commands are available on the host
self.cv_HOST.host_check_command("git")
self.cv_HOST.host_check_command("gcc")
# It will clone skiboot source repository
l_dir = "/tmp/skiboot"
self.cv_HOST.host_clone_skiboot_source(l_dir)
# Compile the necessary tools xscom-utils and gard utility
self.cv_HOST.host_compile_xscom_utilities(l_dir)
self.cv_HOST.host_compile_gard_utility(l_dir)
# Getting list of processor chip Id's(executing getscom -l to get chip id's)
l_res = self.cv_HOST.host_run_command("cd %s/external/xscom-utils/; ./getscom -l" % l_dir)
l_res = l_res.splitlines()
l_chips = []
for line in l_res:
matchObj = re.search("(\d{8}).*processor", line)
if matchObj:
l_chips.append(matchObj.group(1))
if not l_chips:
l_msg = "Getscom failed to list processor chip id's"
raise OpTestError(l_msg)
l_chips.sort()
print l_chips # ['00000000', '00000001', '00000010']
# Currently getting the list of active core id's with respect to each chip is by using opal msg log
# TODO: Need to identify best way to get list of cores(If Opal msg log is empty)
l_cmd = "cat /sys/firmware/opal/msglog | grep -i CHIP"
l_res = self.cv_HOST.host_run_command(l_cmd)
l_cores = {}
self.l_dic = []
l_res = l_res.splitlines()
for line in l_res:
matchObj = re.search("Chip (\d{1,2}) Core ([a-z0-9])", line)
if matchObj:
if l_cores.has_key(int(matchObj.group(1))):
(l_cores[int(matchObj.group(1))]).append(matchObj.group(2))
else:
l_cores[int(matchObj.group(1))] = list(matchObj.group(2))
if not l_cores:
l_msg = "Failed in getting core id's information from OPAL msg log"
raise OpTestError(l_msg)
print l_cores # {0: ['4', '5', '6', 'c', 'd', 'e'], 1: ['4', '5', '6', 'c', 'd', 'e'], 10: ['4', '5', '6', 'c', 'd', 'e']}
l_cores = sorted(l_cores.iteritems())
print l_cores
i=0
for tup in l_cores:
new_list = [l_chips[i], tup[1]]
self.l_dic.append(new_list)
i+=1
print self.l_dic
# self.l_dic is a list of chip id's, core id's . and is of below format
# [['00000000', ['4', '5', '6', 'c', 'd', 'e']], ['00000001', ['4', '5', '6', 'c', 'd', 'e']], ['00000010', ['4', '5', '6', 'c', 'd', 'e']]]
#.........这里部分代码省略.........
示例3: OpTestMCColdResetEffects
# 需要导入模块: from common.OpTestHost import OpTestHost [as 别名]
# 或者: from common.OpTestHost.OpTestHost import host_compile_xscom_utilities [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")