tcpdump/update-test.sh
Ulrich Windl 09f0179cf9 Provide and suggest update-test.sh in CONTRIBUTING
Provide shell script to update the output for a single test, and suggest
using it in CONTRIBUTING.
2017-09-28 09:14:50 +02:00

15 lines
474 B
Bash
Executable File

#!/bin/sh
TEST="$1"
PREFIX=tests
MATCH=0
while read name input output options
do
[ _$name = _ ] && continue # ignore empty lines
[ _${name#\#} != _$name ] && continue # ignore comment lines
[ $name != "$TEST" ] && continue # not the requested test
[ _$output = _ ] && continue # ignore incomplete lines
MATCH=1
./tcpdump -n -t -r "$PREFIX/$input" $options >"$PREFIX/$output"
done < $PREFIX/TESTLIST
[ $MATCH = 0 ] && echo "test $TEST not found" >&2