X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=doc%2Fyaz-ztest-man.xml;h=dfa1b3a96082da1ff39593ba7a27e53dfd1f356f;hp=f0776cc9da94c6620f547c2212bffe1814a1f7f2;hb=cca8a96be6d6ce6de52009e53e23876ce2fc195c;hpb=876a13d858b70e6f2c34eaefad90d0577f5f1583 diff --git a/doc/yaz-ztest-man.xml b/doc/yaz-ztest-man.xml index f0776cc..dfa1b3a 100644 --- a/doc/yaz-ztest-man.xml +++ b/doc/yaz-ztest-man.xml @@ -1,87 +1,150 @@ - + + %local; + + %entities; + + %idcommon; + + + ]> - - + + YAZ + &version; + Index Data + + yaz-ztest 8 + System management commands - + yaz-ztest - Z39.50 Test Server + Z39.50/SRU Test Server - - - - yaz-ztest - - - - - - - - - - - - - - - - listener-spec - + + &gfs-synopsis; DESCRIPTION - yaz-ztest is a Z39.50 test server that uses - the YAZ frontend server API. - The server acts as a real Z39.50 server but does not use a database. + yaz-ztest is a Z39.50/SRU test server that uses + the YAZ generic frontend server (GFS) API. + The server acts as a real Z39.50/SRU server but does not use a database. It returns a random hit count and returns a subset of a few built-in records. + + + The listener-spec consists of a transport + mode followed by a colon, followed by a listener address. The + transport mode is either tcp, unix, + or ssl. + + + For TCP and SSL, an address has the form: + + hostname | IP-number [ : portnumber ] + + + + For UNIX local socket the address is the filename of the local socket. + + + + OPTIONS + &gfs-options; + + + TESTING + + yaz-ztest normally returns a random hit count between + 0 and 24. However, if a query term includes leading digits, then the + integer value of that term is used as hit count. This allows testers + to return any number of hits. yaz-ztest includes + 24 MARC records for testing. Hit counts exceeding 24 will make + yaz-ztest return the same record batch over and over.. + So record at position 1, 25, 49, etc .. are equivalent. - The listener-spec consists of a transport - mode followed by a colon, followed by a listener address. The - transport mode is either tcp, unix, - or ssl. + For XML if no element set is given or element has value "marcxml", + MARCXML is returned (each of the 24 dummy records converted from + ISO2709 to XML). For element set OP, OPAC XML is returned. - For TCP and SSL, an address has the form: - - hostname | IP-number [ : portnumber ] - + yaz-ztest may also return predefined XML records (for testing). + This is enabled if YAZ_ZTEST_XML_FETCH environment + variable is defined. A record is fetched form a file (one record per file). + The path for the filename is + FE.d.xml + where F is the YAZ_ZTEST_XML_FETCH value + (possibly + empty), E is element-set, + d is record position (starting from 1). - For UNIX local socket the address is the filename of the local socket. + The following databases are honored by yaz-ztest: + Default, slow + and db.* (all databases with prefix "db"). Any + other database will make yaz-ztest return diagnostic + 109: "Database unavailable". - - - OPTIONS - &ztest-options; - - FILES - yaz-<version>/ztest/yaz-ztest.c + Options for search may be included in the form or URL get arguments + included as part of the Z39.50 database name. The following + database options are present: search-delay, + present-delay, fetch-delay + and seed. - yaz-<version>/include/yaz/backend.h + The former, delay type options, specify + a fake delay (sleep) that yaz-ztest will perform + when searching, presenting, fetching records respectively. + The value of the delay may either be a fixed floating point + value which specifies the delay in seconds. + Alternatively the value may be given as two floating point numbers + separated by colon, which wil make yaz-ztest perform + a random sleep between the first and second number. - - SEE ALSO - - yaz - 7 + The database parameter seed takes an integer + as value. This will call srand with this integer to + ensure that the random behavior can be re-played. - Section "Generic server" in the YAZ manual. + Suppose we want searches to take between 0.1 and 0.5 seconds and + a fetch to take 0.2 second. To access test database Default we'd use: + Default?search-delay=0.1:0.5&fetch-delay=0.2. - + + GFS CONFIGURATION AND VIRTUAL HOSTS + &gfs-virtual; + + FILES + + yaz-<version>/ztest/yaz-ztest.c + + + yaz-<version>/include/yaz/backend.h + + + SEE ALSO + + + yaz + 7 + + + yaz-log + 7 + + +