salt/tests/integration/states/cmd.py

32 lines
701 B
Python
Raw Normal View History

2012-05-14 17:18:36 +00:00
'''
Tests for the file state
'''
# Import python libs
2012-05-14 17:18:36 +00:00
# Import salt libs
import integration
import tempfile
2012-05-14 17:18:36 +00:00
2012-05-29 16:40:20 +00:00
2012-05-14 17:18:36 +00:00
class CMDTest(integration.ModuleCase):
'''
Validate the cmd state
'''
def test_run(self):
'''
cmd.run
'''
ret = self.run_state('cmd.run', name='ls', cwd=tempfile.gettempdir())
result = ret[next(iter(ret))]['result']
2012-05-14 17:18:36 +00:00
self.assertTrue(result)
def test_test_run(self):
'''
cmd.run test interface
'''
ret = self.run_state('cmd.run', name='ls',
cwd=tempfile.gettempdir(), test=True)
result = ret[next(iter(ret))]['result']
2012-05-14 17:18:36 +00:00
self.assertIsNone(result)