OSDN Git Service

FIRST REPOSITORY
[eos/hostdependOTHERS.git] / I686LINUX / util / I686LINUX / doc / postgresql / html / regress.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <HTML
3 ><HEAD
4 ><TITLE
5 >Regression Tests</TITLE
6 ><META
7 NAME="GENERATOR"
8 CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
9 REV="MADE"
10 HREF="mailto:pgsql-docs@postgresql.org"><LINK
11 REL="HOME"
12 TITLE="PostgreSQL 7.4.1 Documentation"
13 HREF="index.html"><LINK
14 REL="UP"
15 TITLE="Server Administration"
16 HREF="admin.html"><LINK
17 REL="PREVIOUS"
18 TITLE="Internals"
19 HREF="wal-internals.html"><LINK
20 REL="NEXT"
21 TITLE="Test Evaluation"
22 HREF="regress-evaluation.html"><LINK
23 REL="STYLESHEET"
24 TYPE="text/css"
25 HREF="stylesheet.css"><META
26 NAME="creation"
27 CONTENT="2003-12-22T03:48:47"></HEAD
28 ><BODY
29 CLASS="CHAPTER"
30 ><DIV
31 CLASS="NAVHEADER"
32 ><TABLE
33 SUMMARY="Header navigation table"
34 WIDTH="100%"
35 BORDER="0"
36 CELLPADDING="0"
37 CELLSPACING="0"
38 ><TR
39 ><TH
40 COLSPAN="5"
41 ALIGN="center"
42 VALIGN="bottom"
43 >PostgreSQL 7.4.1 Documentation</TH
44 ></TR
45 ><TR
46 ><TD
47 WIDTH="10%"
48 ALIGN="left"
49 VALIGN="top"
50 ><A
51 HREF="wal-internals.html"
52 ACCESSKEY="P"
53 >Prev</A
54 ></TD
55 ><TD
56 WIDTH="10%"
57 ALIGN="left"
58 VALIGN="top"
59 ><A
60 HREF="wal.html"
61 >Fast Backward</A
62 ></TD
63 ><TD
64 WIDTH="60%"
65 ALIGN="center"
66 VALIGN="bottom"
67 ></TD
68 ><TD
69 WIDTH="10%"
70 ALIGN="right"
71 VALIGN="top"
72 ><A
73 HREF="client-interfaces.html"
74 >Fast Forward</A
75 ></TD
76 ><TD
77 WIDTH="10%"
78 ALIGN="right"
79 VALIGN="top"
80 ><A
81 HREF="regress-evaluation.html"
82 ACCESSKEY="N"
83 >Next</A
84 ></TD
85 ></TR
86 ></TABLE
87 ><HR
88 ALIGN="LEFT"
89 WIDTH="100%"></DIV
90 ><DIV
91 CLASS="CHAPTER"
92 ><H1
93 ><A
94 NAME="REGRESS"
95 ></A
96 >Chapter 26. Regression Tests</H1
97 ><DIV
98 CLASS="TOC"
99 ><DL
100 ><DT
101 ><B
102 >Table of Contents</B
103 ></DT
104 ><DT
105 >26.1. <A
106 HREF="regress.html#REGRESS-RUN"
107 >Running the Tests</A
108 ></DT
109 ><DT
110 >26.2. <A
111 HREF="regress-evaluation.html"
112 >Test Evaluation</A
113 ></DT
114 ><DD
115 ><DL
116 ><DT
117 >26.2.1. <A
118 HREF="regress-evaluation.html#AEN19742"
119 >Error message differences</A
120 ></DT
121 ><DT
122 >26.2.2. <A
123 HREF="regress-evaluation.html#AEN19747"
124 >Locale differences</A
125 ></DT
126 ><DT
127 >26.2.3. <A
128 HREF="regress-evaluation.html#AEN19760"
129 >Date and time differences</A
130 ></DT
131 ><DT
132 >26.2.4. <A
133 HREF="regress-evaluation.html#AEN19781"
134 >Floating-point differences</A
135 ></DT
136 ><DT
137 >26.2.5. <A
138 HREF="regress-evaluation.html#AEN19795"
139 >Row ordering differences</A
140 ></DT
141 ><DT
142 >26.2.6. <A
143 HREF="regress-evaluation.html#AEN19806"
144 >The <SPAN
145 CLASS="QUOTE"
146 >"random"</SPAN
147 > test</A
148 ></DT
149 ></DL
150 ></DD
151 ><DT
152 >26.3. <A
153 HREF="regress-platform.html"
154 >Platform-specific comparison files</A
155 ></DT
156 ></DL
157 ></DIV
158 ><A
159 NAME="AEN19681"
160 ></A
161 ><A
162 NAME="AEN19683"
163 ></A
164 ><P
165 >   The regression tests are a comprehensive set of tests for the SQL
166    implementation in <SPAN
167 CLASS="PRODUCTNAME"
168 >PostgreSQL</SPAN
169 >.  They test
170    standard SQL operations as well as the extended capabilities of
171    <SPAN
172 CLASS="PRODUCTNAME"
173 >PostgreSQL</SPAN
174 >.  From
175    <SPAN
176 CLASS="PRODUCTNAME"
177 >PostgreSQL</SPAN
178 > 6.1 onward, the regression
179    tests are current for every official release.
180   </P
181 ><DIV
182 CLASS="SECT1"
183 ><H1
184 CLASS="SECT1"
185 ><A
186 NAME="REGRESS-RUN"
187 >26.1. Running the Tests</A
188 ></H1
189 ><P
190 >   The regression test can be run against an already installed and
191    running server, or using a temporary installation within the build
192    tree.  Furthermore, there is a <SPAN
193 CLASS="QUOTE"
194 >"parallel"</SPAN
195 > and a
196    <SPAN
197 CLASS="QUOTE"
198 >"sequential"</SPAN
199 > mode for running the tests.  The
200    sequential method runs each test script in turn, whereas the
201    parallel method starts up multiple server processes to run groups
202    of tests in parallel.  Parallel testing gives confidence that
203    interprocess communication and locking are working correctly.  For
204    historical reasons, the sequential test is usually run against an
205    existing installation and the parallel method against a temporary
206    installation, but there are no technical reasons for this.
207   </P
208 ><P
209 >   To run the regression tests after building but before installation,
210    type
211 </P><PRE
212 CLASS="SCREEN"
213 >gmake check</PRE
214 ><P>
215    in the top-level directory.  (Or you can change to
216    <TT
217 CLASS="FILENAME"
218 >src/test/regress</TT
219 > and run the command there.)
220    This will first build several auxiliary files, such as
221    some sample
222    user-defined trigger functions, and then run the test driver
223    script.  At the end you should see something like
224 </P><PRE
225 CLASS="SCREEN"
226 ><SAMP
227 CLASS="COMPUTEROUTPUT"
228 >======================
229  All 93 tests passed.
230 ======================</SAMP
231 ></PRE
232 ><P>
233    or otherwise a note about which tests failed.  See <A
234 HREF="regress-evaluation.html"
235 >Section 26.2</A
236 > below for more.
237   </P
238 ><P
239 >    Because this test method runs a temporary server, it will not work
240     when you are the root user (since the server will not start as root).
241     If you already did the build as root, you do not have to start all
242     over.  Instead, make the regression test directory writable by
243     some other user, log in as that user, and restart the tests.
244     For example
245 </P><PRE
246 CLASS="SCREEN"
247 ><SAMP
248 CLASS="PROMPT"
249 >root# </SAMP
250 ><KBD
251 CLASS="USERINPUT"
252 >chmod -R a+w src/test/regress</KBD
253 >
254 <SAMP
255 CLASS="PROMPT"
256 >root# </SAMP
257 ><KBD
258 CLASS="USERINPUT"
259 >chmod -R a+w contrib/spi</KBD
260 >
261 <SAMP
262 CLASS="PROMPT"
263 >root# </SAMP
264 ><KBD
265 CLASS="USERINPUT"
266 >su - joeuser</KBD
267 >
268 <SAMP
269 CLASS="PROMPT"
270 >joeuser$ </SAMP
271 ><KBD
272 CLASS="USERINPUT"
273 >cd <VAR
274 CLASS="REPLACEABLE"
275 >top-level build directory</VAR
276 ></KBD
277 >
278 <SAMP
279 CLASS="PROMPT"
280 >joeuser$ </SAMP
281 ><KBD
282 CLASS="USERINPUT"
283 >gmake check</KBD
284 ></PRE
285 ><P>
286     (The only possible <SPAN
287 CLASS="QUOTE"
288 >"security risk"</SPAN
289 > here is that other
290     users might be able to alter the regression test results behind
291     your back.  Use common sense when managing user permissions.)
292    </P
293 ><P
294 >    Alternatively, run the tests after installation.
295    </P
296 ><P
297 >    The parallel regression test starts quite a few processes under your
298     user ID.  Presently, the maximum concurrency is twenty parallel test
299     scripts, which means sixty processes: there's a server process, a
300     <SPAN
301 CLASS="APPLICATION"
302 >psql</SPAN
303 >, and usually a shell parent process for the
304     <SPAN
305 CLASS="APPLICATION"
306 >psql</SPAN
307 > for each test script.
308     So if your system enforces a per-user limit on the number of processes,
309     make sure this limit is at least seventy-five or so, else you may get
310     random-seeming failures in the parallel test.  If you are not in
311     a position to raise the limit, you can cut down the degree of parallelism
312     by setting the <TT
313 CLASS="LITERAL"
314 >MAX_CONNECTIONS</TT
315 > parameter.  For example,
316 </P><PRE
317 CLASS="SCREEN"
318 >gmake MAX_CONNECTIONS=10 check</PRE
319 ><P>
320     runs no more than ten tests concurrently.
321    </P
322 ><P
323 >    On some systems, the default Bourne-compatible shell
324     (<TT
325 CLASS="FILENAME"
326 >/bin/sh</TT
327 >) gets confused when it has to manage
328     too many child processes in parallel.  This may cause the parallel
329     test run to lock up or fail.  In such cases, specify a different
330     Bourne-compatible shell on the command line, for example:
331 </P><PRE
332 CLASS="SCREEN"
333 >gmake SHELL=/bin/ksh check</PRE
334 ><P>
335     If no non-broken shell is available, you may be able to work around the
336     problem by limiting the number of connections, as shown above.
337    </P
338 ><P
339 >   To run the tests after installation (see <A
340 HREF="installation.html"
341 >Chapter 14</A
342 >),
343    initialize a data area and start the
344    server, as explained in <A
345 HREF="runtime.html"
346 >Chapter 16</A
347 >,  then type
348 </P><PRE
349 CLASS="SCREEN"
350 >gmake installcheck</PRE
351 ><P>
352    The tests will expect to contact the server at the local host and the
353    default port number, unless directed otherwise by <TT
354 CLASS="ENVAR"
355 >PGHOST</TT
356 > and <TT
357 CLASS="ENVAR"
358 >PGPORT</TT
359 >
360    environment variables.
361   </P
362 ></DIV
363 ></DIV
364 ><DIV
365 CLASS="NAVFOOTER"
366 ><HR
367 ALIGN="LEFT"
368 WIDTH="100%"><TABLE
369 SUMMARY="Footer navigation table"
370 WIDTH="100%"
371 BORDER="0"
372 CELLPADDING="0"
373 CELLSPACING="0"
374 ><TR
375 ><TD
376 WIDTH="33%"
377 ALIGN="left"
378 VALIGN="top"
379 ><A
380 HREF="wal-internals.html"
381 ACCESSKEY="P"
382 >Prev</A
383 ></TD
384 ><TD
385 WIDTH="34%"
386 ALIGN="center"
387 VALIGN="top"
388 ><A
389 HREF="index.html"
390 ACCESSKEY="H"
391 >Home</A
392 ></TD
393 ><TD
394 WIDTH="33%"
395 ALIGN="right"
396 VALIGN="top"
397 ><A
398 HREF="regress-evaluation.html"
399 ACCESSKEY="N"
400 >Next</A
401 ></TD
402 ></TR
403 ><TR
404 ><TD
405 WIDTH="33%"
406 ALIGN="left"
407 VALIGN="top"
408 >Internals</TD
409 ><TD
410 WIDTH="34%"
411 ALIGN="center"
412 VALIGN="top"
413 ><A
414 HREF="admin.html"
415 ACCESSKEY="U"
416 >Up</A
417 ></TD
418 ><TD
419 WIDTH="33%"
420 ALIGN="right"
421 VALIGN="top"
422 >Test Evaluation</TD
423 ></TR
424 ></TABLE
425 ></DIV
426 ></BODY
427 ></HTML
428 >