test: print an error when networkctl returns an unexpected EC
If networkctl crashes, like recently with SIGABRT, it returns absolutely no output, which may be confusing during debugging. Help it a little with a short informative message.
This commit is contained in:
parent
2de705cd1c
commit
345997f393
|
@ -420,7 +420,9 @@ DHCP={}
|
||||||
subprocess.call(['ip', 'a', 'show', 'dev', self.iface])
|
subprocess.call(['ip', 'a', 'show', 'dev', self.iface])
|
||||||
print('---- networkctl status {} ----'.format(self.iface))
|
print('---- networkctl status {} ----'.format(self.iface))
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
subprocess.call(['networkctl', 'status', self.iface])
|
rc = subprocess.call(['networkctl', 'status', self.iface])
|
||||||
|
if rc != 0:
|
||||||
|
print("'networkctl status' exited with an unexpected code {}".format(rc))
|
||||||
self.show_journal('systemd-networkd.service')
|
self.show_journal('systemd-networkd.service')
|
||||||
self.print_server_log()
|
self.print_server_log()
|
||||||
raise
|
raise
|
||||||
|
|
Loading…
Reference in a new issue