Added test to verify disabling SSH via GUI

Change-Id: Ib886ff6fcdb86c95ec2cfe65c21aa6e627c4cf81
Signed-off-by: meghagn <Megha.GN@ibm.com>
diff --git a/gui/gui_test/security_and_access_menu/test_policies_sub_menu.robot b/gui/gui_test/security_and_access_menu/test_policies_sub_menu.robot
index afdfd46..870aca4 100644
--- a/gui/gui_test/security_and_access_menu/test_policies_sub_menu.robot
+++ b/gui/gui_test/security_and_access_menu/test_policies_sub_menu.robot
@@ -66,6 +66,35 @@
     Wait Until Keyword Succeeds  10 sec  5 sec  Open Connection And Login
 
 
+Disable SSH Via GUI And Verify
+    [Documentation]  Verify that SSH to BMC stops working after disabling SSH.
+    [Tags]  Disable_SSH_Via_GUI_And_Verify
+    [Teardown]  Run Keywords  Redfish.Patch  /redfish/v1/Managers/bmc/NetworkProtocol
+    ...  body={"SSH":{"ProtocolEnabled":True}}  valid_status_codes=[200, 204]  AND
+    ...  Wait Until Keyword Succeeds  30 sec  5 sec  Open Connection And Login
+
+    # Enable ssh via Redfish.
+    Redfish.Patch  /redfish/v1/Managers/bmc/NetworkProtocol  body={"SSH":{"ProtocolEnabled":True}}
+    ...   valid_status_codes=[200, 204]
+
+    # Wait for GUI to reflect enable SSH status.
+    Wait Until Keyword Succeeds  30 sec  10 sec
+    ...  Refresh GUI And Verify Element Value  ${xpath_bmc_ssh_toggle}  Enabled
+
+    # Disable ssh via GUI.
+    Click Element  ${xpath_bmc_ssh_toggle}
+
+    # Wait for GUI to reflect disable SSH status.
+    Wait Until Keyword Succeeds  30 sec  10 sec
+    ...  Refresh GUI And Verify Element Value  ${xpath_bmc_ssh_toggle}  Disabled
+
+    ${status}=  Run Keyword And Return Status
+    ...  Open Connection And Login
+
+    Should Be Equal As Strings  ${status}  False
+    ...  msg=SSH login still working after disabling SSH.
+
+
 *** Keywords ***
 
 Test Setup Execution