annotate smoketest.sh @ 779:6caf372a8b12

Teach smoketest to skip creation of hdb for /home when not needed.
author Rob Landley <rob@landley.net>
date Fri, 03 Jul 2009 19:46:48 -0500
parents e373d2b6d0b8
children 2ca7ea5d3ec1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
345
1a70dfe0a436 Quick smoke test for system image: ./smoketest.sh $ARCH | grep 'Hello world!'
Rob Landley <rob@landley.net>
parents:
diff changeset
1 #!/bin/bash
1a70dfe0a436 Quick smoke test for system image: ./smoketest.sh $ARCH | grep 'Hello world!'
Rob Landley <rob@landley.net>
parents:
diff changeset
2
778
e373d2b6d0b8 Add killtree and make stuff use it. Update smoketest-all.sh to use doforklog, allowing FORK=1 to run stuff in parallel.
Rob Landley <rob@landley.net>
parents: 751
diff changeset
3 . sources/functions.sh || exit 1
e373d2b6d0b8 Add killtree and make stuff use it. Update smoketest-all.sh to use doforklog, allowing FORK=1 to run stuff in parallel.
Rob Landley <rob@landley.net>
parents: 751
diff changeset
4
345
1a70dfe0a436 Quick smoke test for system image: ./smoketest.sh $ARCH | grep 'Hello world!'
Rob Landley <rob@landley.net>
parents:
diff changeset
5 # This script compiles stuff under the final system, using distcc to call out
1a70dfe0a436 Quick smoke test for system image: ./smoketest.sh $ARCH | grep 'Hello world!'
Rob Landley <rob@landley.net>
parents:
diff changeset
6 # to the cross compiler.
1a70dfe0a436 Quick smoke test for system image: ./smoketest.sh $ARCH | grep 'Hello world!'
Rob Landley <rob@landley.net>
parents:
diff changeset
7
742
46c4978c9a5c Add a 60 second timeout to smoketest. (Some qemu failure modes involve hanging.)
Rob Landley <rob@landley.net>
parents: 732
diff changeset
8 # Set up a timeout. If it doesn't complete in 60 seconds, it failed.
46c4978c9a5c Add a 60 second timeout to smoketest. (Some qemu failure modes involve hanging.)
Rob Landley <rob@landley.net>
parents: 732
diff changeset
9
46c4978c9a5c Add a 60 second timeout to smoketest. (Some qemu failure modes involve hanging.)
Rob Landley <rob@landley.net>
parents: 732
diff changeset
10 timeout()
46c4978c9a5c Add a 60 second timeout to smoketest. (Some qemu failure modes involve hanging.)
Rob Landley <rob@landley.net>
parents: 732
diff changeset
11 {
779
6caf372a8b12 Teach smoketest to skip creation of hdb for /home when not needed.
Rob Landley <rob@landley.net>
parents: 778
diff changeset
12 sleep 60
742
46c4978c9a5c Add a 60 second timeout to smoketest. (Some qemu failure modes involve hanging.)
Rob Landley <rob@landley.net>
parents: 732
diff changeset
13 kill $1
46c4978c9a5c Add a 60 second timeout to smoketest. (Some qemu failure modes involve hanging.)
Rob Landley <rob@landley.net>
parents: 732
diff changeset
14 }
46c4978c9a5c Add a 60 second timeout to smoketest. (Some qemu failure modes involve hanging.)
Rob Landley <rob@landley.net>
parents: 732
diff changeset
15
46c4978c9a5c Add a 60 second timeout to smoketest. (Some qemu failure modes involve hanging.)
Rob Landley <rob@landley.net>
parents: 732
diff changeset
16 timeout $$ &
778
e373d2b6d0b8 Add killtree and make stuff use it. Update smoketest-all.sh to use doforklog, allowing FORK=1 to run stuff in parallel.
Rob Landley <rob@landley.net>
parents: 751
diff changeset
17 trap "killtree $$" EXIT
742
46c4978c9a5c Add a 60 second timeout to smoketest. (Some qemu failure modes involve hanging.)
Rob Landley <rob@landley.net>
parents: 732
diff changeset
18
46c4978c9a5c Add a 60 second timeout to smoketest. (Some qemu failure modes involve hanging.)
Rob Landley <rob@landley.net>
parents: 732
diff changeset
19 # Call run-from-build with a here document to do stuff.
46c4978c9a5c Add a 60 second timeout to smoketest. (Some qemu failure modes involve hanging.)
Rob Landley <rob@landley.net>
parents: 732
diff changeset
20
345
1a70dfe0a436 Quick smoke test for system image: ./smoketest.sh $ARCH | grep 'Hello world!'
Rob Landley <rob@landley.net>
parents:
diff changeset
21 # Note that the first line of the script is a few spaces followed by a comment
1a70dfe0a436 Quick smoke test for system image: ./smoketest.sh $ARCH | grep 'Hello world!'
Rob Landley <rob@landley.net>
parents:
diff changeset
22 # character. This gives some harmless data for the linux boot process to
1a70dfe0a436 Quick smoke test for system image: ./smoketest.sh $ARCH | grep 'Hello world!'
Rob Landley <rob@landley.net>
parents:
diff changeset
23 # consume and discard before it gets to the command prompt. I don't know why
1a70dfe0a436 Quick smoke test for system image: ./smoketest.sh $ARCH | grep 'Hello world!'
Rob Landley <rob@landley.net>
parents:
diff changeset
24 # it does this, but it does. The comment character is so you can see how
1a70dfe0a436 Quick smoke test for system image: ./smoketest.sh $ARCH | grep 'Hello world!'
Rob Landley <rob@landley.net>
parents:
diff changeset
25 # much got eaten, generally about 3 characters.
1a70dfe0a436 Quick smoke test for system image: ./smoketest.sh $ARCH | grep 'Hello world!'
Rob Landley <rob@landley.net>
parents:
diff changeset
26
1a70dfe0a436 Quick smoke test for system image: ./smoketest.sh $ARCH | grep 'Hello world!'
Rob Landley <rob@landley.net>
parents:
diff changeset
27 # If you cat your own script into emulator-build.sh, you probably also need
1a70dfe0a436 Quick smoke test for system image: ./smoketest.sh $ARCH | grep 'Hello world!'
Rob Landley <rob@landley.net>
parents:
diff changeset
28 # to start with a line of spaces like that. Just FYI.
1a70dfe0a436 Quick smoke test for system image: ./smoketest.sh $ARCH | grep 'Hello world!'
Rob Landley <rob@landley.net>
parents:
diff changeset
29
779
6caf372a8b12 Teach smoketest to skip creation of hdb for /home when not needed.
Rob Landley <rob@landley.net>
parents: 778
diff changeset
30 SKIP_HOME=1 ./run-from-build.sh $1 << 'EOF'
345
1a70dfe0a436 Quick smoke test for system image: ./smoketest.sh $ARCH | grep 'Hello world!'
Rob Landley <rob@landley.net>
parents:
diff changeset
31 #
1a70dfe0a436 Quick smoke test for system image: ./smoketest.sh $ARCH | grep 'Hello world!'
Rob Landley <rob@landley.net>
parents:
diff changeset
32 # Show free space
1a70dfe0a436 Quick smoke test for system image: ./smoketest.sh $ARCH | grep 'Hello world!'
Rob Landley <rob@landley.net>
parents:
diff changeset
33 df
1a70dfe0a436 Quick smoke test for system image: ./smoketest.sh $ARCH | grep 'Hello world!'
Rob Landley <rob@landley.net>
parents:
diff changeset
34 # Smoke test for the compiler
732
0ac06d08cfe5 Root directory isn't writable with squashfs, use /tmp instead.
Rob Landley <rob@landley.net>
parents: 522
diff changeset
35 gcc -s /usr/src/thread-hello2.c -lpthread -o /tmp/hello &&
0ac06d08cfe5 Root directory isn't writable with squashfs, use /tmp instead.
Rob Landley <rob@landley.net>
parents: 522
diff changeset
36 /tmp/hello
345
1a70dfe0a436 Quick smoke test for system image: ./smoketest.sh $ARCH | grep 'Hello world!'
Rob Landley <rob@landley.net>
parents:
diff changeset
37 sync
1a70dfe0a436 Quick smoke test for system image: ./smoketest.sh $ARCH | grep 'Hello world!'
Rob Landley <rob@landley.net>
parents:
diff changeset
38 exit
1a70dfe0a436 Quick smoke test for system image: ./smoketest.sh $ARCH | grep 'Hello world!'
Rob Landley <rob@landley.net>
parents:
diff changeset
39 EOF