From: Paul Eggleton <paul.eggleton@linux.intel.com>
To: Stefan Stanacar <stefanx.stanacar@intel.com>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH 17/21] oeqa/utils/targetbuild: change download to use bitbake's fetcher
Date: Fri, 23 Aug 2013 16:38:02 +0100 [thread overview]
Message-ID: <3198150.4aauEBHVOu@helios> (raw)
In-Reply-To: <b58ed117ebd7a8b543fb843c2f67e014e4b521ad.1377269486.git.stefanx.stanacar@intel.com>
Hi Stefan,
On Friday 23 August 2013 18:30:57 Stefan Stanacar wrote:
> Use bb.fetcher2 instead of running our own wget command
> (helps with proxy too). Also no need to use the class attribute target,
> use self.target, as the tests pass that to the class.
> Also, we shouldn't clean the archive, now that it gets to DL_DIR.
>
> Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
> ---
> meta/lib/oeqa/utils/targetbuild.py | 33 +++++++++++++++------------------
> 1 file changed, 15 insertions(+), 18 deletions(-)
>
> diff --git a/meta/lib/oeqa/utils/targetbuild.py
> b/meta/lib/oeqa/utils/targetbuild.py index 7555add..9b2cf53 100644
> --- a/meta/lib/oeqa/utils/targetbuild.py
> +++ b/meta/lib/oeqa/utils/targetbuild.py
> @@ -5,8 +5,8 @@
> # Provides a class for automating build tests for projects
>
> from oeqa.oetest import oeRuntimeTest
> -from oeqa.utils.decorators import *
> -import bb.process
> +import bb.fetch2
> +import bb.data
> import os
> import re
>
> @@ -18,6 +18,9 @@ class TargetBuildProject():
> self.uri = uri
> self.targetdir = "/home/root/"
>
> + self.localdata = bb.data.createCopy(oeRuntimeTest.tc.d)
> + bb.data.update_data(self.localdata)
> +
> if not foldername:
> self.archive = os.path.basename(uri)
> self.fname = re.sub(r'.tar.bz2|tar.gz$', '', self.archive)
> @@ -25,22 +28,20 @@ class TargetBuildProject():
> self.fname = foldername
>
> def download_archive(self):
> - wgetcmd = oeRuntimeTest.tc.d.getVar('FETCHCMD_wget', True).split()
> - self.testdir = oeRuntimeTest.tc.d.getVar('TEST_LOG_DIR', True)
>
> try:
> - output = bb.process.run(wgetcmd + ['-P', self.testdir,
> self.uri])[0] - except bb.process.CmdError:
> - raise Exception("Failed to download archive, output: %s" %
> output) -
> - (status, output) = oeRuntimeTest.tc.target.copy_to(
> - os.path.join(self.testdir, self.archive),
> - self.targetdir)
> + self.localdata.delVar("BB_STRICT_CHECKSUM")
> + fetcher = bb.fetch2.Fetch([self.uri], self.localdata)
> + fetcher.download()
> + self.localarchive = fetcher.localpath(self.uri)
> + except bb.fetch2.BBFetchException:
> + raise Exception("Failed to download archive: %s" % self.uri)
> +
> + (status, output) = self.target.copy_to(self.localarchive,
> self.targetdir) if status != 0:
> raise Exception("Failed to copy archive to target, output: %s"
> % output)
>
> - (status, output) = oeRuntimeTest.tc.target.run(
> - 'tar xf %s%s -C %s' % (self.targetdir, self.archive,
> self.targetdir)) + (status, output) = self.target.run('tar xf %s%s
> -C %s' % (self.targetdir, self.archive, self.targetdir)) if status != 0:
> raise Exception("Failed to extract archive, output: %s" %
> output)
>
> @@ -59,8 +60,4 @@ class TargetBuildProject():
> return self.target.run('cd %s; make install' % self.targetdir,
> 0)[0]
>
> def clean(self):
> - self.target.run('rm -r %s*' % self.targetdir)
> - try:
> - bb.process.run(['rm', '-rf', os.path.join(self.testdir,
> self.archive)]) - except bb.process.CmdError:
> - bb.note("Failed to remove archive")
> + self.target.run('rm -rf %s' % self.targetdir)
Could you please squash this into the commit that adds this module?
Cheers,
Paul
--
Paul Eggleton
Intel Open Source Technology Centre
next prev parent reply other threads:[~2013-08-23 15:38 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-23 15:30 [PATCH 00/21] Some new runtime tests or fixes Stefan Stanacar
2013-08-23 15:30 ` [PATCH 01/21] lib/oeqa/runtime: add basic test for x32 images Stefan Stanacar
2013-08-23 15:30 ` [PATCH 02/21] lib/oeqa/runtime: add test for perl Stefan Stanacar
2013-08-23 15:30 ` [PATCH 03/21] lib/oeqa/runtime: add a test for ldd Stefan Stanacar
2013-08-23 15:30 ` [PATCH 04/21] lib/oeqa/runtime: add new logrotate test Stefan Stanacar
2013-08-23 15:30 ` [PATCH 05/21] lib/oeqa/runtime: add new skeletoninit test Stefan Stanacar
2013-08-23 15:30 ` [PATCH 06/21] lib/oeqa/runtime: add new PAM support test Stefan Stanacar
2013-08-23 15:30 ` [PATCH 07/21] lib/oeqa/runtime: add new scp test Stefan Stanacar
2013-08-23 15:30 ` [PATCH 08/21] lib/oeqa/utils: new file: httpserver.py useful for serving files over HTTP to the target Stefan Stanacar
2013-08-23 15:30 ` [PATCH 09/21] lib/oeqa/utils: qemurunner: save host IP address Stefan Stanacar
2013-08-23 15:30 ` [PATCH 10/21] oeqa/utils/decorators: return the decorated method Stefan Stanacar
2013-08-23 15:30 ` [PATCH 11/21] lib/oeqa/runtime: smart: add new smart tests Stefan Stanacar
2013-08-23 15:30 ` [PATCH 12/21] lib/oeqa/utils: targetbuild: Add helper class for building packages on target Stefan Stanacar
2013-08-23 15:30 ` [PATCH 13/21] lib/oeqa/runtime: add iptables, cvs and sudoku projects build tests " Stefan Stanacar
2013-08-23 15:30 ` [PATCH 14/21] lib/oeqa/runtime: add adjust date and time test Stefan Stanacar
2013-08-23 15:30 ` [PATCH 15/21] lib/oeqa/runtime: add vncserver for target test Stefan Stanacar
2013-08-23 15:30 ` [PATCH 16/21] classess/testimage: change default test suites Stefan Stanacar
2013-08-23 15:30 ` [PATCH 17/21] oeqa/utils/targetbuild: change download to use bitbake's fetcher Stefan Stanacar
2013-08-23 15:38 ` Paul Eggleton [this message]
2013-08-23 15:30 ` [PATCH 18/21] lib/oeqa/runtime: rpm: add install and erase tests Stefan Stanacar
2013-08-23 15:30 ` [PATCH 19/21] lib/oeqa: change behaviour for unskippable tests Stefan Stanacar
2013-08-23 15:31 ` [PATCH 20/21] lib/oeqa/utils: qemurunner: improve kill and restart Stefan Stanacar
2013-08-23 15:31 ` [PATCH 21/21] lib/oeqa: add a restart method for base class and use it for build tests Stefan Stanacar
2013-08-23 15:41 ` Paul Eggleton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3198150.4aauEBHVOu@helios \
--to=paul.eggleton@linux.intel.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=stefanx.stanacar@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox