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 77b637d commit 32c9b68
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions tests/e2e-net-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ info
info "= COMPILING TRACEE ============================================"
info
# make clean # if you want to be extra cautious
set -e
make -j$(nproc) all
make e2e-net-signatures
set +e
if [[ ! -x ./dist/tracee ]]; then
error_exit "could not find tracee executables"
fi
# set -e
# make -j$(nproc) all
# make e2e-net-signatures
# set +e
# if [[ ! -x ./dist/tracee ]]; then
# error_exit "could not find tracee executables"
# fi

# if any test has failed
anyerror=""
Expand All @@ -93,8 +93,7 @@ for TEST in $TESTS; do
--cache mem-cache-size=512 \
--output json \
--scope comm=ping,nc,nslookup,isc-net-0000,isc-worker0000,curl \
--signatures-dir ./dist/e2e-net-signatures/ \
2>&1 |
--signatures-dir ./dist/e2e-net-signatures/ 2>&1 |
tee $SCRIPT_TMP_DIR/build-$$ 2>&1 &

# wait tracee to be started (30 sec most)
Expand All @@ -116,12 +115,12 @@ for TEST in $TESTS; do
fi
done

# tracee-ebpf could not start for some reason, check stderr
# tracee could not start for some reason, check stderr
if [[ $timedout -eq 1 ]]; then
info
info "$TEST: FAILED. ERRORS:"
info
cat $SCRIPT_TMP_DIR/ebpf-$$
cat $SCRIPT_TMP_DIR/build-$$

anyerror="${anyerror}$TEST,"
continue
Expand All @@ -140,14 +139,14 @@ for TEST in $TESTS; do
## cleanup at EXIT

found=0
cat $SCRIPT_TMP_DIR/build-$$ | grep "Signature ID: $TEST" -B2 | head -3 | grep -q "\*\*\* Detection" && found=1
cat $SCRIPT_TMP_DIR/build-$$ | grep "\"signatureID\":\"$TEST\"" -B2 && found=1
info
if [[ $found -eq 1 ]]; then
info "$TEST: SUCCESS"
else
anyerror="${anyerror}$TEST,"
info "$TEST: FAILED, stderr from tracee-ebpf:"
cat $SCRIPT_TMP_DIR/ebpf-$$
info "$TEST: FAILED, stderr from tracee:"
cat $SCRIPT_TMP_DIR/build-$$
info
fi
info
Expand Down

0 comments on commit 32c9b68

Please sign in to comment.