[26752] in CVS-changelog-for-Kerberos-V5

home help back first fref pref prev next nref lref last post

krb5 commit [krb5-1.10]: Handle huge /bin directories in libdb2 test

daemon@ATHENA.MIT.EDU (Tom Yu)
Mon Jul 23 16:26:42 2012

Date: Mon, 23 Jul 2012 16:26:21 -0400
From: Tom Yu <tlyu@mit.edu>
Message-Id: <201207232026.q6NKQLKf029000@drugstore.mit.edu>
To: cvs-krb5@mit.edu
Reply-To: krbdev@mit.edu
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cvs-krb5-bounces@mit.edu

https://github.com/krb5/krb5/commit/6ae99a7300195ed05df5a5efa43486e98ef7ef1c
commit 6ae99a7300195ed05df5a5efa43486e98ef7ef1c
Author: Tom Yu <tlyu@mit.edu>
Date:   Thu Jul 12 14:26:15 2012 -0400

    Handle huge /bin directories in libdb2 test
    
    The test suite for libdb2 uses /bin as a source of filenames and
    contents for insertion into databases.  Fedora 17 (and possibly other
    OSes) have /bin symlinked to /usr/bin, which can vastly increase the
    number of files found, exceeding some limits of the test databases.
    Truncate this list of files at 100 to prevent this problem.
    
    (cherry picked from commit 18a378eb43a7a5a5e14a7e6c3b6504fe32804781)
    
    ticket: 7201
    version_fixed: 1.10.3
    status: resolved

 src/plugins/kdb/db2/libdb2/test/run.test |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/plugins/kdb/db2/libdb2/test/run.test b/src/plugins/kdb/db2/libdb2/test/run.test
index d2d54e9..7d9f0fe 100644
--- a/src/plugins/kdb/db2/libdb2/test/run.test
+++ b/src/plugins/kdb/db2/libdb2/test/run.test
@@ -11,6 +11,7 @@ main()
 	TMP1=${TMPDIR-.}/t1
 	TMP2=${TMPDIR-.}/t2
 	TMP3=${TMPDIR-.}/t3
+	BINFILES=${TMPDIR-.}/binfiles
 
 	if [ \! -z "$WORDLIST" -a -f "$WORDLIST" ]; then
 		DICT=$WORDLIST
@@ -32,6 +33,7 @@ main()
 	dictsize=`wc -l < $DICT`
 
 	bindir=/bin/.
+	find $bindir -type f -exec test -r {} \; -print | head -100 > $BINFILES
 
 	if [ $# -eq 0 ]; then
 		for t in 1 2 3 4 5 6 7 8 9 10 11 12 13 20 40 41; do
@@ -64,7 +66,7 @@ main()
 			shift
 		done
 	fi
-	rm -f $TMP1 $TMP2 $TMP3
+	rm -f $TMP1 $TMP2 $TMP3 $BINFILES
 	exit 0
 }
 
@@ -154,10 +156,10 @@ test3()
 {
 	echo "Test 3: hash: small key, big data pairs"
 	rm -f $TMP1
-	(find $bindir -type f -exec test -r {} \; -print | xargs cat) > $TMP1
+	xargs cat < $BINFILES > $TMP1
 	for type in hash; do
 		rm -f $TMP2 $TMP3
-		for i in `find $bindir -type f -exec test -r {} \; -print`; do
+		for i in `cat $BINFILES`; do
 			echo p
 			echo k$i
 			echo D$i
@@ -176,7 +178,7 @@ test3()
 		echo "    page size $psize"
 		for type in btree; do
 			rm -f $TMP2 $TMP3
-			for i in `find $bindir -type f -exec test -r {} \; -print`; do
+			for i in `cat $BINFILES`; do
 				echo p
 				echo k$i
 				echo D$i
@@ -193,11 +195,10 @@ test3()
 	done
 	echo "Test 3: recno: big data pairs"
 	rm -f $TMP2 $TMP3
-	find $bindir -type f -exec test -r {} \; -print | 
 	awk '{
 		++i;
 		printf("p\nk%d\nD%s\ng\nk%d\n", i, $0, i);
-	}' > $TMP2
+	}' < $BINFILES > $TMP2
 	for psize in 512 16384 65536; do
 		echo "    page size $psize"
 		$PROG -i psize=$psize -o $TMP3 recno $TMP2
_______________________________________________
cvs-krb5 mailing list
cvs-krb5@mit.edu
https://mailman.mit.edu/mailman/listinfo/cvs-krb5

home help back first fref pref prev next nref lref last post