deactivate
}
+display_log() {
+ local daemon=$1
+ shift
+ local lines=$1
+ shift
+
+ local log_files=$(find "$CEPH_OUT_DIR" -iname "${daemon}.*.log" | tr '\n' ' ')
+ for log_file in ${log_files[@]}; do
+ printf "\n\nDisplaying last ${lines} lines of: ${log_file}\n\n"
+ tail -n ${lines} $log_file
+ printf "\n\nEnd of: ${log_file}\n\n"
+ done
+ printf "\n\nTEST FAILED.\n\n"
+}
+
on_tests_error() {
if [[ -n "$JENKINS_HOME" ]]; then
CEPH_OUT_DIR=${CEPH_OUT_DIR:-"$LOCAL_BUILD_DIR"/out}
- MGR_LOG_FILES=$(find "$CEPH_OUT_DIR" -iname "mgr.*.log" | tr '\n' ' ')
- MGR_LOG_FILE_LAST_LINES=60000
- for mgr_log_file in ${MGR_LOG_FILES[@]}; do
- printf "\n\nDisplaying last ${MGR_LOG_FILE_LAST_LINES} lines of: $mgr_log_file\n\n"
- tail -n ${MGR_LOG_FILE_LAST_LINES} $mgr_log_file
- printf "\n\nEnd of: $mgr_log_file\n\n"
- done
- printf "\n\nTEST FAILED.\n\n"
+ display_log "mgr" 60000
fi
}