File tree 3 files changed +71
-3
lines changed
3 files changed +71
-3
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,12 @@ sub new
63
63
{
64
64
my $host = " 127.0.0.1" ;
65
65
my ($pgport , $arbiter_port ) = allocate_ports($host , 2);
66
+
67
+ if (defined $ENV {MMPORT }) {
68
+ $pgport = $ENV {MMPORT };
69
+ delete $ENV {MMPORT };
70
+ }
71
+
66
72
my $node = new PostgresNode(" node$i " , $host , $pgport );
67
73
$node -> {id } = $i ;
68
74
$node -> {arbiter_port } = $arbiter_port ;
Original file line number Diff line number Diff line change 1
-
2
1
EXTENSION = multimaster
3
2
DATA = multimaster--1.0.sql
4
3
OBJS = src/multimaster.o src/dmq.o src/commit.o src/bytebuf.o src/bgwpool.o \
@@ -27,14 +26,43 @@ top_builddir = ../..
27
26
include $(top_builddir ) /src/Makefile.global
28
27
include $(top_srcdir ) /contrib/contrib-global.mk
29
28
endif
29
+
30
30
.PHONY : all
31
31
32
32
EXTRA_INSTALL =contrib/mmts
33
33
34
34
all : multimaster.so
35
35
36
-
37
-
38
36
check : temp-install
39
37
$(prove_check )
40
38
39
+ submake-regress :
40
+ $(MAKE ) -C $(top_builddir ) /src/test/regress all
41
+
42
+ run : temp-install
43
+ rm -rf ' $(CURDIR)' /tmp_check
44
+ $(MKDIR_P ) ' $(CURDIR)' /tmp_check
45
+ cd $(srcdir ) && TESTDIR=' $(CURDIR)' \
46
+ $(with_temp_install ) \
47
+ MMPORT=' 6$(DEF_PGPORT)' \
48
+ PG_REGRESS=' $(CURDIR)/$(top_builddir)/src/test/regress/pg_regress' \
49
+ perl run.pl --start
50
+
51
+ stop :
52
+ cd $(srcdir ) && TESTDIR=' $(CURDIR)' \
53
+ $(with_temp_install ) \
54
+ PGPORT=' 6$(DEF_PGPORT)' \
55
+ PG_REGRESS=' $(CURDIR)/$(top_builddir)/src/test/regress/pg_regress' \
56
+ perl run.pl --stop
57
+
58
+ regress : submake-regress
59
+ cd $(CURDIR ) /$(top_builddir ) /src/test/regress && \
60
+ $(with_temp_install ) \
61
+ PGPORT=' 6$(DEF_PGPORT)' \
62
+ PGHOST=' 127.0.0.1' \
63
+ PGUSER=' $(USER)' \
64
+ ./pg_regress \
65
+ --bindir=' ' \
66
+ --use-existing \
67
+ --schedule=serial_schedule \
68
+ --dbname=postgres
Original file line number Diff line number Diff line change
1
+ # !/usr/bin/env perl
2
+
3
+ use File::Basename;
4
+ BEGIN { unshift @INC , ' .' ; unshift @INC , ' ../../src/test/perl' }
5
+ use Cluster;
6
+
7
+ my $n_nodes = 3;
8
+ my $action = $ARGV [0];
9
+
10
+ if ($action eq " --start" )
11
+ {
12
+ my $cluster = new Cluster($n_nodes );
13
+ $cluster -> init();
14
+ $cluster -> configure();
15
+ $cluster -> start();
16
+ $cluster -> await_nodes( (0..$n_nodes -1) );
17
+ }
18
+ elsif ($action eq " --stop" )
19
+ {
20
+ for my $i (1..$n_nodes )
21
+ {
22
+ TestLib::system_or_bail(' pg_ctl' ,
23
+ ' -D' , " $TestLib::tmp_check /t_run_node${i} _data/pgdata" ,
24
+ ' -m' , ' fast' ,
25
+ ' stop' );
26
+ }
27
+ }
28
+ else
29
+ {
30
+ die (" Usage: run.pl --start/--stop\n " );
31
+ }
32
+
33
+
34
+
You can’t perform that action at this time.
0 commit comments