mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
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:
parent
d48b2b8b52
commit
6d3e4e8935
2 changed files with 6 additions and 4 deletions
|
@ -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)
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue