chiark / gitweb /
* hosts/cadmium/onepackage-config: explain about archive skew.
[autopkgtest.git] / hosts / cadmium / lalonde-nightly
1 #!/bin/bash
2
3 set -e
4
5 PATH=/home/iwj/autopkgtest/runner:/usr/local/sbin:/usr/sbin:$PATH
6 export PATH
7
8 #any_tests_ok=false
9 any_tests_ok=true
10 source_tests_ok=true
11 binary_tests_ok=true
12 gutsy_tests_ok=true
13 max_test_count=10
14 go_anyway=false
15
16 for x in "$@"; do eval "$x"; done
17
18 fail () { printf >&2 "%s\n" "$*"; exit 127; }
19 progress () { printf "========== %s ==========\n" "$1"; }
20 x () { printf "+ %s\n" "$*"; "$@"; }
21 x2 () { printf >&2 "+ %s\n" "$*"; "$@"; }
22
23 wait_for () {
24         remain=$1; interval=$2; on_not=$3; shift;shift;shift
25         progress "await ($interval/$remain) $*"
26         while true; do
27                 date
28                 if "$@"; then return; fi
29                 remain=$(( $remain - $interval ))
30                 if [ $remain -lt 0 ]; then fail "wait timed out for $*"; fi
31                 eval "$on_not"
32                 sleep $interval
33         done
34 }
35
36 progress testing
37
38 xoptslist="source gutsy, target=source:binary gutsy, target=binary-amd64"
39
40 test_count=0
41
42 while $any_tests_ok && ($go_anyway || test -f go) && test $test_count -lt $max_test_count; do
43         now=`date`
44         printf "%s" "$now: "
45         
46         xopts="${xoptslist%%:*}"
47         xopts_opts="${xopts#*,}"
48         xoptslist="${xoptslist#*:}:$xopts"
49         printf "considering (%s) " "$xopts_opts"
50
51         anybroken=false
52         for x in ${xopts%%,*}; do
53                 if eval \$${x}_tests_ok; then :; else
54                         printf "   skipping because of %s\n" "$x"
55                         anybroken=true
56                         break
57                 fi
58         done
59         if $anybroken; then continue; fi
60
61         adt-testreport-onepackage /home/iwj/adt-play/onepackage-config \
62                 adtrun_extra_opts=--built-binaries-filter=__ \
63                 interactive=false $xopts_opts
64
65         test_count=$(( $test_count + 1 ))
66 done
67
68 progress 'stopping'