1*** Settings ***
2
3Documentation    Module to test dcmi get capabilites functionality.
4Resource         ../../lib/ipmi_client.robot
5
6Force Tags       DCMI_Get_Capabilities
7
8*** Variables ***
9
10@{slave_address_list}  Slave address of device: 0h (8bits)(Satellite/External controller)
11...                    Slave address of device: 20h (BMC)
12
13*** Test Cases ***
14
15Verify Get DCMI Capabilities
16    [Documentation]  Verify get DCMI capabilities command output.
17    [Tags]  Verify_Get_DCMI_Capabilities
18    ${cmd_output}=  Run IPMI Standard Command  dcmi discover
19
20    @{supported_capabilities}=  Create List
21    # Supported DCMI capabilities:
22    ...  Mandatory platform capabilties
23    ...  Optional platform capabilties
24    ...  Power management available
25    ...  Managebility access capabilties
26    ...  In-band KCS channel available
27    # Mandatory platform attributes:
28    ...  200 SEL entries
29    ...  SEL automatic rollover is enabled
30    # Optional Platform Attributes:
31    ...  Channel number is 0h (Primary BMC)
32    ...  Device revision is 0
33    # Manageability Access Attributes:
34    ...  Primary LAN channel number: ${CHANNEL_NUMBER} is available
35    ...  Secondary LAN channel is not available for OOB
36    ...  No serial channel is available
37
38    FOR  ${capability}  IN  @{supported_capabilities}
39      Run Keyword And Continue On Failure  Should Contain  ${cmd_output}  ${capability}  ignore_case=True
40      ...  msg=Supported DCMI capabilities not present.
41    END
42
43    FOR  ${slave_address}  IN  @{slave_address_list}
44      ${slave_address_status}=  Run Keyword And Return Status
45      ...  Should Contain  ${cmd_output}  ${slave_address}  ignore_case=True
46      Exit For Loop IF  ${slave_address_status} == True
47    END
48
49    Run Keyword IF  ${slave_address_status} == False  Fail  msg=Slave address is showing wrongly.
50
51    ${output}=  Get Lines Containing String  ${cmd_output}  Slave address of device:
52    ${slave_address_status_1}=  Run Keyword And Return Status
53    ...  Should Be Equal  ${output.strip()}  ${slave_address_list[1]}  ignore_case=True
54    ${output_1}=  Get Lines Containing String  ${cmd_output}   Channel number is
55    Run Keyword IF  ${slave_address_status_1} == True
56    ...    Should Be Equal  ${output_1.strip()}   ${supported_capabilities[7]}
57    ...  ELSE  Should Match Regexp  ${output.strip()}  [1-9]+h
58