From 5ad712974e6216d178691feaeb4e4b66b4f5d835 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Wed, 3 Sep 2025 16:40:47 +0200 Subject: [PATCH 1/2] test-client: fix quotation in expected message With the newer glib and libc in F42 and Ubuntu devel, the "{left,right} double quotation mark" characters are printed in the output message. The double quotation marks are multi-byte characters and they can't be matched using a character class []. Update the regexp accordingly. --- src/tests/client/test-client.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tests/client/test-client.py b/src/tests/client/test-client.py index 9598aa0751..6220587a9b 100755 --- a/src/tests/client/test-client.py +++ b/src/tests/client/test-client.py @@ -2227,9 +2227,9 @@ class TestNmcli(unittest.TestCase): extra_env=no_dbus_env, replace_stderr=[ Util.ReplaceTextRegex( - # depending on glib version, it prints `%s', '%s', or ā€œ%sā€. - # depending on libc version, it converts unicode to ? or *. - r"Key/Value pair 0, [`*?']invalid[*?'], in address element [`*?']very:invalid[*?'] does not contain an equal sign", + # Depending on glib version, it prints `%s', '%s', or ā€œ%sā€. + # Some libc versions convert the multi-byte UTF-8 sequence to ? or *. + r"Key/Value pair 0, .*invalid.*, in address element .*very:invalid.* does not contain an equal sign", "Key/Value pair 0, 'invalid', in address element 'very:invalid' does not contain an equal sign", ) ], From d559f61423fe9fd26c078acb2bb39b723394296c Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Fri, 5 Sep 2025 14:37:17 +0200 Subject: [PATCH 2/2] libnm-client: fix memory leak The test calls g_main_context_ref() on client_context, which must then be unreferenced. Fixes: 88724ff169a1 ('libnm: add nm_client_wait_shutdown() function for cleaning up NMClient') --- src/libnm-client-impl/tests/test-nm-client.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/libnm-client-impl/tests/test-nm-client.c b/src/libnm-client-impl/tests/test-nm-client.c index 39831509b9..da252549a7 100644 --- a/src/libnm-client-impl/tests/test-nm-client.c +++ b/src/libnm-client-impl/tests/test-nm-client.c @@ -1432,13 +1432,13 @@ test_client_wait_shutdown(void) nmtst_assert_success(dbus_connection, error); for (i_run = 0; i_run < N_RUN; i_run++) { - gs_unref_object GCancellable *init_cancellable = g_cancellable_new(); - gs_unref_object NMClient *nmc = NULL; - nm_auto_pop_gmaincontext GMainContext *client_context = NULL; - gboolean b; - gboolean context_integrated = FALSE; - gs_unref_object GCancellable *cancellable_1 = NULL; - GMainContext *ctx; + gs_unref_object GCancellable *init_cancellable = g_cancellable_new(); + gs_unref_object NMClient *nmc = NULL; + nm_auto_pop_and_unref_gmaincontext GMainContext *client_context = NULL; + gboolean b; + gboolean context_integrated = FALSE; + gs_unref_object GCancellable *cancellable_1 = NULL; + GMainContext *ctx; /* Choose a random context for the client. */ ctx = contexts->pdata[nmtst_get_rand_uint32() % contexts->len];