本文整理汇总了Python中common.OpTestIPMI.OpTestIPMI.ipmi_get_host_status_led_state方法的典型用法代码示例。如果您正苦于以下问题:Python OpTestIPMI.ipmi_get_host_status_led_state方法的具体用法?Python OpTestIPMI.ipmi_get_host_status_led_state怎么用?Python OpTestIPMI.ipmi_get_host_status_led_state使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common.OpTestIPMI.OpTestIPMI
的用法示例。
在下文中一共展示了OpTestIPMI.ipmi_get_host_status_led_state方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: OpTestOOBIPMI
# 需要导入模块: from common.OpTestIPMI import OpTestIPMI [as 别名]
# 或者: from common.OpTestIPMI.OpTestIPMI import ipmi_get_host_status_led_state [as 别名]
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()
#.........这里部分代码省略.........