From patchwork Wed Oct 9 11:20:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 175616 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp610922ill; Wed, 9 Oct 2019 04:20:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqy2tvNLV5LBQNeIXP32FhQUJSk6RCRcI28bOf+j1g1iR756Ds5vAJlb6ucJNTDSYXl11Eyx X-Received: by 2002:a17:902:a618:: with SMTP id u24mr2607537plq.112.1570620009074; Wed, 09 Oct 2019 04:20:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570620009; cv=none; d=google.com; s=arc-20160816; b=U28fuKN746u4aQ961neOw5iBo13yuaSZcbWf1uR/70mFXfDEOMJOpvTd4pOQLzVqRe I5vt7z7MYDziM6faqnubj8QN5JSbXFxI2QA+y/DRlH9B08zxG3N/Jxzq6Vir223DbEOv HiIQUooAv6wpEn4K+PohWDoikeGv86tqeE3vr1qpPpaw6YDsr7+Vtq5S8WNxilopGeCP NXIdgbtTTnmw1mumCTAAY2ma2/2DHXUYxPtbu+jdA0BvRnVTsM9xLlOOnzxVrVbmF9Av CLJ8Zw8z9R1JIZft8Xw6hmUbnILsmZbi7WdQWifYjADCPPeVTyg7niRccoIuwB1XUIbJ 4Fwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:message-id:date:to:from:dkim-signature:delivered-to; bh=e3hRgD+Ng8JZ0vNlAq4vtyCyJe0lWgmHBZSaru84LtA=; b=QNLAMrnl2uBAhStVsJpCow3WuyRj+WUT+rchl7ZuCcRJQ1Gbdh4uVV+w2F07WtDkGS TDTkUUgWouKwUP6HRsAQJMXv3shZ2RA5CbIaeEyqNr8knJVxgAEj+g3E+9Vt5N18MSV6 HCEXB1x3PTmAiJFcV6aV4JW6CNFKPjQGd5E5vM/Js7T+7Hi1wffCHFeoIc5kCWHSh8z/ KFRA4oyVXiTG9h9FOy3yXtUtAiu2OrU5f7Tki9HWsDEosuShjYTSrFkdw0SDooBXA8gj pnbIvbA5TuY2nbb50KKwMIonNBxmqa3f/DR4DGFlxncQmlVXmYknJxKzMe5JgjpJ/VZW URSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=pBc1y4J1; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id u70si1957805pgu.390.2019.10.09.04.20.08; Wed, 09 Oct 2019 04:20:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=pBc1y4J1; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from ec2-34-214-78-129.us-west-2.compute.amazonaws.com (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id A62D67F4AA; Wed, 9 Oct 2019 11:20:05 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by mail.openembedded.org (Postfix) with ESMTP id A4B2A6C132 for ; Wed, 9 Oct 2019 11:20:04 +0000 (UTC) Received: by mail-wm1-f65.google.com with SMTP id b24so2123659wmj.5 for ; Wed, 09 Oct 2019 04:20:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=UKm0eOXY0XzA5fQqJdld1bqIl6sQwKb5JzaoQSDeSNU=; b=pBc1y4J1fpCl/y7w4xmyIM0sHMITNlhgHh3TdaD57l74javQsHd5alEA/Y1Cfibax+ +lfFnZ3bnc+yCdCc73Ipp9PSDM6B6KiDhzibZO4haGbD0SXGaWTlDwaOaoKk7kR4k//i UqzP/guxyNbjQZ0nLp0s9ml2Ij5Udxq6qcHAqa6fHd1rvTHKMvpWU7tdbDzHL/jahOtX JjsSovRIG+vRV5K6bfRnv/yF+ikewFKx0Y63cQ4uBcIpKLKG21MOiV3m6kvKjVL1IBXn DRkYxrrDku2bP2xrPpAnLtwFOhDu/T/IoEZxJ9cyxNk03nCpHhoPKiF+2KJrGrDwPRA0 kvJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=UKm0eOXY0XzA5fQqJdld1bqIl6sQwKb5JzaoQSDeSNU=; b=gimO9OEIcvQGx/V6OiF0JYHNbj8gjz6pTiT13WzpN+j9sG1iNn8J3d8gzywxNonE8S 3oM1YCjtV6WVrLs0pg0yAu/UTnNZYn8i1wNuQxDUDoKeoTpVdCOS4Ou/Odry3IxQd1xj 0bZmTgCWKgEpEbR+zLu/4FIefTh7hqzygfnacp+Zhha1EM5sWSJ4h3sMxlXj0mp8i0G1 Q7J0LRw76+l56CfCEOBtl0YRfocWeUklZibuN2cU0LGlhS8ZWad5Ws4u2vrD0lCxYfGD 9LmZv+EQQaekCvlZv5yB9L+pjCj0fK0zEjrET7bKoP3jcSRUX/26Ph8uyWdu7rSuVUgL k/OQ== X-Gm-Message-State: APjAAAU77Qdh/FMdJwT9RSdCqKdTZMYg7DuKCbL7wtjNHgycd9CMoub4 RULdn4Zwt7ig44kA7QicX7q596fDK/0= X-Received: by 2002:a1c:f011:: with SMTP id a17mr2154709wmb.18.1570620005042; Wed, 09 Oct 2019 04:20:05 -0700 (PDT) Received: from flashheart.burtonini.com (35.106.2.81.in-addr.arpa. [81.2.106.35]) by smtp.gmail.com with ESMTPSA id n8sm2346579wma.7.2019.10.09.04.20.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2019 04:20:04 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Date: Wed, 9 Oct 2019 12:20:01 +0100 Message-Id: <20191009112001.27050-1-ross.burton@intel.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [OE-core] [PATCH] oeqa/selftest/imagefeatures: improve test_hypervisor_fmts X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org 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 --- meta/lib/oeqa/selftest/cases/imagefeatures.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) -- 2.20.1 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/lib/oeqa/selftest/cases/imagefeatures.py b/meta/lib/oeqa/selftest/cases/imagefeatures.py index 8213d63e375..cf2a42aab5c 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): """