1 { lib, tracee, makeWrapper }:
2 tracee.overrideAttrs (oa: {
3 pname = oa.pname + "-integration";
4 postPatch = oa.postPatch or "" + ''
5 # fix the test to look at nixos paths for running programs
6 # --replace-fail '"integration.tes"' '"tracee-integrat"' \
7 substituteInPlace tests/integration/event_filters_test.go \
8 --replace-fail "exec=/usr/bin/dockerd" "comm=dockerd" \
9 --replace-fail "exec=/usr/bin" "exec=/tmp/testdir" \
10 --replace-fail "/usr/bin/tee" "tee" \
11 --replace-fail "/usr/bin" "/run/current-system/sw/bin" \
12 --replace-fail 'syscallerAbsPath := filepath.Join("..", "..", "dist", "syscaller")' "syscallerAbsPath := filepath.Join(\"$out/bin/syscaller\")"
13 substituteInPlace tests/integration/exec_test.go \
14 --replace-fail "/usr/bin" "/run/current-system/sw/bin"
16 nativeBuildInputs = oa.nativeBuildInputs or [ ] ++ [ makeWrapper ];
19 # copy existing built object to dist
21 touch dist/btfhub/.placeholder
22 cp ${lib.getOutput "lib" tracee}/lib/tracee/tracee.bpf.o ./dist/
24 # then compile the tests to be ran later
25 mkdir -p $GOPATH/tracee-integration
26 CGO_LDFLAGS="$(pkg-config --libs libbpf)" go build -o $GOPATH/tracee-integration/syscaller ./tests/integration/syscaller/cmd
27 CGO_LDFLAGS="$(pkg-config --libs libbpf)" go test -tags core,ebpf,integration -c -o $GOPATH/tracee-integration/ ./tests/integration/...
33 mv $GOPATH/tracee-integration/{integration.test,syscaller} $out/bin/
34 # cp -r ${tracee}/bin/signatures $out/bin/
36 doInstallCheck = false;
40 outputsToInstall = [ "out" ];