本文整理汇总了Python中common.OpTestHost.OpTestHost.host_compile_gard_utility方法的典型用法代码示例。如果您正苦于以下问题:Python OpTestHost.host_compile_gard_utility方法的具体用法?Python OpTestHost.host_compile_gard_utility怎么用?Python OpTestHost.host_compile_gard_utility使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common.OpTestHost.OpTestHost
的用法示例。
在下文中一共展示了OpTestHost.host_compile_gard_utility方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: OpTestIPMIReprovision
# 需要导入模块: from common.OpTestHost import OpTestHost [as 别名]
# 或者: from common.OpTestHost.OpTestHost import host_compile_gard_utility [as 别名]
#.........这里部分代码省略.........
print "IPMI_Reprovision: Updating the nvram partition with test cfg data"
self.cv_HOST.host_run_command(BMC_CONST.NVRAM_UPDATE_CONFIG_TEST_DATA)
self.cv_HOST.host_run_command(BMC_CONST.NVRAM_PRINT_CFG)
print "IPMI_Reprovision: issuing ipmi pnor reprovision request"
self.cv_SYSTEM.sys_issue_ipmi_pnor_reprovision_request()
print "IPMI_Reprovision: wait for reprovision to complete"
self.cv_SYSTEM.sys_wait_for_ipmi_pnor_reprovision_to_complete()
print "IPMI_Reprovision: gathering the opal message logs"
self.cv_HOST.host_gather_opal_msg_log()
print "IPMI_Reprovision: 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 "IPMI_Reprovision: System is in standby/Soft-off state"
else:
l_msg = "IPMI_Reprovision: System failed to reach standby/Soft-off state after pnor reprovisioning"
raise OpTestError(l_msg)
print "IPMI_Reprovision: 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_res = self.cv_HOST.host_run_command(BMC_CONST.NVRAM_PRINT_CFG)
if l_res.__contains__(BMC_CONST.NVRAM_TEST_DATA):
l_msg = "NVRAM Partition - IPMI Reprovision not happening, nvram test config data still exists"
raise OpTestError(l_msg)
print "NVRAM Partition - IPMI Reprovision is done, cleared the nvram test config data"
self.cv_HOST.host_gather_opal_msg_log()
return BMC_CONST.FW_SUCCESS
##
# @brief This function will cover following test steps
# Testcase: GARD Partition-IPMI Reprovision
# 1. Inject core checkstop using existed function from OpTestHMIHandling.py
# 2. Do a Hard reboot(IPMI Power OFF/ON)
# 2. Issue an IPMI PNOR Reprovision request command, to reset GUARD partition to default.
# 3. Wait for IPMI PNOR Reprovision progress to complete(00).
# 4. Check for GUARD parition whether the existing gard records erased or not.
# 6. Reboot the system back to see system is booting fine or not.
#
# @return BMC_CONST.FW_SUCCESS or raise OpTestError
#
def test_gard_ipmi_reprovision(self):
self.cv_SYSTEM.sys_bmc_power_on_validate_host()
print "IPMI_Reprovision: Injecting system core checkstop to guard the phyisical cpu"
self.opTestHMIHandling.testHMIHandling(BMC_CONST.HMI_MALFUNCTION_ALERT)
print "IPMI_Reprovision: 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 "IPMI_Reprovision: System is in standby/Soft-off state"
else:
l_msg = "IPMI_Reprovision: System failed to reach standby/Soft-off state"
raise OpTestError(l_msg)
print "IPMI_Reprovision: 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)
print "IPMI_Reprovision: issuing ipmi pnor reprovision request"
self.cv_SYSTEM.sys_issue_ipmi_pnor_reprovision_request()
print "IPMI_Reprovision: wait for reprovision to complete"
self.cv_SYSTEM.sys_wait_for_ipmi_pnor_reprovision_to_complete()
print "IPMI_Reprovision: gathering the opal message logs"
self.cv_HOST.host_gather_opal_msg_log()
self.cv_HOST.host_get_OS_Level()
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_gard_utility(BMC_CONST.CLONE_SKIBOOT_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")
l_res = self.cv_SYSTEM.sys_list_gard_records(BMC_CONST.GARD_TOOL_DIR)
print l_res
if BMC_CONST.NO_GARD_RECORDS in l_res:
print "GUARD Partition - IPMI Reprovision is done, cleared HW gard records"
else:
l_msg = "IPMI: Reprovision not happening, gard records are not erased"
raise OpTestError(l_msg)
print "IPMI_Reprovision: 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 "IPMI_Reprovision: System is in standby/Soft-off state"
else:
l_msg = "IPMI_Reprovision: System failed to reach standby/Soft-off state"
raise OpTestError(l_msg)
print "IPMI_Reprovision: 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)
print "IPMI_Reprovision: gathering the opal message logs"
self.cv_HOST.host_gather_opal_msg_log()
return BMC_CONST.FW_SUCCESS
示例2: OpTestHMIHandling
# 需要导入模块: from common.OpTestHost import OpTestHost [as 别名]
# 或者: from common.OpTestHost.OpTestHost import host_compile_gard_utility [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']]]
#.........这里部分代码省略.........