tests/krb5: Run test_rpc against member server
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Wed, 24 Nov 2021 03:02:00 +0000 (16:02 +1300)
committerJule Anger <janger@samba.org>
Sun, 24 Jul 2022 09:42:01 +0000 (11:42 +0200)
We were instead always running against the DC.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 167bd2070483004cd0b9a96ffb40ea73c6ddf579)

python/samba/tests/krb5/test_rpc.py

index 03c125f518a7308df2639be936805263c8979088..2d483986e83cfdcc0c3d01edabd0106b0ca0b63f 100755 (executable)
@@ -58,7 +58,7 @@ class RpcTests(KDCBaseTest):
 
         samdb = self.get_samdb()
 
-        mach_name = samdb.host_dns_name()
+        mach_name = self.host
         service = "cifs"
 
         # Create the user account.
@@ -67,7 +67,7 @@ class RpcTests(KDCBaseTest):
             use_cache=False)
         user_name = user_credentials.get_username()
 
-        mach_credentials = self.get_dc_creds()
+        mach_credentials = self.get_server_creds()
 
         # Talk to the KDC to obtain the service ticket, which gets placed into
         # the cache. The machine account name has to match the name in the
@@ -114,8 +114,7 @@ class RpcTests(KDCBaseTest):
             self.assertEqual(user_name, account_name.string)
 
     def test_rpc_anonymous(self):
-        samdb = self.get_samdb()
-        mach_name = samdb.host_dns_name()
+        mach_name = self.host
 
         anon_creds = credentials.Credentials()
         anon_creds.set_anonymous()
@@ -125,7 +124,7 @@ class RpcTests(KDCBaseTest):
 
         (account_name, _) = conn.GetUserName(None, None, None)
 
-        self.assertEqual('ANONYMOUS LOGON', account_name.string)
+        self.assertEqual('ANONYMOUS LOGON', account_name.string.upper())
 
 
 if __name__ == "__main__":