mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
parent
f19caac8e4
commit
10a1af9949
1 changed files with 1 additions and 29 deletions
|
@ -18,7 +18,7 @@ from contextlib import contextmanager
|
|||
# Import Salt Testing libs
|
||||
from salttesting import TestCase
|
||||
from salttesting.mock import MagicMock, patch
|
||||
from salttesting.helpers import ensure_in_syspath, TestsLoggingHandler
|
||||
from salttesting.helpers import ensure_in_syspath
|
||||
from salt.exceptions import CommandExecutionError
|
||||
|
||||
ensure_in_syspath('../')
|
||||
|
@ -364,34 +364,6 @@ class ConfigTestCase(TestCase, integration.AdaptedConfigurationTestCaseMixIn):
|
|||
self.assertEqual(syndic_opts['_master_conf_file'], minion_conf_path)
|
||||
self.assertEqual(syndic_opts['_minion_conf_file'], syndic_conf_path)
|
||||
|
||||
def test_issue_6714_parsing_errors_logged(self):
|
||||
try:
|
||||
tempdir = tempfile.mkdtemp(dir=integration.SYS_TMP_DIR)
|
||||
test_config = os.path.join(tempdir, 'config')
|
||||
|
||||
# Let's populate a master configuration file with some basic
|
||||
# settings
|
||||
salt.utils.fopen(test_config, 'w').write(
|
||||
'root_dir: {0}\n'
|
||||
'log_file: {0}/foo.log\n'.format(tempdir) +
|
||||
'\n\n\n'
|
||||
'blah:false\n'
|
||||
)
|
||||
|
||||
with TestsLoggingHandler() as handler:
|
||||
# Let's load the configuration
|
||||
config = sconfig.master_config(test_config)
|
||||
for message in handler.messages:
|
||||
if message.startswith('ERROR:Error parsing configuration'):
|
||||
break
|
||||
else:
|
||||
raise AssertionError(
|
||||
'No parsing error message was logged'
|
||||
)
|
||||
finally:
|
||||
if os.path.isdir(tempdir):
|
||||
shutil.rmtree(tempdir)
|
||||
|
||||
@patch('salt.utils.network.get_fqhostname', MagicMock(return_value='localhost'))
|
||||
def test_get_id_etc_hostname(self):
|
||||
'''
|
||||
|
|
Loading…
Add table
Reference in a new issue