Commit Graph

214 Commits

Author SHA1 Message Date
Frediano Ziglio
dfe9fe9ebe test: Add vp9 support to GStreamer test
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-04-07 16:45:54 +01:00
Frediano Ziglio
5d046d9b2d red-channel: Initialize statistic node correctly
Doing a memset(0) on a SpiceStatNode does not create an empty/unattached
node, but instead creates a node '0'. This node could be non-existing,
or totally unrelated.
This patch creates a default '0' node as soon as the file is created.
This will make the behaviour of 0-filled nodes more in line with what
one would expect.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-03-31 11:02:02 +01:00
Frediano Ziglio
7d86223e21 Fix minor incompatibilities with RHEL6
Include missing pthread header.
Avoid undeclared functions in test-glib-compat.c including
proper/correct header.
Define missing g_assert_true and g_assert_false.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-03-30 10:50:09 +01:00
Frediano Ziglio
3c78882884 test-leaks: Document test program
This test needs some additional setup to do its job.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2017-03-24 11:58:16 +00:00
Frediano Ziglio
76b7f943e4 Some automatic check on video encoders
Stress a bit video encoders.
This check different combination of
- encoder type;
- image formats;
- image clipping (encoding partial frames);
- handling frames split into chunks.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2017-03-23 12:52:58 +00:00
Christophe Fergeau
7b5e294a36 tests/pki: Use CA/certificate valid until 2048
As pointed out by danpb, tests/pki/server-cert.pem is only valid until
Fri Nov 29 15:51:44 UTC 2019

This changes tests/pki/server-cert.pem and tests/pki/ca-cert.pem to be
valid until 2048. These certificates were generated using the
instructions on https://www.spice-space.org/page/SSLConnection
The -subj args were omitted, and the defaults suggested by openssl used.
The -days parameter was changed to -days 10950.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-03-23 12:02:47 +01:00
Christophe Fergeau
759fdfc6d1 build-sys: Add tests/pki to EXTRA_DIST
This fixes make distcheck

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-03-23 12:02:47 +01:00
Christophe Fergeau
844544f8be build-sys: Add make check-valgrind target
This allows to run automatically our test-suite with valgrind to test
for memory leaks.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-03-21 16:34:56 +01:00
Christophe Fergeau
02d42d4f00 tests: Port test-qxl-parsing to GTest
test-qxl-parsing is really a series of several tests. Porting it to
GTest makes this more obvious. This also has the side-effect of making
it more friendly to 'make check-valgrind' (which would fail on SIGALRM,
and on unexpected g_warning()).

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-03-21 16:34:56 +01:00
Frediano Ziglio
312c0aadf0 test-leaks: Checks some leaks using TLS
Verify stuff are freed correctly (like TLS context).
The different PKI file required are generated with
base values (localhost and rsa 1024).

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-03-08 12:21:15 +00:00
Frediano Ziglio
df48918dd0 test-leaks: Test that creating and destroying spicevmc does not leak
Add and remove some vmc device to check for leaking.
These combination assure that currently implemented type
of devices (webdav, usb and generic) are checked.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-03-08 12:21:09 +00:00
Frediano Ziglio
a22a76371e tests: Reuse GLib compatibility code
Instead of disabling the code use the compatibility functions.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-03-03 16:49:43 +00:00
Frediano Ziglio
73f8a65d06 tests: Move some specific GLib compatibility to compatibility file
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-03-03 16:49:41 +00:00
Frediano Ziglio
b7a7ed3900 tests: Move some glib compatibility code to a separate file
Allow to reuse this code in other tests.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-03-03 16:49:36 +00:00
Frediano Ziglio
cdd1e69b28 main-dispatcher: Remove watch leak
Watch was added but never removed.
The added basic_event_loop_destroy() addition allows to see that
this leak is gone).

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-03-02 11:15:28 +00:00
Christophe Fergeau
be4ceb4e24 test-vdagent: Make test case more useful
This switches the test to using the GTest API, and add several tests
related to https://bugzilla.redhat.com/show_bug.cgi?id=1411194

This uses some API not available in glib 2.28, so this checks we have a
new enough glib before building this test, and disables warnings when
using too new glib API when building it.

