14f743c4e2fe7f10061bee6b3fc5c74ebfcb1aff
[yaz-moved-to-github.git] / doc / yaz-ztest-man.xml
1 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN"
2  "http://www.oasis-open.org/docbook/xml/4.1/docbookx.dtd"
3 [
4      <!ENTITY % local SYSTEM "local.ent">
5      %local;
6      <!ENTITY % entities SYSTEM "entities.ent">
7      %entities;
8      <!ENTITY % idcommon SYSTEM "common/common.ent">
9      %idcommon;
10      <!ENTITY gfs-synopsis-app "yaz-ztest">
11      <!ENTITY reference-tools-cql-map 'section "Specifiction of CQL to RPN mappings"'>
12      <!ENTITY reference-tools-cql-map 'section "CCL Qualifiers"'>
13 ]>
14 <refentry id="yaz-ztest">
15  <refentryinfo>
16   <productname>YAZ</productname>
17   <productnumber>&version;</productnumber>
18  </refentryinfo>
19  
20  <refmeta>
21   <refentrytitle>yaz-ztest</refentrytitle>
22   <manvolnum>8</manvolnum>
23  </refmeta>
24  
25  <refnamediv>
26   <refname>yaz-ztest</refname>
27   <refpurpose>Z39.50 Test Server</refpurpose>
28  </refnamediv>
29  
30  <refsynopsisdiv>
31   &gfs-synopsis;
32  </refsynopsisdiv>
33  <refsect1><title>DESCRIPTION</title>
34   <para>
35    <command>yaz-ztest</command> is a Z39.50 test server that uses
36    the YAZ generic frontend server API.
37    The server acts as a real Z39.50 server but does not use a database.
38    It returns a random hit count and returns a subset of a few built-in
39    records.
40   </para>
41   <para>
42    The <replaceable>listener-spec</replaceable> consists of a transport
43    mode followed by a colon, followed by a listener address. The
44    transport mode is either <literal>tcp</literal>, <literal>unix</literal>,
45    or <literal>ssl</literal>.
46   </para>
47   <para>
48    For TCP and SSL, an address has the form:
49    <screen>
50     hostname | IP-number [ : portnumber ]
51    </screen>
52   </para>
53   <para>
54    For UNIX local socket the address is the filename of the local socket.
55   </para>
56  </refsect1>
57  <refsect1>
58   <title>OPTIONS</title>
59   &gfs-options;
60  </refsect1>
61  <refsect1>
62    <title>TESTING</title>
63    <para>
64     <command>yaz-ztest</command> normally returns a random hit count between
65     0 and 24. However, if a query term includes leading digits, then the 
66     integer value of that term is used as hit count. This allows testers
67     to return any number of hits. <command>yaz-ztest</command> includes
68     24 MARC records for testing. Hit counts exceeding 24 will make 
69     <command>yaz-ztest</command> return the same record batch over and over..
70     So record at position 1, 25, 49, etc .. are equivalent.
71    </para>
72    <para>
73      The following databases are honored by <command>yaz-ztest</command>:
74      <literal>Default</literal>, <literal>slow</literal>
75      and <literal>db.*</literal> (all databases with prefix "db"). Any
76      other database will make <command>yaz-ztest</command> return diagnostic
77      109: "Database unavailable".
78    </para>
79    <para>
80      Options for search may be included in the form or URL get arguments
81      included as part of the Z39.50 database name. The following
82      database options are present: <literal>search-delay</literal>,
83      <literal>present-delay</literal>, <literal>fetch-delay</literal>
84      and <literal>seed</literal>.
85    </para>
86    <para>
87      The former, delay type options, specify
88      a fake delay (sleep) that <command>yaz-ztest</command> will perform
89      when searching, presenting, fetching records respectively.
90      The value of the delay may either be a fixed floating point
91      value which specifies the delay in seconds.
92      Alternatively the value may be given as two floating point numbers
93      separated by colon, which wil make <command>yaz-ztest</command> perform
94      a random sleep between the first and second number.
95    </para>
96    <para>
97      The database parameter <literal>seed</literal> takes an integer 
98      as value. This will call <literal>srand</literal> with this integer to
99      ensure that the random behavior can be re-played.
100    </para>
101    <para>
102      Suppose we want searches to take between 0.1 and 0.5 seconds and
103      a fetch to take 0.2 second. To access test database Default we'd use:
104      <literal>Default?search-delay=0.1:0.5&amp;fetch-delay=0.2</literal>.
105    </para>
106  </refsect1>
107  <refsect1><title>GFS CONFIGURATION AND VIRTUAL HOSTS</title>
108   &gfs-virtual;
109  </refsect1>
110  <refsect1><title>FILES</title>
111   <para>
112    <filename>yaz-&lt;version&gt;/ztest/yaz-ztest.c</filename>
113   </para>
114   <para>
115    <filename>yaz-&lt;version&gt;/include/yaz/backend.h</filename>
116   </para>
117  </refsect1>
118  <refsect1><title>SEE ALSO</title>
119   <para>
120    <citerefentry>
121     <refentrytitle>yaz</refentrytitle>
122     <manvolnum>7</manvolnum>
123    </citerefentry>
124    <citerefentry>
125     <refentrytitle>yaz-log</refentrytitle>
126     <manvolnum>7</manvolnum>
127    </citerefentry>
128   </para>
129  </refsect1>
130 </refentry>
131
132 <!-- Keep this comment at the end of the file
133 Local variables:
134 mode: sgml
135 sgml-omittag:t
136 sgml-shorttag:t
137 sgml-minimize-attributes:nil
138 sgml-always-quote-attributes:t
139 sgml-indent-step:1
140 sgml-indent-data:t
141 sgml-parent-document:nil
142 sgml-local-catalogs: nil
143 sgml-namecase-general:t
144 End:
145 -->