Skip to content

Conversation

@lukashino
Copy link
Contributor

Follow-up of #13957

Link to ticket: https://redmine.openinfosecfoundation.org/issues/6927

The PR is adding unit tests tailored to verify CPU threading logic and the automatic calculation of mempool cache of the interface.

Describe changes:

v2:

  • rebased

v1:

  • new unit tests
  • skip directive for unit tests for incompatible environments

Lukas Sismis added 7 commits October 6, 2025 18:22
To better control the values within the variables and to
prepare for the follow-up unit tests, the variable was moved
into global scope and should accessed only by functions.
This allows reinstantination of the variable value - needed for
unit tests.

Ticket: 6927
Needed by unit tests to properly reset the device list.

Ticket: 6927
For the upcoming changes, skipping a unit test might be beneficial
when testing a function that retrieves hardware data. This can e.g. depend
on the number of CPU cores and systems that does not meet the required
test criteria will need to omit the tests.
The tests should always target minimal system requirements

Ticket: 6927
The commit adds unit tests for mempool cache calculation.
The DPDK mempool cache can be automatically calculated
from the size of the mempool.

The commit also adds unit tests for automatic thread
distribution when multiple interfaces are present
and when there is a possible overlap with management
threads.

Ticket: 6927
@codecov
Copy link

codecov bot commented Oct 6, 2025

Codecov Report

❌ Patch coverage is 92.78351% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.89%. Comparing base (27383f8) to head (400abda).
⚠️ Report is 166 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13971      +/-   ##
==========================================
+ Coverage   83.87%   83.89%   +0.02%     
==========================================
  Files        1011     1011              
  Lines      275561   275850     +289     
==========================================
+ Hits       231128   231434     +306     
+ Misses      44433    44416      -17     
Flag Coverage Δ
fuzzcorpus 63.51% <50.00%> (+0.01%) ⬆️
livemode 19.37% <69.23%> (-0.04%) ⬇️
pcap 44.75% <100.00%> (+0.02%) ⬆️
suricata-verify 65.16% <100.00%> (-0.02%) ⬇️
unittests 58.84% <92.78%> (-0.33%) ⬇️

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@suricata-qa
Copy link

Information: QA ran without warnings.

Pipeline = 27884

@jasonish
Copy link
Member

In what environment would I see tests skipped?

@lukashino
Copy link
Contributor Author

lukashino commented Oct 22, 2025

In this case, it would be in environments with not enough CPUs to try some of the CPU affinity functions.

@lukashino
Copy link
Contributor Author

Follow-up in #14113

@lukashino lukashino closed this Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants