wintest: cope with the heimdal version of kinit
authorAndrew Tridgell <tridge@samba.org>
Mon, 29 Nov 2010 06:19:55 +0000 (17:19 +1100)
committerAndrew Tridgell <tridge@samba.org>
Mon, 29 Nov 2010 07:49:36 +0000 (08:49 +0100)
Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Mon Nov 29 08:49:36 CET 2010 on sn-devel-104

wintest/test-s4-howto.py
wintest/wintest.py

index ae0dc1437a5683576671d83b1ed7fe2f4a162781..8f57553929bc673d3c654e67e07272c36b1d9a61 100755 (executable)
@@ -239,7 +239,8 @@ def test_kerberos(t):
     t.info("Testing kerberos")
     t.run_cmd("kdestroy")
     t.kinit("administrator@${REALM}", "${PASSWORD1}")
-    t.cmd_contains("klist -e", ["Ticket cache", "Default principal", "Valid starting"])
+    # this copes with the differences between MIT and Heimdal klist
+    t.cmd_contains("klist", ["rincipal", "administrator@${REALM}"])
 
 
 def test_dyndns(t):
index effc77e95ef8e0f6546894e0d0da5a82cf7b1bbe..67af51a313b1d17c719ba603ad81a335b4bcad7e 100644 (file)
@@ -453,11 +453,13 @@ class wintest():
         if len(s) > 0:
             s[1] = s[1].upper()
         username = '@'.join(s)
-        child = self.pexpect_spawn('kinit -V ' + username)
-        child.expect("Password for")
+        child = self.pexpect_spawn('kinit ' + username)
+        child.expect("Password")
         child.sendline(password)
-        child.expect("Authenticated to Kerberos")
-
+        child.expect(pexpect.EOF)
+        child.close()
+        if child.exitstatus != 0:
+            raise RuntimeError("kinit failed with status %d" % child.exitstatus)
 
     def get_domains(self):
         '''return a dictionary of DNS domains and IPs for named.conf'''