-
Notifications
You must be signed in to change notification settings - Fork 155
Bpftool tests ci #10780
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
Open
Tropicao
wants to merge
4
commits into
kernel-patches:bpf-next_base
Choose a base branch
from
Tropicao:bpftool-tests-ci
base: bpf-next_base
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Bpftool tests ci #10780
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9881c70 to
1b66e85
Compare
243bdd7 to
24a3f92
Compare
028bb9d to
0958f1c
Compare
b96afa5 to
a172611
Compare
a5493b2 to
b67a8b8
Compare
bcd42c7 to
5b97fbd
Compare
5b97fbd to
5f0eb13
Compare
In order to integrate some bpftool tests into test_progs, define a few specific helpers that allow to execute bpftool commands, while possibly retrieving the command output. Those helpers most notably set the path to the bpftool binary under test. This version checks different possible paths relative to the directories where the different test_progs runners are executed, as we want to make sure not to accidentally use a bootstrap version of the binary. Signed-off-by: Alexis Lothoré (eBPF Foundation) <alexis.lothore@bootlin.com> --- Changes in v2: - Drop the new runner from commit, keep only the new bpftool-specific helpers - replace hardcoded path with a detected (and cached) path
…work The test_bpftool_metadata.sh script validates that bpftool properly returns in its ouptput any metadata generated by bpf programs through some .rodata sections. Port this test to the test_progs framework so that it can be executed automatically in CI. The new test, similarly to the former script, checks that valid data appears both for textual output and json output, as well as for both data not used at all and used data. For the json check part, the expected json string is hardcoded to avoid bringing a new external dependency (eg: a json deserializer) for test_progs. As the test is now converted into test_progs, remove the former script. The newly converted test brings two new subtests: kernel-patches#37/1 bpftool_metadata/metadata_unused:OK kernel-patches#37/2 bpftool_metadata/metadata_used:OK kernel-patches#37 bpftool_metadata:OK Summary: 1/2 PASSED, 0 SKIPPED, 0 FAILED Signed-off-by: Alexis Lothoré (eBPF Foundation) <alexis.lothore@bootlin.com> --- Changes in v2: - move the new test in prog_tests directory - use power of 2 for bpftool output buffer size - check snprintf return when building commands - target program by pin path rather than prog name - remove a few blank lines
…mework The test_bpftool_map.sh script tests that maps read/write accesses are being properly allowed/refused by the kernel depending on a specific fmod_ret program being attached on security_bpf_map function. Rewrite this test to integrate it in the test_progs. The new test spawns a few subtests: kernel-patches#36/1 bpftool_maps_access/unprotected_unpinned:OK kernel-patches#36/2 bpftool_maps_access/unprotected_pinned:OK kernel-patches#36/3 bpftool_maps_access/protected_unpinned:OK kernel-patches#36/4 bpftool_maps_access/protected_pinned:OK kernel-patches#36/5 bpftool_maps_access/nested_maps:OK kernel-patches#36/6 bpftool_maps_access/btf_list:OK kernel-patches#36 bpftool_maps_access:OK Summary: 1/6 PASSED, 0 SKIPPED, 0 FAILED Signed-off-by: Alexis Lothoré (eBPF Foundation) <alexis.lothore@bootlin.com> Acked-by: Quentin Monnet <qmo@kernel.org> --- Changes in v2: - move the new test in prog_tests directory - collect Quentin's AB
b67a8b8 to
4c979fc
Compare
403c46b to
53953d6
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
test