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])
AT_CHECK([
PIES_XFAIL_CHECK
PIES_CONTROL_INIT
-comp_pid_file=$PWD/comp.pid
cat > pies.conf <<_EOT
component b1 {
- mode startup;
- command "$auxdir/touchfile $PWD 1 b1";
+ mode startup;
+ command "$auxdir/touchfile b1 1";
}
component b2 {
- mode startup;
- command "$auxdir/touchfile $PWD 2 b2";
+ mode startup;
+ command "$auxdir/touchfile b2 2";
}
component test {
- mode respawn;
- command "$auxdir/respawn -append -pid $comp_pid_file";
+ mode respawn;
+ command "$auxdir/startcheck b1 b2";
+ chdir $PWD;
+ stdout file "log.out";
+ stderr file "log.err";
+ return-code * {
+ action disable;
+ exec "piesctl --url unix:///$PWD/pies.ctl shutdown";
+ }
}
_EOT
-pies --config-file control.conf --config-file pies.conf
+set -e
+to 5 \
+ pies --foreground --stderr \
+ --config-file control.conf --config-file pies.conf 2>errlog
-n=0
-res=
-b1=
-b2=
-while :
-do
- echo "n=$n" >> tracefile
- if test -z "$b1" && test -f b1; then
- res="${res}b1"
- b1=1
- echo "got b1" >> tracefile
- fi
- if test -z "$b2" && test -f b2; then
- res="${res}b2"
- b2=1
- echo "got b2" >> tracefile
- fi
- if test -f $comp_pid_file; then
- echo "got pidfile" >> tracefile
- res="${res}pid"
- break
- fi
- sleep 1
- n=$(($n + 1))
- if test $n -gt 10; then
- echo >&2 "timed out"
- break
- fi
-done
-
-PIES_STOP
-case $res in
-b1b2pid|b2b1pid) echo b1b2pid;;
-*) echo $res
-esac
+cat log.out
+cat log.err >&2
],
[0],
-[b1b2pid
+[# b1
+b1
+# b2
+b2
])
AT_CLEANUP

Return to:

Send suggestions and report system problems to the System administrator.