Added ability to run automatic tests (initial version)

This commit is contained in:
Luca Deri
2015-05-14 00:47:50 +02:00
parent bcd8380704
commit 199193fb86
4 changed files with 87 additions and 22 deletions
Executable
+34
View File
@@ -0,0 +1,34 @@
READER=../example/ndpiReader
PCAPS=`cd pcap; /bin/ls *.pcap`
build_results() {
for f in $PCAPS; do
#echo $f
# create result files if not present
[ ! -f result/$f.out ] && $READER -q -i pcap/$f -w result/$f.out
done
}
check_results() {
for f in $PCAPS; do
if [ -f result/$f.out ]; then
$READER -q -i pcap/$f -w /tmp/reader.out
NUM_DIFF=`diff result/$f.out /tmp/reader.out | wc -l`
if [ $NUM_DIFF -eq 0 ]; then
echo "$f\t OK"
else
echo "$f\t ERROR"
fi
/bin/rm /tmp/reader.out
fi
done
}
build_results
check_results
+1
View File
@@ -0,0 +1 @@
BitTorrent 2 322 1
+1
View File
@@ -0,0 +1 @@
Unknown 413 254874 1