Comment 1 for bug 1875677

Revision history for this message
Bryce Harrington (bryce) wrote :

Unfortunately the test doesn't indicate why netplan apply failed.

Maybe something like this might give more info?

diff --git a/tests/integration/base.py b/tests/integration/base.py
index 5042bf4..c8902ca 100644
--- a/tests/integration/base.py
+++ b/tests/integration/base.py
@@ -297,7 +297,12 @@ class IntegrationTestsBase(unittest.TestCase):
         '''Generate config, launch and settle NM and networkd'''

         # regenerate netplan config
- out = subprocess.check_output(['netplan', 'apply'], stderr=subprocess.STDOUT, universal_newlines=True)
+ try:
+ out = subprocess.check_output(['netplan', 'apply'], stderr=subprocess.STDOUT, universal_newlines=True)
+ except subprocess.CalledProcessError as e:
+ sys.stderr.write('%d: %s\n' %(e.returncode, e.output))
+ self.fail('could not regenerate netplan config')
+
         if 'Run \'systemctl daemon-reload\' to reload units.' in out:
             self.fail('systemd units changed without reload')
         # start NM so that we can verify that it does not manage anything