mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
update cron and cmd tests for cron runas changes
This commit is contained in:
parent
31e749f99d
commit
5dc09e7da1
@ -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:
|
||||
|
@ -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):
|
||||
'''
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user