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()) - From patchwork Tue Dec 11 23:26:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 153525 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1206329ljp; Tue, 11 Dec 2018 15:27:40 -0800 (PST) X-Google-Smtp-Source: AFSGD/VZ6Ydjjg9NWj2Vfg1RPULJttzMHfJ+eolCBIfeKu8LCupmcfbG71pSwE+JP/msJKQCYC+J X-Received: by 2002:a63:40c6:: with SMTP id n189mr16021384pga.355.1544570860100; Tue, 11 Dec 2018 15:27:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544570860; cv=none; d=google.com; s=arc-20160816; b=FFMitAoW0JDMh+PsnaQ27v2cXv+EhDIWYQgR3+Y/JCyg5tY+TwiSpHHe/V2YCnGjda u1NqooHJ3AHsUTHQ4efzhyUsCQ5GwT8AlAscdwSTrE6xoUXFsgdpAg79SbUbNWdXl7Yl O4NqJU19rRrfGtGAMoUthCX+wRZv456I++8eVISZBL+RV9FwWaxSgvt8cok0jpgRK9kT 4HXLj0Ax2m6ytrQ1o8w4TdHQzOmzViCTRJUnf+PFN8mQ5PD3U7QrwbcMMVj+6Ou+Jv1t hE+bQX3xqa0Y01nFJ2+fk/Jcz7MsyBVgPCMuulfUrxGopStpWTlz/lmUUrL9NDTTW+xn B1Uw== 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:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=InY5+4bwJCdhVcgsEAZZNQh3EMtNwye9hE+wh42CfzE=; b=CqE23TtxYGzRaNU9+w1mD9qBCAaAaUqax+YRz5GaLjwsn2o5SrV+T6hetxwPuwWjJS stMo0ueS7msZHTQBNnpO3tYRN1mdvQrlT2DWCSEkDglT4gDP8v63w3Hob0I/OFeOJ9EN 4mGL84kl4BelYzRtf/jNJDA39xHtXSB/Ju3hj5NMf2TWSHYkBVG9nSEaCt7TdTEOqBTn b5FwGV9UiNO29f8Li6xox61u9mUxloPuCFpGYysQPmuAbWDccT97R0UZaP41v2XB0JJk Bm5oKFCNfOKBx6s/TrkWs7/mbeHqb2SUvdgCv+EMDMmj/jxBZvuXWJuhCQUipIke1fa/ lZKw== 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=dLC5nCCv; 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 n12si13100286pgb.563.2018.12.11.15.27.39; Tue, 11 Dec 2018 15:27:40 -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=dLC5nCCv; 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 A8BB46C125; Tue, 11 Dec 2018 23:27:37 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by mail.openembedded.org (Postfix) with ESMTP id 5E66D6BCF1 for ; Tue, 11 Dec 2018 23:26:40 +0000 (UTC) Received: by mail-wr1-f45.google.com with SMTP id q18so15820703wrx.9 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:in-reply-to:references; bh=Uk0hzf4sFMOXl6ZviEkCfUe30w8Nz2BlsIjxfEbkUys=; b=dLC5nCCvvX6PM1l5SEoTiYJHNW+rKR3upHd6Hu2tVa89LJqD9SEzRht8zXKA3NBMVj OGp/1YAngplF0V11xnGRaRjjHtcvGVbqB6f4oPKbJYCEc7CMkV9EDADhkVbqneMBp0fr jDdL+ZYAHR5fip7/8XucoVwGevXS931EiJrriAsMq3Hv8FBCJ2xrPlDl/PyJsGS+wW+2 OiwVa6tGpocLm7cFTGN4G5LUOVNlZVrs+O37U03ug8Vnr5zTuXETSIZXcZrqu1fco6yT tBFHN2wJ4nqOpZ8JlAV+Hvo9tT4Jaxu1w75VTHAzbb3+OqeC22HYT2Ekt0xtRBDCy0IQ 5OfA== 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:in-reply-to :references; bh=Uk0hzf4sFMOXl6ZviEkCfUe30w8Nz2BlsIjxfEbkUys=; b=bwmY/22oeFcuXGZqVGO2kqklvftUgN9eFtNPHc0x9gIWTfVoYiJ0obs3/tOFQk3MFr gsF0GRZm38eiqnuCC3pNbBwl0qfasxxVqzJldVS3p6VaaUxmInnO+RpjYWAk04W2/BFw +tCOoeGNsY0jUC2NNyRnvfIf0C9buZFBbSUpEcXzTdTQbRdEP44nPLXAOZ7mlyNTIm1S LtKK4nHS7pD8dvN8+H5QlpYURg1Z1TOgY6YjayLQgPKokxIcDVH2MF9kJTwC7AaCJsCG Xq1CUyV2FqTXwqcPDRRD1MIFBjleIlKYGlSG377625/R692gfMLtkOafAeBb2vxZ1spP MRew== X-Gm-Message-State: AA+aEWaD91lY1fKU4YjbRUgeGexDIDjL9WWgDsjC7Xf3amKUjXcFQgZ0 cwjI/J7mtFpwQBwGF6VMzkwGz5vvQO4= X-Received: by 2002:adf:fb0d:: with SMTP id c13mr16589745wrr.285.1544570800782; Tue, 11 Dec 2018 15:26:40 -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.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Dec 2018 15:26:40 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Date: Tue, 11 Dec 2018 23:26:33 +0000 Message-Id: <20181211232636.13113-2-ross.burton@intel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181211232636.13113-1-ross.burton@intel.com> References: <20181211232636.13113-1-ross.burton@intel.com> Subject: [OE-core] [PATCH V2 2/5] oeqa/sdk: show output if run() fails 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 Use oeqa.utils.subprocesstweak to monkey-patch the subprocess exception so that any output is shown, and remove any explicit try/catch handling that would have hidden this. Signed-off-by: Ross Burton --- meta/lib/oeqa/sdk/cases/buildcpio.py | 3 +++ meta/lib/oeqa/sdk/cases/buildlzip.py | 2 ++ meta/lib/oeqa/sdk/cases/gcc.py | 3 +++ meta/lib/oeqa/sdk/cases/perl.py | 12 ++++++------ meta/lib/oeqa/sdk/cases/python.py | 21 +++++++++------------ meta/lib/oeqa/sdkext/cases/devtool.py | 3 +++ 6 files changed, 26 insertions(+), 18 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/cases/buildcpio.py b/meta/lib/oeqa/sdk/cases/buildcpio.py index f348ac5d909..6697b12de29 100644 --- a/meta/lib/oeqa/sdk/cases/buildcpio.py +++ b/meta/lib/oeqa/sdk/cases/buildcpio.py @@ -2,6 +2,9 @@ import unittest from oeqa.sdk.case import OESDKTestCase from oeqa.sdk.utils.sdkbuildproject import SDKBuildProject +from oeqa.utils.subprocesstweak import errors_have_output +errors_have_output() + class BuildCpioTest(OESDKTestCase): td_vars = ['DATETIME'] diff --git a/meta/lib/oeqa/sdk/cases/buildlzip.py b/meta/lib/oeqa/sdk/cases/buildlzip.py index 9d137f30ebf..b57fbbece7f 100644 --- a/meta/lib/oeqa/sdk/cases/buildlzip.py +++ b/meta/lib/oeqa/sdk/cases/buildlzip.py @@ -2,6 +2,8 @@ import unittest from oeqa.sdk.case import OESDKTestCase from oeqa.sdk.utils.sdkbuildproject import SDKBuildProject +from oeqa.utils.subprocesstweak import errors_have_output +errors_have_output() class BuildLzipTest(OESDKTestCase): td_vars = ['DATETIME'] diff --git a/meta/lib/oeqa/sdk/cases/gcc.py b/meta/lib/oeqa/sdk/cases/gcc.py index b32b01fc241..54c6fc488bc 100644 --- a/meta/lib/oeqa/sdk/cases/gcc.py +++ b/meta/lib/oeqa/sdk/cases/gcc.py @@ -5,6 +5,9 @@ import unittest from oeqa.core.utils.path import remove_safe from oeqa.sdk.case import OESDKTestCase +from oeqa.utils.subprocesstweak import errors_have_output +errors_have_output() + class GccCompileTest(OESDKTestCase): td_vars = ['MACHINE'] diff --git a/meta/lib/oeqa/sdk/cases/perl.py b/meta/lib/oeqa/sdk/cases/perl.py index e1d2bc159a0..b8adc5ac72d 100644 --- a/meta/lib/oeqa/sdk/cases/perl.py +++ b/meta/lib/oeqa/sdk/cases/perl.py @@ -1,6 +1,9 @@ import unittest from oeqa.sdk.case import OESDKTestCase +from oeqa.utils.subprocesstweak import errors_have_output +errors_have_output() + class PerlTest(OESDKTestCase): def setUp(self): if not (self.tc.hasHostPackage("nativesdk-perl") or @@ -8,9 +11,6 @@ class PerlTest(OESDKTestCase): raise unittest.SkipTest("No perl package in the SDK") def test_perl(self): - try: - cmd = "perl -e '$_=\"Uryyb, jbeyq\"; tr/a-zA-Z/n-za-mN-ZA-M/;print'" - output = self._run(cmd) - self.assertEqual(output, "Hello, world") - except subprocess.CalledProcessError as e: - self.fail("Unexpected exit %d (output %s)" % (e.returncode, e.output)) + cmd = "perl -e '$_=\"Uryyb, jbeyq\"; tr/a-zA-Z/n-za-mN-ZA-M/;print'" + output = self._run(cmd) + self.assertEqual(output, "Hello, world") diff --git a/meta/lib/oeqa/sdk/cases/python.py b/meta/lib/oeqa/sdk/cases/python.py index 2254867d455..b9174fadbaa 100644 --- a/meta/lib/oeqa/sdk/cases/python.py +++ b/meta/lib/oeqa/sdk/cases/python.py @@ -1,6 +1,9 @@ import subprocess, unittest from oeqa.sdk.case import OESDKTestCase +from oeqa.utils.subprocesstweak import errors_have_output +errors_have_output() + class Python2Test(OESDKTestCase): def setUp(self): if not (self.tc.hasHostPackage("nativesdk-python-core") or @@ -8,12 +11,9 @@ class Python2Test(OESDKTestCase): raise unittest.SkipTest("No python package in the SDK") def test_python2(self): - try: - cmd = "python -c \"import codecs; print(codecs.encode('Uryyb, jbeyq', 'rot13'))\"" - output = self._run(cmd) - self.assertEqual(output, "Hello, world\n") - except subprocess.CalledProcessError as e: - self.fail("Unexpected exit %d (output %s)" % (e.returncode, e.output)) + cmd = "python -c \"import codecs; print(codecs.encode('Uryyb, jbeyq', 'rot13'))\"" + output = self._run(cmd) + self.assertEqual(output, "Hello, world\n") class Python3Test(OESDKTestCase): def setUp(self): @@ -22,9 +22,6 @@ class Python3Test(OESDKTestCase): raise unittest.SkipTest("No python3 package in the SDK") def test_python3(self): - try: - cmd = "python3 -c \"import codecs; print(codecs.encode('Uryyb, jbeyq', 'rot13'))\"" - output = self._run(cmd) - self.assertEqual(output, "Hello, world\n") - except subprocess.CalledProcessError as e: - self.fail("Unexpected exit %d (output %s)" % (e.returncode, e.output)) + cmd = "python3 -c \"import codecs; print(codecs.encode('Uryyb, jbeyq', 'rot13'))\"" + output = self._run(cmd) + self.assertEqual(output, "Hello, world\n") diff --git a/meta/lib/oeqa/sdkext/cases/devtool.py b/meta/lib/oeqa/sdkext/cases/devtool.py index 0860e8d17cf..d322f86c73e 100644 --- a/meta/lib/oeqa/sdkext/cases/devtool.py +++ b/meta/lib/oeqa/sdkext/cases/devtool.py @@ -9,6 +9,9 @@ from oeqa.sdkext.case import OESDKExtTestCase from oeqa.core.decorator.oeid import OETestID from oeqa.utils.httpserver import HTTPService +from oeqa.utils.subprocesstweak import errors_have_output +errors_have_output() + class DevtoolTest(OESDKExtTestCase): @classmethod def setUpClass(cls): From patchwork Tue Dec 11 23:26:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 153526 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1206539ljp; Tue, 11 Dec 2018 15:28:00 -0800 (PST) X-Google-Smtp-Source: AFSGD/XiC2Atsbhl0xx3WpdNMFU2ELxre+M1r8cmdheNcqTqB7JLLE7uC0po57uI1Kc5ZbuR+RDg X-Received: by 2002:a62:9683:: with SMTP id s3mr18046719pfk.60.1544570879962; Tue, 11 Dec 2018 15:27:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544570879; cv=none; d=google.com; s=arc-20160816; b=MZlI9Hd3OzLhtDkVafOFl3BYj67v9ki8Qc2LXEWjD3otX9twkb6gHSv8MBbiC03TlQ R0mZKZg+p/oWBFV3gdfS3/vmUieP7T0i8kP61eBhxLn8+PHpH6SNTjzS+xgEmnNEv5vA xXv/VbP9kDChebBDu8diASRhsZrJsrMi3qyfLWIdpLoNYHulwOx0qo93hR4pFarYJB7O uMtAyUcspy6dWTSmzJDO0ctTGLiQiYaCtEDVXBHHYkI2GPhmY3BV9H0FXhecuBDjQ1Cd O+mLELbwbbXpGXunPQjUkm21N97aPPDPqJGqo2b/5SxS1vMoVMRp4oNS4E1xkrDoBxH+ Tq9Q== 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:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=tL6/MAjq+B3eQ9KQ0QC54Ff1vTyWtEMsFBUXZr5VK9A=; b=zw7Qq0+XuwvJG9vkBkXhfdkp38Hg+h0e9T6k5eA1JjpeAIS2t4rb2/NSGe5zv+hWyx Fb7wGI/AWys+qrU8TJv7O34Pg+GH9NdquxfdDdDZ1kKl3VNA/eiX23xLcVIu3Xdu9AJ/ 4FWB5BhHfJpa+5GThm2pXqZXXXZ/bo+DvR4Lzc4o27VVYYB8fjhQNH/NjIdgh/akMKJB 2FXtDtjbaSYlIG/pgGpMES5z1618oy4WKm7+0Jhbd3wJVCIGcVTfp46+J/XDuKTeBo+9 nroxVi/SnPW7pkJdqcWMk0cRMjwGJTS/OLWPGWPCk/LzX3T/3wqcJk2NTc6Hvy8r7J6t DUEw== 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=Y2Z1qsH4; 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 4si13885285pff.161.2018.12.11.15.27.59; Tue, 11 Dec 2018 15:27:59 -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=Y2Z1qsH4; 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 22CD36C182; Tue, 11 Dec 2018 23:27:57 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by mail.openembedded.org (Postfix) with ESMTP id 3CC266BCF1 for ; Tue, 11 Dec 2018 23:26:41 +0000 (UTC) Received: by mail-wm1-f66.google.com with SMTP id r24so10109121wmh.0 for ; Tue, 11 Dec 2018 15:26:42 -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:in-reply-to:references; bh=VCelXHrq6lZGOrSR7xhDGTo8ylf2XB9Pl3LZT09GkSg=; b=Y2Z1qsH4sqjFxR7q0/yScOb/npXZNBYHL67k5svFKz5bfy5kr/6U6yRF82Roq9RcDU 7w6wIPbdo4DyLGQ6Mh/dxZY7O9kIX/DpD8EUmBLKfqBEW0yAQ/gv4hnXWfhUVGyONaDH pTDzXItPIeT6BabfJcwFdIBLyMsDRQavkCiMISqfj2NY9sZSOU51zQAowaMzOrOYYTFw LYa6+oT5K5nD9sx8BuFpGSHs5MGZPusmgUce/TFB0rYVTefKiKIl5XYkZL3FMGMQC9Tn KZibqsKfuAXh/pTC8/03VtINFqlWfDDLQ6SpbrrjdtC8kJ0E58RPmqwAQWAFsoZiY7WF xtuw== 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:in-reply-to :references; bh=VCelXHrq6lZGOrSR7xhDGTo8ylf2XB9Pl3LZT09GkSg=; b=IiwSMOTi9V4KTA1ZaLtfxlLFJp86cBK4dDLoRTmZlxWBzg3D3h8xUm18C9cEou+zpT 5s6IhCbXN15dEKHXFt4yp5dhL/C1jlBDIy3BpkHrgoDg9A+Mhy4cc2gKuKD0/GLlc/9z hph/aEICyZhzjBby6s6Cj5qyjg6F/Hk/iGhtq2YBFgdaxSb8F/MkDFBCWCfvtFRDQk6+ eWehuS/xQnfk0tnISvVfRQIGw9qwmdaS4Nb7/AC7MA5y5xotKN5TfXsbT4eu7DsiBuY9 px1RVSBwq6WluWqYKV5xpSiy6da3qd8is45/0RNsHR+zaclYOuJfbvMhjQ8BD+r1svs1 mJFw== X-Gm-Message-State: AA+aEWaDUbATCQ8hnmZs9oEsgpzCY5oIl75JNx+8LneL+OdlAPOF4ETc A7jpOZP1GfH/Tq70I+n5+myI1fqg1/k= X-Received: by 2002:a1c:b1d5:: with SMTP id a204mr4420412wmf.32.1544570801748; Tue, 11 Dec 2018 15:26:41 -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.40 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Dec 2018 15:26:41 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Date: Tue, 11 Dec 2018 23:26:34 +0000 Message-Id: <20181211232636.13113-3-ross.burton@intel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181211232636.13113-1-ross.burton@intel.com> References: <20181211232636.13113-1-ross.burton@intel.com> Subject: [OE-core] [PATCH V2 3/5] oeqa/sdk: clean up galculator test 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 Drop redundant imports and variables, and use os.makedirs() instead of bb.utils.mkdirhier(). Signed-off-by: Ross Burton --- meta/lib/oeqa/sdk/cases/buildgalculator.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 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/cases/buildgalculator.py b/meta/lib/oeqa/sdk/cases/buildgalculator.py index 7beb55884d3..164a695637a 100644 --- a/meta/lib/oeqa/sdk/cases/buildgalculator.py +++ b/meta/lib/oeqa/sdk/cases/buildgalculator.py @@ -3,17 +3,14 @@ import subprocess import tempfile import unittest -import bb - from oeqa.sdk.case import OESDKTestCase -from oeqa.sdk.utils.sdkbuildproject import SDKBuildProject - from oeqa.utils.subprocesstweak import errors_have_output errors_have_output() class GalculatorTest(OESDKTestCase): - td_vars = ['DATETIME'] - + """ + Test that autotools and GTK+ 3 compiles correctly. + """ def setUp(self): if not (self.tc.hasTargetPackage("gtk+3", multilib=True) or \ self.tc.hasTargetPackage("libgtk-3.0", multilib=True)): @@ -33,8 +30,8 @@ class GalculatorTest(OESDKTestCase): subprocess.check_output(["tar", "xf", tarball, "-C", testdir]) self.assertTrue(os.path.isdir(dirs["source"])) + os.makedirs(dirs["build"]) - bb.utils.mkdirhier(dirs["build"]) self._run("cd {source} && autoreconf -i -f -I $OECORE_TARGET_SYSROOT/usr/share/aclocal -I m4".format(**dirs)) self._run("cd {build} && {source}/configure $CONFIGURE_FLAGS".format(**dirs)) self._run("cd {build} && make -j".format(**dirs)) From patchwork Tue Dec 11 23:26:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 153527 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1206720ljp; Tue, 11 Dec 2018 15:28:19 -0800 (PST) X-Google-Smtp-Source: AFSGD/U6XzlRaKo1kSTMlUrWhlbXYUI3yojWyt7ZjOq1Lx8kf8/aYh9IRx7A63CtSE8xa9KAhnSB X-Received: by 2002:a63:3204:: with SMTP id y4mr16259656pgy.41.1544570899772; Tue, 11 Dec 2018 15:28:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544570899; cv=none; d=google.com; s=arc-20160816; b=cU9egRGU8m2dcC1eMRxRDT8XdLSzat0uwrohcur9I/M4P5HhYWMm7KueYDguFi6J5L 65QzX98Elyc2bjQtrYsqAGEIAHEmQZs7g2X0HCA5oMZqreeMBe1EHz9qJo6eStB86giv BQY5RJr6T/Ub5H6AibFs4ygRxJj/a42dxoH4Vm5JG7moufHN/Kr3poD6Sf1KpwOqWpBp SlDy6lMMPMzFw8+tWZLOpeY2MlT/rVu7i/kXqiaYPBtpxdQkczPY2G5BVASrEGqrjYOa n8pJ1wWcJH4wQQNX3Sc6MHeX/oAFxfmblInexT8jTTYzNP3wwAgiu0YpR2QOtPgORa2f WT+g== 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:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=aqyur7+dJI1Gj84otJaokJhHG+agpX8eu1W8zEqMMzw=; b=BbQrniCbAdJ4a68cmFLkSJeOPwGLGhrPah0wW749kiZtzEYYPoih1HSyt4mb2qLCAs j7/CQgxvckG5GzhdwaOIiXIP/ZujeSW8tXf0oAOmMpnT7LIjDGLtOTVL1RAFA/fpS9to qA/nU2IEqnKaZqbaYbVRjNHqztoUvDzYHsTYM/GexfbEiq91thdtZyPCLaiUE3Hdnb92 uLzES2NcSwDscDdihiPuUwOIBfCfAVIWGp5uSWaRMqhr4wX0oTb9BdYjud8sGMFBstih BSxyYTWEeD89ffpdl85w4uaGUXgs9TiqESWZ2ZDI6SObvWt/QdhuJgP2aSHyftiq3XxG tmHw== 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=kQwDG9u2; 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 b19si14715575pfm.100.2018.12.11.15.28.19; Tue, 11 Dec 2018 15:28:19 -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=kQwDG9u2; 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 EFCEC6C18F; Tue, 11 Dec 2018 23:28:16 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by mail.openembedded.org (Postfix) with ESMTP id 5DB236C0F7 for ; Tue, 11 Dec 2018 23:26:42 +0000 (UTC) Received: by mail-wr1-f48.google.com with SMTP id q18so15820752wrx.9 for ; Tue, 11 Dec 2018 15:26:43 -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:in-reply-to:references; bh=131YgH5X4083V741S8XiGMuKKimZFWkENgnuMu1MYTM=; b=kQwDG9u2wrxj4jYhwvUXBz08I8ZhmycWJ6LK4ZGPzMaoXtX1XUHv2kU1asLYoUzUi7 tUTWGw0YcWkNBvixxWJ8TPn0VaIObo1aMyHv1VUFKnQB4zc5Ieq6Ci6qLsYjz462C7K8 uyTBw+vPfeNKpqf+w6NMOIwPZwo8TxxVXxwmK8MPEf11cw2AGJ+PZ7OsJT3pAOx2az0s JQAGj4jryJv9BwbN3HQvwYTLuiSuRBFwnpjWlpX8i83m24kifs6QSfR3dNse2nwLH3sH tDHY6sqpOI+h3nQsMBa1IugQvK6yJHw0BT9Ym7MPhozEO4IyZZqFG0Q7Nc9pLSoGao9V BJxg== 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:in-reply-to :references; bh=131YgH5X4083V741S8XiGMuKKimZFWkENgnuMu1MYTM=; b=W6Cm6JbSxKbQX/i4ga69x3jZVEUHkG7eAuDom1RdCLYwJtS67r8sWia/6vBhfw/nb+ S1SDTMaZZ8/DQ37B0W/GkWmZtZ6s2j8q73JpGee9O8xOiCe3LCqFFpkniX1ZnkZKupvP Kp2alWGT7z15MA0aJ7LTfVGiSxvKk+9gXEYBgIivFfzNJoiPReBxG7963j0/KBhPWmoY 1mBHo9HIod/e2xxDgDYNWC6pHCzYT2P/kq52RxWQ14LCiyhGHAHqMje4tUfPS8NIMl9v 6sdHLZleClWZ/3Q4VXCkYAtFEhNQZQ0p1dZH9qALBFELJBQXlZFj224eiJQCTAdQr2y6 4gVw== X-Gm-Message-State: AA+aEWbYRh7EdwXuMfbv2H2Z5yNpZEq35ScF5YV9VzwYI1Fl02do2Ww4 mN+eT4y8N8dkshdQP9dEPHEoCREXy2w= X-Received: by 2002:adf:ea11:: with SMTP id q17mr14600302wrm.328.1544570802858; Tue, 11 Dec 2018 15:26:42 -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.41 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Dec 2018 15:26:42 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Date: Tue, 11 Dec 2018 23:26:35 +0000 Message-Id: <20181211232636.13113-4-ross.burton@intel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181211232636.13113-1-ross.burton@intel.com> References: <20181211232636.13113-1-ross.burton@intel.com> Subject: [OE-core] [PATCH V2 4/5] oeqa/sdk: rewrite lzip test 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 Don't use the helper class as it gets in the way more than it helps, exercise the out-of-tree paths, and verify the installed files match the expected architecture. Signed-off-by: Ross Burton --- meta/lib/oeqa/sdk/cases/buildlzip.py | 61 +++++++++++++++++------------------- 1 file changed, 28 insertions(+), 33 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/cases/buildlzip.py b/meta/lib/oeqa/sdk/cases/buildlzip.py index b57fbbece7f..a7ca239fb49 100644 --- a/meta/lib/oeqa/sdk/cases/buildlzip.py +++ b/meta/lib/oeqa/sdk/cases/buildlzip.py @@ -1,39 +1,34 @@ -import unittest +import os, tempfile, subprocess, unittest from oeqa.sdk.case import OESDKTestCase -from oeqa.sdk.utils.sdkbuildproject import SDKBuildProject - from oeqa.utils.subprocesstweak import errors_have_output errors_have_output() class BuildLzipTest(OESDKTestCase): - td_vars = ['DATETIME'] - - @classmethod - def setUpClass(self): - dl_dir = self.td.get('DL_DIR', None) - - self.project = SDKBuildProject(self.tc.sdk_dir + "/lzip/", self.tc.sdk_env, - "http://downloads.yoctoproject.org/mirror/sources/lzip-1.19.tar.gz", - self.tc.sdk_dir, self.td['DATETIME'], dl_dir=dl_dir) - self.project.download_archive() - - def setUp(self): - machine = self.td.get("MACHINE") - - if not (self.tc.hasHostPackage("packagegroup-cross-canadian-%s" % machine) or - self.tc.hasHostPackage("^gcc-", regex=True)): - raise unittest.SkipTest("SDK doesn't contain a cross-canadian toolchain") - + """ + Test that "plain" compilation works, using just $CC $CFLAGS etc. + """ def test_lzip(self): - self.assertEqual(self.project.run_configure(), 0, - msg="Running configure failed") - - self.assertEqual(self.project.run_make(), 0, - msg="Running make failed") - - self.assertEqual(self.project.run_install(), 0, - msg="Running make install failed") - - @classmethod - def tearDownClass(self): - self.project.clean() + with tempfile.TemporaryDirectory(prefix="lzip", dir=self.tc.sdk_dir) as testdir: + dl_dir = self.td.get('DL_DIR', None) + tarball = self.fetch(testdir, dl_dir, "http://downloads.yoctoproject.org/mirror/sources/lzip-1.19.tar.gz") + + dirs = {} + dirs["source"] = os.path.join(testdir, "lzip-1.19") + dirs["build"] = os.path.join(testdir, "build") + dirs["install"] = os.path.join(testdir, "install") + + subprocess.check_output(["tar", "xf", tarball, "-C", testdir]) + self.assertTrue(os.path.isdir(dirs["source"])) + os.makedirs(dirs["build"]) + + cmd = """cd {build} && \ + {source}/configure --srcdir {source} \ + CXX="$CXX" \ + CPPFLAGS="$CPPFLAGS" \ + CXXFLAGS="$CXXFLAGS" \ + LDFLAGS="$LDFLAGS" \ + """ + self._run(cmd.format(**dirs)) + self._run("cd {build} && make -j".format(**dirs)) + self._run("cd {build} && make install DESTDIR={install}".format(**dirs)) + self.check_elf(os.path.join(dirs["install"], "usr", "local", "bin", "lzip")) From patchwork Tue Dec 11 23:26:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 153528 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1206978ljp; Tue, 11 Dec 2018 15:28:43 -0800 (PST) X-Google-Smtp-Source: AFSGD/XJB86xBp00EYkpJCJ3QaMlU0X5Hw/Yw7BWnWvd0uXJ5bl56quHO1R2HA0FY5oc2/kTHiks X-Received: by 2002:a17:902:bcc7:: with SMTP id o7mr18221160pls.281.1544570923177; Tue, 11 Dec 2018 15:28:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544570923; cv=none; d=google.com; s=arc-20160816; b=I7gjexBk91I/cXUMgqZ4mOp7puOhH7l6fzohMfmXl51/MCXpxDb56sw0BZ7nAVYYMl JXEex7qKMv5yivu0XQ+RL2FMbL5la4a5IHkk2Mc9CItuWZEnXGPI3WHzVZ54vCFceP/4 8j/oUyM7K0rPai+EeExE4x3Z4LCDaZzUgd32Fxf7W1g2MA3swrQ81axdquou/ZBUTdh1 seCpCNtMq8zNn9RV7WYRHcN4QvNjasIEBzrSbZfwHk8XN1uFxnoi8Q39hjJgHtDOBnwd Jlvj7M1LZMoZSCSdP3GLcPyU2xfihzxwxUP5MwDzCW8G98DtjUpTpJq62igRV5V4Er9T iwXQ== 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:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=UuZGEZU/NDm2I0tzUWqJIwfpL4FS6+nUntBf/xJSwn8=; b=hF9QG26jDsY7p8Pxh1+T3O50ZH+Ltalc93fscCxiCPqxC3tAOc1S9dQyrjXv/kpGhA f2X2zjRcPfO+jay2lpQtAvojH4FugDXr4l0ooC5Bca16jCZ/CZSth+n1Tnwv1Pt6MdN9 uTt5LbpPqzWCkremU7k4RSk/vvOuSOBAR2Z+0j4zDkZBLt+VzwI7NWva3kyJIO4JuZxT Hyvz14arzW8ek5k5GnajJ5/vCd9JdP5y22MDyEETsLFn6H7oNkDnrqirIcPIx1ystbgP vLMv1L9U+clIuQ1b0V8nEgo6xZAwQz7GlPfVGf5HI1vkXCQ1bUrz23P2P0d6TCCHK8Br I+cw== 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=nlopY0R6; 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 c191si14373651pfg.72.2018.12.11.15.28.42; Tue, 11 Dec 2018 15:28:43 -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=nlopY0R6; 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 25F806C121; Tue, 11 Dec 2018 23:28:41 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by mail.openembedded.org (Postfix) with ESMTP id 5D70B6C0ED for ; Tue, 11 Dec 2018 23:26:43 +0000 (UTC) Received: by mail-wr1-f68.google.com with SMTP id p4so15829062wrt.7 for ; Tue, 11 Dec 2018 15:26:44 -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:in-reply-to:references; bh=DNYgDTooI6toGRXeXblb1adi6OCjcs1VdsZuUOnugso=; b=nlopY0R6iwPWTl7RAV3k/tQTwDS7ZRxfHToXkgb9vEZZ8BDBDcm4GnS70G3d2LIyNC V8QToX32wq/01wRPmGbY9fy8m0G7/Z60IYG/Y81c71o8nlyk/X8MjEjxMjCU37o3stvj MoEgLwOPEBIcd3EHOOdrjrJ+B4SJP6E1QyV/cZCxNYi4NHVZBDN3geEhwJJjGL3UHRe+ pAYTAywi/TvUZN7znd/Djp5I2IJibDOFPbpudGtLut3V/Jdi+N08t3E1QDH4jqcsUsUn t6ZZsgZXQPXo6c91cjDmGw/O5a1dueA2kRLFskuYIP21R90dHJ8dYweODlELZAFnJN/n mxyA== 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:in-reply-to :references; bh=DNYgDTooI6toGRXeXblb1adi6OCjcs1VdsZuUOnugso=; b=bfWCED33kBKqG0n3pIVAwt+ZYFsABv4YGepRKNoyfzbefTZRUWknyLU4MyurACD0Pa Y3kye5qpOjzpHYUMgx/KQ4Sb8gCg56OuHkn+7YzGeRBCgQs7sKuH1AvUJiPA62sxMugR mPaDmBx5IpNtikQ0qfhSrXzzQAZvu8Wps1YNxxQP+4powqOF7yDCnDQELsdTO3S95GAO CsOToAny+8Rv0oZWhnVHo27OZfAYCVxQVtYsayC2uMSKDp4ZGE68HbKFMvQvsqT8yKxC kJw932ybpo6f44D0uFDehgzuFQZccxDHKgo3bbgMpcAU7kidXyWUtQwZQhMfsyEWI6Hj pjRQ== X-Gm-Message-State: AA+aEWZtuOtF5sTroieBYNkLVU/DypE9jmT2G+4oudQKmZqzOhToUdQ/ u4NRT7psZd2phdIV+6RQNfW/ZfrQMOw= X-Received: by 2002:a05:6000:1287:: with SMTP id f7mr16062697wrx.302.1544570803783; Tue, 11 Dec 2018 15:26:43 -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.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Dec 2018 15:26:43 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Date: Tue, 11 Dec 2018 23:26:36 +0000 Message-Id: <20181211232636.13113-5-ross.burton@intel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181211232636.13113-1-ross.burton@intel.com> References: <20181211232636.13113-1-ross.burton@intel.com> Subject: [OE-core] [PATCH V2 5/5] oeqa/sdk: rewrite cpio test 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 Don't use the helper class as it gets in the way more than it helps, exercise the out-of-tree paths, and verify the installed files match the expected architecture. Signed-off-by: Ross Burton --- meta/lib/oeqa/sdk/cases/buildcpio.py | 49 ++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 27 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/cases/buildcpio.py b/meta/lib/oeqa/sdk/cases/buildcpio.py index 6697b12de29..ff3e1347d37 100644 --- a/meta/lib/oeqa/sdk/cases/buildcpio.py +++ b/meta/lib/oeqa/sdk/cases/buildcpio.py @@ -1,37 +1,32 @@ +import os +import tempfile +import subprocess import unittest -from oeqa.sdk.case import OESDKTestCase -from oeqa.sdk.utils.sdkbuildproject import SDKBuildProject +from oeqa.sdk.case import OESDKTestCase from oeqa.utils.subprocesstweak import errors_have_output errors_have_output() class BuildCpioTest(OESDKTestCase): - td_vars = ['DATETIME'] - - @classmethod - def setUpClass(self): - dl_dir = self.td.get('DL_DIR', None) - - self.project = SDKBuildProject(self.tc.sdk_dir + "/cpio/", self.tc.sdk_env, - "https://ftp.gnu.org/gnu/cpio/cpio-2.12.tar.gz", - self.tc.sdk_dir, self.td['DATETIME'], dl_dir=dl_dir) - self.project.download_archive() - - def setUp(self): - machine = self.td.get("MACHINE") - if not self.tc.hasHostPackage("packagegroup-cross-canadian-%s" % machine): - raise unittest.SkipTest("SDK doesn't contain a cross-canadian toolchain") - + """ + Check that autotools will cross-compile correctly. + """ def test_cpio(self): - self.assertEqual(self.project.run_configure(), 0, - msg="Running configure failed") + with tempfile.TemporaryDirectory(prefix="cpio-", dir=self.tc.sdk_dir) as testdir: + dl_dir = self.td.get('DL_DIR', None) + tarball = self.fetch(testdir, dl_dir, "https://ftp.gnu.org/gnu/cpio/cpio-2.12.tar.gz") + + dirs = {} + dirs["source"] = os.path.join(testdir, "cpio-2.12") + dirs["build"] = os.path.join(testdir, "build") + dirs["install"] = os.path.join(testdir, "install") - self.assertEqual(self.project.run_make(), 0, - msg="Running make failed") + subprocess.check_output(["tar", "xf", tarball, "-C", testdir]) + self.assertTrue(os.path.isdir(dirs["source"])) + os.makedirs(dirs["build"]) - self.assertEqual(self.project.run_install(), 0, - msg="Running make install failed") + self._run("cd {build} && {source}/configure $CONFIGURE_FLAGS".format(**dirs)) + self._run("cd {build} && make -j".format(**dirs)) + self._run("cd {build} && make install DESTDIR={install}".format(**dirs)) - @classmethod - def tearDownClass(self): - self.project.clean() + self.check_elf(os.path.join(dirs["install"], "usr", "local", "bin", "cpio"))