Added new SNMP testcase

Changes :
    - Configure SNMP Manager With Hostname Via GUI AND Verify
    - Removed "Add DNS Servers And Verify" keyword from test_network_sub_menu.robot
      and added in lib file gui_resource.robot

Tested:
    - Ran successfully test_snmp_alerts_sub_menu.robot

Change-Id: Ib6e90c8ae45d1185631416e83144d739f0d8c38a
Signed-off-by: Megha G N <Megha.G.N@ibm.com>
diff --git a/gui/lib/gui_resource.robot b/gui/lib/gui_resource.robot
index 08ac09e..bf08b7e 100644
--- a/gui/lib/gui_resource.robot
+++ b/gui/lib/gui_resource.robot
@@ -153,3 +153,31 @@
     Wait Until Keyword Succeeds  30 sec  10 sec  Click Button  ${xpath_confirm_bmc_reboot}
     Wait Until Keyword Succeeds  2 min  10 sec  Is BMC Unpingable
     Wait For Host To Ping  ${OPENBMC_HOST}  1 min
+
+
+Add DNS Servers And Verify
+    [Documentation]  Login to GUI Network page,add DNS server on BMC
+    ...  and verify it via BMC CLI.
+    [Arguments]  ${dns_server}   ${expected_status}=Valid format
+
+    # Description of the argument(s):
+    # dns_server           A list of static name server IPs to be
+    #                      configured on the BMC.
+    # expected_status      Expected status while adding DNS server address
+    #                      (e.g. Invalid format / Field required).
+
+    Wait Until Page Contains Element  ${xpath_add_dns_ip_address_button}  timeout=15sec
+
+    Click Button  ${xpath_add_dns_ip_address_button}
+    Input Text  ${xpath_input_static_dns}  ${dns_server}
+    Click Button  ${xpath_add_button}
+    Run keyword if  '${expected_status}' != 'Valid format'
+    ...  Run keywords  Page Should Contain  ${expected_status}  AND  Return From Keyword
+
+    Wait Until Page Contains Element  ${xpath_add_dns_ip_address_button}  timeout=10sec
+    Wait Until Page Contains  ${dns_server}  timeout=40sec
+
+    # Check if newly added DNS server is configured on BMC.
+    ${cli_name_servers}=  CLI Get Nameservers
+    ${cmd_status}=  Run Keyword And Return Status
+    ...  List Should Contain Sub List  ${cli_name_servers}  ${dns_server}