File: test-maptcp.sh

package info (click to toggle)
libhsync 0.5.7-1.2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,060 kB
  • ctags: 543
  • sloc: sh: 7,944; ansic: 5,413; makefile: 154
file content (52 lines) | stat: -rwxr-xr-x 1,352 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#! /bin/sh -pe

# libhsync test case.
# Copyright (C) 2000 by Martin Pool
# $Id: test-maptcp.sh,v 1.9 2000/08/27 08:58:03 mbp Exp $

# Test the mapptr routines by running them across a localhost TCP
# socket.  We try several different strategies for generating the
# sequence of commands, and also for doing IO.

from=$tmpdir/basis
new=$tmpdir/new.tmp
cmds=$tmpdir/cmds
expect=$tmpdir/expect
port=$tmpdir/port

run_test cat $builddir/libhsync.a >$from

# NB: Can't use the `forward' pattern with map_copy because it
# discards buffered data and can't step backwards even to the previous
# region.

for seed in `seq 10`
do
for strategy in decoder stepping ones 
do
    run_test genmaptest $strategy 1000 $cmds $expect $from $seed

    for ioargs in '-c' '' '-k' '-n -k -s'
    do
	run_test sockrun -- hsmapread $debug $ioargs `cat $cmds` <$from >$new
	run_test cmp $expect $new
    done
done

for strategy in forward 
do
    run_test genmaptest $strategy 1000 $cmds $expect $from $seed

    for ioargs in '' '-k' '-n -k -s'
    do
	run_test sockrun -- hsmapread $debug $ioargs `cat $cmds` <$from >$new
	run_test cmp $expect $new
    done
done
done #seed

# the output files are pretty huge, so if we completed successfully
# delete them.  if we failed they're left behind so that you can find
# the cause of death.

run_test rm $expect $new $cmds $from