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.
This commit is contained in:
Thomas Haller 2023-02-06 11:25:36 +01:00
parent 6dbb215793
commit 1630009234
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -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