svn rev #24138: trunk/src/ lib/krb5/os/

tlyu@MIT.EDU tlyu at MIT.EDU
Fri Jun 18 15:41:48 EDT 2010


http://src.mit.edu/fisheye/changelog/krb5/?cs=24138
Commit By: tlyu
Log Message:
ticket: 6744
subject: only test t_locate_kdc if known-good DNS name is present
target_version: 1.8.3
tags: pullup

Running "make check" while offline or on a firewalled network may
result in failure in lib/krb5/os because the invocation of
t_locate_kdc requires that the DNS servers for ATHENA.MIT.EDU be
reachable.  Autodetect DNS utilities "dig" and "nslookup", and use
them to check for existence of the known-good DNS name.  Also
parameterize the test so that the known-good DNS name can be
overridden on the make command line.


Changed Files:
U   trunk/src/configure.in
U   trunk/src/lib/krb5/os/Makefile.in
Modified: trunk/src/configure.in
===================================================================
--- trunk/src/configure.in	2010-06-14 20:46:27 UTC (rev 24137)
+++ trunk/src/configure.in	2010-06-18 19:41:48 UTC (rev 24138)
@@ -662,6 +662,11 @@
 AC_MSG_RESULT($ac_cv_printf_positional)
 
 
+# for t_locate_kdc test
+
+AC_PATH_PROG(DIG, dig, false)
+AC_PATH_PROG(NSLOOKUP, nslookup, false)
+
 # for kadmin
 
 AC_PROG_YACC

Modified: trunk/src/lib/krb5/os/Makefile.in
===================================================================
--- trunk/src/lib/krb5/os/Makefile.in	2010-06-14 20:46:27 UTC (rev 24137)
+++ trunk/src/lib/krb5/os/Makefile.in	2010-06-18 19:41:48 UTC (rev 24138)
@@ -192,7 +192,9 @@
 	$(LCLINT) $(LCLINTOPTS) $(CPPFLAGS) $(LOCALINCLUDES) $(DEFS) \
 		-DTEST $(srcdir)/localaddr.c
 
-check-unix:: $(TEST_PROGS)
+check-unix:: check-unix-stdconf check-unix-locate check-unix-antoln
+
+check-unix-stdconf:: t_std_conf
 	KRB5_CONFIG=$(srcdir)/td_krb5.conf ; export KRB5_CONFIG ;\
 	$(KRB5_RUN_ENV) $(VALGRIND) ./t_std_conf  -d -s NEW.DEFAULT.REALM -d \
 		-k IGGY.ORG -k DEFAULT_REALM.TST \
@@ -201,17 +203,29 @@
 		-r pgp.good.idea -r no_domain > test.out
 	cmp test.out $(srcdir)/ref_std_conf.out
 	$(RM) test.out
-	KRB5_CONFIG=$(srcdir)/td_krb5.conf ; export KRB5_CONFIG ;\
-	if test "$(OFFLINE)" != yes; then \
-	  $(KRB5_RUN_ENV) $(VALGRIND) ./t_locate_kdc ATHENA.MIT.EDU; \
+
+# The following can be overriden on the make command line if needed:
+LOCREALM = ATHENA.MIT.EDU
+SRVNAME = _kerberos._udp.athena.mit.edu.
+DIGPAT = '^_kerberos.*srv'
+NSPAT = '^_kerberos.*service'
+DIG = @DIG@
+NSLOOKUP = @NSLOOKUP@
+
+check-unix-locate:: t_locate_kdc
+	if [ "$(OFFLINE)" = no ] && \
+	    $(DIG) $(SRVNAME) srv | grep -i $(DIGPAT) || \
+	    $(NSLOOKUP) -q=srv $(SRVNAME) | grep -i $(NSPAT); then \
+	    KRB5_CONFIG=$(srcdir)/td_krb5.conf ; export KRB5_CONFIG ;\
+	    $(KRB5_RUN_ENV) $(VALGRIND) ./t_locate_kdc $(LOCREALM); \
 	else \
-	  echo SKIPPING t_locate_kdc TEST WHILE OFFLINE; \
+	    echo '*** WARNING: skipped t_locate_kdc test: known DNS name not found'; \
 	fi
 
 #
 # Do some aname-to-lname testing.
 #
-check-unix::
+check-unix-antoln:: t_an_to_ln
 	echo '[libdefaults]' > ./t_an.conf
 	echo '	default_realm = r' >> ./t_an.conf
 	echo '[realms]' >> ./t_an.conf




More information about the cvs-krb5 mailing list