]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Handle huge /bin directories in libdb2 test
authorTom Yu <tlyu@mit.edu>
Thu, 12 Jul 2012 18:26:15 +0000 (14:26 -0400)
committerTom Yu <tlyu@mit.edu>
Thu, 12 Jul 2012 18:49:02 +0000 (14:49 -0400)
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.

ticket: 7201 (new)
status: pullup
target_version: 1.10.3

src/plugins/kdb/db2/libdb2/test/run.test

index d2d54e94bcdb9469fd20512d0349d1884be50334..7d9f0feb75ff52d826cc3f740ebb975fe323c14f 100644 (file)
@@ -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