about summary refs log tree commit diff
path: root/nixos/tests/tracee.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/tests/tracee.nix')
-rw-r--r--nixos/tests/tracee.nix11
1 files changed, 7 insertions, 4 deletions
diff --git a/nixos/tests/tracee.nix b/nixos/tests/tracee.nix
index 26d0ada931b1c..72e82ec0b7edf 100644
--- a/nixos/tests/tracee.nix
+++ b/nixos/tests/tracee.nix
@@ -14,15 +14,18 @@ import ./make-test-python.nix ({ pkgs, ... }: {
           patches = oa.patches or [] ++ [
             # change the prefix from /usr/bin to /run to find nix processes
             ../../pkgs/tools/security/tracee/test-EventFilters-prefix-nix-friendly.patch
-            # skip magic_write test that currently fails
-            ../../pkgs/tools/security/tracee/test-EventFilters-magic_write-skip.patch
           ];
           buildPhase = ''
             runHook preBuild
             # just build the static lib we need for the go test binary
-            make $makeFlags ''${enableParallelBuilding:+-j$NIX_BUILD_CORES -l$NIX_BUILD_CORES} bpf-core ./dist/btfhub ./dist/libbpf/libbpf.a
+            make $makeFlags ''${enableParallelBuilding:+-j$NIX_BUILD_CORES -l$NIX_BUILD_CORES} bpf-core ./dist/btfhub
+
+            # remove the /usr/bin prefix to work with the patch above
+            substituteInPlace tests/integration/integration_test.go \
+              --replace "/usr/bin/ls" "ls"
+
             # then compile the tests to be ran later
-            CGO_CFLAGS="-I$PWD/dist/libbpf" CGO_LDFLAGS="-lelf -lz $PWD/dist/libbpf/libbpf.a" go test -tags core,ebpf,integration -p 1 -c -o $GOPATH/tracee-integration ./tests/integration/...
+            CGO_LDFLAGS="$(pkg-config --libs libbpf)" go test -tags core,ebpf,integration -p 1 -c -o $GOPATH/tracee-integration ./tests/integration/...
             runHook postBuild
           '';
           doCheck = false;