summaryrefslogtreecommitdiff
path: root/dev-libs/libgweather/files/40.0-autoskip-network-test.patch
blob: def65382613b546796c14fb8e9c93bd37f9cbee5 (plain)
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
From 1d0ae284635ef1975a581b4d73ab497ccbd4532f Mon Sep 17 00:00:00 2001
From: Mart Raudsepp <leio@gentoo.org>
Date: Sun, 30 Aug 2020 10:35:13 +0300
Subject: [PATCH 2/2] tests: Skip metar tests when METAR_SOURCES couldn't be
 resolved

---
 libgweather/test_libgweather.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libgweather/test_libgweather.c b/libgweather/test_libgweather.c
index ee13dc7b..7ffaac41 100644
--- a/libgweather/test_libgweather.c
+++ b/libgweather/test_libgweather.c
@@ -438,6 +438,11 @@ test_metar_weather_stations (void)
         g_test_message ("SSL/TLS failure, please check your glib-networking installation");
         g_test_failed ();
         return;
+    } else if (msg->status_code == SOUP_STATUS_CANT_RESOLVE) {
+        g_test_skip ("Could not resolve " METAR_SOURCES " - network sandboxed?");
+        g_object_unref (session);
+        g_object_unref (msg);
+        return;
     }
     g_assert_cmpint (msg->status_code, >=, 200);
     g_assert_cmpint (msg->status_code, <, 300);
-- 
2.26.2