summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2019-10-09 12:00:51 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-10-09 14:02:56 +0100
commit6a710ad0b445295991b17545f634684f4f317099 (patch)
tree796f0da868747ebd7fd33af6fc5785770c0a7254 /meta
parentc75707bbd24552e72ae2e564c0d6f72823b63b8c (diff)
downloadopenembedded-core-6a710ad0b445295991b17545f634684f4f317099.tar.gz
openembedded-core-6a710ad0b445295991b17545f634684f4f317099.tar.bz2
openembedded-core-6a710ad0b445295991b17545f634684f4f317099.zip
oeqa/selftest/imagefeatures: improve test_hypervisor_fmts
If this test fails then the output doesn't help in any meaningful way, so improve the test to output the unparsable JSON and display unexpected output. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oeqa/selftest/cases/imagefeatures.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/meta/lib/oeqa/selftest/cases/imagefeatures.py b/meta/lib/oeqa/selftest/cases/imagefeatures.py
index 8213d63e37..cf2a42aab5 100644
--- a/meta/lib/oeqa/selftest/cases/imagefeatures.py
+++ b/meta/lib/oeqa/selftest/cases/imagefeatures.py
@@ -161,8 +161,12 @@ class ImageFeatures(OESelftestTestCase):
sysroot = get_bb_var('STAGING_DIR_NATIVE', 'core-image-minimal')
result = runCmd('qemu-img info --output json %s' % image_path,
native_sysroot=sysroot)
- self.assertTrue(json.loads(result.output).get('format') == itype,
- msg="Could not parse '%s'" % result.output)
+ try:
+ data = json.loads(result.output)
+ self.assertEqual(data.get('format'), itype,
+ msg="Unexpected format in '%s'" % (result.output))
+ except json.decoder.JSONDecodeError:
+ self.fail("Could not parse '%ss'" % result.output)
def test_long_chain_conversion(self):
"""