1*** Settings ***
2
3Documentation    Module to test IPMI management controller ID functionality.
4Resource         ../lib/ipmi_client.robot
5Resource         ../lib/openbmc_ffdc.robot
6Variables        ../data/ipmi_raw_cmd_table.py
7
8Test Teardown    FFDC On Test Case Fail
9
10
11*** Variables ***
12
13${new_mc_id}=  HOST
14
15
16*** Test Cases ***
17
18Verify Get And Set Management Controller ID String
19    [Documentation]  Verify get and set management controller ID string.
20    [Tags]  Verify_Get_And_Set_Management_Controller_ID_String
21    # Get the value of the managemment controller ID string.
22    # Example:
23    # Get Management Controller Identifier String: witherspoon
24
25    ${cmd_output}=  Wait Until Keyword Succeeds  15 sec  5 sec
26    ...  Run IPMI Standard Command  dcmi get_mc_id_string
27
28    # Extract management controller ID from cmd_output.
29    ${initial_mc_id}=  Fetch From Right  ${cmd_output}  :${SPACE}
30
31    # Set the management controller ID string to other value.
32    # Example:
33    # Set Management Controller Identifier String Command: HOST
34
35    Set Management Controller ID String  ${new_mc_id}
36
37    # Get the management controller ID and verify.
38    Get Management Controller ID String And Verify  ${new_mc_id}
39
40    # Set the value back to the initial value and verify.
41    Set Management Controller ID String  ${initial_mc_id}
42
43    # Get the management controller ID and verify.
44    Get Management Controller ID String And Verify  ${initial_mc_id}
45
46
47Test Management Controller ID String Status via IPMI
48    [Documentation]  Test management controller ID string status via IPMI.
49    [Tags]  Test_Management_Controller_ID_String_Status_via_IPMI
50    # Disable management controller ID string status via IPMI and verify.
51    Run IPMI Standard Command  dcmi set_conf_param dhcp_config 0x00
52    Verify Management Controller ID String Status  disable
53
54    # Enable management controller ID string status via IPMI and verify.
55    Run IPMI Standard Command  dcmi set_conf_param dhcp_config 0x01
56    Verify Management Controller ID String Status  enable
57
58
59Test Management Controller ID String Status via Raw IPMI
60    [Documentation]  Test management controller ID string status via IPMI.
61    [Tags]  Test_Management_Controller_ID_String_Status_via_Raw_IPMI
62    # Disable management controller ID string status via raw IPMI and verify.
63    Run IPMI Standard Command  raw ${IPMI_RAW_CMD['conf_param']['Disabled'][0]}
64    Verify Management Controller ID String Status  disable
65
66    # Enable management controller ID string status via raw IPMI and verify.
67    Run IPMI Standard Command  raw ${IPMI_RAW_CMD['conf_param']['Enabled'][0]}
68    Verify Management Controller ID String Status  enable
69
70
71*** Keywords ***
72
73Set Management Controller ID String
74    [Documentation]  Set the management controller ID string.
75    [Arguments]  ${string}
76
77    # Description of argument(s):
78    # string  Management Controller ID String to be set
79
80    ${set_mc_id_string}=  Run IPMI Standard Command
81    ...  dcmi set_mc_id_string ${string}
82
83
84Get Management Controller ID String And Verify
85    [Documentation]  Get the management controller ID string.
86    [Arguments]  ${string}
87
88    # Description of argument(s):
89    # string  Management Controller ID string
90
91    ${get_mc_id}=  Run IPMI Standard Command  dcmi get_mc_id_string
92    Should Contain  ${get_mc_id}  ${string}
93    ...  msg=Command failed: get_mc_id.
94
95
96Verify Management Controller ID String Status
97    [Documentation]  Verify management controller ID string status via IPMI.
98    [Arguments]  ${status}
99
100    # Example of dcmi get_conf_param command output:
101    # DHCP Discovery method   :
102    #           Management Controller ID String is disabled
103    #           Vendor class identifier DCMI IANA and Vendor class-specific Informationa are disabled
104    #   Initial timeout interval        : 4 seconds
105    #   Server contact timeout interval : 120 seconds
106    #   Server contact retry interval   : 64 seconds
107
108    ${resp}=  Run IPMI Standard Command  dcmi get_conf_param
109    ${resp}=  Get Lines Containing String  ${resp}
110    ...  Management Controller ID String  case_insensitive=True
111    Should Contain  ${resp}  ${status}
112    ...  msg=Management controller ID string is not ${status}
113