head	1.2;
access;
symbols
	RPM_4_2_1:1.1.1.5
	RPM_4_2:1.1.1.5
	RPM_4_1_1:1.1.1.5
	RPM_4_1:1.1.1.4
	RPM_4_0_5:1.1.1.3
	RPM_4_0_4:1.1.1.2
	RPM_4_0_3:1.1.1.1
	RPM:1.1.1;
locks; strict;
comment	@# @;


1.2
date	2008.01.02.09.58.57;	author rse;	state dead;
branches;
next	1.1;
commitid	z4cpSiAhOCXk5PLs;

1.1
date	2001.07.23.20.45.41;	author rse;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2001.07.23.20.45.41;	author rse;	state Exp;
branches;
next	1.1.1.2;

1.1.1.2
date	2002.01.08.01.45.11;	author rse;	state Exp;
branches;
next	1.1.1.3;

1.1.1.3
date	2003.01.18.13.49.10;	author rse;	state Exp;
branches;
next	1.1.1.4;

1.1.1.4
date	2001.10.15.03.47.28;	author rse;	state Exp;
branches;
next	1.1.1.5;

1.1.1.5
date	2003.01.18.14.05.14;	author rse;	state Exp;
branches;
next	;


desc
@@


1.2
log
@remove the ancient RPM 4.2.1 source tree copy
@
text
@# See the file LICENSE for redistribution information.
#
# Copyright (c) 1996-2001
#	Sleepycat Software.  All rights reserved.
#
# $Id: dead002.tcl,v 1.1 2001/07/23 20:45:41 rse Exp $
#
# Deadlock Test 2.
# Identical to Test 1 except that instead of running a standalone deadlock
# detector, we create the region with "detect on every wait"
proc dead002 { { procs "2 4 10" } {tests "ring clump" } } {
	source ./include.tcl

	puts "Dead002: Deadlock detector tests"

	env_cleanup $testdir

	# Create the environment.
	puts "\tDead002.a: creating environment"
	set env [berkdb env \
	    -create -mode 0644 -home $testdir -lock -lock_detect default]
	error_check_good lock_env:open [is_valid_env $env] TRUE
	error_check_good lock_env:close [$env close] 0

	foreach t $tests {
		set pidlist ""
		foreach n $procs {
			sentinel_init

			# Fire off the tests
			puts "\tDead002: $n procs of test $t"
			for { set i 0 } { $i < $n } { incr i } {
				puts "$tclsh_path $test_path/wrap.tcl \
				    $testdir/dead002.log.$i \
				    ddscript.tcl $testdir $t $i $i $n"
				set p [exec $tclsh_path \
					$test_path/wrap.tcl \
					ddscript.tcl $testdir/dead002.log.$i \
					$testdir $t $i $i $n &]
				lappend pidlist $p
			}
			watch_procs 5

			# Now check output
			set dead 0
			set clean 0
			set other 0
			for { set i 0 } { $i < $n } { incr i } {
				set did [open $testdir/dead002.log.$i]
				while { [gets $did val] != -1 } {
					switch $val {
						DEADLOCK { incr dead }
						1 { incr clean }
						default { incr other }
					}
				}
				close $did
			}
			dead_check $t $n $dead $clean $other
		}
	}

	fileremove -f $testdir/dd.out
	# Remove log files
	for { set i 0 } { $i < $n } { incr i } {
		fileremove -f $testdir/dead002.log.$i
	}
}
@


1.1
log
@Initial revision
@
text
@d6 1
a6 1
# $Id: dead002.tcl,v 11.16 2001/01/25 18:23:04 bostic Exp $
@


1.1.1.1
log
@Import: RPM 4.0.3
@
text
@@


1.1.1.2
log
@Import: RPM 4.0.4
@
text
@d6 1
a6 1
# Id: dead002.tcl,v 11.20 2001/10/11 16:15:30 sandstro Exp 
d8 4
a11 5
# TEST	dead002
# TEST	Same test as dead001, but use "detect on every collision" instead
# TEST	of separate deadlock detector.
proc dead002 { { procs "2 4 10" } {tests "ring clump" } \
    {timeout 0} {tnum 002} } {
d14 1
a14 1
	puts "Dead$tnum: Deadlock detector tests"
d19 1
a19 5
	puts "\tDead$tnum.a: creating environment"
	set lmode "default"
	if { $timeout != 0 } {
		set lmode "expire"
	}
d21 1
a21 2
	    -create -mode 0644 -home $testdir \
	    -lock -txn_timeout $timeout -lock_detect $lmode]
d23 1
d31 1
a31 1
			puts "\tDead$tnum: $n procs of test $t"
a32 1
				set locker [$env lock_id]
d34 2
a35 2
				    $testdir/dead$tnum.log.$i \
				    ddscript.tcl $testdir $t $locker $i $n"
d38 2
a39 2
					ddscript.tcl $testdir/dead$tnum.log.$i \
					$testdir $t $locker $i $n &]
d49 1
a49 1
				set did [open $testdir/dead$tnum.log.$i]
d59 1
a59 1
			dead_check $t $n $timeout $dead $clean $other
d66 1
a66 1
		fileremove -f $testdir/dead$tnum.log.$i
a67 1
	error_check_good lock_env:close [$env close] 0
@


1.1.1.3
log
@Import: RPM 4.0.5
@
text
@d3 1
a3 1
# Copyright (c) 1996-2002
d6 1
a6 1
# Id: dead002.tcl,v 11.23 2002/09/05 17:23:05 sandstro Exp 
d25 1
a25 1
	set env [berkdb_env \
d31 1
a32 1
			set pidlist ""
d48 1
a48 1
			watch_procs $pidlist 5
@


1.1.1.4
log
@Import: RPM 4.1
@
text
@d3 1
a3 1
# Copyright (c) 1996-2001
d6 1
a6 1
# Id: dead002.tcl,v 11.20 2001/10/11 16:15:30 sandstro Exp 
d25 1
a25 1
	set env [berkdb env \
a30 1
		set pidlist ""
d32 1
d48 1
a48 1
			watch_procs 5
@


1.1.1.5
log
@Import: RPM 4.1.1
@
text
@d3 1
a3 1
# Copyright (c) 1996-2002
d6 1
a6 1
# Id: dead002.tcl,v 11.23 2002/09/05 17:23:05 sandstro Exp 
d25 1
a25 1
	set env [berkdb_env \
d31 1
a32 1
			set pidlist ""
d48 1
a48 1
			watch_procs $pidlist 5
@


