本文整理汇总了Python中common.OpTestIPMI.OpTestIPMI类的典型用法代码示例。如果您正苦于以下问题:Python OpTestIPMI类的具体用法?Python OpTestIPMI怎么用?Python OpTestIPMI使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了OpTestIPMI类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
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,
i_hostLspci=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.lspci_file = i_hostLspci
示例2: __init__
def __init__(
self,
i_bmcIP,
i_bmcUser,
i_bmcPasswd,
i_bmcUserIpmi,
i_bmcPasswdIpmi,
i_ffdcDir=None,
i_lparip=None,
i_lparuser=None,
i_lparPasswd=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_lparip, i_lparuser, i_lparPasswd
)
self.cv_LPAR = OpTestLpar(i_lparip, i_lparuser, i_lparPasswd, i_bmcIP)
self.cv_SYSTEM = OpTestSystem(
i_bmcIP,
i_bmcUser,
i_bmcPasswd,
i_bmcUserIpmi,
i_bmcPasswdIpmi,
i_ffdcDir,
i_lparip,
i_lparuser,
i_lparPasswd,
)
self.util = OpTestUtil()
示例3: __init__
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)
self.cv_HOST = OpTestHost(i_hostip, i_hostuser, i_hostPasswd, i_bmcIP)
self.util = OpTestUtil()
示例4: __init__
def __init__(self, i_bmcIP, i_bmcUser, i_bmcPasswd,
i_bmcUserIpmi, i_bmcPasswdIpmi, i_ffdcDir=None, i_platName=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)
self.cv_SYSTEM = OpTestSystem(i_bmcIP, i_bmcUser, i_bmcPasswd,
i_bmcUserIpmi, i_bmcPasswdIpmi, i_ffdcDir, i_hostip,
i_hostuser, i_hostPasswd)
self.cv_PLATFORM = i_platName
self.util = OpTestUtil()
示例5: OpTestDropbearSafety
class OpTestDropbearSafety():
## 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)
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 function will tests Dropbear running functionality in skiroot
# 1. Power Off the system
# 2. Power on the system
# 3. Exit to the petitboot shell
# 4. Execute ps command
# 5. test will fail incase dropbear is running and listed out by ps
# 6. At the end of test reboot the system to OS.
#
# @return BMC_CONST.FW_SUCCESS or raise OpTestError
#
def test_dropbear_running(self):
self.cv_SYSTEM.sys_bmc_power_on_validate_host()
print "Test Dropbear running in Petitboot"
print "Performing IPMI Power Off Operation"
self.console = self.cv_SYSTEM.sys_get_ipmi_console()
self.cv_SYSTEM.sys_ipmi_boot_system_to_petitboot(self.console)
self.cv_IPMI.ipmi_host_set_unique_prompt(self.console)
self.cv_IPMI.run_host_cmd_on_ipmi_console("uname -a")
# we don't grep for 'dropbear' so that our naive line.count
# below doesn't hit a false positive.
res = self.cv_IPMI.run_host_cmd_on_ipmi_console("ps|grep drop")
print res
self.cv_IPMI.ipmi_set_boot_to_disk()
for line in res:
if line.count('dropbear'):
raise OpTestError("drobear is running in the skiroot")
return BMC_CONST.FW_SUCCESS
示例6: __init__
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.opTestHMIHandling = OpTestHMIHandling(i_bmcIP, i_bmcUser, i_bmcPasswd,
i_bmcUserIpmi, i_bmcPasswdIpmi, i_ffdcDir, i_hostIP,
i_hostUser, i_hostPasswd)
示例7: OpTestHMIHandling
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']]]
#.........这里部分代码省略.........
示例8: OpTestPrdDriver
class OpTestPrdDriver():
## 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)
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 function performs below steps
# 1. Initially connecting to host and ipmi consoles for execution.
# 2. check for IPOLL mask register value to see whether opal-prd is running or not
# if it is 0-->opal-prd is running-->continue
# else start opal-prd service again
# 3. call test_prd_for_fir() function for each core FIR error and this function
# can be used for any number of errors, like it is a generic function
#
# @return BMC_CONST.FW_SUCCESS or raise OpTestError
#
def testPrdDriver(self):
self.cv_SYSTEM.sys_bmc_power_on_validate_host()
self.test_init()
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("cd %s/external/xscom-utils/;" % BMC_CONST.CLONE_SKIBOOT_DIR)
# check for IPOLL mask register value to check opal-prd is running or not
l_cmd = "./getscom -c 0x0 %s" % 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 is running"
else:
self.cv_IPMI.run_host_cmd_on_ipmi_console("service opal-prd start")
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 is running"
else:
l_msg = "IPOLL MASK REGISTER is not getting cleared by opal-prd"
raise OpTestError(l_msg)
# test for PBA FIR with different core errors
# 1.PBAFIR_OCI_APAR_ERR-->OCI Address Parity Error
print "PRD: Test for PBAFIR_OCI_APAR_ERR-->OCI Address Parity Error"
self.test_prd_for_fir(BMC_CONST.PBA_FAULT_ISOLATION_REGISTER,
BMC_CONST.PBA_FAULT_ISOLATION_MASK_REGISTER,
BMC_CONST.PBAFIR_OCI_APAR_ERR)
# 2.PBAFIR_PB_CE_FW-->PB Read Data CE Error for Forwarded Request
print "PRD: Test for PBAFIR_PB_CE_FW-->PB Read Data CE Error for Forwarded Request"
self.test_prd_for_fir(BMC_CONST.PBA_FAULT_ISOLATION_REGISTER,
BMC_CONST.PBA_FAULT_ISOLATION_MASK_REGISTER,
BMC_CONST.PBAFIR_PB_CE_FW)
# 3.PBAFIR_PB_RDDATATO_FW-->PB Read Data Timeout for Forwarded Request
print "PRD: Test for PBAFIR_PB_RDDATATO_FW-->PB Read Data Timeout for Forwarded Request"
self.test_prd_for_fir(BMC_CONST.PBA_FAULT_ISOLATION_REGISTER,
BMC_CONST.PBA_FAULT_ISOLATION_MASK_REGISTER,
BMC_CONST.PBAFIR_PB_RDDATATO_FW)
# 4.PBAFIR_PB_RDADRERR_FW-->PB CRESP Addr Error Received for Forwarded Read Request
print "PRD: Test for PBAFIR_PB_RDADRERR_FW-->PB CRESP Addr Error Received for Forwarded Read Request"
self.test_prd_for_fir(BMC_CONST.PBA_FAULT_ISOLATION_REGISTER,
BMC_CONST.PBA_FAULT_ISOLATION_MASK_REGISTER,
BMC_CONST.PBAFIR_PB_RDADRERR_FW)
return BMC_CONST.FW_SUCCESS
##
# @brief This function injects some core FIR errors and verifies whether opal-prd clears the errors.
# and also this function injects errors on random chip.
#
# @param FIR @type str: Local Fault Isolation register
# @param FIMR @type str: Local Fault Isolation mask register
# @param ERROR @type int: Core FIR error, this error will be written to FIR.
#
# @return BMC_CONST.FW_SUCCESS or raise OpTestError
#
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)
#.........这里部分代码省略.........
示例9: OpTestOOBIPMI
class OpTestOOBIPMI():
## 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)
self.cv_HOST = OpTestHost(i_hostip, i_hostuser, i_hostPasswd, i_bmcIP)
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 It will execute and test all Out-of-band ipmi commands.
# bmc, channel, chassis, dcmi, echo, event, exec, firewall, fru, lan
# mc, pef, power, raw, sdr, sel, sensor, session, user
#
# @return l_res @type list: output of command or raise OpTestError
#
def test_oob_ipmi(self):
self.cv_SYSTEM.sys_bmc_power_on_validate_host()
# Get OS level
l_oslevel = self.cv_HOST.host_get_OS_Level()
# Get kernel version
l_kernel = self.cv_HOST.host_get_kernel_version()
# Checking for ipmitool command and lm_sensors package
self.cv_HOST.host_check_command("ipmitool")
l_pkg = self.cv_HOST.host_check_pkg_for_utility(l_oslevel, "ipmitool")
print "Installed package: %s" % l_pkg
# loading below ipmi modules based on config option
# ipmi_devintf, ipmi_powernv and ipmi_masghandler
self.cv_HOST.host_load_module_based_on_config(l_kernel, BMC_CONST.CONFIG_IPMI_DEVICE_INTERFACE,
BMC_CONST.IPMI_DEV_INTF)
self.cv_HOST.host_load_module_based_on_config(l_kernel, BMC_CONST.CONFIG_IPMI_POWERNV,
BMC_CONST.IPMI_POWERNV)
self.cv_HOST.host_load_module_based_on_config(l_kernel, BMC_CONST.CONFIG_IPMI_HANDLER,
BMC_CONST.IPMI_MSG_HANDLER)
test_cases = [self.test_chassis, self.test_chassisIdentifytests,
self.test_chassisBootdev, self.test_Info, self.test_sdr_list_by_type,
self.test_sdr_elist_by_type, self.test_sdr_type_list, self.test_sdr_get_id,
self.test_fru_print, self.test_fru_read, self.test_mc,
self.test_sensor_list, self.test_sensor_get_host_status,
self.test_sensor_get_os_boot, self.test_sel_info, self.test_sel_list,
self.test_sel_elist, self.test_set_sel_time,
self.test_sel_time_get, self.test_sel_list_first_3_entries,
self.test_sel_list_last_3_entries, self.test_sel_get_functionality,
self.test_sel_clear_functionality, self.test_channel,
self.test_dcmi, self.test_echo, self.test_event,
self.test_firewall, self.test_pef, self.test_raw,
self.test_exec, self.test_bmc_golden_side_version,
self.test_get_pnor_partition_size_cmd,
self.test_bmc_boot_completed_cmd,
self.test_get_led_state_cmd, self.test_set_led_state_cmd]
fail_count = 0
for test in test_cases:
try:
print "OOB IPMI: test case %s" % test
test(self)
except:
print "Test Fail: %s failed" % test
fail_count += 1
print sys.exc_info()
continue
print "OOB IPMI: Test case failure count %s" % fail_count
print self.cv_IPMI.ipmi_get_bmc_golden_side_version()
print self.cv_IPMI.ipmi_get_pnor_partition_size("NVRAM")
print self.cv_IPMI.ipmi_get_pnor_partition_size("GUARD")
print self.cv_IPMI.ipmi_get_pnor_partition_size("BOOTKERNEL")
print self.cv_IPMI.ipmi_get_bmc_boot_completion_status()
print self.cv_IPMI.ipmi_get_fault_led_state()
print self.cv_IPMI.ipmi_get_power_on_led_state()
print self.cv_IPMI.ipmi_get_host_status_led_state()
print self.cv_IPMI.ipmi_get_chassis_identify_led_state()
self.cv_IPMI.ipmi_enable_fan_control_task_command()
self.cv_IPMI.ipmi_get_fan_control_task_state_command()
self.cv_IPMI.ipmi_disable_fan_control_task_command()
self.cv_IPMI.ipmi_get_fan_control_task_state_command()
#.........这里部分代码省略.........
示例10: OpTestNVRAM
class OpTestNVRAM():
## 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)
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 function tests nvram partition access, print/update
# the config data and dumping the partition's data. All
# these operations are done on supported partitions in both
# host OS and Petitboot.
#
# @return BMC_CONST.FW_SUCCESS or BMC_CONST.FW_FAILED
#
def test_nvram_configuration(self):
# Execute these tests in host OS
self.cv_SYSTEM.sys_bmc_power_on_validate_host()
self.cv_HOST.host_run_command("uname -a")
self.cv_HOST.host_run_command("cat /etc/os-release")
self.cv_HOST.host_run_command("nvram -v")
self.cv_HOST.host_run_command("nvram --print-config -p ibm,skiboot")
self.cv_HOST.host_run_command("nvram --print-config -p common")
self.cv_HOST.host_run_command("nvram --print-config -p lnx,oops-log")
self.cv_HOST.host_run_command("nvram --print-config -p wwwwwwwwwwww")
self.cv_HOST.host_run_command("nvram --print-vpd")
self.cv_HOST.host_run_command("nvram --print-all-vpd")
self.cv_HOST.host_run_command("nvram --print-err-log")
self.cv_HOST.host_run_command("nvram --print-event-scan")
self.cv_HOST.host_run_command("nvram --partitions")
self.cv_HOST.host_run_command("nvram --dump common")
self.cv_HOST.host_run_command("nvram --dump ibm,skiboot")
self.cv_HOST.host_run_command("nvram --dump lnx,oops-log")
self.cv_HOST.host_run_command("nvram --dump wwwwwwwwwwww")
self.cv_HOST.host_run_command("nvram --ascii common")
self.cv_HOST.host_run_command("nvram --ascii ibm,skiboot")
self.cv_HOST.host_run_command("nvram --ascii lnx,oops-log")
self.cv_HOST.host_run_command("nvram --ascii wwwwwwwwwwww")
try:
self.test_nvram_update_part_config_in_host("common")
self.test_nvram_update_part_config_in_host("ibm,skiboot")
self.test_nvram_update_part_config_in_host("lnx,oops-log")
self.test_nvram_update_part_config_in_host("wwwwwwwwwwww")
except OpTestError:
print "There is a failure in updating one of NVRAM partitions"
# Execute these tests in petitboot
self.console = self.cv_SYSTEM.sys_get_ipmi_console()
try:
self.cv_SYSTEM.sys_ipmi_boot_system_to_petitboot(self.console)
self.cv_IPMI.ipmi_host_set_unique_prompt(self.console)
self.cv_IPMI.run_host_cmd_on_ipmi_console("uname -a")
self.cv_IPMI.run_host_cmd_on_ipmi_console("cat /etc/os-release")
self.cv_IPMI.run_host_cmd_on_ipmi_console("nvram -v")
self.cv_IPMI.run_host_cmd_on_ipmi_console("nvram --print-config -p ibm,skiboot")
self.cv_IPMI.run_host_cmd_on_ipmi_console("nvram --print-config -p common")
self.cv_IPMI.run_host_cmd_on_ipmi_console("nvram --print-config -p lnx,oops-log")
self.cv_IPMI.run_host_cmd_on_ipmi_console("nvram --print-config -p wwwwwwwwwwww")
self.cv_IPMI.run_host_cmd_on_ipmi_console("nvram --print-vpd")
self.cv_IPMI.run_host_cmd_on_ipmi_console("nvram --print-all-vpd")
self.cv_IPMI.run_host_cmd_on_ipmi_console("nvram --print-err-log")
self.cv_IPMI.run_host_cmd_on_ipmi_console("nvram --print-event-scan")
self.cv_IPMI.run_host_cmd_on_ipmi_console("nvram --partitions")
self.cv_IPMI.run_host_cmd_on_ipmi_console("nvram --dump common")
self.cv_IPMI.run_host_cmd_on_ipmi_console("nvram --dump ibm,skiboot")
self.cv_IPMI.run_host_cmd_on_ipmi_console("nvram --dump lnx,oops-log")
self.cv_IPMI.run_host_cmd_on_ipmi_console("nvram --dump wwwwwwwwwwww")
self.cv_IPMI.run_host_cmd_on_ipmi_console("nvram --ascii common")
self.cv_IPMI.run_host_cmd_on_ipmi_console("nvram --ascii ibm,skiboot")
self.cv_IPMI.run_host_cmd_on_ipmi_console("nvram --ascii lnx,oops-log")
self.cv_IPMI.run_host_cmd_on_ipmi_console("nvram --ascii wwwwwwwwwwww")
try:
self.test_nvram_update_part_config_in_petitboot("common")
self.test_nvram_update_part_config_in_petitboot("ibm,skiboot")
self.test_nvram_update_part_config_in_petitboot("lnx,oops-log")
self.test_nvram_update_part_config_in_petitboot("wwwwwwwwwwww")
except OpTestError:
print "There is a failure in updating one of NVRAM partitions"
except:
self.cv_IPMI.ipmi_set_boot_to_disk()
self.cv_IPMI.ipmi_set_boot_to_disk()
#.........这里部分代码省略.........
示例11: objs
def objs(self):
if self.args.list_suites or self.args.list_tests:
return
# check to see if bmc_ip even pings to validate configuration parms
try:
self.util.PingFunc(self.args.bmc_ip, totalSleepTime=BMC_CONST.PING_RETRY_FOR_STABILITY)
except Exception as e:
# we are trying to catch sooner rather than later
# if we have reservations that need cleaned up
# otherwise we would have to try/except for cleanup
# in lots of places
# testcases.HelloWorld in CI fails if we throw this
# raise only if we have reservations to cleanup
if self.args.hostlocker is not None \
or self.args.aes is not None \
or self.args.aes_search_args is not None:
self.util.cleanup()
raise ParameterCheck(message="OpTestSystem PingFunc fails to "
"ping '{}', check your configuration and setup, see "
"Exception details: {}".format(self.args.bmc_ip, e))
try:
host = common.OpTestHost.OpTestHost(self.args.host_ip,
self.args.host_user,
self.args.host_password,
self.args.bmc_ip,
self.output,
scratch_disk=self.args.host_scratch_disk,
proxy=self.args.proxy,
check_ssh_keys=self.args.check_ssh_keys,
known_hosts_file=self.args.known_hosts_file,
conf=self)
if self.args.bmc_type in ['AMI', 'SMC']:
web = OpTestWeb(self.args.bmc_ip,
self.args.bmc_usernameipmi,
self.args.bmc_passwordipmi)
bmc = None
if self.args.bmc_type in ['AMI']:
ipmi = OpTestIPMI(self.args.bmc_ip,
self.args.bmc_usernameipmi,
self.args.bmc_passwordipmi,
host=host,
logfile=self.logfile,
)
bmc = OpTestBMC(ip=self.args.bmc_ip,
username=self.args.bmc_username,
password=self.args.bmc_password,
logfile=self.logfile,
ipmi=ipmi,
web=web,
check_ssh_keys=self.args.check_ssh_keys,
known_hosts_file=self.args.known_hosts_file
)
elif self.args.bmc_type in ['SMC']:
ipmi = OpTestSMCIPMI(self.args.bmc_ip,
self.args.bmc_usernameipmi,
self.args.bmc_passwordipmi,
logfile=self.logfile,
host=host,
)
bmc = OpTestSMC(ip=self.args.bmc_ip,
username=self.args.bmc_username,
password=self.args.bmc_password,
ipmi=ipmi,
web=web,
check_ssh_keys=self.args.check_ssh_keys,
known_hosts_file=self.args.known_hosts_file
)
self.op_system = common.OpTestSystem.OpTestSystem(
state=self.startState,
bmc=bmc,
host=host,
conf=self,
)
ipmi.set_system(self.op_system)
bmc.set_system(self.op_system)
elif self.args.bmc_type in ['FSP']:
ipmi = OpTestIPMI(self.args.bmc_ip,
None, # FSP does not use UID
self.args.bmc_passwordipmi,
host=host,
logfile=self.logfile)
bmc = OpTestFSP(self.args.bmc_ip,
self.args.bmc_username,
self.args.bmc_password,
ipmi=ipmi,
)
self.op_system = common.OpTestSystem.OpTestFSPSystem(
state=self.startState,
bmc=bmc,
host=host,
conf=self,
)
ipmi.set_system(self.op_system)
elif self.args.bmc_type in ['OpenBMC']:
ipmi = OpTestIPMI(self.args.bmc_ip,
self.args.bmc_usernameipmi,
self.args.bmc_passwordipmi,
#.........这里部分代码省略.........
示例12: OpTestMCColdResetEffects
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")
示例13: OpTestOCC
class OpTestOCC():
## 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)
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 function is used to test OCC Reset funtionality in BMC based systems.
# OCC Reset reload is limited to 3 times per full power cycle.
#
# @return BMC_CONST.FW_SUCCESS or raise OpTestError
#
def test_occ_reset_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)
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 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 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, rebooting the system"
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 test OCC Reset funtionality in BMC based systems.
# OCC Reset reload can be done more than 3 times per full power cycle, by
# resetting OCC resetreload count.
#
# @return BMC_CONST.FW_SUCCESS or raise OpTestError
#
def test_occ_reset_n_times(self):
self.cv_SYSTEM.sys_bmc_power_on_validate_host()
#.........这里部分代码省略.........
示例14: OpTestEnergyScale
class OpTestEnergyScale():
## 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_platName=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)
self.cv_SYSTEM = OpTestSystem(i_bmcIP, i_bmcUser, i_bmcPasswd,
i_bmcUserIpmi, i_bmcPasswdIpmi, i_ffdcDir, i_hostip,
i_hostuser, i_hostPasswd)
self.cv_PLATFORM = i_platName
self.util = OpTestUtil()
##
# @brief This function will get and return platform power limits for supported machine
#
# @param i_platform type: str platform name to get the power limits
#
# @return l_power_limit_low lower platform power limit
# l_power_limit_high higher platform power limit
# or raise OpTestError if it is a new platform
#
def get_platform_power_limits(self, i_platform):
l_platform = i_platform
if BMC_CONST.HABANERO in l_platform:
l_power_limit_high = BMC_CONST.HABANERO_POWER_LIMIT_HIGH
l_power_limit_low = BMC_CONST.HABANERO_POWER_LIMIT_LOW
elif BMC_CONST.FIRESTONE in l_platform:
l_power_limit_high = BMC_CONST.FIRESTONE_POWER_LIMIT_HIGH
l_power_limit_low = BMC_CONST.FIRESTONE_POWER_LIMIT_LOW
elif BMC_CONST.GARRISON in l_platform:
l_power_limit_high = BMC_CONST.GARRISON_POWER_LIMIT_HIGH
l_power_limit_low = BMC_CONST.GARRISON_POWER_LIMIT_LOW
else:
l_msg = "New platform, add power limit support to this platform and retry"
raise OpTestError(l_msg)
return l_power_limit_low, l_power_limit_high
##
# @brief This function will test Energy scale features at standby state
# 1. Power OFF the system.
# 2. Validate below Energy scale features at standby 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 standby 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.
# ipmitool dcmi power sensors :Prints the available DCMI sensors.
# ipmitool dcmi get_temp_reading :Get Temperature Sensor Readings.
# 4. Power ON the system.
# 5. Check after system booted to runtime, whether occ's are active or not.
# 6. Again in runtime execute all dcmi commands to check the functionality.
#
# @return BMC_CONST.FW_SUCCESS or BMC_CONST.FW_FAILED
#
def test_energy_scale_at_standby_state(self):
self.cv_SYSTEM.sys_bmc_power_on_validate_host()
print "Energy Scale Test 1: Get, Set, activate and deactivate platform power limit at power off"
l_power_limit_low, l_power_limit_high = self.get_platform_power_limits(self.cv_PLATFORM)
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_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()
#.........这里部分代码省略.........
示例15: OpTestSystemBootSequence
class OpTestSystemBootSequence():
## 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 function will test mc cold reset boot sequence
# 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, Issue a Power ON of the system
# 5. Check for system status and gather OPAL msg log.
#
# @return BMC_CONST.FW_SUCCESS or raise OpTestError
#
def testMcColdResetBootSequence(self):
self.cv_SYSTEM.sys_bmc_power_on_validate_host()
print "Testing MC Cold reset boot sequence"
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)
print "Setting the system power policy to always-off"
self.cv_IPMI.ipmi_set_power_policy("always-off")
# Perform a BMC Cold Reset Operation
self.cv_IPMI.ipmi_cold_reset()
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)
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 mc warm reset boot sequence
# 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 Warm reset.
# 4. After BMC comes up, Issue a Power ON of the system
# 5. Check for system status and gather OPAL msg log.
#
# @return BMC_CONST.FW_SUCCESS or raise OpTestError
#
def testMcWarmResetBootSequence(self):
self.cv_SYSTEM.sys_bmc_power_on_validate_host()
print "Testing MC Warm reset boot sequence"
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)
print "Setting the system power policy to always-off"
self.cv_IPMI.ipmi_set_power_policy("always-off")
# Perform a BMC Warm Reset Operation
self.cv_IPMI.ipmi_warm_reset()
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)
self.cv_IPMI.clear_ssh_keys(self.cv_HOST.ip)
#.........这里部分代码省略.........