Improve DHCP IP address parsing speed for journal
This PR aims to improve DHCP parsing logic introduced in #550. Unfortunately the previous approach makes interactive commands such as target-info slow. We have opted to only parse the first 10000 journal log messages for DHCP IP address leases by default. This can be extended with the flag --dhcp-all.
Hi @Horofic could you take a look at this PR? This fix makes sure target-info does not take up to two hours to complete :)
It also seems like to the test_ips_dhcp now fails.
It also seems like to the test_ips_dhcp now fails.
Those should now be fixed!
Codecov Report
Attention: Patch coverage is 82.35294% with 3 lines in your changes missing coverage. Please review.
Project coverage is 75.24%. Comparing base (
11afdf0) to head (8851f13).
| Files | Patch % | Lines |
|---|---|---|
| dissect/target/helpers/network_managers.py | 81.25% | 3 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #687 +/- ##
==========================================
+ Coverage 75.21% 75.24% +0.03%
==========================================
Files 296 296
Lines 25422 25434 +12
==========================================
+ Hits 19121 19139 +18
+ Misses 6301 6295 -6
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 75.24% <82.35%> (+0.03%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.