Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[test][sockhash/map] Fix the test to work with kernels >= 5.15
Those tests have started to fail since kernel 5.15. The restriction was lifted in https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=0c48eefae712c2fd91480346a07a1a9cd0f9470b This diff makes the expected returned value to the call to `update_value` conditional on the kernel version. Tested on 5.15 (using a Ubuntu 22.04 host), which is representative of the kernel running in GH CI. Also tested on Ubuntu 20.04 stock kernel: ``` $ 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-focal \ /bin/bash -c \ '/bcc/build/tests/wrapper.sh \ c_test_all sudo /bcc/build/tests/cc/test_libbcc "test sock*"' =============================================================================== All tests passed (8 assertions in 2 test cases) [22:40:55] chantra@focal:bcc git:(fix_sock_map_tests*) $ uname -a Linux focal 5.4.0-122-generic iovisor#138-Ubuntu SMP Wed Jun 22 15:00:31 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux ```
- Loading branch information