From 070ce87440d078f2ddef40d178cdb34c6a323268 Mon Sep 17 00:00:00 2001 From: Arne de Laat Date: Thu, 18 May 2023 21:09:28 +0200 Subject: [PATCH] Add test for symbolic to octal when others is omitted (#80822) * Add test for symbolic to octal when others is omitted Add case when there should be no permissions for other. And specific permissions for owner and group. * Fix permissions test by explicitly setting no permissions for others * Add additional cases where multiple permissions are specified --- .../module_utils/basic/test__symbolic_mode_to_octal.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/units/module_utils/basic/test__symbolic_mode_to_octal.py b/test/units/module_utils/basic/test__symbolic_mode_to_octal.py index 7793b348508..b3a73e5a6ea 100644 --- a/test/units/module_utils/basic/test__symbolic_mode_to_octal.py +++ b/test/units/module_utils/basic/test__symbolic_mode_to_octal.py @@ -63,6 +63,14 @@ DATA = ( # Going from no permissions to setting all for user, group, and/or oth # Multiple permissions (0o040000, u'u=rw-x+X,g=r-x+X,o=r-x+X', 0o0755), (0o100000, u'u=rw-x+X,g=r-x+X,o=r-x+X', 0o0644), + (0o040000, u'ug=rx,o=', 0o0550), + (0o100000, u'ug=rx,o=', 0o0550), + (0o040000, u'u=rx,g=r', 0o0540), + (0o100000, u'u=rx,g=r', 0o0540), + (0o040777, u'ug=rx,o=', 0o0550), + (0o100777, u'ug=rx,o=', 0o0550), + (0o040777, u'u=rx,g=r', 0o0547), + (0o100777, u'u=rx,g=r', 0o0547), ) UMASK_DATA = (