Index: crash_sender |
diff --git a/crash_sender b/crash_sender |
index 684986468518d0301d51af08571d6c910ac5ef0a..9d34e34b018abe7657393266b2eef2ea030b5e7d 100644 |
--- a/crash_sender |
+++ b/crash_sender |
@@ -68,6 +68,12 @@ lecho() { |
logger -t "${TAG}" "$@" |
} |
+# Returns true if mock is enabled. |
+is_mock() { |
+ [ -f "${MOCK_CRASH_SENDING}" ] && return 0 |
+ return 1 |
+} |
+ |
cleanup() { |
if [ -n "${TMP_DIR}" ]; then |
rm -rf "${TMP_DIR}" |
@@ -75,6 +81,11 @@ cleanup() { |
if [ ${CLEAN_UP_RUN_FILE} -eq 1 ]; then |
rm -f "${RUN_FILE}" |
fi |
+ if is_mock; then |
+ # For testing purposes, emit a message to log so that we |
+ # know when the test has received all the messages from this run. |
+ lecho "crash_sender done." |
+ fi |
} |
check_not_already_running() { |
@@ -165,12 +176,6 @@ get_key_value() { |
grep "$2=" "$1" | cut -d = -f 2- |
} |
-# Returns true if mock is enabled. |
-is_mock() { |
- [ -f "${MOCK_CRASH_SENDING}" ] && return 0 |
- return 1 |
-} |
- |
# Return the board name. |
get_board() { |
echo $(get_key_value "/etc/lsb-release" "CHROMEOS_RELEASE_BOARD") |