blob: b3069b80924d149f764321a45f20ab1ab4fad89f [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 N02cbfa12022-12-12 02:05:03 -060039
Vijay06a169d2020-04-23 09:28:24 -050040
41*** Test Cases ***
42
43Verify All VMI EthernetInterfaces
44 [Documentation] Verify all VMI ethernet interfaces.
shrsuman1235c7e4d72021-04-16 05:42:57 -050045 [Tags] Verify_All_VMI_EthernetInterfaces
Vijay06a169d2020-04-23 09:28:24 -050046
47 Verify VMI EthernetInterfaces
48
49
50Verify Existing VMI Network Interface Details
51 [Documentation] Verify existing VMI network interface details.
shrsuman1235c7e4d72021-04-16 05:42:57 -050052 [Tags] Verify_Existing_VMI_Network_Interface_Details
Vijay06a169d2020-04-23 09:28:24 -050053
54 ${vmi_ip}= Get VMI Network Interface Details
55 ${origin}= Set Variable If ${vmi_ip["DHCPv4"]} == ${False} Static DHCP
Vijay06a169d2020-04-23 09:28:24 -050056 Should Not Be Equal ${vmi_ip["DHCPv4"]} ${vmi_ip["IPv4StaticAddresses"]}
shrsuman123bfb851b2021-07-02 04:59:16 -050057 Should Be Equal As Strings ${vmi_ip["Id"]} ${ethernet_interface}
George Keishingb3ea0952020-07-01 05:03:56 -050058 Should Be Equal As Strings ${vmi_ip["Description"]}
shrsuman1235c7e4d72021-04-16 05:42:57 -050059 ... Hypervisor's Virtual Management Ethernet Interface
60 Should Be Equal As Strings ${vmi_ip["Name"]} Hypervisor Ethernet Interface
shrsuman1235c7e4d72021-04-16 05:42:57 -050061 Run Keyword If ${vmi_ip["IPv4StaticAddresses"]} != @{empty}
62 ... Verify VMI Network Interface Details ${vmi_ip["IPv4_Address"]}
63 ... ${origin} ${vmi_ip["IPv4_Gateway"]} ${vmi_ip["IPv4_SubnetMask"]}
Vijay06a169d2020-04-23 09:28:24 -050064
65
66Delete Existing Static VMI IP Address
67 [Documentation] Delete existing static VMI IP address.
68 [Tags] Delete_Existing_Static_VMI_IP_Address
69
70 ${curr_origin}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
71 Run Keyword If ${curr_origin} == ${True} Set VMI IPv4 Origin ${False} ${HTTP_ACCEPTED}
72
shrsuman1235c7e4d72021-04-16 05:42:57 -050073 Delete VMI IPv4 Address
Vijay06a169d2020-04-23 09:28:24 -050074
75
76Verify User Cannot Delete ReadOnly Property IPv4Addresses
77 [Documentation] Verify user cannot delete readonly property IPv4Addresses.
78 [Tags] Verify_User_Cannot_Delete_ReadOnly_Property_IPv4Addresses
79
80 ${curr_origin}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
shrsuman1235c7e4d72021-04-16 05:42:57 -050081 Run Keyword If ${curr_origin} == ${True} Set VMI IPv4 Origin ${False} ${HTTP_ACCEPTED}
82 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
shrsuman123b25343d2021-09-22 04:33:47 -050083 Delete VMI IPv4 Address IPv4Addresses valid_status_code=${HTTP_FORBIDDEN}
Vijay06a169d2020-04-23 09:28:24 -050084
85
Anves Kumar rayankula358c41d2020-08-14 04:53:06 -050086Assign Valid And Invalid Static IPv4 Address To VMI
Vijay06a169d2020-04-23 09:28:24 -050087 [Documentation] Assign static IPv4 address to VMI.
Anves Kumar rayankula358c41d2020-08-14 04:53:06 -050088 [Tags] Assign_Valid_And_Invalid_Static_IPv4_Address_To_VMI
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -060089 [Template] Set Static IPv4 Address To VMI And Verify
90 [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution
Vijay06a169d2020-04-23 09:28:24 -050091
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -050092 # ip gateway netmask valid_status_code
Shradha Sumanc7df7db2021-03-08 05:16:44 -060093 10.5.20.30 10.5.20.1 255.255.252.0 ${HTTP_ACCEPTED}
94 a.3.118.94 10.5.20.1 255.255.252.0 ${HTTP_BAD_REQUEST}
Anves Kumar rayankula81fd9db2021-05-10 02:39:51 -050095 10.5.20 10.5.20.1 255.255.252.0 ${HTTP_BAD_REQUEST}
96 10.5.20.-5 10.5.20.1 255.255.252.0 ${HTTP_BAD_REQUEST}
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -050097
Vijay06a169d2020-04-23 09:28:24 -050098
George Keishing16b3c7b2021-01-28 09:23:37 -060099Add Multiple IP Addresses On VMI Interface And Verify
100 [Documentation] Add multiple IP addresses on VMI interface and verify.
101 [Tags] Add_Multiple_IP_Addresses_On_VMI_Interface_And_Verify
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600102 [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution
shrsuman123e37b0cc2020-09-02 00:33:42 -0500103
Shradha Sumanc7df7db2021-03-08 05:16:44 -0600104 ${ip1}= Create dictionary Address=10.5.5.10 SubnetMask=255.255.252.0 Gateway=10.5.5.1
105 ${ip2}= Create dictionary Address=10.5.5.11 SubnetMask=255.255.252.0 Gateway=10.5.5.1
106 ${ip3}= Create dictionary Address=10.5.5.12 SubnetMask=255.255.252.0 Gateway=10.5.5.1
shrsuman123e37b0cc2020-09-02 00:33:42 -0500107 ${ips}= Create List ${ip1} ${ip2} ${ip3}
108
shrsuman123bfb851b2021-07-02 04:59:16 -0500109 Redfish.Patch /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface}
shrsuman123993a5c92021-04-19 06:40:16 -0500110 ... body={'IPv4StaticAddresses':${ips}} valid_status_codes=[${HTTP_BAD_REQUEST}]
shrsuman123e37b0cc2020-09-02 00:33:42 -0500111
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500112
shrsuman123e37b0cc2020-09-02 00:33:42 -0500113Modify IP Addresses On VMI Interface And Verify
114 [Documentation] Modify IP addresses on VMI interface and verify.
115 [Tags] Modify_IP_Addresses_On_VMI_Interface_And_Verify
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600116 [Template] Set Static IPv4 Address To VMI And Verify
117 [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution
shrsuman123e37b0cc2020-09-02 00:33:42 -0500118
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500119 # ip gateway netmask valid_status_code
Shradha Sumanc7df7db2021-03-08 05:16:44 -0600120 10.5.5.10 10.5.5.1 255.255.252.0 ${HTTP_ACCEPTED}
121 10.5.5.11 10.5.5.1 255.255.252.0 ${HTTP_ACCEPTED}
Vijay06a169d2020-04-23 09:28:24 -0500122
Megha GN80ef5ca2022-06-09 00:29:57 -0500123
Vijay06a169d2020-04-23 09:28:24 -0500124Switch Between IP Origins On VMI And Verify Details
125 [Documentation] Switch between IP origins on VMI and verify details.
126 [Tags] Switch_Between_IP_Origins_On_VMI_And_Verify_Details
127
128 Switch VMI IPv4 Origin And Verify Details
129 Switch VMI IPv4 Origin And Verify Details
130
131
132Verify Persistency Of VMI IPv4 Details After Host Reboot
133 [Documentation] Verify persistency of VMI IPv4 details after host reboot.
134 [Tags] Verify_Persistency_Of_VMI_IPv4_Details_After_Host_Reboot
135
136 # Verifying persistency of dynamic address.
137 Set VMI IPv4 Origin ${True} ${HTTP_ACCEPTED}
Anves Kumar rayankula7936eee2021-04-19 05:38:36 -0500138 Redfish Power Off stack_mode=skip
139 Redfish Power On
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500140 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
Vijay06a169d2020-04-23 09:28:24 -0500141
142 # Verifying persistency of static address.
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600143 Switch VMI IPv4 Origin And Verify Details
Anves Kumar rayankula7936eee2021-04-19 05:38:36 -0500144 Redfish Power Off stack_mode=skip
145 Redfish Power On
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600146 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
Vijay06a169d2020-04-23 09:28:24 -0500147
148
Anves Kumar rayankula9fa524a2020-08-18 06:40:18 -0500149Delete VMI Static IP Address And Verify
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500150 [Documentation] Delete VMI static IP address and verify.
151 [Tags] Delete_VMI_Static_IP_Address_And_Verify
152 [Teardown] Test Teardown Execution
Anves Kumar rayankula9fa524a2020-08-18 06:40:18 -0500153
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600154 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
155 Delete VMI IPv4 Address
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500156
Anves Kumar rayankula9fa524a2020-08-18 06:40:18 -0500157
shrsuman123c1d3fe32020-09-08 05:04:07 -0500158Verify Successful VMI IP Static Configuration On HOST Boot After Session Delete
159 [Documentation] Verify VMI IP static Configuration On HOST Boot After session deleted.
160 [Tags] Verify_Successful_VMI_IP_Static_Configuration_On_HOST_Boot_After_Session_Delete
shrsuman123b25343d2021-09-22 04:33:47 -0500161 [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution
shrsuman123c1d3fe32020-09-08 05:04:07 -0500162
shrsuman12375e77062020-09-18 01:08:45 -0500163 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
shrsuman123c1d3fe32020-09-08 05:04:07 -0500164
165 ${session_info}= Get Redfish Session Info
166 Redfish.Delete ${session_info["location"]}
167
168 # Create a new Redfish session
shrsuman1235c7e4d72021-04-16 05:42:57 -0500169 Redfish.Login
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500170 Redfish Power Off
171 Redfish Power On
shrsuman123c1d3fe32020-09-08 05:04:07 -0500172
173 Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask}
174
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500175
shrsuman123c1d3fe32020-09-08 05:04:07 -0500176Verify Persistency Of VMI DHCP IP Configuration After Multiple HOST Reboots
177 [Documentation] Verify Persistency Of VMI DHCP IP configuration After Multiple HOST Reboots
178 [Tags] Verify_Persistency_Of_VMI_DHCP_IP_Configuration_After_Multiple_HOST_Reboots
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500179 [Teardown] Test Teardown Execution
shrsuman123c1d3fe32020-09-08 05:04:07 -0500180
shrsuman123c1d3fe32020-09-08 05:04:07 -0500181 Set VMI IPv4 Origin ${True} ${HTTP_ACCEPTED}
shrsuman123c1d3fe32020-09-08 05:04:07 -0500182 ${vmi_ip_config}= Get VMI Network Interface Details
183 # Verifying persistency of dynamic address after multiple reboots.
shrsuman123f559cbe2021-01-06 05:40:45 -0600184 FOR ${i} IN RANGE ${2}
185 Redfish Power Off
186 Redfish Power On
George Keishing538f1742022-03-14 05:00:55 -0500187 Verify VMI Network Interface Details ${vmi_ip_config["IPv4_Address"]}
188 ... DHCP ${vmi_ip_config["IPv4_Gateway"]} ${vmi_ip_config["IPv4_SubnetMask"]}
shrsuman123f559cbe2021-01-06 05:40:45 -0600189 END
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500190
191
192Enable DHCP When Static IP Configured And Verify Static IP
193 [Documentation] Enable DHCP when static ip configured and verify static ip
George Keishing4203fad2022-01-31 12:22:33 -0600194 [Tags] Enable_DHCP_When_Static_IP_Configured_And_Verify_Static_IP
Shradha Sumanc7df7db2021-03-08 05:16:44 -0600195 [Setup] Redfish Power On
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500196 [Teardown] Test Teardown Execution
197
shrsuman123f559cbe2021-01-06 05:40:45 -0600198 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500199 Set VMI IPv4 Origin ${True}
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500200 ${vmi_network_conf}= Get VMI Network Interface Details
201 Should Not Be Equal As Strings ${test_ipv4} ${vmi_network_conf["IPv4_Address"]}
202
Anves Kumar rayankula9fa524a2020-08-18 06:40:18 -0500203
shrsuman123e37b0cc2020-09-02 00:33:42 -0500204Verify VMI Static IP Configuration Persist On BMC Reset Before Host Boot
205 [Documentation] Verify VMI static IP configuration persist on BMC reset.
206 [Tags] Verify_VMI_Static_IP_Configuration_Persist_On_BMC_Reset_Before_Host_Boot
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600207 [Teardown] Run keywords Delete VMI IPv4 Address AND FFDC On Test Case Fail
shrsuman123e37b0cc2020-09-02 00:33:42 -0500208
shrsuman12375e77062020-09-18 01:08:45 -0500209 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
Megha GNbe428592022-07-21 10:33:02 -0500210 Redfish OBMC Reboot (off) stack_mode=skip
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500211 Redfish Power On
shrsuman123e37b0cc2020-09-02 00:33:42 -0500212 # Verifying the VMI static configuration
213 Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask}
214
Megha GN80ef5ca2022-06-09 00:29:57 -0500215
shrsuman12375e77062020-09-18 01:08:45 -0500216Add Static IP When Host Poweroff And Verify On Poweron
217 [Documentation] Add Static IP When Host Poweroff And Verify on power on
218 [Tags] Add_Static_IP_When_Host_Poweroff_And_Verify_On_Poweron
219 [Setup] Redfish Power Off
220 [Teardown] Run keywords Delete VMI IPv4 Address AND FFDC On Test Case Fail
221
222 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
223 Redfish Power On
224 Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask}
225
Megha GN80ef5ca2022-06-09 00:29:57 -0500226
shrsuman12375e77062020-09-18 01:08:45 -0500227Add VMI Static IP When Host Poweroff And Verify Static IP On BMC Reset
228 [Documentation] Add Static IP When Host Poweroff And Verify Static IP On BMC Reset.
229 [Tags] Add_VMI_Static_IP_When_Host_Poweroff_And_Verify_Static_IP_On_BMC_Reset
230 [Setup] Redfish Power Off
231 [Teardown] Run keywords Delete VMI IPv4 Address AND FFDC On Test Case Fail
232
233 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
Megha GNbe428592022-07-21 10:33:02 -0500234 Redfish OBMC Reboot (off) stack_mode=skip
shrsuman12375e77062020-09-18 01:08:45 -0500235 Redfish Power On
236 Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask}
237
Megha GN80ef5ca2022-06-09 00:29:57 -0500238
shrsuman12375e77062020-09-18 01:08:45 -0500239Enable DHCP When No Static IP Configured And Verify DHCP IP
240 [Documentation] Enable DHCP when no static ip configured and verify dhcp ip
241 [Tags] Enable_DHCP_When_No_Static_IP_Configured_And_Verify_DHCP_IP
242 [Setup] Run Keyword And Ignore Error Delete VMI IPv4 Address
243 [Teardown] Test Teardown Execution
244
245 ${curr_origin}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
246 Run Keyword If ${curr_origin} == ${False} Set VMI IPv4 Origin ${True} ${HTTP_ACCEPTED}
247 ${vmi_ip_config}= Get VMI Network Interface Details
George Keishing538f1742022-03-14 05:00:55 -0500248 Verify VMI Network Interface Details ${vmi_ip_config["IPv4_Address"]}
249 ... DHCP ${vmi_ip_config["IPv4_Gateway"]} ${vmi_ip_config["IPv4_SubnetMask"]}
shrsuman12375e77062020-09-18 01:08:45 -0500250
Megha GN80ef5ca2022-06-09 00:29:57 -0500251
shrsuman12375e77062020-09-18 01:08:45 -0500252Verify User Cannot Delete VMI DHCP IP Address
253 [Documentation] Verify user cannot delete VMI DHCP IP Address
254 [Tags] Verify_User_Cannot_Delete_VMI_DHCP_IP_Address
255 [Setup] Set VMI IPv4 Origin ${True}
256 [Teardown] Test Teardown Execution
257
shrsuman123b25343d2021-09-22 04:33:47 -0500258 Delete VMI IPv4 Address IPv4Addresses valid_status_code=${HTTP_FORBIDDEN}
shrsuman12375e77062020-09-18 01:08:45 -0500259 ${resp}= Redfish.Get
shrsuman123bfb851b2021-07-02 04:59:16 -0500260 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface}
shrsuman12375e77062020-09-18 01:08:45 -0500261 Should Not Be Empty ${resp.dict["IPv4Addresses"]}
262
Megha GN80ef5ca2022-06-09 00:29:57 -0500263
shrsuman12375e77062020-09-18 01:08:45 -0500264Enable DHCP When Static IP Configured DHCP Server Unavailable And Verify IP
265 [Documentation] Enable DHCP When Static IP Configured And DHCP Server Unavailable And Verify No IP.
266 [Tags] Enable_DHCP_When_Static_IP_Configured_DHCP_Server_Unavailable_And_Verify_IP
267 [Teardown] Test Teardown Execution
268
269 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
270 Set VMI IPv4 Origin ${True}
shrsuman12375e77062020-09-18 01:08:45 -0500271 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
272
shrsuman123e37b0cc2020-09-02 00:33:42 -0500273
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500274Verify To Configure VMI Static IP Address With Different User Roles
275 [Documentation] Verify to configure vmi static ip address with different user roles.
276 [Tags] Verify_To_Configure_VMI_Static_IP_Address_With_Different_User_Roles
Megha G N4e2b5732023-02-02 04:52:27 -0600277 [Setup] Run Keywords Delete BMC Users Using Redfish
278 ... AND Create Users With Different Roles users=${USERS} force=${True}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500279 [Template] Config VMI Static IP Address Using Different Users
280 [Teardown] Delete BMC Users Using Redfish
281
282 # username password ip_address gateway nemask valid_status_code
283 admin_user TestPwd123 ${test_ipv4} ${test_gateway} ${test_netmask} ${HTTP_ACCEPTED}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500284 readonly_user TestPwd123 ${test_ipv4} ${test_gateway} ${test_netmask} ${HTTP_FORBIDDEN}
Megha GN80ef5ca2022-06-09 00:29:57 -0500285
286
287Verify To Configure VMI Static IP Address With Operator User Role
288 [Documentation] Verify to configure vmi static ip address with operator user role.
289 [Tags] Verify_To_Configure_VMI_Static_IP_Address_With_Operator_User_Role
290 [Setup] Create Users With Different Roles users=${USERS} force=${True}
291 [Template] Config VMI Static IP Address Using Different Users
292 [Teardown] Delete BMC Users Using Redfish
293
294 # username password ip_address gateway nemask valid_status_code
295 operator_user TestPwd123 ${test_ipv4} ${test_gateway} ${test_netmask} ${HTTP_FORBIDDEN}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500296
297
298Verify To Delete VMI Static IP Address With Different User Roles
299 [Documentation] Verify to delete vmi static IP address with different user roles.
300 [Tags] Verify_To_Delete_VMI_Static_IP_Address_With_Different_User_Roles
301 [Setup] Create Users With Different Roles users=${USERS} force=${True}
302 [Template] Delete VMI Static IP Address Using Different Users
303 [Teardown] Delete BMC Users Using Redfish
304
305 # username password valid_status_code
306 admin_user TestPwd123 ${HTTP_ACCEPTED}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500307 readonly_user TestPwd123 ${HTTP_FORBIDDEN}
Megha GN80ef5ca2022-06-09 00:29:57 -0500308
309
310Verify To Delete VMI Static IP Address With Operator User Role
311 [Documentation] Verify to delete vmi static IP address with operator user role.
312 [Tags] Verify_To_Delete_VMI_Static_IP_Address_With_Operator_User_Role
313 [Setup] Create Users With Different Roles users=${USERS} force=${True}
314 [Template] Delete VMI Static IP Address Using Different Users
315 [Teardown] Delete BMC Users Using Redfish
316
317 # username password valid_status_code
318 operator_user TestPwd123 ${HTTP_FORBIDDEN}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500319
320
321Verify To Update VMI Static IP Address With Different User Roles
322 [Documentation] Verify to update vmi static IP address with different user roles.
George Keishing4203fad2022-01-31 12:22:33 -0600323 [Tags] Verify_To_Update_VMI_Static_IP_Address_With_Different_User_Roles
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500324 [Setup] Create Users With Different Roles users=${USERS} force=${True}
325 [Template] Config VMI Static IP Address Using Different Users
326 [Teardown] Delete BMC Users Using Redfish
327
Shradha Sumanc7df7db2021-03-08 05:16:44 -0600328 # username password ip_address gateway netmask valid_status_code
329 admin_user TestPwd123 10.5.10.20 10.5.10.1 255.255.0.0 ${HTTP_ACCEPTED}
Shradha Sumanc7df7db2021-03-08 05:16:44 -0600330 readonly_user TestPwd123 10.5.20.40 10.5.20.1 255.255.0.0 ${HTTP_FORBIDDEN}
Megha GN80ef5ca2022-06-09 00:29:57 -0500331
332
333Verify To Update VMI Static IP Address With Operator User Role
334 [Documentation] Verify to update vmi static IP address with operator user role.
335 [Tags] Verify_To_Update_VMI_Static_IP_Address_With_Operator_User_Role
336 [Setup] Create Users With Different Roles users=${USERS} force=${True}
337 [Template] Config VMI Static IP Address Using Different Users
338 [Teardown] Delete BMC Users Using Redfish
339
340 # username password ip_address gateway netmask valid_status_code
341 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 -0500342
343
344Verify To Read VMI Network Configuration With Different User Roles
345 [Documentation] Verify to read vmi network configuration with different user roles.
George Keishing4203fad2022-01-31 12:22:33 -0600346 [Tags] Verify_To_Read_VMI_Network_Configuration_With_Different_User_Roles
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500347 [Setup] Create Users With Different Roles users=${USERS} force=${True}
348 [Template] Read VMI Static IP Address Using Different Users
349 [Teardown] Delete BMC Users Using Redfish
350
351 # username password valid_status_code
352 admin_user TestPwd123 ${HTTP_OK}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500353 readonly_user TestPwd123 ${HTTP_OK}
Megha GN80ef5ca2022-06-09 00:29:57 -0500354
355
356Verify To Read VMI Network Configuration With Operator User Role
357 [Documentation] Verify to read vmi network configuration with operator user role.
358 [Tags] Verify_To_Read_VMI_Network_Configuration_With_Operator_User_Role
359 [Setup] Create Users With Different Roles users=${USERS} force=${True}
360 [Template] Read VMI Static IP Address Using Different Users
361 [Teardown] Delete BMC Users Using Redfish
362
363 # username password valid_status_code
364 operator_user TestPwd123 ${HTTP_FORBIDDEN}
365
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500366
shrsuman123b361d412020-09-30 06:17:23 -0500367Enable DHCP On VMI Network Via Different Users Roles And Verify
368 [Documentation] Enable DHCP On VMI Network Via Different Users Roles And Verify.
369 [Tags] Enable_DHCP_On_VMI_Network_Via_Different_Users_Roles_And_Verify
370 [Setup] Create Users With Different Roles users=${USERS} force=${True}
371 [Template] Update User Role And Set VMI IPv4 Origin
372 [Teardown] Delete BMC Users Using Redfish
373
374 # username password dhcp_enabled valid_status_code
375 admin_user TestPwd123 ${True} ${HTTP_ACCEPTED}
shrsuman123b361d412020-09-30 06:17:23 -0500376 readonly_user TestPwd123 ${True} ${HTTP_FORBIDDEN}
Megha GN80ef5ca2022-06-09 00:29:57 -0500377
378
379Enable DHCP On VMI Network Via Operator User Role And Verify
380 [Documentation] Enable DHCP On VMI Network Via Operator User Role And Verify.
381 [Tags] Enable_DHCP_On_VMI_Network_Via_Operator_User_Role_And_Verify
382 [Setup] Create Users With Different Roles users=${USERS} force=${True}
383 [Template] Update User Role And Set VMI IPv4 Origin
384 [Teardown] Delete BMC Users Using Redfish
385
386 # username password dhcp_enabled valid_status_code
387 operator_user TestPwd123 ${True} ${HTTP_FORBIDDEN}
388
shrsuman123b361d412020-09-30 06:17:23 -0500389
390Disable DHCP On VMI Network Via Different Users Roles And Verify
391 [Documentation] Disable DHCP On VMI Network Via Different Users Roles And Verify.
392 [Tags] Disable_DHCP_On_VMI_Network_Via_Different_Users_Roles_And_Verify
393 [Setup] Create Users With Different Roles users=${USERS} force=${True}
394 [Template] Update User Role And Set VMI IPv4 Origin
395 [Teardown] Delete BMC Users Using Redfish
396
397 # username password dhcp_enabled valid_status_code
398 admin_user TestPwd123 ${False} ${HTTP_ACCEPTED}
shrsuman123b361d412020-09-30 06:17:23 -0500399 readonly_user TestPwd123 ${False} ${HTTP_FORBIDDEN}
Megha GN80ef5ca2022-06-09 00:29:57 -0500400
401
402Disable DHCP On VMI Network Via Operator User Role And Verify
403 [Documentation] Disable DHCP On VMI Network Via Operator User Role And Verify.
404 [Tags] Disable_DHCP_On_VMI_Network_Via_Operator_User_Role_And_Verify
405 [Setup] Create Users With Different Roles users=${USERS} force=${True}
406 [Template] Update User Role And Set VMI IPv4 Origin
407 [Teardown] Delete BMC Users Using Redfish
408
409 # username password dhcp_enabled valid_status_code
410 operator_user TestPwd123 ${False} ${HTTP_FORBIDDEN}
shrsuman123b361d412020-09-30 06:17:23 -0500411
shrsuman123e37b0cc2020-09-02 00:33:42 -0500412
Anves Kumar rayankula55b939e2020-08-12 04:19:01 -0500413Enable And Disable DHCP And Verify
414 [Documentation] verify enable DHCP and disable DHCP.
George Keishing4203fad2022-01-31 12:22:33 -0600415 [Tags] Enable_And_Disable_DHCP_And_Verify
Anves Kumar rayankula55b939e2020-08-12 04:19:01 -0500416
417 Set VMI IPv4 Origin ${True}
Anves Kumar rayankula55b939e2020-08-12 04:19:01 -0500418 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
419 Set VMI IPv4 Origin ${False}
Megha GN80ef5ca2022-06-09 00:29:57 -0500420 Verify VMI Network Interface Details ${default} Static ${default} ${default}
Anves Kumar rayankula55b939e2020-08-12 04:19:01 -0500421
422
423Multiple Times Enable And Disable DHCP And Verify
424 [Documentation] Enable and Disable DHCP in a loop and verify VMI gets an IP address from DHCP
425 ... each time when DHCP is enabled
426 [Tags] Multiple_Times_Enable_And_Disable_DHCP_And_Verify
427
Anves Kumar rayankula55b939e2020-08-12 04:19:01 -0500428 FOR ${i} IN RANGE ${2}
429 Set VMI IPv4 Origin ${True}
430 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
431 Set VMI IPv4 Origin ${False}
Megha GN80ef5ca2022-06-09 00:29:57 -0500432 Verify VMI Network Interface Details ${default} Static ${default} ${default}
Anves Kumar rayankula55b939e2020-08-12 04:19:01 -0500433 END
434
435
Anves Kumar rayankula81fd9db2021-05-10 02:39:51 -0500436Assign Static IPv4 Address With Invalid Netmask To VMI
437 [Documentation] Assign static IPv4 address with invalid netmask and expect error.
438 [Tags] Assign_Static_IPv4_Address_With_Invalid_Netmask_To_VMI
439 [Template] Set Static IPv4 Address To VMI And Verify
440
441 # ip gateway netmask valid_status_code
442 ${test_ipv4} ${test_gateway} 255.256.255.0 ${HTTP_BAD_REQUEST}
443 ${test_ipv4} ${test_gateway} ff.ff.ff.ff ${HTTP_BAD_REQUEST}
444 ${test_ipv4} ${test_gateway} 255.255.253.0 ${HTTP_BAD_REQUEST}
445
446
447Assign Static IPv4 Address With Invalid Gateway To VMI
448 [Documentation] Add static IPv4 address with invalid gateway and expect error.
449 [Tags] Assign_Static_IPv4_Address_With_Invalid_Gateway_To_VMI
450 [Template] Set Static IPv4 Address To VMI And Verify
451
452 # ip gateway netmask valid_status_code
453 ${test_ipv4} @@@.%%.44.11 ${test_netmask} ${HTTP_BAD_REQUEST}
454 ${test_ipv4} 0xa.0xb.0xc.0xd ${test_netmask} ${HTTP_BAD_REQUEST}
455 ${test_ipv4} 10.3.36 ${test_netmask} ${HTTP_BAD_REQUEST}
456 ${test_ipv4} 10.3.36.-10 ${test_netmask} ${HTTP_BAD_REQUEST}
457
458
Megha G N02cbfa12022-12-12 02:05:03 -0600459Enable DHCP When Host Is Off And Verify After Poweron
460 [Documentation] Enable DHCP when host is off and
461 ... check whether it is enabled after poweron.
462 [Tags] Enable_DHCP_When_Host_Is_Off_And_Verify_After_Poweron
463 [Setup] Redfish Power Off stack_mode=skip
464
465 Set VMI IPv4 Origin ${True}
466 Redfish Power On stack_mode=skip
467 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
468
469
Megha G N89174682023-01-24 23:28:27 -0600470Disable DHCP When Host Is Off And Verify New State Reflects After Power On
471 [Documentation] Disable DHCP when host is off and
472 ... get network info and verify that VMI origin is static.
473 [Tags] Disable_DHCP_When_Host_Is_Off_And_Verify_New_State_Reflects_After_Power_On
474 [Setup] Redfish Power Off stack_mode=skip
475
476 Set VMI IPv4 Origin ${False}
477 Redfish Power On stack_mode=skip
478 Verify VMI Network Interface Details ${default} Static ${default} ${default}
479
480
Megha G N38acd842024-10-14 14:28:11 -0500481Enable VMI Stateless Address AutoConfig And Verify
482 [Documentation] Enable VMI SLAACv6 and verify an origin.
483 [Tags] Enable_VMI_Stateless_Address_AutoConfig_And_Verify
484
485 Set VMI SLAACv6 Origin ${True}
486
487 # Check origin is set to slaac and address are getting displayed.
488 Verify VMI IPv6 Address SLAAC
489
490
Megha G Ne8c0e422024-12-04 03:12:55 -0600491Disable VMI Stateless Address AutoConfig And Verify
492 [Documentation] Disable VMI SLAACv6 and verify an origin.
493 [Tags] Disable_VMI_Stateless_Address_AutoConfig_And_Verify
494 [Setup] Set VMI SLAACv6 Origin ${True}
495
496 Set VMI SLAACv6 Origin ${False}
497
498 # Check origin is set to static and slaacv6 address are getting erased.
499 Verify VMI IPv6 Address Static
500
501
Megha G Na37b8da2025-01-06 00:23:15 -0600502Enable VMI SLAAC And Check Persistency On BMC Reboot
503 [Documentation] Enable VMI SLAACv6 and verify its persistency
504 ... on BMC reboot and this works on the setup where router
Megha G Na727d5b2025-02-06 04:41:47 -0600505 ... advertises network prefix.
Megha G Na37b8da2025-01-06 00:23:15 -0600506 [Tags] Enable_VMI_SLAAC_And_Check_Persistency_On_BMC_Reboot
507
508 Set VMI SLAACv6 Origin ${True}
509
510 # Reboot BMC and verify persistency.
511 OBMC Reboot (off)
512 Redfish Power On
513 Wait For Host Boot Progress To Reach Required State
Megha G Na727d5b2025-02-06 04:41:47 -0600514 Sleep 5s
Megha G Na37b8da2025-01-06 00:23:15 -0600515
516 # Check origin is set to slaac and address are getting displayed.
517 ${vmi_ipv6addr}= Verify VMI IPv6 Address SLAAC
518 Should Not Be Equal ${vmi_ipv6addr["Address"]} ${default_ipv6addr}
519
520
Megha G N49657382025-01-07 23:10:42 -0600521Disable VMI SLAAC And Check Persistency On BMC Reboot
522 [Documentation] Disable VMI SLAACv6 and verify its persistency
523 ... on BMC reboot.
524 [Tags] Disable_VMI_SLAAC_And_Check_Persistency_On_BMC_Reboot
525
526 Set VMI SLAACv6 Origin ${False}
527
528 # Reboot BMC and verify persistency.
529 OBMC Reboot (off)
530 Redfish Power On
531 Wait For Host Boot Progress To Reach Required State
532
533 # Check if origin is set to static and SLAAC address are getting erased.
534 ${vmi_ipv6addr}= Verify VMI IPv6 Address Static
535 Should Be Equal ${vmi_ipv6addr["Address"]} ${default_ipv6addr}
536
537
Megha G N503fa352025-01-08 04:43:09 -0600538Disable VMI DHCPv4 When SLAAC Is Enabled And Verify
539 [Documentation] Disable VMI DHCPv4 parameter when SLAACv6 is enabled
540 ... and check whether the IPv4 address origin is set to static and
541 ... DHCPv4 address is getting erased.
542 [Tags] Disable_VMI_DHCPv4_When_SLAAC_Is_Enabled_And_Verify
543 [Setup] Set VMI IPv4 Origin ${True}
544
545 # Set IPv6 origin to SLAAC.
546 Set VMI SLAACv6 Origin ${True}
547 Verify VMI IPv6 Address SLAAC
548
549 # Disable VMI DHCPv4 and check IPv4 address origin is set to static.
550 Set VMI IPv4 Origin ${False}
551 Verify VMI Network Interface Details ${default} Static ${default} ${default}
552
553
Megha G Ndf255642025-01-10 02:12:21 -0600554Enable VMI SLAAC When DHCPv6 Is Enabled And Verify
555 [Documentation] Enable VMI SLAACv6 when VMI DHCPv6 is enabled and
556 ... check IPv6 gets Slaac address and this works on the setup
557 ... where router advertise network prefix.
558 [Tags] Enable_VMI_SLAAC_When_DHCPv6_Is_Enabled_And_Verify
559
560 Set VMI DHCPv6 Property Enabled
561
562 # Enable SLAAC and check whether IPv6 origin is set to SLAAC.
563 Set VMI SLAACv6 Origin ${True}
564
565 # Check if origin is set to slaac and address are getting displayed.
566 ${vmi_ipv6addr}= Verify VMI IPv6 Address SLAAC
567 Should Not Be Equal ${vmi_ipv6addr["Address"]} ${default_ipv6addr}
568 Should Be Equal ${vmi_ipv6addr["PrefixLength"]} ${prefix_length}
569
570
Megha G N80b4af32025-01-15 00:47:35 -0600571Disable VMI DHCPv6 Property And Verify
George Keishing4ebb3282025-01-17 10:01:34 +0530572 [Documentation] Disable VMI DHCPv6 property and verify IPv6 address
573 ... origin is set to static and DHCPv6 address is erased.
574 [Tags] Disable_VMI_DHCPv6_Property_And_Verify
Megha G N80b4af32025-01-15 00:47:35 -0600575 [Setup] Set VMI DHCPv6 Property Enabled
576
577 Set VMI DHCPv6 Property Disabled
578
579 # Verify IPv6 address origin is set to static and DHCPv6 address is erased.
580 ${vmi_ipv6addr}= Verify VMI IPv6 Address Static
581 Should Be Equal ${vmi_ipv6addr["Address"]} ${default_ipv6addr}
582
583
Megha G N58be5122025-01-16 08:26:53 -0600584Enable VMI SLAAC When DHCPv4 Is Enabled And Verify
585 [Documentation] On VMI enable SLAAC when DHCPv4 is enabled and verify DHCPv4 settings are intact
586 ... and IPv6 origin is set to SLAAC & it gets assigned with SLAAC IPv6 address and this
587 ... works on the setup where router advertise network prefix.
588 [Tags] Enable_VMI_SLAAC_When_DHCPv4_Is_Enabled_And_Verify
589 [Setup] Set VMI IPv4 Origin ${True}
590
591 # Enable Autoconfig address and check whether IPv6 address origin is set to SLAAC.
592 Set VMI SLAACv6 Origin ${True}
593 Verify VMI IPv6 Address SLAAC
594
595 # Check there is no impact on IPv4 settings, IPv4 address origin should be DHCP.
596 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
597
598
Megha G Nf9867142025-02-03 23:10:57 -0600599Disable VMI DHCPv6 Property And Check Persistency On BMC Reboot
600 [Documentation] Disable VMI DHCPv6 property and verify its persistency on
601 ... BMC reboot.
602 [Tags] Disable_VMI_DHCPv6_Property_And_Check_Persistency_On_BMC_Reboot
603 [Setup] Set VMI DHCPv6 Property Enabled
604
605 Set VMI DHCPv6 Property Disabled
606
607 # Reboot BMC and verify persistency.
608 OBMC Reboot (off)
609
610 # Verify IPv6 address origin is set to Static and DHCPv6 address is erased.
611 ${vmi_ipv6addr}= Verify VMI IPv6 Address Static
612 Should Be Equal ${vmi_ipv6addr["Address"]} ${default_ipv6addr}
613
614
Megha G N95e37d82025-02-06 03:56:04 -0600615Enable VMI SLAAC When IPv4 Origin Is Static And Verify
616 [Documentation] On VMI enable SLAAC when IPv4 origin is static and verify IPv4 settings are intact
617 ... and IPv6 origin is set to SLAAC & it gets assigned with SLAAC IPv6 address and this works
618 ... on the setup where router advertise network prefix.
619 [Tags] Enable_VMI_SLAAC_When_IPv4_Origin_Is_Static_And_Verify
620 [Setup] Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
621 [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution
622
623 # Enable Autoconfig address and check whether IPv6 address origin is set to SLAAC.
624 Set VMI SLAACv6 Origin ${True}
625 Verify VMI IPv6 Address SLAAC
626
627 # Check there is no impact on IPv4 settings, IPv4 address origin should be Static.
628 Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask}
629
630
Megha G N97af3bf2025-02-27 10:32:08 -0600631Configure Static VMI IPv6 Address And Verify
632 [Documentation] Add static VMI IPv6 address and check whether IPv6 origin is set to static
633 ... and Static IPv6 address is assigned.
634 [Tags] Configure_Static_VMI_IPv6_Address_And_Verify
635
636 Set Static VMI IPv6 Address ${test_vmi_ipv6addr} ${prefix_length}
637
638 # Verify IPv6 address origin is set to static and static IPv6 address is assigned.
639 ${vmi_ipv6addr}= Verify VMI IPv6 Address Static
640 Should Not Be Equal ${vmi_ipv6addr["Address"]} ${default_ipv6addr}
641 Should Be Equal ${vmi_ipv6addr["PrefixLength"]} ${prefix_length}
642
643
Megha G Ne0e055d2025-02-28 02:16:06 -0600644Configure IPv6 Static Default Gateway On VMI And Verify
645 [Documentation] Configure IPv6 static default gateway on VMI and verify.
646 [Tags] Configure_IPv6_Static_Default_Gateway_On_VMI_And_Verify
Megha G N1361edf2025-03-18 03:09:41 -0500647 [Setup] Set Static VMI IPv6 Address ${test_vmi_ipv6addr} ${prefix_length}
Megha G Ne0e055d2025-02-28 02:16:06 -0600648
649 Set VMI IPv6 Static Default Gateway ${test_vmi_ipv6gateway}
650
651 ${resp}= Redfish.Get
652 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface}
Megha G N1361edf2025-03-18 03:09:41 -0500653 ${vmi_ipv6_gateways}= Get From Dictionary ${resp.dict} IPv6StaticDefaultGateways
654 ${vmi_ipv6_gateway} = Get From List ${vmi_ipv6_gateways} 0
655 Should Be Equal ${vmi_ipv6_gateway["Address"]} ${test_vmi_ipv6gateway}
Megha G Ne0e055d2025-02-28 02:16:06 -0600656
657
Megha G Na2148332025-03-06 07:28:15 -0600658Delete VMI Static IPv6 Address And Verify
659 [Documentation] Delete VMI static IPv6 address and verify address is erased.
660 [Tags] Delete_VMI_Static_IPv6_Address_And_Verify
661 [Setup] Set Static VMI IPv6 Address ${test_vmi_ipv6addr} ${prefix_length}
662
663 # Delete VMI static IPv6 address.
664 Delete VMI IPv6 Static Address
665
666 # Verify VMI static IPv6 address is erased.
667 ${vmi_ipv6addr}= Verify VMI IPv6 Address Static
668 Should Not Be Equal ${vmi_ipv6addr["Address"]} ${test_vmi_ipv6addr}
669 Should Be Equal ${vmi_ipv6addr["Address"]} ${default_ipv6addr}
670
671
Megha G Nd9ba2b42025-03-07 05:27:10 -0600672Enable VMI DHCPv6 When IPv6 Origin Is Static And Verify
673 [Documentation] Enable VMI DHCPv6 when IPv6 origin is in static and verify
674 ... origin is set to DHCP and check if static IPv6 address is erased.
675 [Tags] Enable_VMI_DHCPv6_When_IPv6_Origin_Is_Static_And_Verify
676
677 Set Static VMI IPv6 Address ${test_vmi_ipv6addr} ${prefix_length}
678 ${vmi_ipv6addr_static}= Verify VMI IPv6 Address Static
679
680 Sleep 5s
681
682 # Enable DHCPv6 property.
683 Set VMI DHCPv6 Property Enabled
684
685 # Check origin is set to DHCP and static IPv6 address is erased.
686 ${vmi_dhcpv6addr}= Verify VMI IPv6 Address DHCPv6
687 Should Not Be Equal ${vmi_dhcpv6addr["Address"]} ${vmi_ipv6addr_static["Address"]}
688
689
Megha G N3e2cf0d2025-03-11 12:16:08 -0500690Configure Invalid Static IPv6 To VMI And Verify
691 [Documentation] Configure invalid static IPv6 address to VMI and verify that address
692 ... does not get assigned and it throws an error.
693 [Tags] Configure_Invalid_Static_IPv6_To_VMI_And_Verify
694 [Setup] Set Static VMI IPv6 Address ${test_vmi_ipv6addr} ${prefix_length}
695 [Template] Set VMI Invalid Static IPv6 Address And Verify
696
697 # invalid_vmi_ipv6addr invalid_prefix_length valid_status_codes
698 ${default_ipv6addr} 128 ${HTTP_BAD_REQUEST}
699 ${multicast_ipv6addr} 8 ${HTTP_BAD_REQUEST}
700 ${loopback_ipv6addr} 64 ${HTTP_BAD_REQUEST}
701 ${ipv4_hexword_addr} 64 ${HTTP_BAD_REQUEST}
702
703
Megha G Nf719f242025-03-25 04:09:50 -0500704Delete IPv6 Static Default Gateway On VMI And Verify
705 [Documentation] Delete IPv6 static default gateway and verify address is erased.
706 [Tags] Delete_IPv6_Static_Default_Gateway_On_VMI_And_Verify
707 [Setup] Run Keywords Set Static VMI IPv6 Address ${test_vmi_ipv6addr} ${prefix_length}
708 ... AND Set VMI IPv6 Static Default Gateway ${test_vmi_ipv6gateway}
709
710 # Delete IPv6 static default gateway address.
711 Delete VMI IPv6 Static Default Gateway Address
712
713 Sleep 5s
714
715 # Verify static IPv6 default gateway address is deleted.
716 ${resp}= Redfish.Get
717 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface}
718 Should Be Empty ${resp.dict["IPv6StaticDefaultGateways"]}
719
720
Vijay06a169d2020-04-23 09:28:24 -0500721*** Keywords ***
722
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500723Suite Setup Execution
724 [Documentation] Do test setup execution task.
725
726 Redfish.Login
Megha G Nd0b4da92024-02-08 15:04:24 -0600727
728 Redfish Power Off
729 Set BIOS Attribute pvm_hmc_managed Enabled
Megha G N1e538242024-06-11 03:42:03 -0500730 Set BIOS Attribute pvm_stop_at_standby Disabled
731
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500732 Redfish Power On
Megha G N1e538242024-06-11 03:42:03 -0500733 Wait For Host Boot Progress To Reach Required State
Megha G N86507da2024-02-07 23:16:27 -0600734
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500735 ${active_channel_config}= Get Active Channel Config
736 Set Suite Variable ${active_channel_config}
shrsuman123bfb851b2021-07-02 04:59:16 -0500737 Set Suite Variable ${ethernet_interface} ${active_channel_config['${CHANNEL_NUMBER}']['name']}
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500738 ${resp}= Redfish.Get
shrsuman123bfb851b2021-07-02 04:59:16 -0500739 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface}
shrsuman12362e5be52021-05-20 02:42:59 -0500740 ${ip_resp}= Evaluate json.loads(r'''${resp.text}''') json
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500741 ${length}= Get Length ${ip_resp["IPv4StaticAddresses"]}
742 ${vmi_network_conf}= Run Keyword If ${length} != ${0} Get VMI Network Interface Details
743 Set Suite Variable ${vmi_network_conf}
744
745
746Test Teardown Execution
747 [Documentation] Do test teardown execution task.
748
749 FFDC On Test Case Fail
750 ${curr_mode}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
751 Run Keyword If ${curr_mode} == ${True} Set VMI IPv4 Origin ${False}
Megha G N1e538242024-06-11 03:42:03 -0500752 Run Keyword If '${vmi_network_conf["IPv4_Address"]}' != '${default}'
shrsuman123f559cbe2021-01-06 05:40:45 -0600753 ... Set Static IPv4 Address To VMI And Verify ${vmi_network_conf["IPv4_Address"]}
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500754 ... ${vmi_network_conf["IPv4_Gateway"]} ${vmi_network_conf["IPv4_SubnetMask"]}
755
756
Vijay06a169d2020-04-23 09:28:24 -0500757Get Immediate Child Parameter From VMI Network Interface
758 [Documentation] Get immediate child parameter from VMI network interface.
759 [Arguments] ${parameter} ${valid_status_code}=${HTTP_OK}
760
761 # Description of argument(s):
762 # parameter parameter for which value is required. Ex: DHCPEnabled, MACAddress etc.
763 # valid_status_code Expected valid status code from GET request.
764
Anves Kumar rayankula358c41d2020-08-14 04:53:06 -0500765 ${resp}= Redfish.Get
shrsuman123bfb851b2021-07-02 04:59:16 -0500766 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface}
Vijay06a169d2020-04-23 09:28:24 -0500767 ... valid_status_codes=[${valid_status_code}]
768
shrsuman12362e5be52021-05-20 02:42:59 -0500769 ${ip_resp}= Evaluate json.loads(r'''${resp.text}''') json
Vijay06a169d2020-04-23 09:28:24 -0500770 ${value}= Set Variable If '${parameter}' != 'DHCPEnabled' ${ip_resp["${parameter}"]}
771 ... ${ip_resp["DHCPv4"]["${parameter}"]}
772
George Keishing409df052024-01-17 22:36:14 +0530773 RETURN ${value}
Vijay06a169d2020-04-23 09:28:24 -0500774
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600775
Vijay06a169d2020-04-23 09:28:24 -0500776Switch VMI IPv4 Origin And Verify Details
777 [Documentation] Switch VMI IPv4 origin and verify details.
Vijay06a169d2020-04-23 09:28:24 -0500778
Anves Kumar rayankula7936eee2021-04-19 05:38:36 -0500779 ${dhcp_mode_before}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
Anves Kumar rayankulae7dc89a2021-04-28 04:29:38 -0500780 ${dhcp_enabled}= Set Variable If ${dhcp_mode_before} == ${False} ${True} ${False}
Vijay06a169d2020-04-23 09:28:24 -0500781
Anves Kumar rayankulae7dc89a2021-04-28 04:29:38 -0500782 ${origin}= Set Variable If ${dhcp_mode_before} == ${False} DHCP Static
Vijay06a169d2020-04-23 09:28:24 -0500783 Set VMI IPv4 Origin ${dhcp_enabled} ${HTTP_ACCEPTED}
Anves Kumar rayankula7936eee2021-04-19 05:38:36 -0500784
785 ${dhcp_mode_after}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
786 Should Not Be Equal ${dhcp_mode_before} ${dhcp_mode_after}
787
788 Run Keyword If ${dhcp_mode_after} == ${True}
789 ... Verify VMI Network Interface Details ${default} ${origin} ${default} ${default}
Vijay06a169d2020-04-23 09:28:24 -0500790
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500791
792Delete VMI Static IP Address Using Different Users
793 [Documentation] Update user role and delete vmi static IP address.
794 [Arguments] ${username} ${password} ${valid_status_code}
795 [Teardown] Run Keywords Redfish.Login AND
shrsuman123f559cbe2021-01-06 05:40:45 -0600796 ... Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500797 ... ${test_netmask} ${HTTP_ACCEPTED} AND Redfish.Logout
798
799 # Description of argument(s):
800 # username The host username.
801 # password The host password.
802 # valid_status_code The expected valid status code.
803
Megha GN80ef5ca2022-06-09 00:29:57 -0500804 # TODO: operator_user role is not yet supported.
805 Skip If '${username}' == 'operator_user'
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500806 Redfish.Login ${username} ${password}
807 Delete VMI IPv4 Address delete_param=IPv4StaticAddresses valid_status_code=${valid_status_code}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500808
809
810Config VMI Static IP Address Using Different Users
811 [Documentation] Update user role and update vmi static ip address.
812 [Arguments] ${username} ${password} ${ip} ${gateway} ${netmask}
813 ... ${valid_status_code}
814
815 # Description of argument(s):
816 # username The host username.
817 # password The host password.
818 # ip IP address to be added (e.g. "10.7.7.7").
819 # subnet_mask Subnet mask for the IP to be added
820 # (e.g. "255.255.0.0").
821 # gateway Gateway for the IP to be added (e.g. "10.7.7.1").
822 # valid_status_code The expected valid status code.
823
Megha GN80ef5ca2022-06-09 00:29:57 -0500824 # TODO: operator_user role is not yet supported.
825 Skip If '${username}' == 'operator_user'
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500826 Redfish.Login ${username} ${password}
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600827 Set Static IPv4 Address To VMI And Verify ${ip} ${gateway} ${netmask} ${valid_status_code}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500828
829
830Read VMI Static IP Address Using Different Users
831 [Documentation] Update user role and read vmi static ip address.
832 [Arguments] ${username} ${password} ${valid_status_code}
833
834 # Description of argument(s):
835 # username The host username.
836 # password The host password.
837 # valid_status_code The expected valid status code.
838
Megha GN80ef5ca2022-06-09 00:29:57 -0500839 # TODO: operator_user role is not yet supported.
840 Skip If '${username}' == 'operator_user'
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500841 Redfish.Login ${username} ${password}
842 Redfish.Get
shrsuman123bfb851b2021-07-02 04:59:16 -0500843 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500844 ... valid_status_codes=[${valid_status_code}]
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500845
846
847Delete BMC Users Using Redfish
848 [Documentation] Delete BMC users via redfish.
849
850 Redfish.Login
851 Delete BMC Users Via Redfish users=${USERS}
shrsuman123b361d412020-09-30 06:17:23 -0500852
Sweta Potthurid52b2732021-08-12 12:48:24 -0500853
shrsuman123b361d412020-09-30 06:17:23 -0500854Update User Role And Set VMI IPv4 Origin
855 [Documentation] Update User Role And Set VMI IPv4 Origin.
856 [Arguments] ${username} ${password} ${dhcp_enabled} ${valid_status_code}
857
858 # Description of argument(s):
859 # username The host username.
860 # password The host password.
861 # dhcp_enabled Indicates whether dhcp should be enabled
862 # (${True}, ${False}).
863 # valid_status_code The expected valid status code.
864
Megha GNbe428592022-07-21 10:33:02 -0500865 # TODO: operator_user role is not yet supported.
866 Skip If '${username}' == 'operator_user'
shrsuman123b361d412020-09-30 06:17:23 -0500867 Redfish.Login ${username} ${password}
868 Set VMI IPv4 Origin ${dhcp_enabled} ${valid_status_code}
shrsuman123bfb851b2021-07-02 04:59:16 -0500869
Sweta Potthurid52b2732021-08-12 12:48:24 -0500870
shrsuman123bfb851b2021-07-02 04:59:16 -0500871Suite Teardown Execution
872 [Documentation] Do suite teardown execution task.
873
874 Run Keyword If ${vmi_network_conf} != ${None}
875 ... Set Static IPv4 Address To VMI And Verify ${vmi_network_conf["IPv4_Address"]}
876 ... ${vmi_network_conf["IPv4_Gateway"]} ${vmi_network_conf["IPv4_SubnetMask"]}
shrsuman123b25343d2021-09-22 04:33:47 -0500877 Delete All Redfish Sessions
shrsuman123bfb851b2021-07-02 04:59:16 -0500878 Redfish.Logout
Megha G N3e2cf0d2025-03-11 12:16:08 -0500879
880
881Set VMI Invalid Static IPv6 Address And Verify
882 [Documentation] Set VMI invalid static IPv6 address and verify it throws an error.
883 [Arguments] ${invalid_vmi_ipv6addr} ${invalid_prefix_length} ${valid_status_codes}
884 ... ${interface}=${ethernet_interface}
885
886 # Description of argument(s):
887 # invalid_vmi_ipv6addr VMI IPv6 address to be added.
888 # invalid_prefix_length Prefix length for the VMI IPv6 to be added.
889 # valid_status_codes Expected status code for PATCH request.
890 # interface VMI interface (eg. eth0 or eth1).
891
892 Set Static VMI IPv6 Address ${invalid_vmi_ipv6addr} ${invalid_prefix_length}
893 ... ${valid_status_codes}
894
895 ${resp}= Redfish.Get /redfish/v1/Systems/hypervisor/EthernetInterfaces/${interface}
896
897 @{vmi_ipv6_address}= Get From Dictionary ${resp.dict} IPv6Addresses
898 ${vmi_ipv6_addr}= Get From List ${vmi_ipv6_address} 0
899 Should Not Be Equal ${vmi_ipv6_addr["Address"]} ${invalid_vmi_ipv6addr}
Megha G Nf719f242025-03-25 04:09:50 -0500900
901
902Delete VMI IPv6 Static Default Gateway Address
903 [Documentation] Delete VMI IPv6 static default gateway address.
904 [Arguments] ${valid_status_codes}=${HTTP_ACCEPTED}
905 ... ${interface}=${ethernet_interface}
906
907 # Description of argument(s):
908 # valid_status_codes Expected valid status code from PATCH request.
909 # interface VMI interface (eg. eth0 or eth1).
910
911 ${data}= Set Variable {"IPv6StaticDefaultGateways": [${Null}]}
912 Redfish.Patch /redfish/v1/Systems/hypervisor/EthernetInterfaces/${interface}
913 ... body=${data} valid_status_codes=[${valid_status_codes}]