blob: bcd4476f33ae9b7e88736a7e44f6c9f3f6f923f3 [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
Matt Fischer6fb70d92023-10-24 19:06:33 -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 N38acd842024-10-14 14:28:11 -050031&{SLAAC_ENABLED} IPv6AutoConfigEnabled=${True}
32&{SLAAC_DISABLED} IPv6AutoConfigEnabled=${False}
33
34&{ENABLE_SLAAC} StatelessAddressAutoConfig=&{SLAAC_ENABLED}
35&{DISABLE_SLAAC} StatelessAddressAutoConfig=&{SLAAC_DISABLED}
36
Megha G N02cbfa12022-12-12 02:05:03 -060037${default} 0.0.0.0
38
Vijay06a169d2020-04-23 09:28:24 -050039
40*** Test Cases ***
41
42Verify All VMI EthernetInterfaces
43 [Documentation] Verify all VMI ethernet interfaces.
shrsuman1235c7e4d72021-04-16 05:42:57 -050044 [Tags] Verify_All_VMI_EthernetInterfaces
Vijay06a169d2020-04-23 09:28:24 -050045
46 Verify VMI EthernetInterfaces
47
48
49Verify Existing VMI Network Interface Details
50 [Documentation] Verify existing VMI network interface details.
shrsuman1235c7e4d72021-04-16 05:42:57 -050051 [Tags] Verify_Existing_VMI_Network_Interface_Details
Vijay06a169d2020-04-23 09:28:24 -050052
53 ${vmi_ip}= Get VMI Network Interface Details
54 ${origin}= Set Variable If ${vmi_ip["DHCPv4"]} == ${False} Static DHCP
Vijay06a169d2020-04-23 09:28:24 -050055 Should Not Be Equal ${vmi_ip["DHCPv4"]} ${vmi_ip["IPv4StaticAddresses"]}
shrsuman123bfb851b2021-07-02 04:59:16 -050056 Should Be Equal As Strings ${vmi_ip["Id"]} ${ethernet_interface}
George Keishingb3ea0952020-07-01 05:03:56 -050057 Should Be Equal As Strings ${vmi_ip["Description"]}
shrsuman1235c7e4d72021-04-16 05:42:57 -050058 ... Hypervisor's Virtual Management Ethernet Interface
59 Should Be Equal As Strings ${vmi_ip["Name"]} Hypervisor Ethernet Interface
shrsuman1235c7e4d72021-04-16 05:42:57 -050060 Run Keyword If ${vmi_ip["IPv4StaticAddresses"]} != @{empty}
61 ... Verify VMI Network Interface Details ${vmi_ip["IPv4_Address"]}
62 ... ${origin} ${vmi_ip["IPv4_Gateway"]} ${vmi_ip["IPv4_SubnetMask"]}
Vijay06a169d2020-04-23 09:28:24 -050063
64
65Delete Existing Static VMI IP Address
66 [Documentation] Delete existing static VMI IP address.
67 [Tags] Delete_Existing_Static_VMI_IP_Address
68
69 ${curr_origin}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
70 Run Keyword If ${curr_origin} == ${True} Set VMI IPv4 Origin ${False} ${HTTP_ACCEPTED}
71
shrsuman1235c7e4d72021-04-16 05:42:57 -050072 Delete VMI IPv4 Address
Vijay06a169d2020-04-23 09:28:24 -050073
74
75Verify User Cannot Delete ReadOnly Property IPv4Addresses
76 [Documentation] Verify user cannot delete readonly property IPv4Addresses.
77 [Tags] Verify_User_Cannot_Delete_ReadOnly_Property_IPv4Addresses
78
79 ${curr_origin}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
shrsuman1235c7e4d72021-04-16 05:42:57 -050080 Run Keyword If ${curr_origin} == ${True} Set VMI IPv4 Origin ${False} ${HTTP_ACCEPTED}
81 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
shrsuman123b25343d2021-09-22 04:33:47 -050082 Delete VMI IPv4 Address IPv4Addresses valid_status_code=${HTTP_FORBIDDEN}
Vijay06a169d2020-04-23 09:28:24 -050083
84
Anves Kumar rayankula358c41d2020-08-14 04:53:06 -050085Assign Valid And Invalid Static IPv4 Address To VMI
Vijay06a169d2020-04-23 09:28:24 -050086 [Documentation] Assign static IPv4 address to VMI.
Anves Kumar rayankula358c41d2020-08-14 04:53:06 -050087 [Tags] Assign_Valid_And_Invalid_Static_IPv4_Address_To_VMI
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -060088 [Template] Set Static IPv4 Address To VMI And Verify
89 [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution
Vijay06a169d2020-04-23 09:28:24 -050090
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -050091 # ip gateway netmask valid_status_code
Shradha Sumanc7df7db2021-03-08 05:16:44 -060092 10.5.20.30 10.5.20.1 255.255.252.0 ${HTTP_ACCEPTED}
93 a.3.118.94 10.5.20.1 255.255.252.0 ${HTTP_BAD_REQUEST}
Anves Kumar rayankula81fd9db2021-05-10 02:39:51 -050094 10.5.20 10.5.20.1 255.255.252.0 ${HTTP_BAD_REQUEST}
95 10.5.20.-5 10.5.20.1 255.255.252.0 ${HTTP_BAD_REQUEST}
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -050096
Vijay06a169d2020-04-23 09:28:24 -050097
George Keishing16b3c7b2021-01-28 09:23:37 -060098Add Multiple IP Addresses On VMI Interface And Verify
99 [Documentation] Add multiple IP addresses on VMI interface and verify.
100 [Tags] Add_Multiple_IP_Addresses_On_VMI_Interface_And_Verify
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600101 [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution
shrsuman123e37b0cc2020-09-02 00:33:42 -0500102
Shradha Sumanc7df7db2021-03-08 05:16:44 -0600103 ${ip1}= Create dictionary Address=10.5.5.10 SubnetMask=255.255.252.0 Gateway=10.5.5.1
104 ${ip2}= Create dictionary Address=10.5.5.11 SubnetMask=255.255.252.0 Gateway=10.5.5.1
105 ${ip3}= Create dictionary Address=10.5.5.12 SubnetMask=255.255.252.0 Gateway=10.5.5.1
shrsuman123e37b0cc2020-09-02 00:33:42 -0500106 ${ips}= Create List ${ip1} ${ip2} ${ip3}
107
shrsuman123bfb851b2021-07-02 04:59:16 -0500108 Redfish.Patch /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface}
shrsuman123993a5c92021-04-19 06:40:16 -0500109 ... body={'IPv4StaticAddresses':${ips}} valid_status_codes=[${HTTP_BAD_REQUEST}]
shrsuman123e37b0cc2020-09-02 00:33:42 -0500110
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500111
shrsuman123e37b0cc2020-09-02 00:33:42 -0500112Modify IP Addresses On VMI Interface And Verify
113 [Documentation] Modify IP addresses on VMI interface and verify.
114 [Tags] Modify_IP_Addresses_On_VMI_Interface_And_Verify
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600115 [Template] Set Static IPv4 Address To VMI And Verify
116 [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution
shrsuman123e37b0cc2020-09-02 00:33:42 -0500117
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500118 # ip gateway netmask valid_status_code
Shradha Sumanc7df7db2021-03-08 05:16:44 -0600119 10.5.5.10 10.5.5.1 255.255.252.0 ${HTTP_ACCEPTED}
120 10.5.5.11 10.5.5.1 255.255.252.0 ${HTTP_ACCEPTED}
Vijay06a169d2020-04-23 09:28:24 -0500121
Megha GN80ef5ca2022-06-09 00:29:57 -0500122
Vijay06a169d2020-04-23 09:28:24 -0500123Switch Between IP Origins On VMI And Verify Details
124 [Documentation] Switch between IP origins on VMI and verify details.
125 [Tags] Switch_Between_IP_Origins_On_VMI_And_Verify_Details
126
127 Switch VMI IPv4 Origin And Verify Details
128 Switch VMI IPv4 Origin And Verify Details
129
130
131Verify Persistency Of VMI IPv4 Details After Host Reboot
132 [Documentation] Verify persistency of VMI IPv4 details after host reboot.
133 [Tags] Verify_Persistency_Of_VMI_IPv4_Details_After_Host_Reboot
134
135 # Verifying persistency of dynamic address.
136 Set VMI IPv4 Origin ${True} ${HTTP_ACCEPTED}
Anves Kumar rayankula7936eee2021-04-19 05:38:36 -0500137 Redfish Power Off stack_mode=skip
138 Redfish Power On
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500139 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
Vijay06a169d2020-04-23 09:28:24 -0500140
141 # Verifying persistency of static address.
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600142 Switch VMI IPv4 Origin And Verify Details
Anves Kumar rayankula7936eee2021-04-19 05:38:36 -0500143 Redfish Power Off stack_mode=skip
144 Redfish Power On
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600145 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
Vijay06a169d2020-04-23 09:28:24 -0500146
147
Anves Kumar rayankula9fa524a2020-08-18 06:40:18 -0500148Delete VMI Static IP Address And Verify
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500149 [Documentation] Delete VMI static IP address and verify.
150 [Tags] Delete_VMI_Static_IP_Address_And_Verify
151 [Teardown] Test Teardown Execution
Anves Kumar rayankula9fa524a2020-08-18 06:40:18 -0500152
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600153 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
154 Delete VMI IPv4 Address
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500155
Anves Kumar rayankula9fa524a2020-08-18 06:40:18 -0500156
shrsuman123c1d3fe32020-09-08 05:04:07 -0500157Verify Successful VMI IP Static Configuration On HOST Boot After Session Delete
158 [Documentation] Verify VMI IP static Configuration On HOST Boot After session deleted.
159 [Tags] Verify_Successful_VMI_IP_Static_Configuration_On_HOST_Boot_After_Session_Delete
shrsuman123b25343d2021-09-22 04:33:47 -0500160 [Teardown] Run keywords Delete VMI IPv4 Address AND Test Teardown Execution
shrsuman123c1d3fe32020-09-08 05:04:07 -0500161
shrsuman12375e77062020-09-18 01:08:45 -0500162 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
shrsuman123c1d3fe32020-09-08 05:04:07 -0500163
164 ${session_info}= Get Redfish Session Info
165 Redfish.Delete ${session_info["location"]}
166
167 # Create a new Redfish session
shrsuman1235c7e4d72021-04-16 05:42:57 -0500168 Redfish.Login
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500169 Redfish Power Off
170 Redfish Power On
shrsuman123c1d3fe32020-09-08 05:04:07 -0500171
172 Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask}
173
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500174
shrsuman123c1d3fe32020-09-08 05:04:07 -0500175Verify Persistency Of VMI DHCP IP Configuration After Multiple HOST Reboots
176 [Documentation] Verify Persistency Of VMI DHCP IP configuration After Multiple HOST Reboots
177 [Tags] Verify_Persistency_Of_VMI_DHCP_IP_Configuration_After_Multiple_HOST_Reboots
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500178 [Teardown] Test Teardown Execution
shrsuman123c1d3fe32020-09-08 05:04:07 -0500179
shrsuman123c1d3fe32020-09-08 05:04:07 -0500180 Set VMI IPv4 Origin ${True} ${HTTP_ACCEPTED}
shrsuman123c1d3fe32020-09-08 05:04:07 -0500181 ${vmi_ip_config}= Get VMI Network Interface Details
182 # Verifying persistency of dynamic address after multiple reboots.
shrsuman123f559cbe2021-01-06 05:40:45 -0600183 FOR ${i} IN RANGE ${2}
184 Redfish Power Off
185 Redfish Power On
George Keishing538f1742022-03-14 05:00:55 -0500186 Verify VMI Network Interface Details ${vmi_ip_config["IPv4_Address"]}
187 ... DHCP ${vmi_ip_config["IPv4_Gateway"]} ${vmi_ip_config["IPv4_SubnetMask"]}
shrsuman123f559cbe2021-01-06 05:40:45 -0600188 END
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500189
190
191Enable DHCP When Static IP Configured And Verify Static IP
192 [Documentation] Enable DHCP when static ip configured and verify static ip
George Keishing4203fad2022-01-31 12:22:33 -0600193 [Tags] Enable_DHCP_When_Static_IP_Configured_And_Verify_Static_IP
Shradha Sumanc7df7db2021-03-08 05:16:44 -0600194 [Setup] Redfish Power On
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500195 [Teardown] Test Teardown Execution
196
shrsuman123f559cbe2021-01-06 05:40:45 -0600197 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500198 Set VMI IPv4 Origin ${True}
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500199 ${vmi_network_conf}= Get VMI Network Interface Details
200 Should Not Be Equal As Strings ${test_ipv4} ${vmi_network_conf["IPv4_Address"]}
201
Anves Kumar rayankula9fa524a2020-08-18 06:40:18 -0500202
shrsuman123e37b0cc2020-09-02 00:33:42 -0500203Verify VMI Static IP Configuration Persist On BMC Reset Before Host Boot
204 [Documentation] Verify VMI static IP configuration persist on BMC reset.
205 [Tags] Verify_VMI_Static_IP_Configuration_Persist_On_BMC_Reset_Before_Host_Boot
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600206 [Teardown] Run keywords Delete VMI IPv4 Address AND FFDC On Test Case Fail
shrsuman123e37b0cc2020-09-02 00:33:42 -0500207
shrsuman12375e77062020-09-18 01:08:45 -0500208 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
Megha GNbe428592022-07-21 10:33:02 -0500209 Redfish OBMC Reboot (off) stack_mode=skip
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500210 Redfish Power On
shrsuman123e37b0cc2020-09-02 00:33:42 -0500211 # Verifying the VMI static configuration
212 Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask}
213
Megha GN80ef5ca2022-06-09 00:29:57 -0500214
shrsuman12375e77062020-09-18 01:08:45 -0500215Add Static IP When Host Poweroff And Verify On Poweron
216 [Documentation] Add Static IP When Host Poweroff And Verify on power on
217 [Tags] Add_Static_IP_When_Host_Poweroff_And_Verify_On_Poweron
218 [Setup] Redfish Power Off
219 [Teardown] Run keywords Delete VMI IPv4 Address AND FFDC On Test Case Fail
220
221 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
222 Redfish Power On
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 VMI Static IP When Host Poweroff And Verify Static IP On BMC Reset
227 [Documentation] Add Static IP When Host Poweroff And Verify Static IP On BMC Reset.
228 [Tags] Add_VMI_Static_IP_When_Host_Poweroff_And_Verify_Static_IP_On_BMC_Reset
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}
Megha GNbe428592022-07-21 10:33:02 -0500233 Redfish OBMC Reboot (off) stack_mode=skip
shrsuman12375e77062020-09-18 01:08:45 -0500234 Redfish Power On
235 Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask}
236
Megha GN80ef5ca2022-06-09 00:29:57 -0500237
shrsuman12375e77062020-09-18 01:08:45 -0500238Enable DHCP When No Static IP Configured And Verify DHCP IP
239 [Documentation] Enable DHCP when no static ip configured and verify dhcp ip
240 [Tags] Enable_DHCP_When_No_Static_IP_Configured_And_Verify_DHCP_IP
241 [Setup] Run Keyword And Ignore Error Delete VMI IPv4 Address
242 [Teardown] Test Teardown Execution
243
244 ${curr_origin}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
245 Run Keyword If ${curr_origin} == ${False} Set VMI IPv4 Origin ${True} ${HTTP_ACCEPTED}
246 ${vmi_ip_config}= Get VMI Network Interface Details
George Keishing538f1742022-03-14 05:00:55 -0500247 Verify VMI Network Interface Details ${vmi_ip_config["IPv4_Address"]}
248 ... DHCP ${vmi_ip_config["IPv4_Gateway"]} ${vmi_ip_config["IPv4_SubnetMask"]}
shrsuman12375e77062020-09-18 01:08:45 -0500249
Megha GN80ef5ca2022-06-09 00:29:57 -0500250
shrsuman12375e77062020-09-18 01:08:45 -0500251Verify User Cannot Delete VMI DHCP IP Address
252 [Documentation] Verify user cannot delete VMI DHCP IP Address
253 [Tags] Verify_User_Cannot_Delete_VMI_DHCP_IP_Address
254 [Setup] Set VMI IPv4 Origin ${True}
255 [Teardown] Test Teardown Execution
256
shrsuman123b25343d2021-09-22 04:33:47 -0500257 Delete VMI IPv4 Address IPv4Addresses valid_status_code=${HTTP_FORBIDDEN}
shrsuman12375e77062020-09-18 01:08:45 -0500258 ${resp}= Redfish.Get
shrsuman123bfb851b2021-07-02 04:59:16 -0500259 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface}
shrsuman12375e77062020-09-18 01:08:45 -0500260 Should Not Be Empty ${resp.dict["IPv4Addresses"]}
261
Megha GN80ef5ca2022-06-09 00:29:57 -0500262
shrsuman12375e77062020-09-18 01:08:45 -0500263Enable DHCP When Static IP Configured DHCP Server Unavailable And Verify IP
264 [Documentation] Enable DHCP When Static IP Configured And DHCP Server Unavailable And Verify No IP.
265 [Tags] Enable_DHCP_When_Static_IP_Configured_DHCP_Server_Unavailable_And_Verify_IP
266 [Teardown] Test Teardown Execution
267
268 Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway} ${test_netmask}
269 Set VMI IPv4 Origin ${True}
shrsuman12375e77062020-09-18 01:08:45 -0500270 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
271
shrsuman123e37b0cc2020-09-02 00:33:42 -0500272
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500273Verify To Configure VMI Static IP Address With Different User Roles
274 [Documentation] Verify to configure vmi static ip address with different user roles.
275 [Tags] Verify_To_Configure_VMI_Static_IP_Address_With_Different_User_Roles
Megha G N4e2b5732023-02-02 04:52:27 -0600276 [Setup] Run Keywords Delete BMC Users Using Redfish
277 ... AND Create Users With Different Roles users=${USERS} force=${True}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500278 [Template] Config VMI Static IP Address Using Different Users
279 [Teardown] Delete BMC Users Using Redfish
280
281 # username password ip_address gateway nemask valid_status_code
282 admin_user TestPwd123 ${test_ipv4} ${test_gateway} ${test_netmask} ${HTTP_ACCEPTED}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500283 readonly_user TestPwd123 ${test_ipv4} ${test_gateway} ${test_netmask} ${HTTP_FORBIDDEN}
Megha GN80ef5ca2022-06-09 00:29:57 -0500284
285
286Verify To Configure VMI Static IP Address With Operator User Role
287 [Documentation] Verify to configure vmi static ip address with operator user role.
288 [Tags] Verify_To_Configure_VMI_Static_IP_Address_With_Operator_User_Role
289 [Setup] Create Users With Different Roles users=${USERS} force=${True}
290 [Template] Config VMI Static IP Address Using Different Users
291 [Teardown] Delete BMC Users Using Redfish
292
293 # username password ip_address gateway nemask valid_status_code
294 operator_user TestPwd123 ${test_ipv4} ${test_gateway} ${test_netmask} ${HTTP_FORBIDDEN}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500295
296
297Verify To Delete VMI Static IP Address With Different User Roles
298 [Documentation] Verify to delete vmi static IP address with different user roles.
299 [Tags] Verify_To_Delete_VMI_Static_IP_Address_With_Different_User_Roles
300 [Setup] Create Users With Different Roles users=${USERS} force=${True}
301 [Template] Delete VMI Static IP Address Using Different Users
302 [Teardown] Delete BMC Users Using Redfish
303
304 # username password valid_status_code
305 admin_user TestPwd123 ${HTTP_ACCEPTED}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500306 readonly_user TestPwd123 ${HTTP_FORBIDDEN}
Megha GN80ef5ca2022-06-09 00:29:57 -0500307
308
309Verify To Delete VMI Static IP Address With Operator User Role
310 [Documentation] Verify to delete vmi static IP address with operator user role.
311 [Tags] Verify_To_Delete_VMI_Static_IP_Address_With_Operator_User_Role
312 [Setup] Create Users With Different Roles users=${USERS} force=${True}
313 [Template] Delete VMI Static IP Address Using Different Users
314 [Teardown] Delete BMC Users Using Redfish
315
316 # username password valid_status_code
317 operator_user TestPwd123 ${HTTP_FORBIDDEN}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500318
319
320Verify To Update VMI Static IP Address With Different User Roles
321 [Documentation] Verify to update vmi static IP address with different user roles.
George Keishing4203fad2022-01-31 12:22:33 -0600322 [Tags] Verify_To_Update_VMI_Static_IP_Address_With_Different_User_Roles
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500323 [Setup] Create Users With Different Roles users=${USERS} force=${True}
324 [Template] Config VMI Static IP Address Using Different Users
325 [Teardown] Delete BMC Users Using Redfish
326
Shradha Sumanc7df7db2021-03-08 05:16:44 -0600327 # username password ip_address gateway netmask valid_status_code
328 admin_user TestPwd123 10.5.10.20 10.5.10.1 255.255.0.0 ${HTTP_ACCEPTED}
Shradha Sumanc7df7db2021-03-08 05:16:44 -0600329 readonly_user TestPwd123 10.5.20.40 10.5.20.1 255.255.0.0 ${HTTP_FORBIDDEN}
Megha GN80ef5ca2022-06-09 00:29:57 -0500330
331
332Verify To Update VMI Static IP Address With Operator User Role
333 [Documentation] Verify to update vmi static IP address with operator user role.
334 [Tags] Verify_To_Update_VMI_Static_IP_Address_With_Operator_User_Role
335 [Setup] Create Users With Different Roles users=${USERS} force=${True}
336 [Template] Config VMI Static IP Address Using Different Users
337 [Teardown] Delete BMC Users Using Redfish
338
339 # username password ip_address gateway netmask valid_status_code
340 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 -0500341
342
343Verify To Read VMI Network Configuration With Different User Roles
344 [Documentation] Verify to read vmi network configuration with different user roles.
George Keishing4203fad2022-01-31 12:22:33 -0600345 [Tags] Verify_To_Read_VMI_Network_Configuration_With_Different_User_Roles
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500346 [Setup] Create Users With Different Roles users=${USERS} force=${True}
347 [Template] Read VMI Static IP Address Using Different Users
348 [Teardown] Delete BMC Users Using Redfish
349
350 # username password valid_status_code
351 admin_user TestPwd123 ${HTTP_OK}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500352 readonly_user TestPwd123 ${HTTP_OK}
Megha GN80ef5ca2022-06-09 00:29:57 -0500353
354
355Verify To Read VMI Network Configuration With Operator User Role
356 [Documentation] Verify to read vmi network configuration with operator user role.
357 [Tags] Verify_To_Read_VMI_Network_Configuration_With_Operator_User_Role
358 [Setup] Create Users With Different Roles users=${USERS} force=${True}
359 [Template] Read VMI Static IP Address Using Different Users
360 [Teardown] Delete BMC Users Using Redfish
361
362 # username password valid_status_code
363 operator_user TestPwd123 ${HTTP_FORBIDDEN}
364
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500365
shrsuman123b361d412020-09-30 06:17:23 -0500366Enable DHCP On VMI Network Via Different Users Roles And Verify
367 [Documentation] Enable DHCP On VMI Network Via Different Users Roles And Verify.
368 [Tags] Enable_DHCP_On_VMI_Network_Via_Different_Users_Roles_And_Verify
369 [Setup] Create Users With Different Roles users=${USERS} force=${True}
370 [Template] Update User Role And Set VMI IPv4 Origin
371 [Teardown] Delete BMC Users Using Redfish
372
373 # username password dhcp_enabled valid_status_code
374 admin_user TestPwd123 ${True} ${HTTP_ACCEPTED}
shrsuman123b361d412020-09-30 06:17:23 -0500375 readonly_user TestPwd123 ${True} ${HTTP_FORBIDDEN}
Megha GN80ef5ca2022-06-09 00:29:57 -0500376
377
378Enable DHCP On VMI Network Via Operator User Role And Verify
379 [Documentation] Enable DHCP On VMI Network Via Operator User Role And Verify.
380 [Tags] Enable_DHCP_On_VMI_Network_Via_Operator_User_Role_And_Verify
381 [Setup] Create Users With Different Roles users=${USERS} force=${True}
382 [Template] Update User Role And Set VMI IPv4 Origin
383 [Teardown] Delete BMC Users Using Redfish
384
385 # username password dhcp_enabled valid_status_code
386 operator_user TestPwd123 ${True} ${HTTP_FORBIDDEN}
387
shrsuman123b361d412020-09-30 06:17:23 -0500388
389Disable DHCP On VMI Network Via Different Users Roles And Verify
390 [Documentation] Disable DHCP On VMI Network Via Different Users Roles And Verify.
391 [Tags] Disable_DHCP_On_VMI_Network_Via_Different_Users_Roles_And_Verify
392 [Setup] Create Users With Different Roles users=${USERS} force=${True}
393 [Template] Update User Role And Set VMI IPv4 Origin
394 [Teardown] Delete BMC Users Using Redfish
395
396 # username password dhcp_enabled valid_status_code
397 admin_user TestPwd123 ${False} ${HTTP_ACCEPTED}
shrsuman123b361d412020-09-30 06:17:23 -0500398 readonly_user TestPwd123 ${False} ${HTTP_FORBIDDEN}
Megha GN80ef5ca2022-06-09 00:29:57 -0500399
400
401Disable DHCP On VMI Network Via Operator User Role And Verify
402 [Documentation] Disable DHCP On VMI Network Via Operator User Role And Verify.
403 [Tags] Disable_DHCP_On_VMI_Network_Via_Operator_User_Role_And_Verify
404 [Setup] Create Users With Different Roles users=${USERS} force=${True}
405 [Template] Update User Role And Set VMI IPv4 Origin
406 [Teardown] Delete BMC Users Using Redfish
407
408 # username password dhcp_enabled valid_status_code
409 operator_user TestPwd123 ${False} ${HTTP_FORBIDDEN}
shrsuman123b361d412020-09-30 06:17:23 -0500410
shrsuman123e37b0cc2020-09-02 00:33:42 -0500411
Anves Kumar rayankula55b939e2020-08-12 04:19:01 -0500412Enable And Disable DHCP And Verify
413 [Documentation] verify enable DHCP and disable DHCP.
George Keishing4203fad2022-01-31 12:22:33 -0600414 [Tags] Enable_And_Disable_DHCP_And_Verify
Anves Kumar rayankula55b939e2020-08-12 04:19:01 -0500415
416 Set VMI IPv4 Origin ${True}
Anves Kumar rayankula55b939e2020-08-12 04:19:01 -0500417 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
418 Set VMI IPv4 Origin ${False}
Megha GN80ef5ca2022-06-09 00:29:57 -0500419 Verify VMI Network Interface Details ${default} Static ${default} ${default}
Anves Kumar rayankula55b939e2020-08-12 04:19:01 -0500420
421
422Multiple Times Enable And Disable DHCP And Verify
423 [Documentation] Enable and Disable DHCP in a loop and verify VMI gets an IP address from DHCP
424 ... each time when DHCP is enabled
425 [Tags] Multiple_Times_Enable_And_Disable_DHCP_And_Verify
426
Anves Kumar rayankula55b939e2020-08-12 04:19:01 -0500427 FOR ${i} IN RANGE ${2}
428 Set VMI IPv4 Origin ${True}
429 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
430 Set VMI IPv4 Origin ${False}
Megha GN80ef5ca2022-06-09 00:29:57 -0500431 Verify VMI Network Interface Details ${default} Static ${default} ${default}
Anves Kumar rayankula55b939e2020-08-12 04:19:01 -0500432 END
433
434
Anves Kumar rayankula81fd9db2021-05-10 02:39:51 -0500435Assign Static IPv4 Address With Invalid Netmask To VMI
436 [Documentation] Assign static IPv4 address with invalid netmask and expect error.
437 [Tags] Assign_Static_IPv4_Address_With_Invalid_Netmask_To_VMI
438 [Template] Set Static IPv4 Address To VMI And Verify
439
440 # ip gateway netmask valid_status_code
441 ${test_ipv4} ${test_gateway} 255.256.255.0 ${HTTP_BAD_REQUEST}
442 ${test_ipv4} ${test_gateway} ff.ff.ff.ff ${HTTP_BAD_REQUEST}
443 ${test_ipv4} ${test_gateway} 255.255.253.0 ${HTTP_BAD_REQUEST}
444
445
446Assign Static IPv4 Address With Invalid Gateway To VMI
447 [Documentation] Add static IPv4 address with invalid gateway and expect error.
448 [Tags] Assign_Static_IPv4_Address_With_Invalid_Gateway_To_VMI
449 [Template] Set Static IPv4 Address To VMI And Verify
450
451 # ip gateway netmask valid_status_code
452 ${test_ipv4} @@@.%%.44.11 ${test_netmask} ${HTTP_BAD_REQUEST}
453 ${test_ipv4} 0xa.0xb.0xc.0xd ${test_netmask} ${HTTP_BAD_REQUEST}
454 ${test_ipv4} 10.3.36 ${test_netmask} ${HTTP_BAD_REQUEST}
455 ${test_ipv4} 10.3.36.-10 ${test_netmask} ${HTTP_BAD_REQUEST}
456
457
Megha G N02cbfa12022-12-12 02:05:03 -0600458Enable DHCP When Host Is Off And Verify After Poweron
459 [Documentation] Enable DHCP when host is off and
460 ... check whether it is enabled after poweron.
461 [Tags] Enable_DHCP_When_Host_Is_Off_And_Verify_After_Poweron
462 [Setup] Redfish Power Off stack_mode=skip
463
464 Set VMI IPv4 Origin ${True}
465 Redfish Power On stack_mode=skip
466 Verify VMI Network Interface Details ${default} DHCP ${default} ${default}
467
468
Megha G N89174682023-01-24 23:28:27 -0600469Disable DHCP When Host Is Off And Verify New State Reflects After Power On
470 [Documentation] Disable DHCP when host is off and
471 ... get network info and verify that VMI origin is static.
472 [Tags] Disable_DHCP_When_Host_Is_Off_And_Verify_New_State_Reflects_After_Power_On
473 [Setup] Redfish Power Off stack_mode=skip
474
475 Set VMI IPv4 Origin ${False}
476 Redfish Power On stack_mode=skip
477 Verify VMI Network Interface Details ${default} Static ${default} ${default}
478
479
Megha G N38acd842024-10-14 14:28:11 -0500480Enable VMI Stateless Address AutoConfig And Verify
481 [Documentation] Enable VMI SLAACv6 and verify an origin.
482 [Tags] Enable_VMI_Stateless_Address_AutoConfig_And_Verify
483
484 Set VMI SLAACv6 Origin ${True}
485
486 # Check origin is set to slaac and address are getting displayed.
487 Verify VMI IPv6 Address SLAAC
488
489
Megha G Ne8c0e422024-12-04 03:12:55 -0600490Disable VMI Stateless Address AutoConfig And Verify
491 [Documentation] Disable VMI SLAACv6 and verify an origin.
492 [Tags] Disable_VMI_Stateless_Address_AutoConfig_And_Verify
493 [Setup] Set VMI SLAACv6 Origin ${True}
494
495 Set VMI SLAACv6 Origin ${False}
496
497 # Check origin is set to static and slaacv6 address are getting erased.
498 Verify VMI IPv6 Address Static
499
500
Vijay06a169d2020-04-23 09:28:24 -0500501*** Keywords ***
502
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500503Suite Setup Execution
504 [Documentation] Do test setup execution task.
505
506 Redfish.Login
Megha G Nd0b4da92024-02-08 15:04:24 -0600507
508 Redfish Power Off
509 Set BIOS Attribute pvm_hmc_managed Enabled
Megha G N1e538242024-06-11 03:42:03 -0500510 Set BIOS Attribute pvm_stop_at_standby Disabled
511
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500512 Redfish Power On
Megha G N1e538242024-06-11 03:42:03 -0500513 Wait For Host Boot Progress To Reach Required State
Megha G N86507da2024-02-07 23:16:27 -0600514
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500515 ${active_channel_config}= Get Active Channel Config
516 Set Suite Variable ${active_channel_config}
shrsuman123bfb851b2021-07-02 04:59:16 -0500517 Set Suite Variable ${ethernet_interface} ${active_channel_config['${CHANNEL_NUMBER}']['name']}
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500518 ${resp}= Redfish.Get
shrsuman123bfb851b2021-07-02 04:59:16 -0500519 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface}
shrsuman12362e5be52021-05-20 02:42:59 -0500520 ${ip_resp}= Evaluate json.loads(r'''${resp.text}''') json
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500521 ${length}= Get Length ${ip_resp["IPv4StaticAddresses"]}
522 ${vmi_network_conf}= Run Keyword If ${length} != ${0} Get VMI Network Interface Details
523 Set Suite Variable ${vmi_network_conf}
524
525
526Test Teardown Execution
527 [Documentation] Do test teardown execution task.
528
529 FFDC On Test Case Fail
530 ${curr_mode}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
531 Run Keyword If ${curr_mode} == ${True} Set VMI IPv4 Origin ${False}
Megha G N1e538242024-06-11 03:42:03 -0500532 Run Keyword If '${vmi_network_conf["IPv4_Address"]}' != '${default}'
shrsuman123f559cbe2021-01-06 05:40:45 -0600533 ... Set Static IPv4 Address To VMI And Verify ${vmi_network_conf["IPv4_Address"]}
Anves Kumar rayankulad7deb892020-08-24 02:58:20 -0500534 ... ${vmi_network_conf["IPv4_Gateway"]} ${vmi_network_conf["IPv4_SubnetMask"]}
535
536
Vijay06a169d2020-04-23 09:28:24 -0500537Get Immediate Child Parameter From VMI Network Interface
538 [Documentation] Get immediate child parameter from VMI network interface.
539 [Arguments] ${parameter} ${valid_status_code}=${HTTP_OK}
540
541 # Description of argument(s):
542 # parameter parameter for which value is required. Ex: DHCPEnabled, MACAddress etc.
543 # valid_status_code Expected valid status code from GET request.
544
Anves Kumar rayankula358c41d2020-08-14 04:53:06 -0500545 ${resp}= Redfish.Get
shrsuman123bfb851b2021-07-02 04:59:16 -0500546 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface}
Vijay06a169d2020-04-23 09:28:24 -0500547 ... valid_status_codes=[${valid_status_code}]
548
shrsuman12362e5be52021-05-20 02:42:59 -0500549 ${ip_resp}= Evaluate json.loads(r'''${resp.text}''') json
Vijay06a169d2020-04-23 09:28:24 -0500550 ${value}= Set Variable If '${parameter}' != 'DHCPEnabled' ${ip_resp["${parameter}"]}
551 ... ${ip_resp["DHCPv4"]["${parameter}"]}
552
George Keishing409df052024-01-17 22:36:14 +0530553 RETURN ${value}
Vijay06a169d2020-04-23 09:28:24 -0500554
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600555
Vijay06a169d2020-04-23 09:28:24 -0500556Switch VMI IPv4 Origin And Verify Details
557 [Documentation] Switch VMI IPv4 origin and verify details.
Vijay06a169d2020-04-23 09:28:24 -0500558
Anves Kumar rayankula7936eee2021-04-19 05:38:36 -0500559 ${dhcp_mode_before}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
Anves Kumar rayankulae7dc89a2021-04-28 04:29:38 -0500560 ${dhcp_enabled}= Set Variable If ${dhcp_mode_before} == ${False} ${True} ${False}
Vijay06a169d2020-04-23 09:28:24 -0500561
Anves Kumar rayankulae7dc89a2021-04-28 04:29:38 -0500562 ${origin}= Set Variable If ${dhcp_mode_before} == ${False} DHCP Static
Vijay06a169d2020-04-23 09:28:24 -0500563 Set VMI IPv4 Origin ${dhcp_enabled} ${HTTP_ACCEPTED}
Anves Kumar rayankula7936eee2021-04-19 05:38:36 -0500564
565 ${dhcp_mode_after}= Get Immediate Child Parameter From VMI Network Interface DHCPEnabled
566 Should Not Be Equal ${dhcp_mode_before} ${dhcp_mode_after}
567
568 Run Keyword If ${dhcp_mode_after} == ${True}
569 ... Verify VMI Network Interface Details ${default} ${origin} ${default} ${default}
Vijay06a169d2020-04-23 09:28:24 -0500570
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500571
572Delete VMI Static IP Address Using Different Users
573 [Documentation] Update user role and delete vmi static IP address.
574 [Arguments] ${username} ${password} ${valid_status_code}
575 [Teardown] Run Keywords Redfish.Login AND
shrsuman123f559cbe2021-01-06 05:40:45 -0600576 ... Set Static IPv4 Address To VMI And Verify ${test_ipv4} ${test_gateway}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500577 ... ${test_netmask} ${HTTP_ACCEPTED} AND Redfish.Logout
578
579 # Description of argument(s):
580 # username The host username.
581 # password The host password.
582 # valid_status_code The expected valid status code.
583
Megha GN80ef5ca2022-06-09 00:29:57 -0500584 # TODO: operator_user role is not yet supported.
585 Skip If '${username}' == 'operator_user'
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500586 Redfish.Login ${username} ${password}
587 Delete VMI IPv4 Address delete_param=IPv4StaticAddresses valid_status_code=${valid_status_code}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500588
589
590Config VMI Static IP Address Using Different Users
591 [Documentation] Update user role and update vmi static ip address.
592 [Arguments] ${username} ${password} ${ip} ${gateway} ${netmask}
593 ... ${valid_status_code}
594
595 # Description of argument(s):
596 # username The host username.
597 # password The host password.
598 # ip IP address to be added (e.g. "10.7.7.7").
599 # subnet_mask Subnet mask for the IP to be added
600 # (e.g. "255.255.0.0").
601 # gateway Gateway for the IP to be added (e.g. "10.7.7.1").
602 # valid_status_code The expected valid status code.
603
Megha GN80ef5ca2022-06-09 00:29:57 -0500604 # TODO: operator_user role is not yet supported.
605 Skip If '${username}' == 'operator_user'
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500606 Redfish.Login ${username} ${password}
Anves Kumar rayankula1b64d942020-11-17 02:44:02 -0600607 Set Static IPv4 Address To VMI And Verify ${ip} ${gateway} ${netmask} ${valid_status_code}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500608
609
610Read VMI Static IP Address Using Different Users
611 [Documentation] Update user role and read vmi static ip address.
612 [Arguments] ${username} ${password} ${valid_status_code}
613
614 # Description of argument(s):
615 # username The host username.
616 # password The host password.
617 # valid_status_code The expected valid status code.
618
Megha GN80ef5ca2022-06-09 00:29:57 -0500619 # TODO: operator_user role is not yet supported.
620 Skip If '${username}' == 'operator_user'
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500621 Redfish.Login ${username} ${password}
622 Redfish.Get
shrsuman123bfb851b2021-07-02 04:59:16 -0500623 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${ethernet_interface}
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500624 ... valid_status_codes=[${valid_status_code}]
Anves Kumar rayankulad5de2072020-09-30 06:24:11 -0500625
626
627Delete BMC Users Using Redfish
628 [Documentation] Delete BMC users via redfish.
629
630 Redfish.Login
631 Delete BMC Users Via Redfish users=${USERS}
shrsuman123b361d412020-09-30 06:17:23 -0500632
Sweta Potthurid52b2732021-08-12 12:48:24 -0500633
shrsuman123b361d412020-09-30 06:17:23 -0500634Update User Role And Set VMI IPv4 Origin
635 [Documentation] Update User Role And Set VMI IPv4 Origin.
636 [Arguments] ${username} ${password} ${dhcp_enabled} ${valid_status_code}
637
638 # Description of argument(s):
639 # username The host username.
640 # password The host password.
641 # dhcp_enabled Indicates whether dhcp should be enabled
642 # (${True}, ${False}).
643 # valid_status_code The expected valid status code.
644
Megha GNbe428592022-07-21 10:33:02 -0500645 # TODO: operator_user role is not yet supported.
646 Skip If '${username}' == 'operator_user'
shrsuman123b361d412020-09-30 06:17:23 -0500647 Redfish.Login ${username} ${password}
648 Set VMI IPv4 Origin ${dhcp_enabled} ${valid_status_code}
shrsuman123bfb851b2021-07-02 04:59:16 -0500649
Sweta Potthurid52b2732021-08-12 12:48:24 -0500650
shrsuman123bfb851b2021-07-02 04:59:16 -0500651Suite Teardown Execution
652 [Documentation] Do suite teardown execution task.
653
654 Run Keyword If ${vmi_network_conf} != ${None}
655 ... Set Static IPv4 Address To VMI And Verify ${vmi_network_conf["IPv4_Address"]}
656 ... ${vmi_network_conf["IPv4_Gateway"]} ${vmi_network_conf["IPv4_SubnetMask"]}
shrsuman123b25343d2021-09-22 04:33:47 -0500657 Delete All Redfish Sessions
shrsuman123bfb851b2021-07-02 04:59:16 -0500658 Redfish.Logout
Megha G N38acd842024-10-14 14:28:11 -0500659
660
661Set VMI SLAACv6 Origin
662 [Documentation] Set VMI SLAACv6 origin.
663 [Arguments] ${slaac_enabled}=${False} ${valid_status_code}=${HTTP_ACCEPTED}
664 ... ${interface}=${ethernet_interface}
665
666 # Description of argument(s):
667 # slaacv6_enabled True if user wants to enable SLAACv6. Default is Static, hence value is set to False.
668 # valid_status_code Expected valid status code from PATCH request. Default is HTTP_OK.
669 # interface VMI interface (eg. eth0 or eth1).
670
671 ${data}= Set Variable If ${slaac_enabled} == ${False} ${DISABLE_SLAAC} ${ENABLE_SLAAC}
672 ${resp}= Redfish.Patch
673 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${interface}
674 ... body=${data} valid_status_codes=[${valid_status_code}]
675
676 Sleep ${wait_time}
677 Return From Keyword If ${valid_status_code} != ${HTTP_ACCEPTED}
678 ${resp}= Redfish.Get
679 ... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${interface}
680 Should Be Equal ${resp.dict["StatelessAddressAutoConfig"]["IPv6AutoConfigEnabled"]} ${slaac_enabled}
681
682
683Verify VMI IPv6 Address
684 [Documentation] Verify VMI IPv6 address configurations.
685 [Arguments] ${ipv6_origin} ${interface}=${ethernet_interface}
686
687 # Description of argument(s):
688 # ipv6_origin Origin of IPv6 address eg. Static or DHCPv6 or SLAAC.
689 # interface VMI interface (eg. eth0 or eth1).
690
691 ${resp}= Redfish.Get /redfish/v1/Systems/hypervisor/EthernetInterfaces/${interface}
692
693 @{vmi_ipv6_configurations}= Get From Dictionary ${resp.dict} IPv6Addresses
694 ${vmi_ipv6_config}= Get From List ${vmi_ipv6_configurations} 0
695 Should Not Be Empty ${vmi_ipv6_config["Address"]}
696 Should Be Equal As Strings   ${vmi_ipv6_config["AddressOrigin"]} ${ipv6_origin}