summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Adam <jakub.adam@collabora.com>2019-01-14 10:24:12 +0100
committerJakub Adam <jakub.adam@collabora.com>2019-01-14 22:12:21 +0100
commit6e27c1efa02f45fd2eb8f27615c61973a707d2f4 (patch)
tree33f8b381409ef5c6425673177450099691c742a2
parent1ff4d53d3dcb35bac9ca9317033170c201609803 (diff)
downloadlibnice-6e27c1efa02f45fd2eb8f27615c61973a707d2f4.tar.gz
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
-rw-r--r--tests/test-build-io-stream.c5
-rw-r--r--tests/test-dribble.c11
-rw-r--r--tests/test-drop-invalid.c2
-rw-r--r--tests/test-fallback.c3
-rw-r--r--tests/test-gstreamer.c3
-rw-r--r--tests/test-icetcp.c2
-rw-r--r--tests/test-restart.c2
7 files changed, 27 insertions, 1 deletions
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);