Skip to content

Commit

Permalink
fix: e2e-net-tests should use unified binary
Browse files Browse the repository at this point in the history
  • Loading branch information
josedonizetti committed Feb 1, 2024
1 parent d3c00ab commit 3d25492
Showing 1 changed file with 9 additions and 23 deletions.
32 changes: 9 additions & 23 deletions tests/e2e-net-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ set -e
make -j$(nproc) all
make e2e-net-signatures
set +e
if [[ ! -x ./dist/tracee-ebpf || ! -x ./dist/tracee-rules ]]; then
if [[ ! -x ./dist/tracee ]]; then
error_exit "could not find tracee executables"
fi

Expand All @@ -86,28 +86,18 @@ for TEST in $TESTS; do
info

rm -f $SCRIPT_TMP_DIR/build-$$
rm -f $SCRIPT_TMP_DIR/ebpf-$$

events=$(./dist/tracee-rules --allcaps --rules-dir ./dist/e2e-net-signatures/ --rules $TEST --list-events)

./dist/tracee-ebpf \
./dist/tracee \
--install-path $TRACEE_TMP_DIR \
--cache cache-type=mem \
--cache mem-cache-size=512 \
--output format:json \
--output option:parse-arguments \
--output json \
--scope comm=ping,nc,nslookup,isc-net-0000,isc-worker0000,curl \
--events $events \
2>$SCRIPT_TMP_DIR/ebpf-$$ |
./dist/tracee-rules \
--rules-dir ./dist/e2e-net-signatures/ \
--input-tracee=file:stdin \
--input-tracee format:json \
--rules $TEST \
--allcaps 2>&1 |
--signatures-dir ./dist/e2e-net-signatures/ \
2>&1 |
tee $SCRIPT_TMP_DIR/build-$$ 2>&1 &

# wait tracee-ebpf to be started (30 sec most)
# wait tracee to be started (30 sec most)
times=0
timedout=0
while true; do
Expand Down Expand Up @@ -163,21 +153,17 @@ for TEST in $TESTS; do
info

rm -f $SCRIPT_TMP_DIR/build-$$
rm -f $SCRIPT_TMP_DIR/ebpf-$$

# make sure we exit both to start them again

pid_rules=$(pidof tracee-rules)
pid_ebpf=$(pidof tracee-ebpf)
pid_tracee=$(pidof tracee)

kill -2 $pid_rules
kill -2 $pid_ebpf
kill -2 $pid_tracee

sleep $TRACEE_SHUTDOWN_TIMEOUT

# make sure tracee is exited with SIGKILL
kill -9 $pid_rules >/dev/null 2>&1
kill -9 $pid_ebpf >/dev/null 2>&1
kill -9 $pid_tracee >/dev/null 2>&1

# give a little break for OS noise to reduce
sleep 3
Expand Down

0 comments on commit 3d25492

Please sign in to comment.