mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Test that correct salt-minion start-up exits with EX_OK
This commit is contained in:
parent
920f062193
commit
1fdb232af3
1 changed files with 26 additions and 0 deletions
|
@ -331,6 +331,32 @@ class MinionTest(integration.ShellCase, integration.ShellCaseCommonTestsMixIn):
|
|||
)
|
||||
self._assert_exit_status(status, 'EX_USAGE', message='unknown argument', stdout=stdout, stderr=stderr)
|
||||
|
||||
def test_exit_status_correct_usage(self):
|
||||
'''
|
||||
Ensure correct exit status when salt-minion starts correctly.
|
||||
'''
|
||||
|
||||
user = getpass.getuser()
|
||||
|
||||
minion = testprogram.TestDaemonSaltMinion(
|
||||
name='correct_usage',
|
||||
program=os.path.join(integration.CODE_DIR, 'scripts', 'salt-minion'),
|
||||
config={'user': user},
|
||||
parent_dir=self._test_dir,
|
||||
env={
|
||||
'PYTHONPATH': ':'.join(sys.path),
|
||||
},
|
||||
)
|
||||
# Call setup here to ensure config and script exist
|
||||
minion.setup()
|
||||
stdout, stderr, status = minion.run(
|
||||
args=['-d'],
|
||||
catch_stderr=True,
|
||||
with_retcode=True,
|
||||
)
|
||||
self._assert_exit_status(status, 'EX_OK', message='correct usage', stdout=stdout, stderr=stderr)
|
||||
minion.shutdown()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
integration.run_tests(MinionTest)
|
||||
|
|
Loading…
Add table
Reference in a new issue