def test__parse_settings_eth_macaddr(self): """ Make sure macaddr gets added when parsing opts """ opts = {"macaddr": "AA:BB:CC:11:22:33"} with patch.dict(rh_ip.__salt__, {"network.interfaces": MagicMock()}): results = rh_ip._parse_settings_eth( opts=opts, iface_type="eth", enabled=True, iface="eth0" ) self.assertIn("macaddr", results) self.assertEqual(results["macaddr"], opts["macaddr"])
def test__parse_settings_eth_ethtool_channels(self): """ Make sure channels gets added when parsing opts """ opts = {"channels": {"rx": 4, "tx": 4, "combined": 4, "other": 4}} with patch.dict(rh_ip.__grains__, {"num_cpus": 4}), patch.dict( rh_ip.__salt__, {"network.interfaces": MagicMock()} ): results = rh_ip._parse_settings_eth( opts=opts, iface_type="eth", enabled=True, iface="eth0" ) self.assertIn("ethtool", results) self.assertEqual(results["ethtool"], "-L eth0 rx 4 tx 4 other 4 combined 4")