summaryrefslogtreecommitdiffabout
path: root/tests/maxinst.at
Unidiff
Diffstat (limited to 'tests/maxinst.at') (more/less context) (ignore whitespace changes)
-rw-r--r--tests/maxinst.at78
1 files changed, 78 insertions, 0 deletions
diff --git a/tests/maxinst.at b/tests/maxinst.at
new file mode 100644
index 0000000..f67d15e
--- a/dev/null
+++ b/tests/maxinst.at
@@ -0,0 +1,78 @@
1# This file is part of GNU pies testsuite. -*- Autotest -*-
2# Copyright (C) 2019 Sergey Poznyakoff
3#
4# GNU pies is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by
6# the Free Software Foundation; either version 3, or (at your option)
7# any later version.
8#
9# GNU pies is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with GNU pies. If not, see <http://www.gnu.org/licenses/>.
16
17AT_SETUP([inet component: max instances])
18AT_CHECK([
19PIES_XFAIL_CHECK
20PIES_CONTROL_INIT
21
22AT_DATA([in1],
23[test
24enable con2
25sleep 10
26quit
27])
28
29AT_DATA([in2],
30[test
31enable con3
32sleep 10
33quit
34])
35
36: ${PIES_TEST_INET_SOCKET:=unix://$PWD/in.sock}
37
38cat > pies.conf <<_EOT
39component in {
40 command "$auxdir/in.test /tmp/in.log";
41 mode inetd;
42 socket "$PIES_TEST_INET_SOCKET";
43 stderr file "$PWD/in.err";
44 max-instances 2;
45 max-instances-message "too many instances running\n";
46}
47component con1 {
48 command "nt $PIES_TEST_INET_SOCKET -i in1 -o con1.out";
49 stderr file "/tmp/con1.err";
50}
51component con2 {
52 command "nt $PIES_TEST_INET_SOCKET -i in2 -o con2.out";
53 stderr file "/tmp/con2.err";
54 flags (disable);
55}
56component con3 {
57 flags (disable);
58 command "nt $PIES_TEST_INET_SOCKET -o con3.out";
59 stderr file "/tmp/con3.err";
60 return-code * {
61 action disable;
62 exec "$abs_top_builddir/src/piesctl --url unix://$PWD/pies.ctl --no-netrc shutdown";
63 }
64}
65_EOT
66
67set -e
68to 10 \
69 pies --foreground --stderr \
70 --config-file control.conf --config-file pies.conf --debug 1 2>errlog
71
72cat con3.out
73],
74[0],
75[too many instances running
76])
77
78AT_CLEANUP

Return to:

Send suggestions and report system problems to the System administrator.