aboutsummaryrefslogtreecommitdiff
path: root/tests/respawn.at
diff options
context:
space:
mode:
Diffstat (limited to 'tests/respawn.at')
-rw-r--r--tests/respawn.at38
1 files changed, 15 insertions, 23 deletions
diff --git a/tests/respawn.at b/tests/respawn.at
index 6b51ca6..0ba60dc 100644
--- a/tests/respawn.at
+++ b/tests/respawn.at
@@ -19,34 +19,26 @@ AT_SETUP([Respawn components])
AT_CHECK([
PIES_XFAIL_CHECK
PIES_CONTROL_INIT
-comp_pid_file=$PWD/comp.pid
+statefile=$PWD/state
cat > pies.conf <<_EOT
component test {
- mode respawn;
- command "$auxdir/respawn -append -pid $comp_pid_file";
+ mode respawn;
+ command "$auxdir/respawn $statefile 3";
+ chdir $PWD;
+ return-code 1 {
+ action disable;
+ exec "piesctl --url unix:///$PWD/pies.ctl shutdown";
+ }
}
_EOT
-pies --config-file control.conf --config-file pies.conf
-
-n=0
-while :
-do
- if test -f $comp_pid_file; then
- lines=`wc -l $comp_pid_file | awk '{print $1}'`
- if test "$lines" -ge 2 ; then
- break
- fi
- fi
- sleep 1
- n=$(($n + 1))
- if test $n -gt 35; then
- echo >&2 "timed out"
- break
- fi
-done
-
-PIES_STOP
+to 5 \
+ pies --foreground --stderr \
+ --config-file control.conf --config-file pies.conf --debug 1 2>errlog
+cat state
+],
+[0],
+[3
])
AT_CLEANUP

Return to:

Send suggestions and report system problems to the System administrator.