aboutsummaryrefslogtreecommitdiff
path: root/tests/startup.at
diff options
context:
space:
mode:
Diffstat (limited to 'tests/startup.at')
-rw-r--r--tests/startup.at67
1 files changed, 23 insertions, 44 deletions
diff --git a/tests/startup.at b/tests/startup.at
index 440c249..22ad25b 100644
--- a/tests/startup.at
+++ b/tests/startup.at
@@ -19,65 +19,44 @@ AT_SETUP([Startup components])
19AT_CHECK([ 19AT_CHECK([
20PIES_XFAIL_CHECK 20PIES_XFAIL_CHECK
21PIES_CONTROL_INIT 21PIES_CONTROL_INIT
22comp_pid_file=$PWD/comp.pid
23 22
24cat > pies.conf <<_EOT 23cat > pies.conf <<_EOT
25component b1 { 24component b1 {
26 mode startup; 25 mode startup;
27 command "$auxdir/touchfile $PWD 1 b1"; 26 command "$auxdir/touchfile b1 1";
28} 27}
29 28
30component b2 { 29component b2 {
31 mode startup; 30 mode startup;
32 command "$auxdir/touchfile $PWD 2 b2"; 31 command "$auxdir/touchfile b2 2";
33} 32}
34 33
35component test { 34component test {
36 mode respawn; 35 mode respawn;
37 command "$auxdir/respawn -append -pid $comp_pid_file"; 36 command "$auxdir/startcheck b1 b2";
37 chdir $PWD;
38 stdout file "log.out";
39 stderr file "log.err";
40 return-code * {
41 action disable;
42 exec "piesctl --url unix:///$PWD/pies.ctl shutdown";
43 }
38} 44}
39_EOT 45_EOT
40 46
41pies --config-file control.conf --config-file pies.conf 47set -e
48to 5 \
49 pies --foreground --stderr \
50 --config-file control.conf --config-file pies.conf 2>errlog
42 51
43n=0 52cat log.out
44res= 53cat log.err >&2
45b1=
46b2=
47while :
48do
49 echo "n=$n" >> tracefile
50 if test -z "$b1" && test -f b1; then
51 res="${res}b1"
52 b1=1
53 echo "got b1" >> tracefile
54 fi
55 if test -z "$b2" && test -f b2; then
56 res="${res}b2"
57 b2=1
58 echo "got b2" >> tracefile
59 fi
60 if test -f $comp_pid_file; then
61 echo "got pidfile" >> tracefile
62 res="${res}pid"
63 break
64 fi
65 sleep 1
66 n=$(($n + 1))
67 if test $n -gt 10; then
68 echo >&2 "timed out"
69 break
70 fi
71done
72
73PIES_STOP
74case $res in
75b1b2pid|b2b1pid) echo b1b2pid;;
76*) echo $res
77esac
78], 54],
79[0], 55[0],
80[b1b2pid 56[# b1
57b1
58# b2
59b2
81]) 60])
82 61
83AT_CLEANUP 62AT_CLEANUP

Return to:

Send suggestions and report system problems to the System administrator.