blob: b554dae68f22930f1c03c643bec04affb23d03cb [file] [log] [blame]
Sweta Potthuri24401f32025-03-02 23:54:37 -06001*** Settings ***
2Documentation LLDP(Link Layer Discovery Protocol) Test Suite for configuration
George Keishing6ab47612025-03-19 22:01:46 +05303 ... and verification tests.
Sweta Potthuri24401f32025-03-02 23:54:37 -06004
5Resource ../../lib/bmc_redfish_resource.robot
6Resource ../../lib/bmc_network_utils.robot
7Resource ../../lib/openbmc_ffdc.robot
8
9Suite Setup Suite Setup Execution
George Keishing6ab47612025-03-19 22:01:46 +053010Suite Teardown Redfish.Logout
Sweta Potthuri24401f32025-03-02 23:54:37 -060011Test Teardown FFDC On Test Case Fail
12
13Test Tags LLDP_config
14
15*** Test Cases ***
16
17Enable 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
kvishaladf3ba52025-05-15 02:08:33 -050027Disable 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 Potthuri24401f32025-03-02 23:54:37 -060037*** Keywords ***
38
39Suite 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
50Set 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
60Get 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
68Verify 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 Keishinge6e161e2025-05-08 10:18:30 +053078 IF '${lldp_state}' != '${lldp_state_expected['LLDPEnabled']}'
79 Fail msg=LLDP value is not set correctly.
80 END