readsocket expansion: response caching
[exim.git] / test / scripts / 0000-Basic / 0373
CommitLineData
1cce3af8 1# ${readsocket (Unix domain and IPv4)
59371ea7
PH
2need_ipv4
3#
4exim -be
1950cf85 5connfail cases (no server)
59371ea7
PH
61 >>${readsocket{DIR/test-socket}{QUERY-1\n}}<<
72 ${if exists{DIR/test-socket}\
8 {>>${readsocket{DIR/test-socket}{QUERY-1\n}}<<}\
9 {++ no socket ++}}
10****
11#
12# Note the difference between:
13# >*eof => close the connection
14# *eof => expect to read EOF from client
15#
16server DIR/test-socket 9
17QUERY-1
18>LF>ANSWER-1
19>*eof
20QUERY-2
21>>ANSWER-2
22>*eof
23QUERY-3
24>LF>ANSWER-3
25>*eof
26QUERY-4
27>LF>ANSWER-4
28>*eof
29>>ANSWER-5
30>*eof
31*sleep 1
32>*eof
33>*eof
34QUERY-8
35*sleep 2
36*eof
37QUERY-9
38*sleep 2
39****
40millisleep 500
41exim -be
1950cf85 42unix-socket cases
59371ea7
PH
431 >>${readsocket{DIR/test-socket}{QUERY-1\n}}<<
442 >>${readsocket{DIR/test-socket}{QUERY-2\n}}<<
453 >>${readsocket{DIR/test-socket}{QUERY-3\n}{2s}{*EOL*}}<<
464 >>${readsocket{DIR/test-socket}{QUERY-4\n}{2s}{*EOL*}{sock error}}<<
475 >>${readsocket{DIR/test-socket}{}}<<
486 >>${readsocket{DIR/test-socket}{QUERY-6\n}}<<
497 >>${readsocket{DIR/test-socket}{QUERY-7\n}{1s}{}{sock error}}<<
508 >>${readsocket{DIR/test-socket}{QUERY-8\n}{1s}}<<
519 >>${readsocket{DIR/test-socket}{QUERY-9\n}{1s}{}{sock error}}<<
52****
53server DIR/test-socket
54QUERY-ACL
55*sleep 3
56****
57exim -odq -bs -oMa V4NET.0.0.0
58quit
59****
1cce3af8
PH
60#
61# Tests of IPv4 sockets
62#
8de9db65 63server PORT_S 11
1cce3af8
PH
64QUERY-1
65>LF>ANSWER-1
66>*eof
67QUERY-2
68>>ANSWER-2
69>*eof
70QUERY-3
71>LF>ANSWER-3
72>*eof
73QUERY-4
74>LF>ANSWER-4
75>*eof
76>>ANSWER-5
77>*eof
78*sleep 1
79>*eof
80>*eof
81QUERY-8
82*sleep 2
83*eof
84QUERY-9
85*sleep 2
86*eof
87QUERY-10
88>LF>ANSWER-10
89>*eof
8de9db65
JH
90>LF>ANSWER-11
91>*eof
1cce3af8
PH
92****
93millisleep 500
94exim -be
1950cf85
JH
95ipv4 cases
961 ANSWER-1 >>${readsocket{inet:thisloop:PORT_S}{QUERY-1\n}}<<
972 ANSWER-2 >>${readsocket{inet:127.0.0.1:PORT_S}{QUERY-2\n}}<<
983 ANSWER-3*EOL* >>${readsocket{inet:127.0.0.1:PORT_S}{QUERY-3\n}{2s}{*EOL*}}<<
994 ANSWER-4*EOL* >>${readsocket{inet:127.0.0.1:PORT_S}{QUERY-4\n}{2s}{*EOL*}{sock error}}<<
1005 ANSWER-5 >>${readsocket{inet:127.0.0.1:PORT_S}{}}<<
1016 >>${readsocket{inet:127.0.0.1:PORT_S}{QUERY-6\n}}<<
1027 >>${readsocket{inet:127.0.0.1:PORT_S}{QUERY-7\n}{1s}{}{sock error}}<<
1038 read timed out >>${readsocket{inet:127.0.0.1:PORT_S}{QUERY-8\n}{1s}}<<
1049 sock error >>${readsocket{inet:127.0.0.1:PORT_S}{QUERY-9\n}{1s}{}{sock error}}<<
10510 ANSWER-10\\n >>${readsocket{inet:badloop:PORT_S}{QUERY-10\n}}<<
10611 ANSWER-11 >>${readsocket{inet:thisloop:PORT_S}{QUERY-11\n}{2s:shutdown=no}}<<
1cce3af8 107****
c06ddd66
JH
108#
109exim -be
110crash-regression-check >>${readsocket{inet:127.0.0.1:PORT_N}{}{}}<<
111****
1950cf85
JH
112#
113# Caching of response value
114server DIR/test-socket 3
115QUERY-1
116>LF>ANSWER-1
117>*eof
118QUERY-2
119>LF>ANSWER-2
120>*eof
121QUERY-1
122>LF>ANSWER-1
123>*eof
124****
125millisleep 500
126exim -be
127caching of response value
1281 >>${readsocket{DIR/test-socket}{QUERY-1\n}{5s:cache=yes}}<<
1291+ >>${readsocket{DIR/test-socket}{QUERY-1\n}{5s:cache=yes}}<<
1302 >>${readsocket{DIR/test-socket}{QUERY-2\n}{5s:cache=yes}}<<
1312- >>${readsocket{DIR/test-socket2}{QUERY-2\n}{5s:cache=yes}{}{expected failure}}<<
1321- >>${readsocket{DIR/test-socket2}{QUERY-1\n}{5s:cache=yes}{}{expected failure}}<<
1331+ >>${readsocket{DIR/test-socket}{QUERY-1\n}{5s:cache=yes}}<<
1341- >>${readsocket{DIR/test-socket}{QUERY-1\n}{5s}}<<
135****