Skip to content
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

feat: add unit tests from kernel #354

Merged
merged 26 commits into from
Oct 20, 2024

Conversation

kenlig
Copy link
Contributor

@kenlig kenlig commented Sep 27, 2024

This PR integrates some bpf unittests from kernel (https://elixir.bootlin.com/linux/latest/source/tools/testing/selftests/bpf) into bpftime.

These tests from test_maps.c are expected to work:

  • test_hashmap
  • test_hashmap_sizes
  • test_hashmap_percpu
  • test_hashmap_walk
  • test_arraymap
  • test_arraymap_percpu
  • test_arraymap_percpu_many_keys
  • test_map_large
  • test_map_stress
  • test_update_delete
  • test_map_parallel
  • test_map_rdonly
  • test_map_wronly_hash

Note hash map tests are only implemented for var_size_hash_map_impl, also used pre-allocated nodes for performance increasing

@Officeyutong Officeyutong marked this pull request as draft September 27, 2024 16:38
Copy link

codecov bot commented Oct 19, 2024

Codecov Report

Attention: Patch coverage is 96.44860% with 19 lines in your changes missing coverage. Please review.

Project coverage is 92.90%. Comparing base (da6ba42) to head (7361d02).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
runtime/unit-test/maps/kernel_unit_tests.cpp 95.65% 19 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #354      +/-   ##
==========================================
+ Coverage   91.75%   92.90%   +1.14%     
==========================================
  Files          34       37       +3     
  Lines        1189     1720     +531     
  Branches       61      103      +42     
==========================================
+ Hits         1091     1598     +507     
- Misses         98      122      +24     
Flag Coverage Δ
attach tests (uprobe & syscall trace) 97.30% <ø> (-0.05%) ⬇️
runtime tests 91.15% <96.44%> (+2.57%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Officeyutong Officeyutong marked this pull request as ready for review October 20, 2024 17:16
@Officeyutong Officeyutong requested a review from yunwei37 October 20, 2024 17:16
@yunwei37 yunwei37 merged commit 327ba8d into eunomia-bpf:master Oct 20, 2024
94 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants