mirror of
https://github.com/valitydev/salt.git
synced 2024-11-09 01:36:48 +00:00
42 lines
926 B
Python
42 lines
926 B
Python
# -*- coding: utf-8 -*-
|
|
'''
|
|
Tests for the file state
|
|
'''
|
|
# Import python libs
|
|
from __future__ import absolute_import
|
|
import tempfile
|
|
|
|
# Import Salt Testing libs
|
|
from salttesting.helpers import ensure_in_syspath
|
|
ensure_in_syspath('../../')
|
|
|
|
# Import salt libs
|
|
import integration
|
|
|
|
|
|
class CMDTest(integration.ModuleCase,
|
|
integration.SaltReturnAssertsMixIn):
|
|
'''
|
|
Validate the cmd state
|
|
'''
|
|
def test_run(self):
|
|
'''
|
|
cmd.run
|
|
'''
|
|
|
|
ret = self.run_state('cmd.run', name='ls', cwd=tempfile.gettempdir())
|
|
self.assertSaltTrueReturn(ret)
|
|
|
|
def test_test_run(self):
|
|
'''
|
|
cmd.run test interface
|
|
'''
|
|
ret = self.run_state('cmd.run', name='ls',
|
|
cwd=tempfile.gettempdir(), test=True)
|
|
self.assertSaltNoneReturn(ret)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
from integration import run_tests
|
|
run_tests(CMDTest)
|