krb5 commit: Fix trace log unit test

Greg Hudson ghudson at MIT.EDU
Mon Jun 4 11:26:54 EDT 2012


https://github.com/krb5/krb5/commit/a1f9c18326525c2d80d7e8039e404ba7828dfd1a
commit a1f9c18326525c2d80d7e8039e404ba7828dfd1a
Author: Greg Hudson <ghudson at mit.edu>
Date:   Mon Jun 4 11:23:00 2012 -0400

    Fix trace log unit test
    
    Only use common denominator Bourne shell syntax for exporting
    environment variables.  Don't rely on /dev/stdout working.  Compare
    the output with a reference file to detect changes, instead of just
    sending it to stdout.

 src/lib/krb5/os/Makefile.in |    5 +++-
 src/lib/krb5/os/t_trace.ref |   49 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 53 insertions(+), 1 deletions(-)

diff --git a/src/lib/krb5/os/Makefile.in b/src/lib/krb5/os/Makefile.in
index 9faab25..7d07480 100644
--- a/src/lib/krb5/os/Makefile.in
+++ b/src/lib/krb5/os/Makefile.in
@@ -261,8 +261,11 @@ check-unix-antoln:: t_an_to_ln
 	$(RM) ./t_an.*
 
 check-unix-trace:: t_trace
-	export KRB5_TRACE=/dev/stdout ; \
+	rm -f t_trace.out
+	KRB5_TRACE=t_trace.out ; export KRB5_TRACE ; \
 	$(KRB5_RUN_ENV) $(VALGRIND) ./t_trace
+	sed -e 's/^[^:]*: //' t_trace.out | cmp - $(srcdir)/t_trace.ref
+	rm -f t_trace.out
 
 clean:: 
 	$(RM) $(TEST_PROGS) test.out t_std_conf.o t_an_to_ln.o t_locate_kdc.o
diff --git a/src/lib/krb5/os/t_trace.ref b/src/lib/krb5/os/t_trace.ref
new file mode 100644
index 0000000..a4b4a05
--- /dev/null
+++ b/src/lib/krb5/os/t_trace.ref
@@ -0,0 +1,49 @@
+simple format
+int, in decimal: -1
+long, in decimal: -2
+const char *, display as C string: example.data
+size_t and const char *, as a counted string: example.data
+size_t and const char *, as a counted string: (null)
+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
+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
+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)
+krb5_key, display enctype and hash of key: 511/7B9A
+krb5_key, display enctype and hash of key: (null)
+const krb5_checksum *, display cksumtype and hex checksum: -1/6578616D706C652E64617461
+krb5_principal, unparse and display: @ATHENA.MIT.EDU
+int, krb5_principal type: unknown
+int, krb5_principal type: principal
+int, krb5_principal type: service instance
+int, krb5_principal type: service with host as instance
+int, krb5_principal type: service with host as components
+int, krb5_principal type: unique ID
+int, krb5_principal type: X.509
+int, krb5_principal type: SMTP email
+int, krb5_principal type: Windows 2000 UPN
+int, krb5_principal type: well-known
+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: (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_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