Verify SNMP works when eth1 is not configured
Changes:
1.Moved SNMP reusable variables into resource file
2.Added new testcase Verify SNMP works when eth1 is not configured
Change-Id: I58da71f0ab167318cefee98137812fd588c16425
Signed-off-by: Anves Kumar rayankula <anvesr77@in.ibm.com>
diff --git a/lib/snmp/redfish_snmp_utils.robot b/lib/snmp/redfish_snmp_utils.robot
index 79656a1..d5d9c7c 100644
--- a/lib/snmp/redfish_snmp_utils.robot
+++ b/lib/snmp/redfish_snmp_utils.robot
@@ -7,6 +7,29 @@
Library ../../lib/gen_misc.py
Library ../../lib/utils.py
+*** Variables ***
+
+${snmp_function} SNMPTrap
+${snmp_version} SNMPv2c
+${subscription_uri} /redfish/v1/EventService/Subscriptions
+
+${CMD_INTERNAL_FAILURE} busctl call xyz.openbmc_project.Logging /xyz/openbmc_project/logging
+... xyz.openbmc_project.Logging.Create Create ssa{ss} xyz.openbmc_project.Common.Error.InternalFailure
+... xyz.openbmc_project.Logging.Entry.Level.Error 0
+
+${CMD_FRU_CALLOUT} busctl call xyz.openbmc_project.Logging /xyz/openbmc_project/logging
+... xyz.openbmc_project.Logging.Create Create ssa{ss} xyz.openbmc_project.Common.Error.Timeout
+... xyz.openbmc_project.Logging.Entry.Level.Error 2 "TIMEOUT_IN_MSEC" "5"
+... "CALLOUT_INVENTORY_PATH" "/xyz/openbmc_project/inventory/system/chassis/motherboard"
+
+${CMD_INFORMATIONAL_ERROR} busctl call xyz.openbmc_project.Logging /xyz/openbmc_project/logging
+... xyz.openbmc_project.Logging.Create Create ssa{ss} xyz.openbmc_project.Common.Error.TestError2
+... xyz.openbmc_project.Logging.Entry.Level.Informational 0
+
+${SNMP_TRAP_BMC_INTERNAL_FAILURE} xyz.openbmc_project.Common.Error.InternalFailure
+${SNMP_TRAP_BMC_CALLOUT_ERROR} xyz.openbmc_project.Common.Error.Timeout
+${SNMP_TRAP_BMC_INFORMATIONAL_ERROR} xyz.openbmc_project.Common.Error.TestError2
+
*** Keywords ***
diff --git a/redfish/events/test_bmc_snmp_trap.robot b/redfish/events/test_bmc_snmp_trap.robot
index 6c6fbce..c17a296 100644
--- a/redfish/events/test_bmc_snmp_trap.robot
+++ b/redfish/events/test_bmc_snmp_trap.robot
@@ -14,29 +14,6 @@
Test Teardown FFDC On Test Case Fail
Suite Setup Suite Setup Execution
-*** Variables ***
-
-${snmp_function} SNMPTrap
-${snmp_version} SNMPv2c
-${subscription_uri} /redfish/v1/EventService/Subscriptions
-
-${CMD_INTERNAL_FAILURE} busctl call xyz.openbmc_project.Logging /xyz/openbmc_project/logging
-... xyz.openbmc_project.Logging.Create Create ssa{ss} xyz.openbmc_project.Common.Error.InternalFailure
-... xyz.openbmc_project.Logging.Entry.Level.Error 0
-
-${CMD_FRU_CALLOUT} busctl call xyz.openbmc_project.Logging /xyz/openbmc_project/logging
-... xyz.openbmc_project.Logging.Create Create ssa{ss} xyz.openbmc_project.Common.Error.Timeout
-... xyz.openbmc_project.Logging.Entry.Level.Error 2 "TIMEOUT_IN_MSEC" "5"
-... "CALLOUT_INVENTORY_PATH" "/xyz/openbmc_project/inventory/system/chassis/motherboard"
-
-${CMD_INFORMATIONAL_ERROR} busctl call xyz.openbmc_project.Logging /xyz/openbmc_project/logging
-... xyz.openbmc_project.Logging.Create Create ssa{ss} xyz.openbmc_project.Common.Error.TestError2
-... xyz.openbmc_project.Logging.Entry.Level.Informational 0
-
-${SNMP_TRAP_BMC_INTERNAL_FAILURE} xyz.openbmc_project.Common.Error.InternalFailure
-${SNMP_TRAP_BMC_CALLOUT_ERROR} xyz.openbmc_project.Common.Error.Timeout
-${SNMP_TRAP_BMC_INFORMATIONAL_ERROR} xyz.openbmc_project.Common.Error.TestError2
-
*** Test Cases ***
diff --git a/redfish/managers/test_multiple_interfaces.robot b/redfish/managers/test_multiple_interfaces.robot
index 15b1ccf..8a8abb3 100644
--- a/redfish/managers/test_multiple_interfaces.robot
+++ b/redfish/managers/test_multiple_interfaces.robot
@@ -12,6 +12,8 @@
Resource ../../lib/bmc_network_utils.robot
Resource ../../lib/openbmc_ffdc.robot
Resource ../../lib/bmc_ldap_utils.robot
+Resource ../../lib/snmp/resource.robot
+Resource ../../lib/snmp/redfish_snmp_utils.robot
Suite Setup Suite Setup Execution
Test Teardown FFDC On Test Case Fail
@@ -62,6 +64,17 @@
Redfish.Logout
+Verify SNMP Works When Eth1 IP Is Not Configured
+ [Documentation] Verify SNMP works when eth1 IP is not configured.
+ [Tags] Verify_SNMP_Works_When_Eth1_IP_Is_Not_Configured
+ [Setup] Run Keywords Set Test Variable ${CHANNEL_NUMBER} ${2}
+ ... AND Delete IP Address ${OPENBMC_HOST_1}
+ [Teardown] Run Keywords Redfish.Login AND
+ ... Add IP Address ${OPENBMC_HOST_1} ${eth1_subnet_mask} ${eth1_gateway}
+
+ Create Error On BMC And Verify Trap
+
+
*** Keywords ***
Get Network Configuration Using Channel Number
@@ -97,4 +110,3 @@
... AND Exit For Loop
END
-