diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2018-10-25 14:23:55 +0200 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2018-10-25 14:25:30 +0200 |
commit | fbc75e1ac02a6f3bc9fee37dc24ec49fae4ef926 (patch) | |
tree | f5e743581fc0d941421f5dc17ffbf42844e6141f /clients/tests/test-client.py | |
parent | ef5ada1d1d53b04a468dc44838afb459f85e95e7 (diff) | |
download | NetworkManager-bg/cli-test-debug.tar.gz |
clients: print additional information on failurebg/cli-test-debug
Diffstat (limited to 'clients/tests/test-client.py')
-rwxr-xr-x | clients/tests/test-client.py | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/clients/tests/test-client.py b/clients/tests/test-client.py index e8f1f7f2e7..f83c501524 100755 --- a/clients/tests/test-client.py +++ b/clients/tests/test-client.py @@ -711,9 +711,6 @@ class TestNmcli(NmTestBase): self.async_wait() - self.srv.shutdown() - self.srv = None - self._calling_num = None results = self._results @@ -748,6 +745,22 @@ class TestNmcli(NmTestBase): print("EXPECT OUTPUT:\n[[%s]]\n" % (n['content'])) print("Let the test write the file by rerunning with NM_TEST_REGENERATE=1") print("See howto in %s for details.\n" % (PathConfiguration.canonical_script_filename())) + + env = {} + for k in ['LD_LIBRARY_PATH', + 'DBUS_SESSION_BUS_ADDRESS']: + val = os.environ.get(k, None) + if val is not None: + env[k] = val + env['LIBNM_USE_SESSION_BUS'] = '1' + env['LIBNM_USE_NO_UDEV'] = '1' + env['TERM'] = 'linux' + env['XDG_CONFIG_HOME'] = PathConfiguration.srcdir() + print("######## DEVICES ########") + print("%s" % subprocess.check_output([conf.get(ENV_NM_TEST_CLIENT_NMCLI_PATH), 'device', 'show'], env = env)) + print("#########################") + sys.stdout.flush() + self.fail("Unexpected output of command, expected %s. Rerun test with NM_TEST_REGENERATE=1 to regenerate files" % (filename)) if len(results_expect) != len(results): if not regenerate: @@ -760,6 +773,9 @@ class TestNmcli(NmTestBase): print("See howto in %s for details.\n" % (PathConfiguration.canonical_script_filename())) self.fail("Unexpected output of command, expected %s. Rerun test with NM_TEST_REGENERATE=1 to regenerate files" % (filename)) + self.srv.shutdown() + self.srv = None + if regenerate: content_new = ''.join([r['content'] for r in results]) if content_new != content_expect: |