Configure Static IP Without Using Gateway And Verify

Change-Id: I275340d182ed45b4912b753051a36bc39a212efc
Signed-off-by: Anves Kumar rayankula <anvesr77@in.ibm.com>
diff --git a/redfish/managers/test_bmc_network_conf.robot b/redfish/managers/test_bmc_network_conf.robot
index 7a650d8..9c94f77 100644
--- a/redfish/managers/test_bmc_network_conf.robot
+++ b/redfish/managers/test_bmc_network_conf.robot
@@ -591,6 +591,30 @@
     Redfish.Login
     Verify CLI and Redfish Nameservers
 
+
+Configure Static IP Without Using Gateway And Verify
+    [Documentation]  Configure static IP without using gateway and verify error.
+    [Tags]  Configure_Static_IP_Without_Using_Gateway_And_Verify
+
+    ${ip}=  Create dictionary  Address=${test_ipv4_addr}
+    ...  SubnetMask=${test_subnet_mask}
+    ${empty_dict}=  Create Dictionary
+    ${patch_list}=  Create List
+    ${network_configurations}=  Get Network Configuration
+
+    ${num_entries}=  Get Length  ${network_configurations}
+    FOR  ${INDEX}  IN RANGE  0  ${num_entries}
+      Append To List  ${patch_list}  ${empty_dict}
+    END
+
+    # We need not check for existence of IP on BMC while adding.
+    Append To List  ${patch_list}  ${ip}
+    ${payload}=  Create Dictionary  IPv4StaticAddresses=${patch_list}
+    ${active_channel_config}=  Get Active Channel Config
+    ${ethernet_interface}=  Set Variable  ${active_channel_config['${CHANNEL_NUMBER}']['name']}
+    Redfish.patch  ${REDFISH_NW_ETH_IFACE}${ethernet_interface}
+    ...  body=&{payload}  valid_status_codes=[${HTTP_BAD_REQUEST}]
+
 *** Keywords ***
 
 Test Setup Execution