From 1a9892620e773c10105717ee0301b1813447bb70 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 6 Feb 2023 11:25:36 +0100 Subject: [PATCH] test-client: pass LIBNM_CLIENT_DEBUG to nmcli For debugging libnm, LIBNM_CLIENT_DEBUG can be very useful. As the tests compare stdout/stderr from nmcli with expected output, just enabling it will break the tests. However, in combination with LIBNM_CLIENT_DEBUG_FILE this can be very useful. Preserve and pass on the environment variables, if set. (cherry picked from commit 1630009234b3164225671fb485bd75e92d38c69a) --- src/tests/client/test-client.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/tests/client/test-client.py b/src/tests/client/test-client.py index dd90947b76..2c8f332706 100755 --- a/src/tests/client/test-client.py +++ b/src/tests/client/test-client.py @@ -996,7 +996,12 @@ class TestNmcli(unittest.TestCase): self.fail("invalid language %s" % (lang)) env = {} - for k in ["LD_LIBRARY_PATH", "DBUS_SESSION_BUS_ADDRESS"]: + for k in [ + "LD_LIBRARY_PATH", + "DBUS_SESSION_BUS_ADDRESS", + "LIBNM_CLIENT_DEBUG", + "LIBNM_CLIENT_DEBUG_FILE", + ]: val = os.environ.get(k, None) if val is not None: env[k] = val