aboutsummaryrefslogtreecommitdiff
path: root/tests/redirect.at
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2019-06-02 11:57:42 +0300
committerSergey Poznyakoff <gray@gnu.org>2019-06-02 11:57:42 +0300
commit685600d72b0c300f94c0c69dc0a16c4ebb230a21 (patch)
tree3a3ea6f43a8cdc543118e2cf81d29628dc82f61f /tests/redirect.at
parentcc298a11a131b162f291d6ee27ba1d7598a1b6c4 (diff)
downloadpies-685600d72b0c300f94c0c69dc0a16c4ebb230a21.tar.gz
pies-685600d72b0c300f94c0c69dc0a16c4ebb230a21.tar.bz2
Rewrite the testsuite
The aim is to run pies in foreground if possible. Limit execution time using external wrapper. * src/pies.c: (_cb_redir): Consistently return 1 on errors. * tests/aux/sleepexit: New file. * tests/aux/startcheck: New file. * tests/aux/touchfile: Change arguments. * tests/aux/respawn: Rewrite. * tests/lines.c: New noinst program. * tests/to.c: New noinst program. * tests/.gitignore: Add new programs. * tests/Makefile.am: Update. * tests/env.at: Use to to avoid hanging forever. Add missing popdef. * tests/redirect.at: Use echo as component program. * tests/respawn.at: Run pies in foreground. Use to to limit execution time. * tests/shell.at: Likewise. * tests/shutdown.at: Likewise. * tests/startup.at: Likewise. * tests/ret-exec.at: Use sleepexit as component program. * tests/ret-notify.at: Likewise.
Diffstat (limited to 'tests/redirect.at')
-rw-r--r--tests/redirect.at12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/redirect.at b/tests/redirect.at
index 7860736..12fb20f 100644
--- a/tests/redirect.at
+++ b/tests/redirect.at
@@ -15,16 +15,16 @@
# along with GNU pies. If not, see <http://www.gnu.org/licenses/>.
AT_SETUP([stdout redirection])
+AT_KEYWORDS([redirect])
AT_CHECK([
PIES_XFAIL_CHECK
PIES_CONTROL_INIT
-comp_pid_file=$PWD/comp.pid
outfile=$PWD/out
cat > pies.conf <<_EOT
component test {
mode respawn;
- command "$auxdir/respawn -tag respawn -append -pid $comp_pid_file";
+ command "echo pass";
stdout file "$outfile";
}
_EOT
@@ -34,8 +34,8 @@ 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 -f $outfile; then
+ lines=`lines $outfile`
if test "$lines" -ge 2 ; then
break
fi
@@ -53,8 +53,8 @@ PIES_STOP
head -2 $outfile
],
[0],
-[respawn: start
-respawn: stop
+[pass
+pass
])
AT_CLEANUP

Return to:

Send suggestions and report system problems to the System administrator.