krb5 commit [krb5-1.13]: Test bt_split.c unaligned access

Tom Yu tlyu at mit.edu
Fri Sep 9 17:30:29 EDT 2016


https://github.com/krb5/krb5/commit/12e3c4465e4c4514af47d11e128caec303c9556e
commit 12e3c4465e4c4514af47d11e128caec303c9556e
Author: Tom Yu <tlyu at mit.edu>
Date:   Wed Sep 7 18:20:56 2016 -0400

    Test bt_split.c unaligned access
    
    (back ported from commit 4613d503986f34f05ff310fcc580f65ba60eec5b)
    
    ticket: 8493
    version_fixed: 1.13.7

 src/plugins/kdb/db2/libdb2/test/run.test |   26 ++++++++++++++++++++++++--
 1 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/src/plugins/kdb/db2/libdb2/test/run.test b/src/plugins/kdb/db2/libdb2/test/run.test
index b907105..d61f637 100644
--- a/src/plugins/kdb/db2/libdb2/test/run.test
+++ b/src/plugins/kdb/db2/libdb2/test/run.test
@@ -36,7 +36,7 @@ main()
 	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 60 61 62; do
+		for t in 1 2 3 4 5 6 7 8 9 10 11 12 13 20 40 41 60 61 62 63; do
 			test$t
 		done
 	else
@@ -47,7 +47,7 @@ main()
 			[0-9]*)
 				test$1;;
 			btree)
-				for t in 1 2 3 7 8 9 10 12 13 40 41 60 61 62; do
+				for t in 1 2 3 7 8 9 10 12 13 40 41 60 61 62 63; do
 					test$t
 				done;;
 			hash)
@@ -970,4 +970,26 @@ test62 () {
 	done
 }
 
+test63 () {
+	echo "Test 63: btree: big key, medium data, bt_split unaligned access"
+	# 488 = 512 - 20 (header) - 3 ("foo") - 1 (newline)
+	# 223 = 232 - 8 (key pointer)
+	# 232 = bt_ovflsize = (512 - 20 (header)) / 2 (DEFMINKEYPAGE)
+	#	- (2 (indx_t) + 12 (NBLEAFDBT(0,0)))
+	awk 'BEGIN {
+		s = "";
+		for (i = 0; i < 488; i++) {
+			s = s "x";
+		}
+		d = "";
+		for (i = 0; i < 223; i++) {
+			d = d "x";
+		}
+		for (i = 0; i < 128; i++) {
+			printf("p\nk%s%03d\nd%s\n", s, i, d);
+		}
+	}' /dev/null > $TMP2
+	$PROG -o $TMP3 -i psize=512 btree $TMP2
+}
+
 main $*


More information about the cvs-krb5 mailing list