chiark / gitweb /
config.tcl: New profile for devices which can't accept certificate updates.
[ca] / test / update
1 #! /bin/sh
2
3 set -ex
4 dirs="state archive req cert"
5 rm -rf $dirs tmp
6 mkdir -m775 tmp
7 export CA_FAKE_TIME
8
9 donep=t stage=0
10 while :; 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
22       bin/update
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       ;;
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       ;;
59     *)
60       break
61       ;;
62   esac
63   tar cfz test/stage-$stage.tar.gz $dirs
64 done