2013-11-27 11:19:24 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
2012-05-28 03:24:45 +00:00
|
|
|
'''
|
|
|
|
Tests for the salt-run command
|
|
|
|
'''
|
2014-11-21 19:05:13 +00:00
|
|
|
# Import Python libs
|
|
|
|
from __future__ import absolute_import
|
2012-05-28 03:24:45 +00:00
|
|
|
|
2013-06-27 12:16:17 +00:00
|
|
|
# Import Salt Testing libs
|
2017-04-03 16:04:09 +00:00
|
|
|
from tests.support.case import ShellCase
|
2017-02-27 13:58:07 +00:00
|
|
|
from tests.support.unit import skipIf
|
2012-05-28 03:24:45 +00:00
|
|
|
|
|
|
|
|
2017-04-03 16:04:09 +00:00
|
|
|
class ManageTest(ShellCase):
|
2012-05-28 03:24:45 +00:00
|
|
|
'''
|
|
|
|
Test the manage runner
|
|
|
|
'''
|
|
|
|
def test_active(self):
|
|
|
|
'''
|
|
|
|
jobs.active
|
|
|
|
'''
|
|
|
|
ret = self.run_run_plus('jobs.active')
|
2016-09-01 16:53:14 +00:00
|
|
|
self.assertEqual(ret['return'], {})
|
2014-04-19 22:59:13 +00:00
|
|
|
self.assertEqual(ret['out'], [])
|
2012-05-28 03:24:45 +00:00
|
|
|
|
|
|
|
def test_lookup_jid(self):
|
|
|
|
'''
|
|
|
|
jobs.lookup_jid
|
|
|
|
'''
|
2016-09-01 16:40:13 +00:00
|
|
|
ret = self.run_run_plus('jobs.lookup_jid', '23974239742394')
|
2016-09-01 16:53:14 +00:00
|
|
|
self.assertEqual(ret['return'], {})
|
2012-11-04 10:22:18 +00:00
|
|
|
self.assertEqual(ret['out'], [])
|
2012-05-28 03:24:45 +00:00
|
|
|
|
2017-05-24 09:40:44 +00:00
|
|
|
@skipIf(True, 'to be re-enabled when #23623 is merged')
|
2012-05-28 03:34:48 +00:00
|
|
|
def test_list_jobs(self):
|
|
|
|
'''
|
|
|
|
jobs.list_jobs
|
|
|
|
'''
|
|
|
|
ret = self.run_run_plus('jobs.list_jobs')
|
2016-09-01 16:53:14 +00:00
|
|
|
self.assertIsInstance(ret['return'], dict)
|