crosutils: Detect sym_upload errors by its stdout instead of return value

Change-Id: If649d355f3d9cb2650613e4eb6d34813216c0b61

BUG=7516
TEST=Change hardcoded URL to illegal URL and verify symbol sends fail

Review URL: http://codereview.chromium.org/3635001
This commit is contained in:
Ken Mixter 2010-10-07 17:54:04 -07:00
parent 33146728ef
commit f5adf798f0

View File

@ -32,10 +32,10 @@ SYM_UPLOAD="sym_upload"
ANY_ERRORS=0 ANY_ERRORS=0
ERR_FILE=$(mktemp "/tmp/err.XXXX") OUT_DIR=$(mktemp -d "/tmp/err.XXXX")
function cleanup() { function cleanup() {
rm -f "${ERR_FILE}" rm -rf "${OUT_DIR}"
} }
function really_upload() { function really_upload() {
@ -63,10 +63,11 @@ function upload_file() {
if [ ${FLAGS_verbose} -eq ${FLAGS_TRUE} ]; then if [ ${FLAGS_verbose} -eq ${FLAGS_TRUE} ]; then
info "Uploading ${upload_file}" info "Uploading ${upload_file}"
fi fi
if ! "${SYM_UPLOAD}" "${upload_file}" "${upload_url}" > /dev/null \ "${SYM_UPLOAD}" "${upload_file}" "${upload_url}" > "${OUT_DIR}/stdout" \
2> "${ERR_FILE}"; then 2> "${OUT_DIR}/stderr"
if ! grep -q "Successfully sent the symbol file." "${OUT_DIR}/stdout"; then
error "Unable to upload symbols in ${upload_file}:" error "Unable to upload symbols in ${upload_file}:"
cat "${ERR_FILE}" cat "${OUT_DIR}/stderr"
ANY_ERRORS=1 ANY_ERRORS=1
return 1 return 1
fi fi