mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Merge pull request #34739 from cachedout/remove_config_test
Remove unnedeed config test
This commit is contained in:
commit
d0e0c0186b
@ -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…
Reference in New Issue
Block a user