aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2015-05-14 00:47:50 +0200
committerLuca Deri <deri@ntop.org>2015-05-14 00:47:50 +0200
commit199193fb86822954deb3142c67336e53b3c59409 (patch)
treecb4e8e8516c5ca45f4af4b0d60e20ccd77e612d1 /tests
parentbcd83807040f8f00599751274de4efedfa59785d (diff)
Added ability to run automatic tests (initial version)
Diffstat (limited to 'tests')
-rwxr-xr-xtests/do.sh34
-rw-r--r--tests/result/bt_search.pcap.out1
-rw-r--r--tests/result/quic.pcap.out1
3 files changed, 36 insertions, 0 deletions
diff --git a/tests/do.sh b/tests/do.sh
new file mode 100755
index 000000000..4f81906f7
--- /dev/null
+++ b/tests/do.sh
@@ -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 \ No newline at end of file
diff --git a/tests/result/bt_search.pcap.out b/tests/result/bt_search.pcap.out
new file mode 100644
index 000000000..6cf54c85a
--- /dev/null
+++ b/tests/result/bt_search.pcap.out
@@ -0,0 +1 @@
+BitTorrent 2 322 1
diff --git a/tests/result/quic.pcap.out b/tests/result/quic.pcap.out
new file mode 100644
index 000000000..283fb04d2
--- /dev/null
+++ b/tests/result/quic.pcap.out
@@ -0,0 +1 @@
+Unknown 413 254874 1