Adding a test case to enable SLAACv6

    Changes:
       - Adding a test case to enable SLAACv6
       - Adding a keyword for enabling/ disabling SLAACv6

    Tested:
        Ran and Tested on BMC Environment.

Change-Id: I6ab8ceec6189f543503d8c87c4dd3d6896923c8b
Signed-off-by: Sweta Potthuri <spotthur@in.ibm.com>
diff --git a/redfish/managers/test_bmc_ipv6.robot b/redfish/managers/test_bmc_ipv6.robot
index a610e28..a970936 100644
--- a/redfish/managers/test_bmc_ipv6.robot
+++ b/redfish/managers/test_bmc_ipv6.robot
@@ -5,6 +5,7 @@
 Resource       ../../lib/bmc_redfish_resource.robot
 Resource       ../../lib/openbmc_ffdc.robot
 Resource       ../../lib/bmc_ipv6_utils.robot
+Resource       ../../lib/external_intf/vmi_utils.robot
 Library        ../../lib/bmc_network_utils.py
 Library        Collections
 
@@ -106,6 +107,13 @@
     Verify IPv6 On BMC  ${test_ipv6_addr}
 
 
+Enable SLAACv6 On BMC And Verify
+    [Documentation]  Enable SLAACv6 on BMC and verify.
+    [Tags]  Enable_SLAACv6_On_BMC_And_Verify
+
+    Set SLAACv6 Configuration State And Verify  ${True}
+
+
 *** Keywords ***
 
 Suite Setup Execution
@@ -462,3 +470,26 @@
     Should Be Equal  ${cmd_status}  ${False}  msg=Old IPv6 address is not deleted.
 
     Validate IPv6 Network Config On BMC
+
+
+Set SLAACv6 Configuration State And Verify
+    [Documentation]  Set SLAACv6 configuration state and verify.
+    [Arguments]  ${slaac_state}  ${valid_status_codes}=${HTTP_OK}
+
+    # Description of argument(s):
+    # slaac_state         SLAACv6 state('True' or 'False').
+    # valid_status_code   Expected valid status codes.
+
+    ${active_channel_config}=  Get Active Channel Config
+    ${ethernet_interface}=  Set Variable  ${active_channel_config['${CHANNEL_NUMBER}']['name']}
+
+    ${data}=  Set Variable If  ${slaac_state} == ${False}  ${DISABLE_SLAAC}  ${ENABLE_SLAAC}
+    ${resp}=  Redfish.Patch  ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
+    ...  body=${data}  valid_status_codes=[${valid_status_codes}]
+
+    # Verify SLAACv6 is set correctly.
+    ${resp}=  Redfish.Get  ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
+    ${slaac_verify}=  Get From Dictionary  ${resp.dict}  StatelessAddressAutoConfig
+
+    Run Keyword If  '${slaac_verify['IPv6AutoConfigEnabled']}' != '${slaac_state}'
+    ...  Fail  msg=SLAACv6 not set properly.