summaryrefslogtreecommitdiff
path: root/test/run_tests.sh
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2021-06-08 15:57:13 +0200
committerToni Uhlig <matzeton@googlemail.com>2021-06-08 16:18:54 +0200
commit7daeee141d235b53b4b3c1b825acaf06a0cf19c9 (patch)
tree412df5e6f48aa281ed78f79ee43da911598f81af /test/run_tests.sh
parenta41ddafa88de870aadad4acdf0193ac3a326c403 (diff)
`make dist`
* fixed run_tests.sh file check bug, CI compat * updated results due to libnDPI submodule update Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'test/run_tests.sh')
-rwxr-xr-xtest/run_tests.sh15
1 files changed, 4 insertions, 11 deletions
diff --git a/test/run_tests.sh b/test/run_tests.sh
index 61d8b8547..f9612ba90 100755
--- a/test/run_tests.sh
+++ b/test/run_tests.sh
@@ -60,10 +60,11 @@ nc -h |& head -n1 | grep -qoE '^OpenBSD netcat' || {
}
nDPI_TEST_DIR="$(realpath "${nDPI_SOURCE_ROOT}/tests/pcap")"
+cd "${nDPI_TEST_DIR}"
cat <<EOF
nDPId-test: ${nDPId_test_EXEC}
-nDPI pcaps: ${nDPI_TEST_DIR}
+nDPI pcaps: ${nDPI_TEST_DIR} ($(ls -l *.pcap *.pcapng *.cap | wc -l) total)
--------------------------
-- nDPId PCAP diff tests --
@@ -71,7 +72,6 @@ nDPI pcaps: ${nDPI_TEST_DIR}
EOF
-cd "${nDPI_TEST_DIR}"
mkdir -p /tmp/nDPId-test-stderr
set +e
TESTS_FAILED=0
@@ -82,14 +82,7 @@ if [ $? -ne 1 ]; then
exit 7
fi
-printf 'Using PCAP files from: %s (%s total)\n\n' "$(pwd)" "$(ls -l *.pcap *.pcapng *.cap | wc -l)"
-for pcap_file in $(ls *.pcap *.pcapng *.cap); do
- if file "${pcap_file}" | grep -qoE ':\s(pcap|pcap-ng) capture file'; then
- true # pass
- else
- continue
- fi
-
+for pcap_file in *.pcap *.pcapng *.cap; do
printf '%s\n' "-- CMD: ${nDPId_test_EXEC} $(realpath "${pcap_file}")" \
>"/tmp/nDPId-test-stderr/${pcap_file}.out"
printf '%s\n' "-- OUT: ${MYDIR}/results/${pcap_file}.out" \
@@ -192,7 +185,7 @@ netcat (OpenBSD) exec + args: ${NETCAT_EXEC}
EOF
cd "${MYDIR}"
-for out_file in $(ls results/*.out); do
+for out_file in results/*.out; do
pcap_file="${nDPI_TEST_DIR}/$(basename ${out_file%.out})"
if [ ! -r "${pcap_file}" ]; then
printf "%-${LINE_SPACES}s\t%s\n" "$(basename ${pcap_file})" '[MISSING]'