1 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.4//EN"
2 "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
4 <!ENTITY % local SYSTEM "local.ent">
6 <!ENTITY % entities SYSTEM "entities.ent">
8 <!ENTITY % idcommon SYSTEM "common/common.ent">
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"'>
14 <refentry id="yaz-ztest">
16 <productname>YAZ</productname>
17 <productnumber>&version;</productnumber>
18 <info><orgname>Index Data</orgname></info>
22 <refentrytitle>yaz-ztest</refentrytitle>
23 <manvolnum>8</manvolnum>
24 <refmiscinfo class="manual">System management commands</refmiscinfo>
28 <refname>yaz-ztest</refname>
29 <refpurpose>Z39.50/SRU Test Server</refpurpose>
35 <refsect1><title>DESCRIPTION</title>
37 <command>yaz-ztest</command> is a Z39.50/SRU test server that uses
38 the YAZ generic frontend server (GFS) API.
39 The server acts as a real Z39.50/SRU server but does not use a database.
40 It returns a random hit count and returns a subset of a few built-in
44 The <replaceable>listener-spec</replaceable> consists of a transport
45 mode followed by a colon, followed by a listener address. The
46 transport mode is either <literal>tcp</literal>, <literal>unix</literal>,
47 or <literal>ssl</literal>.
50 For TCP and SSL, an address has the form:
52 hostname | IP-number [ : portnumber ]
56 For UNIX local socket the address is the filename of the local socket.
60 <title>OPTIONS</title>
64 <title>TESTING</title>
66 <command>yaz-ztest</command> normally returns a random hit count between
67 0 and 24. However, if a query term includes leading digits, then the
68 integer value of that term is used as hit count. This allows testers
69 to return any number of hits. <command>yaz-ztest</command> includes
70 24 MARC records for testing. Hit counts exceeding 24 will make
71 <command>yaz-ztest</command> return the same record batch over and over..
72 So record at position 1, 25, 49, etc .. are equivalent.
75 The following databases are honored by <command>yaz-ztest</command>:
76 <literal>Default</literal>, <literal>slow</literal>
77 and <literal>db.*</literal> (all databases with prefix "db"). Any
78 other database will make <command>yaz-ztest</command> return diagnostic
79 109: "Database unavailable".
82 Options for search may be included in the form or URL get arguments
83 included as part of the Z39.50 database name. The following
84 database options are present: <literal>search-delay</literal>,
85 <literal>present-delay</literal>, <literal>fetch-delay</literal>
86 and <literal>seed</literal>.
89 The former, delay type options, specify
90 a fake delay (sleep) that <command>yaz-ztest</command> will perform
91 when searching, presenting, fetching records respectively.
92 The value of the delay may either be a fixed floating point
93 value which specifies the delay in seconds.
94 Alternatively the value may be given as two floating point numbers
95 separated by colon, which wil make <command>yaz-ztest</command> perform
96 a random sleep between the first and second number.
99 The database parameter <literal>seed</literal> takes an integer
100 as value. This will call <literal>srand</literal> with this integer to
101 ensure that the random behavior can be re-played.
104 Suppose we want searches to take between 0.1 and 0.5 seconds and
105 a fetch to take 0.2 second. To access test database Default we'd use:
106 <literal>Default?search-delay=0.1:0.5&fetch-delay=0.2</literal>.
109 <refsect1><title>GFS CONFIGURATION AND VIRTUAL HOSTS</title>
112 <refsect1><title>FILES</title>
114 <filename>yaz-<version>/ztest/yaz-ztest.c</filename>
117 <filename>yaz-<version>/include/yaz/backend.h</filename>
120 <refsect1><title>SEE ALSO</title>
123 <refentrytitle>yaz</refentrytitle>
124 <manvolnum>7</manvolnum>
127 <refentrytitle>yaz-log</refentrytitle>
128 <manvolnum>7</manvolnum>
134 <!-- Keep this comment at the end of the file
139 sgml-minimize-attributes:nil
140 sgml-always-quote-attributes:t
143 sgml-parent-document:nil
144 sgml-local-catalogs: nil
145 sgml-namecase-general:t