Statistics
| Branch: | Tag: | Revision:

root / test / import-export_unittest.bash @ acd65a16

History | View | Annotate | Download (9.7 kB)

1 2d76b580 Michael Hanselmann
#!/bin/bash
2 2d76b580 Michael Hanselmann
#
3 2d76b580 Michael Hanselmann
4 2d76b580 Michael Hanselmann
# Copyright (C) 2010 Google Inc.
5 2d76b580 Michael Hanselmann
#
6 2d76b580 Michael Hanselmann
# This program is free software; you can redistribute it and/or modify
7 2d76b580 Michael Hanselmann
# it under the terms of the GNU General Public License as published by
8 2d76b580 Michael Hanselmann
# the Free Software Foundation; either version 2 of the License, or
9 2d76b580 Michael Hanselmann
# (at your option) any later version.
10 2d76b580 Michael Hanselmann
#
11 2d76b580 Michael Hanselmann
# This program is distributed in the hope that it will be useful, but
12 2d76b580 Michael Hanselmann
# WITHOUT ANY WARRANTY; without even the implied warranty of
13 2d76b580 Michael Hanselmann
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 2d76b580 Michael Hanselmann
# General Public License for more details.
15 2d76b580 Michael Hanselmann
#
16 2d76b580 Michael Hanselmann
# You should have received a copy of the GNU General Public License
17 2d76b580 Michael Hanselmann
# along with this program; if not, write to the Free Software
18 2d76b580 Michael Hanselmann
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 2d76b580 Michael Hanselmann
# 02110-1301, USA.
20 2d76b580 Michael Hanselmann
21 2d76b580 Michael Hanselmann
set -e
22 2d76b580 Michael Hanselmann
set -o pipefail
23 2d76b580 Michael Hanselmann
24 2d76b580 Michael Hanselmann
export PYTHON=${PYTHON:=python}
25 2d76b580 Michael Hanselmann
26 9d198e6f Michael Hanselmann
impexpd="$PYTHON daemons/import-export -d"
27 2d76b580 Michael Hanselmann
28 2d76b580 Michael Hanselmann
err() {
29 2d76b580 Michael Hanselmann
  echo "$@"
30 2d76b580 Michael Hanselmann
  echo 'Aborting'
31 9d198e6f Michael Hanselmann
  show_output
32 2d76b580 Michael Hanselmann
  exit 1
33 2d76b580 Michael Hanselmann
}
34 2d76b580 Michael Hanselmann
35 9d198e6f Michael Hanselmann
show_output() {
36 d6547a1c Michael Hanselmann
  if [[ -s "$gencert_output" ]]; then
37 d6547a1c Michael Hanselmann
    echo
38 d6547a1c Michael Hanselmann
    echo 'Generating certificates:'
39 d6547a1c Michael Hanselmann
    cat $gencert_output
40 d6547a1c Michael Hanselmann
  fi
41 9d198e6f Michael Hanselmann
  if [[ -s "$dst_output" ]]; then
42 9d198e6f Michael Hanselmann
    echo
43 9d198e6f Michael Hanselmann
    echo 'Import output:'
44 9d198e6f Michael Hanselmann
    cat $dst_output
45 9d198e6f Michael Hanselmann
  fi
46 9d198e6f Michael Hanselmann
  if [[ -s "$src_output" ]]; then
47 9d198e6f Michael Hanselmann
    echo
48 9d198e6f Michael Hanselmann
    echo 'Export output:'
49 9d198e6f Michael Hanselmann
    cat $src_output
50 9d198e6f Michael Hanselmann
  fi
51 9d198e6f Michael Hanselmann
}
52 9d198e6f Michael Hanselmann
53 2d76b580 Michael Hanselmann
checkpids() {
54 2d76b580 Michael Hanselmann
  local result=0
55 2d76b580 Michael Hanselmann
56 2d76b580 Michael Hanselmann
  # Unlike combining the "wait" commands using || or &&, this ensures we
57 2d76b580 Michael Hanselmann
  # actually wait for all PIDs.
58 2d76b580 Michael Hanselmann
  for pid in "$@"; do
59 2d76b580 Michael Hanselmann
    if ! wait $pid; then
60 2d76b580 Michael Hanselmann
      result=1
61 2d76b580 Michael Hanselmann
    fi
62 2d76b580 Michael Hanselmann
  done
63 2d76b580 Michael Hanselmann
64 2d76b580 Michael Hanselmann
  return $result
65 2d76b580 Michael Hanselmann
}
66 2d76b580 Michael Hanselmann
67 2d76b580 Michael Hanselmann
get_testpath() {
68 2d76b580 Michael Hanselmann
  echo "${TOP_SRCDIR:-.}/test"
69 2d76b580 Michael Hanselmann
}
70 2d76b580 Michael Hanselmann
71 2d76b580 Michael Hanselmann
get_testfile() {
72 2d76b580 Michael Hanselmann
  echo "$(get_testpath)/data/$1"
73 2d76b580 Michael Hanselmann
}
74 2d76b580 Michael Hanselmann
75 53dbf14c Michael Hanselmann
upto() {
76 53dbf14c Michael Hanselmann
  echo "$(date '+%F %T'):" "$@" '...'
77 53dbf14c Michael Hanselmann
}
78 53dbf14c Michael Hanselmann
79 2d76b580 Michael Hanselmann
statusdir=$(mktemp -d)
80 2d76b580 Michael Hanselmann
trap "rm -rf $statusdir" EXIT
81 2d76b580 Michael Hanselmann
82 d6547a1c Michael Hanselmann
gencert_output=$statusdir/gencert.output
83 d6547a1c Michael Hanselmann
84 2d76b580 Michael Hanselmann
src_statusfile=$statusdir/src.status
85 9d198e6f Michael Hanselmann
src_output=$statusdir/src.output
86 2d76b580 Michael Hanselmann
src_x509=$statusdir/src.pem
87 2d76b580 Michael Hanselmann
88 2d76b580 Michael Hanselmann
dst_statusfile=$statusdir/dst.status
89 9d198e6f Michael Hanselmann
dst_output=$statusdir/dst.output
90 2d76b580 Michael Hanselmann
dst_x509=$statusdir/dst.pem
91 2d76b580 Michael Hanselmann
92 2d76b580 Michael Hanselmann
other_x509=$statusdir/other.pem
93 2d76b580 Michael Hanselmann
94 2d76b580 Michael Hanselmann
testdata=$statusdir/data1
95 41a2e7d7 Michael Hanselmann
largetestdata=$statusdir/data2
96 2d76b580 Michael Hanselmann
97 53dbf14c Michael Hanselmann
upto 'Command line parameter tests'
98 53dbf14c Michael Hanselmann
99 2d76b580 Michael Hanselmann
$impexpd >/dev/null 2>&1 &&
100 2d76b580 Michael Hanselmann
  err "daemon-util succeeded without parameters"
