svn rev #25223: trunk/src/lib/kdb/

ghudson@MIT.EDU ghudson at MIT.EDU
Wed Sep 21 17:18:35 EDT 2011


http://src.mit.edu/fisheye/changelog/krb5/?cs=25223
Commit By: ghudson
Log Message:
Fix string attribute unit tests.

Wrap t_stringattr in a very minimal Python test script so that libkdb5
can find the DB2 module to allocate memory.


Changed Files:
U   trunk/src/lib/kdb/Makefile.in
U   trunk/src/lib/kdb/t_stringattr.c
A   trunk/src/lib/kdb/t_stringattr.py
Modified: trunk/src/lib/kdb/Makefile.in
===================================================================
--- trunk/src/lib/kdb/Makefile.in	2011-09-21 18:40:43 UTC (rev 25222)
+++ trunk/src/lib/kdb/Makefile.in	2011-09-21 21:18:35 UTC (rev 25223)
@@ -58,10 +58,10 @@
 install-unix:: install-libs
 clean-unix:: clean-liblinks clean-libs clean-libobjs
 	$(RM) adb_err.c adb_err.h t_stringattr.o t_stringattr
-check-unix:: t_stringattr
-	KRB5_CONFIG=$(top_srcdir)/config-files/krb5.conf; export KRB5_CONFIG; \
-	$(RUN_SETUP) $(VALGRIND) ./t_stringattr
 
+check-pytests:: t_stringattr
+	$(RUNPYTEST) $(srcdir)/t_stringattr.py $(PYTESTFLAGS)
+
 generate-files-mac: darwin.exports
 
 depend:: adb_err.h

Modified: trunk/src/lib/kdb/t_stringattr.c
===================================================================
--- trunk/src/lib/kdb/t_stringattr.c	2011-09-21 18:40:43 UTC (rev 25222)
+++ trunk/src/lib/kdb/t_stringattr.c	2011-09-21 21:18:35 UTC (rev 25223)
@@ -46,12 +46,14 @@
     char *val;
     int count;
 
-    assert(krb5_init_context(&context) == 0);
+    assert(krb5int_init_context_kdc(&context) == 0);
 
     /* Start with an empty entry. */
     ent = krb5_db_alloc(context, NULL, sizeof(*ent));
-    if (ent == NULL)
-        return ENOMEM;
+    if (ent == NULL) {
+        fprintf(stderr, "Can't allocate memory for entry.\n");
+        return 1;
+    }
     memset(ent, 0, sizeof(*ent));
 
     /* Check that the entry has no strings to start. */

Added: trunk/src/lib/kdb/t_stringattr.py
===================================================================
--- trunk/src/lib/kdb/t_stringattr.py	                        (rev 0)
+++ trunk/src/lib/kdb/t_stringattr.py	2011-09-21 21:18:35 UTC (rev 25223)
@@ -0,0 +1,6 @@
+#!/usr/bin/python
+from k5test import *
+
+realm = K5Realm(create_kdb=False)
+realm.run_as_master(['./t_stringattr'])
+success('String attribute unit tests.')




More information about the cvs-krb5 mailing list