blob: ffcccfe4e5666eba6284499c63a3d6599b99a32e [file] [log] [blame]
Roger Meier4d5157d2012-01-09 21:23:19 +00001#!/bin/sh
2#
3# Licensed to the Apache Software Foundation (ASF) under one
4# or more contributor license agreements. See the NOTICE file
5# distributed with this work for additional information
6# regarding copyright ownership. The ASF licenses this file
7# to you under the Apache License, Version 2.0 (the
8# "License"); you may not use this file except in compliance
9# with the License. You may obtain a copy of the License at
10#
11# http://www.apache.org/licenses/LICENSE-2.0
12#
13# Unless required by applicable law or agreed to in writing,
14# software distributed under the License is distributed on an
15# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16# KIND, either express or implied. See the License for the
17# specific language governing permissions and limitations
18# under the License.
19#
20
21# Apache Thrift - integration test suite
22#
23# tests different client-server, protocol and transport combinations
24
25# related issues:
26# THRIFT-847 Test Framework harmonization across all languages
27# THRIFT-819 add Enumeration for protocol, transport and server types
28
Roger Meiercc0fe272014-05-16 23:18:25 +020029START_TIME=$SECONDS
henriqued17f1c92014-04-30 16:21:25 +020030cd "$( dirname "$0" )"
31BASEDIR=$(pwd)
32
Roger Meier4d5157d2012-01-09 21:23:19 +000033print_header() {
Roger Meier76150722014-05-31 22:22:07 +020034 printf "%-16s %-13s %-17s %-s\n" "client-server:" "protocol:" "transport:" "result:"
Roger Meier4d5157d2012-01-09 21:23:19 +000035}
36
Roger Meiercc0fe272014-05-16 23:18:25 +020037STATUS_HTML="status.html"
38
39print_html_header() {
40cat << EOF > $STATUS_HTML
41<!DOCTYPE HTML>
42<html>
43<head>
44<meta charset="utf-8">
45<title>Apache Thrift - integration test suite</title>
46<link rel="stylesheet" type="text/css" href="http://cdn.datatables.net/1.10.0/css/jquery.dataTables.css">
47<script type="text/javascript" charset="utf-8" src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
48<script type="text/javascript" charset="utf-8" src="http://cdn.datatables.net/1.10.0/js/jquery.dataTables.js"></script>
49<script>
50 var test_data;
51 \$(document).ready( function () {
52 testTable = \$('#test_results').DataTable( {
53 data: test_data
54 });
55 \$('#test_results_filter label input')
56 .focus()
57 .val('failure');
58 });
59</script>
60</head>
61<body>
62<h2>Apache Thrift - integration test suite: Results</h2>
63<table id="test_results" class="display">
64 <thead>
65 <tr>
66 <th>Server</th>
67 <th>Client</th>
68 <th>Protocol</th>
69 <th>Transport</th>
70 <th>Result (log)</th>
71 </tr>
72 </thead>
73</table>
74<script>
75test_data = [
76EOF
77}
78
79print_html_footer() {
80duration=$1
81cat << EOF >> $STATUS_HTML
82]
83</script>
84<h2>Test Information</h2>
85<pre>
86Test Date: `date --iso-8601=seconds`
87Revision: `git rev-parse --short HEAD`
88OS: `uname -a`
89Test duration: $duration
90</pre>
91</body>
92</html>
93EOF
94}
95
Roger Meierf42ce2a2013-01-16 22:12:14 +010096intersection() {
97 return_value=""
98 for one in $1; do
99 for two in $2; do
100 if [ ${one} = ${two} ]; then
101 return_value=${return_value}" "${one}
102 fi
103 done;
104 done;
105 echo ${return_value};
106}
107
Roger Meier4d5157d2012-01-09 21:23:19 +0000108do_test () {
109 client_server=$1
110 protocol=$2
111 transport=$3
112 client_exec=$4
113 server_exec=$5
henriqued17f1c92014-04-30 16:21:25 +0200114 client_timeout=$6
115 server_startup_time=$7
Roger Meier4d5157d2012-01-09 21:23:19 +0000116
117 testname=${client_server}_${protocol}_${transport}
henriqued5aba4c2014-04-30 18:11:11 +0200118 server_timeout=$(echo "(${server_startup_time}+${client_timeout})" | bc)
Roger Meier76150722014-05-31 22:22:07 +0200119 printf "%-16s %-13s %-17s" ${client_server} ${protocol} ${transport}
henriqued17f1c92014-04-30 16:21:25 +0200120
Roger Meier284101c2014-03-11 21:20:35 +0100121 timeout $server_timeout $server_exec > log/${testname}_server.log 2>&1 &
henriqued17f1c92014-04-30 16:21:25 +0200122 server_pid=$!
123
Roger Meier4d5157d2012-01-09 21:23:19 +0000124 sleep $server_startup_time
henriqued17f1c92014-04-30 16:21:25 +0200125 timeout $client_timeout $client_exec > log/${testname}_client.log 2>&1
Ben Craigf41d79d2014-01-08 15:15:48 -0600126
Roger Meier4d5157d2012-01-09 21:23:19 +0000127 if [ "$?" -eq "0" ]; then
Roger Meiercc0fe272014-05-16 23:18:25 +0200128 result="success($?)"
129 echo " $result"
Roger Meier4d5157d2012-01-09 21:23:19 +0000130 else
Roger Meiercc0fe272014-05-16 23:18:25 +0200131 result="failure($?)"
132 echo " $result"
Roger Meier4edac7f2014-05-02 21:07:01 +0200133 # add details to the error.log
134 print_header >> log/error.log
135 printf "%-16s %-11s %-17s\n" ${client_server} ${protocol} ${transport} >> log/error.log
136 echo "=================== server message ===================" >> log/error.log
137 tail log/${testname}_server.log >> log/error.log
138 echo "=================== client message ===================" >> log/error.log
139 tail log/${testname}_client.log >> log/error.log
140 echo "======================================================" >> log/error.log
141 echo "" >> log/error.log
Roger Meier4d5157d2012-01-09 21:23:19 +0000142 fi
henriqued17f1c92014-04-30 16:21:25 +0200143
henriquead4df162014-05-20 13:18:45 +0200144 # split client-server string
145 client=${client_server%-*}
146 server=${client_server#*-}
Roger Meiercc0fe272014-05-16 23:18:25 +0200147
148 cat << EOF >> $STATUS_HTML
149 [
Roger Meiercc0fe272014-05-16 23:18:25 +0200150 "${server}",
Roger Meierc62798b2014-05-23 12:54:08 +0200151 "${client}",
Roger Meiercc0fe272014-05-16 23:18:25 +0200152 "${protocol}",
153 "${transport}",
154 "${result} (<a href=\"log/${testname}_client.log\">client</a>, <a href=\"log/${testname}_server.log\">server</a>)"
155 ],
156EOF
157
henriqued17f1c92014-04-30 16:21:25 +0200158 # silently kill server
159 kill ${server_pid} 2>/dev/null && wait ${server_pid} 2>/dev/null
Roger Meier4d5157d2012-01-09 21:23:19 +0000160}
161
162echo "Apache Thrift - integration test suite"
163date
henriqued17f1c92014-04-30 16:21:25 +0200164
henriqued17f1c92014-04-30 16:21:25 +0200165
Roger Meier4d5157d2012-01-09 21:23:19 +0000166echo "======================================================"
167
168rm -rf log
169mkdir -p log
170
Roger Meiercc0fe272014-05-16 23:18:25 +0200171
Roger Meier4d5157d2012-01-09 21:23:19 +0000172print_header
Roger Meiercc0fe272014-05-16 23:18:25 +0200173print_html_header
174
175ant -f ../lib/java/build.xml compile-test 1>/dev/null
176
Roger Meier4d5157d2012-01-09 21:23:19 +0000177
Roger Meier82525772012-11-16 00:38:27 +0000178#TODO add enum for parameters
179#TODO align program arguments across languages
Roger Meier4d5157d2012-01-09 21:23:19 +0000180
Roger Meier023192f2014-02-12 09:35:12 +0100181cpp_protocols="binary compact json"
182java_protocols="binary compact json"
Roger Meierf42ce2a2013-01-16 22:12:14 +0100183cpp_transports="buffered framed http"
184java_server_transports="buffered framed fastframed"
185java_client_transports=${java_server_transports}" http"
Roger Meier5829a2c2014-04-08 00:28:17 +0200186cpp_sockets="ip domain ip-ssl"
Roger Meierf42ce2a2013-01-16 22:12:14 +0100187java_sockets="ip ip-ssl"
188# TODO fastframed java transport is another implementation of framed transport
Roger Meier4d5157d2012-01-09 21:23:19 +0000189
Roger Meierd9b331d2014-05-25 22:59:17 +0200190nodejs_protocols="binary compact json"
Roger Meier8909cbd2014-01-26 11:44:27 +0100191nodejs_transports="buffered framed"
Roger Meier57b354b2014-02-22 01:01:58 +0100192nodejs_sockets="ip ip-ssl"
Roger Meiereaa61d82012-01-12 21:38:29 +0000193
Jens Geyerc1d79432014-04-22 22:52:43 +0200194csharp_protocols="binary compact json"
195csharp_transports="buffered framed"
196csharp_sockets="ip ip-ssl"
197
Roger Meier72268b72014-05-28 23:03:57 +0200198py_protocols="binary compact json accel"
Roger Meier76150722014-05-31 22:22:07 +0200199py_transports="buffered framed"
200py_sockets="ip ip-ssl"
Roger Meier72268b72014-05-28 23:03:57 +0200201
Roger Meiera3570ac2014-06-10 22:16:14 +0200202ruby_protocols="binary compact json accel"
203ruby_transports="buffered framed"
204ruby_sockets="ip"
205
Roger Meierf42ce2a2013-01-16 22:12:14 +0100206
207######### java client - java server #############
208for proto in $java_protocols; do
209 for trans in $java_server_transports; do
210 for sock in $java_sockets; do
211 case "$sock" in
212 "ip" ) extraparam="";;
213 "ip-ssl" ) extraparam="--ssl";;
214 esac
215 do_test "java-java" "${proto}" "${trans}-${sock}" \
henriqued5aba4c2014-04-30 18:11:11 +0200216 "ant -f ../lib/java/build.xml -Dno-gen-thrift=\"\" -Dtestargs \"--protocol=${proto} --transport=${trans} ${extraparam}\" run-testclient" \
217 "ant -f ../lib/java/build.xml -Dno-gen-thrift=\"\" -Dtestargs \"--protocol=${proto} --transport=${trans} ${extraparam}\" run-testserver" \
218 "5" "1"
Roger Meierf42ce2a2013-01-16 22:12:14 +0100219 done
220 done
221done
222
223######### cpp client - cpp server ###############
224for proto in $cpp_protocols; do
225 for trans in $cpp_transports; do
226 for sock in $cpp_sockets; do
Roger Meier4d5157d2012-01-09 21:23:19 +0000227 case "$sock" in
228 "ip" ) extraparam="";;
229 "ip-ssl" ) extraparam="--ssl";;
230 "domain" ) extraparam="--domain-socket=/tmp/ThriftTest.thrift";;
231 esac
232 do_test "cpp-cpp" "${proto}" "${trans}-${sock}" \
233 "cpp/TestClient --protocol=${proto} --transport=${trans} ${extraparam}" \
234 "cpp/TestServer --protocol=${proto} --transport=${trans} ${extraparam}" \
henriqued5aba4c2014-04-30 18:11:11 +0200235 "2" "0.1"
Roger Meierf42ce2a2013-01-16 22:12:14 +0100236 done
237 done
238done
239
henriqued17f1c92014-04-30 16:21:25 +0200240
Roger Meierf42ce2a2013-01-16 22:12:14 +0100241######### java client - cpp server ##############
242# warning: ssl over http is not supported in java client!
243for proto in $(intersection "${java_protocols}" "${cpp_protocols}"); do
244 for trans in $(intersection "${java_client_transports}" "${cpp_transports}"); do
245 for sock in $(intersection "${java_sockets}" "${cpp_sockets}"); do
246 case "$sock" in
247 "ip" ) extraparam="";;
248 "ip-ssl" ) extraparam="--ssl";;
249 esac
Roger Meier188024e2014-04-17 21:53:45 +0200250 do_test "java-cpp" "${proto}" "${trans}-${sock}" \
henriqued5aba4c2014-04-30 18:11:11 +0200251 "ant -f ../lib/java/build.xml -Dno-gen-thrift=\"\" -Dtestargs \"--protocol=${proto} --transport=${trans} ${extraparam}\" run-testclient" \
Roger Meierf42ce2a2013-01-16 22:12:14 +0100252 "cpp/TestServer --protocol=${proto} --transport=${trans} ${extraparam}"\
henriqued5aba4c2014-04-30 18:11:11 +0200253 "5" "0.1"
Roger Meierf42ce2a2013-01-16 22:12:14 +0100254 done
255 done
256done
257
258######### cpp client - java server ##############
259for proto in $(intersection "${cpp_protocols}" "${java_protocols}"); do
260 for trans in $(intersection "${cpp_transports}" "${java_server_transports}"); do
261 for sock in $(intersection "${java_sockets}" "${cpp_sockets}"); do
262 case "$sock" in
263 "ip" ) extraparam="";;
264 "ip-ssl" ) extraparam="--ssl";;
265 esac
Roger Meier188024e2014-04-17 21:53:45 +0200266 do_test "cpp-java" "${proto}" "${trans}-${sock}" \
267 "cpp/TestClient --protocol=${proto} --transport=${trans} ${extraparam}" \
henriqued5aba4c2014-04-30 18:11:11 +0200268 "ant -f ../lib/java/build.xml -Dno-gen-thrift=\"\" -Dtestargs \"--protocol=${proto} --transport=${trans} ${extraparam}\" run-testserver" \
269 "5" "1"
Roger Meierf42ce2a2013-01-16 22:12:14 +0100270 done
271 done
272done
Roger Meier4d5157d2012-01-09 21:23:19 +0000273
Roger Meier8909cbd2014-01-26 11:44:27 +0100274
henriqued17f1c92014-04-30 16:21:25 +0200275NODE_TEST_DIR=${BASEDIR}/../lib/nodejs/test
Roger Meier8909cbd2014-01-26 11:44:27 +0100276export NODE_PATH=${NODE_TEST_DIR}:${NODE_TEST_DIR}/../lib:${NODE_PATH}
Roger Meierd9b331d2014-05-25 22:59:17 +0200277######### nodejs client - nodejs server ##############
Roger Meierd9b331d2014-05-25 22:59:17 +0200278for proto in ${nodejs_protocols}; do
279 for trans in ${nodejs_transports}; do
280 for sock in ${nodejs_sockets}; do
281 case "$sock" in
282 "ip" ) extraparam="";;
283 "ip-ssl" ) extraparam="--ssl";;
284 esac
285 do_test "nodejs-nodejs" "${proto}" "${trans}-${sock}" \
286 "node ${NODE_TEST_DIR}/client.js -p ${proto} -t ${trans} ${extraparam}" \
287 "node ${NODE_TEST_DIR}/server.js -p ${proto} -t ${trans} ${extraparam}" \
288 "5" "0.2"
289 done
290 done
291done
henriqued5aba4c2014-04-30 18:11:11 +0200292
Roger Meier8909cbd2014-01-26 11:44:27 +0100293######### nodejs client - cpp server ##############
Roger Meier8909cbd2014-01-26 11:44:27 +0100294for proto in $(intersection "${nodejs_protocols}" "${cpp_protocols}"); do
295 for trans in $(intersection "${nodejs_transports}" "${cpp_transports}"); do
296 for sock in $(intersection "${nodejs_sockets}" "${cpp_sockets}"); do
Roger Meier57b354b2014-02-22 01:01:58 +0100297 case "$sock" in
298 "ip" ) extraparam="";;
299 "ip-ssl" ) extraparam="--ssl";;
300 esac
henriqued17f1c92014-04-30 16:21:25 +0200301 do_test "nodejs-cpp" "${proto}" "${trans}-${sock}" \
302 "node ${NODE_TEST_DIR}/client.js -p ${proto} -t ${trans} ${extraparam}" \
Roger Meier8909cbd2014-01-26 11:44:27 +0100303 "cpp/TestServer --protocol=${proto} --transport=${trans} ${extraparam}" \
henriqued5aba4c2014-04-30 18:11:11 +0200304 "5" "0.2"
Roger Meier8909cbd2014-01-26 11:44:27 +0100305 done
306 done
307done
308
309######### cpp client - nodejs server ##############
310for proto in $(intersection "${nodejs_protocols}" "${cpp_protocols}"); do
311 for trans in $(intersection "${nodejs_transports}" "${cpp_transports}"); do
312 for sock in $(intersection "${nodejs_sockets}" "${cpp_sockets}"); do
Roger Meier57b354b2014-02-22 01:01:58 +0100313 case "$sock" in
314 "ip" ) extraparam="";;
315 "ip-ssl" ) extraparam="--ssl";;
316 esac
henriqued17f1c92014-04-30 16:21:25 +0200317 do_test "cpp-nodejs" "${proto}" "${trans}-${sock}" \
Roger Meier57b354b2014-02-22 01:01:58 +0100318 "cpp/TestClient --protocol=${proto} --transport=${trans} ${extraparam}" \
henriqued17f1c92014-04-30 16:21:25 +0200319 "node ${NODE_TEST_DIR}/server.js -p ${proto} -t ${trans} ${extraparam}" \
henriqued5aba4c2014-04-30 18:11:11 +0200320 "5" "2"
Roger Meier8909cbd2014-01-26 11:44:27 +0100321 done
322 done
323done
324
Roger Meier5c6ad242014-05-27 21:18:00 +0200325######### nodejs client - java server ##############
Roger Meier5c6ad242014-05-27 21:18:00 +0200326for proto in $(intersection "${nodejs_protocols}" "${java_protocols}"); do
327 for trans in $(intersection "${nodejs_transports}" "${java_server_transports}"); do
328 for sock in $(intersection "${nodejs_sockets}" "${java_sockets}"); do
329 case "$sock" in
330 "ip" ) extraparam="";;
331 "ip-ssl" ) extraparam="--ssl";;
332 esac
333 do_test "nodejs-java" "${proto}" "${trans}-${sock}" \
334 "node ${NODE_TEST_DIR}/client.js -p ${proto} -t ${trans} ${extraparam}" \
335 "ant -f ../lib/java/build.xml -Dno-gen-thrift=\"\" -Dtestargs \"--protocol=${proto} --transport=${trans} ${extraparam}\" run-testserver" \
336 "5" "1"
337 done
338 done
339done
340
341######### java client - nodejs server ##############
342for proto in $(intersection "${nodejs_protocols}" "${java_protocols}"); do
343 for trans in $(intersection "${nodejs_transports}" "${java_client_transports}"); do
344 for sock in $(intersection "${nodejs_sockets}" "${java_sockets}"); do
345 case "$sock" in
346 "ip" ) extraparam="";;
347 "ip-ssl" ) extraparam="--ssl";;
348 esac
349 do_test "java-nodejs" "${proto}" "${trans}-${sock}" \
350 "ant -f ../lib/java/build.xml -Dno-gen-thrift=\"\" -Dtestargs \"--protocol=${proto} --transport=${trans} ${extraparam}\" run-testclient" \
351 "node ${NODE_TEST_DIR}/server.js -p ${proto} -t ${trans} ${extraparam}" \
352 "5" "2"
353 done
354 done
355done
356
Roger Meier72268b72014-05-28 23:03:57 +0200357######### py client - py server ##############
358for proto in ${py_protocols}; do
359 for trans in ${py_transports}; do
360 for sock in ${py_sockets}; do
361 case "$sock" in
362 "ip" ) extraparam="";;
363 "ip-ssl" ) extraparam="--ssl";;
364 esac
365 do_test "py-py" "${proto}" "${trans}-${sock}" \
Roger Meier76150722014-05-31 22:22:07 +0200366 "py/TestClient.py --protocol=${proto} --transport={trans} --port=9090 --host=localhost --genpydir=py/gen-py ${extraparam}" \
367 "py/TestServer.py --protocol=${proto} --transport={trans} --port=9090 --genpydir=py/gen-py TSimpleServer ${extraparam}" \
Roger Meier72268b72014-05-28 23:03:57 +0200368 "10" "2"
369 done
370 done
371done
372
Roger Meier76150722014-05-31 22:22:07 +0200373for trans in ${py_transports}; do
374 for sock in ${py_sockets}; do
375 case "$sock" in
376 "ip" ) extraparam="";;
377 "ip-ssl" ) extraparam="--ssl";;
378 esac
379 do_test "py-py" "accel-binary" "${trans}-${sock}" \
380 "py/TestClient.py --protocol=accel --transport=${trans} --port=9090 --host=localhost --genpydir=py/gen-py ${extraparam}" \
381 "py/TestServer.py --protocol=binary --transport=${trans} --port=9090 --genpydir=py/gen-py TSimpleServer ${extraparam}" \
382 "10" "2"
383 do_test "py-py" "binary-accel" "${trans}-${sock}" \
384 "py/TestClient.py --protocol=binary --transport={trans} --port=9090 --host=localhost --genpydir=py/gen-py ${extraparam}" \
385 "py/TestServer.py --protocol=accel --transport={trans} --port=9090 --genpydir=py/gen-py TSimpleServer ${extraparam}" \
386 "10" "2"
387 done
388 done
389
Roger Meier72268b72014-05-28 23:03:57 +0200390######### py client - cpp server ##############
391for proto in $(intersection "${cpp_protocols}" "${py_protocols}"); do
392 for trans in $(intersection "${cpp_transports}" "${py_transports}"); do
393 for sock in $(intersection "${cpp_sockets}" "${py_sockets}"); do
394 case "$sock" in
395 "ip" ) extraparam="";;
396 "ip-ssl" ) extraparam="--ssl";;
397 esac
398 do_test "py-cpp" "${proto}" "${trans}-${sock}" \
Roger Meier76150722014-05-31 22:22:07 +0200399 "py/TestClient.py --protocol=${proto} --transport=${trans} --port=9090 --host=localhost --genpydir=py/gen-py ${extraparam}" \
Roger Meier72268b72014-05-28 23:03:57 +0200400 "cpp/TestServer --protocol=${proto} --transport=${trans} ${extraparam}" \
401 "10" "2"
402 done
403 done
404done
405
Roger Meier76150722014-05-31 22:22:07 +0200406for trans in $(intersection "${cpp_transports}" "${py_transports}"); do
407 for sock in $(intersection "${cpp_sockets}" "${py_sockets}"); do
408 case "$sock" in
409 "ip" ) extraparam="";;
410 "ip-ssl" ) extraparam="--ssl";;
411 esac
412 do_test "py-cpp" "accel-binary" "${trans}-${sock}" \
413 "py/TestClient.py --protocol=accel --transport=${trans} --port=9090 --host=localhost --genpydir=py/gen-py ${extraparam}" \
414 "cpp/TestServer --protocol=binary --transport=${trans} ${extraparam}" \
415 "10" "2"
416 done
417 done
418
Roger Meier72268b72014-05-28 23:03:57 +0200419######### cpp client - py server ##############
420for proto in $(intersection "${cpp_protocols}" "${py_protocols}"); do
421 for trans in $(intersection "${cpp_transports}" "${py_transports}"); do
422 for sock in $(intersection "${cpp_sockets}" "${py_sockets}"); do
423 case "$sock" in
424 "ip" ) extraparam="";;
425 "ip-ssl" ) extraparam="--ssl";;
426 esac
427 do_test "cpp-py" "${proto}" "${trans}-${sock}" \
428 "cpp/TestClient --protocol=${proto} --transport=${trans} ${extraparam}" \
Roger Meier76150722014-05-31 22:22:07 +0200429 "py/TestServer.py --protocol=${proto} --transport=${trans} --port=9090 --genpydir=py/gen-py TSimpleServer ${extraparam}" \
Roger Meier72268b72014-05-28 23:03:57 +0200430 "10" "2"
431 done
432 done
433done
434
Roger Meier76150722014-05-31 22:22:07 +0200435for trans in $(intersection "${cpp_transports}" "${py_transports}"); do
436 for sock in $(intersection "${cpp_sockets}" "${py_sockets}"); do
437 case "$sock" in
438 "ip" ) extraparam="";;
439 "ip-ssl" ) extraparam="--ssl";;
440 esac
441 do_test "cpp-py" "binary-accel" "${trans}-${sock}" \
442 "cpp/TestClient --protocol=binary --transport=${trans} ${extraparam}" \
443 "py/TestServer.py --protocol=accel --transport=${trans} --port=9090 --genpydir=py/gen-py TSimpleServer ${extraparam}" \
444 "10" "2"
445 done
446 done
447
Roger Meier72268b72014-05-28 23:03:57 +0200448######### py client - java server ##############
Roger Meier72268b72014-05-28 23:03:57 +0200449for proto in $(intersection "${py_protocols}" "${java_protocols}"); do
450 for trans in $(intersection "${py_transports}" "${java_server_transports}"); do
451 for sock in $(intersection "${py_sockets}" "${java_sockets}"); do
452 case "$sock" in
453 "ip" ) extraparam="";;
454 "ip-ssl" ) extraparam="--ssl";;
455 esac
456 do_test "py-java" "${proto}" "${trans}-${sock}" \
Roger Meier76150722014-05-31 22:22:07 +0200457 "py/TestClient.py --protocol=${proto} --transport=${trans} --port=9090 --host=localhost --genpydir=py/gen-py ${extraparam}" \
Roger Meier72268b72014-05-28 23:03:57 +0200458 "ant -f ../lib/java/build.xml -Dno-gen-thrift=\"\" -Dtestargs \"--protocol=${proto} --transport=${trans} ${extraparam}\" run-testserver" \
459 "15" "2"
460 done
461 done
462done
463
Roger Meier76150722014-05-31 22:22:07 +0200464for trans in $(intersection "${py_transports}" "${java_server_transports}"); do
465 for sock in $(intersection "${py_sockets}" "${java_sockets}"); do
466 case "$sock" in
467 "ip" ) extraparam="";;
468 "ip-ssl" ) extraparam="--ssl";;
469 esac
470 do_test "py-java" "accel-binary" "${trans}-${sock}" \
471 "py/TestClient.py --protocol=accel --transport=${trans} --port=9090 --host=localhost --genpydir=py/gen-py ${extraparam}" \
472 "ant -f ../lib/java/build.xml -Dno-gen-thrift=\"\" -Dtestargs \"--protocol=binary --transport=${trans} ${extraparam}\" run-testserver" \
473 "15" "2"
474 done
475 done
476
Roger Meier72268b72014-05-28 23:03:57 +0200477######### java client - py server ##############
478for proto in $(intersection "${py_protocols}" "${java_protocols}"); do
479 for trans in $(intersection "${py_transports}" "${java_client_transports}"); do
480 for sock in $(intersection "${py_sockets}" "${java_sockets}"); do
481 case "$sock" in
482 "ip" ) extraparam="";;
483 "ip-ssl" ) extraparam="--ssl";;
484 esac
485 do_test "java-py" "${proto}" "${trans}-${sock}" \
486 "ant -f ../lib/java/build.xml -Dno-gen-thrift=\"\" -Dtestargs \"--protocol=${proto} --transport=${trans} ${extraparam}\" run-testclient" \
Roger Meier76150722014-05-31 22:22:07 +0200487 "py/TestServer.py --protocol=${proto} --transport=${trans} --port=9090 --genpydir=py/gen-py TSimpleServer ${extraparam}" \
Roger Meier72268b72014-05-28 23:03:57 +0200488 "10" "5"
489 done
490 done
491done
492
Roger Meier76150722014-05-31 22:22:07 +0200493for trans in $(intersection "${py_transports}" "${java_client_transports}"); do
494 for sock in $(intersection "${py_sockets}" "${java_sockets}"); do
495 case "$sock" in
496 "ip" ) extraparam="";;
497 "ip-ssl" ) extraparam="--ssl";;
498 esac
499 do_test "java-py" "binary-accel" "${trans}-${sock}" \
500 "ant -f ../lib/java/build.xml -Dno-gen-thrift=\"\" -Dtestargs \"--protocol=binary --transport=${trans} ${extraparam}\" run-testclient" \
501 "py/TestServer.py --protocol=accel --transport=${trans} --port=9090 --genpydir=py/gen-py TSimpleServer ${extraparam}" \
502 "10" "5"
503 done
504 done
505
Roger Meier72268b72014-05-28 23:03:57 +0200506######### py client - nodejs server ##############
Roger Meier72268b72014-05-28 23:03:57 +0200507for proto in $(intersection "${py_protocols}" "${nodejs_protocols}"); do
508 for trans in $(intersection "${py_transports}" "${nodejs_transports}"); do
509 for sock in $(intersection "${py_sockets}" "${nodejs_sockets}"); do
510 case "$sock" in
511 "ip" ) extraparam="";;
512 "ip-ssl" ) extraparam="--ssl";;
513 esac
514 do_test "py-nodejs" "${proto}" "${trans}-${sock}" \
Roger Meier76150722014-05-31 22:22:07 +0200515 "py/TestClient.py --protocol=${proto} --transport=${trans} --port=9090 --host=localhost --genpydir=py/gen-py ${extraparam}" \
Roger Meier72268b72014-05-28 23:03:57 +0200516 "node ${NODE_TEST_DIR}/server.js -p ${proto} -t ${trans} ${extraparam}" \
517 "15" "2"
518 done
519 done
520done
521
Roger Meier76150722014-05-31 22:22:07 +0200522for trans in $(intersection "${py_transports}" "${nodejs_transports}"); do
523 for sock in $(intersection "${py_sockets}" "${nodejs_sockets}"); do
524 case "$sock" in
525 "ip" ) extraparam="";;
526 "ip-ssl" ) extraparam="--ssl";;
527 esac
528 do_test "py-nodejs" "${proto}" "${trans}-${sock}" \
529 "py/TestClient.py --protocol=accel --transport=${trans} --port=9090 --host=localhost --genpydir=py/gen-py ${extraparam}" \
530 "node ${NODE_TEST_DIR}/server.js -p binary -t ${trans} ${extraparam}" \
531 "15" "2"
532 done
533 done
534
Roger Meier72268b72014-05-28 23:03:57 +0200535######### nodejs client - py server ##############
536for proto in $(intersection "${py_protocols}" "${nodejs_protocols}"); do
537 for trans in $(intersection "${py_transports}" "${nodejs_transports}"); do
538 for sock in $(intersection "${py_sockets}" "${nodejs_sockets}"); do
539 case "$sock" in
540 "ip" ) extraparam="";;
541 "ip-ssl" ) extraparam="--ssl";;
542 esac
543 do_test "nodejs-py" "${proto}" "${trans}-${sock}" \
544 "node ${NODE_TEST_DIR}/client.js -p ${proto} -t ${trans} ${extraparam}" \
Roger Meier76150722014-05-31 22:22:07 +0200545 "py/TestServer.py --protocol=${proto} --transport=${trans} --port=9090 --genpydir=py/gen-py TSimpleServer ${extraparam}" \
Roger Meier72268b72014-05-28 23:03:57 +0200546 "10" "2"
547 done
548 done
549done
550
Roger Meier76150722014-05-31 22:22:07 +0200551for trans in $(intersection "${py_transports}" "${nodejs_transports}"); do
552 for sock in $(intersection "${py_sockets}" "${nodejs_sockets}"); do
553 case "$sock" in
554 "ip" ) extraparam="";;
555 "ip-ssl" ) extraparam="--ssl";;
556 esac
557 do_test "nodejs-py" "binary-accel" "${trans}-${sock}" \
558 "node ${NODE_TEST_DIR}/client.js -p binary -t ${trans} ${extraparam}" \
559 "py/TestServer.py --protocol=accel --transport=${trans} --port=9090 --genpydir=py/gen-py TSimpleServer ${extraparam}" \
560 "10" "2"
561 done
562 done
563
Roger Meiera3570ac2014-06-10 22:16:14 +0200564######### ruby client - ruby server ##############
565for proto in ${ruby_protocols}; do
566 for trans in ${ruby_transports}; do
567 for sock in ${ruby_sockets}; do
568 case "$sock" in
569 "ip" ) extraparam="";;
570 "ip-ssl" ) extraparam="--ssl";;
571 esac
572 do_test "ruby-ruby" "${proto}" "${trans}-${sock}" \
573 "ruby rb/integration/TestClient.rb --protocol=${proto} --transport=${trans} --port=9091" \
574 "ruby rb/integration/TestServer.rb --protocol=${proto} --transport=${trans} --port=9091" \
575 "5" "5"
576 done
577 done
578done
579
580for trans in ${ruby_transports}; do
581 for sock in ${ruby_sockets}; do
582 case "$sock" in
583 "ip" ) extraparam="";;
584 "ip-ssl" ) extraparam="--ssl";;
585 esac
586 do_test "ruby-ruby" "accel-binary" "${trans}-${sock}" \
587 "ruby rb/integration/TestClient.rb --protocol=accel --transport=${trans} --port=9091" \
588 "ruby rb/integration/TestServer.rb --protocol=binary --transport=${trans} --port=9091" \
589 "5" "5"
590 do_test "ruby-ruby" "binary-accel" "${trans}-${sock}" \
591 "ruby rb/integration/TestClient.rb --protocol=binary --transport=${trans} --port=9091" \
592 "ruby rb/integration/TestServer.rb --protocol=accel --transport=${trans} --port=9091" \
593 "5" "5"
594 done
595 done
596
597######### ruby client - cpp server ##############
598for proto in $(intersection "${cpp_protocols}" "${ruby_protocols}"); do
599 for trans in $(intersection "${cpp_transports}" "${ruby_transports}"); do
600 for sock in $(intersection "${cpp_sockets}" "${ruby_sockets}"); do
601 case "$sock" in
602 "ip" ) extraparam="";;
603 "ip-ssl" ) extraparam="--ssl";;
604 esac
605 do_test "ruby-cpp" "${proto}" "${trans}-${sock}" \
606 "ruby rb/integration/TestClient.rb --protocol=${proto} --transport=${trans}" \
607 "cpp/TestServer --protocol=${proto} --transport=${trans} ${extraparam}" \
608 "5" "5"
609 done
610 done
611done
612
613for trans in $(intersection "${cpp_transports}" "${ruby_transports}"); do
614 for sock in $(intersection "${cpp_sockets}" "${ruby_sockets}"); do
615 case "$sock" in
616 "ip" ) extraparam="";;
617 "ip-ssl" ) extraparam="--ssl";;
618 esac
619 do_test "ruby-cpp" "accel-binary" "${trans}-${sock}" \
620 "ruby rb/integration/TestClient.rb --protocol=accel --transport=${trans}" \
621 "cpp/TestServer --protocol=binary --transport=${trans} ${extraparam}" \
622 "5" "5"
623 done
624 done
625
626######### cpp client - ruby server ##############
627for proto in $(intersection "${cpp_protocols}" "${ruby_protocols}"); do
628 for trans in $(intersection "${cpp_transports}" "${ruby_transports}"); do
629 for sock in $(intersection "${cpp_sockets}" "${ruby_sockets}"); do
630 case "$sock" in
631 "ip" ) extraparam="";;
632 "ip-ssl" ) extraparam="--ssl";;
633 esac
634 do_test "cpp-ruby" "${proto}" "${trans}-${sock}" \
635 "cpp/TestClient --protocol=${proto} --transport=${trans} ${extraparam}" \
636 "ruby rb/integration/TestServer.rb --protocol=${proto} --transport=${trans}" \
637 "5" "5"
638 done
639 done
640done
641
642for trans in $(intersection "${cpp_transports}" "${ruby_transports}"); do
643 for sock in $(intersection "${cpp_sockets}" "${ruby_sockets}"); do
644 case "$sock" in
645 "ip" ) extraparam="";;
646 "ip-ssl" ) extraparam="--ssl";;
647 esac
648 do_test "cpp-ruby" "binary-accel" "${trans}-${sock}" \
649 "cpp/TestClient --protocol=binary --transport=${trans} ${extraparam}" \
650 "ruby rb/integration/TestServer.rb --protocol=accel --transport=${trans}" \
651 "5" "5"
652 done
653 done
654
655######### ruby client - java server ##############
656for proto in $(intersection "${ruby_protocols}" "${java_protocols}"); do
657 for trans in $(intersection "${ruby_transports}" "${java_server_transports}"); do
658 for sock in $(intersection "${ruby_sockets}" "${java_sockets}"); do
659 case "$sock" in
660 "ip" ) extraparam="";;
661 "ip-ssl" ) extraparam="--ssl";;
662 esac
663 do_test "ruby-java" "${proto}" "${trans}-${sock}" \
664 "ruby rb/integration/TestClient.rb --protocol=${proto} --transport=${trans}" \
665 "ant -f ../lib/java/build.xml -Dno-gen-thrift=\"\" -Dtestargs \"--protocol=${proto} --transport=${trans} ${extraparam}\" run-testserver" \
666 "15" "5"
667 done
668 done
669done
670
671for trans in $(intersection "${ruby_transports}" "${java_server_transports}"); do
672 for sock in $(intersection "${ruby_sockets}" "${java_sockets}"); do
673 case "$sock" in
674 "ip" ) extraparam="";;
675 "ip-ssl" ) extraparam="--ssl";;
676 esac
677 do_test "ruby-java" "accel-binary" "${trans}-${sock}" \
678 "ruby rb/integration/TestClient.rb --protocol=accel --transport=${trans}" \
679 "ant -f ../lib/java/build.xml -Dno-gen-thrift=\"\" -Dtestargs \"--protocol=binary --transport=${trans} ${extraparam}\" run-testserver" \
680 "15" "5"
681 done
682 done
683
684######### java client - ruby server ##############
685for proto in $(intersection "${ruby_protocols}" "${java_protocols}"); do
686 for trans in $(intersection "${ruby_transports}" "${java_client_transports}"); do
687 for sock in $(intersection "${ruby_sockets}" "${java_sockets}"); do
688 case "$sock" in
689 "ip" ) extraparam="";;
690 "ip-ssl" ) extraparam="--ssl";;
691 esac
692 do_test "java-ruby" "${proto}" "${trans}-${sock}" \
693 "ant -f ../lib/java/build.xml -Dno-gen-thrift=\"\" -Dtestargs \"--protocol=${proto} --transport=${trans} ${extraparam}\" run-testclient" \
694 "ruby rb/integration/TestServer.rb --protocol=${proto} --transport=${trans}" \
695 "10" "5"
696 done
697 done
698done
699
700for trans in $(intersection "${ruby_transports}" "${java_client_transports}"); do
701 for sock in $(intersection "${ruby_sockets}" "${java_sockets}"); do
702 case "$sock" in
703 "ip" ) extraparam="";;
704 "ip-ssl" ) extraparam="--ssl";;
705 esac
706 do_test "java-ruby" "binary-accel" "${trans}-${sock}" \
707 "ant -f ../lib/java/build.xml -Dno-gen-thrift=\"\" -Dtestargs \"--protocol=binary --transport=${trans} ${extraparam}\" run-testclient" \
708 "ruby rb/integration/TestServer.rb --protocol=accel --transport=${trans}" \
709 "10" "5"
710 done
711 done
712
713######### ruby client - nodejs server ##############
714for proto in $(intersection "${ruby_protocols}" "${nodejs_protocols}"); do
715 for trans in $(intersection "${ruby_transports}" "${nodejs_transports}"); do
716 for sock in $(intersection "${ruby_sockets}" "${nodejs_sockets}"); do
717 case "$sock" in
718 "ip" ) extraparam="";;
719 "ip-ssl" ) extraparam="--ssl";;
720 esac
721 do_test "ruby-nodejs" "${proto}" "${trans}-${sock}" \
722 "ruby rb/integration/TestClient.rb --protocol=${proto} --transport=${trans}" \
723 "node ${NODE_TEST_DIR}/server.js -p ${proto} -t ${trans} ${extraparam}" \
724 "5" "2"
725 done
726 done
727done
728
729for trans in $(intersection "${ruby_transports}" "${nodejs_transports}"); do
730 for sock in $(intersection "${ruby_sockets}" "${nodejs_sockets}"); do
731 case "$sock" in
732 "ip" ) extraparam="";;
733 "ip-ssl" ) extraparam="--ssl";;
734 esac
735 do_test "ruby-nodejs" "${proto}" "${trans}-${sock}" \
736 "ruby rb/integration/TestClient.rb --protocol=accel --transport=${trans}" \
737 "node ${NODE_TEST_DIR}/server.js -p binary -t ${trans} ${extraparam}" \
738 "5" "2"
739 done
740 done
741
742######### nodejs client - ruby server ##############
743for proto in $(intersection "${ruby_protocols}" "${nodejs_protocols}"); do
744 for trans in $(intersection "${ruby_transports}" "${nodejs_transports}"); do
745 for sock in $(intersection "${ruby_sockets}" "${nodejs_sockets}"); do
746 case "$sock" in
747 "ip" ) extraparam="";;
748 "ip-ssl" ) extraparam="--ssl";;
749 esac
750 do_test "nodejs-ruby" "${proto}" "${trans}-${sock}" \
751 "node ${NODE_TEST_DIR}/client.js -p ${proto} -t ${trans} ${extraparam}" \
752 "ruby rb/integration/TestServer.rb --protocol=${proto} --transport=${trans}" \
753 "10" "5"
754 done
755 done
756done
757
758for trans in $(intersection "${ruby_transports}" "${nodejs_transports}"); do
759 for sock in $(intersection "${ruby_sockets}" "${nodejs_sockets}"); do
760 case "$sock" in
761 "ip" ) extraparam="";;
762 "ip-ssl" ) extraparam="--ssl";;
763 esac
764 do_test "nodejs-ruby" "binary-accel" "${trans}-${sock}" \
765 "node ${NODE_TEST_DIR}/client.js -p binary -t ${trans} ${extraparam}" \
766 "ruby rb/integration/TestServer.rb --protocol=accel --transport=${trans}" \
767 "10" "2"
768 done
769 done
770
771 ######### py client - ruby server ##############
772for proto in $(intersection "${py_protocols}" "${ruby_protocols}"); do
773 for trans in $(intersection "${py_transports}" "${ruby_transports}"); do
774 for sock in $(intersection "${py_sockets}" "${ruby_sockets}"); do
775 case "$sock" in
776 "ip" ) extraparam="";;
777 "ip-ssl" ) extraparam="--ssl";;
778 esac
779 do_test "py-ruby" "${proto}" "${trans}-${sock}" \
780 "py/TestClient.py --protocol=${proto} --transport=${trans} --port=9090 --host=localhost --genpydir=py/gen-py ${extraparam}" \
781 "ruby rb/integration/TestServer.rb --protocol=${proto} --transport=${trans}" \
782 "15" "5"
783 done
784 done
785done
786
787for trans in $(intersection "${py_transports}" "${ruby_transports}"); do
788 for sock in $(intersection "${py_sockets}" "${ruby_sockets}"); do
789 case "$sock" in
790 "ip" ) extraparam="";;
791 "ip-ssl" ) extraparam="--ssl";;
792 esac
793 do_test "py-ruby" "${proto}" "${trans}-${sock}" \
794 "py/TestClient.py --protocol=accel --transport=${trans} --port=9090 --host=localhost --genpydir=py/gen-py ${extraparam}" \
795 "ruby rb/integration/TestServer.rb --protocol=binary --transport=${trans}" \
796 "15" "5"
797 do_test "py-ruby" "${proto}" "${trans}-${sock}" \
798 "py/TestClient.py --protocol=binary --transport=${trans} --port=9090 --host=localhost --genpydir=py/gen-py ${extraparam}" \
799 "ruby rb/integration/TestServer.rb --protocol=accel --transport=${trans}" \
800 "15" "5"
801 done
802 done
803
804######### ruby client - py server ##############
805for proto in $(intersection "${py_protocols}" "${ruby_protocols}"); do
806 for trans in $(intersection "${py_transports}" "${ruby_transports}"); do
807 for sock in $(intersection "${py_sockets}" "${ruby_sockets}"); do
808 case "$sock" in
809 "ip" ) extraparam="";;
810 "ip-ssl" ) extraparam="--ssl";;
811 esac
812 do_test "ruby-py" "${proto}" "${trans}-${sock}" \
813 "ruby rb/integration/TestClient.rb --protocol=${proto} --transport=${trans}" \
814 "py/TestServer.py --protocol=${proto} --transport=${trans} --port=9090 --genpydir=py/gen-py TSimpleServer ${extraparam}" \
815 "5" "2"
816 done
817 done
818done
819
820for trans in $(intersection "${py_transports}" "${ruby_transports}"); do
821 for sock in $(intersection "${py_sockets}" "${ruby_sockets}"); do
822 case "$sock" in
823 "ip" ) extraparam="";;
824 "ip-ssl" ) extraparam="--ssl";;
825 esac
826 do_test "ruby-py" "binary-accel" "${trans}-${sock}" \
827 "ruby rb/integration/TestClient.rb --protocol=binary --transport=${trans}" \
828 "py/TestServer.py --protocol=accel --transport=${trans} --port=9090 --genpydir=py/gen-py TSimpleServer ${extraparam}" \
829 "5" "2"
830 do_test "ruby-py" "accel-binary" "${trans}-${sock}" \
831 "ruby rb/integration/TestClient.rb --protocol=accel --transport=${trans}" \
832 "py/TestServer.py --protocol=binary --transport=${trans} --port=9090 --genpydir=py/gen-py TSimpleServer ${extraparam}" \
833 "5" "2"
834 done
835 done
836
837
Roger Meier691ec002012-11-02 07:50:24 +0000838# delete Unix Domain Socket used by cpp tests
839rm -f /tmp/ThriftTest.thrift
840
Jens Geyerc1d79432014-04-22 22:52:43 +0200841######### csharp client - csharp server #############
842export MONO_PATH=../lib/csharp
843for proto in $csharp_protocols; do
844 for trans in $csharp_transports; do
845 for sock in $csharp_sockets; do
846 case "$sock" in
847 "ip" ) extraparam="";;
848 "ip-ssl" ) extraparam="--ssl";;
849 esac
850 do_test "csharp-csharp" "${proto}" "${trans}-${sock}" \
851 "../lib/csharp/test/ThriftTest/TestClientServer.exe client --protocol=${proto} --transport=${trans} ${extraparam}" \
852 "../lib/csharp/test/ThriftTest/TestClientServer.exe server --protocol=${proto} --transport=${trans} ${extraparam}" \
henriqued5aba4c2014-04-30 18:11:11 +0200853 "5" "1"
Jens Geyerc1d79432014-04-22 22:52:43 +0200854 done
855 done
856done
857
858
Roger Meier4edac7f2014-05-02 21:07:01 +0200859do_test "js-java" "json" "http-ip" \
Roger Meier4d5157d2012-01-09 21:23:19 +0000860 "" \
861 "ant -f ../lib/js/test/build.xml unittest" \
henriqued17f1c92014-04-30 16:21:25 +0200862 "2" "2"
Roger Meier4d5157d2012-01-09 21:23:19 +0000863do_test "perl-cpp" "binary" "buffered-ip" \
Roger Meier01b568c2012-01-10 21:30:02 +0000864 "perl -I perl/gen-perl/ -I../lib/perl/lib/ perl/TestClient.pl" \
Roger Meier4d5157d2012-01-09 21:23:19 +0000865 "cpp/TestServer" \
henriqued5aba4c2014-04-30 18:11:11 +0200866 "10" "2"
Roger Meierb33967b2012-01-21 09:18:05 +0000867do_test "php-cpp" "binary" "buffered-ip" \
868 "make -C php/ client" \
869 "cpp/TestServer" \
henriqued5aba4c2014-04-30 18:11:11 +0200870 "10" "2"
Roger Meier4edac7f2014-05-02 21:07:01 +0200871
872echo " failed tests are logged to test/log/error.log"
Roger Meiercc0fe272014-05-16 23:18:25 +0200873echo " full log is here test/log/client_server_protocol_transport_client.log"
874echo " full log is here test/log/client_server_protocol_transport_server.log"
875echo " or look at file://$BASEDIR/$STATUS_HTML"
876
henriquead4df162014-05-20 13:18:45 +0200877ELAPSED_TIME=$(echo "(${SECONDS} - ${START_TIME})" | bc)
878DURATION="${ELAPSED_TIME} seconds"
Roger Meiercc0fe272014-05-16 23:18:25 +0200879echo "test an took" $DURATION
880print_html_footer "$DURATION"
881
Roger Meier4edac7f2014-05-02 21:07:01 +0200882date
Roger Meier82525772012-11-16 00:38:27 +0000883cd -