tcpdump/tests/print-flags.sh
Guy Harris d53e50ef24 Fix some problems with the tests.
Get rid of some no-longer-necessary uudecodes (Git can store binary
files such as pcap files, so we no longer need to uuencode them, and the
uuencoded files are no longer around), and handle the "-X" and "-XX"
flag tests (where we had to rename the "should be" output files to avoid
collisions on case-insensitive file systems such as the default local
file system on the desktop UN*X with the biggest market share).
2011-06-12 18:08:55 -07:00

30 lines
689 B
Bash
Executable File

#!/bin/sh
for i in x xx X XX A AA; do
#
# We cannot rely on, for example, "print-x.out" and
# "print-X.out" being different files - we might be running
# this on a case-insensitive file system, e.g. a Windows
# file system or a case-insensitive HFS+ file system on
# Mac OS X.
#
# Therefore, for "X" and "XX", we have "print-capX.out"
# and "print-capXX.out".
#
if test $i = X
then
printname=capX
elif test $i = XX
then
printname=capXX
else
printname=$i
fi
if (../tcpdump -$i -s0 -nr print-flags.pcap | tee NEW/print-$printname.new | diff - print-$printname.out >DIFF/print-$printname.out.diff )
then
echo print-$i passed.
else
echo print-$i failed.
fi
done