From patchwork Tue Dec 11 23:26:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 153524 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1205706ljp; Tue, 11 Dec 2018 15:26:47 -0800 (PST) X-Google-Smtp-Source: AFSGD/V8pECRB+lAsOaTF0JUOEe5uaq0Hj+5zqJIEc5JH365VoK0jyQWBDbjX2te69SzfqGg+WA0 X-Received: by 2002:a65:6148:: with SMTP id o8mr16252035pgv.451.1544570807674; Tue, 11 Dec 2018 15:26:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544570807; cv=none; d=google.com; s=arc-20160816; b=ZO1/X70tpVUXkZGHIgq+/kcvD7wONxZ8QymaSL6bFiuVdVoN6KKeuGcz5I/DRRoJwt boma8UeMeM8jSUqj6D48Y4IvkhCimwhtHbDLLgBlncN5K5bHDHohgFYa4bD8Dp+3r/G1 WR8D73eGgaL0qwX5Z1ByZ4cf4bLBsNz8rWAz9LYy56bGcafTbPy/5mTmwRYW15vXyA6s auImZhtM108JLJJy74ZfJSLYto3fXtXjz41jVrfRa/ZE6DesT3Hb21TDVa9u0u8KhJ/u qhTn34NQotGGmpKcNxVwshwC2jrzxmzfQsQJ3FR4U4KSt70CK33VH1AisX1znRR6invZ kjEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to; bh=NX4Fo+IwvKrORakW98d5wMJz/r+extTug582Vh+OyZs=; b=khTcjMVQuINUa/ejK9iq+cT0lkgOnQI+oczl81txdmjvqOinpaOZtVK+YUUN5p/OGr dcAfN4+9YqKrl038SRojC7m1pvB/q765cb8R4Svsxbg1EYc9/5aA6IWbwmXepPM+i96r Q91mrNEmcnwvh1z54d8HtuK4+jpFOjQcWlD9EqP6RdDRt3hrjX64TXRe9E4Jp9BbQnUE QL2Pu3WT81rU/9/EJoBm0AETydu7GIKfoDZGutmzLmx9gVZ7DUMTSoezAENbR/z10ZjF 0tPdy+ubszeR9BnIJLKT793HMdShdId03r2PAMgHqw8EhuF7J/VDFialAkvX4l6Gx7/p 7/cA== 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=qOTNeMRC; 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 r25si14533832pfk.28.2018.12.11.15.26.47; Tue, 11 Dec 2018 15:26:47 -0800 (PST) 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=qOTNeMRC; 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 165.28.230.35.bc.googleusercontent.com (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 0761A6C115; Tue, 11 Dec 2018 23:26:42 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by mail.openembedded.org (Postfix) with ESMTP id C52CA6BCF1 for ; Tue, 11 Dec 2018 23:26:39 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id m1so3324998wml.2 for ; Tue, 11 Dec 2018 15:26:41 -0800 (PST) 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; bh=RaTQVvQubsX5LEiJ3SO6Rx6egUBHzVDtYBxtS8GfyOE=; b=qOTNeMRCW/TpipJVrt//jJNAedImXO5KBGkaZJZ7D7yBMVTltefN6jrmStVcDJV4P9 Ucn9w9DTbzc5W9/FugGLb0JkIbs/UFcXH3/q6u5sWwSAwf4RZL440S+BeWDbVl/1FqVR IL9O/F16fUOL22T7CPP3dh6GsRbvXwxLGSjyO0IRypd3VB9To0IJv7N+EqarvWPGKRND wk0tHBTb8QQ5fW6TbPffSiljHC5v1rOQOh6W32aomNO8isyRYcgob1kFwwSErpvO42GG 70s4447UxiOfbjX2xHKLI0WmVL6Z6jrTAlSiTjGccLCw48nVF8kLNqXrBi+qZ1Ua9Sj4 YJuQ== 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; bh=RaTQVvQubsX5LEiJ3SO6Rx6egUBHzVDtYBxtS8GfyOE=; b=jNh4sUaBwWYGj5gsAPkKVCXJ+OnQaCZEH+SssVozyhxu+ZNB8YxgyEeqSGmTuGH6SW gjN2V0CT+IUO+TJTh/T35V62t1IwVvcm5IXK2QobblPeGUafa+HQBnFC7w4RtV2aLYDH Up5x2KcmtpsjSardD3pdcUKQd/YohSKTP/KKS2b82T5h+Zc0Loq1UhcKnhFt8s347JKZ Se7/8fSB+nJgHPqPr0YJcyteWp3bFeSJW6yA5wUvb16RIv40SCa/+r+ttBcZkmnE5GRY pNBnwxG8tJxjrqMQ4GFvFNYFdoIvXCDP1/XGx9r6WDBaM67+2W6AdNSqsCSxuzzNDIgU f7IQ== X-Gm-Message-State: AA+aEWbAnEQkeF1PUQKcT6K7r0EscUD6Vk7yiwG4z1S4G8g1WCBBBEXp fOHFB5zSbYHU/utMvMhQJDIupescXx0= X-Received: by 2002:a1c:ab87:: with SMTP id u129mr4149340wme.104.1544570799780; Tue, 11 Dec 2018 15:26:39 -0800 (PST) Received: from flashheart.burtonini.com (35.106.2.81.in-addr.arpa. [81.2.106.35]) by smtp.gmail.com with ESMTPSA id v19sm30194595wrd.46.2018.12.11.15.26.38 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Dec 2018 15:26:38 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Date: Tue, 11 Dec 2018 23:26:32 +0000 Message-Id: <20181211232636.13113-1-ross.burton@intel.com> X-Mailer: git-send-email 2.11.0 Subject: [OE-core] [PATCH V2 1/5] oeqa/sdk: clarify ELF assertion message 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: , MIME-Version: 1.0 Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org For example, instead of saying "3 != 62", say "Binary was x86-64 but expected i586". Signed-off-by: Ross Burton --- meta/lib/oeqa/sdk/case.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) -- 2.11.0 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/lib/oeqa/sdk/case.py b/meta/lib/oeqa/sdk/case.py index ea15d6a107e..d8611c8b308 100644 --- a/meta/lib/oeqa/sdk/case.py +++ b/meta/lib/oeqa/sdk/case.py @@ -1,6 +1,7 @@ # Copyright (C) 2016 Intel Corporation # Released under the MIT license (see COPYING.MIT) +import os import subprocess from oeqa.core.case import OETestCase @@ -26,11 +27,13 @@ class OESDKTestCase(OETestCase): return tarball def check_elf(self, path, target_os=None, target_arch=None): + """ + Verify that the ELF binary $path matches the specified target + OS/architecture, or if not specified the currently configured MACHINE's + OS/architecture. + """ import oe.qa, oe.elf - elf = oe.qa.ELFFile(path) - elf.open() - if not target_os or not target_arch: output = self._run("echo $OECORE_TARGET_OS:$OECORE_TARGET_ARCH") target_os, target_arch = output.strip().split(":") @@ -38,7 +41,11 @@ class OESDKTestCase(OETestCase): machine_data = oe.elf.machine_dict(None)[target_os][target_arch] (machine, osabi, abiversion, endian, bits) = machine_data - self.assertEqual(machine, elf.machine()) + elf = oe.qa.ELFFile(path) + elf.open() + + self.assertEqual(machine, elf.machine(), + "Binary was %s but expected %s" % + (oe.qa.elf_machine_to_string(elf.machine()), oe.qa.elf_machine_to_string(machine))) self.assertEqual(bits, elf.abiSize()) self.assertEqual(endian, elf.isLittleEndian()) -