test: ensure interface chosen is managed by NetworkManager#326
Conversation
Reviewer's GuideTest playbook is updated to select a PCI-backed ethernet interface that is actively managed and connected via NetworkManager, ensure NetworkManager is present and running across supported distros, wire that interface’s PCI ID and name into assertions, and add more robust debugging and cleanup around iptables/nftables and temp dirs. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The
varsdefined on theTest interfaces with PCI idsblock (iface_pathandpci_id) referencepci_id_result.stdout_lines[...]beforepci_id_resultis registered, which will fail at runtime; consider moving these into a separateset_facttask after thepci_id_resulttask. - The shell task that finds the first interface managed by NetworkManager uses the bash-specific
[[ ... ]]test operator but does not specifyexecutable: /bin/bash, which can break on systems where/bin/shis not bash; either declare the bash executable or use POSIX-compliant[ ... ]syntax.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `vars` defined on the `Test interfaces with PCI ids` block (`iface_path` and `pci_id`) reference `pci_id_result.stdout_lines[...]` before `pci_id_result` is registered, which will fail at runtime; consider moving these into a separate `set_fact` task after the `pci_id_result` task.
- The shell task that finds the first interface managed by NetworkManager uses the bash-specific `[[ ... ]]` test operator but does not specify `executable: /bin/bash`, which can break on systems where `/bin/sh` is not bash; either declare the bash executable or use POSIX-compliant `[ ... ]` syntax.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
[citest] |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #326 +/- ##
==========================================
- Coverage 61.09% 58.20% -2.90%
==========================================
Files 2 2
Lines 910 1304 +394
==========================================
+ Hits 556 759 +203
- Misses 354 545 +191
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
NetworkManager must be running for this test to work, so ensure it. Ensure that the interface chosen is an active connected device managed by NM. Signed-off-by: Rich Megginson <rmeggins@redhat.com>
1ba7e9a to
a85cd09
Compare
|
[citest] |
NetworkManager must be running for this test to work, so ensure it.
Ensure that the interface chosen is an active connected device managed by NM.
Signed-off-by: Rich Megginson rmeggins@redhat.com
Summary by Sourcery
Ensure the firewall interface PCI test targets an active NetworkManager-managed PCI ethernet device and improves visibility of firewall ruleset changes.
Bug Fixes:
Enhancements:
Tests: