当前位置: 首页>>代码示例>>Python>>正文


Python OpTestIPMI.ipmi_sdr_clear方法代码示例

本文整理汇总了Python中common.OpTestIPMI.OpTestIPMI.ipmi_sdr_clear方法的典型用法代码示例。如果您正苦于以下问题:Python OpTestIPMI.ipmi_sdr_clear方法的具体用法?Python OpTestIPMI.ipmi_sdr_clear怎么用?Python OpTestIPMI.ipmi_sdr_clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在common.OpTestIPMI.OpTestIPMI的用法示例。


在下文中一共展示了OpTestIPMI.ipmi_sdr_clear方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: OpTestIPMILockMode

# 需要导入模块: from common.OpTestIPMI import OpTestIPMI [as 别名]
# 或者: from common.OpTestIPMI.OpTestIPMI import ipmi_sdr_clear [as 别名]

#.........这里部分代码省略.........
        l_res = self.cv_IPMI.run_lpar_cmd_on_ipmi_console(BMC_CONST.LPAR_GET_MESSAGE_FLAGS)
        if l_res[-1] != "0":
            l_msg = "IPMI: Get Message Flags command failed"
            raise OpTestError(l_msg)

        # 15. [App] Get BT Capabilities
        print "Testing Get BT Capabilities"
        l_res = self.cv_IPMI.run_lpar_cmd_on_ipmi_console(BMC_CONST.LPAR_GET_BT_CAPABILITIES)
        if l_res[-1] != "0":
            l_msg = "IPMI: Get BT Capabilities command failed"
            raise OpTestError(l_msg)

        # 16. [App] Clear Message Flags
        print "Testing Clear Message Flags"
        l_res = self.cv_IPMI.run_lpar_cmd_on_ipmi_console(BMC_CONST.LPAR_CLEAR_MESSAGE_FLAGS)
        if l_res[-1] != "0":
            l_msg = "IPMI: Clear Message Flags command failed"
            raise OpTestError(l_msg)

        # 17. [OEM] PNOR Access Status
        print "Testing the PNOR Access Status"
        l_res = self.cv_IPMI.run_lpar_cmd_on_ipmi_console(BMC_CONST.LPAR_PNOR_ACCESS_STATUS_DENY)
        if l_res[-1] != "0":
            l_msg = "IPMI: PNOR Access Status:deny command failed"
            raise OpTestError(l_msg)
        l_res = self.cv_IPMI.run_lpar_cmd_on_ipmi_console(BMC_CONST.LPAR_PNOR_ACCESS_STATUS_GRANT)
        if l_res[-1] != "0":
            l_msg = "IPMI: PNOR Access Status:grant command failed"
            raise OpTestError(l_msg)

        # 18. [Storage] Add SEL Entry
        print "Testing Add SEL Entry"
        print "Clearing the SEL list"
        self.cv_IPMI.ipmi_sdr_clear()
        l_res = self.cv_IPMI.run_lpar_cmd_on_ipmi_console(BMC_CONST.LPAR_ADD_SEL_ENTRY)
        if l_res[-1] != "0":
            l_msg = "IPMI: Add SEL Entry command failed"
            raise OpTestError(l_msg)
        l_res = self.cv_IPMI.ipmitool_execute_command(BMC_CONST.IPMI_LIST_LAST_SEL_EVENT)
        print "Checking for Reserved entry creation in SEL"
        if "Reserved" not in l_res:
            l_msg = "IPMI: Add SEL Entry command, doesn't create an SEL event"
            raise OpTestError(l_msg)

        # 19. [App] Set Power State
        print "Testing Set Power State"
        l_res = self.cv_IPMI.run_lpar_cmd_on_ipmi_console(BMC_CONST.LPAR_SET_ACPI_POWER_STATE)
        if l_res[-1] != "0":
            l_msg = "IPMI: Set Power State command failed"
            raise OpTestError(l_msg)

        # 20. [App] Set watchdog
        print "Testing Set watchdog"
        l_res = self.cv_IPMI.run_lpar_cmd_on_ipmi_console(BMC_CONST.LPAR_SET_WATCHDOG)
        if l_res[-1] != "0":
            l_msg = "IPMI: Set watchdog command failed"
            raise OpTestError(l_msg)
        self.cv_IPMI.ipmitool_execute_command(BMC_CONST.IPMI_MC_WATCHDOG_GET)

        # 21. [Sensor/Event] Get Sensor Type
        print "Testing Get Sensor Type"
        l_res = self.cv_IPMI.ipmitool_execute_command(BMC_CONST.IPMI_SDR_GET_WATCHDOG)
        matchObj = re.search( "Watchdog \((0x\d{1,})\)", l_res)
        if matchObj:
            print "Got sensor Id for watchdog: %s" % matchObj.group(1)
        else:
开发者ID:PavamanSubramaniyam,项目名称:op-test-framework,代码行数:70,代码来源:OpTestIPMILockMode.py

示例2: OpTestOOBIPMI

# 需要导入模块: from common.OpTestIPMI import OpTestIPMI [as 别名]
# 或者: from common.OpTestIPMI.OpTestIPMI import ipmi_sdr_clear [as 别名]

#.........这里部分代码省略.........
        self.cv_IPMI.ipmi_set_led_state("0x00", "0x0")
        self.cv_IPMI.ipmi_get_fault_led_state()
        self.cv_IPMI.ipmi_set_led_state("0x00", "0x1")
        self.cv_IPMI.ipmi_get_fault_led_state()
        self.cv_IPMI.ipmi_set_led_state("0x00", "0x2")
        self.cv_IPMI.ipmi_get_fault_led_state()
        self.cv_IPMI.ipmi_set_led_state("0x00", "0x3")
        self.cv_IPMI.ipmi_get_fault_led_state()
        self.cv_IPMI.ipmi_set_led_state("0x01", "0x0")
        self.cv_IPMI.ipmi_get_power_on_led_state()
        self.cv_IPMI.ipmi_set_led_state("0x01", "0x1")
        self.cv_IPMI.ipmi_get_power_on_led_state()
        self.cv_IPMI.ipmi_set_led_state("0x01", "0x2")
        self.cv_IPMI.ipmi_get_power_on_led_state()
        self.cv_IPMI.ipmi_set_led_state("0x01", "0x3")
        self.cv_IPMI.ipmi_get_power_on_led_state()

    ##
    # @brief Step 1: Stop Fan Control Thread:
    #           ipmitool -I lanplus -U admin -P admin -H <BMC IP> raw 0x3a 0x12 0x00
    #        Step 2: Fan Control STOPPED OEM SEL created
    #           ipmitool -I lanplus -U admin -P admin -H <BMC IP> sel list |grep OEM
    #           7b | 04/20/2015 | 03:03:14 | OEM record c0 | 000000 | 3a1100ffffff
    #        Step 3: #Run IsFanRunning OEM Command
    #           ipmitool -I lanplus -U admin -P admin -H <BMC IP> raw 0x3a 0x13
    #           00
    #
    # @return return BMC_CONST.FW_SUCCESS or raise OpTestError
    #
    @staticmethod
    def test_fan_control_algorithm_1(self):
        print "OOB IPMI: Testing Fan control disable functionality"
        self.cv_IPMI.ipmi_enable_fan_control_task_command()
        self.cv_IPMI.ipmi_sdr_clear()
        l_state = self.cv_IPMI.ipmi_get_fan_control_task_state_command()
        if str(BMC_CONST.IPMI_FAN_CONTROL_THREAD_RUNNING) in l_state:
            self.cv_IPMI.ipmi_disable_fan_control_task_command()
            l_state = self.cv_IPMI.ipmi_get_fan_control_task_state_command()
            if str(BMC_CONST.IPMI_FAN_CONTROL_THREAD_NOT_RUNNING) in l_state:
                l_output = self.cv_IPMI.ipmi_get_sel_list()
                print l_output
                if "OEM" in l_output:
                    print "IPMI: Disabling of fan control creates an OEM SEL event"
                    return BMC_CONST.FW_SUCCESS
                else:
                    l_msg = "IPMI: Disabling of fan control doesn't create an OEM SEL event"
                    raise OpTestError(l_msg)
            else:
                l_msg = "IPMI: Fan control thread still running, disable failed"
                raise OpTestError(l_msg)
        else:
            l_msg = "IPMI: Fan control thread still in not running state, enable failed"
            raise OpTestError(l_msg)

    ##
    # @brief Step 1: Start Fan Control Thread:
    #           ipmitool -I lanplus -U admin -P admin -H <BMC IP> raw 0x3a 0x12 0x01
    #        Step 2: Fan Control STOPPED OEM SEL created
    #           ipmitool -I lanplus -U admin -P admin -H <BMC IP> sel list |grep OEM
    #           7b | 04/20/2015 | 03:03:14 | OEM record c0 | 000000 | 3a1100ffffff
    #        Step 3: #Run IsFanRunning OEM Command
    #           ipmitool -I lanplus -U admin -P admin -H <BMC IP> raw 0x3a 0x13
    #           01
    #
    # @return return BMC_CONST.FW_SUCCESS or raise OpTestError
    #
开发者ID:open-power,项目名称:op-test-framework,代码行数:70,代码来源:OpTestOOBIPMI.py

示例3: OpTestEnergyScale

# 需要导入模块: from common.OpTestIPMI import OpTestIPMI [as 别名]
# 或者: from common.OpTestIPMI.OpTestIPMI import ipmi_sdr_clear [as 别名]
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()
#.........这里部分代码省略.........
开发者ID:open-power,项目名称:op-test-framework,代码行数:103,代码来源:OpTestEnergyScale.py


注:本文中的common.OpTestIPMI.OpTestIPMI.ipmi_sdr_clear方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。