blob: 0fd28d25ae804c524820dc4c5c01e7d9a7661e23 [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
Megha G Na48b0eb2025-06-26 04:07:44 -050021${test_ipv4} 10.6.6.6
22${test_gateway} 10.6.6.1
23${test_netmask} 255.255.252.0
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -050024
Megha G Na48b0eb2025-06-26 04:07:44 -050025&{DHCP_ENABLED} DHCPEnabled=${${True}}
26&{DHCP_DISABLED} DHCPEnabled=${${False}}
Vijay06a169d2020-04-23 09:28:24 -050027
Megha G Na48b0eb2025-06-26 04:07:44 -050028&{ENABLE_DHCP} DHCPv4=&{DHCP_ENABLED}
29&{DISABLE_DHCP} DHCPv4=&{DHCP_DISABLED}
Vijay06a169d2020-04-23 09:28:24 -050030
Megha G Na48b0eb2025-06-26 04:07:44 -050031${default} 0.0.0.0
32${default_ipv6addr} ::
33${prefix_length} ${64}
34${test_vmi_ipv6addr} 2001:db8:1111:2222:10:5:5:6
35${test_vmi_ipv6gateway} 2001:db8:1111:2222::1
36${ipv4_hexword_addr} 10.5.5.6:1A:1B:1C:1D:1E:1F
37${multicast_ipv6addr} FF00
38${loopback_ipv6addr} ::1
39${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
42${ipv4_mapped_ipv6aadr} 00::FFFF:10.5.5.6
43${compressed_1hextet_ipv6aadr} 2001:DB8::1234:8:800:200c:417A
Megha G N02cbfa12022-12-12 02:05:03 -060044
Vijay06a169d2020-04-23 09:28:24 -050045
46*** Test Cases ***
47
48Verify All VMI EthernetInterfaces
49 [Documentation] Verify all VMI ethernet interfaces.
shrsuman1235c7e4d72021-04-16 05:42:57 -050050 [Tags] Verify_All_VMI_EthernetInterfaces
Vijay06a169d2020-04-23 09:28:24 -050051
52 Verify VMI EthernetInterfaces
53
54
55Verify Existing VMI Network Interface Details
56 [Documentation] Verify existing VMI network interface details.
shrsuman1235c7e4d72021-04-16 05:42:57 -050057 [Tags] Verify_Existing_VMI_Network_Interface_Details
Vijay06a169d2020-04-23 09:28:24 -050058
59 ${vmi_ip}= Get VMI Network Interface Details
60 ${origin}= Set Variable If ${vmi_ip["DHCPv4"]} == ${False} Static DHCP
Vijay06a169d2020-04-23 09:28:24 -050061 Should Not Be Equal ${vmi_ip["DHCPv4"]} ${vmi_ip["IPv4StaticAddresses"]}
shrsuman123bfb851b2021-07-02 04:59:16 -050062 Should Be Equal As Strings ${vmi_ip["Id"]} ${ethernet_interface}
George Keishingb3ea0952020-07-01 05:03:56 -050063 Should Be Equal As Strings ${vmi_ip["Description"]}
shrsuman1235c7e4d72021-04-16 05:42:57 -050064 ... Hypervisor's Virtual Management Ethernet Interface
65 Should Be Equal As Strings ${vmi_ip["Name"]} Hypervisor Ethernet Interface
Megha G N1e9f2f32025-05-13 02:18:41 -050066 IF ${vmi_ip["IPv4StaticAddresses"]} != @{empty}
67 Verify VMI Network Interface Details ${vmi_ip["IPv4_Address"]}
68 ... ${origin} ${vmi_ip["IPv4_Gateway"]} ${vmi_ip["IPv4_SubnetMask"]}
69 END
Vijay06a169d2020-04-23 09:28:24 -050070
71
72Delete Existing Static VMI IP Address
73 [Documentation] Delete existing static VMI IP address.
74 [Tags] Delete_Existing_Static_VMI_IP_Address
75
76 ${curr_origin}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
Megha G N1e9f2f32025-05-13 02:18:41 -050077 IF ${curr_origin} == ${True}
78 Set VMI IPv4 Origin ${False} ${HTTP_ACCEPTED}
79 END
Vijay06a169d2020-04-23 09:28:24 -050080
shrsuman1235c7e4d72021-04-16 05:42:57 -050081 Delete VMI IPv4 Address
Vijay06a169d2020-04-23 09:28:24 -050082
83
84Verify User Cannot Delete ReadOnly Property IPv4Addresses
85 [Documentation] Verify user cannot delete readonly property IPv4Addresses.
86 [Tags] Verify_User_Cannot_Delete_ReadOnly_Property_IPv4Addresses
87
88 ${curr_origin}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
Megha G N1e9f2f32025-05-13 02:18:41 -050089 IF ${curr_origin} == ${True}
90 Set VMI IPv4 Origin ${False} ${HTTP_ACCEPTED}
91 END
shrsuman1235c7e4d72021-04-16 05:42:57 -050092 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
shrsuman123b25343d2021-09-22 04:33:47 -050093 Delete VMI IPv4 Address IPv4Addresses valid_status_code=${HTTP_FORBIDDEN}
Vijay06a169d2020-04-23 09:28:24 -050094
95
Anves Kumar rayankula358c41d2020-08-14 04:53:06 -050096Assign Valid And Invalid Static IPv4 Address To VMI
Vijay06a169d2020-04-23 09:28:24 -050097 [Documentation] Assign static IPv4 address to VMI.
Anves Kumar rayankula358c41d2020-08-14 04:53:06 -050098 [Tags] Assign_Valid_And_Invalid_Static_IPv4_Address_To_VMI
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -060099 [Template] Set Static IPv4 Address To VMI And Verify
100 [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution
Vijay06a169d2020-04-23 09:28:24 -0500101
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500102 # ip gateway netmask valid_status_code
Shradha Sumanc7df7db2021-03-08 05:16:44 -0600103 10.5.20.30 10.5.20.1 255.255.252.0 ${HTTP_ACCEPTED}
104 a.3.118.94 10.5.20.1 255.255.252.0 ${HTTP_BAD_REQUEST}
Anves Kumar rayankula81fd9db2021-05-10 02:39:51 -0500105 10.5.20 10.5.20.1 255.255.252.0 ${HTTP_BAD_REQUEST}
106 10.5.20.-5 10.5.20.1 255.255.252.0 ${HTTP_BAD_REQUEST}
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500107
Vijay06a169d2020-04-23 09:28:24 -0500108
George Keishing16b3c7b2021-01-28 09:23:37 -0600109Add Multiple IP Addresses On VMI Interface And Verify
110 [Documentation] Add multiple IP addresses on VMI interface and verify.
111 [Tags] Add_Multiple_IP_Addresses_On_VMI_Interface_And_Verify
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600112 [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution
shrsuman123e37b0cc2020-09-02 00:33:42 -0500113
Shradha Sumanc7df7db2021-03-08 05:16:44 -0600114 ${ip1}= Create dictionary Address=10.5.5.10 SubnetMask=255.255.252.0 Gateway=10.5.5.1
115 ${ip2}= Create dictionary Address=10.5.5.11 SubnetMask=255.255.252.0 Gateway=10.5.5.1
116 ${ip3}= Create dictionary Address=10.5.5.12 SubnetMask=255.255.252.0 Gateway=10.5.5.1
shrsuman123e37b0cc2020-09-02 00:33:42 -0500117 ${ips}= Create List ${ip1} ${ip2} ${ip3}
118
shrsuman123bfb851b2021-07-02 04:59:16 -0500119 Redfish.Patch /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface}
shrsuman123993a5c92021-04-19 06:40:16 -0500120 ... body={'IPv4StaticAddresses':${ips}} valid_status_codes=[${HTTP_BAD_REQUEST}]
shrsuman123e37b0cc2020-09-02 00:33:42 -0500121
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500122
shrsuman123e37b0cc2020-09-02 00:33:42 -0500123Modify IP Addresses On VMI Interface And Verify
124 [Documentation] Modify IP addresses on VMI interface and verify.
125 [Tags] Modify_IP_Addresses_On_VMI_Interface_And_Verify
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600126 [Template] Set Static IPv4 Address To VMI And Verify
127 [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution
shrsuman123e37b0cc2020-09-02 00:33:42 -0500128
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500129 # ip gateway netmask valid_status_code
Shradha Sumanc7df7db2021-03-08 05:16:44 -0600130 10.5.5.10 10.5.5.1 255.255.252.0 ${HTTP_ACCEPTED}
131 10.5.5.11 10.5.5.1 255.255.252.0 ${HTTP_ACCEPTED}
Vijay06a169d2020-04-23 09:28:24 -0500132
Megha GN80ef5ca2022-06-09 00:29:57 -0500133
Vijay06a169d2020-04-23 09:28:24 -0500134Switch Between IP Origins On VMI And Verify Details
135 [Documentation] Switch between IP origins on VMI and verify details.
136 [Tags] Switch_Between_IP_Origins_On_VMI_And_Verify_Details
137
138 Switch VMI IPv4 Origin And Verify Details
139 Switch VMI IPv4 Origin And Verify Details
140
141
142Verify Persistency Of VMI IPv4 Details After Host Reboot
143 [Documentation] Verify persistency of VMI IPv4 details after host reboot.
144 [Tags] Verify_Persistency_Of_VMI_IPv4_Details_After_Host_Reboot
145
146 # Verifying persistency of dynamic address.
147 Set VMI IPv4 Origin ${True} ${HTTP_ACCEPTED}
Anves Kumar rayankula7936eee2021-04-19 05:38:36 -0500148 Redfish Power Off stack_mode=skip
149 Redfish Power On
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500150 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
Vijay06a169d2020-04-23 09:28:24 -0500151
152 # Verifying persistency of static address.
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600153 Switch VMI IPv4 Origin And Verify Details
Anves Kumar rayankula7936eee2021-04-19 05:38:36 -0500154 Redfish Power Off stack_mode=skip
155 Redfish Power On
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600156 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
Vijay06a169d2020-04-23 09:28:24 -0500157
158
Anves Kumar rayankula9fa524a2020-08-18 06:40:18 -0500159Delete VMI Static IP Address And Verify
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500160 [Documentation] Delete VMI static IP address and verify.
161 [Tags] Delete_VMI_Static_IP_Address_And_Verify
162 [Teardown] Test Teardown Execution
Anves Kumar rayankula9fa524a2020-08-18 06:40:18 -0500163
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600164 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
165 Delete VMI IPv4 Address
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500166
Anves Kumar rayankula9fa524a2020-08-18 06:40:18 -0500167
shrsuman123c1d3fe32020-09-08 05:04:07 -0500168Verify Successful VMI IP Static Configuration On HOST Boot After Session Delete
169 [Documentation] Verify VMI IP static Configuration On HOST Boot After session deleted.
170 [Tags] Verify_Successful_VMI_IP_Static_Configuration_On_HOST_Boot_After_Session_Delete
shrsuman123b25343d2021-09-22 04:33:47 -0500171 [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution
shrsuman123c1d3fe32020-09-08 05:04:07 -0500172
shrsuman12375e77062020-09-18 01:08:45 -0500173 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
shrsuman123c1d3fe32020-09-08 05:04:07 -0500174
175 ${session_info}= Get Redfish Session Info
176 Redfish.Delete ${session_info["location"]}
177
178 # Create a new Redfish session
shrsuman1235c7e4d72021-04-16 05:42:57 -0500179 Redfish.Login
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500180 Redfish Power Off
181 Redfish Power On
shrsuman123c1d3fe32020-09-08 05:04:07 -0500182
183 Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask}
184
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500185
shrsuman123c1d3fe32020-09-08 05:04:07 -0500186Verify Persistency Of VMI DHCP IP Configuration After Multiple HOST Reboots
187 [Documentation] Verify Persistency Of VMI DHCP IP configuration After Multiple HOST Reboots
188 [Tags] Verify_Persistency_Of_VMI_DHCP_IP_Configuration_After_Multiple_HOST_Reboots
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500189 [Teardown] Test Teardown Execution
shrsuman123c1d3fe32020-09-08 05:04:07 -0500190
shrsuman123c1d3fe32020-09-08 05:04:07 -0500191 Set VMI IPv4 Origin ${True} ${HTTP_ACCEPTED}
shrsuman123c1d3fe32020-09-08 05:04:07 -0500192 ${vmi_ip_config}= Get VMI Network Interface Details
193 # Verifying persistency of dynamic address after multiple reboots.
shrsuman123f559cbe2021-01-06 05:40:45 -0600194 FOR ${i} IN RANGE ${2}
195 Redfish Power Off
196 Redfish Power On
George Keishing538f1742022-03-14 05:00:55 -0500197 Verify VMI Network Interface Details ${vmi_ip_config["IPv4_Address"]}
198 ... DHCP ${vmi_ip_config["IPv4_Gateway"]} ${vmi_ip_config["IPv4_SubnetMask"]}
shrsuman123f559cbe2021-01-06 05:40:45 -0600199 END
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500200
201
202Enable DHCP When Static IP Configured And Verify Static IP
203 [Documentation] Enable DHCP when static ip configured and verify static ip
George Keishing4203fad2022-01-31 12:22:33 -0600204 [Tags] Enable_DHCP_When_Static_IP_Configured_And_Verify_Static_IP
Shradha Sumanc7df7db2021-03-08 05:16:44 -0600205 [Setup] Redfish Power On
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500206 [Teardown] Test Teardown Execution
207
shrsuman123f559cbe2021-01-06 05:40:45 -0600208 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500209 Set VMI IPv4 Origin ${True}
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500210 ${vmi_network_conf}= Get VMI Network Interface Details
211 Should Not Be Equal As Strings ${test_ipv4} ${vmi_network_conf["IPv4_Address"]}
212
Anves Kumar rayankula9fa524a2020-08-18 06:40:18 -0500213
shrsuman123e37b0cc2020-09-02 00:33:42 -0500214Verify VMI Static IP Configuration Persist On BMC Reset Before Host Boot
215 [Documentation] Verify VMI static IP configuration persist on BMC reset.
216 [Tags] Verify_VMI_Static_IP_Configuration_Persist_On_BMC_Reset_Before_Host_Boot
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600217 [Teardown] Run keywords Delete VMI IPv4 Address AND FFDC On Test Case Fail
shrsuman123e37b0cc2020-09-02 00:33:42 -0500218
shrsuman12375e77062020-09-18 01:08:45 -0500219 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
Megha GNbe428592022-07-21 10:33:02 -0500220 Redfish OBMC Reboot (off) stack_mode=skip
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500221 Redfish Power On
shrsuman123e37b0cc2020-09-02 00:33:42 -0500222 # Verifying the VMI static configuration
223 Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask}
224
Megha GN80ef5ca2022-06-09 00:29:57 -0500225
shrsuman12375e77062020-09-18 01:08:45 -0500226Add Static IP When Host Poweroff And Verify On Poweron
227 [Documentation] Add Static IP When Host Poweroff And Verify on power on
228 [Tags] Add_Static_IP_When_Host_Poweroff_And_Verify_On_Poweron
229 [Setup] Redfish Power Off
230 [Teardown] Run keywords Delete VMI IPv4 Address AND FFDC On Test Case Fail
231
232 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
233 Redfish Power On
234 Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask}
235
Megha GN80ef5ca2022-06-09 00:29:57 -0500236
shrsuman12375e77062020-09-18 01:08:45 -0500237Add VMI Static IP When Host Poweroff And Verify Static IP On BMC Reset
238 [Documentation] Add Static IP When Host Poweroff And Verify Static IP On BMC Reset.
239 [Tags] Add_VMI_Static_IP_When_Host_Poweroff_And_Verify_Static_IP_On_BMC_Reset
240 [Setup] Redfish Power Off
241 [Teardown] Run keywords Delete VMI IPv4 Address AND FFDC On Test Case Fail
242
243 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
Megha GNbe428592022-07-21 10:33:02 -0500244 Redfish OBMC Reboot (off) stack_mode=skip
shrsuman12375e77062020-09-18 01:08:45 -0500245 Redfish Power On
246 Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask}
247
Megha GN80ef5ca2022-06-09 00:29:57 -0500248
shrsuman12375e77062020-09-18 01:08:45 -0500249Enable DHCP When No Static IP Configured And Verify DHCP IP
250 [Documentation] Enable DHCP when no static ip configured and verify dhcp ip
251 [Tags] Enable_DHCP_When_No_Static_IP_Configured_And_Verify_DHCP_IP
252 [Setup] Run Keyword And Ignore Error Delete VMI IPv4 Address
253 [Teardown] Test Teardown Execution
254
255 ${curr_origin}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
Megha G N1e9f2f32025-05-13 02:18:41 -0500256 IF ${curr_origin} == ${False}
257 Set VMI IPv4 Origin ${True} ${HTTP_ACCEPTED}
258 END
shrsuman12375e77062020-09-18 01:08:45 -0500259 ${vmi_ip_config}= Get VMI Network Interface Details
George Keishing538f1742022-03-14 05:00:55 -0500260 Verify VMI Network Interface Details ${vmi_ip_config["IPv4_Address"]}
261 ... DHCP ${vmi_ip_config["IPv4_Gateway"]} ${vmi_ip_config["IPv4_SubnetMask"]}
shrsuman12375e77062020-09-18 01:08:45 -0500262
Megha GN80ef5ca2022-06-09 00:29:57 -0500263
shrsuman12375e77062020-09-18 01:08:45 -0500264Verify User Cannot Delete VMI DHCP IP Address
265 [Documentation] Verify user cannot delete VMI DHCP IP Address
266 [Tags] Verify_User_Cannot_Delete_VMI_DHCP_IP_Address
267 [Setup] Set VMI IPv4 Origin ${True}
268 [Teardown] Test Teardown Execution
269
shrsuman123b25343d2021-09-22 04:33:47 -0500270 Delete VMI IPv4 Address IPv4Addresses valid_status_code=${HTTP_FORBIDDEN}
shrsuman12375e77062020-09-18 01:08:45 -0500271 ${resp}= Redfish.Get
shrsuman123bfb851b2021-07-02 04:59:16 -0500272 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface}
shrsuman12375e77062020-09-18 01:08:45 -0500273 Should Not Be Empty ${resp.dict["IPv4Addresses"]}
274
Megha GN80ef5ca2022-06-09 00:29:57 -0500275
shrsuman12375e77062020-09-18 01:08:45 -0500276Enable DHCP When Static IP Configured DHCP Server Unavailable And Verify IP
277 [Documentation] Enable DHCP When Static IP Configured And DHCP Server Unavailable And Verify No IP.
278 [Tags] Enable_DHCP_When_Static_IP_Configured_DHCP_Server_Unavailable_And_Verify_IP
279 [Teardown] Test Teardown Execution
280
281 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
282 Set VMI IPv4 Origin ${True}
shrsuman12375e77062020-09-18 01:08:45 -0500283 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
284
shrsuman123e37b0cc2020-09-02 00:33:42 -0500285
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500286Verify To Configure VMI Static IP Address With Different User Roles
287 [Documentation] Verify to configure vmi static ip address with different user roles.
288 [Tags] Verify_To_Configure_VMI_Static_IP_Address_With_Different_User_Roles
Megha G N4e2b5732023-02-02 04:52:27 -0600289 [Setup] Run Keywords Delete BMC Users Using Redfish
290 ... AND Create Users With Different Roles users=${USERS} force=${True}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500291 [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 admin_user TestPwd123 ${test_ipv4} ${test_gateway} ${test_netmask} ${HTTP_ACCEPTED}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500296 readonly_user TestPwd123 ${test_ipv4} ${test_gateway} ${test_netmask} ${HTTP_FORBIDDEN}
Megha GN80ef5ca2022-06-09 00:29:57 -0500297
298
299Verify To Configure VMI Static IP Address With Operator User Role
300 [Documentation] Verify to configure vmi static ip address with operator user role.
301 [Tags] Verify_To_Configure_VMI_Static_IP_Address_With_Operator_User_Role
302 [Setup] Create Users With Different Roles users=${USERS} force=${True}
303 [Template] Config VMI Static IP Address Using Different Users
304 [Teardown] Delete BMC Users Using Redfish
305
306 # username password ip_address gateway nemask valid_status_code
307 operator_user TestPwd123 ${test_ipv4} ${test_gateway} ${test_netmask} ${HTTP_FORBIDDEN}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500308
309
310Verify To Delete VMI Static IP Address With Different User Roles
311 [Documentation] Verify to delete vmi static IP address with different user roles.
312 [Tags] Verify_To_Delete_VMI_Static_IP_Address_With_Different_User_Roles
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 admin_user TestPwd123 ${HTTP_ACCEPTED}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500319 readonly_user TestPwd123 ${HTTP_FORBIDDEN}
Megha GN80ef5ca2022-06-09 00:29:57 -0500320
321
322Verify To Delete VMI Static IP Address With Operator User Role
323 [Documentation] Verify to delete vmi static IP address with operator user role.
324 [Tags] Verify_To_Delete_VMI_Static_IP_Address_With_Operator_User_Role
325 [Setup] Create Users With Different Roles users=${USERS} force=${True}
326 [Template] Delete VMI Static IP Address Using Different Users
327 [Teardown] Delete BMC Users Using Redfish
328
329 # username password valid_status_code
330 operator_user TestPwd123 ${HTTP_FORBIDDEN}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500331
332
333Verify To Update VMI Static IP Address With Different User Roles
334 [Documentation] Verify to update vmi static IP address with different user roles.
George Keishing4203fad2022-01-31 12:22:33 -0600335 [Tags] Verify_To_Update_VMI_Static_IP_Address_With_Different_User_Roles
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500336 [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
Shradha Sumanc7df7db2021-03-08 05:16:44 -0600340 # username password ip_address gateway netmask valid_status_code
341 admin_user TestPwd123 10.5.10.20 10.5.10.1 255.255.0.0 ${HTTP_ACCEPTED}
Shradha Sumanc7df7db2021-03-08 05:16:44 -0600342 readonly_user TestPwd123 10.5.20.40 10.5.20.1 255.255.0.0 ${HTTP_FORBIDDEN}
Megha GN80ef5ca2022-06-09 00:29:57 -0500343
344
345Verify To Update VMI Static IP Address With Operator User Role
346 [Documentation] Verify to update vmi static IP address with operator user role.
347 [Tags] Verify_To_Update_VMI_Static_IP_Address_With_Operator_User_Role
348 [Setup] Create Users With Different Roles users=${USERS} force=${True}
349 [Template] Config VMI Static IP Address Using Different Users
350 [Teardown] Delete BMC Users Using Redfish
351
352 # username password ip_address gateway netmask valid_status_code
353 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 -0500354
355
356Verify To Read VMI Network Configuration With Different User Roles
357 [Documentation] Verify to read vmi network configuration with different user roles.
George Keishing4203fad2022-01-31 12:22:33 -0600358 [Tags] Verify_To_Read_VMI_Network_Configuration_With_Different_User_Roles
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500359 [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 admin_user TestPwd123 ${HTTP_OK}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500365 readonly_user TestPwd123 ${HTTP_OK}
Megha GN80ef5ca2022-06-09 00:29:57 -0500366
367
368Verify To Read VMI Network Configuration With Operator User Role
369 [Documentation] Verify to read vmi network configuration with operator user role.
370 [Tags] Verify_To_Read_VMI_Network_Configuration_With_Operator_User_Role
371 [Setup] Create Users With Different Roles users=${USERS} force=${True}
372 [Template] Read VMI Static IP Address Using Different Users
373 [Teardown] Delete BMC Users Using Redfish
374
375 # username password valid_status_code
376 operator_user TestPwd123 ${HTTP_FORBIDDEN}
377
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500378
shrsuman123b361d412020-09-30 06:17:23 -0500379Enable DHCP On VMI Network Via Different Users Roles And Verify
380 [Documentation] Enable DHCP On VMI Network Via Different Users Roles And Verify.
381 [Tags] Enable_DHCP_On_VMI_Network_Via_Different_Users_Roles_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 admin_user TestPwd123 ${True} ${HTTP_ACCEPTED}
shrsuman123b361d412020-09-30 06:17:23 -0500388 readonly_user TestPwd123 ${True} ${HTTP_FORBIDDEN}
Megha GN80ef5ca2022-06-09 00:29:57 -0500389
390
391Enable DHCP On VMI Network Via Operator User Role And Verify
392 [Documentation] Enable DHCP On VMI Network Via Operator User Role And Verify.
393 [Tags] Enable_DHCP_On_VMI_Network_Via_Operator_User_Role_And_Verify
394 [Setup] Create Users With Different Roles users=${USERS} force=${True}
395 [Template] Update User Role And Set VMI IPv4 Origin
396 [Teardown] Delete BMC Users Using Redfish
397
398 # username password dhcp_enabled valid_status_code
399 operator_user TestPwd123 ${True} ${HTTP_FORBIDDEN}
400
shrsuman123b361d412020-09-30 06:17:23 -0500401
402Disable DHCP On VMI Network Via Different Users Roles And Verify
403 [Documentation] Disable DHCP On VMI Network Via Different Users Roles And Verify.
404 [Tags] Disable_DHCP_On_VMI_Network_Via_Different_Users_Roles_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 admin_user TestPwd123 ${False} ${HTTP_ACCEPTED}
shrsuman123b361d412020-09-30 06:17:23 -0500411 readonly_user TestPwd123 ${False} ${HTTP_FORBIDDEN}
Megha GN80ef5ca2022-06-09 00:29:57 -0500412
413
414Disable DHCP On VMI Network Via Operator User Role And Verify
415 [Documentation] Disable DHCP On VMI Network Via Operator User Role And Verify.
416 [Tags] Disable_DHCP_On_VMI_Network_Via_Operator_User_Role_And_Verify
417 [Setup] Create Users With Different Roles users=${USERS} force=${True}
418 [Template] Update User Role And Set VMI IPv4 Origin
419 [Teardown] Delete BMC Users Using Redfish
420
421 # username password dhcp_enabled valid_status_code
422 operator_user TestPwd123 ${False} ${HTTP_FORBIDDEN}
shrsuman123b361d412020-09-30 06:17:23 -0500423
shrsuman123e37b0cc2020-09-02 00:33:42 -0500424
Anves Kumar rayankula55b939e2020-08-12 04:19:01 -0500425Enable And Disable DHCP And Verify
426 [Documentation] verify enable DHCP and disable DHCP.
George Keishing4203fad2022-01-31 12:22:33 -0600427 [Tags] Enable_And_Disable_DHCP_And_Verify
Anves Kumar rayankula55b939e2020-08-12 04:19:01 -0500428
429 Set VMI IPv4 Origin ${True}
Anves Kumar rayankula55b939e2020-08-12 04:19:01 -0500430 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
434
435Multiple Times Enable And Disable DHCP And Verify
436 [Documentation] Enable and Disable DHCP in a loop and verify VMI gets an IP address from DHCP
437 ... each time when DHCP is enabled
438 [Tags] Multiple_Times_Enable_And_Disable_DHCP_And_Verify
439
Anves Kumar rayankula55b939e2020-08-12 04:19:01 -0500440 FOR ${i} IN RANGE ${2}
441 Set VMI IPv4 Origin ${True}
442 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
443 Set VMI IPv4 Origin ${False}
Megha GN80ef5ca2022-06-09 00:29:57 -0500444 Verify VMI Network Interface Details ${default} Static ${default} ${default}
Anves Kumar rayankula55b939e2020-08-12 04:19:01 -0500445 END
446
447
Anves Kumar rayankula81fd9db2021-05-10 02:39:51 -0500448Assign Static IPv4 Address With Invalid Netmask To VMI
449 [Documentation] Assign static IPv4 address with invalid netmask and expect error.
450 [Tags] Assign_Static_IPv4_Address_With_Invalid_Netmask_To_VMI
451 [Template] Set Static IPv4 Address To VMI And Verify
452
453 # ip gateway netmask valid_status_code
454 ${test_ipv4} ${test_gateway} 255.256.255.0 ${HTTP_BAD_REQUEST}
455 ${test_ipv4} ${test_gateway} ff.ff.ff.ff ${HTTP_BAD_REQUEST}
456 ${test_ipv4} ${test_gateway} 255.255.253.0 ${HTTP_BAD_REQUEST}
457
458
459Assign Static IPv4 Address With Invalid Gateway To VMI
460 [Documentation] Add static IPv4 address with invalid gateway and expect error.
461 [Tags] Assign_Static_IPv4_Address_With_Invalid_Gateway_To_VMI
462 [Template] Set Static IPv4 Address To VMI And Verify
463
464 # ip gateway netmask valid_status_code
465 ${test_ipv4} @@@.%%.44.11 ${test_netmask} ${HTTP_BAD_REQUEST}
466 ${test_ipv4} 0xa.0xb.0xc.0xd ${test_netmask} ${HTTP_BAD_REQUEST}
467 ${test_ipv4} 10.3.36 ${test_netmask} ${HTTP_BAD_REQUEST}
468 ${test_ipv4} 10.3.36.-10 ${test_netmask} ${HTTP_BAD_REQUEST}
469
470
Megha G N02cbfa12022-12-12 02:05:03 -0600471Enable DHCP When Host Is Off And Verify After Poweron
472 [Documentation] Enable DHCP when host is off and
473 ... check whether it is enabled after poweron.
474 [Tags] Enable_DHCP_When_Host_Is_Off_And_Verify_After_Poweron
475 [Setup] Redfish Power Off stack_mode=skip
476
477 Set VMI IPv4 Origin ${True}
478 Redfish Power On stack_mode=skip
479 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
480
481
Megha G N89174682023-01-24 23:28:27 -0600482Disable DHCP When Host Is Off And Verify New State Reflects After Power On
483 [Documentation] Disable DHCP when host is off and
484 ... get network info and verify that VMI origin is static.
485 [Tags] Disable_DHCP_When_Host_Is_Off_And_Verify_New_State_Reflects_After_Power_On
486 [Setup] Redfish Power Off stack_mode=skip
487
488 Set VMI IPv4 Origin ${False}
489 Redfish Power On stack_mode=skip
490 Verify VMI Network Interface Details ${default} Static ${default} ${default}
491
492
Megha G N38acd842024-10-14 14:28:11 -0500493Enable VMI Stateless Address AutoConfig And Verify
494 [Documentation] Enable VMI SLAACv6 and verify an origin.
495 [Tags] Enable_VMI_Stateless_Address_AutoConfig_And_Verify
496
497 Set VMI SLAACv6 Origin ${True}
498
499 # Check origin is set to slaac and address are getting displayed.
500 Verify VMI IPv6 Address SLAAC
501
502
Megha G Ne8c0e422024-12-04 03:12:55 -0600503Disable VMI Stateless Address AutoConfig And Verify
504 [Documentation] Disable VMI SLAACv6 and verify an origin.
505 [Tags] Disable_VMI_Stateless_Address_AutoConfig_And_Verify
506 [Setup] Set VMI SLAACv6 Origin ${True}
507
508 Set VMI SLAACv6 Origin ${False}
509
510 # Check origin is set to static and slaacv6 address are getting erased.
511 Verify VMI IPv6 Address Static
512
513
Megha G Na37b8da2025-01-06 00:23:15 -0600514Enable VMI SLAAC And Check Persistency On BMC Reboot
515 [Documentation] Enable VMI SLAACv6 and verify its persistency
516 ... on BMC reboot and this works on the setup where router
Megha G Na727d5b2025-02-06 04:41:47 -0600517 ... advertises network prefix.
Megha G Na37b8da2025-01-06 00:23:15 -0600518 [Tags] Enable_VMI_SLAAC_And_Check_Persistency_On_BMC_Reboot
519
520 Set VMI SLAACv6 Origin ${True}
521
522 # Reboot BMC and verify persistency.
523 OBMC Reboot (off)
524 Redfish Power On
525 Wait For Host Boot Progress To Reach Required State
Megha G Na727d5b2025-02-06 04:41:47 -0600526 Sleep 5s
Megha G Na37b8da2025-01-06 00:23:15 -0600527
528 # Check origin is set to slaac and address are getting displayed.
529 ${vmi_ipv6addr}= Verify VMI IPv6 Address SLAAC
530 Should Not Be Equal ${vmi_ipv6addr["Address"]} ${default_ipv6addr}
531
532
Megha G N49657382025-01-07 23:10:42 -0600533Disable VMI SLAAC And Check Persistency On BMC Reboot
534 [Documentation] Disable VMI SLAACv6 and verify its persistency
535 ... on BMC reboot.
536 [Tags] Disable_VMI_SLAAC_And_Check_Persistency_On_BMC_Reboot
537
538 Set VMI SLAACv6 Origin ${False}
539
540 # Reboot BMC and verify persistency.
541 OBMC Reboot (off)
542 Redfish Power On
543 Wait For Host Boot Progress To Reach Required State
544
545 # Check if origin is set to static and SLAAC address are getting erased.
546 ${vmi_ipv6addr}= Verify VMI IPv6 Address Static
547 Should Be Equal ${vmi_ipv6addr["Address"]} ${default_ipv6addr}
548
549
Megha G N503fa352025-01-08 04:43:09 -0600550Disable VMI DHCPv4 When SLAAC Is Enabled And Verify
551 [Documentation] Disable VMI DHCPv4 parameter when SLAACv6 is enabled
552 ... and check whether the IPv4 address origin is set to static and
553 ... DHCPv4 address is getting erased.
554 [Tags] Disable_VMI_DHCPv4_When_SLAAC_Is_Enabled_And_Verify
555 [Setup] Set VMI IPv4 Origin ${True}
556
557 # Set IPv6 origin to SLAAC.
558 Set VMI SLAACv6 Origin ${True}
559 Verify VMI IPv6 Address SLAAC
560
561 # Disable VMI DHCPv4 and check IPv4 address origin is set to static.
562 Set VMI IPv4 Origin ${False}
563 Verify VMI Network Interface Details ${default} Static ${default} ${default}
564
565
Megha G Ndf255642025-01-10 02:12:21 -0600566Enable VMI SLAAC When DHCPv6 Is Enabled And Verify
567 [Documentation] Enable VMI SLAACv6 when VMI DHCPv6 is enabled and
568 ... check IPv6 gets Slaac address and this works on the setup
569 ... where router advertise network prefix.
570 [Tags] Enable_VMI_SLAAC_When_DHCPv6_Is_Enabled_And_Verify
571
572 Set VMI DHCPv6 Property Enabled
573
574 # Enable SLAAC and check whether IPv6 origin is set to SLAAC.
575 Set VMI SLAACv6 Origin ${True}
576
577 # Check if origin is set to slaac and address are getting displayed.
578 ${vmi_ipv6addr}= Verify VMI IPv6 Address SLAAC
579 Should Not Be Equal ${vmi_ipv6addr["Address"]} ${default_ipv6addr}
580 Should Be Equal ${vmi_ipv6addr["PrefixLength"]} ${prefix_length}
581
582
Megha G N80b4af32025-01-15 00:47:35 -0600583Disable VMI DHCPv6 Property And Verify
George Keishing4ebb3282025-01-17 10:01:34 +0530584 [Documentation] Disable VMI DHCPv6 property and verify IPv6 address
585 ... origin is set to static and DHCPv6 address is erased.
586 [Tags] Disable_VMI_DHCPv6_Property_And_Verify
Megha G N80b4af32025-01-15 00:47:35 -0600587 [Setup] Set VMI DHCPv6 Property Enabled
588
589 Set VMI DHCPv6 Property Disabled
590
591 # Verify IPv6 address origin is set to static and DHCPv6 address is erased.
592 ${vmi_ipv6addr}= Verify VMI IPv6 Address Static
593 Should Be Equal ${vmi_ipv6addr["Address"]} ${default_ipv6addr}
594
595
Megha G N58be5122025-01-16 08:26:53 -0600596Enable VMI SLAAC When DHCPv4 Is Enabled And Verify
597 [Documentation] On VMI enable SLAAC when DHCPv4 is enabled and verify DHCPv4 settings are intact
598 ... and IPv6 origin is set to SLAAC & it gets assigned with SLAAC IPv6 address and this
599 ... works on the setup where router advertise network prefix.
600 [Tags] Enable_VMI_SLAAC_When_DHCPv4_Is_Enabled_And_Verify
601 [Setup] Set VMI IPv4 Origin ${True}
602
603 # Enable Autoconfig address and check whether IPv6 address origin is set to SLAAC.
604 Set VMI SLAACv6 Origin ${True}
605 Verify VMI IPv6 Address SLAAC
606
607 # Check there is no impact on IPv4 settings, IPv4 address origin should be DHCP.
608 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
609
610
Megha G Nf9867142025-02-03 23:10:57 -0600611Disable VMI DHCPv6 Property And Check Persistency On BMC Reboot
612 [Documentation] Disable VMI DHCPv6 property and verify its persistency on
613 ... BMC reboot.
614 [Tags] Disable_VMI_DHCPv6_Property_And_Check_Persistency_On_BMC_Reboot
615 [Setup] Set VMI DHCPv6 Property Enabled
616
617 Set VMI DHCPv6 Property Disabled
618
619 # Reboot BMC and verify persistency.
620 OBMC Reboot (off)
621
622 # Verify IPv6 address origin is set to Static and DHCPv6 address is erased.
623 ${vmi_ipv6addr}= Verify VMI IPv6 Address Static
624 Should Be Equal ${vmi_ipv6addr["Address"]} ${default_ipv6addr}
625
626
Megha G N95e37d82025-02-06 03:56:04 -0600627Enable VMI SLAAC When IPv4 Origin Is Static And Verify
628 [Documentation] On VMI enable SLAAC when IPv4 origin is static and verify IPv4 settings are intact
629 ... and IPv6 origin is set to SLAAC & it gets assigned with SLAAC IPv6 address and this works
630 ... on the setup where router advertise network prefix.
631 [Tags] Enable_VMI_SLAAC_When_IPv4_Origin_Is_Static_And_Verify
632 [Setup] Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
633 [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution
634
635 # Enable Autoconfig address and check whether IPv6 address origin is set to SLAAC.
636 Set VMI SLAACv6 Origin ${True}
637 Verify VMI IPv6 Address SLAAC
638
639 # Check there is no impact on IPv4 settings, IPv4 address origin should be Static.
640 Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask}
641
642
Megha G N97af3bf2025-02-27 10:32:08 -0600643Configure Static VMI IPv6 Address And Verify
644 [Documentation] Add static VMI IPv6 address and check whether IPv6 origin is set to static
645 ... and Static IPv6 address is assigned.
646 [Tags] Configure_Static_VMI_IPv6_Address_And_Verify
647
648 Set Static VMI IPv6 Address ${test_vmi_ipv6addr} ${prefix_length}
649
650 # Verify IPv6 address origin is set to static and static IPv6 address is assigned.
651 ${vmi_ipv6addr}= Verify VMI IPv6 Address Static
652 Should Not Be Equal ${vmi_ipv6addr["Address"]} ${default_ipv6addr}
653 Should Be Equal ${vmi_ipv6addr["PrefixLength"]} ${prefix_length}
654
655
Megha G Ne0e055d2025-02-28 02:16:06 -0600656Configure IPv6 Static Default Gateway On VMI And Verify
657 [Documentation] Configure IPv6 static default gateway on VMI and verify.
658 [Tags] Configure_IPv6_Static_Default_Gateway_On_VMI_And_Verify
Megha G N1361edf2025-03-18 03:09:41 -0500659 [Setup] Set Static VMI IPv6 Address ${test_vmi_ipv6addr} ${prefix_length}
Megha G Ne0e055d2025-02-28 02:16:06 -0600660
661 Set VMI IPv6 Static Default Gateway ${test_vmi_ipv6gateway}
662
663 ${resp}= Redfish.Get
664 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface}
Megha G N1361edf2025-03-18 03:09:41 -0500665 ${vmi_ipv6_gateways}= Get From Dictionary ${resp.dict} IPv6StaticDefaultGateways
666 ${vmi_ipv6_gateway} = Get From List ${vmi_ipv6_gateways} 0
667 Should Be Equal ${vmi_ipv6_gateway["Address"]} ${test_vmi_ipv6gateway}
Megha G Ne0e055d2025-02-28 02:16:06 -0600668
669
Megha G Na2148332025-03-06 07:28:15 -0600670Delete VMI Static IPv6 Address And Verify
671 [Documentation] Delete VMI static IPv6 address and verify address is erased.
672 [Tags] Delete_VMI_Static_IPv6_Address_And_Verify
673 [Setup] Set Static VMI IPv6 Address ${test_vmi_ipv6addr} ${prefix_length}
674
675 # Delete VMI static IPv6 address.
676 Delete VMI IPv6 Static Address
677
678 # Verify VMI static IPv6 address is erased.
679 ${vmi_ipv6addr}= Verify VMI IPv6 Address Static
680 Should Not Be Equal ${vmi_ipv6addr["Address"]} ${test_vmi_ipv6addr}
681 Should Be Equal ${vmi_ipv6addr["Address"]} ${default_ipv6addr}
682
683
Megha G Nd9ba2b42025-03-07 05:27:10 -0600684Enable VMI DHCPv6 When IPv6 Origin Is Static And Verify
685 [Documentation] Enable VMI DHCPv6 when IPv6 origin is in static and verify
686 ... origin is set to DHCP and check if static IPv6 address is erased.
687 [Tags] Enable_VMI_DHCPv6_When_IPv6_Origin_Is_Static_And_Verify
688
689 Set Static VMI IPv6 Address ${test_vmi_ipv6addr} ${prefix_length}
690 ${vmi_ipv6addr_static}= Verify VMI IPv6 Address Static
691
692 Sleep 5s
693
694 # Enable DHCPv6 property.
695 Set VMI DHCPv6 Property Enabled
696
697 # Check origin is set to DHCP and static IPv6 address is erased.
698 ${vmi_dhcpv6addr}= Verify VMI IPv6 Address DHCPv6
699 Should Not Be Equal ${vmi_dhcpv6addr["Address"]} ${vmi_ipv6addr_static["Address"]}
700
701
Megha G N3e2cf0d2025-03-11 12:16:08 -0500702Configure Invalid Static IPv6 To VMI And Verify
703 [Documentation] Configure invalid static IPv6 address to VMI and verify that address
704 ... does not get assigned and it throws an error.
705 [Tags] Configure_Invalid_Static_IPv6_To_VMI_And_Verify
706 [Setup] Set Static VMI IPv6 Address ${test_vmi_ipv6addr} ${prefix_length}
707 [Template] Set VMI Invalid Static IPv6 Address And Verify
708
709 # invalid_vmi_ipv6addr invalid_prefix_length valid_status_codes
710 ${default_ipv6addr} 128 ${HTTP_BAD_REQUEST}
711 ${multicast_ipv6addr} 8 ${HTTP_BAD_REQUEST}
712 ${loopback_ipv6addr} 64 ${HTTP_BAD_REQUEST}
713 ${ipv4_hexword_addr} 64 ${HTTP_BAD_REQUEST}
714
715
Megha G Nf719f242025-03-25 04:09:50 -0500716Delete IPv6 Static Default Gateway On VMI And Verify
717 [Documentation] Delete IPv6 static default gateway and verify address is erased.
718 [Tags] Delete_IPv6_Static_Default_Gateway_On_VMI_And_Verify
719 [Setup] Run Keywords Set Static VMI IPv6 Address ${test_vmi_ipv6addr} ${prefix_length}
720 ... AND Set VMI IPv6 Static Default Gateway ${test_vmi_ipv6gateway}
721
722 # Delete IPv6 static default gateway address.
723 Delete VMI IPv6 Static Default Gateway Address
724
725 Sleep 5s
726
727 # Verify static IPv6 default gateway address is deleted.
728 ${resp}= Redfish.Get
729 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface}
730 Should Be Empty ${resp.dict["IPv6StaticDefaultGateways"]}
731
732
Megha G N619d8702025-04-17 01:03:38 -0500733Disable VMI DHCPv6 When DHCPv4 Is Enabled And Verify
734 [Documentation] Disable VMI DHCPv6 property when DHCPv4 is enabled and verify
735 ... DHCPv4 settings are intact and verify IPv6 address origin is set to static.
736 [Tags] Disable_VMI_DHCPv6_When_DHCPv4_Is_Enabled_And_Verify
737 [Setup] Run Keywords Set VMI DHCPv6 Property Enabled
738 ... AND Set VMI IPv4 Origin ${True}
739
740 Set VMI DHCPv6 Property Disabled
741
742 # Verify IPv6 address origin is set to static and DHCPv6 address is erased.
743 ${vmi_ipv6addr}= Verify VMI IPv6 Address Static
744 Should Be Equal ${vmi_ipv6addr["Address"]} ${default_ipv6addr}
745
746 # Check there is no impact on IPv4 settings, IPv4 address origin should be DHCP.
747 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
748
749
Megha G N62b0c902025-05-06 04:55:06 -0500750Assign Static VMI IPv6 Address And Check Persistency On BMC Reboot
751 [Documentation] Add static VMI IPv6 address and check whether IPv6 origin is set to static
752 ... and static IPv6 address is assigned after BMC reboot.
753 [Tags] Assign_Static_VMI_IPv6_Address_And_Check_Persistency_On_BMC_Reboot
754
755 Set Static VMI IPv6 Address ${test_vmi_ipv6addr} ${prefix_length}
756
757 # Reboot BMC and verify persistency.
758 OBMC Reboot (off)
759 Redfish Power On
760 Wait For Host Boot Progress To Reach Required State
761
762 # Verify IPv6 address origin is set to static and static IPv6 address is assigned.
763 ${vmi_ipv6addr}= Verify VMI IPv6 Address Static
764 Should Not Be Equal ${vmi_ipv6addr["Address"]} ${default_ipv6addr}
765 Should Be Equal ${vmi_ipv6addr["PrefixLength"]} ${prefix_length}
766
767
Megha G N6e1c48e2025-05-15 11:07:28 -0500768Enable VMI DHCPv6 When DHCPv4 Is Enabled And Verify
769 [Documentation] Enable VMI DHCPv6 when DHCPv4 is enabled and verify
770 ... DHCPv4 settings are intact and verify IPv6 address origin is set to DHCP.
771 [Tags] Enable_VMI_DHCPv6_When_DHCPv4_Is_Enabled_And_Verify
772 [Setup] Set VMI IPv4 Origin ${True}
773
774 # Enable DHCPv6 property.
775 Set VMI DHCPv6 Property Enabled
776
777 # Check IPv6 origin is set to DHCP.
778 Verify VMI IPv6 Address DHCPv6
779
780 # Check there is no impact on IPv4 settings, IPv4 address origin should be DHCP.
781 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
782
783
Megha G N439f7122025-06-02 02:58:39 -0500784Assign Valid Static IPv6 Address And Verify
785 [Documentation] Configure valid static IPv6 address to VMI and verify that address
786 ... get assigned.
787 [Tags] Assign_Valid_Static_IPv6_Address_And_Verify
788 [Template] Set VMI Valid Static IPv6 Address And Verify
789
Megha G Na48b0eb2025-06-26 04:07:44 -0500790 # valid_vmi_ipv6addr valid_prefix_length
791 ${compressed_ipv4} 64
792 ${shortform_stand_ipv4} 64
793 ${standard_ipv4rep} 64
794 ${ipv4_mapped_ipv6aadr} 64
795 ${compressed_1hextet_ipv6aadr} 64
Megha G N439f7122025-06-02 02:58:39 -0500796
797
Megha G N376f6e82025-06-18 03:55:10 -0500798Enable VMI DHCPv6 When IPv4 Origin Is Static And Verify
799 [Documentation] Enable VMI DHCPv6 when IPv4 origin is static and verify
800 ... IPv4 settings are intact and verify IPv6 address origin is set to DHCP.
801 [Tags] Enable_VMI_DHCPv6_When_IPv4_Origin_Is_Static_And_Verify
802 [Setup] Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
803
804 # Enable DHCPv6 property.
805 Set VMI DHCPv6 Property Enabled
806
807 # Check IPv6 origin is set to DHCP.
808 Verify VMI IPv6 Address DHCPv6
809
810 # Check there is no impact on IPv4 settings, IPv4 address origin should be static.
811 Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask}
812
813
814Configures Static IPv6 When DHCPv4 Is Enabled And Verify
815 [Documentation] Configure static IPv6 address when DHCPv4 is enabled and verify DHCPv4
816 ... settings are intact and verify IPv6 origin is set to static and static IPv6 address is assigned.
817 [Tags] Configures_Static_IPv6_When_DHCPv4_Is_Enabled_And_Verify
818 [Setup] Set VMI IPv4 Origin ${True}
819
820 Set VMI Valid Static IPv6 Address And Verify ${test_vmi_ipv6addr} ${prefix_length}
821
822 # Check there is no impact on IPv4 settings, IPv4 address origin should be DHCP.
823 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
824
825
Megha G N617b8742025-06-27 01:13:34 -0500826Configure Static IPv6 When IPv4 Origin Is Static And Verify
827 [Documentation] Configure static IPv6 address when IPv4 address origin is static and verify IPv4
828 ... settings are intact and verify IPv6 origin is set to static and static IPv6 address is assigned.
829 [Tags] Configure_Static_IPv6_When_IPv4_Origin_Is_Static_And_Verify
830 [Setup] Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
831 [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution
832
833 Set VMI Valid Static IPv6 Address And Verify ${test_vmi_ipv6addr} ${prefix_length}
834
835 # Check there is no impact on IPv4 settings, IPv4 address origin should be Static.
836 Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask}
837
838
Vijay06a169d2020-04-23 09:28:24 -0500839*** Keywords ***
840
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500841Suite Setup Execution
842 [Documentation] Do test setup execution task.
843
844 Redfish.Login
Megha G Nd0b4da92024-02-08 15:04:24 -0600845
846 Redfish Power Off
847 Set BIOS Attribute pvm_hmc_managed Enabled
Megha G N1e538242024-06-11 03:42:03 -0500848 Set BIOS Attribute pvm_stop_at_standby Disabled
849
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500850 Redfish Power On
Megha G N1e538242024-06-11 03:42:03 -0500851 Wait For Host Boot Progress To Reach Required State
Megha G N86507da2024-02-07 23:16:27 -0600852
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500853 ${active_channel_config}= Get Active Channel Config
854 Set Suite Variable ${active_channel_config}
shrsuman123bfb851b2021-07-02 04:59:16 -0500855 Set Suite Variable ${ethernet_interface} ${active_channel_config['${CHANNEL_NUMBER}']['name']}
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500856 ${resp}= Redfish.Get
shrsuman123bfb851b2021-07-02 04:59:16 -0500857 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface}
shrsuman12362e5be52021-05-20 02:42:59 -0500858 ${ip_resp}= Evaluate json.loads(r'''${resp.text}''') json
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500859 ${length}= Get Length ${ip_resp["IPv4StaticAddresses"]}
Megha G N1e9f2f32025-05-13 02:18:41 -0500860 ${vmi_network_conf}= IF ${length} != ${0} Get VMI Network Interface Details
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500861 Set Suite Variable ${vmi_network_conf}
862
863
864Test Teardown Execution
865 [Documentation] Do test teardown execution task.
866
867 FFDC On Test Case Fail
868 ${curr_mode}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
Megha G N1e9f2f32025-05-13 02:18:41 -0500869 IF ${curr_mode} == ${True}
870 Set VMI IPv4 Origin ${False}
Megha G N286e2f02025-05-21 05:09:41 -0500871 END
872 IF '${vmi_network_conf["IPv4_Address"]}' != '${default}'
Megha G N1e9f2f32025-05-13 02:18:41 -0500873 Set Static IPv4 Address To VMI And Verify ${vmi_network_conf["IPv4_Address"]}
874 ... ${vmi_network_conf["IPv4_Gateway"]} ${vmi_network_conf["IPv4_SubnetMask"]}
875 END
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500876
877
Vijay06a169d2020-04-23 09:28:24 -0500878Get Immediate Child Parameter From VMI Network Interface
879 [Documentation] Get immediate child parameter from VMI network interface.
880 [Arguments] ${parameter} ${valid_status_code}=${HTTP_OK}
881
882 # Description of argument(s):
883 # parameter parameter for which value is required. Ex: DHCPEnabled, MACAddress etc.
884 # valid_status_code Expected valid status code from GET request.
885
Anves Kumar rayankula358c41d2020-08-14 04:53:06 -0500886 ${resp}= Redfish.Get
shrsuman123bfb851b2021-07-02 04:59:16 -0500887 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface}
Vijay06a169d2020-04-23 09:28:24 -0500888 ... valid_status_codes=[${valid_status_code}]
889
shrsuman12362e5be52021-05-20 02:42:59 -0500890 ${ip_resp}= Evaluate json.loads(r'''${resp.text}''') json
Vijay06a169d2020-04-23 09:28:24 -0500891 ${value}= Set Variable If '${parameter}' != 'DHCPEnabled' ${ip_resp["${parameter}"]}
892 ... ${ip_resp["DHCPv4"]["${parameter}"]}
893
George Keishing409df052024-01-17 22:36:14 +0530894 RETURN ${value}
Vijay06a169d2020-04-23 09:28:24 -0500895
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600896
Vijay06a169d2020-04-23 09:28:24 -0500897Switch VMI IPv4 Origin And Verify Details
898 [Documentation] Switch VMI IPv4 origin and verify details.
Vijay06a169d2020-04-23 09:28:24 -0500899
Anves Kumar rayankula7936eee2021-04-19 05:38:36 -0500900 ${dhcp_mode_before}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
Anves Kumar rayankulae7dc89a2021-04-28 04:29:38 -0500901 ${dhcp_enabled}= Set Variable If ${dhcp_mode_before} == ${False} ${True} ${False}
Vijay06a169d2020-04-23 09:28:24 -0500902
Anves Kumar rayankulae7dc89a2021-04-28 04:29:38 -0500903 ${origin}= Set Variable If ${dhcp_mode_before} == ${False} DHCP Static
Vijay06a169d2020-04-23 09:28:24 -0500904 Set VMI IPv4 Origin ${dhcp_enabled} ${HTTP_ACCEPTED}
Anves Kumar rayankula7936eee2021-04-19 05:38:36 -0500905
906 ${dhcp_mode_after}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
907 Should Not Be Equal ${dhcp_mode_before} ${dhcp_mode_after}
908
Megha G N1e9f2f32025-05-13 02:18:41 -0500909 IF ${dhcp_mode_after} == ${True}
910 Verify VMI Network Interface Details ${default} ${origin} ${default} ${default}
911 END
Vijay06a169d2020-04-23 09:28:24 -0500912
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500913
914Delete VMI Static IP Address Using Different Users
915 [Documentation] Update user role and delete vmi static IP address.
916 [Arguments] ${username} ${password} ${valid_status_code}
917 [Teardown] Run Keywords Redfish.Login AND
shrsuman123f559cbe2021-01-06 05:40:45 -0600918 ... Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500919 ... ${test_netmask} ${HTTP_ACCEPTED} AND Redfish.Logout
920
921 # Description of argument(s):
922 # username The host username.
923 # password The host password.
924 # valid_status_code The expected valid status code.
925
Megha GN80ef5ca2022-06-09 00:29:57 -0500926 # TODO: operator_user role is not yet supported.
927 Skip If '${username}' == 'operator_user'
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500928 Redfish.Login ${username} ${password}
929 Delete VMI IPv4 Address delete_param=IPv4StaticAddresses valid_status_code=${valid_status_code}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500930
931
932Config VMI Static IP Address Using Different Users
933 [Documentation] Update user role and update vmi static ip address.
934 [Arguments] ${username} ${password} ${ip} ${gateway} ${netmask}
935 ... ${valid_status_code}
936
937 # Description of argument(s):
938 # username The host username.
939 # password The host password.
940 # ip IP address to be added (e.g. "10.7.7.7").
941 # subnet_mask Subnet mask for the IP to be added
942 # (e.g. "255.255.0.0").
943 # gateway Gateway for the IP to be added (e.g. "10.7.7.1").
944 # valid_status_code The expected valid status code.
945
Megha GN80ef5ca2022-06-09 00:29:57 -0500946 # TODO: operator_user role is not yet supported.
947 Skip If '${username}' == 'operator_user'
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500948 Redfish.Login ${username} ${password}
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600949 Set Static IPv4 Address To VMI And Verify ${ip} ${gateway} ${netmask} ${valid_status_code}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500950
951
952Read VMI Static IP Address Using Different Users
953 [Documentation] Update user role and read vmi static ip address.
954 [Arguments] ${username} ${password} ${valid_status_code}
955
956 # Description of argument(s):
957 # username The host username.
958 # password The host password.
959 # valid_status_code The expected valid status code.
960
Megha GN80ef5ca2022-06-09 00:29:57 -0500961 # TODO: operator_user role is not yet supported.
962 Skip If '${username}' == 'operator_user'
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500963 Redfish.Login ${username} ${password}
964 Redfish.Get
shrsuman123bfb851b2021-07-02 04:59:16 -0500965 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500966 ... valid_status_codes=[${valid_status_code}]
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500967
968
969Delete BMC Users Using Redfish
970 [Documentation] Delete BMC users via redfish.
971
972 Redfish.Login
973 Delete BMC Users Via Redfish users=${USERS}
shrsuman123b361d412020-09-30 06:17:23 -0500974
Sweta Potthurid52b2732021-08-12 12:48:24 -0500975
shrsuman123b361d412020-09-30 06:17:23 -0500976Update User Role And Set VMI IPv4 Origin
977 [Documentation] Update User Role And Set VMI IPv4 Origin.
978 [Arguments] ${username} ${password} ${dhcp_enabled} ${valid_status_code}
979
980 # Description of argument(s):
981 # username The host username.
982 # password The host password.
983 # dhcp_enabled Indicates whether dhcp should be enabled
984 # (${True}, ${False}).
985 # valid_status_code The expected valid status code.
986
Megha GNbe428592022-07-21 10:33:02 -0500987 # TODO: operator_user role is not yet supported.
988 Skip If '${username}' == 'operator_user'
shrsuman123b361d412020-09-30 06:17:23 -0500989 Redfish.Login ${username} ${password}
990 Set VMI IPv4 Origin ${dhcp_enabled} ${valid_status_code}
shrsuman123bfb851b2021-07-02 04:59:16 -0500991
Sweta Potthurid52b2732021-08-12 12:48:24 -0500992
shrsuman123bfb851b2021-07-02 04:59:16 -0500993Suite Teardown Execution
994 [Documentation] Do suite teardown execution task.
995
Megha G N1e9f2f32025-05-13 02:18:41 -0500996 IF ${vmi_network_conf} != ${None}
997 Set Static IPv4 Address To VMI And Verify ${vmi_network_conf["IPv4_Address"]}
shrsuman123bfb851b2021-07-02 04:59:16 -0500998 ... ${vmi_network_conf["IPv4_Gateway"]} ${vmi_network_conf["IPv4_SubnetMask"]}
Megha G N1e9f2f32025-05-13 02:18:41 -0500999 END
1000
shrsuman123b25343d2021-09-22 04:33:47 -05001001 Delete All Redfish Sessions
shrsuman123bfb851b2021-07-02 04:59:16 -05001002 Redfish.Logout
Megha G N3e2cf0d2025-03-11 12:16:08 -05001003
1004
1005Set VMI Invalid Static IPv6 Address And Verify
1006 [Documentation] Set VMI invalid static IPv6 address and verify it throws an error.
1007 [Arguments] ${invalid_vmi_ipv6addr} ${invalid_prefix_length} ${valid_status_codes}
1008 ... ${interface}=${ethernet_interface}
1009
1010 # Description of argument(s):
1011 # invalid_vmi_ipv6addr VMI IPv6 address to be added.
1012 # invalid_prefix_length Prefix length for the VMI IPv6 to be added.
1013 # valid_status_codes Expected status code for PATCH request.
1014 # interface VMI interface (eg. eth0 or eth1).
1015
1016 Set Static VMI IPv6 Address ${invalid_vmi_ipv6addr} ${invalid_prefix_length}
1017 ... ${valid_status_codes}
1018
1019 ${resp}= Redfish.Get /redfish/v1/Systems/hypervisor/EthernetInterfaces/${interface}
1020
1021 @{vmi_ipv6_address}= Get From Dictionary ${resp.dict} IPv6Addresses
1022 ${vmi_ipv6_addr}= Get From List ${vmi_ipv6_address} 0
1023 Should Not Be Equal ${vmi_ipv6_addr["Address"]} ${invalid_vmi_ipv6addr}
Megha G Nf719f242025-03-25 04:09:50 -05001024
1025
1026Delete VMI IPv6 Static Default Gateway Address
1027 [Documentation] Delete VMI IPv6 static default gateway address.
1028 [Arguments] ${valid_status_codes}=${HTTP_ACCEPTED}
1029 ... ${interface}=${ethernet_interface}
1030
1031 # Description of argument(s):
1032 # valid_status_codes Expected valid status code from PATCH request.
1033 # interface VMI interface (eg. eth0 or eth1).
1034
1035 ${data}= Set Variable {"IPv6StaticDefaultGateways": [${Null}]}
1036 Redfish.Patch /redfish/v1/Systems/hypervisor/EthernetInterfaces/${interface}
1037 ... body=${data} valid_status_codes=[${valid_status_codes}]
Megha G N439f7122025-06-02 02:58:39 -05001038
1039
1040Set VMI Valid Static IPv6 Address And Verify
1041 [Documentation] Set valid static VMI IPv6 address and check whether IPv6 origin is set to static
1042 ... and Static IPv6 address is assigned.
1043 [Arguments] ${valid_vmi_ipv6addr} ${valid_prefix_length} ${valid_status_codes}=${HTTP_ACCEPTED}
1044 ... ${interface}=${ethernet_interface}
1045
1046 # Description of argument(s):
1047 # valid_vmi_ipv6addr VMI IPv6 address to be added.
1048 # valid_prefix_length Prefix length for the VMI IPv6 to be added.
1049 # valid_status_codes Expected status code for PATCH request.
1050 # interface VMI interface (eg. eth0 or eth1).
1051
1052 Set Static VMI IPv6 Address ${valid_vmi_ipv6addr} ${valid_prefix_length}
1053 ... ${valid_status_codes}
1054
Megha G N376f6e82025-06-18 03:55:10 -05001055 ${vmi_ipv6}= Verify VMI IPv6 Address Static
1056 Should Be Equal ${vmi_ipv6["Address"]} ${valid_vmi_ipv6addr}