2013-11-02 23:03:31 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
2012-05-28 03:02:29 +00:00
|
|
|
'''
|
|
|
|
Tests for the salt-run command
|
|
|
|
'''
|
2014-11-21 19:05:13 +00:00
|
|
|
# Import Python libs
|
|
|
|
from __future__ import absolute_import
|
|
|
|
|
2013-06-27 12:16:28 +00:00
|
|
|
# Import Salt Testing libs
|
2017-04-03 16:04:09 +00:00
|
|
|
from tests.support.case import ShellCase
|
2012-05-28 03:02:29 +00:00
|
|
|
|
|
|
|
|
2017-04-03 16:04:09 +00:00
|
|
|
class ManageTest(ShellCase):
|
2012-05-28 03:02:29 +00:00
|
|
|
'''
|
|
|
|
Test the manage runner
|
|
|
|
'''
|
|
|
|
def test_up(self):
|
|
|
|
'''
|
|
|
|
manage.up
|
|
|
|
'''
|
|
|
|
ret = self.run_run_plus('manage.up')
|
2016-09-01 16:40:13 +00:00
|
|
|
self.assertIn('minion', ret['return'])
|
|
|
|
self.assertIn('sub_minion', ret['return'])
|
2016-09-07 03:37:29 +00:00
|
|
|
self.assertTrue(any('- minion' in out for out in ret['out']))
|
|
|
|
self.assertTrue(any('- sub_minion' in out for out in ret['out']))
|
2012-05-28 03:02:29 +00:00
|
|
|
|
|
|
|
def test_down(self):
|
|
|
|
'''
|
|
|
|
manage.down
|
|
|
|
'''
|
|
|
|
ret = self.run_run_plus('manage.down')
|
2016-09-01 16:40:13 +00:00
|
|
|
self.assertNotIn('minion', ret['return'])
|
|
|
|
self.assertNotIn('sub_minion', ret['return'])
|
2012-05-28 03:02:29 +00:00
|
|
|
self.assertNotIn('minion', ret['out'])
|
|
|
|
self.assertNotIn('sub_minion', ret['out'])
|