aboutsummaryrefslogtreecommitdiff
path: root/tests/shutdown.at
diff options
context:
space:
mode:
Diffstat (limited to 'tests/shutdown.at')
-rw-r--r--tests/shutdown.at48
1 files changed, 22 insertions, 26 deletions
diff --git a/tests/shutdown.at b/tests/shutdown.at
index 79bec37..1c2a4ef 100644
--- a/tests/shutdown.at
+++ b/tests/shutdown.at
@@ -19,39 +19,35 @@ AT_SETUP([Shutdown components])
AT_CHECK([
PIES_XFAIL_CHECK
PIES_CONTROL_INIT
-comp_pid_file=$PWD/comp.pid
+
+statefile=$PWD/state
cat > pies.conf <<_EOT
-component s {
- mode shutdown;
- command "$auxdir/touchfile $PWD 0 shutdown";
+component test {
+ mode respawn;
+ command "$auxdir/respawn $statefile 3";
+ chdir $PWD;
+ return-code 1 {
+ action disable;
+ exec "piesctl --url unix:///$PWD/pies.ctl shutdown";
+ }
}
-component test {
- mode respawn;
- command "$auxdir/respawn -append -pid $comp_pid_file";
+component s {
+ mode shutdown;
+ command "$auxdir/touchfile shutdown";
}
_EOT
-pies --config-file control.conf --config-file pies.conf
-
-n=0
-while :
-do
- if test -f $comp_pid_file; then
- break
- fi
- sleep 1
- n=$(($n + 1))
- if test $n -gt 10; then
- echo >&2 "timed out"
- break
- fi
-done
-
-PIES_STOP
-
-test -f shutdown
+set -e
+to 5 \
+ pies --foreground --stderr \
+ --config-file control.conf --config-file pies.conf 2>errlog
+
+cat shutdown
+],
+[0],
+[shutdown
])
AT_CLEANUP

Return to:

Send suggestions and report system problems to the System administrator.