IPv6 prefix length and default gateway tests
Signed-off-by: Prashanth Katti <prkatti1@in.ibm.com>
Change-Id: I3f6e82864327b74ba47157203e9859fde3ad9716
diff --git a/lib/bmc_ipv6_utils.robot b/lib/bmc_ipv6_utils.robot
index b9e88a3..7050afd 100644
--- a/lib/bmc_ipv6_utils.robot
+++ b/lib/bmc_ipv6_utils.robot
@@ -51,3 +51,39 @@
@{ip_data}= Get BMC IPv6 Info
Should Contain Match ${ip_data} ${ipv6}/*
... msg=IPv6 address does not exist.
+
+
+Verify IPv6 Default Gateway On BMC
+ [Documentation] Verify IPv6 default gateway on BMC.
+ [Arguments] ${gateway_ip}=${EMPTY}
+
+ # Description of argument(s):
+ # gateway_ip Gateway IPv6 address.
+
+ ${route_info}= Get BMC IPv6 Route Info
+
+ # If gateway IP is empty it will not have route entry.
+
+ Run Keyword If '${gateway_ip}' == '${EMPTY}'
+ ... Pass Execution Gateway IP is not configured.
+ ... ELSE
+ ... Should Contain ${route_info} ${gateway_ip}
+ ... msg=Gateway IP address not matching
+
+
+Get BMC IPv6 Route Info
+ [Documentation] Get IPv6 route info on BMC.
+
+ # Sample output of "ip -6 route":
+ # unreachable ::/96 dev lo metric 1024 error -113
+ # unreachable ::ffff:0.0.0.0/96 dev lo metric 1024 error -113
+ # 2xxx:xxxx:0:1::/64 dev eth0 proto kernel metric 256
+ # fe80::/64 dev eth1 proto kernel metric 256
+ # fe80::/64 dev eth0 proto kernel metric 256
+ # fe80::/64 dev eth2 proto kernel metric 256
+
+
+ ${cmd_output} ${stderr} ${rc}= BMC Execute Command
+ ... /sbin/ip -6 route
+
+ [Return] ${cmd_output}
diff --git a/redfish/managers/test_bmc_ipv6.robot b/redfish/managers/test_bmc_ipv6.robot
index 87b8a30..f606f7b 100644
--- a/redfish/managers/test_bmc_ipv6.robot
+++ b/redfish/managers/test_bmc_ipv6.robot
@@ -31,6 +31,23 @@
END
+Get PrefixLength And Verify
+ [Documentation] Get IPv6 prefix length and verify.
+ [Tags] Get_PrefixLength_And_Verify
+
+ FOR ${ipv6_network_configuration} IN @{ipv6_network_configurations}
+ Verify IPv6 On BMC ${ipv6_network_configuration['PrefixLength']}
+ END
+
+
+Get IPv6 Default Gateway And Verify
+ [Documentation] Get IPv6 default gatway and verify.
+
+ ${resp}= Redfish.Get ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
+ ${ipv6_gateway}= Get From Dictionary ${resp.dict} IPv6DefaultGateway
+ Verify IPv6 Default Gateway On BMC ${ipv6_gateway}
+
+
*** Keywords ***
Test Setup Execution