1
0
forked from cockpit/cockpit
cockpit/0001-test-handle-XDG_CONFIG_DIRS.patch
Klaus Kämpf 55b44b2d8a Accepting request 791691 from home:lnussel:branches:systemsmanagement:cockpit
- new version 215

Note even though the diff might look wild it's actually synced up with
upstream. I sent most changes there and they were accepted.

License string and libpwquality change are still pending approval, the test has
been merged.
What's left is this:
ae413cf9cf

OBS-URL: https://build.opensuse.org/request/show/791691
OBS-URL: https://build.opensuse.org/package/show/systemsmanagement:cockpit/cockpit?expand=0&rev=26
2020-04-15 08:21:19 +00:00

42 lines
1.4 KiB
Diff

From 0f38a3a889b71351dae831d017958bec955daaaa Mon Sep 17 00:00:00 2001
From: Ludwig Nussel <ludwig.nussel@suse.de>
Date: Thu, 26 Mar 2020 18:12:07 +0100
Subject: [PATCH] test: handle XDG_CONFIG_DIRS
Previously the test would fail in an environment where XDG_CONFIG_DIRS
was set as it takes precedence over the built in defaults. So let's just
set XDG_CONFIG_DIRS and test that feature instead.
---
src/common/test-config.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/common/test-config.c b/src/common/test-config.c
index cf5b8746b..4b5153153 100644
--- a/src/common/test-config.c
+++ b/src/common/test-config.c
@@ -27,7 +27,6 @@
/* Mock override cockpitconf.c */
extern const gchar *cockpit_config_file;
-extern const gchar *cockpit_config_dirs[];
static void
test_get_strings (void)
@@ -134,11 +133,11 @@ test_get_strvs (void)
static void
test_load_dir (void)
{
- cockpit_config_dirs[0] = SRCDIR "/src/ws/mock-config";
+ g_setenv("XDG_CONFIG_DIRS", "/does-not-exist:" SRCDIR "/src/ws/mock-config", 1);
cockpit_config_file = "cockpit.conf";
g_assert_cmpstr (cockpit_conf_string ("Section2", "value1"), ==, "string");
- g_assert_cmpstr (cockpit_conf_get_dirs ()[0], ==, SRCDIR "/src/ws/mock-config");
+ g_assert_cmpstr (cockpit_conf_get_dirs ()[1], ==, SRCDIR "/src/ws/mock-config");
cockpit_conf_cleanup ();
}
--
2.16.4