mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-10 03:30:19 +01:00
client/test: allow overriding all environment variables
Set extra variables after the pre-defined ones have been set. This allows overriding then. In particular, this allows overriding DBUS_SESSION_BUS_ADDRESS so that the test can check the behavior of the client is correct when it's set to some garbage.
This commit is contained in:
parent
beebde9e56
commit
9108f8ecfc
1 changed files with 3 additions and 3 deletions
|
|
@ -854,9 +854,6 @@ class TestNmcli(NmTestBase):
|
|||
self.fail("invalid language %s" % (lang))
|
||||
|
||||
env = {}
|
||||
if extra_env is not None:
|
||||
for k, v in extra_env.items():
|
||||
env[k] = v
|
||||
for k in ["LD_LIBRARY_PATH", "DBUS_SESSION_BUS_ADDRESS"]:
|
||||
val = os.environ.get(k, None)
|
||||
if val is not None:
|
||||
|
|
@ -873,6 +870,9 @@ class TestNmcli(NmTestBase):
|
|||
env["NM_TEST_CALLING_NUM"] = str(calling_num)
|
||||
if fatal_warnings is _DEFAULT_ARG or fatal_warnings:
|
||||
env["G_DEBUG"] = "fatal-warnings"
|
||||
if extra_env is not None:
|
||||
for k, v in extra_env.items():
|
||||
env[k] = v
|
||||
|
||||
args = [conf.get(ENV_NM_TEST_CLIENT_NMCLI_PATH)] + list(args)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue