diff options
| author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2015-02-17 17:25:57 +0000 |
|---|---|---|
| committer | <> | 2015-03-17 16:26:24 +0000 |
| commit | 780b92ada9afcf1d58085a83a0b9e6bc982203d1 (patch) | |
| tree | 598f8b9fa431b228d29897e798de4ac0c1d3d970 /test/tcl/env018.tcl | |
| parent | 7a2660ba9cc2dc03a69ddfcfd95369395cc87444 (diff) | |
| download | berkeleydb-master.tar.gz | |
Diffstat (limited to 'test/tcl/env018.tcl')
| -rw-r--r-- | test/tcl/env018.tcl | 86 |
1 files changed, 85 insertions, 1 deletions
diff --git a/test/tcl/env018.tcl b/test/tcl/env018.tcl index 78c2a182..2bdd0be6 100644 --- a/test/tcl/env018.tcl +++ b/test/tcl/env018.tcl @@ -1,6 +1,6 @@ # See the file LICENSE for redistribution information. # -# Copyright (c) 2009, 2012 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 2015 Oracle and/or its affiliates. All rights reserved. # # $Id$ # @@ -13,6 +13,12 @@ # TEST For several different flags to env_open, open an env. Open # TEST a second handle on the same env, get_open_flags and verify # TEST the flag is returned. +# TEST +# TEST Also check that the environment configurations lock and txn +# TEST timeout, mpool max write openfd and mmap size, and log auto +# TEST remove, when set before opening an environment, are applied +# TEST when creating the environment, but not when joining. + proc env018 { } { source ./include.tcl set tnum "018" @@ -53,5 +59,83 @@ proc env018 { } { error_check_good e1_close [$e1 close] 0 error_check_good e2_close [$e2 close] 0 } + + env_cleanup $testdir + + # Configurations being tested, values are: + # env open command, set value, reset value, get command, + # printout string, get return value + set rlist { + { " -blob_dir " "." "./BLOBDIR" " get_blob_dir " " blob_dir " "." } + { " -blob_threshold " "10485760" "20971520" " get_blob_threshold " + " blob_threshold " "10485760" } + { " -log_remove " "" "" " log_get_config autoremove " + " DB_LOG_AUTOREMOVE " "1" } + { " -txn_timeout " "3" "6" " get_timeout txn " " txn_timeout " "3" } + { " -lock_timeout " "4" "7" " get_timeout lock " " lock_timeout " "4" } + { " -mpool_max_openfd " "1000" "2000" " get_mp_max_openfd " + " mpool_max_openfd " "1000" } + { " -mpool_max_write " "{100 1000}" "{200 2000}" " get_mp_max_write " + " mpool_max_write " "100 1000" } + { " -mpool_mmap_size " "1024" "2048" " get_mp_mmapsize " + " mpool_mmap_size " "1024" } + { " -log_max " "100000" "900000" + " get_lg_max " " get_log_max " "100000" } + } + + # + # Build one environment open command including all tested options, and + # create msgfile to catch warning message. + # + set envopen "berkdb_env -create -home $testdir -txn -lock -log \ + -msgfile $testdir/msgfile " + foreach item $rlist { + append envopen [lindex $item 0] [lindex $item 1] + } + puts "\t\tEnv$tnum.d: Create env with given configurations." + set e3 [eval $envopen] + error_check_good e3_open [is_valid_env $e3] TRUE + + + puts "\t\tEnv$tnum.e: Check that env configurations have been set." + foreach item $rlist { + set printout [lindex $item 4] + set value [lindex $item 5] + puts "\t\t\tEnv$tnum.e.1 Check $printout." + set command [lindex $item 3] + error_check_good [lindex $item 4] \ + [eval $e3 $command ] $value + + } + + # + # Build one environment re-open command including all tested options, + # and create msgfile to catch warning message. + # + set envopen "berkdb_env_noerr -home $testdir -txn -lock -log \ + -msgfile $testdir/msgfile " + foreach item $rlist { + if { ![string equal [lindex $item 0] " -log_remove " ] } { + append envopen [lindex $item 0] [lindex $item 2] + } + } + puts "\t\tEnv$tnum.f: Join env with different configuration values." + set e4 [eval $envopen] + error_check_good e4_open [is_valid_env $e4] TRUE + + + puts "\t\tEnv$tnum.g: Check that config values have not changed." + foreach item $rlist { + set printout [lindex $item 4] + set value [lindex $item 5] + puts "\t\t\tEnv$tnum.g.1 Check $printout." + set command [lindex $item 3] + error_check_good $printout \ + [eval $e3 $command ] $value + } + + # Clean up. + error_check_good e3_close [$e3 close] 0 + error_check_good e4_close [$e4 close] 0 } |
