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