From: Greg Hudson Date: Wed, 6 Jun 2012 20:37:02 +0000 (-0400) Subject: Try to make t_trace.c output consistent X-Git-Tag: krb5-1.11-alpha1~512 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e8df1bd63ace7ddc4cafc93269f523d7c94585a;p=thirdparty%2Fkrb5.git 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. --- diff --git a/src/lib/krb5/os/Makefile.in b/src/lib/krb5/os/Makefile.in index 6d818e0e36..7d07480147 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 90e814dd9f..746dbea03f 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 a4b4a05115..4922b89e35 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