Merge branch 'master' of git://git.distorted.org.uk/~mdw/ca
[ca] / test / update
CommitLineData
69ab55f7
MW
1#! /bin/sh
2
3set -ex
4dirs="state archive req cert"
5rm -rf $dirs tmp
6mkdir -m775 tmp
7export CA_FAKE_TIME
8
9donep=t stage=0
10while :; do
11 stage=$(( $stage + 1 ))
12 if [ -e test/stage-$stage.tar.gz ]; then continue; fi
13 case $donep,$stage in
14 t,1) ;;
15 t,*) tar xf test/stage-$(( $stage - 1 )).tar.gz ;;
16 esac
17 donep=nil
18 case $stage in
19 1)
20 CA_FAKE_TIME="2011-08-23 18:32:45"
21 bin/setup
ba5955a0 22 bin/update
69ab55f7
MW
23 for i in $(seq 1 50); do
24 bin/add tls-client fake#$i test/fake-reqs/$i.req
25 done
26 bin/check
27 ;;
28 2)
29 CA_FAKE_TIME="2011-08-24 18:32:45"
30 bin/update
31 bin/check
32 ;;
33 3)
34 CA_FAKE_TIME="2011-08-30 18:32:45"
35 bin/update
36 bin/check
37 ;;
38 4)
39 CA_FAKE_TIME="2011-09-03 18:32:45"
40 bin/update
41 bin/revoke fake#13 key-compromise
42 bin/check
43 ;;
44 5)
45 CA_FAKE_TIME="2011-09-05 18:32:45"
46 bin/update
47 bin/check
48 ;;
624478e5
MW
49 6)
50 CA_FAKE_TIME="2011-10-05 18:32:45"
51 bin/update
52 bin/check
53 ;;
54 7)
55 CA_FAKE_TIME="2011-12-05 18:32:45"
56 bin/update
57 bin/check
58 ;;
69ab55f7
MW
59 *)
60 break
61 ;;
62 esac
63 tar cfz test/stage-$stage.tar.gz $dirs
64done