Added configure IPv6 address by eliminating leading 0s test

Changes:
    - Added the test case:
    Configure IPv6 Address By Eliminating Leading 0s In Multiple Hextets

    Tested:
        Ran and Tested on BMC Environment.
Change-Id: I9bb6a4109948d7d0a7c6509125e7e63cb9ec5bfe
Signed-off-by: Abhijith Naik <Abhijith.Naik@ibm.com>
diff --git a/redfish/managers/test_bmc_ipv6.robot b/redfish/managers/test_bmc_ipv6.robot
index 10b45bf..5a9d572 100644
--- a/redfish/managers/test_bmc_ipv6.robot
+++ b/redfish/managers/test_bmc_ipv6.robot
@@ -33,6 +33,8 @@
 ${linklocal_addr_format}     fe80::[0-9a-f:]+$
 ${link_local_addr}           fe80::
 ${link_local_prefix_len}     10
+${ipv6_leading_zero}         2001:0022:0033::0111
+${ipv6_eliminate_zero}       2001:22:33::111
 
 *** Test Cases ***
 
@@ -379,6 +381,17 @@
     Should Be Equal As Integers  ${count}  2
 
 
+Configure IPv6 With Leading Zeros And Verify
+    [Documentation]  Configure IPv6 with leading zeros & verify address is configured by eliminating 0s in multiple hextets.
+    [Tags]  Configure_IPv6_with_Leading_Zeros_And_Verify
+    [Teardown]  Run Keywords
+    ...  Delete IPv6 Address  ${ipv6_eliminate_zero}  AND  Test Teardown Execution
+
+    #Verify 2001:0022:0033::0111 configured as 2001:22:33::111.
+    Configure IPv6 Address On BMC
+    ...    ${ipv6_leading_zero}  ${test_prefix_length}  ${ipv6_eliminate_zero}
+
+
 *** Keywords ***
 
 Suite Setup Execution
@@ -536,10 +549,12 @@
 
 Configure IPv6 Address On BMC
     [Documentation]  Add IPv6 Address on BMC.
-    [Arguments]  ${ipv6_addr}  ${prefix_len}  ${valid_status_codes}=${HTTP_OK}
+    [Arguments]  ${ipv6_addr1}  ${prefix_len}  ${ipv6_addr2}=${None}
+    ...          ${valid_status_codes}=[${HTTP_OK},${HTTP_NO_CONTENT}]
 
     # Description of argument(s):
-    # ipv6_addr           IPv6 address to be added (e.g. "2001:EEEE:2222::2022").
+    # ipv6_addr1          IPv6 address to be added (e.g. "2001:0022:0033::0111").
+    # ipv6_addr2          IPv6 address to be Verified (e.g. "2001:22:33::111").
     # prefix_len          Prefix length for the IPv6 to be added
     #                     (e.g. "64").
     # valid_status_codes  Expected return code from patch operation
@@ -547,7 +562,7 @@
 
     ${prefix_length}=  Convert To Integer  ${prefix_len}
     ${empty_dict}=  Create Dictionary
-    ${ipv6_data}=  Create Dictionary  Address=${ipv6_addr}
+    ${ipv6_data}=  Create Dictionary  Address=${ipv6_addr1}
     ...  PrefixLength=${prefix_length}
 
     ${patch_list}=  Create List
@@ -560,10 +575,6 @@
       Append To List  ${patch_list}  ${empty_dict}
     END
 
-    ${valid_status_codes}=  Set Variable If  '${valid_status_codes}' == '${HTTP_OK}'
-    ...  ${HTTP_OK},${HTTP_NO_CONTENT}
-    ...  ${valid_status_codes}
-
     # We need not check for existence of IPv6 on BMC while adding.
     Append To List  ${patch_list}  ${ipv6_data}
     ${data}=  Create Dictionary  IPv6StaticAddresses=${patch_list}
@@ -572,21 +583,29 @@
     ${ethernet_interface}=  Set Variable  ${active_channel_config['${CHANNEL_NUMBER}']['name']}
 
     Redfish.patch  ${REDFISH_NW_ETH_IFACE}${ethernet_interface}  body=&{data}
-    ...  valid_status_codes=[${valid_status_codes}]
+    ...  valid_status_codes=${valid_status_codes}
 
-    Return From Keyword If  '${valid_status_codes}' != '${HTTP_OK},${HTTP_NO_CONTENT}'
+    IF  ${valid_status_codes} != [${HTTP_OK}, ${HTTP_NO_CONTENT}]
+        Fail  msg=Static address not added correctly
+    END
 
     # Note: Network restart takes around 15-18s after patch request processing.
     Sleep  ${NETWORK_TIMEOUT}s
     Wait For Host To Ping  ${OPENBMC_HOST}  ${NETWORK_TIMEOUT}
 
-    Verify IPv6 And PrefixLength  ${ipv6_addr}  ${prefix_len}
+    #Verify ip address on CLI.
+    IF  '${ipv6_addr2}' != '${None}'
+        Verify IPv6 And PrefixLength  ${ipv6_addr2}  ${prefix_len}
+    ELSE
+        Verify IPv6 And PrefixLength  ${ipv6_addr1}  ${prefix_len}
+    END
 
     # Verify if existing static IPv6 addresses still exist.
     FOR  ${ipv6_network_configuration}  IN  @{ipv6_network_configurations}
       Verify IPv6 On BMC  ${ipv6_network_configuration['Address']}
     END
 
+    #Verify redfish and CLI data matches.
     Validate IPv6 Network Config On BMC