101 2d76b580 Michael Hanselmann
102 2d76b580 Michael Hanselmann
$impexpd foo bar baz moo boo >/dev/null 2>&1 &&
103 2d76b580 Michael Hanselmann
  err "daemon-util succeeded with wrong parameters"
104 2d76b580 Michael Hanselmann
105 2d76b580 Michael Hanselmann
$impexpd $src_statusfile >/dev/null 2>&1 &&
106 2d76b580 Michael Hanselmann
  err "daemon-util succeeded with insufficient parameters"
107 2d76b580 Michael Hanselmann
108 2d76b580 Michael Hanselmann
$impexpd $src_statusfile invalidmode >/dev/null 2>&1 &&
109 2d76b580 Michael Hanselmann
  err "daemon-util succeeded with invalid mode"
110 2d76b580 Michael Hanselmann
111 acd65a16 Michael Hanselmann
for mode in import export; do
112 acd65a16 Michael Hanselmann
  $impexpd $src_statusfile $mode --compression=rot13 >/dev/null 2>&1 &&
113 acd65a16 Michael Hanselmann
    err "daemon-util succeeded with invalid compression"
114 acd65a16 Michael Hanselmann
115 acd65a16 Michael Hanselmann
  for host in '' '  ' ' s p a c e' ... , foo.example.net... \
116 acd65a16 Michael Hanselmann
              'some"evil"name' 'x\ny\tmoo'; do
117 acd65a16 Michael Hanselmann
    $impexpd $src_statusfile $mode --host="$host" >/dev/null 2>&1 &&
118 acd65a16 Michael Hanselmann
      err "daemon-util succeeded with invalid host '$host'"
119 acd65a16 Michael Hanselmann
  done
120 acd65a16 Michael Hanselmann
121 acd65a16 Michael Hanselmann
  for port in '' ' ' -1234 'some ` port " here'; do
122 acd65a16 Michael Hanselmann
    $impexpd $src_statusfile $mode --port="$port" >/dev/null 2>&1 &&
123 acd65a16 Michael Hanselmann
      err "daemon-util succeeded with invalid port '$port'"
124 acd65a16 Michael Hanselmann
  done
125 acd65a16 Michael Hanselmann
done
126 7e3c1da6 Michael Hanselmann
127 4dd97aa1 Michael Hanselmann
upto 'Generate test data'
128 2d76b580 Michael Hanselmann
cat $(get_testfile proc_drbd8.txt) $(get_testfile cert1.pem) > $testdata
129 2d76b580 Michael Hanselmann
130 41a2e7d7 Michael Hanselmann
# Generate about 7.5 MB of test data
131 41a2e7d7 Michael Hanselmann
{ tmp="$(<$testdata)"
132 41a2e7d7 Michael Hanselmann
  for (( i=0; i < 100; ++i )); do
133 41a2e7d7 Michael Hanselmann
    echo "$tmp $tmp $tmp $tmp $tmp $tmp"
134 41a2e7d7 Michael Hanselmann
  done
135 41a2e7d7 Michael Hanselmann
  dd if=/dev/zero bs=1024 count=4096 2>/dev/null
136 41a2e7d7 Michael Hanselmann
  for (( i=0; i < 100; ++i )); do
137 41a2e7d7 Michael Hanselmann
    echo "$tmp $tmp $tmp $tmp $tmp $tmp"
138 41a2e7d7 Michael Hanselmann
  done
139 41a2e7d7 Michael Hanselmann
} > $largetestdata
140 41a2e7d7 Michael Hanselmann
141 2d76b580 Michael Hanselmann
impexpd_helper() {
142 2d76b580 Michael Hanselmann
  $PYTHON $(get_testpath)/import-export_unittest-helper "$@"
143 2d76b580 Michael Hanselmann
}
144 2d76b580 Michael Hanselmann
145 ca9ec5aa Michael Hanselmann
start_test() {
146 ca9ec5aa Michael Hanselmann
  upto "$@"
147 2d76b580 Michael Hanselmann
148 ca9ec5aa Michael Hanselmann
  rm -f $src_statusfile $dst_output $dst_statusfile $dst_output
149 ca9ec5aa Michael Hanselmann
  rm -f $gencert_output
150 53dbf14c Michael Hanselmann
151 ca9ec5aa Michael Hanselmann
  imppid=
152 ca9ec5aa Michael Hanselmann
  exppid=
153 2d76b580 Michael Hanselmann
154 ca9ec5aa Michael Hanselmann
  cmd_prefix=
155 ca9ec5aa Michael Hanselmann
  cmd_suffix=
156 ca9ec5aa Michael Hanselmann
  connect_timeout=30
157 ca9ec5aa Michael Hanselmann
  connect_retries=1
158 ca9ec5aa Michael Hanselmann
  compress=gzip
159 2d76b580 Michael Hanselmann
}
160 2d76b580 Michael Hanselmann
161 ca9ec5aa Michael Hanselmann
wait_import_ready() {
162 2d76b580 Michael Hanselmann
  # Wait for listening port
163 ca9ec5aa Michael Hanselmann
  impexpd_helper $dst_statusfile listen-port
164 2d76b580 Michael Hanselmann
}
165 2d76b580 Michael Hanselmann
166 ca9ec5aa Michael Hanselmann
do_export() {
167 2d76b580 Michael Hanselmann
  local port=$1
168 2d76b580 Michael Hanselmann
169 2d76b580 Michael Hanselmann
  $impexpd $src_statusfile export --bind=127.0.0.1 \
170 2d76b580 Michael Hanselmann
    --host=127.0.0.1 --port=$port \
171 2d76b580 Michael Hanselmann
    --key=$src_x509 --cert=$src_x509 --ca=$dst_x509 \
172 9d198e6f Michael Hanselmann
    --cmd-prefix="$cmd_prefix" --cmd-suffix="$cmd_suffix" \
173 9d198e6f Michael Hanselmann
    --connect-timeout=$connect_timeout \
174 7e3c1da6 Michael Hanselmann
    --connect-retries=$connect_retries \
175 7e3c1da6 Michael Hanselmann
    --compress=$compress
176 2d76b580 Michael Hanselmann
}
177 2d76b580 Michael Hanselmann
178 2d76b580 Michael Hanselmann
do_import() {
179 2d76b580 Michael Hanselmann
  $impexpd $dst_statusfile import --bind=127.0.0.1 \
180 2d76b580 Michael Hanselmann
    --host=127.0.0.1 \
181 2d76b580 Michael Hanselmann
    --key=$dst_x509 --cert=$dst_x509 --ca=$src_x509 \
182 9d198e6f Michael Hanselmann
    --cmd-prefix="$cmd_prefix" --cmd-suffix="$cmd_suffix" \
183 9d198e6f Michael Hanselmann
    --connect-timeout=$connect_timeout \
184 7e3c1da6 Michael Hanselmann
    --connect-retries=$connect_retries \
185 7e3c1da6 Michael Hanselmann
    --compress=$compress
186 2d76b580 Michael Hanselmann
}
187 2d76b580 Michael Hanselmann
188 9d198e6f Michael Hanselmann
upto 'Generate X509 certificates and keys'
189 d6547a1c Michael Hanselmann
impexpd_helper $src_x509 gencert 2>$gencert_output & srccertpid=$!
190 d6547a1c Michael Hanselmann
impexpd_helper $dst_x509 gencert 2>$gencert_output & dstcertpid=$!
191 d6547a1c Michael Hanselmann
impexpd_helper $other_x509 gencert 2>$gencert_output & othercertpid=$!
192 d6547a1c Michael Hanselmann
checkpids $srccertpid $dstcertpid $othercertpid || \
193 d6547a1c Michael Hanselmann
  err 'Failed to generate certificates'
