traffic: new version of model with packet_rate, version number
[samba.git] / python / samba / tests / auth.py
index 6318bec40a085ef79090de2df75645323bbaf129..099826e0c62e68b380c4ff88a248a7572285c576 100644 (file)
@@ -24,6 +24,7 @@ the functionality, that's already done in other tests.
 from samba import auth
 import samba.tests
 
+
 class AuthSystemSessionTests(samba.tests.TestCase):
 
     def setUp(self):
@@ -57,6 +58,7 @@ class AuthSystemSessionTests(samba.tests.TestCase):
         self.assertTrue(self.system_session.security_token.is_system())
         self.assertFalse(self.system_session.security_token.is_anonymous())
 
+
 class AuthAdminSessionTests(samba.tests.TestCase):
 
     def setUp(self):
@@ -87,3 +89,14 @@ class AuthAdminSessionTests(samba.tests.TestCase):
         self.assertFalse(self.admin_session.security_token.is_system())
         self.assertFalse(self.admin_session.security_token.is_anonymous())
         self.assertTrue(self.admin_session.security_token.has_builtin_administrators())
+
+    def test_session_info_unix_details(self):
+        samba.auth.session_info_fill_unix(session_info=self.admin_session,
+                                          lp_ctx=self.lp,
+                                          user_name="Administrator")
+        self.assertEqual(self.admin_session.unix_info.sanitized_username,
+                         'Administrator')
+        self.assertEqual(self.admin_session.unix_info.unix_name,
+                         self.lp.get('workgroup').upper() +
+                         self.lp.get('winbind separator') + 'Administrator')
+        self.assertIsNotNone(self.admin_session.unix_token)