|
34 | 34 | } |
35 | 35 |
|
36 | 36 | # determenistic ports for expected files |
37 | | -$PostgresNode::last_port_assigned = 55431; |
| 37 | +if ($Cluster::pg_15_modules) |
| 38 | +{ |
| 39 | +$PostgreSQL::Test::Cluster::last_port_assigned = 55431; |
| 40 | +} |
| 41 | +else |
| 42 | +{ |
| 43 | +$PostgresNode::last_port_assigned = 55431; |
| 44 | +} |
38 | 45 |
|
39 | 46 | my$cluster = new Cluster(3); |
40 | 47 | $cluster->init(q{ |
|
84 | 91 |
|
85 | 92 | # load schedule without tablespace test which is not expected |
86 | 93 | # to work with several postgreses on a single node |
87 | | -my$schedule = TestLib::slurp_file('../../src/test/regress/parallel_schedule'); |
| 94 | +my$schedule; |
| 95 | +if ($Cluster::pg_15_modules) |
| 96 | +{ |
| 97 | +$schedule = PostgreSQL::Test::Utils::slurp_file('../../src/test/regress/parallel_schedule'); |
| 98 | +} |
| 99 | +else |
| 100 | +{ |
| 101 | +$schedule = TestLib::slurp_file('../../src/test/regress/parallel_schedule'); |
| 102 | +} |
88 | 103 | $schedule =~s/test: tablespace/#test: tablespace/g; |
89 | 104 | $schedule =~s/test: cfs/#test: cfs/g; |
90 | 105 | $schedule =~s/test: largeobject//;# serial schedule |
91 | 106 | $schedule =~s/largeobject//;# parallel schedule |
92 | 107 | unlink('parallel_schedule'); |
93 | | -TestLib::append_to_file('parallel_schedule',$schedule); |
| 108 | +if ($Cluster::pg_15_modules) |
| 109 | +{ |
| 110 | +PostgreSQL::Test::Utils::append_to_file('parallel_schedule',$schedule); |
| 111 | +} |
| 112 | +else |
| 113 | +{ |
| 114 | +TestLib::append_to_file('parallel_schedule',$schedule); |
| 115 | +} |
94 | 116 |
|
95 | 117 | my$regress_shlib =$ENV{REGRESS_SHLIB}; |
96 | 118 | my$regress_libdir = dirname($regress_shlib); |
|
99 | 121 | # REMOVEME: not needed in 14+, pg_regress fixed in upstream |
100 | 122 | mkdir("${regress_outdir}/sql"); |
101 | 123 | mkdir("${regress_outdir}/expected"); |
102 | | -TestLib::system_log($ENV{'PG_REGRESS'}, |
103 | | -'--host=' .$cluster->{nodes}->[0]->host,'--port=' .$cluster->{nodes}->[0]->port, |
104 | | -'--use-existing','--bindir=', |
105 | | -'--schedule=parallel_schedule', |
106 | | -"--dlpath=${regress_libdir}", |
107 | | -'--inputdir=../../src/test/regress', |
108 | | -"--outputdir=${regress_outdir}"); |
| 124 | +if ($Cluster::pg_15_modules) |
| 125 | +{ |
| 126 | +PostgreSQL::Test::Utils::system_log($ENV{'PG_REGRESS'}, |
| 127 | +'--host=' .$cluster->{nodes}->[0]->host,'--port=' .$cluster->{nodes}->[0]->port, |
| 128 | +'--use-existing','--bindir=', |
| 129 | +'--schedule=parallel_schedule', |
| 130 | +"--dlpath=${regress_libdir}", |
| 131 | +'--inputdir=../../src/test/regress', |
| 132 | +"--outputdir=${regress_outdir}"); |
| 133 | +} |
| 134 | +else |
| 135 | +{ |
| 136 | +TestLib::system_log($ENV{'PG_REGRESS'}, |
| 137 | +'--host=' .$cluster->{nodes}->[0]->host,'--port=' .$cluster->{nodes}->[0]->port, |
| 138 | +'--use-existing','--bindir=', |
| 139 | +'--schedule=parallel_schedule', |
| 140 | +"--dlpath=${regress_libdir}", |
| 141 | +'--inputdir=../../src/test/regress', |
| 142 | +"--outputdir=${regress_outdir}"); |
| 143 | +} |
109 | 144 | unlink('parallel_schedule'); |
110 | 145 |
|
111 | 146 | # rename s/diffs/diff as some upper level testing systems are searching for all |
|
114 | 149 | ordie"cannot rename file:$!"; |
115 | 150 |
|
116 | 151 | # strip absolute paths and dates out of resulted regression.diffs |
117 | | -my$res_diff = TestLib::slurp_file("${regress_outdir}/regression.diff"); |
| 152 | +my$res_diff; |
| 153 | +if ($Cluster::pg_15_modules) |
| 154 | +{ |
| 155 | +$res_diff = PostgreSQL::Test::Utils::slurp_file("${regress_outdir}/regression.diff"); |
| 156 | +} |
| 157 | +else |
| 158 | +{ |
| 159 | +$res_diff = TestLib::slurp_file("${regress_outdir}/regression.diff"); |
| 160 | +} |
118 | 161 | # In <= 11 default diff format was context, since 12 unified; handing lines |
119 | 162 | # starting with ---|+++|*** covers both. |
120 | 163 | # To make someone's life easier, we prepend .. to make relative paths correct. |
|
134 | 177 | # finally compare regression.diffs with our version |
135 | 178 | # Do not use diffs extension as some upper level testing systems are searching for all |
136 | 179 | # *.diffs files. |
137 | | -TestLib::append_to_file("$ENV{TESTDIR}/results/regression.diff",$res_diff); |
| 180 | +if ($Cluster::pg_15_modules) |
| 181 | +{ |
| 182 | +PostgreSQL::Test::Utils::append_to_file("$ENV{TESTDIR}/results/regression.diff",$res_diff); |
| 183 | +} |
| 184 | +else |
| 185 | +{ |
| 186 | + TestLib::append_to_file("$ENV{TESTDIR}/results/regression.diff",$res_diff); |
| 187 | +} |
138 | 188 | # TODO: work with diffs on per-test basis |
139 | 189 | my$expected_file; |
140 | 190 | if (Cluster::is_ee()) |
|
145 | 195 | { |
146 | 196 | $expected_file ="expected/regression_vanilla.diff" |
147 | 197 | } |
148 | | -$diff = TestLib::system_log("diff -U3${expected_file}$ENV{TESTDIR}/results/regression.diff"); |
| 198 | +if ($Cluster::pg_15_modules) |
| 199 | +{ |
| 200 | +$diff = PostgreSQL::Test::Utils::system_log("diff -U3${expected_file}$ENV{TESTDIR}/results/regression.diff"); |
| 201 | +} |
| 202 | +else |
| 203 | +{ |
| 204 | +$diff = TestLib::system_log("diff -U3${expected_file}$ENV{TESTDIR}/results/regression.diff"); |
| 205 | +} |
149 | 206 | run ["diff","-U3","${expected_file}","$ENV{TESTDIR}/results/regression.diff" ],">","$ENV{TESTDIR}/regression.diff.diff"; |
150 | 207 | my$res =$?; |
151 | 208 |
|
|