194 2d76b580 Michael Hanselmann
195 ca9ec5aa Michael Hanselmann
start_test 'Normal case'
196 9d198e6f Michael Hanselmann
do_import > $statusdir/recv1 2>$dst_output & imppid=$!
197 ca9ec5aa Michael Hanselmann
if port=$(wait_import_ready 2>$src_output); then
198 ca9ec5aa Michael Hanselmann
  do_export $port < $testdata >>$src_output 2>&1 & exppid=$!
199 ca9ec5aa Michael Hanselmann
fi
200 2d76b580 Michael Hanselmann
checkpids $exppid $imppid || err 'An error occurred'
201 2d76b580 Michael Hanselmann
cmp $testdata $statusdir/recv1 || err 'Received data does not match input'
202 2d76b580 Michael Hanselmann
203 ca9ec5aa Michael Hanselmann
start_test 'Export using wrong CA'
204 9d198e6f Michael Hanselmann
# Setting lower timeout to not wait for too long
205 9d198e6f Michael Hanselmann
connect_timeout=1 do_import &>$dst_output & imppid=$!
206 ca9ec5aa Michael Hanselmann
if port=$(wait_import_ready 2>$src_output); then
207 ca9ec5aa Michael Hanselmann
  : | dst_x509=$other_x509 do_export $port >>$src_output 2>&1 & exppid=$!
208 ca9ec5aa Michael Hanselmann
fi
209 2d76b580 Michael Hanselmann
checkpids $exppid $imppid && err 'Export did not fail when using wrong CA'
210 2d76b580 Michael Hanselmann
211 ca9ec5aa Michael Hanselmann
start_test 'Import using wrong CA'
212 9d198e6f Michael Hanselmann
# Setting lower timeout to not wait for too long
213 9d198e6f Michael Hanselmann
src_x509=$other_x509 connect_timeout=1 do_import &>$dst_output & imppid=$!
214 ca9ec5aa Michael Hanselmann
if port=$(wait_import_ready 2>$src_output); then
215 ca9ec5aa Michael Hanselmann
  : | do_export $port >>$src_output 2>&1 & exppid=$!
216 ca9ec5aa Michael Hanselmann
fi
217 2d76b580 Michael Hanselmann
checkpids $exppid $imppid && err 'Import did not fail when using wrong CA'
218 2d76b580 Michael Hanselmann
219 ca9ec5aa Michael Hanselmann
start_test 'Suffix command on import'
220 9d198e6f Michael Hanselmann
cmd_suffix="| cksum > $statusdir/recv2" do_import &>$dst_output & imppid=$!
221 ca9ec5aa Michael Hanselmann
if port=$(wait_import_ready 2>$src_output); then
222 ca9ec5aa Michael Hanselmann
  do_export $port < $testdata >>$src_output 2>&1 & exppid=$!
