Check logs are complete before uploading to swift

Add a UUID to the end of the logs that should exist before we're
satisifed enough to upload the logs. This should avoid truncating
the logs too early.

Change-Id: I00d36f71b9025b45eb680bbb7300270800514eb7
This commit is contained in:
Joshua Hesketh 2015-01-27 11:15:59 +11:00
parent babf6ce1a6
commit d7446cec39

@ -1,14 +1,23 @@
#!/bin/bash -xe
echo "Grabbing consoleLog"
# Keep fetching until this uuid to appear in the logs before uploading
END_UUID=$(cat /proc/sys/kernel/random/uuid)
echo "Grabbing consoleLog ($END_UUID)"
# Get the plain text version (does not contain links or timestamps)
console_log_path='consoleText'
wget -O /tmp/console.txt --no-check-certificate $BUILD_URL$console_log_path
while ! grep -q "$END_UUID" /tmp/console.txt; do
sleep 3
wget -c -O /tmp/console.txt --no-check-certificate $BUILD_URL$console_log_path
done
# Grab the HTML version of the log (includes timestamps)
console_log_path='logText/progressiveHtml'
wget -O /tmp/console.html --no-check-certificate $BUILD_URL$console_log_path
while ! grep -q "$END_UUID" /tmp/console.html; do
sleep 3
wget -c -O /tmp/console.html --no-check-certificate $BUILD_URL$console_log_path
done
# We need to add <pre> tags around the output for log-osanalyze to not escape
# the content