source ./include.tcl
source $test_path/test.tcl
source $test_path/testutils.tcl
source $test_path/reputils.tcl
set usage "repscript clientdir apicall"
if { $argc != 2 } {
puts stderr "FAIL:[timestamp] Usage: $usage"
exit
}
set clientdir [ lindex $argv 0 ]
set apicall [ lindex $argv 1 ]
set queueenv [eval berkdb_env -home $testdir/MSGQUEUEDIR]
error_check_good script_qenv_open [is_valid_env $queueenv] TRUE
repladd 3
set envid 3
set cl2_cmd "berkdb_env_noerr -home $clientdir \
-errfile /dev/stderr -errpfx CLIENT.$apicall \
-txn -rep_client -rep_transport \[list $envid replsend\]"
set clientenv [eval $cl2_cmd]
error_check_good script_c2env_open [is_valid_env $clientenv] TRUE
switch -exact -- $apicall {
archive {
while { [file exists $testdir/marker.db] == 0 } {
$clientenv log_archive -arch_remove
}
}
detect {
while { [file exists $testdir/marker.db] == 0 } {
$clientenv lock_detect default
}
}
checkpoint {
while { [file exists $testdir/marker.db] == 0 } {
$clientenv txn_checkpoint -force
tclsleep 1
}
}
trickle {
while { [file exists $testdir/marker.db] == 0 } {
$clientenv mpool_trickle 90
}
}
default {
puts "FAIL: unrecognized API call $apicall
}
}
error_check_good clientenv_close [$clientenv close] 0