Open fruffy opened 8 months ago
Yes some tests for the backend like eBPF and uBPF fails, when I ran ctest
for the first time this is output -
What is the output of the failures with ctest --output-on-failure -R ebpf/
?
ctest --output-on-failure -R ebpf/
Test project /home/sanket-teli/gsoc/p4c/build
Start 280: ebpf/testdata/p4_16_samples/action_call_ebpf.p4
1/28 Test 280: ebpf/testdata/p4_16_samples/action_call_ebpf.p4 .........Failed 0.55 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from ~~~~
WARNING:compilation terminated.
WARNING:make:
Start 281: ebpf/testdata/p4_16_samples/action_call_table_ebpf.p4
2/28 Test 281: ebpf/testdata/p4_16_samples/action_call_table_ebpf.p4 ...Failed 0.53 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from ~~~~
WARNING:compilation terminated.
WARNING:make:
Start 282: ebpf/testdata/p4_16_samples/advance_ebpf.p4
3/28 Test 282: ebpf/testdata/p4_16_samples/advance_ebpf.p4 .............Failed 0.55 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from ~~~~
WARNING:compilation terminated.
WARNING:make:
Start 283: ebpf/testdata/p4_16_samples/bool_ebpf.p4
4/28 Test 283: ebpf/testdata/p4_16_samples/bool_ebpf.p4 ................Failed 0.52 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from ~~~~
WARNING:compilation terminated.
WARNING:make:
Start 284: ebpf/testdata/p4_16_samples/count_add_ebpf.p4
5/28 Test 284: ebpf/testdata/p4_16_samples/count_add_ebpf.p4 ...........Failed 0.50 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from ~~~~
WARNING:compilation terminated.
WARNING:make:
Start 285: ebpf/testdata/p4_16_samples/count_ebpf.p4
6/28 Test 285: ebpf/testdata/p4_16_samples/count_ebpf.p4 ...............Failed 0.54 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from ~~~~
WARNING:compilation terminated.
WARNING:make:
Start 286: ebpf/testdata/p4_16_samples/hit_ebpf.p4
7/28 Test 286: ebpf/testdata/p4_16_samples/hit_ebpf.p4 .................Failed 0.52 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from ~~~~
WARNING:compilation terminated.
WARNING:make:
Start 287: ebpf/testdata/p4_16_samples/init_ebpf.p4
8/28 Test 287: ebpf/testdata/p4_16_samples/init_ebpf.p4 ................Failed 0.51 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from ~~~~
WARNING:compilation terminated.
WARNING:make:
Start 288: ebpf/testdata/p4_16_samples/issue2791_ebpf.p4
9/28 Test 288: ebpf/testdata/p4_16_samples/issue2791_ebpf.p4 ...........Failed 0.49 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from ~~~~
WARNING:compilation terminated.
WARNING:make:
Start 289: ebpf/testdata/p4_16_samples/issue2793_ebpf.p4
10/28 Test 289: ebpf/testdata/p4_16_samples/issue2793_ebpf.p4 ...........Failed 0.53 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from ~~~~
WARNING:compilation terminated.
WARNING:make:
Start 290: ebpf/testdata/p4_16_samples/issue2797_ebpf.p4
11/28 Test 290: ebpf/testdata/p4_16_samples/issue2797_ebpf.p4 ...........Failed 0.50 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from ~~~~
WARNING:compilation terminated.
WARNING:make:
Start 291: ebpf/testdata/p4_16_samples/issue2816-1_ebpf.p4
12/28 Test 291: ebpf/testdata/p4_16_samples/issue2816-1_ebpf.p4 .........Failed 0.55 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from ~~~~
WARNING:compilation terminated.
WARNING:make:
Start 292: ebpf/testdata/p4_16_samples/issue2816_ebpf.p4
13/28 Test 292: ebpf/testdata/p4_16_samples/issue2816_ebpf.p4 ...........Failed 0.55 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from ~~~~
WARNING:compilation terminated.
WARNING:make:
Start 293: ebpf/testdata/p4_16_samples/issue870_ebpf.p4
14/28 Test 293: ebpf/testdata/p4_16_samples/issue870_ebpf.p4 ............Failed 0.63 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from ~~~~
WARNING:compilation terminated.
WARNING:make:
Start 294: ebpf/testdata/p4_16_samples/key-issue-1020_ebpf.p4
15/28 Test 294: ebpf/testdata/p4_16_samples/key-issue-1020_ebpf.p4 ......Failed 0.61 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from ~~~~
WARNING:compilation terminated.
WARNING:make:
Start 295: ebpf/testdata/p4_16_samples/key_ebpf.p4
16/28 Test 295: ebpf/testdata/p4_16_samples/key_ebpf.p4 .................Failed 0.53 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from ~~~~
WARNING:compilation terminated.
WARNING:make:
Start 296: ebpf/testdata/p4_16_samples/length_ebpf.p4
17/28 Test 296: ebpf/testdata/p4_16_samples/length_ebpf.p4 ..............Failed 0.53 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from ~~~~
WARNING:compilation terminated.
WARNING:make:
Start 297: ebpf/testdata/p4_16_samples/lpm_ebpf.p4
18/28 Test 297: ebpf/testdata/p4_16_samples/lpm_ebpf.p4 ................. Passed 0.57 sec
Start 298: ebpf/testdata/p4_16_samples/stack_ebpf.p4
19/28 Test 298: ebpf/testdata/p4_16_samples/stack_ebpf.p4 ...............Failed 0.55 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from ~~~~
WARNING:compilation terminated.
WARNING:make:
Start 299: ebpf/testdata/p4_16_samples/switch_ebpf.p4
20/28 Test 299: ebpf/testdata/p4_16_samples/switch_ebpf.p4 ..............Failed 0.53 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from ~~~~
WARNING:compilation terminated.
WARNING:make:
Start 300: ebpf/testdata/p4_16_samples/ternary_ebpf.p4
21/28 Test 300: ebpf/testdata/p4_16_samples/ternary_ebpf.p4 ............. Passed 0.52 sec
Start 301: ebpf/testdata/p4_16_samples/test_ebpf.p4
22/28 Test 301: ebpf/testdata/p4_16_samples/test_ebpf.p4 ................Failed 0.60 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from ~~~~
WARNING:compilation terminated.
WARNING:make:
Start 302: ebpf/testdata/p4_16_samples/two_ebpf.p4
23/28 Test 302: ebpf/testdata/p4_16_samples/two_ebpf.p4 .................Failed 0.57 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from ~~~~
WARNING:compilation terminated.
WARNING:make:
Start 303: ebpf/testdata/p4_16_samples/valid_ebpf.p4
24/28 Test 303: ebpf/testdata/p4_16_samples/valid_ebpf.p4 ...............Failed 0.57 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from ~~~~
WARNING:compilation terminated.
WARNING:make:
Start 304: ebpf/testdata/p4_16_samples/value_set_ebpf.p4
25/28 Test 304: ebpf/testdata/p4_16_samples/value_set_ebpf.p4 ...........Failed 0.54 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from ~~~~
WARNING:compilation terminated.
WARNING:make:
Start 305: ebpf/testdata/p4_16_samples/verify_ebpf.p4
26/28 Test 305: ebpf/testdata/p4_16_samples/verify_ebpf.p4 ..............Failed 0.47 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from ~~~~
WARNING:compilation terminated.
WARNING:make:
Start 307: ebpf/testdata/p4_16_samples/ebpf_checksum_extern.p4
27/28 Test 307: ebpf/testdata/p4_16_samples/ebpf_checksum_extern.p4 .....Failed 0.60 sec
WARNING:In file included from /home/sanket-teli/gsoc/p4c/backends/ebpf/runtime/ebpf_runtime_test.h:26,
WARNING: from ~~~~
WARNING:compilation terminated.
WARNING:make:
Start 308: ebpf/testdata/p4_16_samples/ebpf_conntrack_extern.p4
28/28 Test 308: ebpf/testdata/p4_16_samples/ebpf_conntrack_extern.p4 .... Passed 0.69 sec
11% tests passed, 25 tests failed out of 28
Label Time Summary: XFAIL = 1.78 secproc (3 tests) ebpf = 15.36 secproc (28 tests)
Total Test time (real) = 15.49 sec
The following tests FAILED: 280 - ebpf/testdata/p4_16_samples/action_call_ebpf.p4 (Failed) 281 - ebpf/testdata/p4_16_samples/action_call_table_ebpf.p4 (Failed) 282 - ebpf/testdata/p4_16_samples/advance_ebpf.p4 (Failed) 283 - ebpf/testdata/p4_16_samples/bool_ebpf.p4 (Failed) 284 - ebpf/testdata/p4_16_samples/count_add_ebpf.p4 (Failed) 285 - ebpf/testdata/p4_16_samples/count_ebpf.p4 (Failed) 286 - ebpf/testdata/p4_16_samples/hit_ebpf.p4 (Failed) 287 - ebpf/testdata/p4_16_samples/init_ebpf.p4 (Failed) 288 - ebpf/testdata/p4_16_samples/issue2791_ebpf.p4 (Failed) 289 - ebpf/testdata/p4_16_samples/issue2793_ebpf.p4 (Failed) 290 - ebpf/testdata/p4_16_samples/issue2797_ebpf.p4 (Failed) 291 - ebpf/testdata/p4_16_samples/issue2816-1_ebpf.p4 (Failed) 292 - ebpf/testdata/p4_16_samples/issue2816_ebpf.p4 (Failed) 293 - ebpf/testdata/p4_16_samples/issue870_ebpf.p4 (Failed) 294 - ebpf/testdata/p4_16_samples/key-issue-1020_ebpf.p4 (Failed) 295 - ebpf/testdata/p4_16_samples/key_ebpf.p4 (Failed) 296 - ebpf/testdata/p4_16_samples/length_ebpf.p4 (Failed) 298 - ebpf/testdata/p4_16_samples/stack_ebpf.p4 (Failed) 299 - ebpf/testdata/p4_16_samples/switch_ebpf.p4 (Failed) 301 - ebpf/testdata/p4_16_samples/test_ebpf.p4 (Failed) 302 - ebpf/testdata/p4_16_samples/two_ebpf.p4 (Failed) 303 - ebpf/testdata/p4_16_samples/valid_ebpf.p4 (Failed) 304 - ebpf/testdata/p4_16_samples/value_set_ebpf.p4 (Failed) 305 - ebpf/testdata/p4_16_samples/verify_ebpf.p4 (Failed) 307 - ebpf/testdata/p4_16_samples/ebpf_checksum_extern.p4 (Failed) Errors while running CTest
Please format the comment so it does not accidentally reference other issues.
But it looks like the failures are coming from pcap not being installed, so they are directly related to the problem in this issue. The eBPF back end tests should not be run if these dependencies are missing.
I think I understood what needs to be done here, I would like to work on this issue.
Can I work on this?
Sure! The context of this issue is https://github.com/p4lang/p4c/pull/4132. The packages should be part of the eBPF CMake instead.
@fruffy I am planning to modify CMakeLists.txt for each backend and check for the dependencies, if any of the dependency is not present, we skip the test and give out a warning message
check_dependency(Pcap)
if (NOT Pcap_FOUND)
message(WARNING "eBPF backend tests skipped due to missing pcap dependency.")
return()
endif()
I will make a module to check dependencies in the root CMakeLists.txt file and reuse it for general context.
Should I go forward with this approach
Yes, that sounds good! Make sure the return() works as intended.
There is probably a couple more dependencies like that:
tcpdump libpcap-dev gcc-multilib
for example. Where tcpdump is actually a binary.
This is something that always throws of first-time users of the compiler. In particular when they run
ctest
they see a bunch of failing tests because runtime dependencies of these tests are missing.