multipass
multipass copied to clipboard
[network] Bridges with long names use hash suffix
This pull request introduces a new strategy for generating bridge names in the Linux backend to ensure uniqueness when interface names are long by truncating long interface names and appending a short hash. This ensures that bridge names are both readable and unique.
- Updated the bridge creation logic in
create_bridge_withto use the newgenerate_bridge_namefunction, replacing the previous simple truncation method. - Added
QCryptographicHashincludes to bothbackend_utils.cppandtest_backend_utils.cppto support the new hashing logic for bridge name generation.
Originally:
-
eth123456789abc→br-eth123456789(truncated to 15 chars) -
eth123456789xyz→br-eth123456789(same name - collision)
With the fix:
-
eth123456789abc→br-eth12345-8f9(unique hash suffix) -
eth123456789xyz→br-eth12345-a2c(different hash - no collision)
Short names (unchanged, fully readable):
-
eth0→br-eth0 -
wlan0→br-wlan0 -
enp0s3→br-enp0s3
resolves #2158
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 89.39%. Comparing base (96a02d6) to head (4a070df).
:warning: Report is 14 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #4422 +/- ##
=======================================
Coverage 89.39% 89.39%
=======================================
Files 253 253
Lines 16457 16468 +11
=======================================
+ Hits 14711 14722 +11
Misses 1746 1746
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.