1 # $NetBSD: t_db.sh,v 1.7 2016/09/24 20:12:33 christos Exp $
3 # Copyright (c) 2008 The NetBSD Foundation, Inc.
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions
9 # 1. Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer.
11 # 2. Redistributions in binary form must reproduce the above copyright
12 # notice, this list of conditions and the following disclaimer in the
13 # documentation and/or other materials provided with the distribution.
15 # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
16 # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
17 # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18 # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
19 # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 # POSSIBILITY OF SUCH DAMAGE.
30 echo $(atf_get_srcdir)/h_db
35 echo $(atf_get_srcdir)/h_lfsr
40 if [ -f /usr/share/dict/words ]; then
41 echo /usr/share/dict/words
42 elif [ -f /usr/dict/words ]; then
45 atf_fail "no dictionary found"
49 SEVEN_SEVEN="abcdefg|abcdefg|abcdefg|abcdefg|abcdefg|abcdefg|abcdefg"
51 atf_test_case small_btree
55 "Checks btree database using small keys and small data" \
56 "pairs: takes the first hundred entries in the dictionary," \
57 "and makes them be key/data pairs."
59 atf_set "require.files" /usr/share/dict/words
64 TMPDIR="$(pwd)/db_dir"; export TMPDIR
69 for i in `sed 200q $(dict)`; do
77 atf_check -o file:exp "$(prog_db)" btree in
80 atf_test_case small_hash
84 "Checks hash database using small keys and small data" \
85 "pairs: takes the first hundred entries in the dictionary," \
86 "and makes them be key/data pairs."
88 atf_set "require.files" /usr/share/dict/words
93 TMPDIR="$(pwd)/db_dir"; export TMPDIR
98 for i in `sed 200q $(dict)`; do
106 atf_check -o file:exp "$(prog_db)" hash in
109 atf_test_case small_recno
113 "Checks recno database using small keys and small data" \
114 "pairs: takes the first hundred entries in the dictionary," \
115 "and makes them be key/data pairs."
117 atf_set "require.files" /usr/share/dict/words
122 TMPDIR="$(pwd)/db_dir"; export TMPDIR
125 sed 200q $(dict) >exp
130 printf("p\nk%d\nd%s\ng\nk%d\n", i, $0, i);
133 atf_check -o file:exp "$(prog_db)" recno in
136 atf_test_case medium_btree
140 "Checks btree database using small keys and medium" \
141 "data pairs: takes the first 200 entries in the" \
142 "dictionary, and gives them each a medium size data entry."
144 atf_set "require.files" /usr/share/dict/words
149 TMPDIR="$(pwd)/db_dir"; export TMPDIR
152 mdata=abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
154 awk '{ for (i = 1; i < 201; ++i) print $0 }' >exp
156 for i in $(sed 200q $(dict)); do
164 atf_check -o file:exp "$(prog_db)" btree in
167 atf_test_case medium_hash
171 "Checks hash database using small keys and medium" \
172 "data pairs: takes the first 200 entries in the" \
173 "dictionary, and gives them each a medium size data entry."
175 atf_set "require.files" /usr/share/dict/words
180 TMPDIR="$(pwd)/db_dir"; export TMPDIR
183 mdata=abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
185 awk '{ for (i = 1; i < 201; ++i) print $0 }' >exp
187 for i in $(sed 200q $(dict)); do
195 atf_check -o file:exp "$(prog_db)" hash in
198 atf_test_case medium_recno
202 "Checks recno database using small keys and medium" \
203 "data pairs: takes the first 200 entries in the" \
204 "dictionary, and gives them each a medium size data entry."
208 TMPDIR="$(pwd)/db_dir"; export TMPDIR
211 mdata=abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
213 awk '{ for (i = 1; i < 201; ++i) print $0 }' >exp
216 awk '{ for (i = 1; i < 201; ++i)
217 printf("p\nk%d\nd%s\ng\nk%d\n", i, $0, i);
220 atf_check -o file:exp "$(prog_db)" recno in
223 atf_test_case big_btree
227 "Checks btree database using small keys and big data" \
228 "pairs: inserts the programs in /bin with their paths" \
233 TMPDIR="$(pwd)/db_dir"; export TMPDIR
236 (find /bin -type f -print | xargs cat) >exp
238 for psize in 512 16384 65536; do
239 echo "checking page size: $psize"
241 for i in `find /bin -type f -print`; do
249 atf_check "$(prog_db)" -o out btree in
250 cmp -s exp out || atf_fail "test failed for page size: $psize"
254 atf_test_case big_hash
258 "Checks hash database using small keys and big data" \
259 "pairs: inserts the programs in /bin with their paths" \
264 TMPDIR="$(pwd)/db_dir"; export TMPDIR
267 (find /bin -type f -print | xargs cat) >exp
269 for i in `find /bin -type f -print`; do
277 atf_check "$(prog_db)" -o out hash in
278 cmp -s exp out || atf_fail "test failed"
281 atf_test_case big_recno
285 "Checks recno database using small keys and big data" \
286 "pairs: inserts the programs in /bin with their paths" \
291 TMPDIR="$(pwd)/db_dir"; export TMPDIR
294 (find /bin -type f -print | xargs cat) >exp
296 find /bin -type f -print |
299 printf("p\nk%d\nD%s\ng\nk%d\n", i, $0, i);
302 for psize in 512 16384 65536; do
303 echo "checking page size: $psize"
305 atf_check "$(prog_db)" -o out recno in
306 cmp -s exp out || atf_fail "test failed for page size: $psize"
310 atf_test_case random_recno
313 atf_set "descr" "Checks recno database using random entries"
317 TMPDIR="$(pwd)/db_dir"; export TMPDIR
322 for (i = 37; i <= 37 + 88 * 17; i += 17) {
324 s = substr($0, 1, i % 41);
327 printf("input key %d: %s\n", i, s);
329 for (i = 1; i <= 15; ++i) {
331 s = substr($0, 1, i % 41);
334 printf("input key %d: %s\n", i, s);
336 for (i = 19234; i <= 19234 + 61 * 27; i += 27) {
338 s = substr($0, 1, i % 41);
341 printf("input key %d: %s\n", i, s);
352 printf("p\nk%d\nd%s\n", i, $0);
353 if (i == 19234 + 61 * 27)
355 if (i == 37 + 88 * 17) {
358 } else if (i == 15) {
365 for (i = 37; i <= 37 + 88 * 17; i += 17)
366 printf("g\nk%d\n", i);
367 for (i = 1; i <= 15; ++i)
368 printf("g\nk%d\n", i);
369 for (i = 19234; i <= 19234 + 61 * 27; i += 27)
370 printf("g\nk%d\n", i);
373 atf_check -o file:exp "$(prog_db)" recno in
376 atf_test_case reverse_recno
379 atf_set "descr" "Checks recno database using reverse order entries"
383 TMPDIR="$(pwd)/db_dir"; export TMPDIR
388 for (i = 1500; i; --i) {
390 s = substr($0, 1, i % 34);
393 printf("input key %d: %s\n", i, s);
403 printf("p\nk%d\nd%s\n", i, $0);
407 for (i = 1500; i; --i)
408 printf("g\nk%d\n", i);
411 atf_check -o file:exp "$(prog_db)" recno in
414 atf_test_case alternate_recno
415 alternate_recno_head()
417 atf_set "descr" "Checks recno database using alternating order entries"
419 alternate_recno_body()
421 TMPDIR="$(pwd)/db_dir"; export TMPDIR
426 for (i = 1; i < 1200; i += 2) {
428 s = substr($0, 1, i % 34);
431 printf("input key %d: %s\n", i, s);
433 for (i = 2; i < 1200; i += 2) {
435 s = substr($0, 1, i % 34);
438 printf("input key %d: %s\n", i, s);
449 printf("p\nk%d\nd%s\n", i, $0);
459 for (i = 1; i < 1200; ++i)
460 printf("g\nk%d\n", i);
463 atf_check "$(prog_db)" -o out recno in
468 cmp -s exp out || atf_fail "test failed"
473 TMPDIR="$(pwd)/db_dir"; export TMPDIR
480 for (i = 1; i <= 120; ++i)
481 printf("%05d: input key %d: %s\n", i, i, $0);
486 printf("p\nk%d\nd%s\n", ++i, $0);
490 for (i = 1; i <= 120; ++i)
492 printf("fR_CURSOR\ns\nkXX\n");
494 printf("fR_NEXT\ns\n");
495 printf("fR_CURSOR\ns\nk1\n");
497 printf("fR_FIRST\ns\n");
500 # For btree, the records are ordered by the string representation
501 # of the key value. So sort the expected output file accordingly,
502 # and set the seek_last key to the last expected key value.
504 if [ "$type" = "btree" ] ; then
505 sed -e 's/kXX/k99/' < in > tmp
507 sort -d -k4 < exp > tmp
511 printf("%05d: input key %d: %s\n", 99, 99, $0);
512 printf("seq failed, no such key\n");
513 printf("%05d: input key %d: %s\n", 1, 1, $0);
514 printf("%05d: input key %d: %s\n", 10, 10, $0);
518 # For recno, records are ordered by numerical key value. No sort
519 # is needed, but still need to set proper seek_last key value.
520 sed -e 's/kXX/k120/' < in > tmp
524 printf("%05d: input key %d: %s\n", 120, 120, $0);
525 printf("seq failed, no such key\n");
526 printf("%05d: input key %d: %s\n", 1, 1, $0);
527 printf("%05d: input key %d: %s\n", 2, 2, $0);
532 atf_check "$(prog_db)" -o out $type in
533 atf_check -o file:exp cat out
536 atf_test_case delete_btree
539 atf_set "descr" "Checks removing records in btree database"
546 atf_test_case delete_recno
549 atf_set "descr" "Checks removing records in recno database"
559 TMPDIR="$(pwd)/db_dir"; export TMPDIR
564 for (i = 1; i <= 10; ++i) {
565 printf("p\nkkey1\nD/bin/sh\n");
566 printf("p\nkkey2\nD/bin/csh\n");
568 printf("c\nkkey2\nD/bin/csh\n");
569 printf("c\nkkey1\nD/bin/sh\n");
570 printf("e\t%d of 10 (comparison)\n", i);
572 printf("e\t%d of 10 \n", i);
573 printf("r\nkkey1\nr\nkkey2\n");
580 atf_test_case repeated_btree
581 repeated_btree_head()
584 "Checks btree database with repeated small keys and" \
585 "big data pairs. Makes sure that overflow pages are reused"
587 repeated_btree_body()
592 atf_test_case repeated_hash
596 "Checks hash database with repeated small keys and" \
597 "big data pairs. Makes sure that overflow pages are reused"
604 atf_test_case duplicate_btree
605 duplicate_btree_head()
607 atf_set "descr" "Checks btree database with duplicate keys"
609 duplicate_btree_body()
611 TMPDIR="$(pwd)/db_dir"; export TMPDIR
616 for (i = 1; i <= 543; ++i)
617 printf("%05d: input key %d: %s\n", i, i, $0);
624 printf("p\nkduplicatekey\nd%s\n", $0);
626 printf("p\nkunique%dkey\nd%s\n", i, $0);
632 atf_check -o file:exp -x "$(prog_db) -iflags=1 btree in | sort"
638 TMPDIR="$(pwd)/db_dir"; export TMPDIR
643 for (i = 1; i <= 20; ++i)
644 printf("%05d: input key %d: %s\n", i, i, $0);
648 # Test that R_CURSOR doesn't succeed before cursor initialized
653 printf("p\nk%d\nd%s\n", ++i, $0);
656 printf("fR_CURSOR\nr\n");
657 printf("eR_CURSOR SHOULD HAVE FAILED\n");
660 atf_check -o ignore -e ignore -s ne:0 "$(prog_db)" -o out $type in
661 atf_check -s ne:0 test -s out
667 printf("p\nk%d\nd%s\n", ++i, $0);
670 printf("fR_CURSOR\np\nk1\ndsome data\n");
671 printf("eR_CURSOR SHOULD HAVE FAILED\n");
674 atf_check -o ignore -e ignore -s ne:0 "$(prog_db)" -o out $type in
675 atf_check -s ne:0 test -s out
678 atf_test_case cursor_flags_btree
679 cursor_flags_btree_head()
682 "Checks use of cursor flags without initialization in btree database"
684 cursor_flags_btree_body()
689 atf_test_case cursor_flags_recno
690 cursor_flags_recno_head()
693 "Checks use of cursor flags without initialization in recno database"
695 cursor_flags_recno_body()
700 atf_test_case reverse_order_recno
701 reverse_order_recno_head()
703 atf_set "descr" "Checks reverse order inserts in recno database"
705 reverse_order_recno_body()
707 TMPDIR="$(pwd)/db_dir"; export TMPDIR
712 for (i = 1; i <= 779; ++i)
713 printf("%05d: input key %d: %s\n", i, i, $0);
721 printf("p\nk1\nd%s\n", $0);
722 printf("%s\n", "fR_IBEFORE");
724 printf("p\nk1\nd%s\n", $0);
730 atf_check -o file:exp "$(prog_db)" recno in
733 atf_test_case small_page_btree
734 small_page_btree_head()
737 "Checks btree database with lots of keys and small page" \
738 "size: takes the first 20000 entries in the dictionary," \
739 "reverses them, and gives them each a small size data" \
740 "entry. Uses a small page size to make sure the btree" \
741 "split code gets hammered."
743 atf_set "require.files" /usr/share/dict/words
746 small_page_btree_body()
748 TMPDIR="$(pwd)/db_dir"; export TMPDIR
751 mdata=abcdefghijklmnopqrstuvwxy
753 awk '{ for (i = 1; i < 20001; ++i) print $0 }' >exp
755 for i in `sed 20000q $(dict) | rev`; do
763 atf_check -o file:exp "$(prog_db)" -i psize=512 btree in
768 TMPDIR="$(pwd)/db_dir"; export TMPDIR
774 for order in 1234 4321; do
775 for i in `sed 50q $(dict)`; do
784 atf_check -o file:exp "$(prog_db)" -ilorder=$order -f byte.file $type in
786 for i in `sed 50q $(dict)`; do
791 atf_check -o file:exp "$(prog_db)" -s -ilorder=$order -f byte.file $type in
795 atf_test_case byte_orders_btree
796 byte_orders_btree_head()
798 atf_set "descr" "Checks btree database using differing byte orders"
800 atf_set "require.files" /usr/share/dict/words
803 byte_orders_btree_body()
808 atf_test_case byte_orders_hash
809 byte_orders_hash_head()
811 atf_set "descr" "Checks hash database using differing byte orders"
813 byte_orders_hash_body()
823 echo "bucketsize $bsize, fill factor $ffactor"
824 atf_check -o file:exp "$(prog_db)" "-ibsize=$bsize,\
825 ffactor=$ffactor,nelem=25000,cachesize=65536" hash in
828 atf_test_case bsize_ffactor
831 atf_set "timeout" "1800"
832 atf_set "descr" "Checks hash database with various" \
833 "bucketsizes and fill factors"
835 atf_set "require.files" /usr/share/dict/words
840 TMPDIR="$(pwd)/db_dir"; export TMPDIR
845 for (i = 1; i <= 10000; ++i) {
847 s = substr($0, 1, i % 34);
862 s = substr(ds, 1, i % 34);
865 printf("p\nk%s\nd%s\n", $0, s);
871 printf("g\nk%s\n", $0);
874 h_bsize_ffactor 256 11
875 h_bsize_ffactor 256 14
876 h_bsize_ffactor 256 21
878 h_bsize_ffactor 512 21
879 h_bsize_ffactor 512 28
880 h_bsize_ffactor 512 43
882 h_bsize_ffactor 1024 43
883 h_bsize_ffactor 1024 57
884 h_bsize_ffactor 1024 85
886 h_bsize_ffactor 2048 85
887 h_bsize_ffactor 2048 114
888 h_bsize_ffactor 2048 171
890 h_bsize_ffactor 4096 171
891 h_bsize_ffactor 4096 228
892 h_bsize_ffactor 4096 341
894 h_bsize_ffactor 8192 341
895 h_bsize_ffactor 8192 455
896 h_bsize_ffactor 8192 683
898 h_bsize_ffactor 16384 341
899 h_bsize_ffactor 16384 455
900 h_bsize_ffactor 16384 683
902 h_bsize_ffactor 32768 341
903 h_bsize_ffactor 32768 455
904 h_bsize_ffactor 32768 683
909 h_bsize_ffactor 65536 341
910 h_bsize_ffactor 65536 455
911 h_bsize_ffactor 65536 683
917 # This tests 64K block size addition/removal
918 atf_test_case four_char_hash
919 four_char_hash_head()
922 "Checks hash database with 4 char key and" \
923 "value insert on a 65536 bucket size"
925 four_char_hash_body()
927 TMPDIR="$(pwd)/db_dir"; export TMPDIR
940 atf_check "$(prog_db)" -i bsize=32768 hash in
943 atf_check "$(prog_db)" -i bsize=65536 hash in
950 atf_test_case bsize_torture
953 atf_set "timeout" "36000"
954 atf_set "descr" "Checks hash database with various bucket sizes"
958 TMPDIR="$(pwd)/db_dir"; export TMPDIR
962 # db(3) doesn't support 64kB bucket sizes
963 for i in 2048 4096 8192 16384 32768 # 65536
966 atf_check "$(prog_lfsr)" $i
970 atf_test_case btree_weird_page_split
971 btree_weird_page_split_head()
974 "Test for a weird page split condition where an insertion " \
975 "into index 0 of a page that would cause the new item to " \
976 "be the only item on the left page results in index 0 of " \
977 "the right page being erroneously skipped; this only " \
978 "happens with one particular key+data length for each page size."
980 btree_weird_page_split_body()
982 for psize in 512 1024 2048 4096 8192; do
983 echo " page size $psize"
984 kdsizes=`awk 'BEGIN {
985 psize = '$psize'; hsize = int(psize/2);
986 for (kdsize = hsize-40; kdsize <= hsize; kdsize++) {
991 # Use a series of keylen+datalen values in the right
992 # neighborhood to find the one that triggers the bug.
993 # We could compute the exact size that triggers the
994 # bug but this additional fuzz may be useful.
996 # Insert keys in reverse order to maximize the chances
997 # for a split on index 0.
999 for kdsize in $kdsizes; do
1002 for (i = 8; i-- > 0; ) {
1003 s = sprintf("a%03d:%09d", i, kdsize);
1004 for (j = 0; j < kdsize-20; j++) {
1007 printf("p\nka%03d\nd%s\n", i, s);
1011 sed -n 's/^d//p' in | sort > exp
1012 atf_check -o file:exp \
1013 "$(prog_db)" -i psize=$psize btree in
1018 # Extremely tricky test attempting to replicate some unusual database
1019 # corruption seen in the field: pieces of the database becoming
1020 # inaccessible to random access, sequential access, or both. The
1021 # hypothesis is that at least some of these are triggered by the bug
1022 # in page splits on index 0 with a particular exact keylen+datalen.
1023 # (See Test 40.) For psize=4096, this size is exactly 2024.
1025 # The order of operations here relies on very specific knowledge of
1026 # the internals of the btree access method in order to place records
1027 # at specific offsets in a page and to create certain keys on internal
1028 # pages. The to-be-split page immediately prior to the bug-triggering
1029 # split has the following properties:
1031 # * is not the leftmost leaf page
1032 # * key on the parent page is compares less than the key of the item
1034 # * triggering record's key also compares greater than the key on the
1037 # Additionally, we prime the mpool LRU chain so that the head page on
1038 # the chain has the following properties:
1040 # * record at index 0 is located where it will not get overwritten by
1041 # items written to the right-hand page during the split
1042 # * key of the record at index 0 compares less than the key of the
1043 # bug-triggering record
1045 # If the page-split bug exists, this test appears to create a database
1046 # where some records are inaccessible to a search, but still remain in
1047 # the file and are accessible by sequential traversal. At least one
1048 # record gets duplicated out of sequence.
1050 atf_test_case btree_tricky_page_split
1051 btree_tricky_page_split_head()
1054 "btree: no unsearchables due to page split on index 0"
1056 btree_tricky_page_split_body()
1058 list=`(for i in a b c d; do
1059 for j in 990 998 999; do
1060 echo g ${i}${j} 1024
1065 for j in 998 999; do
1066 echo g ${i}${j} 1024
1069 # Exact number for trigger condition accounts for newlines
1070 # retained by dbtest with -ofile but not without; we use
1071 # -ofile, so count newlines. keylen=5,datalen=5+2014 for
1102 # {p|g|r} key [datasize]
1104 printf("%s\nk%s\n", $1, $2);
1108 for (i = 0; i < $3; i++) {
1116 (echo "$list"; echo "$list") | awk '{
1118 for (i = 0; i < $3; i++) {
1123 atf_check -o file:exp \
1124 "$(prog_db)" -i psize=4096 btree in
1130 atf_test_case btree_recursive_traversal
1131 btree_recursive_traversal_head()
1134 "btree: Test for recursive traversal successfully " \
1135 "retrieving records that are inaccessible to normal " \
1136 "sequential 'sibling-link' traversal. This works by " \
1137 "unlinking a few leaf pages but leaving their parent " \
1138 "links intact. To verify that the unlink actually makes " \
1139 "records inaccessible, the test first uses 'o' to do a " \
1140 "normal sequential traversal, followed by 'O' to do a " \
1141 "recursive traversal."
1143 btree_recursive_traversal_body()
1145 fill="abcdefghijklmnopqrstuvwxyzy"
1147 for (i = 0; i < 20000; i++) {
1148 printf("p\nkAA%05d\nd%05d%s\n", i, i, $0);
1155 (echo $fill | awk "$script"; echo o) > in1
1158 for (i = 0; i < 20000; i++) {
1159 if (i >= 5 && i <= 40)
1161 printf("%05d%s\n", i, $0);
1164 atf_check -o file:exp1 \
1165 "$(prog_db)" -i psize=512 btree in1
1168 for (i = 0; i < 20000; i++) {
1169 printf("%05d%s\n", i, $0);
1172 (echo $fill | awk "$script"; echo O) > in2
1173 atf_check -o file:exp2 \
1174 "$(prog_db)" -i psize=512 btree in2
1180 atf_test_case btree_byteswap_unaligned_access_bksd
1181 btree_byteswap_unaligned_access_bksd_head()
1184 "btree: big key, small data, byteswap unaligned access"
1186 btree_byteswap_unaligned_access_bksd_body()
1188 (echo foo; echo bar) |
1191 for (i = 0; i < 488; i++) {
1194 printf("p\nk%s\ndx\n", s);
1196 for order in 1234 4321; do
1198 "$(prog_db)" -o out -i psize=512,lorder=$order btree in
1202 atf_test_case btree_byteswap_unaligned_access_skbd
1203 btree_byteswap_unaligned_access_skbd_head()
1206 "btree: small key, big data, byteswap unaligned access"
1208 btree_byteswap_unaligned_access_skbd_body()
1210 # 484 = 512 - 20 (header) - 7 ("foo1234") - 1 (newline)
1211 (echo foo1234; echo bar1234) |
1214 for (i = 0; i < 484; i++) {
1217 printf("p\nk%s\nd%s\n", $0, s);
1219 for order in 1234 4321; do
1221 "$(prog_db)" -o out -i psize=512,lorder=$order btree in
1225 atf_test_case btree_known_byte_order
1226 btree_known_byte_order_head()
1229 "btree: small key, big data, known byte order"
1231 btree_known_byte_order_body()
1233 local a="-i psize=512,lorder="
1235 (echo foo1234; echo bar1234) |
1238 for (i = 0; i < 484; i++) {
1243 (echo foo1234; echo bar1234) |
1246 for (i = 0; i < 484; i++) {
1249 printf("p\nk%s\nd%s\n", $0, s);
1251 for order in 1234 4321; do
1253 "$(prog_db)" -f out.$order $a$order btree in1
1255 (echo g; echo kfoo1234; echo g; echo kbar1234) > in2
1256 for order in 1234 4321; do
1257 atf_check -o file:exp \
1258 "$(prog_db)" -s -f out.$order $a$order btree in2
1262 atf_init_test_cases()
1264 atf_add_test_case small_btree
1265 atf_add_test_case small_hash
1266 atf_add_test_case small_recno
1267 atf_add_test_case medium_btree
1268 atf_add_test_case medium_hash
1269 atf_add_test_case medium_recno
1270 atf_add_test_case big_btree
1271 atf_add_test_case big_hash
1272 atf_add_test_case big_recno
1273 atf_add_test_case random_recno
1274 atf_add_test_case reverse_recno
1275 atf_add_test_case alternate_recno
1276 atf_add_test_case delete_btree
1277 atf_add_test_case delete_recno
1278 atf_add_test_case repeated_btree
1279 atf_add_test_case repeated_hash
1280 atf_add_test_case duplicate_btree
1281 atf_add_test_case cursor_flags_btree
1282 atf_add_test_case cursor_flags_recno
1283 atf_add_test_case reverse_order_recno
1284 atf_add_test_case small_page_btree
1285 atf_add_test_case byte_orders_btree
1286 atf_add_test_case byte_orders_hash
1287 atf_add_test_case bsize_ffactor
1288 atf_add_test_case four_char_hash
1289 atf_add_test_case bsize_torture
1290 atf_add_test_case btree_weird_page_split
1291 atf_add_test_case btree_tricky_page_split
1295 atf_add_test_case btree_recursive_traversal
1299 atf_add_test_case btree_byteswap_unaligned_access_bksd
1300 atf_add_test_case btree_byteswap_unaligned_access_skbd
1301 atf_add_test_case btree_known_byte_order