Sweta Potthuri | 24401f3 | 2025-03-02 23:54:37 -0600 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation LLDP(Link Layer Discovery Protocol) Test Suite for configuration |
George Keishing | 6ab4761 | 2025-03-19 22:01:46 +0530 | [diff] [blame] | 3 | ... and verification tests. |
Sweta Potthuri | 24401f3 | 2025-03-02 23:54:37 -0600 | [diff] [blame] | 4 | |
| 5 | Resource ../../lib/bmc_redfish_resource.robot |
| 6 | Resource ../../lib/bmc_network_utils.robot |
| 7 | Resource ../../lib/openbmc_ffdc.robot |
| 8 | |
| 9 | Suite Setup Suite Setup Execution |
George Keishing | 6ab4761 | 2025-03-19 22:01:46 +0530 | [diff] [blame] | 10 | Suite Teardown Redfish.Logout |
Sweta Potthuri | 24401f3 | 2025-03-02 23:54:37 -0600 | [diff] [blame] | 11 | Test Teardown FFDC On Test Case Fail |
| 12 | |
| 13 | Test Tags LLDP_config |
| 14 | |
| 15 | *** Test Cases *** |
| 16 | |
| 17 | Enable LLDP And Verify |
| 18 | [Documentation] Enable LLDP and verify. |
| 19 | [Tags] Enable_LLDP_And_Verify |
| 20 | |
| 21 | # Set the LLDP enabled property as True. |
| 22 | Set LLDP Configuration State ${True} |
| 23 | |
| 24 | # Verify the LLDP state is set true |
| 25 | Verify LLDP Configuration State ${True} |
| 26 | |
kvishal | adf3ba5 | 2025-05-15 02:08:33 -0500 | [diff] [blame^] | 27 | Disable LLDP And Verify |
| 28 | [Documentation] Disable LLDP and verify. |
| 29 | [Tags] Disable_LLDP_And_Verify |
| 30 | |
| 31 | # Set the LLDP enabled property as False. |
| 32 | Set LLDP Configuration State ${False} |
| 33 | |
| 34 | # Verify the LLDP state is set False |
| 35 | Verify LLDP Configuration State ${False} |
| 36 | |
Sweta Potthuri | 24401f3 | 2025-03-02 23:54:37 -0600 | [diff] [blame] | 37 | *** Keywords *** |
| 38 | |
| 39 | Suite Setup Execution |
| 40 | [Documentation] Do suite setup execution. |
| 41 | |
| 42 | ${active_channel_config}= Get Active Channel Config |
| 43 | ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']} |
| 44 | Set Suite variable ${ethernet_interface} |
| 45 | |
| 46 | Redfish.Login |
| 47 | ${initial_lldp_config}= Get Initial LLDP Configuration |
| 48 | Set Suite Variable ${initial_lldp_config} |
| 49 | |
| 50 | Set LLDP Configuration State |
| 51 | [Documentation] Set LLDP configuration state. |
| 52 | [Arguments] ${lldp_state} |
| 53 | |
| 54 | # Description of argument(s): |
| 55 | # lldp_state LLDP state('True' or 'False'). |
| 56 | |
| 57 | Redfish.Patch ${REDFISH_LLDP_ETH_IFACE}${ethernet_interface} body={'Ethernet':{'LLDPEnabled': ${lldp_state}}} |
| 58 | ... valid_status_codes=[${HTTP_OK}, ${HTTP_NO_CONTENT}] |
| 59 | |
| 60 | Get Initial LLDP Configuration |
| 61 | [Documentation] Get initial LLDP configuration. |
| 62 | |
| 63 | ${resp}= Redfish.Get ${REDFISH_LLDP_ETH_IFACE}${ethernet_interface} |
| 64 | |
| 65 | ${lldp_state}= Get From Dictionary ${resp.dict} Ethernet |
| 66 | RETURN ${lldp_state} |
| 67 | |
| 68 | Verify LLDP Configuration State |
| 69 | [Documentation] Verify LLDP configuration state. |
| 70 | [Arguments] ${lldp_state} |
| 71 | |
| 72 | # Description of argument(s): |
| 73 | # lldp_state LLDP state set('True' or 'False'). |
| 74 | |
| 75 | ${resp}= Redfish.Get ${REDFISH_LLDP_ETH_IFACE}${ethernet_interface} |
| 76 | ${lldp_state_expected}= Get From Dictionary ${resp.dict} Ethernet |
| 77 | |
George Keishing | e6e161e | 2025-05-08 10:18:30 +0530 | [diff] [blame] | 78 | IF '${lldp_state}' != '${lldp_state_expected['LLDPEnabled']}' |
| 79 | Fail msg=LLDP value is not set correctly. |
| 80 | END |