Add new keyword and log collection cleanup
This changes is added to identify BMC sessions
getting piled up due to test scripts. The logic
is to log the count and delete them as part of
the cleanup for debugging in general.
Changes:
- Added new keyword to get current redfish
active session count.
- Added 2 new entries in log collection for
logging session count and doing delete of
session explicitly.
Tested:
- Ran from the sandbox
Change-Id: I73695879187f292523e0a4f255ad35c56bc66a88
Signed-off-by: George Keishing <gkeishin@in.ibm.com>
diff --git a/lib/bmc_redfish_utils.robot b/lib/bmc_redfish_utils.robot
index 1afea8d..26aec0a 100644
--- a/lib/bmc_redfish_utils.robot
+++ b/lib/bmc_redfish_utils.robot
@@ -408,12 +408,24 @@
Redfish BMC Reset Operation
# Wait for BMC real reboot and Redfish API ready
- Wait Until Keyword Succeeds 3 min 10 sec Is BMC LastResetTime Changed ${last_reset_time}
+ Wait Until Keyword Succeeds 3 min 10 sec
+ ... Is BMC LastResetTime Changed ${last_reset_time}
Get BMC Last Reset Time
[Documentation] Return BMC LastResetTime.
- ${last_reset_time}= Redfish.Get Attribute /redfish/v1/Managers/${MANAGER_ID} LastResetTime
+ ${last_reset_time}= Redfish.Get Attribute
+ ... /redfish/v1/Managers/${MANAGER_ID} LastResetTime
RETURN ${last_reset_time}
+
+
+Get BMC Active Session Count
+ [Documentation] Return active session count from BMC.
+
+ ${session_count}= Redfish.Get Attribute
+ ... /redfish/v1/SessionService/Sessions Members@odata.count
+
+ Log To Console Redfish active session count: ${session_count}
+ RETURN ${session_count}
diff --git a/lib/openbmc_ffdc_list.py b/lib/openbmc_ffdc_list.py
index 806551d..19bb49d 100755
--- a/lib/openbmc_ffdc_list.py
+++ b/lib/openbmc_ffdc_list.py
@@ -277,6 +277,7 @@
"Dump Files": "SCP Dump Files",
"PEL Files": "Collect PEL Log",
# "Redfish Log": "Enumerate Redfish Resources",
+ "Log Redfish Session Count": "Get BMC Active Session Count",
"Firmware Log": (
"Enumerate Redfish Resources "
+ " enum_uri=/redfish/v1/UpdateService/FirmwareInventory "
@@ -284,6 +285,7 @@
),
"Redfish OEM Log": "Enumerate Redfish OEM Resources",
"End ffdc cleanup": "BMC FFDC Cleanup",
+ "Cleanup sessions": "Delete All Redfish Sessions",
},
}