mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix integration.modules.test_mine.MineTest.test_get
for sub_minion
Since the `sub_minion` does not have `mine_functions` defined, `mine.update` returns `None` as opposed to `True` when `mine_functions` are defined.
This commit is contained in:
parent
26314f58e5
commit
eb5fd3ece2
2 changed files with 9 additions and 3 deletions
|
@ -19,12 +19,16 @@ class MineTest(ModuleCase):
|
|||
test mine.get and mine.update
|
||||
'''
|
||||
self.assertTrue(self.run_function('mine.update', minion_tgt='minion'))
|
||||
self.assertTrue(
|
||||
# The sub_minion does not have mine_functions defined in its configuration
|
||||
# In this case, mine.update returns None
|
||||
self.assertIsNone(
|
||||
self.run_function(
|
||||
'mine.update',
|
||||
minion_tgt='sub_minion'
|
||||
)
|
||||
)
|
||||
# Since the minion has mine_functions defined in its configuration,
|
||||
# mine.update will return True
|
||||
self.assertTrue(
|
||||
self.run_function(
|
||||
'mine.get',
|
||||
|
|
|
@ -800,9 +800,11 @@ class ModuleCase(TestCase, SaltClientTestCaseMixin):
|
|||
Run a single salt function and condition the return down to match the
|
||||
behavior of the raw function call
|
||||
'''
|
||||
know_to_return_none = (
|
||||
known_to_return_none = (
|
||||
'file.chown', 'file.chgrp', 'ssh.recv_known_host_entries'
|
||||
)
|
||||
if minion_tgt == 'sub_minion':
|
||||
known_to_return_none += ('mine.update',)
|
||||
if 'f_arg' in kwargs:
|
||||
kwargs['arg'] = kwargs.pop('f_arg')
|
||||
if 'f_timeout' in kwargs:
|
||||
|
@ -820,7 +822,7 @@ class ModuleCase(TestCase, SaltClientTestCaseMixin):
|
|||
minion_tgt, orig
|
||||
)
|
||||
)
|
||||
elif orig[minion_tgt] is None and function not in know_to_return_none:
|
||||
elif orig[minion_tgt] is None and function not in known_to_return_none:
|
||||
self.skipTest(
|
||||
'WARNING(SHOULD NOT HAPPEN #1935): Failed to get \'{0}\' from '
|
||||
'the minion \'{1}\'. Command output: {2}'.format(
|
||||
|
|
Loading…
Add table
Reference in a new issue