Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The test "searching for modules in /proc/[pid]/maps" was trying to load `dummy_proc_map.txt` from the current directory. When running in a container, the current directory is set to `/`. One way around this in CI would be to use the argument `-w /bcc/build/tests/cc` so we change current directory. On the other hand, our CMakeLists.txt file already copy the dummy file to CMAKE_CURRENT_BINARY_DIR. So we may as well use this. This diff sets `CMAKE_CURRENT_BINARY_DIR` as a define flag at compilation and we re-use this within the test itself to load the file properly. Test: ``` $ docker run -ti \ --privileged \ --network=host \ --pid=host \ -v $(pwd):/bcc \ -v /sys/kernel/debug:/sys/kernel/debug:rw \ -v /lib/modules:/lib/modules:ro \ -v /usr/src:/usr/src:ro \ -e CTEST_OUTPUT_ON_FAILURE=1 \ bcc-docker-fedora \ /bin/bash -c \ '/bcc/build/tests/wrapper.sh \ c_test_all sudo /bcc/build/tests/cc/test_libbcc "searching for modules *"' =============================================================================== All tests passed (15 assertions in 1 test case) ```
- Loading branch information