From afb97eb07ad052cf23cf0c80a83311ba4d87fa26 Mon Sep 17 00:00:00 2001 From: Rafael David Tinoco Date: Fri, 27 Oct 2023 21:23:43 -0300 Subject: [PATCH] fixes --- .../scripts/hooked_syscall.sh | 20 ++++++++++++++++++- tests/e2e-inst-test.sh | 9 +++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/tests/e2e-inst-signatures/scripts/hooked_syscall.sh b/tests/e2e-inst-signatures/scripts/hooked_syscall.sh index d5ec2ecffa58..bce8478bcad1 100755 --- a/tests/e2e-inst-signatures/scripts/hooked_syscall.sh +++ b/tests/e2e-inst-signatures/scripts/hooked_syscall.sh @@ -1,18 +1,36 @@ #!/usr/bin/bash -e +KERNEL_VERSION=$(uname -r) + exit_err() { echo -n "ERROR: " echo "$@" exit 1 } +. /etc/os-release + +if [[ "$VERSION_CODENAME" == "jammy" ]]; then + if [[ "$KERNEL_VERSION" == *"5.19"* ]]; then + apt-get update + apt-get install -y gcc-12 + fi +fi + +if [[ "$VERSION_CODENAME" == "mantic" ]]; then + if [[ "$KERNEL_VERSION" == *"6.5"* ]]; then + apt-get update + apt-get install -y gcc-13 + fi +fi + # Build and load module dir="tests/e2e-inst-signatures/scripts/hijack" cd $dir || exit_err "could not cd to $dir" make && ./load.sh || exit_err "could not load module" # Sleep a bit to allow module to load -sleep 3 +sleep 5 # Unload module after 30 seconds nohup sleep 30 > /dev/null 2>&1 && ./unload.sh & diff --git a/tests/e2e-inst-test.sh b/tests/e2e-inst-test.sh index 786cf9028276..31a38b7fcb8f 100755 --- a/tests/e2e-inst-test.sh +++ b/tests/e2e-inst-test.sh @@ -36,6 +36,8 @@ if [[ $UID -ne 0 ]]; then error_exit "need root privileges" fi +. /etc/os-release + if [[ ! -d ./signatures ]]; then error_exit "need to be in tracee root directory" fi @@ -91,6 +93,13 @@ for TEST in $TESTS; do case $TEST in HOOKED_SYSCALL) + if [[ "$VERSION_CODENAME" == "mantic" ]]; then + if [[ "$KERNEL_VERSION" == *"6.5"* ]]; then + # v6.5 and mantic needs fixing + info "skip hooked_syscall test in mantic" + continue + fi + fi if [[ $ARCH == "aarch64" ]]; then info "skip hooked_syscall test in aarch64" continue