1# See the file LICENSE for redistribution information.
2#
3# Copyright (c) 2007-2009 Oracle.  All rights reserved.
4#
5# $Id$
6#
7# TEST	repmgr002
8# TEST	Basic repmgr election test.
9# TEST
10# TEST	Open three clients of different priorities and make sure repmgr
11# TEST	elects expected master. Shut master down, make sure repmgr elects
12# TEST	expected remaining client master, make sure former master can join
13# TEST	as client.
14# TEST
15# TEST	Run for btree only because access method shouldn't matter.
16# TEST
17proc repmgr002 { method { niter 100 } { tnum "002" } args } {
18
19	source ./include.tcl
20
21	if { $is_freebsd_test == 1 } {
22		puts "Skipping replication manager test on FreeBSD platform."
23		return
24	}
25
26	if { $is_windows9x_test == 1 } {
27		puts "Skipping replication test on Win9x platform."
28		return
29	}
30
31	# Skip for all methods except btree.
32	if { $checking_valid_methods } {
33		return btree
34	}
35	if { [is_btree $method] == 0 } {
36		puts "Repmgr$tnum: skipping for non-btree method $method."
37		return
38	}
39
40	set args [convert_args $method $args]
41
42	puts "Repmgr$tnum ($method): Basic repmgr election test."
43	basic_repmgr_election_test $method $niter $tnum 0 $args
44}
45