From patchwork Tue Dec 11 18:20:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 153485 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp935072ljp; Tue, 11 Dec 2018 10:20:37 -0800 (PST) X-Google-Smtp-Source: AFSGD/WA4ZXZsfdQGIrwYCI3ZLhKcNKiDhP/4JRRfYBspQKAKhsiIi49Lfodb9ElSXGB2P3gxaaD X-Received: by 2002:a63:200e:: with SMTP id g14mr1542216pgg.235.1544552437746; Tue, 11 Dec 2018 10:20:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544552437; cv=none; d=google.com; s=arc-20160816; b=GSJ1wRlqllfk++uDdDWXniRXlGSU+YzWwcxjesNHvFnZrEKLS12q+h+6Lc1a+Z6G0o q9XtHrVdStMq+fgUNdJRZaUPwvd84PoiTvrJ7jp3p8cyeBm6l5uylILiY1S59LGnJE5m XyNzFnbWK+Ql4s5CQqyLkMqPwn1MJdOEgA3+XCXblx6CAgkD2thpRf9kF1vf7qvFHKQY Qs9zu6MzB3xfUKlrmBdM7D9F3Y02co7IkeDmM6He/J4+L++zrUicdREDSEoGObI+YV6a cG7i+ajgbgi5cvfcwAv1tUi163F7RAS6rOAImiZACH2OKHq5/XaNRzQ3n2e8fXxXaczX gmZg== 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=vwWdpq7sX9EPhZEwONbYsVaR6bI8DUyLfQrnb/opvUg=; b=nAQ3WO8Kbh9a6aRP+tr7HUm9HRXTEiXxwYZOQjdXRdpLajmixM081/SBvl2gaSHQF2 UCaqZP9yMhT8g3zXaUMeJAPvm1FjKOSkZwlhAW17u26BZsFBqPVSXm7NZysOiGwYNPtg lc4VFBWe+ZdiWZnJPGrGymM+i0kjsVqDL0vWigpHL9qUJ0ayb8DANnmkbEHK6GLV1AX5 wXgBMeDsqKz+A53nsfb+MhAYQnLbjSdWQZatvU0vBRltzcDLaqNSDW/JYxzOPVxSC1CG B066J2UxLQkl45exb3oSkD1YZHHcETLgxAtEI7NXvkMvkKwOvCuPisg5HSfhEiDBd/xj cJMA== 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=0xOyHPhc; 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 q8si12858072plr.382.2018.12.11.10.20.37; Tue, 11 Dec 2018 10:20:37 -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=0xOyHPhc; 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 6286E6B067; Tue, 11 Dec 2018 18:20:32 +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 D2CCD6B067 for ; Tue, 11 Dec 2018 18:20:30 +0000 (UTC) Received: by mail-wm1-f66.google.com with SMTP id q26so3291618wmf.5 for ; Tue, 11 Dec 2018 10:20:32 -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=AI98P4EDw7WQhF29NQgvmHWrRyrqcjJlBFTkTXZ1eQI=; b=0xOyHPhc5DbbDA8z0Vds6DG3KvMp5kTdCmpUwuFwf75jXp1Tl49huA49IKm/fy+dq7 BAD2NVGu1xc4+ZaQe2UVTSkUc6fjwBZ06XgxNeen6bI2uqDx37DFb0upUAIsSnqH1FBK jNqJzTGmncSDcSd7s39K98+JvQmG1hgSci8Rhb7TDOLP3ALQMFJMJAo9dxcQypZQr0RJ 7RbuWbzvo7fIBcAcDL6x+c2kd21Mdwv4ZtA9B4mL2HB+L63pszWKc6cPUwjwDndoNq+T XP45j00FBTXzHjlNFkSmikFPCj4/hulO9pkWTE3v10doCGNEZclTa77HRG8IJq5Sk9k3 VHRw== 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=AI98P4EDw7WQhF29NQgvmHWrRyrqcjJlBFTkTXZ1eQI=; b=XatwT+B5zNvoPk/hyv3jUOLmV+1tgthyw+tJTFQ8a0PCjM9HvRHo39Tfw2LG4iR/Qi g0GNeWbaczWcKI5CPPsvI6UNjYk55+ybc98JOed1Q26At0CAPkKVDHf8v6sFy/n/14OZ TnsqTutBoqdPC+PkLnAKUd4MMgNw3WbY/7iDwNS9hG/w43bjm0jykw0tl4Qfj5g7KAYB zr3qqMlmuzgbean2hOfHdIsVJBEtgvg+yxdm+w+d1/xGuXpglHezEh2bXAKyIHMUdjIT +KtSe6UPuvELXZiQM14zZpSID8yFhu0dq1/Dtv6bYmHg2NJn8A8qpAEpXfuYvAt2k0jV 3Qug== X-Gm-Message-State: AA+aEWYaeRBDnInjCQHgj/M+FAmroIK+6j7l65PBtz9zpiBcCCNFwTED KBrMK0oo1qkeLXniyGockKxq8ujjstU= X-Received: by 2002:a7b:c7c2:: with SMTP id z2mr3228558wmk.47.1544552431152; Tue, 11 Dec 2018 10:20:31 -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 b18sm16253616wrw.83.2018.12.11.10.20.29 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Dec 2018 10:20:30 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Date: Tue, 11 Dec 2018 18:20:21 +0000 Message-Id: <20181211182025.20381-1-ross.burton@intel.com> X-Mailer: git-send-email 2.11.0 Subject: [OE-core] [PATCH 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 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 18:20:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 153486 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp935887ljp; Tue, 11 Dec 2018 10:21:23 -0800 (PST) X-Google-Smtp-Source: AFSGD/VfTPklhDTK4mpYfDEL/GzvWvVvRQxye4MhNJjzDtyWO7/g0faH/hdc3IR8nNJvarDT5B+l X-Received: by 2002:a17:902:7b88:: with SMTP id w8mr16839946pll.320.1544552482972; Tue, 11 Dec 2018 10:21:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544552482; cv=none; d=google.com; s=arc-20160816; b=y624Rd6xFm6iVSrGTQtKDrRLF2tr8BYAkSH9V9vkBqqtaMd+xXXJy14ERfiBr1Wx1L 7wNR2/zNB/Ycf4EagH+dDJd1/A5ujlz1k/rVQhBBB9c9I00it7zN6HcP7P37cS2PGF3L UjXyk8k9c+jYttoL6WHjZZzlZ5ISRpJFLCy9IA/Y4d8bEQ/wqe7b9IFy7h7L9iBiq94d p2aDE/PIdzRhOgJa9Byjy1WfbVTlrqekcXavQZAvVSkokA3HSBt7K9U7yIQF4WfXIPL1 mT2NrGbojNAg3Us+S4I5u4s8sxdxgqlXNuBha1W83Fuq7dOAGBSTekLXzaqx0TknGTxw mvNg== 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=Hcxsg0Qv/doAhkJrEMsU5vlZqiammzNtTsmbhvOwL30=; b=0snIdlylqydM7L0/++Ll/GPYXKEGvaQqh9p/pkUWZhqaU3UlrnfpwtEHDbCMQB3aNl 4wEtUoesyyR9PUKHh2hQsqUuC3VJPoQK6hV2c37aGlxjW6KtX6ifT6JV2iE4myzohpjM nw16sbsTCeCYau6cisA4AUvQsscQAVnazQgEe+Ku8cIJbXuma7ZbDnWI/NmB2Wqacv2u RIDWCeuOsypu7is/fkW8Lagix2BVFvf02ceJvinu2H/pjNPbKDKNvN5eUdTbb6rNiSpI xkA/xnA01cLfsNPZL78bcBN37JQhumzJCem/6kainIdjPj5rvoLcduSnQYjfnc7qwwT7 NTOw== 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=Y6e83mUE; 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 27si12662064pgp.135.2018.12.11.10.21.22; Tue, 11 Dec 2018 10:21:22 -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=Y6e83mUE; 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 701206C176; Tue, 11 Dec 2018 18:21:20 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) by mail.openembedded.org (Postfix) with ESMTP id E68596B067 for ; Tue, 11 Dec 2018 18:20:31 +0000 (UTC) Received: by mail-wm1-f53.google.com with SMTP id m1so2606481wml.2 for ; Tue, 11 Dec 2018 10:20:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=JqXIOtY2rrFloXbPbsYcqI5lJS1gENy1XgbXfbkwKUU=; b=Y6e83mUErQCTJCH+fRKazCna4XoxXBMRQu2dhjQD3uGpAeJs2RL7T0iPzqUz8ATkxs JX8Ln7LpAB5h0OSSTaHYHp6XZuCq6ErfAfcHl5LVz6+OAH4JLUTBR2S30Gpo3JPr8zYm 9AFmhHlcFegkItuoFXDxInAgB4d/Wotj6RHKBlLLioDJQQuhsxmLypxoe4eu1GTB8X3v gqr60FsfGKCG/4r4QgvaPLfR8YoeaXIjwl8Eyi7ccQ5V16GBXhXjo+biajAYDX1nP2dw hXayMDKMs1JO3sSLWxl3qa37EXnty6AFBxRBKAH1M40lFb7b868ndJaH7HoOTCXp52EK 0WWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=JqXIOtY2rrFloXbPbsYcqI5lJS1gENy1XgbXfbkwKUU=; b=hA+Zls8aRXN1DoWOck/nE0u7KUR9YISVkue6SYLsOFYv8vfqzluOl90iGmqhaM94ti gHdR72gA/LCbrf/DPTWb/D2BiYfrtKcdA5N6NOSkD4i5cit9KnUn+gG5zrm+JxJ9r30G M7m6XlMN8dz9YkYNO5JanxgFkKoq8ugWHFcBjeok/Mfu0ewQiXXxo3k5OVm4e4UPEah7 /qbFn3hWS/Gg3ObCXDo6vvbwhBg1TeAWZkhZW4AByeXa2/aawQmZaJa1qCDY5Ja08zF7 ZVGU4AWbjrR54zJ3G+Z93SpLSHLAu+A71lyByg4uAMGWNLFFUxF5lw6C9U2U9/W8v8bm fUNg== X-Gm-Message-State: AA+aEWa76+EAP/Lz2tKaTL6S7EvSTSMQL8BYmExwhol//A1RFACjrKj2 GAG4BzCyepcSJ/36cByx+/JpujClKEI= X-Received: by 2002:a7b:c1d7:: with SMTP id a23mr3219580wmj.48.1544552432359; Tue, 11 Dec 2018 10:20:32 -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 b18sm16253616wrw.83.2018.12.11.10.20.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Dec 2018 10:20:31 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Date: Tue, 11 Dec 2018 18:20:22 +0000 Message-Id: <20181211182025.20381-2-ross.burton@intel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181211182025.20381-1-ross.burton@intel.com> References: <20181211182025.20381-1-ross.burton@intel.com> Subject: [OE-core] [PATCH 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. (From OE-Core rev: 0fcc1f7d1f7d4efc793005e194edc048b0c9d388) Signed-off-by: Ross Burton Signed-off-by: Richard Purdie 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 18:20:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 153487 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp936186ljp; Tue, 11 Dec 2018 10:21:42 -0800 (PST) X-Google-Smtp-Source: AFSGD/V/dEyrOcI52Jadqoz75mdKdOJ048JMQ0kbgrWj8V1mOI1KLl5ijCyQIqgSZzsVjA/DUIGu X-Received: by 2002:a62:f54f:: with SMTP id n76mr17285456pfh.59.1544552502527; Tue, 11 Dec 2018 10:21:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544552502; cv=none; d=google.com; s=arc-20160816; b=jqivUjvOiDpC4S4dP4MwJSP97fcIiKacoJvMofUIxKCWmaIQzuSs7yiRBZRMut8Qjl G5Rcrity24esGjIYzE00B80+WKtOuUOKYl2Zvhhn/5njut/qXniwbjRC7vmdkc5DK4yN sU1D1JghKQvrAC0AvHRBAVlALTAVI76zBGWZsoSFO01kUBLerxz4FQEimqZcevBB4BWK G/jdAScEI1qujopxEceyqV3gfStERquKglrLMDB8mq7qKSmuAnTYs7X38/+ZLdW8bvHO nI+8Xpp+mAM0oeoCuKraKfopDvhj4DCVwhEjCQ9m7HPnuue4LqQftFAalReKSvIaEZsh RHkg== 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=IkC5WXP+KGRwUZiDpmqhyqTSpr/J4WUCjF98S97VdUw=; b=T5VQfBnbkhzbPNdmabGXEe3wnXh2amc9cng3g4ZhzHlk3NUnWWlY2C8PqmU157BQKY lDuFlKpQB6l2g1kMKwjaxO0iSzELAu/zGwiwXgL0wIiczMEHFIgONCNy6zdUwyC00D2G MsZyMFTtDWoJkcucDO4bsbEy8x852HP6m5c6tIb72qrJnP+1yznJLvcjkqZxLYSzMHsE qAxCu18nvg6AfBTvcMf4p5QJUuEB9KyEImoczBi3ZJLLnq6xdBvCQpqEYSTkOW6B8xF2 N3R+dmpKYxkVBgT1++Blw4iJcwX7QRWA53qFeViVvjgtq0FzhAPryhi2veGipllBWqVv 8SZw== 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=1qMwmCYS; 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 z19si14602576pfc.95.2018.12.11.10.21.42; Tue, 11 Dec 2018 10:21:42 -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=1qMwmCYS; 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 156866C1B3; Tue, 11 Dec 2018 18:21:40 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by mail.openembedded.org (Postfix) with ESMTP id E65976C108 for ; Tue, 11 Dec 2018 18:20:32 +0000 (UTC) Received: by mail-wm1-f68.google.com with SMTP id a18so3346453wmj.1 for ; Tue, 11 Dec 2018 10:20:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=oYLBsn2+epQ8kSmlMKaIH72HaxFjhYuVbOHzsAtrD1s=; b=1qMwmCYSWU3PBzkZNbvousi04xKpZhyh6AHU1o1bBXMAoSEc0Jkb/APd8DBA5ZGUpy TJ12LKeIzltM56VnE5ykd1LEXsBv6bnZdFZrE4nHWWwXOcj1HlerESa/AUCwG/F8m7q7 2L0RTEx0N07GS9Lb7p08i2lR2w/3IBoVaZ8jshqAFHeVJh9D8OqSe6SRmtyw9/CLbcTT RFdpegnraPQW8vY4ACklOS3gyPzPuN7kVDvwoxn/kwovknxCkxKK/wJKGAYoahdwQNGz q1IT9huQI6W90wMmF75ncQ2Y6qlt0HX08agSstMacy8jJRWU/W2QX4F61cF2kKz0KrdI DLLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=oYLBsn2+epQ8kSmlMKaIH72HaxFjhYuVbOHzsAtrD1s=; b=KwuIxgC8ebULZJqrDU2p8rpFBq1vefIUlPej8VBdwWcMbvTlPtUj7X5uytfWjOQ6Vn Ue1g69oNndXkJq7AoaXaf4OHzGCLCTj6NcKHHmVhmnYuOaYkV7F/Vyt5I+D1Clhm/WdR 7SN6LgLoBlU00wJ0EI/xT6CYohchVWpAQqdwc6ldb4gC2yiKK+ZeF0W4YzKEVPf5/Lje W7yHKujOdRm199ox6o9qP6kegf1JnK0P2GmpScdn3nTtM2hF4OqJDrfN+SY8LAf/oflu x4B+iL+/PhWJruHYdE8QGC3OcuDq5J10H9rP2O4ynG7gb/gs3xtV5KlXH8H618CkZvAa zF6w== X-Gm-Message-State: AA+aEWaek4MzdErhh1Zqf+lqyh4RVV8SdaZdbkKB/zh6dRI1Pwc8L9US Lm+n8B2k6w39CK2fLCanxwZTMJ1QB9o= X-Received: by 2002:a7b:c04e:: with SMTP id u14mr3431936wmc.113.1544552433369; Tue, 11 Dec 2018 10:20:33 -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 b18sm16253616wrw.83.2018.12.11.10.20.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Dec 2018 10:20:32 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Date: Tue, 11 Dec 2018 18:20:23 +0000 Message-Id: <20181211182025.20381-3-ross.burton@intel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181211182025.20381-1-ross.burton@intel.com> References: <20181211182025.20381-1-ross.burton@intel.com> Subject: [OE-core] [PATCH 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(). (From OE-Core rev: fe49be0608e8beac45be2335f1ec970db8ea5e1f) Signed-off-by: Ross Burton Signed-off-by: Richard Purdie 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 18:20:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 153488 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp936539ljp; Tue, 11 Dec 2018 10:22:03 -0800 (PST) X-Google-Smtp-Source: AFSGD/Wls8znRWS6uoJI3e3vvGplPmkjtx/5D7Zlw41aNpiAgG1yI4H0Nh7gnaRxLdGdsHJNhH6g X-Received: by 2002:a63:82c6:: with SMTP id w189mr15730400pgd.344.1544552523238; Tue, 11 Dec 2018 10:22:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544552523; cv=none; d=google.com; s=arc-20160816; b=YUKm2zIW0E1tlYR87YeCJyBZP5PVN1GiyTncV98h4zaxzy0/6NvbzjBucRzjymayVZ nAez2wy+xNSHdHKbzuHVLcHeBtE0roo1GfTs9eSPxNCJyjet3q/OMOGHcNh2WzPjqKlA gu9QGMHEE6jTYzJxD0KrzlqwEo9bkmY7PEKcI2Gs/sHzUnxFRaP+jFXbnQWJl0seg4FA C8QCf8nMDn0L0JYUXqFN+79Lh8pQ7/3BWGAvebDS77AXBRavuZBoSEIT+boY4H7kd8rA MARExaEFezPDlqsaRQgaWEtw2ijZYqK9zDwiwKg22tDblHe8uqwLMX2VfPuJjcHtx/0f uIgg== 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=+V3jyInM3PGpQhd2ujNU7Nm4Jq+O8IIx5Hf8DtuYiD4=; b=IhCnPq+mY7vswysVZ0etbUfZBdTDyxgfrqHEjzBZqdi/nocbANhIBBUU/0k3i1WoUq 0p5mFuBVGQHx/q3ZlymkjMy7hsKt8yAOwnCG66WumPHJPOF+b3Fhk/P/OMkeWnhoiiJG GEcoVNEEJ/pHZJRRjJNCH//d9bQQ2Mm18wAj6/JGjh2L0KiS2+ClDwVdukvjoH9LvXA5 v1+IyCNZT+042BIwvK8lGAoXTZP4Phgg9L9A+ZDxxKzwpgu2b1EtR+ZeYSG05gGRljCy jtsdKl5BYuOfZ8PlmFsaQU9fVk99gS9+3g9pje0oul9LfiSZbVpkObUt9qpygufpDL6A zqnw== 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=QUp0LOby; 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 d17si12627866pgl.484.2018.12.11.10.22.02; Tue, 11 Dec 2018 10:22:03 -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=QUp0LOby; 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 E34E86C1B4; Tue, 11 Dec 2018 18:21:59 +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 1F1C76C108 for ; Tue, 11 Dec 2018 18:20:33 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id a18so3346505wmj.1 for ; Tue, 11 Dec 2018 10:20:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=HdnA52bXwf8T5p+D/o7SFkSh/SHU+EsoFo4dHv54gb0=; b=QUp0LOby+WJa/sf6YKqdPhMEvEGD2uYJNAD5ilK7KowMc3LPasvd98lnpIb4RFIYSb ieF05uV0b/FSOJFys6nCtdKPjR3F39DIlZ45wWXy9JoLOF410BvRCODN+eumXplw7Nmu ToGlKxD2wxuyKbEiTdUALM/8Hy41Ev+r28O3ee25W9Jb/hyd4Y64U9ixhK0tOozlPuf3 mPoblcov60YrSOPQkN51WZLG+DTK7hHrIrvzBhlbwSYjebVxFmi9DJTJauWS5adGXuJ/ Lc/e9rsBtL7oyihRzJ3H9yijImvpWt4s2Ir5OzCAGOQDzYzhodV4z3zqNoyaKcMUICIe jmsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=HdnA52bXwf8T5p+D/o7SFkSh/SHU+EsoFo4dHv54gb0=; b=JknfJAIanVA5TsaXxQvit4gL4+Q7h74QFVUFB2T0LougGEO3HdtF+Im1b4XVMvDkCJ ZOPCh61ofmKw+7qJ5Xa27WcppdmVimYXmiVuOCDJvx3KT5UPpVS83CxgmJll2B8IvcUd Tr5gfrdeuL0CK0hLTlo0hV+g+JaHCpqsaNR4Xf+hZnvS3/cEI0OKc7aGtJn0uGutdR6j OIfUV9mOeqbei22MSO6vQGoGV6cT7fuZBgKZYCkppuhpDcExU/Fcig/Mg2ZyqfOuaS1B r6dwQECCmEPu5MOYsGV/Id0rNJy3radwwQLCJdZxIYQl+8UGEtaUT6Qvzp5eMPKSNRW3 POTg== X-Gm-Message-State: AA+aEWbiQ9IS8QxZv5xdngNbrFVh4kdWRwtaNRbkIgVgS4uv3O3R4T7U zQjR1tGJlf9YZmFkQL35S0A8d0BKsgg= X-Received: by 2002:a1c:4c10:: with SMTP id z16mr3521513wmf.117.1544552434436; Tue, 11 Dec 2018 10:20:34 -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 b18sm16253616wrw.83.2018.12.11.10.20.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Dec 2018 10:20:33 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Date: Tue, 11 Dec 2018 18:20:24 +0000 Message-Id: <20181211182025.20381-4-ross.burton@intel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181211182025.20381-1-ross.burton@intel.com> References: <20181211182025.20381-1-ross.burton@intel.com> Subject: [OE-core] [PATCH 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. (From OE-Core rev: ad7bb5d141165fc9e6ffee882adf709c0a76094f) Signed-off-by: Ross Burton Signed-off-by: Richard Purdie 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 18:20:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 153489 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp936843ljp; Tue, 11 Dec 2018 10:22:22 -0800 (PST) X-Google-Smtp-Source: AFSGD/WK0b/VSbqNWGUvfEDm4lQNITwzt9onYMp24C9MGDlj6kzafVgu0aAyg35Iann2v0jvzli7 X-Received: by 2002:a63:62c3:: with SMTP id w186mr15613707pgb.345.1544552542314; Tue, 11 Dec 2018 10:22:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544552542; cv=none; d=google.com; s=arc-20160816; b=fZ8OZJKoloKelDDIzI/otq+VnCTpIPzj6HoDzLsc3n5NzJ75uHoVhbqrrWVgGQFz0t WeJHBvRss1rwwOCqaaaHA4Vee2sJ2WPNuNxe2fNcg7bv/RkMffVmB2g1G/FRgSiYh1Sd pJGjE85cFBESCEIY0I+1awIVM+lDCet1mV9LJ4Xp2mYynKsEGR6UBOvW5wSg/JdZxY4i 0b2UDz7z4jdtoi4JQi/A7pAeNXs7pLS/RO3tEmnqJ95TqqqaEoXDffy9SI1BPCDJs4Gt anp1cYNaR211Vco6bvrBZaoXkUvmSvu4UmHGy7GAKzKG3OMY0dhJOMd5FYxW+Vpm7STO Q6ig== 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=VP/rdyf7IGW/n5pqskfUJn5zYtXDni/aorb6nA8Szh8=; b=odEj2kiT8R5h/gMT7XhzTioI4J51+ELRSG+k5+0VTTrCO9R7xGZMQMaOPr/zS4nEoZ vqR9+vbKCqOesx3vzdXd+xAIKhh+prwLeqHBYggF3uRkGCTMLxvDwOhjAPIcKBY7lMOl usF7/0oX0enP85syz59gQ5p7pt4G8uSGMtEGWOO1QAywBZ6/xnD3fmU7kRwYc55J2LJf dbL8ep9DOBh8y3d90Bo0IP5IEldlBa5OJ37Sv/UI/xLjPUZndQ9IqLfv1hxDVOeNsjK2 S/S3VNtQPY/m0Sk3McrXTpMjburPLawrU6keLrbNKTpd9LdtX62H9FCOC5B529MZ4fFy iP9g== 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=XW1d+mLF; 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 24si12680588pgm.167.2018.12.11.10.22.21; Tue, 11 Dec 2018 10:22:22 -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=XW1d+mLF; 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 6D5396C190; Tue, 11 Dec 2018 18:22:19 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by mail.openembedded.org (Postfix) with ESMTP id 0DD996C108 for ; Tue, 11 Dec 2018 18:20:34 +0000 (UTC) Received: by mail-wr1-f66.google.com with SMTP id u3so15145584wrs.3 for ; Tue, 11 Dec 2018 10:20:36 -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=8kPsVTbtq9kr8qC8QcKyyw67ovCDCdzVWJ+Lbd7nVvs=; b=XW1d+mLFSIaoZfVffg0P2hsSmrq5gDNaihJv/cqKez2lFgx/Fw5ZZuWExEuzvXxptD xiLO9dkTIGweuDD+0mv2q7hy4TWvpbv8Ym/jyhcVsQcn8bcmYPlSzQNNcATSz5+2XCzy pn8Y9ByYexZl31ZKJ6/GTs/22x34nF/zXE9ABIcvIUZYrrjRyG4TmIKVdo53Z4Zb2xNR 6A0O0lBHSUnC0kpIeeDSEssRln1JVd0xTpCfC/B+xFWUNJxQdWdLdCQ5K4JcGDi8e8PM wNFEYpyppJEMUb11eBvYaGMsJCYsgOOJ2E7JSSFEgIbFmC11nUlOfPJ7sr8Nq3EdjD1X 0wMQ== 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=8kPsVTbtq9kr8qC8QcKyyw67ovCDCdzVWJ+Lbd7nVvs=; b=N5Wz3aUq5kJ8MojEP0hNODcqB3eO/iQUpOkP4FvubjGf2rn+cqP57kjfb2k7/y93ZI emSaojjoLReY1fXBBickr3bywMXpgoo15/t3S9pbfbcoDonTCXSM0kZVqhabVmIpfjYn LgFdpxX+Y/jFr8L5uaZbiej/EpBwr8IaxG7N2e8dNuboCOGvHE9qYvjNn8weuVxj8Au2 5NqDujJc/m70XfIXOqTU+M03s83W5Y08qzKWdlMV6GQPjaU/Khb9RHWQifEgjzjsHfHJ 7e637PVlKUKR4gVth1p5JSoKbaLGjYwEpsM65dw+LYxoHs5J9Z4pXnTbdymBOTEG0gwU 44ag== X-Gm-Message-State: AA+aEWZXB3RUPH4eXVQ12KmIXvtCeQ0wFKoQh9NxM4hqrFirX8581inI V7+GNsuDzJLjaWBpABRwUBz9ZF4TMkw= X-Received: by 2002:adf:f691:: with SMTP id v17mr13881838wrp.114.1544552435450; Tue, 11 Dec 2018 10:20:35 -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 b18sm16253616wrw.83.2018.12.11.10.20.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Dec 2018 10:20:34 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Date: Tue, 11 Dec 2018 18:20:25 +0000 Message-Id: <20181211182025.20381-5-ross.burton@intel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181211182025.20381-1-ross.burton@intel.com> References: <20181211182025.20381-1-ross.burton@intel.com> Subject: [OE-core] [PATCH 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 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"))