-
Notifications
You must be signed in to change notification settings - Fork 268
Expanded certain unit tests to run for native programs #4660
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
196708b to
7e9560b
Compare
229b450 to
bd8e839
Compare
ce77c22 to
14c75e9
Compare
Formatting changes Rewrote more tests to run for all eBPF programs. Modified certain tests to run for all types of eBPF programs. Modified specific netsh_test to include all eBPF program types. Added a scope exit to ensure cleanup during fault injection. Reordered cleanup in test helper destructor.
14c75e9 to
d49e78f
Compare
dthaler
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving since my remaining comment is not a big deal either way.
If you need to rev this again for some other reason, would be good to address.
But ok with me to merge if someone else approves it as is.
| #if !defined(CONFIG_BPF_JIT_DISABLED) | ||
| void | ||
| test_invalid_bpf_action(char log_buffer[]) | ||
| { | ||
| REQUIRE(errno == EACCES); | ||
| REQUIRE(strcmp(log_buffer, "0: Invalid type (r0.type == number)\n\n") == 0); | ||
| } | ||
| #else | ||
| void | ||
| test_invalid_bpf_action(char log_buffer[]) | ||
| { | ||
| UNREFERENCED_PARAMETER(log_buffer); | ||
| REQUIRE(errno == ENOTSUP); | ||
| } | ||
| #endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is ok, but since lines 135, 136, and 139 are the same as 142, 143, and 146, it would seem better to me to put the ifdefs inside the function, only wrapping the two different lines.
Description
Resolves #4261
Some tests in libbpf_test.cpp and netsh_test.cpp only ran for JIT/Interpreted programs. Some of these tests should also run for native programs so for each applicable test, functionality was expanded so that the test would also run for native eBPF programs.
Testing
No new tests needed.
Documentation
No.
Installation
No.