spice/server/tests
Alon Levy 622cb433a8 server/tests/spice-server-replay: introduce
usage: spice-server-replay -p <port> -c <client command line> <cmdfile>

will run the commands from cmdfile ignoring timestamps, right after a
connection is established from the client, and will SIGINT the client
on end of cmdfile, and exit itself after waiting for the client.

spicy-stats from spice-gtk is useful for testing, it prints the summary
of the traffic on each channel.

You can also run with no client by doing:
spice-server-replay <cmdfile>

For example, the 300 MB file (compressed to 4 MB with xz -9) available
at [1] produces the following output:

spicy-stats total bytes read:
total bytes read:
inputs: 214
display: 1968983
cursor: 390
main: 256373

You could run it directly like so:
curl http://annarchy.freedesktop.org/~alon/win7_boot_shutdown.cmd.xz | \
  xzcat | server/tests/spice-server-replay -p 12345 -c `which spicy-stats` -

Known Problems:
* Implementation is wrong. Should do a single device->host conversion
 (i.e. get_virt), and then marshall/demarshall that (i.e. RedDrawable).
* segfault on file read done resulting in the above spicy-stats not
 being reproducable (well, up to 1% yes).

[1] http://annarchy.freedesktop.org/~alon/win7_boot_shutdown.cmd.xz

Now based on glib including using an asyncqueue for reading the playback
file, and proper freeing of the allocated commands, with --slow,
--compression and a progress timer, and doesn't use more then nsurfaces.

Signed-off-by: Alon Levy <alon@pobox.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
2015-08-22 12:36:37 +01:00
..
.gitignore syntax-check: fix no-newline or empty line at EOF 2013-07-16 23:37:29 +03:00
base_test.ppm Adding image to be used as "correct" in regression tests 2012-02-14 14:53:47 +02:00
basic_event_loop.c tests: use glib main loop 2015-08-20 17:47:24 +01:00
basic_event_loop.h server: tests: add basic tests with working do nothing server 2010-11-08 16:04:27 +02:00
Makefile.am server/tests/spice-server-replay: introduce 2015-08-22 12:36:37 +01:00
README Adding support to automated tests 2012-02-14 14:53:44 +02:00
regression_test.py build-sys: check for spicy-screenshot 2014-09-08 14:49:29 +02:00
replay.c server/tests/spice-server-replay: introduce 2015-08-22 12:36:37 +01:00
test_display_base.c tests: Fix build on Hurd 2015-02-24 15:39:24 +01:00
test_display_base.h server/tests: test_display_width_stride 2013-05-17 11:06:34 -04:00
test_display_no_ssl.c Adjust to new SpiceImageCompress name 2015-07-29 17:40:48 +02:00
test_display_resolution_changes.c Adjust to new SpiceImageCompress name 2015-07-29 17:40:48 +02:00
test_display_streaming.c Fix -Wunused-value 2014-09-12 18:00:30 +02:00
test_display_width_stride.c Adjust to new SpiceImageCompress name 2015-07-29 17:40:48 +02:00
test_empty_success.c Fix -Wunused-parameter 2014-09-12 18:00:30 +02:00
test_fail_on_null_core_interface.c Add missing includes of config.h 2012-01-13 18:11:59 +02:00
test_just_sockets_no_ssl.c Add missing includes of config.h 2012-01-13 18:11:59 +02:00
test_multiple.py server: add tester and todo for multiple client support 2011-08-23 19:18:23 +03:00
test_playback.c Fix -Wmissing-field-initializers 2014-09-12 18:00:30 +02:00
test_spice_version.sh server: add dist-hook to prevent spice version configure/spice.h difference 2012-09-03 10:31:02 +03:00
test_two_servers.c Adjust to new SpiceImageCompress name 2015-07-29 17:40:48 +02:00
test_util.h server/tests/basic_event_loop: multiple fixes 2011-08-23 17:01:14 +03:00
test_vdagent.c Fix -Wunused-function 2014-09-12 18:00:30 +02:00

What is here
============

This directory will contain a testsuite for the server including tetris drawing.

Unfortunately tetris and most of the tests are not here right now. You can however run all the tests and use libtool to debug any of them thus:

libtool --mode=execute gdb test_just_sockets_no_ssl

Overview of tests
=================

test_just_sockets_no_ssl
 A complete server, only provides the main and inputs channels. Doesn't actually produce anything on the channels. Essentially a test of the regular link code (reds.c), good for multiple connect/disconnect tests.

test_empty_success
 tests calling

test_fail_on_null_core_interface
 should abort when run (when spice tries to watch_add)

basic_event_loop.c
 used by test_just_sockets_no_ssl, can be used by other tests. very crude event loop. Should probably use libevent for better tests, but this is self contained.

Automated tests
===============

test_display_streaming.c
 this test can be used to check regressions. For this, Spice needs to be compiled with --enable-automated-tests and test_display_streaming needs to be called passing --automated-tests as parameter