summaryrefslogtreecommitdiffabout
path: root/tests/shell.at
Side-by-side diff
Diffstat (limited to 'tests/shell.at') (more/less context) (ignore whitespace changes)
-rw-r--r--tests/shell.at48
1 files changed, 23 insertions, 25 deletions
diff --git a/tests/shell.at b/tests/shell.at
index 2f06f62..e3d104b 100644
--- a/tests/shell.at
+++ b/tests/shell.at
@@ -19,40 +19,38 @@ AT_SETUP([flags shell])
AT_CHECK([
PIES_XFAIL_CHECK
PIES_CONTROL_INIT
+statefile=$PWD/state
outfile=$PWD/respawn.out
cat > pies.conf <<_EOT
component test {
- mode respawn;
- flags shell;
- command "$auxdir/respawn -tag respawn >> $outfile";
+ mode respawn;
+ flags shell;
+ command "if $auxdir/respawn $statefile 3; then echo pass; else exit 1; fi >> $outfile";
+ 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
+set -e
+to 5 \
+ pies --foreground --stderr \
+ --config-file control.conf --config-file pies.conf --debug 1 2>errlog
-n=0
-while :
-do
- if test -f $outfile; then
- lines=`wc -l $outfile | 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
-head -n2 $outfile
+echo state:
+cat $statefile
+echo log:
+cat $outfile
],
[0],
-[respawn: start
-respawn: stop
+[state:
+3
+log:
+pass
+pass
+pass
])
AT_CLEANUP

Return to:

Send suggestions and report system problems to the System administrator.