]> eyrie.org Git - kerberos/kstart.git/commitdiff
Fix ticket cache analysis in test suite with Heimdal
authorRuss Allbery <eagle@eyrie.org>
Tue, 30 Mar 2021 06:48:07 +0000 (23:48 -0700)
committerRuss Allbery <eagle@eyrie.org>
Tue, 30 Mar 2021 17:30:28 +0000 (10:30 -0700)
Heimdal's version of klist shows dates in a different format that
the regex parsing of klist output didn't understand.  Adjust for
the current formatting while hopefully not breaking understanding
of previous versions.

tests/libtest.pl

index 0f9076ff42becae48156e9bb9a56884ff5fd7fe4..30c2ad07321a167cc1014b187a20b2dc6b0a596b 100644 (file)
@@ -80,10 +80,16 @@ sub klist {
     return unless $? == 0;
     my ($default) = ($output =~ /^(?:Default p|\s*P)rincipal: (\S+)/m);
     my ($service) = ($output =~ / Service principal\n(?:\S+\s+){4}(\S+)/);
+    unless ($service) {
+        ($service) = ($output =~ / Principal\n(?:\S+\s+){9}(\S+)/);
+    }
     unless ($service) {
         ($service) = ($output =~ / Principal\n(?:\S+\s+){7}(\S+)/);
     }
     my ($flags) = ($output =~ /\sFlags: (\S+)/);
+    unless ($flags) {
+        ($flags) = ($output =~ / Flags\s+Principal\n(?:\S+\s+){8}(\S+)/);
+    }
     unless ($flags) {
         ($flags) = ($output =~ / Flags\s+Principal\n(?:\S+\s+){6}(\S+)/);
     }