Skip to content

Miscellaneous fixes / tiny features V1 - #65

Open
matyas7dub wants to merge 8 commits into
CESNET:mainfrom
matyas7dub:chore/misc-changes
Open

matyas7dub wants to merge 8 commits into
CESNET:mainfrom
matyas7dub:chore/misc-changes

Conversation

@matyas7dub

Copy link
Copy Markdown
Collaborator

This is a collection of commits with changes that I wanted to make, but making a ticket or PR for each seems overkill.

The main ones I would like to highlight are:

  • ConfigBuilder now doesn't assume that it is used for Suricata configuration files, since it was used for other yaml configs as well (TRex)
  • Logs now show how many packets TRex sent
  • Lots of python type stuff with pyright

@matyas7dub
matyas7dub requested a lite review from Copilot September 19, 2026 17:38
@matyas7dub matyas7dub changed the title Miscellaneous fixes / tiny features Miscellaneous fixes / tiny features V1 Sep 19, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

It introduces a tight polling loop risk in wait_on_start() and contains type/API inconsistencies that will likely cause pyright noise and maintainability issues.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity · 3 Low severity

Open (4)
What changed in this PR

This PR bundles several small improvements across the test suite: it generalizes ConfigBuilder so it’s not implicitly Suricata-specific, improves logging/observability for TRex and test runs, and includes various typing/pyright-driven cleanups.

Changes:

  • Generalize ConfigBuilder defaults and update call sites to pass explicit template config paths.
  • Add/adjust logging around pcap merging, run duration, Suricata start delay, and TRex TX counters.
  • Tighten typing and defensive handling in stats/graph utilities and some conftest helpers.
File Description
util/​trex_util.py Adds progress logging for pcap merges; removes unused type alias/imports.
util/​test_runner.py Logs run duration and Suricata RX packet/byte totals after stats are saved.
util/​suricata_manager.py Changes Suricata start delay measurement logic and logging.
util/​suri_util.py Returns aggregated stats from save_stats, adds debug logs for skipped stats, and renames get_trex_suri_stats parameter for clarity.
util/​make-graphs.py Makes parameters extraction tolerant to missing parameters key.
util/​config_builder.py Makes config template path explicit; introduces default config path constants.
README.md Fixes trailing commas in Python dict examples.
pytest_start.sh Makes set -x conditional on LOGLEVEL=DEBUG and improves unsupported-option handling.
performance_tests/​web_50_sites/​test_web_50_sites.py Removes redundant “Run ended” log line (now logged centrally).
performance_tests/​pcap_replay/​test_pcap_replay.py Removes redundant “Run ended” log line (now logged centrally).
performance_tests/​nfs_smb_simple/​test_nfs_smb_simple.py Removes redundant “Run ended” log line (now logged centrally).
performance_tests/​https_simple/​test_https_simple.py Removes redundant “Run ended” log line (now logged centrally).
performance_tests/​http_simple/​test_http_simple.py Removes redundant “Run ended” log line (now logged centrally).
performance_tests/​http_https_smb_simple/​test_http_https_smb_simple.py Removes redundant “Run ended” log line (now logged centrally).
conftest.py Adds byte formatting helper, exports formatting helpers for reuse, and updates fixtures/helpers for new ConfigBuilder behavior.
assets/​trex/​traffic_profiles/​trex_client_manager.py Logs TRex TX totals on stop, hardens stats getters, and refines typing/casts.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread util/suricata_manager.py
Comment thread assets/trex/traffic_profiles/trex_client_manager.py
Comment thread pytest_start.sh
Comment thread util/config_builder.py
@matyas7dub matyas7dub mentioned this pull request Sep 19, 2026
@matyas7dub

Copy link
Copy Markdown
Collaborator Author

The changes mentioned by copilot will be fixed in a V2, but since they are quite minor it can still be reviewed as is

Comment thread README.md
filter = {
"dpdk": [lambda x: x["dpdk.interfaces[0].mtu"] <= 3000],
"af-packet": [lambda x: True]
"af-packet": [lambda x: True],

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mysterious comma!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That one is from the ruff markdown formatting commit, and I figured it won't hurt to leave it there 😝

Speaking of that, there is a new ruff version which has new linter rules (and this markdown formatting), so we might want to update it.

@Davihan11

Copy link
Copy Markdown
Collaborator

v1 refactors and other stuff LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants