comparison smoketest.sh @ 742:46c4978c9a5c

Add a 60 second timeout to smoketest. (Some qemu failure modes involve hanging.)
author Rob Landley <rob@landley.net>
date Sun, 31 May 2009 02:36:22 -0500
parents 0ac06d08cfe5
children d0157468f73d
comparison
equal deleted inserted replaced
741:1b6acc6cf349 742:46c4978c9a5c
1 #!/bin/bash 1 #!/bin/bash
2 2
3 # This script compiles stuff under the final system, using distcc to call out 3 # This script compiles stuff under the final system, using distcc to call out
4 # to the cross compiler. 4 # to the cross compiler.
5
6 # Set up a timeout. If it doesn't complete in 60 seconds, it failed.
7
8 timeout()
9 {
10 sleep 60
11 kill $1
12 }
13
14 timeout $$ &
15 trap "kill $(jobs -p) 2>/dev/null" EXIT
16
17 # Call run-from-build with a here document to do stuff.
5 18
6 # Note that the first line of the script is a few spaces followed by a comment 19 # Note that the first line of the script is a few spaces followed by a comment
7 # character. This gives some harmless data for the linux boot process to 20 # character. This gives some harmless data for the linux boot process to
8 # consume and discard before it gets to the command prompt. I don't know why 21 # consume and discard before it gets to the command prompt. I don't know why
9 # it does this, but it does. The comment character is so you can see how 22 # it does this, but it does. The comment character is so you can see how