Strace support for diff tests.

* tiny README update

Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
This commit is contained in:
Toni Uhlig
2022-11-22 01:21:20 +01:00
parent 8b81b170d3
commit 60741d5649
2 changed files with 10 additions and 3 deletions

View File

@@ -3,7 +3,8 @@
# Disclaimer # Disclaimer
Please protect the privacy of others. Please respect&protect the privacy of others.
The purpose of this software is not to spy on others, but to detect network anomalies and malicious traffic. The purpose of this software is not to spy on others, but to detect network anomalies and malicious traffic.
# Abstract # Abstract
@@ -46,7 +47,7 @@ where:
* `nDPIsrvd`: * `nDPIsrvd`:
* create and manage an "incoming" UNIX-socket (ref [1] above), to fetch data from a local `nDPId`; * create and manage an "incoming" UNIX-socket (ref [1] above), to fetch data from a local `nDPId`;
* apply a filtering logic to received data to select "flow_event_id" related JSONs; * apply a buffering logic to received data;
* create and manage an "outgoing" UNIX or TCP socket (ref [2] above) to relay matched events * create and manage an "outgoing" UNIX or TCP socket (ref [2] above) to relay matched events
to connected clients to connected clients

View File

@@ -3,6 +3,7 @@
set -e set -e
LINE_SPACES=${LINE_SPACES:-48} LINE_SPACES=${LINE_SPACES:-48}
STRACE_EXEC="${STRACE_EXEC}"
MYDIR="$(realpath "$(dirname ${0})")" MYDIR="$(realpath "$(dirname ${0})")"
nDPId_test_EXEC="$(realpath "${2:-"${MYDIR}/../nDPId-test"}")" nDPId_test_EXEC="$(realpath "${2:-"${MYDIR}/../nDPId-test"}")"
NETCAT_EXEC="$(which nc) -q 0 -l 127.0.0.1 9000" NETCAT_EXEC="$(which nc) -q 0 -l 127.0.0.1 9000"
@@ -111,7 +112,12 @@ for pcap_file in *.pcap *.pcapng *.cap; do
printf "%-${LINE_SPACES}s\t" "${pcap_file}" printf "%-${LINE_SPACES}s\t" "${pcap_file}"
${nDPId_test_EXEC} "${pcap_file}" \ if [ ! -z "${STRACE_EXEC}" ]; then
STRACE_CMD="${STRACE_EXEC} -f -e decode-fds=path,socket,dev,pidfd -s 1024 -o /tmp/nDPId-test-stderr/${pcap_file}.strace.out"
else
STRACE_CMD=""
fi
${STRACE_CMD} ${nDPId_test_EXEC} "${pcap_file}" \
>"/tmp/nDPId-test-stdout/${pcap_file}.out.new" \ >"/tmp/nDPId-test-stdout/${pcap_file}.out.new" \
2>>"/tmp/nDPId-test-stderr/${pcap_file}.out" 2>>"/tmp/nDPId-test-stderr/${pcap_file}.out"
nDPId_test_RETVAL=$? nDPId_test_RETVAL=$?