mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add spm shell tests
This commit is contained in:
parent
e38f313ac0
commit
d2e91c33bd
2 changed files with 41 additions and 0 deletions
31
tests/integration/shell/test_spm.py
Normal file
31
tests/integration/shell/test_spm.py
Normal file
|
@ -0,0 +1,31 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Import python libs
|
||||
from __future__ import absolute_import
|
||||
|
||||
# Import Salt Testing libs
|
||||
from tests.support.case import ShellCase
|
||||
|
||||
|
||||
class SPMTest(ShellCase):
|
||||
'''
|
||||
Test spm script
|
||||
'''
|
||||
|
||||
def test_spm_help(self):
|
||||
'''
|
||||
test --help argument for spm
|
||||
'''
|
||||
expected_args = ['--version', '--assume-yes', '--help']
|
||||
output = self.run_spm('--help')
|
||||
for arg in expected_args:
|
||||
self.assertIn(arg, ''.join(output))
|
||||
|
||||
def test_spm_bad_arg(self):
|
||||
'''
|
||||
test correct output when bad argument passed
|
||||
'''
|
||||
expected_args = ['--version', '--assume-yes', '--help']
|
||||
output = self.run_spm('doesnotexist')
|
||||
for arg in expected_args:
|
||||
self.assertIn(arg, ''.join(output))
|
|
@ -442,6 +442,16 @@ class ShellCase(ShellTestCase, AdaptedConfigurationTestCaseMixin, ScriptPathMixi
|
|||
catch_stderr=catch_stderr,
|
||||
timeout=timeout)
|
||||
|
||||
def run_spm(self, arg_str, with_retcode=False, catch_stderr=False, timeout=60): # pylint: disable=W0221
|
||||
'''
|
||||
Execute spm
|
||||
'''
|
||||
return self.run_script('spm',
|
||||
arg_str,
|
||||
with_retcode=with_retcode,
|
||||
catch_stderr=catch_stderr,
|
||||
timeout=timeout)
|
||||
|
||||
def run_ssh(self, arg_str, with_retcode=False, catch_stderr=False, timeout=60): # pylint: disable=W0221
|
||||
'''
|
||||
Execute salt-ssh
|
||||
|
|
Loading…
Add table
Reference in a new issue