Fix for redfishtool certificate, snmp and session management
Changes:
- Set cert_id as test variable
- Remove colon in snmp destination when the snmp port is empty
- Fix redfish_delete_sessions assign location
- Set REDFISH_DELETE_SESSIONS to 0 in suite setup
- Set REDFISH_DELETE_SESSIONS back to 1 in suite teardown
Tested:
- redfish/service_root/test_sessions_management.robot
- redfish/dmtf_tools/test_redfishtool_certificate.robot
- redfish/events/test_bmc_snmp_trap.robot
Change-Id: Ibb16d52b5874484f8cf169456e2feb4ba7593e71
Signed-off-by: Wilson Suen <wilsons@supermicro.com>
diff --git a/lib/snmp/redfish_snmp_utils.robot b/lib/snmp/redfish_snmp_utils.robot
index 109a971..57424aa 100644
--- a/lib/snmp/redfish_snmp_utils.robot
+++ b/lib/snmp/redfish_snmp_utils.robot
@@ -72,7 +72,8 @@
# snmp_port SNMP manager port
# valid_status_code expected code
- ${snmp_mgr_data}= Create Dictionary Destination=snmp://${snmp_mgr_ip}:${snmp_port}
+ ${colon}= Set Variable If '${snmp_port}' == '${EMPTY}' ${EMPTY} :
+ ${snmp_mgr_data}= Create Dictionary Destination=snmp://${snmp_mgr_ip}${colon}${snmp_port}
... SubscriptionType=${snmp_function} Protocol=${snmp_version}
Redfish.Post ${subscription_uri} body=&{snmp_mgr_data}