rts2-test(1)
============

NAME
----
rts2-test - performs test file driven observatory testing

SYNOPSIS
--------

*rts2-test* [-v]+ 'test file'

DESCRIPTION
-----------

Allows autonomous, XML file driven testing of observatory devices. It uses
RTS2 JSON API - so linkman:rts2-httpd[7] must be configured and running.

The tests should be run when observatory is not operating. As tests should be
run 

OPTIONS
-------

RTS2 follows the usual GNU command line syntax, with long options
starting with two dashes (`--').  A summary of options is included below.

You can use \-- (two dashes with a space) to escape arguments which start with
'-'. So to run command with -1 as an argument, you must specify \-- -1 on
the command line.

* **-h**,**\--help** show help message

* *-v* increases verbosity

Test file format
----------------

Test file is an XML file. It must be well formatted. Root element is tests,
with following attributes (all optional):

* **hostname** RTS2 JSON hostname, defaults to http://localhost:8889

* **login** RTS2 JSON login

* **password** RTS2 JSON password

The following tags can follow under tests:

### exists

Check if given device exists in RTS2, and has been recently updated. The test
issues info command on device, and then check if device infotime is sensible
(not in future and less than maxdelay seconds from current time).

Attributes:

* **device** device name

* **maxdelay** maximal allowed delay (in seconds) between reported infotime and
  current system time

### exposure

Starts exposure, gets data. If expected average is provided, test if the
average is within given range.

Attributes:

* **camera** camera name. If none is provided, runs on all connected cameras

* **exposure** exposure time in seconds

* **type** **dark** or **object** image

* **average** image expected average ADU

* **deviation** allowed deviation. Either absolute, or if followed by %, then
  percentage from expected average

* **repeat** how many images should be taken

### Example test file

----
<tests hostname="http://localhost:8889" login="test" password="t">
	<exits device="C0"/> 
	<exposure camera="C0" exposure="10" type="dark" average="400" deviation="10%"/>
	<exposure exposure="10" type="object" average="400" deviation="10%"/>
	<exposure exposure="0.1" type="object" repeat="5"/>
</tests>
----

SEE ALSO
--------

* linkman:rts2[7]

AUTHOR
------

Petr Kubanek <petr@rts2.org>