The "multiple-vmc-devices" is based off code written by Frediano Ziglio.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-03-01 18:02:37 +01:00
Christophe Fergeau
c8f8ea2224 test: Add test_destroy()
This allows to chain several test cases by using
test_new()/test_destroy().

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2017-03-01 18:00:27 +01:00
Frediano Ziglio
f66b7bffc7 tests: Add basic spice_server_init()/spice_server_destroy()
This can be used for very basic leak checks.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-03-01 16:06:57 +00:00
Christophe Fergeau
f5494cfa9b test-playback: Pass proper types to spice_server_add_interface
This is a revert of b76e561d.
For a SpicePlaybackInstance, the base interface must be a
SpicePlaybackInterface instance, not a SpiceBaseInterface instance, or
spice-server code will end up reading out of bounds.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-02-15 12:13:55 +01:00
Christophe Fergeau
1afa86c3ee test-display-base: Pass proper types to spice_server_add_interface
This is a revert of 93b4f4050^ and 93b4f4050.
For a SpiceCharDeviceInstance, the base interface must be a
SpiceCharDeviceInterface instance, not a SpiceBaseInterface instance, or
spice-server code will end up reading out of bounds.

vmc_state/vmc_write/vmc_read implementations also have to be provided.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-02-15 12:13:55 +01:00
Christophe Fergeau
14b2f053ab test-vdagent: Pass proper types to spice_server_add_interface
This is a revert of 93b4f4050^ and 93b4f4050.
For a SpiceCharDeviceInstance, the base interface must be a
SpiceCharDeviceInterface instance, not a SpiceBaseInterface instance, or
spice-server code will end up reading out of bounds.

vmc_state/vmc_write/vmc_read implementations also have to be provided.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-02-15 12:13:55 +01:00
Frediano Ziglio
a44a735cda replay: Support TLS in replay utility
Allows to test encrypted connections.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-02-06 10:06:09 +00:00
Snir Sheriber
1004748c46 autotools: compile gst-test only if gstreamer is available
Needed in order to avoid compilation error when gstreamer is
unavailable
2017-02-03 09:08:55 +01:00
Jeremy White
35177a6c41 Avoid a 'missing braces around initializer' warning.
Static variables don't need initializers to be 0.

Signed-off-by: Jeremy White <jwhite@codeweavers.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-01-25 15:41:04 +00:00
Frediano Ziglio
19a900f396 tests: Make possible to have a report of the video encoding
This allows to do some possible statistics or graph.
Currently the report contains encoded sizes.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-01-21 09:05:42 +00:00
Frediano Ziglio
345d7bde23 Compatibility for GStreamer 0.10 for test utility
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-01-21 09:04:50 +00:00
Frediano Ziglio
623e7d4a93 Add an helper to test VideoEncoder
Add an utility to make possible to check various features of
VideoEncoder.
2 GStreamer plugins are used in a chain like this:
  (1) input pipeline -> (2) video encoder -> (3) output pipeline
While converting output from (1) is compared with output of (3)
making sure the streaming is working correctly.
You can set various options:
- part of the input pipeline description to allow specifying different
  video from GStreamer test ones to a video file;
- the encoder to use;
- different image properties to use for (2) input:
  - different bit depth;
  - top/down or down/up;
- initial bitrate.

The idea is to use this helper in combination with a shell script
and some video sources to make able to test various settings.
Also can be used to extend the current encoder list.

As an example you can use a command like

$ ./test-gst -e gstreamer:vp8 -i \
  'filesrc location=bbb_sunflower_1080p_30fps_normal.mp4 \
  ! decodebin ! videoconvert'

to check vp8 encoding.

Currently it does not emulate bandwidth changes as stream reports
from the client are not coded.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2017-01-10 13:42:25 +00:00
Snir Sheriber
af390d53ca tests: Fix compilation error
Fix compilation error due to -Werror=maybe-uninitialized:

  CC       test-display-base.o
test-display-base.c: In function 'do_wakeup':
test-display-base.c:579:13: error: 'update' may be used uninitialized...
             push_command(&update->ext);

Signed-off-by: Snir Sheriber <ssheribe@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-01-04 16:09:50 +00:00
Victor Toso
aebc51f91a reds: don't replace video_codecs on failure
We should replace the video_codecs GArray only after the parsing of
input is done, otherwise we might lose previous configuration.

