Commit c4ac501
committed
tests: Prioritize find link info by permanent MAC address, with fallback to current address
Given that a network connection specifies both an interface name and a
MAC address for configuring a parent and VLAN connection, and the
physical interface has the same permanent and current MAC address, when
the configuration is applied multiple times, then network role will
raise an error - “profile specifies interface_name 'eno2' and mac
'ec:f4:bb:d3:ec:92' but no such interface exists”. The reason for the
issue is that `SysUtil._link_infos_fetch()` will create a dictionary
containing all the available link infos in the `/sys/class/net/`, each
dictionary element has the structure - {“ifname”: {“ifindex”, “ifname”,
“address”, “perm-address”}}, later on, in the `SysUtil.link_info_find()`
function, the code iterates through all the link info in the
aforementioned dictionary, and tries to compare if the mac address that
the user specified in the network connections appeared either as the
“perm-address” or “address” (current address) in the link info, return
such link info if appeared. However, if the mac address that the user
specified matches only the “address” but not the “perm-address”, the
function will still return. In this case, the returned link info will
contain a different “ifname” than the interface name that the user
specified in the network connections, as a result, the error is raised.
When running the integration test `tests_mac_address_match.yml`, it is
essential to provide an Ethernet interface of which the permanent MAC
address matches the current MAC address. Typically, the vritual
interface like VLAN lacks a valid permanent MAC address and inherits the
current MAC address of its parent interface instead of the permanent
MAC. Thus, the test can verify that the commit "Prioritize find link
info by permanent MAC address, with fallback to current address"
(c341683) can properly resolve the scenarios where multiple network
interfaces share the same current MAC address, leading to potential
ambiguity in link matching.
Notice that the test `tests_mac_address_match.yml` will be skipped in
upstream testing in short term until the upstream testing machine is set
up with two extra NICs.
Resolves: https://issues.redhat.com/browse/RHEL-74211
Signed-off-by: Wen Liang <[email protected]>1 parent 424ad35 commit c4ac501
File tree
4 files changed
+133
-0
lines changed- tests
- playbooks
- tasks
4 files changed
+133
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
0 commit comments