Blame SOURCES/krb5-tests_use_libs_from_build.patch

01ee0a
#
01ee0a
# krb5-tests_use_libs_from_build.patch - patch to ensure the tests
01ee0a
# in the upstream sources use the libraries from the local tree
01ee0a
# and not those from the underlying build system.
01ee0a
3
01ee0a
# Originally repoted as RedHat Bug #1164304 ("Upstream unit tests loads
01ee0a
# the installed shared libraries instead the ones from the build")
01ee0a
# 
01ee0a
# 
01ee0a
# Description of problem:
01ee0a
# krb5-1.12.2/src/lib/kadm5/unit-test fails (segfaults) when
01ee0a
# krb5-pkinit is installed on the sysytem.
01ee0a
# Monitoring via audit showed that unit tests from this directory
01ee0a
# loads pkinit.so from the installed package and not the one that
01ee0a
# was built.
01ee0a
# On top of that, monitoring showed that libs from the installed
01ee0a
# krb5-libs (whatever version installed) are loaded too.
01ee0a
# This questions the effectiveness of upstream testing.
01ee0a
# 
01ee0a
# Version-Release number of selected component (if applicable):
01ee0a
# krb5-libs-1.12.2-8.el7
01ee0a
# 
01ee0a
# How reproducible:
01ee0a
# always
01ee0a
# 
01ee0a
# Steps to Reproduce:
01ee0a
# 
01ee0a
# # rpm -qa krb5\*
01ee0a
# krb5-devel-1.11.3-49.el7.ppc64
01ee0a
# krb5-libs-1.11.3-49.el7.ppc64
01ee0a
# krb5-pkinit-1.11.3-49.el7.ppc64
01ee0a
# #
01ee0a
# # rpm -ivh krb5-1.12.2-8.el7.src.rpm 
01ee0a
# ... snip ...
01ee0a
# # rpmbuild -bc ~/rpmbuild/SPECS/krb5.spec 
01ee0a
# ... snip ...
01ee0a
# #
01ee0a
# # cd ~/rpmbuild/BUILD/krb5-1.12.2/src/
01ee0a
# # make runenv.py
01ee0a
# LD_LIBRARY_PATH=`echo -L./lib | sed -e "s/-L//g" -e "s/ /:/g"`; export LD_LIBRARY_PATH;  \
01ee0a
# for i in LD_LIBRARY_PATH; do \
01ee0a
# 	eval echo 'env['\\\'$i\\\''] = '\\\'\$$i\\\'; \
01ee0a
# done > pyrunenv.vals
01ee0a
# echo "proxy_tls_impl = 'openssl'" >> pyrunenv.vals
01ee0a
# echo 'env = {}' > runenv.py
01ee0a
# cat pyrunenv.vals >> runenv.py
01ee0a
# # cd lib/kadm5/unit-test/
01ee0a
# # make check
01ee0a
# .. snip ...
01ee0a
# 	KINIT=../../../clients/kinit/kinit \
01ee0a
# 	KDESTROY=../../../clients/kdestroy/kdestroy \
01ee0a
# 	KADMIN_LOCAL=../../../kadmin/cli/kadmin.local \
01ee0a
# 	PRIOCNTL_HACK=0 VALGRIND="" \
01ee0a
# 	
01ee0a
# WARNING: Couldn't find the global config file.
01ee0a
# WARNING: Couldn't find tool init file
01ee0a
# Test Run By root on Fri Nov 14 10:30:35 2014
01ee0a
# Native configuration is powerpc64-redhat-linux-gnu
01ee0a
# 
01ee0a
# 		=== api tests ===
01ee0a
# 
01ee0a
# Schedule of variations:
01ee0a
#     unix
01ee0a
# 
01ee0a
# Running target unix
01ee0a
# Using /usr/share/dejagnu/baseboards/unix.exp as board description file for target.
01ee0a
# Using /usr/share/dejagnu/config/unix.exp as generic interface file for target.
01ee0a
# Using ./config/unix.exp as tool-and-target-specific interface file.
01ee0a
# Running ./api.2/crte-policy.exp ...
01ee0a
# FAIL: create-policy 1: eof
01ee0a
# ERROR: create-policy 1: unexpected failure in init
01ee0a
# ERROR: create-policy 2: unexpected failure in init
01ee0a
# ERROR: create-policy 3: unexpected failure in init
01ee0a
# 
01ee0a
diff -ur krb5/src/kadmin/testing/proto/krb5.conf.proto krb5/src/kadmin/testing/proto/krb5.conf.proto
01ee0a
--- krb5/src/kadmin/testing/proto/krb5.conf.proto	2014-11-14 10:16:22.106948323 -0500
01ee0a
+++ krb5/src/kadmin/testing/proto/krb5.conf.proto	2014-11-14 10:14:16.955948323 -0500
01ee0a
@@ -2,6 +2,7 @@
01ee0a
 	default_realm = __REALM__
01ee0a
 	default_keytab_name = FILE:__K5ROOT__/v5srvtab
01ee0a
 	dns_fallback = no
01ee0a
+	plugin_base_dir = __PLUGIN_DIR__
01ee0a
 
01ee0a
 [realms]
01ee0a
 	__REALM__ = {
01ee0a
diff -ur krb5/src/kadmin/testing/scripts/start_servers krb5/src/kadmin/testing/scripts/start_servers
01ee0a
--- krb5/src/kadmin/testing/scripts/start_servers	2014-08-11 18:46:27.000000000 -0400
01ee0a
+++ krb5/src/kadmin/testing/scripts/start_servers	2014-11-14 10:14:56.409948323 -0500
01ee0a
@@ -40,6 +40,7 @@
01ee0a
 		-e "s/__KDCHOST__/$hostname/g" \
01ee0a
 		-e "s/__LOCALHOST__/$localname/g" \
01ee0a
 		-e "s#__MODDIR__#$TOP/../plugins/kdb#g"\
01ee0a
+		-e "s#__PLUGIN_DIR__#$TOP/../plugins#g"\
01ee0a
 		< $STESTDIR/proto/krb5.conf.proto > $K5ROOT/krb5.conf
01ee0a
 
01ee0a
 # Using /usr/ucb/rsh and getting rid of "-k $REALM" until we get