From 6e27c1efa02f45fd2eb8f27615c61973a707d2f4 Mon Sep 17 00:00:00 2001 From: Jakub Adam Date: Mon, 14 Jan 2019 10:24:12 +0100 Subject: tests: Disable UPnP An application using more than one NiceAgent instance may crash due to a race in gUPnP. Fix is to be released in gUPnP 1.1.2 / 1.0.4: https://gitlab.gnome.org/GNOME/gupnp/commit/0123e574595e0a547ce26422633df72d63d3d0e0 --- tests/test-build-io-stream.c | 5 +++++ tests/test-dribble.c | 11 +++++++++++ tests/test-drop-invalid.c | 2 ++ tests/test-fallback.c | 3 ++- tests/test-gstreamer.c | 3 +++ tests/test-icetcp.c | 2 ++ tests/test-restart.c | 2 ++ 7 files changed, 27 insertions(+), 1 deletion(-) diff --git a/tests/test-build-io-stream.c b/tests/test-build-io-stream.c index a3478ed..7a6e5dd 100644 --- a/tests/test-build-io-stream.c +++ b/tests/test-build-io-stream.c @@ -49,6 +49,7 @@ test_invalid_stream (NiceAddress *addr) GIOStream *io_stream; agent = nice_agent_new_reliable (NULL, NICE_COMPATIBILITY_RFC5245); + g_object_set (G_OBJECT (agent), "upnp", FALSE, NULL); nice_agent_add_local_address (agent, addr); /* Try building an I/O stream for an invalid stream. All its operations should @@ -69,6 +70,7 @@ test_io_stream_properties (NiceAddress *addr) GOutputStream *output_stream; agent = nice_agent_new_reliable (NULL, NICE_COMPATIBILITY_RFC5245); + g_object_set (G_OBJECT (agent), "upnp", FALSE, NULL); nice_agent_add_local_address (agent, addr); stream_id = nice_agent_add_stream (agent, 1); @@ -125,6 +127,7 @@ test_pollable_properties (NiceAddress *addr) GSource *stream_source; agent = nice_agent_new_reliable (NULL, NICE_COMPATIBILITY_RFC5245); + g_object_set (G_OBJECT (agent), "upnp", FALSE, NULL); nice_agent_add_local_address (agent, addr); /* Add a stream. */ @@ -295,6 +298,7 @@ test_pollable_cancellation (NiceAddress *addr) GCancellable *cancellable; agent = nice_agent_new_reliable (NULL, NICE_COMPATIBILITY_RFC5245); + g_object_set (G_OBJECT (agent), "upnp", FALSE, NULL); nice_agent_add_local_address (agent, addr); /* Add a stream. */ @@ -373,6 +377,7 @@ test_zero_length_reads_writes (NiceAddress *addr) guint8 buf[1]; /* should never be accessed */ agent = nice_agent_new_reliable (NULL, NICE_COMPATIBILITY_RFC5245); + g_object_set (G_OBJECT (agent), "upnp", FALSE, NULL); nice_agent_add_local_address (agent, addr); /* Add a stream. */ diff --git a/tests/test-dribble.c b/tests/test-dribble.c index d9de07b..388ae48 100644 --- a/tests/test-dribble.c +++ b/tests/test-dribble.c @@ -272,6 +272,17 @@ int main (void) g_object_set (G_OBJECT (lagent), "controlling-mode", TRUE, NULL); g_object_set (G_OBJECT (ragent), "controlling-mode", FALSE, NULL); + /* An application using more than one NiceAgent instance may crash due to + * a race in gUPnP. + * + * UPnP can be re-enabled here and in other libnice tests once gUPnP + * 1.1.2 / 1.0.4 is released. + * + * See https://gitlab.gnome.org/GNOME/gupnp/commit/0123e574595e0a547ce26422633df72d63d3d0e0 + */ + g_object_set (G_OBJECT (lagent), "upnp", FALSE, NULL); + g_object_set (G_OBJECT (ragent), "upnp", FALSE, NULL); + /* step: add one stream, with RTP+RTCP components, to each agent */ ls_id = nice_agent_add_stream (lagent, 1); diff --git a/tests/test-drop-invalid.c b/tests/test-drop-invalid.c index 97e3586..e8f5206 100644 --- a/tests/test-drop-invalid.c +++ b/tests/test-drop-invalid.c @@ -445,6 +445,8 @@ int main (void) g_object_set (G_OBJECT (lagent), "ice-tcp", FALSE, NULL); g_object_set (G_OBJECT (ragent), "ice-tcp", FALSE, NULL); + g_object_set (G_OBJECT (lagent), "upnp", FALSE, NULL); + g_object_set (G_OBJECT (ragent), "upnp", FALSE, NULL); nice_agent_set_software (lagent, "test-drop-invalid, Left Agent"); nice_agent_set_software (ragent, "test-drop-invalid, Right Agent"); diff --git a/tests/test-fallback.c b/tests/test-fallback.c index 34fd1d1..3a75b99 100644 --- a/tests/test-fallback.c +++ b/tests/test-fallback.c @@ -503,7 +503,8 @@ int main (void) lagent = nice_agent_new (g_main_loop_get_context (global_mainloop), NICE_COMPATIBILITY_RFC5245); ragent = nice_agent_new (g_main_loop_get_context (global_mainloop), NICE_COMPATIBILITY_RFC5245); - + g_object_set (G_OBJECT (lagent), "upnp", FALSE, NULL); + g_object_set (G_OBJECT (ragent), "upnp", FALSE, NULL); /* step: add a timer to catch state changes triggered by signals */ timer_id = g_timeout_add (30000, timer_cb, NULL); diff --git a/tests/test-gstreamer.c b/tests/test-gstreamer.c index 2981c00..998baaf 100644 --- a/tests/test-gstreamer.c +++ b/tests/test-gstreamer.c @@ -227,6 +227,9 @@ GST_START_TEST (buffer_list_test) sink_agent = nice_agent_new (NULL, NICE_COMPATIBILITY_RFC5245); src_agent = nice_agent_new (NULL, NICE_COMPATIBILITY_RFC5245); + g_object_set (G_OBJECT (sink_agent), "upnp", FALSE, NULL); + g_object_set (G_OBJECT (src_agent), "upnp", FALSE, NULL); + nice_agent_add_local_address (sink_agent, addr); nice_agent_add_local_address (src_agent, addr); diff --git a/tests/test-icetcp.c b/tests/test-icetcp.c index 5b2b4b2..22cd98a 100644 --- a/tests/test-icetcp.c +++ b/tests/test-icetcp.c @@ -418,6 +418,8 @@ int main (void) g_object_set (G_OBJECT (lagent), "ice-udp", FALSE, NULL); g_object_set (G_OBJECT (ragent), "ice-udp", FALSE, NULL); + g_object_set (G_OBJECT (lagent), "upnp", FALSE, NULL); + g_object_set (G_OBJECT (ragent), "upnp", FALSE, NULL); nice_agent_set_software (lagent, "Test-icetcp, Left Agent"); nice_agent_set_software (ragent, "Test-icetcp, Right Agent"); diff --git a/tests/test-restart.c b/tests/test-restart.c index afc51b6..f350313 100644 --- a/tests/test-restart.c +++ b/tests/test-restart.c @@ -430,6 +430,8 @@ int main (void) g_object_set (G_OBJECT (lagent), "ice-tcp", FALSE, NULL); g_object_set (G_OBJECT (ragent), "ice-tcp", FALSE, NULL); + g_object_set (G_OBJECT (lagent), "upnp", FALSE, NULL); + g_object_set (G_OBJECT (ragent), "upnp", FALSE, NULL); /* step: add a timer to catch state changes triggered by signals */ timer_id = g_timeout_add (30000, timer_cb, NULL); -- cgit v1.2.1