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/rep110script.tcl | |
| parent | 7a2660ba9cc2dc03a69ddfcfd95369395cc87444 (diff) | |
| download | berkeleydb-master.tar.gz | |
Diffstat (limited to 'test/tcl/rep110script.tcl')
| -rw-r--r-- | test/tcl/rep110script.tcl | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/test/tcl/rep110script.tcl b/test/tcl/rep110script.tcl new file mode 100644 index 00000000..e31629be --- /dev/null +++ b/test/tcl/rep110script.tcl @@ -0,0 +1,63 @@ +# See the file LICENSE for redistribution information. +# +# Copyright (c) 2012, 2015 Oracle and/or its affiliates. All rights reserved. +# +# $Id$ +# +# Rep110 script - open an environment handle and then close it. +# This tests a codepath with NOWAIT set where the handle_cnt +# was getting messed up if we are in internal init and would +# need to wait. +# +# Usage: repscript clientdir verb +# clientdir: client env directory +# verb: verbose setting +source ./include.tcl +source $test_path/test.tcl +source $test_path/testutils.tcl +source $test_path/reputils.tcl + +set usage "repscript clientdir verb" + +# Verify usage +if { $argc != 2 } { + puts stderr "FAIL:[timestamp] Usage: $usage" + exit +} + +# Initialize arguments +set clientdir [ lindex $argv 0 ] +set rep_verbose [ lindex $argv 1 ] + +# Join the queue env. We assume the rep test convention of +# placing the messages in $testdir/MSGQUEUEDIR. +set queueenv [eval berkdb_env -home $testdir/MSGQUEUEDIR] +error_check_good script_qenv_open [is_valid_env $queueenv] TRUE + +# Join the client env. We expect an error on the open, +# so that is the only thing we do. +repladd 1 +repladd 2 +set envid 2 +if { $rep_verbose } { + set cl2_cmd "berkdb_env_noerr -home $clientdir \ + -errfile /dev/stderr -errpfx CLIENT.child \ + -verbose {rep on} \ + -txn -rep_client -rep_transport \[list $envid replsend\]" +} else { + set cl2_cmd "berkdb_env_noerr -home $clientdir \ + -errfile /dev/stderr -errpfx CLIENT.child \ + -txn -rep_client -rep_transport \[list $envid replsend\]" +} + +# +# We expect a DB_REP_LOCKOUT error returned from this. +# +set stat [catch {eval $cl2_cmd} ret] +error_check_good stat $stat 1 +error_check_good ret [is_substr $ret DB_REP_LOCKOUT] 1 + +tclsleep 1 +replclose $testdir/MSGQUEUEDIR + +return |
