Commit c9cbf93
fix: Fix "interface_pci_id" role option
Cause: The introduction of this feature in commit 2b0bb1b was broken:
The new `interface_pci_id` option was not passed to `firewall_lib`. The
integration test case was very shallow and did not verify the success of
the operation.
Consequence: Calling the role with `interface_pci_id` had no effect,
that setting was ignored.
Fix: Pass the option to the module.
Rework the test, which was pretty much completely broken:
- Add a positive assertion that the interface mapped to the given PCI
ID actually appears in the nftables/iptables rules.
- Replace the hardcoded 1af4:0001 ID in the test with runtime
detection. That *happens* to be the ID of QEMU's virtio card, but
this is neither obvious nor reliable nor does it apply to other
environments such as Testing Farm.
- Container environments don't have any "real" (PCI) interface, so
skip the test if we can't find any.
- The iptables vs. nftables detection was also broken on RHEL > 9 and
Fedora, as `dbus-send` is not installed by default any more
(`busctl` is more modern, but not yet available in RHEL 7), and the
D-Bus property does not exist on RHEL 7 either. This was shadowed by
the bug above (the actually checked backend didn't matter). The
dynamic detection is too hard/brittle to fix, and there is no
surprise about the backend anyway: RHEL 7 uses iptables, everything
else nftables. So put that condition into the test directly, which
is much more robust.
Fixes #2721 parent 547b7fd commit c9cbf93
2 files changed
+52
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
101 | 102 | | |
102 | 103 | | |
103 | 104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
| 10 | + | |
23 | 11 | | |
24 | 12 | | |
25 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
26 | 28 | | |
27 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
28 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
29 | 43 | | |
30 | 44 | | |
31 | 45 | | |
32 | 46 | | |
33 | 47 | | |
34 | 48 | | |
35 | | - | |
| 49 | + | |
36 | 50 | | |
37 | 51 | | |
38 | 52 | | |
| |||
42 | 56 | | |
43 | 57 | | |
44 | 58 | | |
45 | | - | |
| 59 | + | |
46 | 60 | | |
47 | 61 | | |
48 | 62 | | |
49 | | - | |
| 63 | + | |
50 | 64 | | |
51 | | - | |
52 | | - | |
53 | | - | |
| 65 | + | |
54 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
55 | 75 | | |
56 | | - | |
| 76 | + | |
57 | 77 | | |
58 | | - | |
59 | | - | |
60 | | - | |
| 78 | + | |
61 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
62 | 88 | | |
63 | 89 | | |
64 | 90 | | |
65 | 91 | | |
66 | 92 | | |
67 | 93 | | |
68 | 94 | | |
69 | | - | |
| 95 | + | |
70 | 96 | | |
71 | 97 | | |
72 | 98 | | |
| |||
0 commit comments