diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2019-06-11 12:54:02 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2019-06-11 13:18:29 +0300 |
commit | bf6506cdc46446eada5090a428c2407ebd17468a (patch) | |
tree | 2113b5c049283413fb4fe3981a837989d2969918 /tests/testsuite.at | |
parent | 186b9a1c99988844c5ea3fcce1fcc6cadb491206 (diff) | |
download | pies-bf6506cdc46446eada5090a428c2407ebd17468a.tar.gz pies-bf6506cdc46446eada5090a428c2407ebd17468a.tar.bz2 |
Improve the nt tool. Test inet running instance limit.
* tests/Makefile.am: Add new test.
* tests/aux/in.test (PIESCTL): Provide the necessary options.
Discontinue the use of STOPCMD environment variable.
New commands: enable, sleep, touch.
* tests/testsuite.at (PIES_CONTROL_INIT): Rename pidfile to PIES_PIDFILE
and ctlsock to PIES_CTLSOCK. Export both.
Include maxinst.at
* tests/control.at: Use new variables.
* tests/inet.at: Remove the env block.
* tests/iobuf.h (iobuf_copy): Return number of bytes copied.
* tests/maxinst.at: New file.
* tests/nt.c (netcat_stream_disconnect): New function.
(netcat_stream_read): Disconnect the peer stream if no
more input is available and the peer is not available for
output (i.e. its output buffer is empty).
(netcat_stream_write): Stop polling if output buffer is empty.
(netcat): Fix event mask
Diffstat (limited to 'tests/testsuite.at')
-rw-r--r-- | tests/testsuite.at | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/tests/testsuite.at b/tests/testsuite.at index 822ac7b..0682b51 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at | |||
@@ -28,25 +28,26 @@ _EOT | |||
28 | m4_define([PIES_XFAIL_CHECK],[AT_XFAIL_IF([test -f $[]XFAILFILE])]) | 28 | m4_define([PIES_XFAIL_CHECK],[AT_XFAIL_IF([test -f $[]XFAILFILE])]) |
29 | 29 | ||
30 | m4_define([PIES_CONTROL_INIT],[ | 30 | m4_define([PIES_CONTROL_INIT],[ |
31 | pidfile="$PWD/pies.pid" | 31 | PIES_PIDFILE="$PWD/pies.pid" |
32 | ctlsock="unix://$PWD/pies.ctl"; | 32 | PIES_CTLSOCK="unix://$PWD/pies.ctl"; |
33 | export PIES_PIDFILE PIES_CTLSOCK | ||
33 | cat > control.conf <<_EOT | 34 | cat > control.conf <<_EOT |
34 | pidfile "$pidfile"; | 35 | pidfile "$PIES_PIDFILE"; |
35 | control { | 36 | control { |
36 | socket "$ctlsock"; | 37 | socket "$PIES_CTLSOCK"; |
37 | } | 38 | } |
38 | _EOT | 39 | _EOT |
39 | ]) | 40 | ]) |
40 | 41 | ||
41 | m4_define([PIES_STOP],[ | 42 | m4_define([PIES_STOP],[ |
42 | piesctl --url "$ctlsock" shutdown | 43 | piesctl --url "$PIES_CTLSOCK" shutdown |
43 | pies_stop_spinner=0 | 44 | pies_stop_spinner=0 |
44 | while test -f $pidfile | 45 | while test -f $PIES_PIDFILE |
45 | do | 46 | do |
46 | sleep 1 | 47 | sleep 1 |
47 | pies_stop_spinner=$(($pies_stop_spinner + 1)) | 48 | pies_stop_spinner=$(($pies_stop_spinner + 1)) |
48 | if test $pies_stop_spinner -gt 3; then | 49 | if test $pies_stop_spinner -gt 3; then |
49 | kill `cat $pidfile` | 50 | kill `cat $PIES_PIDFILE` |
50 | echo >&2 "timed out waiting for shutdown" | 51 | echo >&2 "timed out waiting for shutdown" |
51 | fi | 52 | fi |
52 | done]) | 53 | done]) |
@@ -69,6 +70,7 @@ m4_include([startup.at]) | |||
69 | m4_include([shutdown.at]) | 70 | m4_include([shutdown.at]) |
70 | m4_include([shell.at]) | 71 | m4_include([shell.at]) |
71 | m4_include([inet.at]) | 72 | m4_include([inet.at]) |
73 | m4_include([maxinst.at]) | ||
72 | 74 | ||
73 | m4_include([envop.at]) | 75 | m4_include([envop.at]) |
74 | m4_include([env.at]) \ No newline at end of file | 76 | m4_include([env.at]) \ No newline at end of file |