223 ca9ec5aa Michael Hanselmann
fi
224 2d76b580 Michael Hanselmann
checkpids $exppid $imppid || err 'Testing additional commands failed'
225 2d76b580 Michael Hanselmann
cmp $statusdir/recv2 <(cksum < $testdata) || \
226 2d76b580 Michael Hanselmann
  err 'Checksum of received data does not match'
227 2d76b580 Michael Hanselmann
228 ca9ec5aa Michael Hanselmann
start_test 'Prefix command on export'
229 9d198e6f Michael Hanselmann
do_import > $statusdir/recv3 2>$dst_output & imppid=$!
230 ca9ec5aa Michael Hanselmann
if port=$(wait_import_ready 2>$src_output); then
231 ca9ec5aa Michael Hanselmann
  cmd_prefix='cksum |' do_export $port <$testdata >>$src_output 2>&1 & exppid=$!
232 ca9ec5aa Michael Hanselmann
fi
233 2d76b580 Michael Hanselmann
checkpids $exppid $imppid || err 'Testing additional commands failed'
234 2d76b580 Michael Hanselmann
cmp $statusdir/recv3 <(cksum < $testdata) || \
235 2d76b580 Michael Hanselmann
  err 'Received checksum does not match'
236 2d76b580 Michael Hanselmann
237 ca9ec5aa Michael Hanselmann
start_test 'Failing prefix command on export'
238 ca9ec5aa Michael Hanselmann
: | cmd_prefix='exit 1;' do_export 0 &>$src_output & exppid=$!
239 2d76b580 Michael Hanselmann
checkpids $exppid && err 'Prefix command on export did not fail when it should'
240 2d76b580 Michael Hanselmann
241 ca9ec5aa Michael Hanselmann
start_test 'Failing suffix command on export'
242 ca9ec5aa Michael Hanselmann
do_import >&$dst_output & imppid=$!
243 ca9ec5aa Michael Hanselmann
if port=$(wait_import_ready 2>$src_output); then
244 ca9ec5aa Michael Hanselmann
  : | cmd_suffix='| exit 1' do_export $port >>$src_output 2>&1 & exppid=$!
245 ca9ec5aa Michael Hanselmann
fi
246 2d76b580 Michael Hanselmann
checkpids $imppid $exppid && \
247 2d76b580 Michael Hanselmann
  err 'Suffix command on export did not fail when it should'
248 2d76b580 Michael Hanselmann
249 ca9ec5aa Michael Hanselmann
start_test 'Failing prefix command on import'
250 9d198e6f Michael Hanselmann
cmd_prefix='exit 1;' do_import &>$dst_output & imppid=$!
251 2d76b580 Michael Hanselmann
checkpids $imppid && err 'Prefix command on import did not fail when it should'
252 2d76b580 Michael Hanselmann
253 ca9ec5aa Michael Hanselmann
start_test 'Failing suffix command on import'
254 9d198e6f Michael Hanselmann
cmd_suffix='| exit 1' do_import &>$dst_output & imppid=$!
255 ca9ec5aa Michael Hanselmann
if port=$(wait_import_ready 2>$src_output); then
256 ca9ec5aa Michael Hanselmann
  : | do_export $port >>$src_output 2>&1 & exppid=$!
257 ca9ec5aa Michael Hanselmann
fi
258 2d76b580 Michael Hanselmann
checkpids $imppid $exppid && \
259 2d76b580 Michael Hanselmann
  err 'Suffix command on import did not fail when it should'
260 2d76b580 Michael Hanselmann
261 ca9ec5aa Michael Hanselmann
start_test 'Listen timeout A'
262 9d198e6f Michael Hanselmann
# Setting lower timeout to not wait too long (there won't be anything trying to
263 9d198e6f Michael Hanselmann
# connect)
264 9d198e6f Michael Hanselmann
connect_timeout=1 do_import &>$dst_output & imppid=$!
265 9d198e6f Michael Hanselmann
checkpids $imppid && \
266 9d198e6f Michael Hanselmann
  err 'Listening with timeout did not fail when it should'
267 9d198e6f Michael Hanselmann
268 ca9ec5aa Michael Hanselmann
start_test 'Listen timeout B'
269 9d198e6f Michael Hanselmann
do_import &>$dst_output & imppid=$!
270 ca9ec5aa Michael Hanselmann
if port=$(wait_import_ready 2>$src_output); then
271 ca9ec5aa Michael Hanselmann
  { sleep 1; : | do_export $port; } >>$src_output 2>&1 & exppid=$!
