2013-11-27 11:19:24 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
2012-05-14 17:18:36 +00:00
|
|
|
'''
|
|
|
|
Tests for the file state
|
|
|
|
'''
|
2013-06-27 12:32:54 +00:00
|
|
|
|
|
|
|
# Import python libs
|
2012-06-30 22:48:28 +00:00
|
|
|
import tempfile
|
2012-05-14 17:18:36 +00:00
|
|
|
|
2013-06-27 12:32:54 +00:00
|
|
|
# Import Salt Testing libs
|
|
|
|
from salttesting.helpers import ensure_in_syspath
|
|
|
|
ensure_in_syspath('../../')
|
|
|
|
|
2013-06-24 19:06:49 +00:00
|
|
|
# Import salt libs
|
2013-06-27 12:32:54 +00:00
|
|
|
import integration
|
2013-06-24 19:06:49 +00:00
|
|
|
|
2012-05-29 16:40:20 +00:00
|
|
|
|
2012-11-21 12:43:53 +00:00
|
|
|
class CMDTest(integration.ModuleCase,
|
|
|
|
integration.SaltReturnAssertsMixIn):
|
2012-05-14 17:18:36 +00:00
|
|
|
'''
|
|
|
|
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-11-21 12:43:53 +00:00
|
|
|
self.assertSaltTrueReturn(ret)
|
2012-05-14 17:18:36 +00:00
|
|
|
|
|
|
|
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-11-21 12:43:53 +00:00
|
|
|
self.assertSaltNoneReturn(ret)
|
2012-07-20 06:21:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
from integration import run_tests
|
|
|
|
run_tests(CMDTest)
|