Added test to set static VMI IPv6 address
Changes:
- Added test
"Configure Static VMI IPv6 Address And Verify"
- Added keyword
"Set Static VMI IPv6 Address"
Tested:
- Ran successfully test_vmi.robot
Change-Id: I7eaec5c965399798106fedc93082ff36f002c126
Signed-off-by: Megha G N <Megha.G.N@ibm.com>
diff --git a/openpower/ext_interfaces/test_vmi.robot b/openpower/ext_interfaces/test_vmi.robot
index aa57b89..c1eb921 100644
--- a/openpower/ext_interfaces/test_vmi.robot
+++ b/openpower/ext_interfaces/test_vmi.robot
@@ -43,6 +43,7 @@
${default} 0.0.0.0
${default_ipv6addr} ::
${prefix_length} ${64}
+${test_vmi_ipv6addr} 2001:db8:1111:2222:10:5:5:6
*** Test Cases ***
@@ -635,6 +636,19 @@
Verify VMI Network Interface Details ${test_ipv4} Static ${test_gateway} ${test_netmask}
+Configure Static VMI IPv6 Address And Verify
+ [Documentation] Add static VMI IPv6 address and check whether IPv6 origin is set to static
+ ... and Static IPv6 address is assigned.
+ [Tags] Configure_Static_VMI_IPv6_Address_And_Verify
+
+ Set Static VMI IPv6 Address ${test_vmi_ipv6addr} ${prefix_length}
+
+ # Verify IPv6 address origin is set to static and static IPv6 address is assigned.
+ ${vmi_ipv6addr}= Verify VMI IPv6 Address Static
+ Should Not Be Equal ${vmi_ipv6addr["Address"]} ${default_ipv6addr}
+ Should Be Equal ${vmi_ipv6addr["PrefixLength"]} ${prefix_length}
+
+
*** Keywords ***
Suite Setup Execution
@@ -855,3 +869,31 @@
${resp}= Redfish.Get
... /redfish/v1/Systems/hypervisor/EthernetInterfaces/${interface}
Should Be Equal ${resp.dict["DHCPv6"]["OperatingMode"]} ${dhcpv6_operatingmode}
+
+
+Set Static VMI IPv6 Address
+ [Documentation] Add static VMI IPv6 address.
+ [Arguments] ${vmi_ipv6_addr} ${prefix_len} ${valid_status_codes}=${HTTP_ACCEPTED}
+ ... ${interface}=${ethernet_interface}
+
+ # Description of argument(s):
+ # vmi_ipv6_addr VMI IPv6 address to be added.
+ # prefix_len Prefix length for the VMI IPv6 to be added.
+ # valid_status_codes Expected valid status code from PATCH request.
+ # interface VMI interface (eg. eth0 or eth1).
+
+ ${prefix_length}= Convert To Integer ${prefix_len}
+ ${empty_dict}= Create Dictionary
+ ${vmi_ipv6_data}= Create Dictionary Address=${vmi_ipv6_addr}
+ ... PrefixLength=${prefix_length}
+
+ ${patch_list}= Create List
+
+ Append To List ${patch_list} ${vmi_ipv6_data}
+ ${data}= Create Dictionary IPv6StaticAddresses=${patch_list}
+
+ ${active_channel_config}= Get Active Channel Config
+ ${ethernet_interface}= Set Variable ${active_channel_config['${CHANNEL_NUMBER}']['name']}
+
+ Redfish.patch /redfish/v1/Systems/hypervisor/EthernetInterfaces/${interface}
+ ... body=&{data} valid_status_codes=[${valid_status_codes}]