update cron and cmd tests for cron runas changes

This commit is contained in:
Justin Findlay 2015-03-10 13:24:32 -06:00
parent 31e749f99d
commit 5dc09e7da1
3 changed files with 3 additions and 12 deletions

View File

@ -84,7 +84,7 @@ class CMDModuleTest(integration.ModuleCase):
from salt.modules import cmdmod
cmdmod.__grains__ = {'os': 'darwin'}
cmdmod.__grains__ = {'os': 'Darwin', 'os_family': 'Solaris'}
if sys.platform.startswith(('freebsd', 'openbsd')):
shell = '/bin/sh'
else:

View File

@ -546,17 +546,8 @@ class PsTestCase(TestCase):
## Still trying to figure this one out.
# def test__render_tab(self):
# pass
def test__get_cron_cmdstr_solaris(self):
cron.__grains__ = __grains__
with patch.dict(cron.__grains__, {'os_family': 'Solaris'}):
self.assertEqual('su - root -c "crontab /tmp"',
cron._get_cron_cmdstr(STUB_USER, STUB_PATH))
def test__get_cron_cmdstr(self):
cron.__grains__ = __grains__
with patch.dict(cron.__grains__, {'os_family': None}):
self.assertEqual('crontab -u root /tmp',
cron._get_cron_cmdstr(STUB_USER, STUB_PATH))
self.assertEqual('crontab /tmp', cron._get_cron_cmdstr(STUB_PATH))
def test__date_time_match(self):
'''

View File

@ -54,7 +54,7 @@ class IncronTestCase(TestCase):
'''
mock = MagicMock(return_value=True)
with patch.dict(incron.__salt__, {'cmd.run_all': mock}):
self.assertTrue(incron.write_cron_file_verbose
self.assertTrue(incron.write_incron_file_verbose
('cybage', '/home/cybage/new_cron'))
# 'raw_system_incron' function tests: 1