1
# See the file LICENSE for redistribution information.
3
# Copyright (c) 2000-2002
4
# Sleepycat Software. All rights reserved.
9
# TEST Test creation of many small databases in a single environment. [#1528].
10
proc test076 { method { ndbs 1000 } { tnum 76 } args } {
13
set args [convert_args $method $args]
15
set args [split_encargs $args encargs]
16
set omethod [convert_method $method]
18
if { [is_record_based $method] == 1 } {
23
set data "datamoredatamoredata"
25
# Create an env if we weren't passed one.
27
set eindex [lsearch -exact $args "-env"]
28
if { $eindex == -1 } {
31
set env [eval {berkdb_env -create -home} $testdir $encargs]
32
error_check_good env [is_valid_env $env] TRUE
33
set args "$args -env $env"
37
set env [lindex $args $eindex]
38
set txnenv [is_txnenv $env]
40
append args " -auto_commit "
41
if { $ndbs == 1000 } {
45
set testdir [get_home $env]
47
puts -nonewline "Test0$tnum $method ($args): "
48
puts -nonewline "Create $ndbs"
49
puts " small databases in one env."
54
for { set i 1 } { $i <= $ndbs } { incr i } {
55
set testfile test0$tnum.$i.db
57
set db [eval {berkdb_open -create -mode 0644}\
58
$args $omethod $testfile]
59
error_check_good db_open($i) [is_valid_db $db] TRUE
63
error_check_good txn [is_valid_txn $t $env] TRUE
66
set ret [eval {$db put} $txn {$key$i \
67
[chop_data $method $data$i]}]
68
error_check_good db_put($i) $ret 0
70
error_check_good txn [$t commit] 0
72
error_check_good db_close($i) [$db close] 0
75
if { $deleteenv == 1 } {
76
error_check_good env_close [$env close] 0
79
puts "\tTest0$tnum passed."