Added new SNMP test cases

Changes:
    - Configure SNMP manager with less octet IP.
    - Configure SNMP manager with negative port number.

Signed-off-by: Prashanth Katti <prkatti1@in.ibm.com>
Change-Id: I04a7fb491c8638d4cd79aa1739247937bd53dc52
diff --git a/lib/snmp/resource.robot b/lib/snmp/resource.robot
index 7ff3ed7..d2493b5 100644
--- a/lib/snmp/resource.robot
+++ b/lib/snmp/resource.robot
@@ -10,6 +10,7 @@
 ${SNMP_MGR3_IP}       10.6.6.8
 ${out_of_range_ip}    10.6.6.256
 ${alpha_ip}           xx.xx.xx.xx
+${less_octet_ip}      10.5.5
 
 # Valid and invalid IP and ports. Valid port range is 0-65535.
 # Default port is 162.
diff --git a/redfish/events/test_bmc_snmp_trap.robot b/redfish/events/test_bmc_snmp_trap.robot
index 24aa711..88dbb0d 100644
--- a/redfish/events/test_bmc_snmp_trap.robot
+++ b/redfish/events/test_bmc_snmp_trap.robot
@@ -214,6 +214,35 @@
     ...  ${CMD_INTERNAL_FAILURE}  ${SNMP_TRAP_BMC_INTERNAL_FAILURE}
 
 
+Configure SNMP Manager With Less Octet IP And Verify
+    [Documentation]  Configure SNMP manager on BMC with less octet IP and expect an error.
+    [Tags]  Configure_SNMP_Manager_With_Less_Octet_IP_And_Verify
+    [Teardown]  Delete SNMP Manager Via Redfish  ${less_octet_ip}  ${SNMP_DEFAULT_PORT}
+
+    Configure SNMP Manager Via Redfish  ${less_octet_ip}  ${SNMP_DEFAULT_PORT}  ${HTTP_BAD_REQUEST}
+
+    ${status}=  Run Keyword And Return Status
+    ...  Verify SNMP Manager Configured On BMC  ${less_octet_ip}  ${SNMP_DEFAULT_PORT}
+
+    Should Be Equal As Strings  ${status}  False
+    ...  msg=BMC is allowing to configure less octet IP.
+
+
+Configure SNMP Manager On BMC With Negative Port And Verify
+    [Documentation]  Configure SNMP Manager On BMC with negative port and verify.
+    [Tags]  Configure_SNMP_Manager_On_BMC_With_Negative_Port_And_Verify
+
+    [Teardown]  Delete SNMP Manager Via Redfish  ${SNMP_MGR1_IP}  ${negative_port}
+
+    Configure SNMP Manager Via Redfish  ${SNMP_MGR1_IP}  ${negative_port}  ${HTTP_BAD_REQUEST}
+
+    ${status}=  Run Keyword And Return Status
+    ...  Verify SNMP Manager Configured On BMC  ${SNMP_MGR1_IP}  ${negative_port}
+
+    Should Be Equal As Strings  ${status}  False
+    ...  msg=BMC is allowing to configure negative port.
+
+
 *** Keywords ***
 
 Suite Setup Execution