[Spice-commits] AUTHORS server/tests

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Nov 11 09:25:35 UTC 2021


 AUTHORS                   |    1 +
 server/tests/test-leaks.c |    5 +++++
 2 files changed, 6 insertions(+)

New commits:
commit 3d32295f9e99054ae1a40d220ccef53a176c8aed
Author: Simon Chopin <simon.chopin at canonical.com>
Date:   Wed Nov 10 14:03:58 2021 +0100

    test-leaks: fix the test with OpenSSL3
    
    In OpenSSL3, the SSL_accept call now emits proper errors, which we dump
    *before* emitting the expected "SSL_accept failed" error message. The
    g_test_expect_message framework doesn't really allow us to discard
    messages AFAICT, so instead we add a new expectation with fairly loose
    criteria.
    
    Fixes #63
    
    Signed-off-by: Simon Chopin <simon.chopin at canonical.com>
    Acked-by: Frediano Ziglio <freddy77 at gmail.com>

diff --git a/AUTHORS b/AUTHORS
index b2914602..a28cdb62 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -84,5 +84,6 @@ Patches also contributed by
     Tomasz Kłoczko <kloczek at github.com>
     Qiuhao Li <Qiuhao.Li at outlook.com>
     Hunter Sezen <orbea at riseup.net>
+    Simon Chopin <simon.chopin at canonical.com>
 
    ....send patches to get your name here...
diff --git a/server/tests/test-leaks.c b/server/tests/test-leaks.c
index be9fe2d2..53e15ba8 100644
--- a/server/tests/test-leaks.c
+++ b/server/tests/test-leaks.c
@@ -31,6 +31,7 @@
 #include <config.h>
 #include <unistd.h>
 #include <spice.h>
+#include <openssl/ssl.h>
 
 #include "test-glib-compat.h"
 #include "basic-event-loop.h"
@@ -68,6 +69,10 @@ static void server_leaks(void)
     g_assert_cmpint(result, ==, 0);
 
     /* spice_server_add_ssl_client should not leak when it's given a disconnected socket */
+#if (OPENSSL_VERSION_NUMBER >= 0x30000000L)
+    /* Discard the OpenSSL-generated error logs */
+    g_test_expect_message(G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, "*error:*:SSL*");
+#endif
     g_test_expect_message(G_LOG_DOMAIN, G_LOG_LEVEL_WARNING,
                           "*SSL_accept failed*");
     g_assert_cmpint(socketpair(AF_LOCAL, SOCK_STREAM, 0, sv), ==, 0);


More information about the Spice-commits mailing list