chiark / gitweb /
wip tests, but they don't work
[hippotat.git] / test / t-basic
1 #!/bin/bash
2 set -ex
3
4 # expects to be run inside the uml
5
6 fail () { echo >&2 "$0: fail: $*"; exit 1; }
7
8 tname="${0#**/t-}"
9 case "$tname" in
10 .* | */* | '') fail "bad tname $tname" ;;#
11 esac
12
13 test="${0%/*}"
14
15 tmp=tmp/$tname
16 rm -rf "$tmp"
17 mkdir -p $tmp
18
19 $test/netns-setup "$tname"
20 $test/run-server "$tname" &   spid=$!
21 $test/run-client "$tname" &   cpid=$1
22
23 $test/netns-run-client "$tname" -- ping -c 10 192.0.2.1 >$tmp/ping
24 grep ' 0% packet loss' $tmp/ping