tests: show journal on systemd-resolved.service failures (#5297)

In networkd-test.py, show resolved's journal on failure, to debug issues
like https://github.com/systemd/systemd/pull/5283.
This commit is contained in:
Martin Pitt 2017-02-10 03:30:44 +01:00 committed by Zbigniew Jędrzejewski-Szmek
parent 7961116e2c
commit d26fdaa236
1 changed files with 5 additions and 1 deletions

View File

@ -201,7 +201,11 @@ class ClientTestBase(NetworkdTestingUtilities):
def do_test(self, coldplug=True, ipv6=False, extra_opts='',
online_timeout=10, dhcp_mode='yes'):
subprocess.check_call(['systemctl', 'start', 'systemd-resolved'])
try:
subprocess.check_call(['systemctl', 'start', 'systemd-resolved'])
except subprocess.CalledProcessError:
self.show_journal('systemd-resolved.service')
raise
self.write_network(self.config, '''\
[Match]
Name=%s