From ccb33a67b9b35bf5365bb3ab5aeb137a05d00687 Mon Sep 17 00:00:00 2001 From: "fischman@webrtc.org" Date: Mon, 17 Mar 2014 16:27:41 +0000 Subject: [PATCH] turn-prober: enable running headlessly and only emit output on error. With these changes I have the script running in a 10m cronjob on my desktop and emailing me on failure. (extremely poor man's monitoring; still, baby steps) BUG=2187 R=juberti@google.com Review URL: https://webrtc-codereview.appspot.com/9659004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@5709 4adac7df-926f-26a2-2b94-8c16560cd09d --- samples/js/apprtc/turn-prober/turn-prober.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/samples/js/apprtc/turn-prober/turn-prober.sh b/samples/js/apprtc/turn-prober/turn-prober.sh index 2006dccb4..2a063c58e 100755 --- a/samples/js/apprtc/turn-prober/turn-prober.sh +++ b/samples/js/apprtc/turn-prober/turn-prober.sh @@ -10,7 +10,13 @@ export D=$(mktemp -d) CHROME_LOG_FILE="${D}/chrome_debug.log" touch $CHROME_LOG_FILE -chrome \ +XVFB="xvfb-run -a -e $CHROME_LOG_FILE -s '-screen 0 1024x768x24'" +if [ -n "$DISPLAY" ]; then + XVFB="" +fi + +# "eval" below is required by $XVFB containing a quoted argument. +eval $XVFB chrome \ --enable-logging=stderr \ --no-first-run \ --disable-web-security \ @@ -34,9 +40,7 @@ exec 3>&- DONE=$(grep DONE $CHROME_LOG_FILE) EXIT_CODE=0 -if grep -q "DONE: PASS" $CHROME_LOG_FILE; then - echo "PASS" -else +if ! grep -q "DONE: PASS" $CHROME_LOG_FILE; then cat $CHROME_LOG_FILE EXIT_CODE=1 fi