blob: 32501a89d44742afe0893431467685f8235868d3 [file] [log] [blame]
Vijay06a169d2020-04-23 09:28:24 -05001*** Settings ***
2
Megha GN80ef5ca2022-06-09 00:29:57 -05003Documentation VMI static/dynamic IP config tests.
Vijay06a169d2020-04-23 09:28:24 -05004
Megha GN80ef5ca2022-06-09 00:29:57 -05005Resource ../../lib/external_intf/vmi_utils.robot
Vijay06a169d2020-04-23 09:28:24 -05006
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -05007Suite Setup Suite Setup Execution
Vijay06a169d2020-04-23 09:28:24 -05008Test Teardown FFDC On Test Case Fail
George Keishing4e0978d2022-07-27 10:21:18 -05009Suite Teardown Run Keyword And Ignore Error Suite Teardown Execution
Vijay06a169d2020-04-23 09:28:24 -050010
Megha G Nf9867142025-02-03 23:10:57 -060011Test Tags Vmi
George Keishing725e0662022-07-20 22:18:14 -050012
Vijay06a169d2020-04-23 09:28:24 -050013*** Variables ***
14
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -050015# users User Name password
16@{ADMIN} admin_user TestPwd123
17@{OPERATOR} operator_user TestPwd123
18@{ReadOnly} readonly_user TestPwd123
Megha GN80ef5ca2022-06-09 00:29:57 -050019&{USERS} Administrator=${ADMIN} ReadOnly=${ReadOnly}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -050020
Prashanth Katti1ce68212020-11-13 00:39:03 -060021${test_ipv4} 10.6.6.6
22${test_gateway} 10.6.6.1
shrsuman123c1d3fe32020-09-08 05:04:07 -050023${test_netmask} 255.255.252.0
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -050024
Vijay06a169d2020-04-23 09:28:24 -050025&{DHCP_ENABLED} DHCPEnabled=${${True}}
26&{DHCP_DISABLED} DHCPEnabled=${${False}}
27
28&{ENABLE_DHCP} DHCPv4=&{DHCP_ENABLED}
29&{DISABLE_DHCP} DHCPv4=&{DHCP_DISABLED}
30
Megha G N02cbfa12022-12-12 02:05:03 -060031${default} 0.0.0.0
Megha G Na37b8da2025-01-06 00:23:15 -060032${default_ipv6addr} ::
Sridevi Ramesh70f087b2025-01-26 00:27:05 -060033${prefix_length} ${64}
Megha G N97af3bf2025-02-27 10:32:08 -060034${test_vmi_ipv6addr} 2001:db8:1111:2222:10:5:5:6
Megha G Ne0e055d2025-02-28 02:16:06 -060035${test_vmi_ipv6gateway} 2001:db8:1111:2222::1
Megha G N1361edf2025-03-18 03:09:41 -050036${ipv4_hexword_addr} 10.5.5.6:1A:1B:1C:1D:1E:1F
37${multicast_ipv6addr} FF00
38${loopback_ipv6addr} ::1
Megha G N439f7122025-06-02 02:58:39 -050039${compressed_ipv4} ::10.6.6.5
40${shortform_stand_ipv4} 0:0:0:0:0:0:10.5.5.6
41${standard_ipv4rep} 0000:0000:0000:0000:0000:0000:10.5.5.6
Megha G N02cbfa12022-12-12 02:05:03 -060042
Vijay06a169d2020-04-23 09:28:24 -050043
44*** Test Cases ***
45
46Verify All VMI EthernetInterfaces
47 [Documentation] Verify all VMI ethernet interfaces.
shrsuman1235c7e4d72021-04-16 05:42:57 -050048 [Tags] Verify_All_VMI_EthernetInterfaces
Vijay06a169d2020-04-23 09:28:24 -050049
50 Verify VMI EthernetInterfaces
51
52
53Verify Existing VMI Network Interface Details
54 [Documentation] Verify existing VMI network interface details.
shrsuman1235c7e4d72021-04-16 05:42:57 -050055 [Tags] Verify_Existing_VMI_Network_Interface_Details
Vijay06a169d2020-04-23 09:28:24 -050056
57 ${vmi_ip}= Get VMI Network Interface Details
58 ${origin}= Set Variable If ${vmi_ip["DHCPv4"]} == ${False} Static DHCP
Vijay06a169d2020-04-23 09:28:24 -050059 Should Not Be Equal ${vmi_ip["DHCPv4"]} ${vmi_ip["IPv4StaticAddresses"]}
shrsuman123bfb851b2021-07-02 04:59:16 -050060 Should Be Equal As Strings ${vmi_ip["Id"]} ${ethernet_interface}
George Keishingb3ea0952020-07-01 05:03:56 -050061 Should Be Equal As Strings ${vmi_ip["Description"]}
shrsuman1235c7e4d72021-04-16 05:42:57 -050062 ... Hypervisor's Virtual Management Ethernet Interface
63 Should Be Equal As Strings ${vmi_ip["Name"]} Hypervisor Ethernet Interface
Megha G N1e9f2f32025-05-13 02:18:41 -050064 IF ${vmi_ip["IPv4StaticAddresses"]} != @{empty}
65 Verify VMI Network Interface Details ${vmi_ip["IPv4_Address"]}
66 ... ${origin} ${vmi_ip["IPv4_Gateway"]} ${vmi_ip["IPv4_SubnetMask"]}
67 END
Vijay06a169d2020-04-23 09:28:24 -050068
69
70Delete Existing Static VMI IP Address
71 [Documentation] Delete existing static VMI IP address.
72 [Tags] Delete_Existing_Static_VMI_IP_Address
73
74 ${curr_origin}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
Megha G N1e9f2f32025-05-13 02:18:41 -050075 IF ${curr_origin} == ${True}
76 Set VMI IPv4 Origin ${False} ${HTTP_ACCEPTED}
77 END
Vijay06a169d2020-04-23 09:28:24 -050078
shrsuman1235c7e4d72021-04-16 05:42:57 -050079 Delete VMI IPv4 Address
Vijay06a169d2020-04-23 09:28:24 -050080
81
82Verify User Cannot Delete ReadOnly Property IPv4Addresses
83 [Documentation] Verify user cannot delete readonly property IPv4Addresses.
84 [Tags] Verify_User_Cannot_Delete_ReadOnly_Property_IPv4Addresses
85
86 ${curr_origin}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
Megha G N1e9f2f32025-05-13 02:18:41 -050087 IF ${curr_origin} == ${True}
88 Set VMI IPv4 Origin ${False} ${HTTP_ACCEPTED}
89 END
shrsuman1235c7e4d72021-04-16 05:42:57 -050090 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
shrsuman123b25343d2021-09-22 04:33:47 -050091 Delete VMI IPv4 Address IPv4Addresses valid_status_code=${HTTP_FORBIDDEN}
Vijay06a169d2020-04-23 09:28:24 -050092
93
Anves Kumar rayankula358c41d2020-08-14 04:53:06 -050094Assign Valid And Invalid Static IPv4 Address To VMI
Vijay06a169d2020-04-23 09:28:24 -050095 [Documentation] Assign static IPv4 address to VMI.
Anves Kumar rayankula358c41d2020-08-14 04:53:06 -050096 [Tags] Assign_Valid_And_Invalid_Static_IPv4_Address_To_VMI
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -060097 [Template] Set Static IPv4 Address To VMI And Verify
98 [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution
Vijay06a169d2020-04-23 09:28:24 -050099
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500100 # ip gateway netmask valid_status_code
Shradha Sumanc7df7db2021-03-08 05:16:44 -0600101 10.5.20.30 10.5.20.1 255.255.252.0 ${HTTP_ACCEPTED}
102 a.3.118.94 10.5.20.1 255.255.252.0 ${HTTP_BAD_REQUEST}
Anves Kumar rayankula81fd9db2021-05-10 02:39:51 -0500103 10.5.20 10.5.20.1 255.255.252.0 ${HTTP_BAD_REQUEST}
104 10.5.20.-5 10.5.20.1 255.255.252.0 ${HTTP_BAD_REQUEST}
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500105
Vijay06a169d2020-04-23 09:28:24 -0500106
George Keishing16b3c7b2021-01-28 09:23:37 -0600107Add Multiple IP Addresses On VMI Interface And Verify
108 [Documentation] Add multiple IP addresses on VMI interface and verify.
109 [Tags] Add_Multiple_IP_Addresses_On_VMI_Interface_And_Verify
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600110 [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution
shrsuman123e37b0cc2020-09-02 00:33:42 -0500111
Shradha Sumanc7df7db2021-03-08 05:16:44 -0600112 ${ip1}= Create dictionary Address=10.5.5.10 SubnetMask=255.255.252.0 Gateway=10.5.5.1
113 ${ip2}= Create dictionary Address=10.5.5.11 SubnetMask=255.255.252.0 Gateway=10.5.5.1
114 ${ip3}= Create dictionary Address=10.5.5.12 SubnetMask=255.255.252.0 Gateway=10.5.5.1
shrsuman123e37b0cc2020-09-02 00:33:42 -0500115 ${ips}= Create List ${ip1} ${ip2} ${ip3}
116
shrsuman123bfb851b2021-07-02 04:59:16 -0500117 Redfish.Patch /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface}
shrsuman123993a5c92021-04-19 06:40:16 -0500118 ... body={'IPv4StaticAddresses':${ips}} valid_status_codes=[${HTTP_BAD_REQUEST}]
shrsuman123e37b0cc2020-09-02 00:33:42 -0500119
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500120
shrsuman123e37b0cc2020-09-02 00:33:42 -0500121Modify IP Addresses On VMI Interface And Verify
122 [Documentation] Modify IP addresses on VMI interface and verify.
123 [Tags] Modify_IP_Addresses_On_VMI_Interface_And_Verify
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600124 [Template] Set Static IPv4 Address To VMI And Verify
125 [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution
shrsuman123e37b0cc2020-09-02 00:33:42 -0500126
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500127 # ip gateway netmask valid_status_code
Shradha Sumanc7df7db2021-03-08 05:16:44 -0600128 10.5.5.10 10.5.5.1 255.255.252.0 ${HTTP_ACCEPTED}
129 10.5.5.11 10.5.5.1 255.255.252.0 ${HTTP_ACCEPTED}
Vijay06a169d2020-04-23 09:28:24 -0500130
Megha GN80ef5ca2022-06-09 00:29:57 -0500131
Vijay06a169d2020-04-23 09:28:24 -0500132Switch Between IP Origins On VMI And Verify Details
133 [Documentation] Switch between IP origins on VMI and verify details.
134 [Tags] Switch_Between_IP_Origins_On_VMI_And_Verify_Details
135
136 Switch VMI IPv4 Origin And Verify Details
137 Switch VMI IPv4 Origin And Verify Details
138
139
140Verify Persistency Of VMI IPv4 Details After Host Reboot
141 [Documentation] Verify persistency of VMI IPv4 details after host reboot.
142 [Tags] Verify_Persistency_Of_VMI_IPv4_Details_After_Host_Reboot
143
144 # Verifying persistency of dynamic address.
145 Set VMI IPv4 Origin ${True} ${HTTP_ACCEPTED}
Anves Kumar rayankula7936eee2021-04-19 05:38:36 -0500146 Redfish Power Off stack_mode=skip
147 Redfish Power On
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500148 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
Vijay06a169d2020-04-23 09:28:24 -0500149
150 # Verifying persistency of static address.
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600151 Switch VMI IPv4 Origin And Verify Details
Anves Kumar rayankula7936eee2021-04-19 05:38:36 -0500152 Redfish Power Off stack_mode=skip
153 Redfish Power On
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600154 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
Vijay06a169d2020-04-23 09:28:24 -0500155
156
Anves Kumar rayankula9fa524a2020-08-18 06:40:18 -0500157Delete VMI Static IP Address And Verify
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500158 [Documentation] Delete VMI static IP address and verify.
159 [Tags] Delete_VMI_Static_IP_Address_And_Verify
160 [Teardown] Test Teardown Execution
Anves Kumar rayankula9fa524a2020-08-18 06:40:18 -0500161
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600162 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
163 Delete VMI IPv4 Address
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500164
Anves Kumar rayankula9fa524a2020-08-18 06:40:18 -0500165
shrsuman123c1d3fe32020-09-08 05:04:07 -0500166Verify Successful VMI IP Static Configuration On HOST Boot After Session Delete
167 [Documentation] Verify VMI IP static Configuration On HOST Boot After session deleted.
168 [Tags] Verify_Successful_VMI_IP_Static_Configuration_On_HOST_Boot_After_Session_Delete
shrsuman123b25343d2021-09-22 04:33:47 -0500169 [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution
shrsuman123c1d3fe32020-09-08 05:04:07 -0500170
shrsuman12375e77062020-09-18 01:08:45 -0500171 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
shrsuman123c1d3fe32020-09-08 05:04:07 -0500172
173 ${session_info}= Get Redfish Session Info
174 Redfish.Delete ${session_info["location"]}
175
176 # Create a new Redfish session
shrsuman1235c7e4d72021-04-16 05:42:57 -0500177 Redfish.Login
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500178 Redfish Power Off
179 Redfish Power On
shrsuman123c1d3fe32020-09-08 05:04:07 -0500180
181 Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask}
182
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500183
shrsuman123c1d3fe32020-09-08 05:04:07 -0500184Verify Persistency Of VMI DHCP IP Configuration After Multiple HOST Reboots
185 [Documentation] Verify Persistency Of VMI DHCP IP configuration After Multiple HOST Reboots
186 [Tags] Verify_Persistency_Of_VMI_DHCP_IP_Configuration_After_Multiple_HOST_Reboots
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500187 [Teardown] Test Teardown Execution
shrsuman123c1d3fe32020-09-08 05:04:07 -0500188
shrsuman123c1d3fe32020-09-08 05:04:07 -0500189 Set VMI IPv4 Origin ${True} ${HTTP_ACCEPTED}
shrsuman123c1d3fe32020-09-08 05:04:07 -0500190 ${vmi_ip_config}= Get VMI Network Interface Details
191 # Verifying persistency of dynamic address after multiple reboots.
shrsuman123f559cbe2021-01-06 05:40:45 -0600192 FOR ${i} IN RANGE ${2}
193 Redfish Power Off
194 Redfish Power On
George Keishing538f1742022-03-14 05:00:55 -0500195 Verify VMI Network Interface Details ${vmi_ip_config["IPv4_Address"]}
196 ... DHCP ${vmi_ip_config["IPv4_Gateway"]} ${vmi_ip_config["IPv4_SubnetMask"]}
shrsuman123f559cbe2021-01-06 05:40:45 -0600197 END
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500198
199
200Enable DHCP When Static IP Configured And Verify Static IP
201 [Documentation] Enable DHCP when static ip configured and verify static ip
George Keishing4203fad2022-01-31 12:22:33 -0600202 [Tags] Enable_DHCP_When_Static_IP_Configured_And_Verify_Static_IP
Shradha Sumanc7df7db2021-03-08 05:16:44 -0600203 [Setup] Redfish Power On
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500204 [Teardown] Test Teardown Execution
205
shrsuman123f559cbe2021-01-06 05:40:45 -0600206 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500207 Set VMI IPv4 Origin ${True}
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500208 ${vmi_network_conf}= Get VMI Network Interface Details
209 Should Not Be Equal As Strings ${test_ipv4} ${vmi_network_conf["IPv4_Address"]}
210
Anves Kumar rayankula9fa524a2020-08-18 06:40:18 -0500211
shrsuman123e37b0cc2020-09-02 00:33:42 -0500212Verify VMI Static IP Configuration Persist On BMC Reset Before Host Boot
213 [Documentation] Verify VMI static IP configuration persist on BMC reset.
214 [Tags] Verify_VMI_Static_IP_Configuration_Persist_On_BMC_Reset_Before_Host_Boot
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600215 [Teardown] Run keywords Delete VMI IPv4 Address AND FFDC On Test Case Fail
shrsuman123e37b0cc2020-09-02 00:33:42 -0500216
shrsuman12375e77062020-09-18 01:08:45 -0500217 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
Megha GNbe428592022-07-21 10:33:02 -0500218 Redfish OBMC Reboot (off) stack_mode=skip
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500219 Redfish Power On
shrsuman123e37b0cc2020-09-02 00:33:42 -0500220 # Verifying the VMI static configuration
221 Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask}
222
Megha GN80ef5ca2022-06-09 00:29:57 -0500223
shrsuman12375e77062020-09-18 01:08:45 -0500224Add Static IP When Host Poweroff And Verify On Poweron
225 [Documentation] Add Static IP When Host Poweroff And Verify on power on
226 [Tags] Add_Static_IP_When_Host_Poweroff_And_Verify_On_Poweron
227 [Setup] Redfish Power Off
228 [Teardown] Run keywords Delete VMI IPv4 Address AND FFDC On Test Case Fail
229
230 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
231 Redfish Power On
232 Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask}
233
Megha GN80ef5ca2022-06-09 00:29:57 -0500234
shrsuman12375e77062020-09-18 01:08:45 -0500235Add VMI Static IP When Host Poweroff And Verify Static IP On BMC Reset
236 [Documentation] Add Static IP When Host Poweroff And Verify Static IP On BMC Reset.
237 [Tags] Add_VMI_Static_IP_When_Host_Poweroff_And_Verify_Static_IP_On_BMC_Reset
238 [Setup] Redfish Power Off
239 [Teardown] Run keywords Delete VMI IPv4 Address AND FFDC On Test Case Fail
240
241 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
Megha GNbe428592022-07-21 10:33:02 -0500242 Redfish OBMC Reboot (off) stack_mode=skip
shrsuman12375e77062020-09-18 01:08:45 -0500243 Redfish Power On
244 Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask}
245
Megha GN80ef5ca2022-06-09 00:29:57 -0500246
shrsuman12375e77062020-09-18 01:08:45 -0500247Enable DHCP When No Static IP Configured And Verify DHCP IP
248 [Documentation] Enable DHCP when no static ip configured and verify dhcp ip
249 [Tags] Enable_DHCP_When_No_Static_IP_Configured_And_Verify_DHCP_IP
250 [Setup] Run Keyword And Ignore Error Delete VMI IPv4 Address
251 [Teardown] Test Teardown Execution
252
253 ${curr_origin}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
Megha G N1e9f2f32025-05-13 02:18:41 -0500254 IF ${curr_origin} == ${False}
255 Set VMI IPv4 Origin ${True} ${HTTP_ACCEPTED}
256 END
shrsuman12375e77062020-09-18 01:08:45 -0500257 ${vmi_ip_config}= Get VMI Network Interface Details
George Keishing538f1742022-03-14 05:00:55 -0500258 Verify VMI Network Interface Details ${vmi_ip_config["IPv4_Address"]}
259 ... DHCP ${vmi_ip_config["IPv4_Gateway"]} ${vmi_ip_config["IPv4_SubnetMask"]}
shrsuman12375e77062020-09-18 01:08:45 -0500260
Megha GN80ef5ca2022-06-09 00:29:57 -0500261
shrsuman12375e77062020-09-18 01:08:45 -0500262Verify User Cannot Delete VMI DHCP IP Address
263 [Documentation] Verify user cannot delete VMI DHCP IP Address
264 [Tags] Verify_User_Cannot_Delete_VMI_DHCP_IP_Address
265 [Setup] Set VMI IPv4 Origin ${True}
266 [Teardown] Test Teardown Execution
267
shrsuman123b25343d2021-09-22 04:33:47 -0500268 Delete VMI IPv4 Address IPv4Addresses valid_status_code=${HTTP_FORBIDDEN}
shrsuman12375e77062020-09-18 01:08:45 -0500269 ${resp}= Redfish.Get
shrsuman123bfb851b2021-07-02 04:59:16 -0500270 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface}
shrsuman12375e77062020-09-18 01:08:45 -0500271 Should Not Be Empty ${resp.dict["IPv4Addresses"]}
272
Megha GN80ef5ca2022-06-09 00:29:57 -0500273
shrsuman12375e77062020-09-18 01:08:45 -0500274Enable DHCP When Static IP Configured DHCP Server Unavailable And Verify IP
275 [Documentation] Enable DHCP When Static IP Configured And DHCP Server Unavailable And Verify No IP.
276 [Tags] Enable_DHCP_When_Static_IP_Configured_DHCP_Server_Unavailable_And_Verify_IP
277 [Teardown] Test Teardown Execution
278
279 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
280 Set VMI IPv4 Origin ${True}
shrsuman12375e77062020-09-18 01:08:45 -0500281 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
282
shrsuman123e37b0cc2020-09-02 00:33:42 -0500283
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500284Verify To Configure VMI Static IP Address With Different User Roles
285 [Documentation] Verify to configure vmi static ip address with different user roles.
286 [Tags] Verify_To_Configure_VMI_Static_IP_Address_With_Different_User_Roles
Megha G N4e2b5732023-02-02 04:52:27 -0600287 [Setup] Run Keywords Delete BMC Users Using Redfish
288 ... AND Create Users With Different Roles users=${USERS} force=${True}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500289 [Template] Config VMI Static IP Address Using Different Users
290 [Teardown] Delete BMC Users Using Redfish
291
292 # username password ip_address gateway nemask valid_status_code
293 admin_user TestPwd123 ${test_ipv4} ${test_gateway} ${test_netmask} ${HTTP_ACCEPTED}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500294 readonly_user TestPwd123 ${test_ipv4} ${test_gateway} ${test_netmask} ${HTTP_FORBIDDEN}
Megha GN80ef5ca2022-06-09 00:29:57 -0500295
296
297Verify To Configure VMI Static IP Address With Operator User Role
298 [Documentation] Verify to configure vmi static ip address with operator user role.
299 [Tags] Verify_To_Configure_VMI_Static_IP_Address_With_Operator_User_Role
300 [Setup] Create Users With Different Roles users=${USERS} force=${True}
301 [Template] Config VMI Static IP Address Using Different Users
302 [Teardown] Delete BMC Users Using Redfish
303
304 # username password ip_address gateway nemask valid_status_code
305 operator_user TestPwd123 ${test_ipv4} ${test_gateway} ${test_netmask} ${HTTP_FORBIDDEN}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500306
307
308Verify To Delete VMI Static IP Address With Different User Roles
309 [Documentation] Verify to delete vmi static IP address with different user roles.
310 [Tags] Verify_To_Delete_VMI_Static_IP_Address_With_Different_User_Roles
311 [Setup] Create Users With Different Roles users=${USERS} force=${True}
312 [Template] Delete VMI Static IP Address Using Different Users
313 [Teardown] Delete BMC Users Using Redfish
314
315 # username password valid_status_code
316 admin_user TestPwd123 ${HTTP_ACCEPTED}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500317 readonly_user TestPwd123 ${HTTP_FORBIDDEN}
Megha GN80ef5ca2022-06-09 00:29:57 -0500318
319
320Verify To Delete VMI Static IP Address With Operator User Role
321 [Documentation] Verify to delete vmi static IP address with operator user role.
322 [Tags] Verify_To_Delete_VMI_Static_IP_Address_With_Operator_User_Role
323 [Setup] Create Users With Different Roles users=${USERS} force=${True}
324 [Template] Delete VMI Static IP Address Using Different Users
325 [Teardown] Delete BMC Users Using Redfish
326
327 # username password valid_status_code
328 operator_user TestPwd123 ${HTTP_FORBIDDEN}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500329
330
331Verify To Update VMI Static IP Address With Different User Roles
332 [Documentation] Verify to update vmi static IP address with different user roles.
George Keishing4203fad2022-01-31 12:22:33 -0600333 [Tags] Verify_To_Update_VMI_Static_IP_Address_With_Different_User_Roles
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500334 [Setup] Create Users With Different Roles users=${USERS} force=${True}
335 [Template] Config VMI Static IP Address Using Different Users
336 [Teardown] Delete BMC Users Using Redfish
337
Shradha Sumanc7df7db2021-03-08 05:16:44 -0600338 # username password ip_address gateway netmask valid_status_code
339 admin_user TestPwd123 10.5.10.20 10.5.10.1 255.255.0.0 ${HTTP_ACCEPTED}
Shradha Sumanc7df7db2021-03-08 05:16:44 -0600340 readonly_user TestPwd123 10.5.20.40 10.5.20.1 255.255.0.0 ${HTTP_FORBIDDEN}
Megha GN80ef5ca2022-06-09 00:29:57 -0500341
342
343Verify To Update VMI Static IP Address With Operator User Role
344 [Documentation] Verify to update vmi static IP address with operator user role.
345 [Tags] Verify_To_Update_VMI_Static_IP_Address_With_Operator_User_Role
346 [Setup] Create Users With Different Roles users=${USERS} force=${True}
347 [Template] Config VMI Static IP Address Using Different Users
348 [Teardown] Delete BMC Users Using Redfish
349
350 # username password ip_address gateway netmask valid_status_code
351 operator_user TestPwd123 10.5.10.30 10.5.10.1 255.255.0.0 ${HTTP_FORBIDDEN}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500352
353
354Verify To Read VMI Network Configuration With Different User Roles
355 [Documentation] Verify to read vmi network configuration with different user roles.
George Keishing4203fad2022-01-31 12:22:33 -0600356 [Tags] Verify_To_Read_VMI_Network_Configuration_With_Different_User_Roles
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500357 [Setup] Create Users With Different Roles users=${USERS} force=${True}
358 [Template] Read VMI Static IP Address Using Different Users
359 [Teardown] Delete BMC Users Using Redfish
360
361 # username password valid_status_code
362 admin_user TestPwd123 ${HTTP_OK}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500363 readonly_user TestPwd123 ${HTTP_OK}
Megha GN80ef5ca2022-06-09 00:29:57 -0500364
365
366Verify To Read VMI Network Configuration With Operator User Role
367 [Documentation] Verify to read vmi network configuration with operator user role.
368 [Tags] Verify_To_Read_VMI_Network_Configuration_With_Operator_User_Role
369 [Setup] Create Users With Different Roles users=${USERS} force=${True}
370 [Template] Read VMI Static IP Address Using Different Users
371 [Teardown] Delete BMC Users Using Redfish
372
373 # username password valid_status_code
374 operator_user TestPwd123 ${HTTP_FORBIDDEN}
375
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500376
shrsuman123b361d412020-09-30 06:17:23 -0500377Enable DHCP On VMI Network Via Different Users Roles And Verify
378 [Documentation] Enable DHCP On VMI Network Via Different Users Roles And Verify.
379 [Tags] Enable_DHCP_On_VMI_Network_Via_Different_Users_Roles_And_Verify
380 [Setup] Create Users With Different Roles users=${USERS} force=${True}
381 [Template] Update User Role And Set VMI IPv4 Origin
382 [Teardown] Delete BMC Users Using Redfish
383
384 # username password dhcp_enabled valid_status_code
385 admin_user TestPwd123 ${True} ${HTTP_ACCEPTED}
shrsuman123b361d412020-09-30 06:17:23 -0500386 readonly_user TestPwd123 ${True} ${HTTP_FORBIDDEN}
Megha GN80ef5ca2022-06-09 00:29:57 -0500387
388
389Enable DHCP On VMI Network Via Operator User Role And Verify
390 [Documentation] Enable DHCP On VMI Network Via Operator User Role And Verify.
391 [Tags] Enable_DHCP_On_VMI_Network_Via_Operator_User_Role_And_Verify
392 [Setup] Create Users With Different Roles users=${USERS} force=${True}
393 [Template] Update User Role And Set VMI IPv4 Origin
394 [Teardown] Delete BMC Users Using Redfish
395
396 # username password dhcp_enabled valid_status_code
397 operator_user TestPwd123 ${True} ${HTTP_FORBIDDEN}
398
shrsuman123b361d412020-09-30 06:17:23 -0500399
400Disable DHCP On VMI Network Via Different Users Roles And Verify
401 [Documentation] Disable DHCP On VMI Network Via Different Users Roles And Verify.
402 [Tags] Disable_DHCP_On_VMI_Network_Via_Different_Users_Roles_And_Verify
403 [Setup] Create Users With Different Roles users=${USERS} force=${True}
404 [Template] Update User Role And Set VMI IPv4 Origin
405 [Teardown] Delete BMC Users Using Redfish
406
407 # username password dhcp_enabled valid_status_code
408 admin_user TestPwd123 ${False} ${HTTP_ACCEPTED}
shrsuman123b361d412020-09-30 06:17:23 -0500409 readonly_user TestPwd123 ${False} ${HTTP_FORBIDDEN}
Megha GN80ef5ca2022-06-09 00:29:57 -0500410
411
412Disable DHCP On VMI Network Via Operator User Role And Verify
413 [Documentation] Disable DHCP On VMI Network Via Operator User Role And Verify.
414 [Tags] Disable_DHCP_On_VMI_Network_Via_Operator_User_Role_And_Verify
415 [Setup] Create Users With Different Roles users=${USERS} force=${True}
416 [Template] Update User Role And Set VMI IPv4 Origin
417 [Teardown] Delete BMC Users Using Redfish
418
419 # username password dhcp_enabled valid_status_code
420 operator_user TestPwd123 ${False} ${HTTP_FORBIDDEN}
shrsuman123b361d412020-09-30 06:17:23 -0500421
shrsuman123e37b0cc2020-09-02 00:33:42 -0500422
Anves Kumar rayankula55b939e2020-08-12 04:19:01 -0500423Enable And Disable DHCP And Verify
424 [Documentation] verify enable DHCP and disable DHCP.
George Keishing4203fad2022-01-31 12:22:33 -0600425 [Tags] Enable_And_Disable_DHCP_And_Verify
Anves Kumar rayankula55b939e2020-08-12 04:19:01 -0500426
427 Set VMI IPv4 Origin ${True}
Anves Kumar rayankula55b939e2020-08-12 04:19:01 -0500428 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
429 Set VMI IPv4 Origin ${False}
Megha GN80ef5ca2022-06-09 00:29:57 -0500430 Verify VMI Network Interface Details ${default} Static ${default} ${default}
Anves Kumar rayankula55b939e2020-08-12 04:19:01 -0500431
432
433Multiple Times Enable And Disable DHCP And Verify
434 [Documentation] Enable and Disable DHCP in a loop and verify VMI gets an IP address from DHCP
435 ... each time when DHCP is enabled
436 [Tags] Multiple_Times_Enable_And_Disable_DHCP_And_Verify
437
Anves Kumar rayankula55b939e2020-08-12 04:19:01 -0500438 FOR ${i} IN RANGE ${2}
439 Set VMI IPv4 Origin ${True}
440 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
441 Set VMI IPv4 Origin ${False}
Megha GN80ef5ca2022-06-09 00:29:57 -0500442 Verify VMI Network Interface Details ${default} Static ${default} ${default}
Anves Kumar rayankula55b939e2020-08-12 04:19:01 -0500443 END
444
445
Anves Kumar rayankula81fd9db2021-05-10 02:39:51 -0500446Assign Static IPv4 Address With Invalid Netmask To VMI
447 [Documentation] Assign static IPv4 address with invalid netmask and expect error.
448 [Tags] Assign_Static_IPv4_Address_With_Invalid_Netmask_To_VMI
449 [Template] Set Static IPv4 Address To VMI And Verify
450
451 # ip gateway netmask valid_status_code
452 ${test_ipv4} ${test_gateway} 255.256.255.0 ${HTTP_BAD_REQUEST}
453 ${test_ipv4} ${test_gateway} ff.ff.ff.ff ${HTTP_BAD_REQUEST}
454 ${test_ipv4} ${test_gateway} 255.255.253.0 ${HTTP_BAD_REQUEST}
455
456
457Assign Static IPv4 Address With Invalid Gateway To VMI
458 [Documentation] Add static IPv4 address with invalid gateway and expect error.
459 [Tags] Assign_Static_IPv4_Address_With_Invalid_Gateway_To_VMI
460 [Template] Set Static IPv4 Address To VMI And Verify
461
462 # ip gateway netmask valid_status_code
463 ${test_ipv4} @@@.%%.44.11 ${test_netmask} ${HTTP_BAD_REQUEST}
464 ${test_ipv4} 0xa.0xb.0xc.0xd ${test_netmask} ${HTTP_BAD_REQUEST}
465 ${test_ipv4} 10.3.36 ${test_netmask} ${HTTP_BAD_REQUEST}
466 ${test_ipv4} 10.3.36.-10 ${test_netmask} ${HTTP_BAD_REQUEST}
467
468
Megha G N02cbfa12022-12-12 02:05:03 -0600469Enable DHCP When Host Is Off And Verify After Poweron
470 [Documentation] Enable DHCP when host is off and
471 ... check whether it is enabled after poweron.
472 [Tags] Enable_DHCP_When_Host_Is_Off_And_Verify_After_Poweron
473 [Setup] Redfish Power Off stack_mode=skip
474
475 Set VMI IPv4 Origin ${True}
476 Redfish Power On stack_mode=skip
477 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
478
479
Megha G N89174682023-01-24 23:28:27 -0600480Disable DHCP When Host Is Off And Verify New State Reflects After Power On
481 [Documentation] Disable DHCP when host is off and
482 ... get network info and verify that VMI origin is static.
483 [Tags] Disable_DHCP_When_Host_Is_Off_And_Verify_New_State_Reflects_After_Power_On
484 [Setup] Redfish Power Off stack_mode=skip
485
486 Set VMI IPv4 Origin ${False}
487 Redfish Power On stack_mode=skip
488 Verify VMI Network Interface Details ${default} Static ${default} ${default}
489
490
Megha G N38acd842024-10-14 14:28:11 -0500491Enable VMI Stateless Address AutoConfig And Verify
492 [Documentation] Enable VMI SLAACv6 and verify an origin.
493 [Tags] Enable_VMI_Stateless_Address_AutoConfig_And_Verify
494
495 Set VMI SLAACv6 Origin ${True}
496
497 # Check origin is set to slaac and address are getting displayed.
498 Verify VMI IPv6 Address SLAAC
499
500
Megha G Ne8c0e422024-12-04 03:12:55 -0600501Disable VMI Stateless Address AutoConfig And Verify
502 [Documentation] Disable VMI SLAACv6 and verify an origin.
503 [Tags] Disable_VMI_Stateless_Address_AutoConfig_And_Verify
504 [Setup] Set VMI SLAACv6 Origin ${True}
505
506 Set VMI SLAACv6 Origin ${False}
507
508 # Check origin is set to static and slaacv6 address are getting erased.
509 Verify VMI IPv6 Address Static
510
511
Megha G Na37b8da2025-01-06 00:23:15 -0600512Enable VMI SLAAC And Check Persistency On BMC Reboot
513 [Documentation] Enable VMI SLAACv6 and verify its persistency
514 ... on BMC reboot and this works on the setup where router
Megha G Na727d5b2025-02-06 04:41:47 -0600515 ... advertises network prefix.
Megha G Na37b8da2025-01-06 00:23:15 -0600516 [Tags] Enable_VMI_SLAAC_And_Check_Persistency_On_BMC_Reboot
517
518 Set VMI SLAACv6 Origin ${True}
519
520 # Reboot BMC and verify persistency.
521 OBMC Reboot (off)
522 Redfish Power On
523 Wait For Host Boot Progress To Reach Required State
Megha G Na727d5b2025-02-06 04:41:47 -0600524 Sleep 5s
Megha G Na37b8da2025-01-06 00:23:15 -0600525
526 # Check origin is set to slaac and address are getting displayed.
527 ${vmi_ipv6addr}= Verify VMI IPv6 Address SLAAC
528 Should Not Be Equal ${vmi_ipv6addr["Address"]} ${default_ipv6addr}
529
530
Megha G N49657382025-01-07 23:10:42 -0600531Disable VMI SLAAC And Check Persistency On BMC Reboot
532 [Documentation] Disable VMI SLAACv6 and verify its persistency
533 ... on BMC reboot.
534 [Tags] Disable_VMI_SLAAC_And_Check_Persistency_On_BMC_Reboot
535
536 Set VMI SLAACv6 Origin ${False}
537
538 # Reboot BMC and verify persistency.
539 OBMC Reboot (off)
540 Redfish Power On
541 Wait For Host Boot Progress To Reach Required State
542
543 # Check if origin is set to static and SLAAC address are getting erased.
544 ${vmi_ipv6addr}= Verify VMI IPv6 Address Static
545 Should Be Equal ${vmi_ipv6addr["Address"]} ${default_ipv6addr}
546
547
Megha G N503fa352025-01-08 04:43:09 -0600548Disable VMI DHCPv4 When SLAAC Is Enabled And Verify
549 [Documentation] Disable VMI DHCPv4 parameter when SLAACv6 is enabled
550 ... and check whether the IPv4 address origin is set to static and
551 ... DHCPv4 address is getting erased.
552 [Tags] Disable_VMI_DHCPv4_When_SLAAC_Is_Enabled_And_Verify
553 [Setup] Set VMI IPv4 Origin ${True}
554
555 # Set IPv6 origin to SLAAC.
556 Set VMI SLAACv6 Origin ${True}
557 Verify VMI IPv6 Address SLAAC
558
559 # Disable VMI DHCPv4 and check IPv4 address origin is set to static.
560 Set VMI IPv4 Origin ${False}
561 Verify VMI Network Interface Details ${default} Static ${default} ${default}
562
563
Megha G Ndf255642025-01-10 02:12:21 -0600564Enable VMI SLAAC When DHCPv6 Is Enabled And Verify
565 [Documentation] Enable VMI SLAACv6 when VMI DHCPv6 is enabled and
566 ... check IPv6 gets Slaac address and this works on the setup
567 ... where router advertise network prefix.
568 [Tags] Enable_VMI_SLAAC_When_DHCPv6_Is_Enabled_And_Verify
569
570 Set VMI DHCPv6 Property Enabled
571
572 # Enable SLAAC and check whether IPv6 origin is set to SLAAC.
573 Set VMI SLAACv6 Origin ${True}
574
575 # Check if origin is set to slaac and address are getting displayed.
576 ${vmi_ipv6addr}= Verify VMI IPv6 Address SLAAC
577 Should Not Be Equal ${vmi_ipv6addr["Address"]} ${default_ipv6addr}
578 Should Be Equal ${vmi_ipv6addr["PrefixLength"]} ${prefix_length}
579
580
Megha G N80b4af32025-01-15 00:47:35 -0600581Disable VMI DHCPv6 Property And Verify
George Keishing4ebb3282025-01-17 10:01:34 +0530582 [Documentation] Disable VMI DHCPv6 property and verify IPv6 address
583 ... origin is set to static and DHCPv6 address is erased.
584 [Tags] Disable_VMI_DHCPv6_Property_And_Verify
Megha G N80b4af32025-01-15 00:47:35 -0600585 [Setup] Set VMI DHCPv6 Property Enabled
586
587 Set VMI DHCPv6 Property Disabled
588
589 # Verify IPv6 address origin is set to static and DHCPv6 address is erased.
590 ${vmi_ipv6addr}= Verify VMI IPv6 Address Static
591 Should Be Equal ${vmi_ipv6addr["Address"]} ${default_ipv6addr}
592
593
Megha G N58be5122025-01-16 08:26:53 -0600594Enable VMI SLAAC When DHCPv4 Is Enabled And Verify
595 [Documentation] On VMI enable SLAAC when DHCPv4 is enabled and verify DHCPv4 settings are intact
596 ... and IPv6 origin is set to SLAAC & it gets assigned with SLAAC IPv6 address and this
597 ... works on the setup where router advertise network prefix.
598 [Tags] Enable_VMI_SLAAC_When_DHCPv4_Is_Enabled_And_Verify
599 [Setup] Set VMI IPv4 Origin ${True}
600
601 # Enable Autoconfig address and check whether IPv6 address origin is set to SLAAC.
602 Set VMI SLAACv6 Origin ${True}
603 Verify VMI IPv6 Address SLAAC
604
605 # Check there is no impact on IPv4 settings, IPv4 address origin should be DHCP.
606 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
607
608
Megha G Nf9867142025-02-03 23:10:57 -0600609Disable VMI DHCPv6 Property And Check Persistency On BMC Reboot
610 [Documentation] Disable VMI DHCPv6 property and verify its persistency on
611 ... BMC reboot.
612 [Tags] Disable_VMI_DHCPv6_Property_And_Check_Persistency_On_BMC_Reboot
613 [Setup] Set VMI DHCPv6 Property Enabled
614
615 Set VMI DHCPv6 Property Disabled
616
617 # Reboot BMC and verify persistency.
618 OBMC Reboot (off)
619
620 # Verify IPv6 address origin is set to Static and DHCPv6 address is erased.
621 ${vmi_ipv6addr}= Verify VMI IPv6 Address Static
622 Should Be Equal ${vmi_ipv6addr["Address"]} ${default_ipv6addr}
623
624
Megha G N95e37d82025-02-06 03:56:04 -0600625Enable VMI SLAAC When IPv4 Origin Is Static And Verify
626 [Documentation] On VMI enable SLAAC when IPv4 origin is static and verify IPv4 settings are intact
627 ... and IPv6 origin is set to SLAAC & it gets assigned with SLAAC IPv6 address and this works
628 ... on the setup where router advertise network prefix.
629 [Tags] Enable_VMI_SLAAC_When_IPv4_Origin_Is_Static_And_Verify
630 [Setup] Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
631 [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution
632
633 # Enable Autoconfig address and check whether IPv6 address origin is set to SLAAC.
634 Set VMI SLAACv6 Origin ${True}
635 Verify VMI IPv6 Address SLAAC
636
637 # Check there is no impact on IPv4 settings, IPv4 address origin should be Static.
638 Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask}
639
640
Megha G N97af3bf2025-02-27 10:32:08 -0600641Configure Static VMI IPv6 Address And Verify
642 [Documentation] Add static VMI IPv6 address and check whether IPv6 origin is set to static
643 ... and Static IPv6 address is assigned.
644 [Tags] Configure_Static_VMI_IPv6_Address_And_Verify
645
646 Set Static VMI IPv6 Address ${test_vmi_ipv6addr} ${prefix_length}
647
648 # Verify IPv6 address origin is set to static and static IPv6 address is assigned.
649 ${vmi_ipv6addr}= Verify VMI IPv6 Address Static
650 Should Not Be Equal ${vmi_ipv6addr["Address"]} ${default_ipv6addr}
651 Should Be Equal ${vmi_ipv6addr["PrefixLength"]} ${prefix_length}
652
653
Megha G Ne0e055d2025-02-28 02:16:06 -0600654Configure IPv6 Static Default Gateway On VMI And Verify
655 [Documentation] Configure IPv6 static default gateway on VMI and verify.
656 [Tags] Configure_IPv6_Static_Default_Gateway_On_VMI_And_Verify
Megha G N1361edf2025-03-18 03:09:41 -0500657 [Setup] Set Static VMI IPv6 Address ${test_vmi_ipv6addr} ${prefix_length}
Megha G Ne0e055d2025-02-28 02:16:06 -0600658
659 Set VMI IPv6 Static Default Gateway ${test_vmi_ipv6gateway}
660
661 ${resp}= Redfish.Get
662 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface}
Megha G N1361edf2025-03-18 03:09:41 -0500663 ${vmi_ipv6_gateways}= Get From Dictionary ${resp.dict} IPv6StaticDefaultGateways
664 ${vmi_ipv6_gateway} = Get From List ${vmi_ipv6_gateways} 0
665 Should Be Equal ${vmi_ipv6_gateway["Address"]} ${test_vmi_ipv6gateway}
Megha G Ne0e055d2025-02-28 02:16:06 -0600666
667
Megha G Na2148332025-03-06 07:28:15 -0600668Delete VMI Static IPv6 Address And Verify
669 [Documentation] Delete VMI static IPv6 address and verify address is erased.
670 [Tags] Delete_VMI_Static_IPv6_Address_And_Verify
671 [Setup] Set Static VMI IPv6 Address ${test_vmi_ipv6addr} ${prefix_length}
672
673 # Delete VMI static IPv6 address.
674 Delete VMI IPv6 Static Address
675
676 # Verify VMI static IPv6 address is erased.
677 ${vmi_ipv6addr}= Verify VMI IPv6 Address Static
678 Should Not Be Equal ${vmi_ipv6addr["Address"]} ${test_vmi_ipv6addr}
679 Should Be Equal ${vmi_ipv6addr["Address"]} ${default_ipv6addr}
680
681
Megha G Nd9ba2b42025-03-07 05:27:10 -0600682Enable VMI DHCPv6 When IPv6 Origin Is Static And Verify
683 [Documentation] Enable VMI DHCPv6 when IPv6 origin is in static and verify
684 ... origin is set to DHCP and check if static IPv6 address is erased.
685 [Tags] Enable_VMI_DHCPv6_When_IPv6_Origin_Is_Static_And_Verify
686
687 Set Static VMI IPv6 Address ${test_vmi_ipv6addr} ${prefix_length}
688 ${vmi_ipv6addr_static}= Verify VMI IPv6 Address Static
689
690 Sleep 5s
691
692 # Enable DHCPv6 property.
693 Set VMI DHCPv6 Property Enabled
694
695 # Check origin is set to DHCP and static IPv6 address is erased.
696 ${vmi_dhcpv6addr}= Verify VMI IPv6 Address DHCPv6
697 Should Not Be Equal ${vmi_dhcpv6addr["Address"]} ${vmi_ipv6addr_static["Address"]}
698
699
Megha G N3e2cf0d2025-03-11 12:16:08 -0500700Configure Invalid Static IPv6 To VMI And Verify
701 [Documentation] Configure invalid static IPv6 address to VMI and verify that address
702 ... does not get assigned and it throws an error.
703 [Tags] Configure_Invalid_Static_IPv6_To_VMI_And_Verify
704 [Setup] Set Static VMI IPv6 Address ${test_vmi_ipv6addr} ${prefix_length}
705 [Template] Set VMI Invalid Static IPv6 Address And Verify
706
707 # invalid_vmi_ipv6addr invalid_prefix_length valid_status_codes
708 ${default_ipv6addr} 128 ${HTTP_BAD_REQUEST}
709 ${multicast_ipv6addr} 8 ${HTTP_BAD_REQUEST}
710 ${loopback_ipv6addr} 64 ${HTTP_BAD_REQUEST}
711 ${ipv4_hexword_addr} 64 ${HTTP_BAD_REQUEST}
712
713
Megha G Nf719f242025-03-25 04:09:50 -0500714Delete IPv6 Static Default Gateway On VMI And Verify
715 [Documentation] Delete IPv6 static default gateway and verify address is erased.
716 [Tags] Delete_IPv6_Static_Default_Gateway_On_VMI_And_Verify
717 [Setup] Run Keywords Set Static VMI IPv6 Address ${test_vmi_ipv6addr} ${prefix_length}
718 ... AND Set VMI IPv6 Static Default Gateway ${test_vmi_ipv6gateway}
719
720 # Delete IPv6 static default gateway address.
721 Delete VMI IPv6 Static Default Gateway Address
722
723 Sleep 5s
724
725 # Verify static IPv6 default gateway address is deleted.
726 ${resp}= Redfish.Get
727 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface}
728 Should Be Empty ${resp.dict["IPv6StaticDefaultGateways"]}
729
730
Megha G N619d8702025-04-17 01:03:38 -0500731Disable VMI DHCPv6 When DHCPv4 Is Enabled And Verify
732 [Documentation] Disable VMI DHCPv6 property when DHCPv4 is enabled and verify
733 ... DHCPv4 settings are intact and verify IPv6 address origin is set to static.
734 [Tags] Disable_VMI_DHCPv6_When_DHCPv4_Is_Enabled_And_Verify
735 [Setup] Run Keywords Set VMI DHCPv6 Property Enabled
736 ... AND Set VMI IPv4 Origin ${True}
737
738 Set VMI DHCPv6 Property Disabled
739
740 # Verify IPv6 address origin is set to static and DHCPv6 address is erased.
741 ${vmi_ipv6addr}= Verify VMI IPv6 Address Static
742 Should Be Equal ${vmi_ipv6addr["Address"]} ${default_ipv6addr}
743
744 # Check there is no impact on IPv4 settings, IPv4 address origin should be DHCP.
745 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
746
747
Megha G N62b0c902025-05-06 04:55:06 -0500748Assign Static VMI IPv6 Address And Check Persistency On BMC Reboot
749 [Documentation] Add static VMI IPv6 address and check whether IPv6 origin is set to static
750 ... and static IPv6 address is assigned after BMC reboot.
751 [Tags] Assign_Static_VMI_IPv6_Address_And_Check_Persistency_On_BMC_Reboot
752
753 Set Static VMI IPv6 Address ${test_vmi_ipv6addr} ${prefix_length}
754
755 # Reboot BMC and verify persistency.
756 OBMC Reboot (off)
757 Redfish Power On
758 Wait For Host Boot Progress To Reach Required State
759
760 # Verify IPv6 address origin is set to static and static IPv6 address is assigned.
761 ${vmi_ipv6addr}= Verify VMI IPv6 Address Static
762 Should Not Be Equal ${vmi_ipv6addr["Address"]} ${default_ipv6addr}
763 Should Be Equal ${vmi_ipv6addr["PrefixLength"]} ${prefix_length}
764
765
Megha G N6e1c48e2025-05-15 11:07:28 -0500766Enable VMI DHCPv6 When DHCPv4 Is Enabled And Verify
767 [Documentation] Enable VMI DHCPv6 when DHCPv4 is enabled and verify
768 ... DHCPv4 settings are intact and verify IPv6 address origin is set to DHCP.
769 [Tags] Enable_VMI_DHCPv6_When_DHCPv4_Is_Enabled_And_Verify
770 [Setup] Set VMI IPv4 Origin ${True}
771
772 # Enable DHCPv6 property.
773 Set VMI DHCPv6 Property Enabled
774
775 # Check IPv6 origin is set to DHCP.
776 Verify VMI IPv6 Address DHCPv6
777
778 # Check there is no impact on IPv4 settings, IPv4 address origin should be DHCP.
779 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
780
781
Megha G N439f7122025-06-02 02:58:39 -0500782Assign Valid Static IPv6 Address And Verify
783 [Documentation] Configure valid static IPv6 address to VMI and verify that address
784 ... get assigned.
785 [Tags] Assign_Valid_Static_IPv6_Address_And_Verify
786 [Template] Set VMI Valid Static IPv6 Address And Verify
787
788 # valid_vmi_ipv6addr valid_prefix_length
789 ${compressed_ipv4} 64
790 ${shortform_stand_ipv4} 64
791 ${standard_ipv4rep} 64
792
793
Megha G N376f6e82025-06-18 03:55:10 -0500794Enable VMI DHCPv6 When IPv4 Origin Is Static And Verify
795 [Documentation] Enable VMI DHCPv6 when IPv4 origin is static and verify
796 ... IPv4 settings are intact and verify IPv6 address origin is set to DHCP.
797 [Tags] Enable_VMI_DHCPv6_When_IPv4_Origin_Is_Static_And_Verify
798 [Setup] Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
799
800 # Enable DHCPv6 property.
801 Set VMI DHCPv6 Property Enabled
802
803 # Check IPv6 origin is set to DHCP.
804 Verify VMI IPv6 Address DHCPv6
805
806 # Check there is no impact on IPv4 settings, IPv4 address origin should be static.
807 Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask}
808
809
810Configures Static IPv6 When DHCPv4 Is Enabled And Verify
811 [Documentation] Configure static IPv6 address when DHCPv4 is enabled and verify DHCPv4
812 ... settings are intact and verify IPv6 origin is set to static and static IPv6 address is assigned.
813 [Tags] Configures_Static_IPv6_When_DHCPv4_Is_Enabled_And_Verify
814 [Setup] Set VMI IPv4 Origin ${True}
815
816 Set VMI Valid Static IPv6 Address And Verify ${test_vmi_ipv6addr} ${prefix_length}
817
818 # Check there is no impact on IPv4 settings, IPv4 address origin should be DHCP.
819 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
820
821
Vijay06a169d2020-04-23 09:28:24 -0500822*** Keywords ***
823
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500824Suite Setup Execution
825 [Documentation] Do test setup execution task.
826
827 Redfish.Login
Megha G Nd0b4da92024-02-08 15:04:24 -0600828
829 Redfish Power Off
830 Set BIOS Attribute pvm_hmc_managed Enabled
Megha G N1e538242024-06-11 03:42:03 -0500831 Set BIOS Attribute pvm_stop_at_standby Disabled
832
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500833 Redfish Power On
Megha G N1e538242024-06-11 03:42:03 -0500834 Wait For Host Boot Progress To Reach Required State
Megha G N86507da2024-02-07 23:16:27 -0600835
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500836 ${active_channel_config}= Get Active Channel Config
837 Set Suite Variable ${active_channel_config}
shrsuman123bfb851b2021-07-02 04:59:16 -0500838 Set Suite Variable ${ethernet_interface} ${active_channel_config['${CHANNEL_NUMBER}']['name']}
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500839 ${resp}= Redfish.Get
shrsuman123bfb851b2021-07-02 04:59:16 -0500840 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface}
shrsuman12362e5be52021-05-20 02:42:59 -0500841 ${ip_resp}= Evaluate json.loads(r'''${resp.text}''') json
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500842 ${length}= Get Length ${ip_resp["IPv4StaticAddresses"]}
Megha G N1e9f2f32025-05-13 02:18:41 -0500843 ${vmi_network_conf}= IF ${length} != ${0} Get VMI Network Interface Details
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500844 Set Suite Variable ${vmi_network_conf}
845
846
847Test Teardown Execution
848 [Documentation] Do test teardown execution task.
849
850 FFDC On Test Case Fail
851 ${curr_mode}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
Megha G N1e9f2f32025-05-13 02:18:41 -0500852 IF ${curr_mode} == ${True}
853 Set VMI IPv4 Origin ${False}
Megha G N286e2f02025-05-21 05:09:41 -0500854 END
855 IF '${vmi_network_conf["IPv4_Address"]}' != '${default}'
Megha G N1e9f2f32025-05-13 02:18:41 -0500856 Set Static IPv4 Address To VMI And Verify ${vmi_network_conf["IPv4_Address"]}
857 ... ${vmi_network_conf["IPv4_Gateway"]} ${vmi_network_conf["IPv4_SubnetMask"]}
858 END
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500859
860
Vijay06a169d2020-04-23 09:28:24 -0500861Get Immediate Child Parameter From VMI Network Interface
862 [Documentation] Get immediate child parameter from VMI network interface.
863 [Arguments] ${parameter} ${valid_status_code}=${HTTP_OK}
864
865 # Description of argument(s):
866 # parameter parameter for which value is required. Ex: DHCPEnabled, MACAddress etc.
867 # valid_status_code Expected valid status code from GET request.
868
Anves Kumar rayankula358c41d2020-08-14 04:53:06 -0500869 ${resp}= Redfish.Get
shrsuman123bfb851b2021-07-02 04:59:16 -0500870 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface}
Vijay06a169d2020-04-23 09:28:24 -0500871 ... valid_status_codes=[${valid_status_code}]
872
shrsuman12362e5be52021-05-20 02:42:59 -0500873 ${ip_resp}= Evaluate json.loads(r'''${resp.text}''') json
Vijay06a169d2020-04-23 09:28:24 -0500874 ${value}= Set Variable If '${parameter}' != 'DHCPEnabled' ${ip_resp["${parameter}"]}
875 ... ${ip_resp["DHCPv4"]["${parameter}"]}
876
George Keishing409df052024-01-17 22:36:14 +0530877 RETURN ${value}
Vijay06a169d2020-04-23 09:28:24 -0500878
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600879
Vijay06a169d2020-04-23 09:28:24 -0500880Switch VMI IPv4 Origin And Verify Details
881 [Documentation] Switch VMI IPv4 origin and verify details.
Vijay06a169d2020-04-23 09:28:24 -0500882
Anves Kumar rayankula7936eee2021-04-19 05:38:36 -0500883 ${dhcp_mode_before}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
Anves Kumar rayankulae7dc89a2021-04-28 04:29:38 -0500884 ${dhcp_enabled}= Set Variable If ${dhcp_mode_before} == ${False} ${True} ${False}
Vijay06a169d2020-04-23 09:28:24 -0500885
Anves Kumar rayankulae7dc89a2021-04-28 04:29:38 -0500886 ${origin}= Set Variable If ${dhcp_mode_before} == ${False} DHCP Static
Vijay06a169d2020-04-23 09:28:24 -0500887 Set VMI IPv4 Origin ${dhcp_enabled} ${HTTP_ACCEPTED}
Anves Kumar rayankula7936eee2021-04-19 05:38:36 -0500888
889 ${dhcp_mode_after}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
890 Should Not Be Equal ${dhcp_mode_before} ${dhcp_mode_after}
891
Megha G N1e9f2f32025-05-13 02:18:41 -0500892 IF ${dhcp_mode_after} == ${True}
893 Verify VMI Network Interface Details ${default} ${origin} ${default} ${default}
894 END
Vijay06a169d2020-04-23 09:28:24 -0500895
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500896
897Delete VMI Static IP Address Using Different Users
898 [Documentation] Update user role and delete vmi static IP address.
899 [Arguments] ${username} ${password} ${valid_status_code}
900 [Teardown] Run Keywords Redfish.Login AND
shrsuman123f559cbe2021-01-06 05:40:45 -0600901 ... Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500902 ... ${test_netmask} ${HTTP_ACCEPTED} AND Redfish.Logout
903
904 # Description of argument(s):
905 # username The host username.
906 # password The host password.
907 # valid_status_code The expected valid status code.
908
Megha GN80ef5ca2022-06-09 00:29:57 -0500909 # TODO: operator_user role is not yet supported.
910 Skip If '${username}' == 'operator_user'
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500911 Redfish.Login ${username} ${password}
912 Delete VMI IPv4 Address delete_param=IPv4StaticAddresses valid_status_code=${valid_status_code}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500913
914
915Config VMI Static IP Address Using Different Users
916 [Documentation] Update user role and update vmi static ip address.
917 [Arguments] ${username} ${password} ${ip} ${gateway} ${netmask}
918 ... ${valid_status_code}
919
920 # Description of argument(s):
921 # username The host username.
922 # password The host password.
923 # ip IP address to be added (e.g. "10.7.7.7").
924 # subnet_mask Subnet mask for the IP to be added
925 # (e.g. "255.255.0.0").
926 # gateway Gateway for the IP to be added (e.g. "10.7.7.1").
927 # valid_status_code The expected valid status code.
928
Megha GN80ef5ca2022-06-09 00:29:57 -0500929 # TODO: operator_user role is not yet supported.
930 Skip If '${username}' == 'operator_user'
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500931 Redfish.Login ${username} ${password}
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600932 Set Static IPv4 Address To VMI And Verify ${ip} ${gateway} ${netmask} ${valid_status_code}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500933
934
935Read VMI Static IP Address Using Different Users
936 [Documentation] Update user role and read vmi static ip address.
937 [Arguments] ${username} ${password} ${valid_status_code}
938
939 # Description of argument(s):
940 # username The host username.
941 # password The host password.
942 # valid_status_code The expected valid status code.
943
Megha GN80ef5ca2022-06-09 00:29:57 -0500944 # TODO: operator_user role is not yet supported.
945 Skip If '${username}' == 'operator_user'
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500946 Redfish.Login ${username} ${password}
947 Redfish.Get
shrsuman123bfb851b2021-07-02 04:59:16 -0500948 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500949 ... valid_status_codes=[${valid_status_code}]
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500950
951
952Delete BMC Users Using Redfish
953 [Documentation] Delete BMC users via redfish.
954
955 Redfish.Login
956 Delete BMC Users Via Redfish users=${USERS}
shrsuman123b361d412020-09-30 06:17:23 -0500957
Sweta Potthurid52b2732021-08-12 12:48:24 -0500958
shrsuman123b361d412020-09-30 06:17:23 -0500959Update User Role And Set VMI IPv4 Origin
960 [Documentation] Update User Role And Set VMI IPv4 Origin.
961 [Arguments] ${username} ${password} ${dhcp_enabled} ${valid_status_code}
962
963 # Description of argument(s):
964 # username The host username.
965 # password The host password.
966 # dhcp_enabled Indicates whether dhcp should be enabled
967 # (${True}, ${False}).
968 # valid_status_code The expected valid status code.
969
Megha GNbe428592022-07-21 10:33:02 -0500970 # TODO: operator_user role is not yet supported.
971 Skip If '${username}' == 'operator_user'
shrsuman123b361d412020-09-30 06:17:23 -0500972 Redfish.Login ${username} ${password}
973 Set VMI IPv4 Origin ${dhcp_enabled} ${valid_status_code}
shrsuman123bfb851b2021-07-02 04:59:16 -0500974
Sweta Potthurid52b2732021-08-12 12:48:24 -0500975
shrsuman123bfb851b2021-07-02 04:59:16 -0500976Suite Teardown Execution
977 [Documentation] Do suite teardown execution task.
978
Megha G N1e9f2f32025-05-13 02:18:41 -0500979 IF ${vmi_network_conf} != ${None}
980 Set Static IPv4 Address To VMI And Verify ${vmi_network_conf["IPv4_Address"]}
shrsuman123bfb851b2021-07-02 04:59:16 -0500981 ... ${vmi_network_conf["IPv4_Gateway"]} ${vmi_network_conf["IPv4_SubnetMask"]}
Megha G N1e9f2f32025-05-13 02:18:41 -0500982 END
983
shrsuman123b25343d2021-09-22 04:33:47 -0500984 Delete All Redfish Sessions
shrsuman123bfb851b2021-07-02 04:59:16 -0500985 Redfish.Logout
Megha G N3e2cf0d2025-03-11 12:16:08 -0500986
987
988Set VMI Invalid Static IPv6 Address And Verify
989 [Documentation] Set VMI invalid static IPv6 address and verify it throws an error.
990 [Arguments] ${invalid_vmi_ipv6addr} ${invalid_prefix_length} ${valid_status_codes}
991 ... ${interface}=${ethernet_interface}
992
993 # Description of argument(s):
994 # invalid_vmi_ipv6addr VMI IPv6 address to be added.
995 # invalid_prefix_length Prefix length for the VMI IPv6 to be added.
996 # valid_status_codes Expected status code for PATCH request.
997 # interface VMI interface (eg. eth0 or eth1).
998
999 Set Static VMI IPv6 Address ${invalid_vmi_ipv6addr} ${invalid_prefix_length}
1000 ... ${valid_status_codes}
1001
1002 ${resp}= Redfish.Get /redfish/v1/Systems/hypervisor/EthernetInterfaces/${interface}
1003
1004 @{vmi_ipv6_address}= Get From Dictionary ${resp.dict} IPv6Addresses
1005 ${vmi_ipv6_addr}= Get From List ${vmi_ipv6_address} 0
1006 Should Not Be Equal ${vmi_ipv6_addr["Address"]} ${invalid_vmi_ipv6addr}
Megha G Nf719f242025-03-25 04:09:50 -05001007
1008
1009Delete VMI IPv6 Static Default Gateway Address
1010 [Documentation] Delete VMI IPv6 static default gateway address.
1011 [Arguments] ${valid_status_codes}=${HTTP_ACCEPTED}
1012 ... ${interface}=${ethernet_interface}
1013
1014 # Description of argument(s):
1015 # valid_status_codes Expected valid status code from PATCH request.
1016 # interface VMI interface (eg. eth0 or eth1).
1017
1018 ${data}= Set Variable {"IPv6StaticDefaultGateways": [${Null}]}
1019 Redfish.Patch /redfish/v1/Systems/hypervisor/EthernetInterfaces/${interface}
1020 ... body=${data} valid_status_codes=[${valid_status_codes}]
Megha G N439f7122025-06-02 02:58:39 -05001021
1022
1023Set VMI Valid Static IPv6 Address And Verify
1024 [Documentation] Set valid static VMI IPv6 address and check whether IPv6 origin is set to static
1025 ... and Static IPv6 address is assigned.
1026 [Arguments] ${valid_vmi_ipv6addr} ${valid_prefix_length} ${valid_status_codes}=${HTTP_ACCEPTED}
1027 ... ${interface}=${ethernet_interface}
1028
1029 # Description of argument(s):
1030 # valid_vmi_ipv6addr VMI IPv6 address to be added.
1031 # valid_prefix_length Prefix length for the VMI IPv6 to be added.
1032 # valid_status_codes Expected status code for PATCH request.
1033 # interface VMI interface (eg. eth0 or eth1).
1034
1035 Set Static VMI IPv6 Address ${valid_vmi_ipv6addr} ${valid_prefix_length}
1036 ... ${valid_status_codes}
1037
Megha G N376f6e82025-06-18 03:55:10 -05001038 ${vmi_ipv6}= Verify VMI IPv6 Address Static
1039 Should Be Equal ${vmi_ipv6["Address"]} ${valid_vmi_ipv6addr}