diff --git a/tests/unittests/test_distros/test_netconfig.py b/tests/unittests/test_distros/test_netconfig.py index d09e46af71d..88f2697785b 100644 --- a/tests/unittests/test_distros/test_netconfig.py +++ b/tests/unittests/test_distros/test_netconfig.py @@ -767,7 +767,8 @@ def test_apply_network_config_v1_without_netplan(self): expected_cfgs=expected_cfgs.copy(), with_netplan=False) - def test_apply_network_config_v1_with_netplan(self): + @mock.patch('cloudinit.util.system_info', return_value={'variant': 'bsd'}) + def test_apply_network_config_v1_with_netplan(self, *args): expected_cfgs = { self.netplan_path(): dedent("""\ # generated by cloud-init @@ -782,12 +783,10 @@ def test_apply_network_config_v1_with_netplan(self): dhcp4: true """), } - - with mock.patch('cloudinit.util.is_FreeBSD', return_value=False): - self._apply_and_verify(self.distro.apply_network_config, - V1_NET_CFG, - expected_cfgs=expected_cfgs.copy(), - with_netplan=True) + self._apply_and_verify(self.distro.apply_network_config, + V1_NET_CFG, + expected_cfgs=expected_cfgs.copy(), + with_netplan=True) class TestNetCfgDistroPhoton(TestNetCfgDistroBase):