def test__configure_removedlist_blacklist(self): self.mock_introspection_active.return_value = False self.mock_stat.return_value.st_size = dnsmasq._MACWL_LEN dnsmasq._configure_removedlist({self.mac}) self.mock_join.assert_called_with(self.dhcp_hostsdir, self.mac) self.mock__exclusive_write_or_pass.assert_called_once_with( self.mock_join.return_value, '%s,ignore\n' % self.mac)
def test__configure_removedlist_blacklist(self): self.mock_introspection_active.return_value = False self.mock_stat.return_value.st_size = dnsmasq._MACWL_LEN dnsmasq._configure_removedlist({self.mac}) self.mock_join.assert_called_with(self.dhcp_hostsdir, self.mac) self.mock__exclusive_write_or_pass.assert_called_once_with( self.mock_join.return_value, '%s,ignore\n' % self.mac)
def test__configure_removedlist_denylist_deny_unknown(self): self.mock_introspection_active.return_value = True self.mock_stat.return_value.st_size = dnsmasq._MAC_ALLOW_LEN CONF.set_override('deny_unknown_macs', True, 'pxe_filter') dnsmasq._configure_removedlist({self.mac}) self.mock_join.assert_called_with(self.dhcp_hostsdir, self.mac) self.mock__exclusive_write_or_pass.assert_called_once_with( self.mock_join.return_value, '%s,ignore\n' % self.mac)