tests/network: improve error reporting
Include stdout/stderr of failed command during netvm setup.
This commit is contained in:
parent
10f99e5c4a
commit
ffa1a40e6e
@ -93,8 +93,12 @@ class VmNetworkingMixin(object):
|
|||||||
:type self: qubes.tests.SystemTestCase | VMNetworkingMixin
|
:type self: qubes.tests.SystemTestCase | VMNetworkingMixin
|
||||||
'''
|
'''
|
||||||
def run_netvm_cmd(cmd):
|
def run_netvm_cmd(cmd):
|
||||||
if self.run_cmd(self.testnetvm, cmd) != 0:
|
try:
|
||||||
self.fail("Command '%s' failed" % cmd)
|
self.loop.run_until_complete(
|
||||||
|
self.testnetvm.run_for_stdio(cmd, user='root'))
|
||||||
|
except subprocess.CalledProcessError as e:
|
||||||
|
self.fail("Command '%s' failed: %s%s" %
|
||||||
|
(cmd, e.stdout.decode(), e.stderr.decode()))
|
||||||
|
|
||||||
if not self.testnetvm.is_running():
|
if not self.testnetvm.is_running():
|
||||||
self.loop.run_until_complete(self.testnetvm.start())
|
self.loop.run_until_complete(self.testnetvm.start())
|
||||||
@ -783,8 +787,12 @@ class VmIPv6NetworkingMixin(VmNetworkingMixin):
|
|||||||
super(VmIPv6NetworkingMixin, self).configure_netvm()
|
super(VmIPv6NetworkingMixin, self).configure_netvm()
|
||||||
|
|
||||||
def run_netvm_cmd(cmd):
|
def run_netvm_cmd(cmd):
|
||||||
if self.run_cmd(self.testnetvm, cmd) != 0:
|
try:
|
||||||
self.fail("Command '%s' failed" % cmd)
|
self.loop.run_until_complete(
|
||||||
|
self.testnetvm.run_for_stdio(cmd, user='root'))
|
||||||
|
except subprocess.CalledProcessError as e:
|
||||||
|
self.fail("Command '%s' failed: %s%s" %
|
||||||
|
(cmd, e.stdout.decode(), e.stderr.decode()))
|
||||||
|
|
||||||
run_netvm_cmd("ip addr add {}/128 dev test0".format(self.test_ip6))
|
run_netvm_cmd("ip addr add {}/128 dev test0".format(self.test_ip6))
|
||||||
run_netvm_cmd(
|
run_netvm_cmd(
|
||||||
|
Loading…
Reference in New Issue
Block a user