2012-05-14 17:18:36 +00:00
|
|
|
'''
|
|
|
|
Tests for the file state
|
|
|
|
'''
|
|
|
|
# Import python libs
|
2012-06-30 22:48:28 +00:00
|
|
|
|
2012-05-14 17:18:36 +00:00
|
|
|
# Import salt libs
|
|
|
|
import integration
|
2012-06-30 22:48:28 +00:00
|
|
|
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
|
|
|
|
'''
|
2012-06-30 22:48:28 +00:00
|
|
|
|
|
|
|
ret = self.run_state('cmd.run', name='ls', cwd=tempfile.gettempdir())
|
2012-06-01 18:03:17 +00:00
|
|
|
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
|
|
|
|
'''
|
2012-06-30 22:48:28 +00:00
|
|
|
ret = self.run_state('cmd.run', name='ls',
|
|
|
|
cwd=tempfile.gettempdir(), test=True)
|
2012-06-01 18:03:17 +00:00
|
|
|
result = ret[next(iter(ret))]['result']
|
2012-05-14 17:18:36 +00:00
|
|
|
self.assertIsNone(result)
|