]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Try to make t_trace.c output consistent
authorGreg Hudson <ghudson@mit.edu>
Wed, 6 Jun 2012 20:37:02 +0000 (16:37 -0400)
committerGreg Hudson <ghudson@mit.edu>
Wed, 6 Jun 2012 20:37:02 +0000 (16:37 -0400)
Attempt to choose tracing inputs in t_trace.c which will produce
consistent output across platforms and logins.  Re-enable the
comparison against the reference file.

src/lib/krb5/os/Makefile.in
src/lib/krb5/os/t_trace.c
src/lib/krb5/os/t_trace.ref

index 6d818e0e364c1d6cec41cfb5b478745104a51a26..7d074801479f90d668454c09e0c3f33688ec7a56 100644 (file)
@@ -264,8 +264,7 @@ check-unix-trace:: t_trace
        rm -f t_trace.out
        KRB5_TRACE=t_trace.out ; export KRB5_TRACE ; \
        $(KRB5_RUN_ENV) $(VALGRIND) ./t_trace
-# Output is not consistent across runs; disable comparison until we can fix.
-#      sed -e 's/^[^:]*: //' t_trace.out | cmp - $(srcdir)/t_trace.ref
+       sed -e 's/^[^:]*: //' t_trace.out | cmp - $(srcdir)/t_trace.ref
        rm -f t_trace.out
 
 clean:: 
index 90e814dd9f1aece1dbbd54f1aa9ba113b74c28f1..746dbea03f628dd484beca9f770eeacf579919b6 100644 (file)
@@ -124,11 +124,12 @@ main (int argc, char *argv[])
     conn.socktype = SOCK_DGRAM;
     TRACE(ctx, "struct conn_state *, show socket type, address, port: "
           "{connstate}", &conn);
-    conn.socktype = SOCK_RDM;
+    conn.socktype = 1234;
     addr_in->sin_family = AF_UNSPEC;
+    conn.family = AF_UNSPEC;
     TRACE(ctx, "struct conn_state *, show socket type, address, port: "
           "{connstate}", &conn);
-    conn.family = AF_UNSPEC;
+    conn.family = 5678;
     TRACE(ctx, "struct conn_state *, show socket type, address, port: "
           "{connstate}", &conn);
 
@@ -140,8 +141,7 @@ main (int argc, char *argv[])
     TRACE(ctx, "krb5_data *, display as hex bytes: {hexdata}", &data);
     TRACE(ctx, "krb5_data *, display as hex bytes: {hexdata}", NULL);
 
-    TRACE(ctx, "int, display as number/errorstring: {errno}", 0);
-    TRACE(ctx, "int, display as number/errorstring: {errno}", 1);
+    TRACE(ctx, "int, display as number/errorstring: {errno}", ENOENT);
     TRACE(ctx, "krb5_error_code, display as number/errorstring: {kerr}", 0);
 
     key.keyblock.magic = 0;
@@ -213,11 +213,11 @@ main (int argc, char *argv[])
     TRACE(ctx, "krb5_enctype *, display list of enctypes: {etypes}", enctypes);
     TRACE(ctx, "krb5_enctype *, display list of enctypes: {etypes}", NULL);
 
-    err = krb5_cc_default(ctx, &ccache);
+    err = krb5_cc_resolve(ctx, "FILE:/path/to/ccache", &ccache);
     TRACE(ctx, "krb5_ccache, display type:name: {ccache}", ccache);
     krb5_cc_close(ctx, ccache);
 
-    err = krb5_kt_default(ctx, &keytab);
+    err = krb5_kt_resolve(ctx, "FILE:/etc/krb5.keytab", &keytab);
     TRACE(ctx, "krb5_keytab, display name: {keytab}", keytab);
     krb5_kt_close(ctx, keytab);
 
index a4b4a05115f37541e6848658ed7cffcd0b0ed2b1..4922b89e35a3897994037405ef2ba8efc998f821 100644 (file)
@@ -8,16 +8,15 @@ size_t and const char *, as hex bytes: 6578616D706C652E64617461
 size_t and const char *, as hex bytes: (null)
 size_t and const char *, as four-character hex hash: 7B9A
 size_t and const char *, as four-character hex hash: (null)
-struct conn_state *, show socket type, address, port: stream af-12644520
-struct conn_state *, show socket type, address, port: dgram af-12644520
-struct conn_state *, show socket type, address, port: socktype5 af-12644520
-struct conn_state *, show socket type, address, port: socktype5 AF_UNSPEC
+struct conn_state *, show socket type, address, port: stream 0.0.0.0:88
+struct conn_state *, show socket type, address, port: dgram 0.0.0.0:88
+struct conn_state *, show socket type, address, port: socktype1234 AF_UNSPEC
+struct conn_state *, show socket type, address, port: socktype1234 af5678
 krb5_data *, display as counted string: example.data
 krb5_data *, display as counted string: (null)
 krb5_data *, display as hex bytes: 6578616D706C652E64617461
 krb5_data *, display as hex bytes: (null)
-int, display as number/errorstring: 0/Error 0
-int, display as number/errorstring: 1/Not owner
+int, display as number/errorstring: 2/No such file or directory
 krb5_error_code, display as number/errorstring: 0/Success
 const krb5_keyblock *, display enctype and hash of key: 511/7B9A
 const krb5_keyblock *, display enctype and hash of key: (null)
@@ -39,11 +38,11 @@ int, krb5_principal type: Windows 2000 UPN and SID
 int, krb5_principal type: NT 4 style name
 int, krb5_principal type: NT 4 style name and SID
 int, krb5_principal type: ?
-krb5_pa_data **, display list of padata type numbers: 0, 12
+krb5_pa_data **, display list of padata type numbers: 3, 0
 krb5_pa_data **, display list of padata type numbers: (empty)
 krb5_enctype, display shortest name of enctype: des-cbc-crc
 krb5_enctype *, display list of enctypes: 5, rc4-hmac-exp, 511
 krb5_enctype *, display list of enctypes: (empty)
-krb5_ccache, display type:name: FILE:/tmp/krb5cc_3622_myrai14144
+krb5_ccache, display type:name: FILE:/path/to/ccache
 krb5_keytab, display name: FILE:/etc/krb5.keytab
 krb5_creds *, display clientprinc -> serverprinc: @ATHENA.MIT.EDU -> @ZEUS.MIT.EDU