File: test-Avoid-warning-messages.patch

package info (click to toggle)
libgovirt 0.3.9-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 912 kB
  • sloc: ansic: 7,203; xml: 86; makefile: 5
file content (44 lines) | stat: -rw-r--r-- 1,897 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
From: "Eduardo Lima (Etrunko)" <eblima@gmail.com>
Date: Tue, 15 Apr 2025 16:04:43 -0300
Subject: test: Avoid warning messages

GLib-DEBUG: setenv()/putenv() are not thread-safe and should not be used after threads are createdg_setenv
GLib-DEBUG: unsetenv() is not thread-safe and should not be used after threads are created
(cherry picked from commit 81f79e4142a5c2de8ec39d4d40cb238e94b092a7)

Origin: upstream
---
 tests/test-govirt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/test-govirt.c b/tests/test-govirt.c
index 0f3a1ba..2bb07d7 100644
--- a/tests/test-govirt.c
+++ b/tests/test-govirt.c
@@ -56,11 +56,11 @@ static void test_govirt_https_ca(void)
              https://gitlab.gnome.org/GNOME/librest/-/merge_requests/28
     */
     return;
+    g_setenv("GOVIRT_NO_SSL_STRICT", "1", TRUE);
     httpd = govirt_mock_httpd_new(GOVIRT_HTTPS_PORT);
     govirt_mock_httpd_add_request(httpd, "GET", "/ovirt-engine/api", "<api></api>");
     govirt_mock_httpd_start(httpd);
 
-    g_setenv("GOVIRT_NO_SSL_STRICT", "1", TRUE);
     g_test_expect_message("libgovirt", G_LOG_LEVEL_WARNING,
                           "Disabling strict checking of SSL certificates");
     g_test_expect_message("libgovirt", G_LOG_LEVEL_CRITICAL,
@@ -105,12 +105,12 @@ static void test_govirt_http(void)
     GError *error = NULL;
     GovirtMockHttpd *httpd;
 
+    g_setenv("GOVIRT_DISABLE_HTTPS", "1", TRUE);
     httpd = govirt_mock_httpd_new(GOVIRT_HTTPS_PORT);
     govirt_mock_httpd_disable_tls(httpd, TRUE);
     govirt_mock_httpd_add_request(httpd, "GET", "/ovirt-engine/api", "<api></api>");
     govirt_mock_httpd_start(httpd);
 
-    g_setenv("GOVIRT_DISABLE_HTTPS", "1", TRUE);
     g_test_expect_message("libgovirt", G_LOG_LEVEL_WARNING,
                           "Using plain text HTTP connection");
     g_test_expect_message("libgovirt", G_LOG_LEVEL_CRITICAL,