2014-07-09 21:41:18 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
'''
|
|
|
|
:codeauthor: :email:`Nicole Thomas <nicole@saltstack.com>`
|
|
|
|
'''
|
2014-11-21 19:05:13 +00:00
|
|
|
# Import Python libs
|
|
|
|
from __future__ import absolute_import
|
2014-07-09 21:41:18 +00:00
|
|
|
|
|
|
|
# Import Salt Libs
|
|
|
|
import integration
|
|
|
|
|
|
|
|
# Import Salt Testing Libs
|
|
|
|
from salttesting.helpers import ensure_in_syspath
|
|
|
|
|
|
|
|
ensure_in_syspath('../../')
|
|
|
|
|
|
|
|
|
|
|
|
class BatchTest(integration.ShellCase):
|
|
|
|
'''
|
|
|
|
Integration tests for the salt.cli.batch module
|
|
|
|
'''
|
|
|
|
|
|
|
|
def test_batch_run(self):
|
|
|
|
'''
|
|
|
|
Tests executing a simple batch command to help catch regressions
|
|
|
|
'''
|
2015-01-05 17:04:15 +00:00
|
|
|
ret = ['',
|
2014-07-09 21:41:18 +00:00
|
|
|
"Executing run on ['sub_minion']",
|
|
|
|
'',
|
|
|
|
'sub_minion:',
|
2014-12-15 19:04:35 +00:00
|
|
|
'retcode:',
|
|
|
|
' 0',
|
2014-07-09 21:41:18 +00:00
|
|
|
' batch testing',
|
|
|
|
'',
|
|
|
|
"Executing run on ['minion']",
|
|
|
|
'',
|
|
|
|
'minion:',
|
2014-12-15 19:04:35 +00:00
|
|
|
'retcode:',
|
|
|
|
' 0',
|
2014-07-09 21:41:18 +00:00
|
|
|
' batch testing']
|
2014-07-10 04:00:41 +00:00
|
|
|
ret = sorted(ret)
|
|
|
|
cmd = sorted(self.run_salt('\'*\' test.echo \'batch testing\' -b 50%'))
|
|
|
|
self.assertListEqual(cmd, ret)
|
2014-07-10 04:31:54 +00:00
|
|
|
|
2014-07-09 21:41:18 +00:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
from integration import run_tests
|
2014-07-09 22:22:00 +00:00
|
|
|
run_tests(BatchTest)
|