File and User test fixes for 2015.5 on Fedora23 (#33055)

* Fix file_test.test_symlink on 2015.5

* Fix failing user present test
This commit is contained in:
Justin Anderson 2016-05-05 08:00:59 -06:00 committed by Mike Place
parent d48b2b8b52
commit 6d3e4e8935
2 changed files with 6 additions and 4 deletions

View file

@ -69,7 +69,7 @@ class UserTest(integration.ModuleCase,
And then destroys that user.
Assume that it will break any system you run it on.
'''
HOMEDIR = '/tmp/home_of_salt_test'
HOMEDIR = '/home/home_of_salt_test'
ret = self.run_state('user.present', name='salt_test',
home=HOMEDIR)
self.assertSaltTrueReturn(ret)

View file

@ -4,6 +4,7 @@
from __future__ import absolute_import
import json
import pprint
import tempfile
# Import Salt Testing libs
from salttesting import skipIf, TestCase
@ -137,8 +138,9 @@ class FileTestCase(TestCase):
'''
Test to create a symlink.
'''
name = '/etc/grub.conf'
target = '/boot/grub/grub.conf'
name = '/tmp/testfile.txt'
target = tempfile.mkstemp()[1]
test_dir = '/tmp'
user = 'salt'
if salt.utils.is_windows():
group = 'salt'
@ -192,7 +194,7 @@ class FileTestCase(TestCase):
'file.is_link': mock_f}):
with patch.dict(filestate.__opts__, {'test': False}):
with patch.object(os.path, 'isdir', mock_f):
comt = ('Directory /etc for symlink is not present')
comt = ('Directory {0} for symlink is not present').format(test_dir)
ret.update({'comment': comt, 'result': False})
self.assertDictEqual(filestate.symlink(name, target,
user=user,