diff options
Diffstat (limited to 'tests/passfd.at')
-rw-r--r-- | tests/passfd.at | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/tests/passfd.at b/tests/passfd.at new file mode 100644 index 0000000..4a685a3 --- /dev/null +++ b/tests/passfd.at | |||
@@ -0,0 +1,57 @@ | |||
1 | # This file is part of GNU pies testsuite. -*- Autotest -*- | ||
2 | # Copyright (C) 2016-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 | AT_SETUP([pass-fd component]) | ||
17 | AT_CHECK([ | ||
18 | PIES_XFAIL_CHECK | ||
19 | PIES_CONTROL_INIT | ||
20 | |||
21 | AT_DATA([input], | ||
22 | [now is | ||
23 | the time | ||
24 | stop | ||
25 | ]) | ||
26 | |||
27 | : ${PIES_TEST_INET_SOCKET:=unix://$PWD/in.sock} | ||
28 | PIES_FD_SOCKET=$PWD/pfd.sock | ||
29 | |||
30 | cat > pies.conf <<_EOT | ||
31 | component pfd { | ||
32 | command "recvfd '$PIES_FD_SOCKET' $auxdir/in.test $PWD/inlog"; | ||
33 | mode pass-fd; | ||
34 | pass-fd-timeout 3; | ||
35 | pass-fd-socket "$PIES_FD_SOCKET"; | ||
36 | socket "$PIES_TEST_INET_SOCKET"; | ||
37 | stderr file "$PWD/log.err"; | ||
38 | } | ||
39 | component controller { | ||
40 | command "nt $PIES_TEST_INET_SOCKET -i input"; | ||
41 | } | ||
42 | _EOT | ||
43 | |||
44 | set -e | ||
45 | to 10 \ | ||
46 | pies --foreground --stderr \ | ||
47 | --config-file control.conf --config-file pies.conf --debug 1 2>errlog | ||
48 | |||
49 | cat inlog | ||
50 | cat log.err >&2 | ||
51 | ], | ||
52 | [0], | ||
53 | [now is | ||
54 | the time | ||
55 | stop | ||
56 | ]) | ||
57 | AT_CLEANUP \ No newline at end of file | ||