diff options
Diffstat (limited to 'meta/lib/oeqa/runtime/utils/targetbuildproject.py')
| -rw-r--r-- | meta/lib/oeqa/runtime/utils/targetbuildproject.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/meta/lib/oeqa/runtime/utils/targetbuildproject.py b/meta/lib/oeqa/runtime/utils/targetbuildproject.py new file mode 100644 index 0000000000..138b5ef041 --- /dev/null +++ b/meta/lib/oeqa/runtime/utils/targetbuildproject.py | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | # Copyright (C) 2016 Intel Corporation | ||
| 2 | # Released under the MIT license (see COPYING.MIT) | ||
| 3 | |||
| 4 | from oeqa.utils.buildproject import BuildProject | ||
| 5 | |||
| 6 | class TargetBuildProject(BuildProject): | ||
| 7 | |||
| 8 | def __init__(self, target, d, uri, foldername=None): | ||
| 9 | self.target = target | ||
| 10 | self.targetdir = "~/" | ||
| 11 | BuildProject.__init__(self, d, uri, foldername, tmpdir="/tmp") | ||
| 12 | |||
| 13 | def download_archive(self): | ||
| 14 | |||
| 15 | self._download_archive() | ||
| 16 | |||
| 17 | (status, output) = self.target.copy_to(self.localarchive, self.targetdir) | ||
| 18 | if status != 0: | ||
| 19 | raise Exception("Failed to copy archive to target, output: %s" % output) | ||
| 20 | |||
| 21 | (status, output) = self.target.run('tar xf %s%s -C %s' % (self.targetdir, self.archive, self.targetdir)) | ||
| 22 | if status != 0: | ||
| 23 | raise Exception("Failed to extract archive, output: %s" % output) | ||
| 24 | |||
| 25 | #Change targetdir to project folder | ||
| 26 | self.targetdir = self.targetdir + self.fname | ||
| 27 | |||
| 28 | # The timeout parameter of target.run is set to 0 to make the ssh command | ||
| 29 | # run with no timeout. | ||
| 30 | def _run(self, cmd): | ||
| 31 | return self.target.run(cmd, 0)[0] | ||
| 32 | |||
| 33 | |||
