Eric Anholt | cf5ba9d | 2020-03-03 14:38:09 -0800 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Eric Anholt | 4bc15e7 | 2020-03-03 14:38:09 -0800 | [diff] [blame] | 3 | set -ex |
| 4 | |
Eric Anholt | cf5ba9d | 2020-03-03 14:38:09 -0800 | [diff] [blame] | 5 | mount -t proc none /proc |
| 6 | mount -t sysfs none /sys |
| 7 | mount -t devtmpfs none /dev || echo possibly already mounted |
| 8 | mkdir -p /dev/pts |
| 9 | mount -t devpts devpts /dev/pts |
Eric Anholt | 8b3452a | 2020-07-20 10:46:51 -0700 | [diff] [blame] | 10 | mount -t tmpfs tmpfs /tmp |
Eric Anholt | cf5ba9d | 2020-03-03 14:38:09 -0800 | [diff] [blame] | 11 | |
Eric Anholt | c7bbc21 | 2020-05-04 13:42:41 -0700 | [diff] [blame] | 12 | . /set-job-env-vars.sh |
| 13 | |
Eric Anholt | 8b3452a | 2020-07-20 10:46:51 -0700 | [diff] [blame] | 14 | # Store Mesa's disk cache under /tmp, rather than sending it out over NFS. |
| 15 | export XDG_CACHE_HOME=/tmp |
| 16 | |
Eric Anholt | 3b5e71c | 2020-05-01 09:57:00 -0700 | [diff] [blame] | 17 | echo "nameserver 8.8.8.8" > /etc/resolv.conf |
| 18 | |
Tomeu Vizoso | d4ca45e | 2020-07-31 08:13:15 +0200 | [diff] [blame] | 19 | # Not all DUTs have network |
| 20 | sntp -sS pool.ntp.org || true |
| 21 | |
Eric Anholt | cb82274 | 2020-07-22 13:59:49 -0700 | [diff] [blame] | 22 | # Start a little daemon to capture the first devcoredump we encounter. (They |
| 23 | # expire after 5 minutes, so we poll for them). |
| 24 | ./capture-devcoredump.sh & |
| 25 | |
Eric Anholt | 445f3eb | 2020-06-08 15:23:52 -0700 | [diff] [blame] | 26 | if sh $BARE_METAL_TEST_SCRIPT; then |
Christian Gmeiner | 096adbe | 2020-06-10 14:44:17 +0200 | [diff] [blame] | 27 | OK=1 |
| 28 | else |
| 29 | OK=0 |
| 30 | fi |
| 31 | |
| 32 | # upload artifacts via webdav |
| 33 | WEBDAV=$(cat /proc/cmdline | tr " " "\n" | grep webdav | cut -d '=' -f 2 || true) |
| 34 | if [ -n "$WEBDAV" ]; then |
| 35 | find /results -type f -exec curl -T {} $WEBDAV/{} \; |
| 36 | fi |
| 37 | |
| 38 | if [ $OK -eq 1 ]; then |
Eric Anholt | a13209b | 2020-06-08 14:55:53 -0700 | [diff] [blame] | 39 | echo "bare-metal result: pass" |
Eric Anholt | cf5ba9d | 2020-03-03 14:38:09 -0800 | [diff] [blame] | 40 | else |
Eric Anholt | a13209b | 2020-06-08 14:55:53 -0700 | [diff] [blame] | 41 | echo "bare-metal result: fail" |
Eric Anholt | cf5ba9d | 2020-03-03 14:38:09 -0800 | [diff] [blame] | 42 | fi |
| 43 | |
| 44 | # Wait until the job would have timed out anyway, so we don't spew a "init |
| 45 | # exited" panic. |
| 46 | sleep 6000 |