summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorStefan Stanacar <stefanx.stanacar@intel.com>2014-02-03 21:22:31 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-02-09 09:40:01 +0000
commitd7c0e00e40c3eadb139a663bdfef15b2d2cb1408 (patch)
tree28313faea0e91051650cecbb298b5b810127d3c9 /meta/lib
parent4354cb29e7c25eb2a8927caf3856a6c899fe3c3f (diff)
downloadast2050-yocto-poky-d7c0e00e40c3eadb139a663bdfef15b2d2cb1408.zip
ast2050-yocto-poky-d7c0e00e40c3eadb139a663bdfef15b2d2cb1408.tar.gz
oeqa/utils: targetbuild: don't use bb.fetch anymore
When running tests outside of the build system we can't use bb.fetch anymore. It was nice but tests and their modules need to rely on the data storage only as that gets exported. This module is used by the oeqa/runtime/build* tests. (From OE-Core rev: 3caf8e244ea94f62a93f3b40e73e15ea78fc2880) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oeqa/utils/targetbuild.py27
1 files changed, 8 insertions, 19 deletions
diff --git a/meta/lib/oeqa/utils/targetbuild.py b/meta/lib/oeqa/utils/targetbuild.py
index 9b2cf53..77181b1 100644
--- a/meta/lib/oeqa/utils/targetbuild.py
+++ b/meta/lib/oeqa/utils/targetbuild.py
@@ -4,11 +4,9 @@
# Provides a class for automating build tests for projects
-from oeqa.oetest import oeRuntimeTest
-import bb.fetch2
-import bb.data
import os
import re
+import subprocess
class TargetBuildProject():
@@ -16,26 +14,16 @@ class TargetBuildProject():
def __init__(self, target, uri, foldername=None):
self.target = target
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)
- else:
+ self.targetdir = "~/"
+ self.archive = os.path.basename(uri)
+ self.localarchive = "/tmp/" + self.archive
+ self.fname = re.sub(r'.tar.bz2|tar.gz$', '', self.archive)
+ if foldername:
self.fname = foldername
def download_archive(self):
- try:
- 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)
+ subprocess.check_call("wget -O %s %s" % (self.localarchive, self.uri), shell=True)
(status, output) = self.target.copy_to(self.localarchive, self.targetdir)
if status != 0:
@@ -61,3 +49,4 @@ class TargetBuildProject():
def clean(self):
self.target.run('rm -rf %s' % self.targetdir)
+ subprocess.call('rm -f %s' % self.localarchive, shell=True)
OpenPOWER on IntegriCloud