krb5 commit: Try to make t_trace.c output consistent

Greg Hudson ghudson at MIT.EDU
Wed Jun 6 16:37:16 EDT 2012


https://github.com/krb5/krb5/commit/1e8df1bd63ace7ddc4cafc93269f523d7c94585a
commit 1e8df1bd63ace7ddc4cafc93269f523d7c94585a
Author: Greg Hudson <ghudson at mit.edu>
Date:   Wed Jun 6 16:37:02 2012 -0400

    Try to make t_trace.c output consistent
    
    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 |    3 +--
 src/lib/krb5/os/t_trace.c   |   12 ++++++------
 src/lib/krb5/os/t_trace.ref |   15 +++++++--------
 3 files changed, 14 insertions(+), 16 deletions(-)

diff --git a/src/lib/krb5/os/Makefile.in b/src/lib/krb5/os/Makefile.in
index 6d818e0..7d07480 100644
--- a/src/lib/krb5/os/Makefile.in
+++ b/src/lib/krb5/os/Makefile.in
@@ -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:: 
diff --git a/src/lib/krb5/os/t_trace.c b/src/lib/krb5/os/t_trace.c
index 90e814d..746dbea 100644
--- a/src/lib/krb5/os/t_trace.c
+++ b/src/lib/krb5/os/t_trace.c
@@ -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);
 
diff --git a/src/lib/krb5/os/t_trace.ref b/src/lib/krb5/os/t_trace.ref
index a4b4a05..4922b89 100644
--- a/src/lib/krb5/os/t_trace.ref
+++ b/src/lib/krb5/os/t_trace.ref
@@ -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


More information about the cvs-krb5 mailing list