diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/.gitignore | 1 | ||||
-rw-r--r-- | tests/Makefile.am | 6 | ||||
-rw-r--r-- | tests/accept.at | 4 | ||||
-rw-r--r-- | tests/atlocal.in | 2 | ||||
-rwxr-xr-x | tests/aux/in.test | 2 | ||||
-rw-r--r-- | tests/builtin.at | 14 | ||||
-rw-r--r-- | tests/chargen.c | 2 | ||||
-rw-r--r-- | tests/control.at | 6 | ||||
-rw-r--r-- | tests/cyclic.at | 6 | ||||
-rw-r--r-- | tests/env.at | 10 | ||||
-rw-r--r-- | tests/envglobal.at | 6 | ||||
-rw-r--r-- | tests/envop.at | 2 | ||||
-rw-r--r-- | tests/envtest.c | 2 | ||||
-rw-r--r-- | tests/expandenv.at | 6 | ||||
-rw-r--r-- | tests/inet.at | 4 | ||||
-rw-r--r-- | tests/iobuf.h | 2 | ||||
-rw-r--r-- | tests/lines.c | 3 | ||||
-rw-r--r-- | tests/maxinst.at | 6 | ||||
-rw-r--r-- | tests/nt.c | 2 | ||||
-rw-r--r-- | tests/passfd.at | 4 | ||||
-rw-r--r-- | tests/readtime.c | 2 | ||||
-rw-r--r-- | tests/recvfd.c | 2 | ||||
-rw-r--r-- | tests/redirect.at | 4 | ||||
-rw-r--r-- | tests/respawn.at | 6 | ||||
-rw-r--r-- | tests/ret-exec.at | 4 | ||||
-rw-r--r-- | tests/ret-notify.at | 4 | ||||
-rw-r--r-- | tests/shdnseq.at | 82 | ||||
-rw-r--r-- | tests/shell.at | 6 | ||||
-rw-r--r-- | tests/shutdown.at | 8 | ||||
-rw-r--r-- | tests/sigterm.at | 49 | ||||
-rw-r--r-- | tests/sigwait.c | 75 | ||||
-rw-r--r-- | tests/startup.at | 6 | ||||
-rw-r--r-- | tests/testsuite.at | 7 | ||||
-rw-r--r-- | tests/to.c | 2 | ||||
-rw-r--r-- | tests/version.at | 2 |
35 files changed, 281 insertions, 68 deletions
diff --git a/tests/.gitignore b/tests/.gitignore index 43d3848..1993da2 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -11,3 +11,4 @@ nt recvfd readtime chargen +sigwait diff --git a/tests/Makefile.am b/tests/Makefile.am index 62cdb31..6724aea 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,5 +1,5 @@ # This file is part of GNU Pies. -# Copyright (C) 2008-2020 Sergey Poznyakoff +# Copyright (C) 2008-2023 Sergey Poznyakoff # # GNU Pies is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -64,15 +64,17 @@ TESTSUITE_AT = \ redirect.at\ ret-exec.at\ ret-notify.at\ + sigterm.at\ shell.at\ startup.at\ + shdnseq.at\ shutdown.at\ version.at TESTSUITE = $(srcdir)/testsuite M4=m4 -noinst_PROGRAMS = envtest to lines nt recvfd readtime chargen +noinst_PROGRAMS = envtest to lines nt recvfd readtime chargen sigwait nt_SOURCES = nt.c iobuf.h AM_CPPFLAGS = \ -I$(top_srcdir)/lib\ diff --git a/tests/accept.at b/tests/accept.at index 417c2ba..0249ad6 100644 --- a/tests/accept.at +++ b/tests/accept.at @@ -1,5 +1,5 @@ # This file is part of GNU pies testsuite. -*- autotest -*- -# Copyright (C) 2019-2020 Sergey Poznyakoff +# Copyright (C) 2019-2023 Sergey Poznyakoff # # GNU pies is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -40,7 +40,7 @@ _EOT set -e to 10 \ - pies --foreground --stderr \ + pies --no-preprocessor --foreground --stderr \ --config-file control.conf --config-file pies.conf --debug 1 2>errlog cat inlog diff --git a/tests/atlocal.in b/tests/atlocal.in index c043843..0e4695e 100644 --- a/tests/atlocal.in +++ b/tests/atlocal.in @@ -1,6 +1,6 @@ # @configure_input@ -*- shell-script -*- # Configurable variable values for GNU Pies test suite. -# Copyright (C) 2016-2020 Sergey Poznyakoff +# Copyright (C) 2016-2023 Sergey Poznyakoff PATH=@abs_builddir@:@abs_top_builddir@/src:$srcdir:$PATH XFAILFILE=$abs_builddir/.badversion diff --git a/tests/aux/in.test b/tests/aux/in.test index 1fae034..54b546a 100755 --- a/tests/aux/in.test +++ b/tests/aux/in.test @@ -4,7 +4,7 @@ FILE=${1:?} IFS='
' : ${PIESCTL:=piesctl} -PIESCTL="$PIESCTL --no-netrc${PIES_CTLSOCK:+ --url=}$PIES_CTLSOCK" +PIESCTL="$PIESCTL --config-file=/dev/null --no-netrc${PIES_CTLSOCK:+ --url=}$PIES_CTLSOCK" while read COMMAND ARG do echo $COMMAND $ARG >> $FILE diff --git a/tests/builtin.at b/tests/builtin.at index 16208e6..c13b42b 100644 --- a/tests/builtin.at +++ b/tests/builtin.at @@ -1,5 +1,5 @@ # This file is part of GNU pies testsuite. -*- autotest -*- -# Copyright (C) 2016-2020 Sergey Poznyakoff +# Copyright (C) 2016-2023 Sergey Poznyakoff # # GNU pies is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -40,13 +40,13 @@ component controller { command "nt -i input -o output $PIES_TEST_INET_SOCKET"; return-code * { action disable; - exec "piesctl --url '$PIES_CTLSOCK' --no-netrc shutdown"; + exec "piesctl --config-file=/dev/null --url '$PIES_CTLSOCK' --config-file=/dev/null --no-netrc shutdown"; } } _EOT set -e to 10 \ - pies --foreground --stderr \ + pies --no-preprocessor --foreground --stderr \ --config-file control.conf --config-file pies.conf --debug 1 2>errlog cat output m4_if([$1],[qotd],[| tr -d '\r']) @@ -78,7 +78,7 @@ component controller { stderr file "$PWD/controller.err"; return-code * { action disable; - exec "echo \$PIES_STATUS > $PWD/status ; piesctl --url '$PIES_CTLSOCK' --no-netrc shutdown"; + exec "echo \$PIES_STATUS > $PWD/status ; piesctl --url '$PIES_CTLSOCK' --config-file=/dev/null --no-netrc shutdown"; } } _EOT @@ -86,7 +86,7 @@ TZ=0 export TZ set -e to 10 \ - pies --foreground --stderr \ + pies --no-preprocessor --foreground --stderr \ --config-file control.conf --config-file pies.conf --debug 1 2>errlog if test -s in.err; then @@ -166,14 +166,14 @@ component test { stderr file "$PWD/test.err"; return-code * { action disable; - exec "piesctl --no-netrc --url=$PIES_CTLSOCK shutdown"; + exec "piesctl --config-file=/dev/null --no-netrc --url=$PIES_CTLSOCK shutdown"; } } _EOT set -e to 10 \ - pies --foreground --stderr \ + pies --no-preprocessor --foreground --stderr \ --config-file control.conf --config-file pies.conf --debug 1 2>errlog for err in one.err two.err test.err diff --git a/tests/chargen.c b/tests/chargen.c index 59aa0d8..5f5a170 100644 --- a/tests/chargen.c +++ b/tests/chargen.c @@ -1,5 +1,5 @@ /* This file is part of GNU Pies testsuite. - Copyright (C) 2019-2020 Sergey Poznyakoff + Copyright (C) 2019-2023 Sergey Poznyakoff GNU Pies is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/tests/control.at b/tests/control.at index e63cc66..6027817 100644 --- a/tests/control.at +++ b/tests/control.at @@ -1,5 +1,5 @@ # This file is part of GNU pies testsuite. -*- autotest -*- -# Copyright (C) 2016-2020 Sergey Poznyakoff +# Copyright (C) 2016-2023 Sergey Poznyakoff # # GNU pies is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,10 +20,10 @@ AT_CHECK([ PIES_XFAIL_CHECK PIES_CONTROL_INIT -pies --config-file control.conf +pies --no-preprocessor --config-file control.conf sleep 1 -PIESCTL="piesctl --no-netrc --url '$PIES_CTLSOCK'" +PIESCTL="piesctl --config-file=/dev/null --no-netrc --url '$PIES_CTLSOCK'" if test -f $PIES_PIDFILE; then pid0=`head -1 $PIES_PIDFILE` pid1=`$PIESCTL id PID|sed 's/^PID: //'` diff --git a/tests/cyclic.at b/tests/cyclic.at index 46a3c7a..96a7b41 100644 --- a/tests/cyclic.at +++ b/tests/cyclic.at @@ -1,5 +1,5 @@ # This file is part of GNU pies testsuite. -*- autotest -*- -# Copyright (C) 2019-2020 Sergey Poznyakoff +# Copyright (C) 2019-2023 Sergey Poznyakoff # # GNU pies is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -92,7 +92,7 @@ component h { } ]) -pies --config-file test.conf --dump-depmap | trimws +pies --no-preprocessor --config-file test.conf --dump-depmap | trimws ], [0], [Dependency map: @@ -130,7 +130,7 @@ component d { prerequisites (a); } ]) -pies --config-file test.conf --dump-depmap | trimws +pies --no-preprocessor --config-file test.conf --dump-depmap | trimws ], [0], [No components defined diff --git a/tests/env.at b/tests/env.at index 9fe405e..38c6604 100644 --- a/tests/env.at +++ b/tests/env.at @@ -1,5 +1,5 @@ # This file is part of GNU pies testsuite. -*- autotest -*- -# Copyright (C) 2020 Sergey Poznyakoff +# Copyright (C) 2020-2023 Sergey Poznyakoff # # GNU pies is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -30,14 +30,14 @@ component envtest { stdout file "$PWD/log"; return-code 0 { action disable; - exec "$abs_top_builddir/src/piesctl --url unix:///$PWD/pies.ctl --no-netrc shutdown"; + exec "$abs_top_builddir/src/piesctl --config-file=/dev/null --url unix:///$PWD/pies.ctl --no-netrc shutdown"; } } _EOT to 5 \ envtest -exec \ - $abs_top_builddir/src/pies --foreground --stderr \ + $abs_top_builddir/src/pies --no-preprocessor --foreground --stderr \ --config-file control.conf --config-file envtest.conf --debug 1 2>errlog cat log ], @@ -104,14 +104,14 @@ component envtest { stdout file "$PWD/log"; return-code 0 { action disable; - exec "$abs_top_builddir/src/piesctl --url unix:///$PWD/pies.ctl --no-netrc shutdown"; + exec "$abs_top_builddir/src/piesctl --config-file=/dev/null --url unix:///$PWD/pies.ctl --no-netrc shutdown"; } } _EOT to 5 \ envtest -exec \ - $abs_top_builddir/src/pies --foreground --stderr \ + $abs_top_builddir/src/pies --no-preprocessor --foreground --stderr \ --config-file control.conf --config-file envtest.conf --debug 1 2>errlog cat log ], diff --git a/tests/envglobal.at b/tests/envglobal.at index 8adc04d..9b89ce2 100644 --- a/tests/envglobal.at +++ b/tests/envglobal.at @@ -1,5 +1,5 @@ # This file is part of GNU pies testsuite. -*- autotest -*- -# Copyright (C) 2020 Sergey Poznyakoff +# Copyright (C) 2020-2023 Sergey Poznyakoff # # GNU pies is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -30,14 +30,14 @@ component envtest { stdout file "$PWD/log"; return-code 0 { action disable; - exec "$abs_top_builddir/src/piesctl --url unix:///$PWD/pies.ctl --no-netrc shutdown"; + exec "$abs_top_builddir/src/piesctl --url unix:///$PWD/pies.ctl --config-file=/dev/null --no-netrc shutdown"; } } _EOT to 5 \ envtest -exec \ - $abs_top_builddir/src/pies --foreground --stderr \ + $abs_top_builddir/src/pies --no-preprocessor --foreground --stderr \ --config-file control.conf --config-file envtest.conf --debug 1 2>errlog cat log ], diff --git a/tests/envop.at b/tests/envop.at index ac1336e..8cc7a83 100644 --- a/tests/envop.at +++ b/tests/envop.at @@ -1,5 +1,5 @@ # This file is part of GNU pies testsuite. -*- autotest -*- -# Copyright (C) 2020 Sergey Poznyakoff +# Copyright (C) 2020-2023 Sergey Poznyakoff # # GNU pies is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/envtest.c b/tests/envtest.c index 45d69a2..bdbbd40 100644 --- a/tests/envtest.c +++ b/tests/envtest.c @@ -1,5 +1,5 @@ /* Environment test program for GNU Pies. - Copyright (C) 2019-2020 Sergey Poznyakoff + Copyright (C) 2019-2023 Sergey Poznyakoff GNU Pies is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/tests/expandenv.at b/tests/expandenv.at index b8ecd8d..c330c12 100644 --- a/tests/expandenv.at +++ b/tests/expandenv.at @@ -1,5 +1,5 @@ # This file is part of GNU pies testsuite. -*- autotest -*- -# Copyright (C) 2016-2020 Sergey Poznyakoff +# Copyright (C) 2016-2023 Sergey Poznyakoff # # GNU pies is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -28,7 +28,7 @@ component test { chdir "$PWD"; return-code 1 { action disable; - exec "piesctl --url unix:///$PWD/pies.ctl --no-netrc shutdown"; + exec "piesctl --config-file=/dev/null --url unix:///$PWD/pies.ctl --no-netrc shutdown"; } } EOT @@ -38,7 +38,7 @@ export statefile set -e to 5 \ - pies --foreground --stderr \ + pies --no-preprocessor --foreground --stderr \ --config-file control.conf --config-file pies.conf --debug 4 2>errlog cat state diff --git a/tests/inet.at b/tests/inet.at index e9318c9..cf9c13c 100644 --- a/tests/inet.at +++ b/tests/inet.at @@ -1,5 +1,5 @@ # This file is part of GNU pies testsuite. -*- autotest -*- -# Copyright (C) 2016-2020 Sergey Poznyakoff +# Copyright (C) 2016-2023 Sergey Poznyakoff # # GNU pies is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -36,7 +36,7 @@ component controller { _EOT set -e to 10 \ - pies --foreground --stderr \ + pies --no-preprocessor --foreground --stderr \ --config-file control.conf --config-file pies.conf --debug 1 2>errlog cat inlog diff --git a/tests/iobuf.h b/tests/iobuf.h index df5f3ba..f64cb4c 100644 --- a/tests/iobuf.h +++ b/tests/iobuf.h @@ -1,5 +1,5 @@ /* This file is part of GNU Pies. - Copyright (C) 2019-2020 Sergey Poznyakoff + Copyright (C) 2019-2023 Sergey Poznyakoff GNU Pies is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/tests/lines.c b/tests/lines.c index 0ad9d13..b74dd8a 100644 --- a/tests/lines.c +++ b/tests/lines.c @@ -1,5 +1,5 @@ /* This file is part of GNU Pies testsuite. - Copyright (C) 2019-2020 Sergey Poznyakoff + Copyright (C) 2019-2023 Sergey Poznyakoff GNU Pies is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -14,6 +14,7 @@ You should have received a copy of the GNU General Public License along with GNU Pies. If not, see <http://www.gnu.org/licenses/>. */ +#include <config.h> #include <stdio.h> int diff --git a/tests/maxinst.at b/tests/maxinst.at index 304f2dc..91a6faa 100644 --- a/tests/maxinst.at +++ b/tests/maxinst.at @@ -1,5 +1,5 @@ # This file is part of GNU pies testsuite. -*- autotest -*- -# Copyright (C) 2019-2020 Sergey Poznyakoff +# Copyright (C) 2019-2023 Sergey Poznyakoff # # GNU pies is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -59,14 +59,14 @@ component con3 { stderr file "/tmp/con3.err"; return-code * { action disable; - exec "$abs_top_builddir/src/piesctl --url unix://$PWD/pies.ctl --no-netrc shutdown"; + exec "$abs_top_builddir/src/piesctl --url unix://$PWD/pies.ctl --config-file=/dev/null --no-netrc shutdown"; } } _EOT set -e to 10 \ - pies --foreground --stderr \ + pies --no-preprocessor --foreground --stderr \ --config-file control.conf --config-file pies.conf --debug 1 2>errlog cat con3.out @@ -1,5 +1,5 @@ /* This file is part of GNU Pies testsuite. - Copyright (C) 2019-2020 Sergey Poznyakoff + Copyright (C) 2019-2023 Sergey Poznyakoff GNU Pies is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/tests/passfd.at b/tests/passfd.at index a3ead31..f8af911 100644 --- a/tests/passfd.at +++ b/tests/passfd.at @@ -1,5 +1,5 @@ # This file is part of GNU pies testsuite. -*- autotest -*- -# Copyright (C) 2016-2020 Sergey Poznyakoff +# Copyright (C) 2016-2023 Sergey Poznyakoff # # GNU pies is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -43,7 +43,7 @@ _EOT set -e to 10 \ - pies --foreground --stderr \ + pies --no-preprocessor --foreground --stderr \ --config-file control.conf --config-file pies.conf --debug 1 2>errlog cat inlog diff --git a/tests/readtime.c b/tests/readtime.c index ed3f2f8..2f354f4 100644 --- a/tests/readtime.c +++ b/tests/readtime.c @@ -1,5 +1,5 @@ /* This file is part of GNU Pies testsuite. - Copyright (C) 2019-2020 Sergey Poznyakoff + Copyright (C) 2019-2023 Sergey Poznyakoff GNU Pies is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/tests/recvfd.c b/tests/recvfd.c index 8e0ec79..7e6a70a 100644 --- a/tests/recvfd.c +++ b/tests/recvfd.c @@ -1,5 +1,5 @@ /* This file is part of GNU Pies testsuite. - Copyright (C) 2019-2020 Sergey Poznyakoff + Copyright (C) 2019-2023 Sergey Poznyakoff GNU Pies is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/tests/redirect.at b/tests/redirect.at index 8421bfe..d405b3a 100644 --- a/tests/redirect.at +++ b/tests/redirect.at @@ -1,5 +1,5 @@ # This file is part of GNU pies testsuite. -*- autotest -*- -# Copyright (C) 2016-2020 Sergey Poznyakoff +# Copyright (C) 2016-2023 Sergey Poznyakoff # # GNU pies is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -29,7 +29,7 @@ component test { } _EOT -pies --config-file control.conf --config-file pies.conf +pies --no-preprocessor --config-file control.conf --config-file pies.conf n=0 while : diff --git a/tests/respawn.at b/tests/respawn.at index 643ac88..c11379f 100644 --- a/tests/respawn.at +++ b/tests/respawn.at @@ -1,5 +1,5 @@ # This file is part of GNU pies testsuite. -*- autotest -*- -# Copyright (C) 2016-2020 Sergey Poznyakoff +# Copyright (C) 2016-2023 Sergey Poznyakoff # # GNU pies is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -27,13 +27,13 @@ component test { chdir $PWD; return-code 1 { action disable; - exec "piesctl --url unix:///$PWD/pies.ctl --no-netrc shutdown"; + exec "piesctl --url unix:///$PWD/pies.ctl --config-file=/dev/null --no-netrc shutdown"; } } _EOT to 5 \ - pies --foreground --stderr \ + pies --no-preprocessor --foreground --stderr \ --config-file control.conf --config-file pies.conf --debug 1 2>errlog cat state ], diff --git a/tests/ret-exec.at b/tests/ret-exec.at index 1f206b0..6540fc7 100644 --- a/tests/ret-exec.at +++ b/tests/ret-exec.at @@ -1,5 +1,5 @@ # This file is part of GNU pies testsuite. -*- autotest -*- -# Copyright (C) 2016-2020 Sergey Poznyakoff +# Copyright (C) 2016-2023 Sergey Poznyakoff # # GNU pies is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -35,7 +35,7 @@ _EOT >$report_file -pies --config-file control.conf --config-file pies.conf +pies --no-preprocessor --config-file control.conf --config-file pies.conf n=0 while test ! -s $report_file diff --git a/tests/ret-notify.at b/tests/ret-notify.at index c35230b..59bbdf5 100644 --- a/tests/ret-notify.at +++ b/tests/ret-notify.at @@ -1,5 +1,5 @@ # This file is part of GNU pies testsuite. -*- autotest -*- -# Copyright (C) 2016-2020 Sergey Poznyakoff +# Copyright (C) 2016-2023 Sergey Poznyakoff # # GNU pies is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -36,7 +36,7 @@ _EOT >$report_file -pies --config-file control.conf --config-file pies.conf +pies --no-preprocessor --config-file control.conf --config-file pies.conf n=0 while test ! -s $report_file diff --git a/tests/shdnseq.at b/tests/shdnseq.at new file mode 100644 index 0000000..a6ed644 --- /dev/null +++ b/tests/shdnseq.at @@ -0,0 +1,82 @@ +# This file is part of GNU pies testsuite. -*- autotest -*- +# Copyright (C) 2022-2023 Sergey Poznyakoff +# +# GNU pies is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU pies is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU pies. If not, see <http://www.gnu.org/licenses/>. + +AT_SETUP([component shutdown sequence]) +AT_KEYWORDS([shutdown shdnseq]) +AT_CHECK([ +PIES_XFAIL_CHECK +PIES_CONTROL_INIT +cat > pies.conf <<_EOT +component a { + command "sigwait -f result -n a"; + prerequisites (b,d); +} +component b { + command "sigwait -f result -n b"; +} +component c { + command "sigwait -f result -n c"; + prerequisites (e); +} +component d { + command "sigwait -f result -n d"; + prerequisites (c); +} +component e { + command "sigwait -f result -n e"; + prerequisites (g,h); +} +component f { + command "sigwait -f result -n f"; +} +component g { + command "sigwait -f result -n g"; + prerequisites (h); +} +component h { + command "sigwait -f result -n h"; +} +component sentinel { + mode respawn; + prerequisites (test); + command "piesctl --config-file=/dev/null --url unix:///$PWD/pies.ctl --no-netrc shutdown"; +} +_EOT + +rm -f result +set -e +to 5 \ + pies --no-preprocessor --foreground --stderr \ + --config-file control.conf --config-file pies.conf --debug 1 2>errlog +# Two components stop in shutdown sequence 0; their traces can appear in any +# order. +sed -n 1,2p result | sort -k1 +# Same for the components in sequence 1. +sed -n 3,4p result | sort -k1 +# The order for the rest of components is fixed. +tail -n 4 result +], +[0], +[a: 15 +f: 15 +b: 15 +d: 15 +c: 15 +e: 15 +g: 15 +h: 15 +]) +AT_CLEANUP diff --git a/tests/shell.at b/tests/shell.at index 5bf1192..69aa436 100644 --- a/tests/shell.at +++ b/tests/shell.at @@ -1,5 +1,5 @@ # This file is part of GNU pies testsuite. -*- autotest -*- -# Copyright (C) 2016-2020 Sergey Poznyakoff +# Copyright (C) 2016-2023 Sergey Poznyakoff # # GNU pies is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -29,14 +29,14 @@ component test { chdir $PWD; return-code 1 { action disable; - exec "piesctl --url unix:///$PWD/pies.ctl --no-netrc shutdown"; + exec "piesctl --url unix:///$PWD/pies.ctl --config-file=/dev/null --no-netrc shutdown"; } } _EOT set -e to 5 \ - pies --foreground --stderr \ + pies --no-preprocessor --foreground --stderr \ --config-file control.conf --config-file pies.conf --debug 1 2>errlog echo state: diff --git a/tests/shutdown.at b/tests/shutdown.at index b640ab8..3982496 100644 --- a/tests/shutdown.at +++ b/tests/shutdown.at @@ -1,5 +1,5 @@ # This file is part of GNU pies testsuite. -*- autotest -*- -# Copyright (C) 2019-2020 Sergey Poznyakoff +# Copyright (C) 2019-2023 Sergey Poznyakoff # # GNU pies is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -29,8 +29,8 @@ component test { chdir $PWD; return-code 1 { action disable; - exec "piesctl --url unix:///$PWD/pies.ctl --no-netrc shutdown"; - } + exec "piesctl --config-file=/dev/null --url unix:///$PWD/pies.ctl --no-netrc shutdown"; + } } component s { @@ -41,7 +41,7 @@ _EOT set -e to 5 \ - pies --foreground --stderr \ + pies --no-preprocessor --foreground --stderr \ --config-file control.conf --config-file pies.conf --debug 1 2>errlog cat shutdown diff --git a/tests/sigterm.at b/tests/sigterm.at new file mode 100644 index 0000000..37256ca --- /dev/null +++ b/tests/sigterm.at @@ -0,0 +1,49 @@ +# This file is part of GNU pies testsuite. -*- autotest -*- +# Copyright (C) 2022-2023 Sergey Poznyakoff +# +# GNU pies is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU pies is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU pies. If not, see <http://www.gnu.org/licenses/>. + +AT_SETUP([sigterm]) +AT_KEYWORDS([sigterm]) +AT_CHECK([ +PIES_XFAIL_CHECK +PIES_CONTROL_INIT + +resultfile=$PWD/result + +cat > pies.conf <<_EOT +component test { + mode respawn; + command "sigwait -f$resultfile"; + sigterm SIGQUIT; +} +component sentinel { + mode respawn; + prerequisites (test); + command "piesctl --config-file=/dev/null --url unix:///$PWD/pies.ctl --no-netrc shutdown"; +} +_EOT + +rm -f result +set -e +to 5 \ + pies --no-preprocessor --foreground --stderr \ + --config-file control.conf --config-file pies.conf --debug 1 2>errlog +cat result +], +[0], +[sigwait: 3 +]) + +AT_CLEANUP
\ No newline at end of file diff --git a/tests/sigwait.c b/tests/sigwait.c new file mode 100644 index 0000000..dd13b58 --- /dev/null +++ b/tests/sigwait.c @@ -0,0 +1,75 @@ +/* This file is part of GNU Pies testsuite. + Copyright (C) 2019-2023 Sergey Poznyakoff + + GNU Pies is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + GNU Pies is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Pies. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> +#include <stdio.h> +#include <signal.h> +#include <assert.h> +#include <unistd.h> + +static void +sighan (int signo) +{ +} + +int +main (int argc, char **argv) +{ + sigset_t set; + struct sigaction act; + int c, n; + FILE *fp = stdout; + char const *program_name = argv[0]; + char const *file_name = NULL; + + while ((c = getopt (argc, argv, "n:f:")) != EOF) + { + switch (c) + { + case 'n': + program_name = optarg; + break; + + case 'f': + file_name = optarg; + break; + + default: + return 1; + } + } + assert (argc == optind); + + act.sa_flags = 0; + sigemptyset (&act.sa_mask); + act.sa_handler = sighan; + sigaction (SIGTERM, &act, NULL); + sigaction (SIGQUIT, &act, NULL); + sigfillset (&set); |