summaryrefslogtreecommitdiff
path: root/test/run_tests.sh
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2021-05-19 15:07:11 +0200
committerToni Uhlig <matzeton@googlemail.com>2021-05-19 15:56:20 +0200
commitdb39772aa7b10ee6fb9e21db8f44c0f5fca7a1d2 (patch)
tree44997ae9b6efeae85286f7e0c04decf2f67f090a /test/run_tests.sh
parent9ffaeef24d167bc1b99446bc07c7765c3375f776 (diff)
Fixed CMake global CFLAGS misuse which can cause xcompile errors.
nDPIsrvd-captured supports skipping flows w/o any layer 4 payload. * libndpi update * run_tests does not generate any *.out files for fuzz-*.pcap anymore and does not fail if nDPId-test exits with value 1 (most likely caused by a libpcap failure) Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'test/run_tests.sh')
-rwxr-xr-xtest/run_tests.sh22
1 files changed, 18 insertions, 4 deletions
diff --git a/test/run_tests.sh b/test/run_tests.sh
index 6268fc39d..193fd96c4 100755
--- a/test/run_tests.sh
+++ b/test/run_tests.sh
@@ -82,7 +82,7 @@ if [ $? -ne 1 ]; then
exit 7
fi
-for pcap_file in $(ls *.pcap *.pcapng *.cap); do
+find . -printf '%f\n' -iname '*.pcap' -o -iname '*.pcapng' -o -iname '*.cap' | while read pcap_file; do
if file "${pcap_file}" | grep -qoE ':\s(pcap|pcap-ng) capture file'; then
true # pass
else
@@ -94,13 +94,27 @@ for pcap_file in $(ls *.pcap *.pcapng *.cap); do
printf '%s\n' "-- OUT: ${MYDIR}/results/${pcap_file}.out" \
>>"/tmp/nDPId-test-stderr/${pcap_file}.out"
+ printf "%-${LINE_SPACES}s\t" "${pcap_file}"
+
${nDPId_test_EXEC} "${pcap_file}" \
>"${MYDIR}/results/${pcap_file}.out.new" \
2>>"/tmp/nDPId-test-stderr/${pcap_file}.out"
+ nDPId_test_RETVAL=$?
- printf "%-${LINE_SPACES}s\t" "${pcap_file}"
-
- if [ $? -eq 0 ]; then
+ if [[ ${pcap_file} == fuzz-* ]]; then
+ if [ ${nDPId_test_RETVAL} -eq 0 ]; then
+ printf '%s\n' '[OK]'
+ elif [ ${nDPId_test_RETVAL} -eq 1 ]; then
+ # fuzzed PCAPs with a return value of 1 indicates that libpcap failed
+ printf '%s\n' '[FAIL][IGNORED]'
+ else
+ # may be a valid sanitizer/other failure
+ printf '%s\n' '[FAIL]'
+ printf '%s\n' '----------------------------------------'
+ printf '%s\n' "-- STDERR of ${pcap_file}: /tmp/nDPId-test-stderr/${pcap_file}.out"
+ cat "/tmp/nDPId-test-stderr/${pcap_file}.out"
+ fi
+ 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" \