mirror of
https://github.com/berkeleydb/libdb.git
synced 2024-11-16 17:16:25 +00:00
270 lines
8.6 KiB
Bash
270 lines
8.6 KiB
Bash
#!/bin/sh -
|
|
#
|
|
# $Id: s_chk_logverify,v 0f73af5ae3da 2010/05/10 05:38:40 alexander $
|
|
#
|
|
# Verify that the log verify code works as expected.
|
|
# Run from build_unix dir on linux blade server
|
|
|
|
d=..
|
|
[ -f $d/LICENSE ] || {
|
|
echo 'FAIL: Test must be run from scr directory.'
|
|
exit 1
|
|
}
|
|
|
|
b=./tmp_build/
|
|
s=$d/src
|
|
|
|
mkdir -p $b
|
|
|
|
opts="--disable-shared --enable-stl"
|
|
echo "Building DB library, this can take a while."
|
|
(cd $b && ../../dist/configure $opts > /dev/null && make > /dev/null) || {
|
|
echo 'FAIL: unable to build libdb.a'
|
|
exit 1
|
|
}
|
|
|
|
# if compile on linux blade server, add -D_GNU_SOURCE -pthread on cc
|
|
CINC="-I$b -I$s"
|
|
[ `uname` = "Linux" ] && CINC=" -D_GNU_SOURCE $CINC -pthread"
|
|
|
|
if cc -g -Wall $CINC $0.c $b/libdb.a -o t; then
|
|
:
|
|
else
|
|
echo "FAIL: unable to compile test program $0.c"
|
|
exit 1
|
|
fi
|
|
|
|
if ./t; then
|
|
:
|
|
else
|
|
echo "FAIL: test program failed"
|
|
exit 1
|
|
fi
|
|
|
|
rm -fr TESTDIR
|
|
mkdir -p TESTDIR
|
|
resdir=`pwd`/TESTDIR
|
|
|
|
# Running log verify internal functions test.
|
|
./t
|
|
|
|
cd $b
|
|
lv=./db_log_verify
|
|
|
|
# Running db_perf tests.
|
|
make db_perf
|
|
cmd=./db_perf
|
|
configs=../$d/test/perf/configs
|
|
|
|
echo Sanity Tests
|
|
|
|
echo "**** db_perf -c $configs/sanity_btree.conf ****"
|
|
rm -rf TESTDIR
|
|
mkdir TESTDIR
|
|
$cmd -I -hTESTDIR -c $configs/sanity_btree.conf 2>&1 > TESTDIR/OUTPUT
|
|
$cmd -hTESTDIR -c $configs/sanity_btree.conf 2>&1 >> TESTDIR/OUTPUT
|
|
$lv -hTESTDIR 2>&1 >> TESTDIR/OUTPUT
|
|
cp TESTDIR/OUTPUT $resdir/OUTPUT.1
|
|
|
|
echo "**** db_perf -c $configs/sanity_hash.conf ****"
|
|
rm -rf TESTDIR
|
|
mkdir TESTDIR
|
|
$cmd -I -hTESTDIR -c $configs/sanity_hash.conf 2>&1 > TESTDIR/OUTPUT
|
|
$cmd -hTESTDIR -c $configs/sanity_hash.conf 2>&1 >> TESTDIR/OUTPUT
|
|
$lv -hTESTDIR 2>&1 >> TESTDIR/OUTPUT
|
|
cp TESTDIR/OUTPUT $resdir/OUTPUT.2
|
|
|
|
echo Archive Tests
|
|
|
|
echo "**** db_perf -c $configs/archive_fatal_hash.conf -C ****"
|
|
rm -rf TESTDIR TESTDIR.A
|
|
rm -f logverify.ERR
|
|
mkdir TESTDIR TESTDIR.A
|
|
$cmd -I -hTESTDIR -c $configs/archive_fatal_hash.conf 2>&1 > TESTDIR/OUTPUT
|
|
$cmd -C -hTESTDIR -c $configs/archive_fatal_hash.conf 2>&1 >> TESTDIR/OUTPUT
|
|
$lv -hTESTDIR 2>logverify.ERR >> TESTDIR/OUTPUT || {
|
|
grep DB_NOTFOUND logverify.ERR >/dev/null 2>/dev/null || \
|
|
echo "ERROR: expect DB_NOTFOUND in the error output"
|
|
}
|
|
cp TESTDIR/OUTPUT $resdir/OUTPUT.3
|
|
|
|
echo "**** db_perf -c $configs/archive_fatal_btree.conf -C ****"
|
|
rm -rf TESTDIR TESTDIR.A
|
|
rm -f logverify.ERR
|
|
mkdir TESTDIR TESTDIR.A
|
|
$cmd -I -hTESTDIR -c $configs/archive_fatal_btree.conf 2>&1 > TESTDIR/OUTPUT
|
|
$cmd -C -hTESTDIR -c $configs/archive_fatal_btree.conf 2>&1 >> TESTDIR/OUTPUT
|
|
$lv -hTESTDIR 2>logverify.ERR >> TESTDIR/OUTPUT || {
|
|
grep DB_NOTFOUND logverify.ERR >/dev/null 2>/dev/null || \
|
|
echo "ERROR: expect DB_NOTFOUND in the error output"
|
|
}
|
|
cp TESTDIR/OUTPUT $resdir/OUTPUT.4
|
|
|
|
echo "**** db_perf -c $configs/archive_btree.conf -C ****"
|
|
rm -rf TESTDIR TESTDIR.A
|
|
mkdir TESTDIR TESTDIR.A
|
|
$cmd -I -hTESTDIR -c $configs/archive_btree.conf 2>&1 > TESTDIR/OUTPUT
|
|
$cmd -C -hTESTDIR -c $configs/archive_btree.conf 2>&1 >> TESTDIR/OUTPUT
|
|
$lv -hTESTDIR 2>&1 >> TESTDIR/OUTPUT
|
|
cp TESTDIR/OUTPUT $resdir/OUTPUT.5
|
|
|
|
|
|
echo Crash Tests
|
|
echo "**** db_perf -c $configs/crash_test_1.conf ****"
|
|
rm -rf TESTDIR TESTDIR.A
|
|
mkdir TESTDIR TESTDIR.A
|
|
$cmd -I -hTESTDIR -c $configs/crash_test_1.conf 2>&1 > TESTDIR/OUTPUT
|
|
$cmd -hTESTDIR -c $configs/crash_test_1.conf 2>&1 >> TESTDIR/OUTPUT
|
|
rm TESTDIR/__db.0* # Remove region files because the environment is corrupted.
|
|
$lv -hTESTDIR 2>&1 >> TESTDIR/OUTPUT
|
|
cp TESTDIR/OUTPUT $resdir/OUTPUT.6
|
|
|
|
echo "**** db_perf -c $configs/crash_test_2.conf ****"
|
|
rm -rf TESTDIR TESTDIR.A
|
|
rm -f logverify.ERR
|
|
mkdir TESTDIR TESTDIR.A
|
|
$cmd -I -hTESTDIR -c $configs/crash_test_2.conf 2>&1 > TESTDIR/OUTPUT
|
|
$cmd -hTESTDIR -c $configs/crash_test_2.conf 2>&1 >> TESTDIR/OUTPUT
|
|
rm TESTDIR/__db.0* # Remove region files because the environment is corrupted.
|
|
$lv -hTESTDIR 2>logverify.ERR >> TESTDIR/OUTPUT || {
|
|
grep DB_NOTFOUND logverify.ERR >/dev/null 2>/dev/null || \
|
|
echo "ERROR: expect DB_NOTFOUND in the error output"
|
|
}
|
|
cp TESTDIR/OUTPUT $resdir/OUTPUT.7
|
|
|
|
echo "**** db_perf -c $configs/crash_test_3.conf ****"
|
|
rm -rf TESTDIR TESTDIR.A
|
|
mkdir TESTDIR TESTDIR.A
|
|
$cmd -I -hTESTDIR -c $configs/crash_test_3.conf 2>&1 > TESTDIR/OUTPUT
|
|
$cmd -hTESTDIR -c $configs/crash_test_3.conf 2>&1 >> TESTDIR/OUTPUT
|
|
rm TESTDIR/__db.0* # Remove region files because the environment is corrupted.
|
|
$lv -hTESTDIR 2>&1 >> TESTDIR/OUTPUT
|
|
cp TESTDIR/OUTPUT $resdir/OUTPUT.8
|
|
|
|
echo "**** db_perf -S 2 -c $configs/crash_test_1.conf ****"
|
|
rm -rf TESTDIR TESTDIR.A
|
|
mkdir TESTDIR TESTDIR.A
|
|
$cmd -I -hTESTDIR -S 2 -c $configs/crash_test_1.conf 2>&1 > TESTDIR/OUTPUT
|
|
$cmd -hTESTDIR -S 2 -c $configs/crash_test_1.conf 2>&1 >> TESTDIR/OUTPUT
|
|
rm TESTDIR/__db.0* # Remove region files because the environment is corrupted.
|
|
$lv -hTESTDIR 2>&1 >> TESTDIR/OUTPUT
|
|
cp TESTDIR/OUTPUT $resdir/OUTPUT.9
|
|
|
|
echo "**** db_perf -S 1 -c $configs/crash_test_4.conf ****"
|
|
rm -rf TESTDIR TESTDIR.A
|
|
mkdir TESTDIR TESTDIR.A
|
|
$cmd -I -hTESTDIR -S 1 -c $configs/crash_test_4.conf 2>&1 > TESTDIR/OUTPUT
|
|
$cmd -hTESTDIR -S 1 -c $configs/crash_test_4.conf 2>&1 >> TESTDIR/OUTPUT
|
|
rm TESTDIR/__db.0* # Remove region files because the environment is corrupted.
|
|
$lv -hTESTDIR 2>&1 >> TESTDIR/OUTPUT
|
|
cp TESTDIR/OUTPUT $resdir/OUTPUT.10
|
|
|
|
|
|
|
|
# Running dbs tests.
|
|
cmd=./dbs
|
|
make dbs
|
|
|
|
echo Sanity Tests
|
|
echo "************* dbs *******************"
|
|
rm -rf TESTDIR
|
|
mkdir TESTDIR
|
|
$cmd -I -hTESTDIR 2>&1 > TESTDIR/OUTPUT
|
|
$cmd -hTESTDIR 2>&1 >> TESTDIR/OUTPUT
|
|
$lv -h TESTDIR 2>&1 >> TESTDIR/OUTPUT
|
|
cp TESTDIR/OUTPUT $resdir/OUTPUT.11
|
|
|
|
echo "************* dbs -t btree *******************"
|
|
rm -rf TESTDIR
|
|
mkdir TESTDIR
|
|
$cmd -I -tbtree -hTESTDIR 2>&1 > TESTDIR/OUTPUT
|
|
$cmd -tbtree -hTESTDIR 2>&1 >> TESTDIR/OUTPUT
|
|
$lv -h TESTDIR 2>&1 >> TESTDIR/OUTPUT
|
|
cp TESTDIR/OUTPUT $resdir/OUTPUT.12
|
|
|
|
echo Archive Tests
|
|
echo "************* dbs -CA *******************"
|
|
rm -rf TESTDIR T2
|
|
mkdir TESTDIR T2
|
|
$cmd -I -hTESTDIR 2>&1 > TESTDIR/OUTPUT
|
|
$cmd -CA T2 -hTESTDIR 2>&1 >> TESTDIR/OUTPUT
|
|
$lv -h TESTDIR 2>&1 >> TESTDIR/OUTPUT
|
|
cp TESTDIR/OUTPUT $resdir/OUTPUT.13
|
|
|
|
echo "************* dbs -CA -tbtree *******************"
|
|
rm -rf TESTDIR T2
|
|
mkdir TESTDIR T2
|
|
$cmd -I -tbtree -hTESTDIR 2>&1 > TESTDIR/OUTPUT
|
|
$cmd -CA T2 -tbtree -hTESTDIR 2>&1 >> TESTDIR/OUTPUT
|
|
$lv -h TESTDIR 2>&1 >> TESTDIR/OUTPUT
|
|
cp TESTDIR/OUTPUT $resdir/OUTPUT.14
|
|
|
|
echo "************* dbs -Ca -tbtree *******************"
|
|
rm -rf TESTDIR T2
|
|
mkdir TESTDIR T2
|
|
$cmd -I -tbtree -c 10 2>&1 > TESTDIR/OUTPUT
|
|
$cmd -Ca T2 -tbtree -hTESTDIR 2>&1 >> TESTDIR/OUTPUT
|
|
$lv -h TESTDIR 2>&1 >> TESTDIR/OUTPUT
|
|
cp TESTDIR/OUTPUT $resdir/OUTPUT.15
|
|
|
|
echo Crash Tests
|
|
|
|
echo "************ dbs -K30 -a T2 -tbtree -c 10 -k 4 -V"
|
|
rm -rf TESTDIR T2
|
|
mkdir TESTDIR T2
|
|
$cmd -I -tbtree -c 10 -hTESTDIR 2>&1 > TESTDIR/OUTPUT
|
|
$cmd -K30 -a T2 -tbtree -c 10 -k 4 -hTESTDIR 2>&1 >> TESTDIR/OUTPUT
|
|
rm TESTDIR/__db.0* # Remove region files because the environment is corrupted.
|
|
$lv -h TESTDIR 2>&1 >> TESTDIR/OUTPUT
|
|
cp TESTDIR/OUTPUT $resdir/OUTPUT.16
|
|
|
|
echo "************ dbs -K60 -A T2 -tbtree -c 10 -k 4 -V"
|
|
rm -rf TESTDIR T2
|
|
mkdir TESTDIR T2
|
|
$cmd -I -tbtree -c 10 -hTESTDIR 2>&1 > TESTDIR/OUTPUT
|
|
$cmd -K60 -A T2 -tbtree -c 10 -k 4 -hTESTDIR 2>&1 >> TESTDIR/OUTPUT
|
|
rm TESTDIR/__db.0* # Remove region files because the environment is corrupted.
|
|
$lv -h TESTDIR 2>&1 >> TESTDIR/OUTPUT
|
|
cp TESTDIR/OUTPUT $resdir/OUTPUT.17
|
|
|
|
echo "************ dbs -K180 -a T2 -tbtree -c 10 -k 4 -V"
|
|
rm -rf TESTDIR T2
|
|
mkdir TESTDIR T2
|
|
$cmd -I -tbtree -c 10 -hTESTDIR 2>&1 > TESTDIR/OUTPUT
|
|
$cmd -K180 -a T2 -tbtree -c 10 -k 4 -hTESTDIR 2>&1 >> TESTDIR/OUTPUT
|
|
rm TESTDIR/__db.0* # Remove region files because the environment is corrupted.
|
|
$lv -h TESTDIR 2>&1 >> TESTDIR/OUTPUT
|
|
cp TESTDIR/OUTPUT $resdir/OUTPUT.18
|
|
|
|
echo "************ dbs -s 2 -K30 -a T2 -tbtree -c 10 -k 4 -V"
|
|
rm -rf TESTDIR T2
|
|
mkdir TESTDIR T2
|
|
$cmd -s 2 -I -tbtree -c 10 -hTESTDIR 2>&1 > TESTDIR/OUTPUT
|
|
$cmd -s 2 -K30 -A T2 -tbtree -c 10 -k 4 -hTESTDIR 2>&1 >> TESTDIR/OUTPUT
|
|
rm TESTDIR/__db.0* # Remove region files because the environment is corrupted.
|
|
$lv -h TESTDIR 2>&1 >> TESTDIR/OUTPUT
|
|
cp TESTDIR/OUTPUT $resdir/OUTPUT.19
|
|
|
|
echo "************ dbs -s 1 -K60 -a T2 -tbtree -c 10 -k 4 -V"
|
|
rm -rf TESTDIR T2
|
|
mkdir TESTDIR T2
|
|
$cmd -s 1 -I -tbtree -c 10 -hTESTDIR 2>&1 > TESTDIR/OUTPUT
|
|
$cmd -s 1 -K60 -a T2 -tbtree -c 10 -k 4 -hTESTDIR 2>&1 >> TESTDIR/OUTPUT
|
|
rm TESTDIR/__db.0* # Remove region files because the environment is corrupted.
|
|
$lv -h TESTDIR 2>&1 >> TESTDIR/OUTPUT
|
|
cp TESTDIR/OUTPUT $resdir/OUTPUT.20
|
|
|
|
|
|
|
|
# Running test_dbstl tests.
|
|
|
|
make test_dbstl
|
|
|
|
./test_dbstl -I -s b -m t -t a -T 200 -k 50 -l 100 -c 33554432
|
|
$lv -h dbenv
|
|
./test_dbstl -I -s h -m t -t e -T 200 -k 50 -l 100 -c 33554432
|
|
$lv -h dbenv
|
|
./test_dbstl -I -s b -m t -t e -T 200 -k 50 -l 100 -c 33554432 -M
|
|
$lv -h dbenv
|
|
./test_dbstl -I -s h -m t -t a -T 200 -k 50 -l 100 -c 33554432 -M
|
|
$lv -h dbenv
|