summaryrefslogtreecommitdiff
path: root/test/run_tests.sh
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2021-12-15 23:25:32 +0100
committerToni Uhlig <matzeton@googlemail.com>2022-01-20 00:50:38 +0100
commit9e07a57566cc45bf92a845d8cee968d72e0f314e (patch)
tree8f1a6bfd08bd68a5253fadf3a01beecda77b1c95 /test/run_tests.sh
parenta35fc1d5ea8570609cc0c8cf6edadc81f8f5bb76 (diff)
Major nDPId extension. Sorry for the huge commit.
- nDPId: fixed invalid IP4/IP6 tuple compare - nDPIsrvd: fixed caching issue (finally) - added tiny c example (can be used to check flow manager sanity) - c-captured: use flow_last_seen timestamp from `struct nDPIsrvd_flow` - README.md update: added example JSON sequence - nDPId: added new flow event `update` necessary for correct timeout handling (and other future use-cases) - nDPIsrvd.h and nDPIsrvd.py: switched to an instance (consists of an alias/source tuple) based flow manager - every flow related event **must** now serialize `alias`, `source`, `flow_id`, `flow_last_seen` and `flow_idle_time` to make the timeout handling and verification process work correctly - nDPIsrvd.h: ability to profile any dynamic memory (de-)allocation - nDPIsrvd.py: removed PcapPacket class (unused) - py-flow-dashboard and py-flow-multiprocess: fixed race condition - py-flow-info: print statusbar with probably useful information - nDPId/nDPIsrvd.h: switched from packet-flow only timestamps (`pkt_*sec`) to a generic flow event timestamp `ts_msec` - nDPId-test: added additional checks - nDPId: increased ICMP flow timeout - nDPId: using event based i/o if capturing packets from a device - nDPIsrvd: fixed memory leak on shutdown if remote descriptors were still connected Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'test/run_tests.sh')
-rwxr-xr-xtest/run_tests.sh19
1 files changed, 10 insertions, 9 deletions
diff --git a/test/run_tests.sh b/test/run_tests.sh
index d7370b171..0354a44d2 100755
--- a/test/run_tests.sh
+++ b/test/run_tests.sh
@@ -84,6 +84,8 @@ nDPI pcaps: ${nDPI_TEST_DIR} ($(ls -l *.pcap *.pcapng *.cap | wc -l) total)
EOF
mkdir -p /tmp/nDPId-test-stderr
+mkdir -p /tmp/nDPId-test-stdout
+
set +e
TESTS_FAILED=0
@@ -101,8 +103,8 @@ for pcap_file in *.pcap *.pcapng *.cap; do
printf "%-${LINE_SPACES}s\t" "${pcap_file}"
- PRINT_SUMMARY=y ${nDPId_test_EXEC} "${pcap_file}" \
- >"${MYDIR}/results/${pcap_file}.out.new" \
+ ${nDPId_test_EXEC} "${pcap_file}" \
+ >"/tmp/nDPId-test-stdout/${pcap_file}.out.new" \
2>>"/tmp/nDPId-test-stderr/${pcap_file}.out"
nDPId_test_RETVAL=$?
@@ -122,17 +124,18 @@ for pcap_file in *.pcap *.pcapng *.cap; do
elif [ ${nDPId_test_RETVAL} -eq 0 ]; then
if [ ! -r "${MYDIR}/results/${pcap_file}.out" ]; then
printf '%s\n' '[NEW]'
- mv -v "${MYDIR}/results/${pcap_file}.out.new" \
+ mv -v "/tmp/nDPId-test-stdout/${pcap_file}.out.new" \
"${MYDIR}/results/${pcap_file}.out"
TESTS_FAILED=$((TESTS_FAILED + 1))
elif diff -u0 "${MYDIR}/results/${pcap_file}.out" \
- "${MYDIR}/results/${pcap_file}.out.new" >/dev/null; then
+ "/tmp/nDPId-test-stdout/${pcap_file}.out.new" >/dev/null; then
printf '%s\n' '[OK]'
+ rm -f "/tmp/nDPId-test-stdout/${pcap_file}.out.new"
else
printf '%s\n' '[DIFF]'
diff -u0 "${MYDIR}/results/${pcap_file}.out" \
- "${MYDIR}/results/${pcap_file}.out.new"
- mv -v "${MYDIR}/results/${pcap_file}.out.new" \
+ "/tmp/nDPId-test-stdout/${pcap_file}.out.new"
+ mv -v "/tmp/nDPId-test-stdout/${pcap_file}.out.new" \
"${MYDIR}/results/${pcap_file}.out"
TESTS_FAILED=$((TESTS_FAILED + 1))
fi
@@ -143,8 +146,6 @@ for pcap_file in *.pcap *.pcapng *.cap; do
cat "/tmp/nDPId-test-stderr/${pcap_file}.out"
TESTS_FAILED=$((TESTS_FAILED + 1))
fi
-
- rm -f "${MYDIR}/results/${pcap_file}.out.new"
done
function validate_results()
@@ -166,7 +167,7 @@ function validate_results()
return 0
fi
- # Note that the grep command is required as we generate a summary in the results file. (PRINT_SUMMARY=y)
+ # Note that the grep command is required as we generate a summary in the results file.
cat "${result_file}" | grep -vE '^~~.*$' | ${NETCAT_EXEC} &
nc_pid=$!
printf '%s\n' "-- ${validator_exec}" >>"/tmp/nDPId-test-stderr/${pcap_file}.out"