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"))