diff --git a/tests/lxd/test_lxd_backend.cpp b/tests/lxd/test_lxd_backend.cpp index d93dc3a822..da972ce414 100644 --- a/tests/lxd/test_lxd_backend.cpp +++ b/tests/lxd/test_lxd_backend.cpp @@ -2356,9 +2356,20 @@ TEST_F(LXDBackend, addsNetworkInterface) EXPECT_EQ(times_called, 1u); } -TEST_F(LXDBackend, backendReturnsCorrectBridgeName) +struct LXDNetworkNameTestSuite : LXDBackend, WithParamInterface> { +}; + +TEST_P(LXDNetworkNameTestSuite, backendReturnsCorrectBridgeName) +{ + const auto [name, ret] = GetParam(); + CustomLXDFactory factory{std::move(mock_network_access_manager), data_dir.path(), base_url}; - EXPECT_EQ(factory.bridge_name_for("eth7"), "br-eth7"); + EXPECT_EQ(factory.bridge_name_for(name), ret); } + +INSTANTIATE_TEST_SUITE_P(LXDBackend, + LXDNetworkNameTestSuite, + Values(std::make_pair("enp4s0", "br-enp4s0"), + std::make_pair("enx586d8fd35b6c", "br-enx586d8fd35")));