blob: 8bb1d4a41b9f12f12114eeacb66182a4926b4ec8 [file] [log] [blame]
Prashanth Kattif58cce02019-02-06 03:05:14 -06001*** Settings ***
2Documentation Network interface configuration and verification
3 ... tests.
4
George Keishing5d467552019-02-08 23:30:48 -06005Resource ../../lib/bmc_redfish_resource.robot
6Resource ../../lib/bmc_network_utils.robot
7Resource ../../lib/openbmc_ffdc.robot
Prashanth Kattif58cce02019-02-06 03:05:14 -06008
9Test Setup Test Setup Execution
10Test Teardown Test Teardown Execution
11
12*** Test Cases ***
13
14Get IP Address And Verify
15 [Documentation] Get IP Address And Verify.
George Keishing5d467552019-02-08 23:30:48 -060016 [Tags] Get_IP_Address_And_Verify
Prashanth Kattif58cce02019-02-06 03:05:14 -060017
18 : FOR ${network_configuration} IN @{network_configurations}
19 \ Validate IP On BMC ${network_configuration['Address']}
20
21Get Netmask And Verify
22 [Documentation] Get Netmask And Verify.
George Keishing5d467552019-02-08 23:30:48 -060023 [Tags] Get_Netmask_And_Verify
Prashanth Kattif58cce02019-02-06 03:05:14 -060024
25 : FOR ${network_configuration} IN @{network_configurations}
26 \ Validate Netmask On BMC ${network_configuration['SubnetMask']}
27
28*** Keywords ***
29
30Test Setup Execution
31 [Documentation] Test setup execution.
32
33 redfish.Login
34
35 @{network_configurations}= Get Network Configuration
36 Set Test Variable @{network_configurations}
37
38 # Get BMC IP address and prefix length.
39 ${ip_data}= Get BMC IP Info
40 Set Test Variable ${ip_data}
41
42Get Network Configuration
43 [Documentation] Get network configuration.
44
45 # Sample output:
46 #{
47 # "@odata.context": "/redfish/v1/$metadata#EthernetInterface.EthernetInterface",
48 # "@odata.id": "/redfish/v1/Managers/bmc/EthernetInterfaces/eth0",
49 # "@odata.type": "#EthernetInterface.v1_2_0.EthernetInterface",
50 # "Description": "Management Network Interface",
51 # "IPv4Addresses": [
52 # {
53 # "Address": "169.254.xx.xx",
54 # "AddressOrigin": "IPv4LinkLocal",
55 # "Gateway": "0.0.0.0",
56 # "SubnetMask": "255.255.0.0"
57 # },
58 # {
59 # "Address": "xx.xx.xx.xx",
60 # "AddressOrigin": "Static",
61 # "Gateway": "xx.xx.xx.1",
62 # "SubnetMask": "xx.xx.xx.xx"
63 # }
64 # ],
65 # "Id": "eth0",
66 # "MACAddress": "xx:xx:xx:xx:xx:xx",
67 # "Name": "Manager Ethernet Interface",
68 # "SpeedMbps": 0,
69 # "VLAN": {
70 # "VLANEnable": false,
71 # "VLANId": 0
72 # }
73
74 ${resp}= redfish.Get ${REDFISH_NW_ETH0_URI}
75 @{network_configurations}= Get From Dictionary ${resp.dict} IPv4Addresses
76 [Return] @{network_configurations}
77
George Keishing5d467552019-02-08 23:30:48 -060078
Prashanth Kattif58cce02019-02-06 03:05:14 -060079Validate IP On BMC
80 [Documentation] Validate IP on BMC.
81 [Arguments] ${ip}
82
83 # Description of the argument(s):
84 # ip IP address to be verified.
85
86 # Get IP address details on BMC using IP command.
87 @{ip_data}= Get BMC IP Info
88 Should Contain Match ${ip_data} ${ip}/*
89 ... msg=IP address does not exist.
90
George Keishing5d467552019-02-08 23:30:48 -060091
Prashanth Kattif58cce02019-02-06 03:05:14 -060092Validate Netmask On BMC
93 [Documentation] Validate netmask on BMC.
94 [Arguments] ${netmask}
95
96 # Description of the argument(s):
97 # netmask netmask value to be verified.
98
99 # TBD- openbmc/openbmc-test-automation#1541
100
George Keishing5d467552019-02-08 23:30:48 -0600101
Prashanth Kattif58cce02019-02-06 03:05:14 -0600102Test Teardown Execution
103 [Documentation] Test teardown execution.
104
105 FFDC On Test Case Fail
106 redfish.Logout