]> git.ipfire.org Git - thirdparty/samba.git/commit
python/tests: use a system session_info in posixacl.py
authorRalph Boehme <slow@samba.org>
Tue, 17 Dec 2019 14:32:17 +0000 (15:32 +0100)
committerRalph Boehme <slow@samba.org>
Fri, 20 Dec 2019 11:41:42 +0000 (11:41 +0000)
commit9807d69ef4178d4a2c974fed5708ad2d487d0c19
tree6608e4005a0fab2cbe977d442456e6b617d2089a
parent927c87d253c42282e8f62038363399f7643fcc76
python/tests: use a system session_info in posixacl.py

Previously posixacl.py passed None as session_info object from
get_session_info().

That meant that the if/else branch referring to session_info:

        if nwrap_winbind_active or session_info:
             self.assertEquals(posix_acl.acl[1].a_perm, 7)
         else:
             self.assertEquals(posix_acl.acl[1].a_perm, 6)

must be tweaked to take into account that session info is now either

* a system session_info in which case we must continue to use the if branch in
  the code, or

* a user session_info in which case we must continue to go through the else
  branch

Using

  is_user_session = not session_info.security_token.is_system()

in place of just "session_info" does the trick.

Cf the classes SessionedPosixAclMappingTests and
UnixSessionedPosixAclMappingTests in posixacl.py, those are the ones that
trigger test execution with a user session.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
python/samba/tests/posixacl.py