Tests were updated to match this situation. Input that fails to
replace video_codecs are considered bad.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-12-15 11:13:36 +00:00
Victor Toso
8faf7a6f45 Fix gitignore
Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-12-08 15:18:25 +01:00
Frediano Ziglio
030ae7bbdc tests: Apply same warning level as main server code
Allow to catch minor issue with test code.
Although test usually are coded with less care than production
code the current changes required are not so extensive and
can catch different issues.
Most of the patch is making functions static to avoid warnings for
undeclared functions.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-12-06 16:16:19 +00:00
Frediano Ziglio
97f631471b build: Remove not existing include directory
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-12-06 13:07:27 +00:00
Frediano Ziglio
4f301ea0e4 Free replay queues
There could be still some data pending.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-12-05 23:27:35 +00:00
Frediano Ziglio
0c8b059fac replay: Free spice server to detect leaks
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-12-05 23:27:35 +00:00
Pavel Grunt
b53c0d368b test: Ignore too new warnings
There is an explicit check for the version

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-12-05 12:32:28 +00:00
Frediano Ziglio
47f56a72e0 Free statistic file on spice_server_destroy
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-11-30 12:36:47 +00:00
Frediano Ziglio
f275733de3 Add a red_memslot_info_destroy function
Allows to free RedMemSlotInfo structure

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-11-25 14:36:40 +00:00
Frediano Ziglio
e05cf93a01 tests: Normalize test names
Use dash instead of underscores for file names. This is coherent
with rest of file names.
Rename all tests to test-XXX and remove the spice- prefix when
present. This is coherent with most of the tests.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-11-25 13:52:39 +00:00
Pavel Grunt
39b6b65421 Do not crash on NULL codecs
Reviewed-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-11-17 11:13:04 +00:00
Pavel Grunt
5c311ea8a1 Add test for codecs parsing
With Glib2.34 test invalid codec strings

Reviewed-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-11-17 11:12:21 +00:00
Frediano Ziglio
973cbb4df2 Revert "replay: Replicate wakeups properly"
This reverts commit c6881ad1a0.

This patch cause the replay utility run at full speed
to slow down a lot and in some cases getting stuck.
I don't understand the reason and when I tested was working
but as we are going to release would be a pity if this test utility
won't work as useful to get feedback and reports.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-11-17 11:03:51 +00:00
Frediano Ziglio
002c7c9eeb Make RedStatFile private inside stat-file.c
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-11-16 16:38:32 +00:00
Frediano Ziglio
5209d33977 Add a base test for statistic file
Create a file and add/remove some nodes.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-11-16 16:38:24 +00:00
Frediano Ziglio
1b4e8855ea Remove core_public and core_interface_adapter globals usage
Avoid not constant globals.

We started encapsulating all global state into RedsState however
there are still some global variable. This patch remove the
core_public global variable.

To implement this a new SpiceCoreInterface *public_interface
field is added to SpiceCoreInterfaceInternal and the
SpiceCoreInterfaceInternal* argument is passed to callbacks to
understand which external interface to use.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-11-15 16:49:09 +00:00
Frediano Ziglio
5902960d39 Make red-replay-qxl.h a public header
The functions declared in that header are all exported by the
library.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-11-10 06:37:15 +00:00
Frediano Ziglio
c6881ad1a0 replay: Replicate wakeups properly
Instead of waking up the command loop for every command queued,
handle saved wakeups and replicate these.
This better reproduces what happened in the server.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-11-10 06:32:58 +00:00
Pavel Grunt
2051007e05 spice-options-test: Convert to gtest to catch criticals
Fail on glib warnings instead of ignoring them

Signed-off-by: Pavel Grunt <pgrunt@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-11-07 17:18:45 +00:00
Christophe Fergeau
c7f492b75c syntax-check: Add missing license headers
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-11-01 12:48:26 +00:00
Christophe Fergeau
c979647a77 syntax-check: Remove unused header includes
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-11-01 12:48:20 +00:00
Christophe Fergeau
9c21b474c0 syntax-check: Add missing <config.h> includes
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-11-01 12:47:14 +00:00