]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Fix trace log unit test
authorGreg Hudson <ghudson@mit.edu>
Mon, 4 Jun 2012 15:23:00 +0000 (11:23 -0400)
committerGreg Hudson <ghudson@mit.edu>
Mon, 4 Jun 2012 15:26:45 +0000 (11:26 -0400)
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
src/lib/krb5/os/t_trace.ref [new file with mode: 0644]

index 9faab25ee7f971af9a790982f1499ae81fdb54eb..7d074801479f90d668454c09e0c3f33688ec7a56 100644 (file)
@@ -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 (file)
index 0000000..a4b4a05
--- /dev/null
@@ -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