mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add test case to reproduce dnsmasq.set_config failure in #34263
This commit is contained in:
parent
1a4833b3a1
commit
fd380c79b9
1 changed files with 17 additions and 0 deletions
|
@ -58,6 +58,23 @@ class DnsmasqTestCase(TestCase):
|
|||
with patch.object(os, 'listdir', mock):
|
||||
self.assertDictEqual(dnsmasq.set_config(), {})
|
||||
|
||||
@patch('salt.modules.dnsmasq.get_config', MagicMock(return_value={'conf-dir': 'A'}))
|
||||
def test_set_config_filter_pub_kwargs(self):
|
||||
'''
|
||||
Test that the kwargs returned from running the set_config function
|
||||
do not contain the __pub that may have been passed through in **kwargs.
|
||||
'''
|
||||
mock_domain = 'local'
|
||||
mock_address = '/some-test-address.local/8.8.4.4'
|
||||
with patch.dict(dnsmasq.__salt__, {'file.append': MagicMock()}):
|
||||
ret = dnsmasq.set_config(follow=False,
|
||||
domain=mock_domain,
|
||||
address=mock_address,
|
||||
__pub_pid=8184,
|
||||
__pub_jid=20161101194639387946,
|
||||
__pub_tgt='salt-call')
|
||||
self.assertEqual(ret, {'domain': mock_domain, 'address': mock_address})
|
||||
|
||||
def test_get_config(self):
|
||||
'''
|
||||
test to dumps all options from the config file.
|
||||
|
|
Loading…
Add table
Reference in a new issue