272 ca9ec5aa Michael Hanselmann
fi
273 9d198e6f Michael Hanselmann
checkpids $exppid $imppid || \
274 9d198e6f Michael Hanselmann
  err 'Listening with timeout failed when it should not'
275 9d198e6f Michael Hanselmann
276 ca9ec5aa Michael Hanselmann
start_test 'Connect timeout'
277 4dd97aa1 Michael Hanselmann
# Setting lower timeout as nothing will be listening on port 0
278 ca9ec5aa Michael Hanselmann
: | connect_timeout=1 do_export 0 &>$src_output & exppid=$!
279 4dd97aa1 Michael Hanselmann
checkpids $exppid && err 'Connection did not time out when it should'
280 4dd97aa1 Michael Hanselmann
281 ca9ec5aa Michael Hanselmann
start_test 'No compression'
282 7e3c1da6 Michael Hanselmann
compress=none do_import > $statusdir/recv-nocompr 2>$dst_output & imppid=$!
283 ca9ec5aa Michael Hanselmann
if port=$(wait_import_ready 2>$src_output); then
284 ca9ec5aa Michael Hanselmann
  compress=none do_export $port < $testdata >>$src_output 2>&1 & exppid=$!
285 ca9ec5aa Michael Hanselmann
fi
286 7e3c1da6 Michael Hanselmann
checkpids $exppid $imppid || err 'An error occurred'
287 7e3c1da6 Michael Hanselmann
cmp $testdata $statusdir/recv-nocompr || \
288 7e3c1da6 Michael Hanselmann
  err 'Received data does not match input'
289 7e3c1da6 Michael Hanselmann
290 ca9ec5aa Michael Hanselmann
start_test 'Compression mismatch A'
291 7e3c1da6 Michael Hanselmann
compress=none do_import > $statusdir/recv-miscompr 2>$dst_output & imppid=$!
292 ca9ec5aa Michael Hanselmann
if port=$(wait_import_ready 2>$src_output); then
293 ca9ec5aa Michael Hanselmann
  compress=gzip do_export $port < $testdata >>$src_output 2>&1 & exppid=$!
294 ca9ec5aa Michael Hanselmann
fi
295 7e3c1da6 Michael Hanselmann
checkpids $exppid $imppid || err 'An error occurred'
296 7e3c1da6 Michael Hanselmann
cmp -s $testdata $statusdir/recv-miscompr && \
297 7e3c1da6 Michael Hanselmann
  err 'Received data matches input when it should not'
298 7e3c1da6 Michael Hanselmann
299 ca9ec5aa Michael Hanselmann
start_test 'Compression mismatch B'
300 7e3c1da6 Michael Hanselmann
compress=gzip do_import > $statusdir/recv-miscompr2 2>$dst_output & imppid=$!
301 ca9ec5aa Michael Hanselmann
if port=$(wait_import_ready 2>$src_output); then
302 ca9ec5aa Michael Hanselmann
  compress=none do_export $port < $testdata >>$src_output 2>&1 & exppid=$!
303 ca9ec5aa Michael Hanselmann
fi
304 7e3c1da6 Michael Hanselmann
checkpids $exppid $imppid && err 'Did not fail when it should'
305 7e3c1da6 Michael Hanselmann
cmp -s $testdata $statusdir/recv-miscompr2 && \
306 7e3c1da6 Michael Hanselmann
  err 'Received data matches input when it should not'
307 7e3c1da6 Michael Hanselmann
308 ca9ec5aa Michael Hanselmann
start_test 'Large transfer'
309 41a2e7d7 Michael Hanselmann
do_import > $statusdir/recv-large 2>$dst_output & imppid=$!
310 ca9ec5aa Michael Hanselmann
if port=$(wait_import_ready 2>$src_output); then
311 ca9ec5aa Michael Hanselmann
  do_export $port < $largetestdata >>$src_output 2>&1 & exppid=$!
312 ca9ec5aa Michael Hanselmann
fi
313 41a2e7d7 Michael Hanselmann
checkpids $exppid $imppid || err 'An error occurred'
314 41a2e7d7 Michael Hanselmann
cmp $largetestdata $statusdir/recv-large || \
315 41a2e7d7 Michael Hanselmann
  err 'Received data does not match input'
316 41a2e7d7 Michael Hanselmann
317 2d76b580 Michael Hanselmann
exit 0