mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Normalize the mode before we compare it.
This commit is contained in:
parent
f894f0ecb8
commit
8efd33320f
1 changed files with 6 additions and 1 deletions
|
@ -2510,7 +2510,12 @@ class FileTest(ModuleCase, SaltReturnAssertsMixin):
|
|||
# Check that the owner and group are correct, and
|
||||
# the mode is what we expect
|
||||
temp_file_stats = os.stat(tempfile)
|
||||
self.assertEqual(six.text_type(oct(stat.S_IMODE(temp_file_stats.st_mode))), '04750')
|
||||
|
||||
# Normalize the mode
|
||||
temp_file_mode = six.text_type(oct(stat.S_IMODE(temp_file_stats.st_mode)))
|
||||
temp_file_mode = salt.utils.normalize_mode(temp_file_mode)
|
||||
|
||||
self.assertEqual(temp_file_mode, '4750')
|
||||
self.assertEqual(pwd.getpwuid(temp_file_stats.st_uid).pw_name, user)
|
||||
self.assertEqual(grp.getgrgid(temp_file_stats.st_gid).gr_name, group)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue