Added testcases to configure hostname

Change-Id: I4ad257252e56602c37ffc18b1c17b4f28f47df44
Signed-off-by: Anves Kumar rayankula <anvesr77@in.ibm.com>
diff --git a/gui/gui_test/server_config/test_obmc_gui_network_settings.robot b/gui/gui_test/server_config/test_obmc_gui_network_settings.robot
index 7dc826c..2d38112 100644
--- a/gui/gui_test/server_config/test_obmc_gui_network_settings.robot
+++ b/gui/gui_test/server_config/test_obmc_gui_network_settings.robot
@@ -50,6 +50,7 @@
 ${out_of_range_netmask}           255.256.255.0
 ${more_byte_netmask}              255.255.255.0.0
 ${lowest_netmask}                 128.0.0.0
+${test_hostname}                  openbmc
 
 *** Test Cases ***
 
@@ -256,6 +257,17 @@
     ${test_ipv4_addr}   ${alpha_netmask}         Invalid format
     ${test_ipv4_addr}   ${out_of_range_netmask}  Invalid format
 
+
+Configure Hostname And Verify
+    [Documentation]  Configure hostname and verify.
+    [Tags]  Configure_Hostname_And_Verify
+    [Teardown]  Configure And Verify Network Settings
+    ...  ${xpath_hostname_input}  ${hostname}
+
+    ${hostname}=  Get Value  ${xpath_hostname_input}
+    Configure And Verify Network Settings  ${xpath_hostname_input}  ${test_hostname}
+
+
 *** Keywords ***
 
 Suite Setup Execution
@@ -477,3 +489,19 @@
     END
 
     [Return]  ${static_ipv4_addresses}
+
+
+Configure And Verify Network Settings
+    [Documentation]  Configure and verify network settings.
+    [Arguments]  ${xpath}  ${nw_settings}
+
+    # Description of argument(s):
+    # xpath  xpath of the network settings.
+    # nw_settings  The mac address, hostname etc.
+
+    Wait Until Element Is Enabled  ${xpath}
+    Input Text  ${xpath}  ${nw_settings}
+    Click Button  ${xpath_network_save_settings}
+    Wait Until Page Contains Element  ${xpath_setting_success}  timeout=10
+    Textfield Value Should Be  ${xpath}  ${nw_settings}
+