diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-06-12 18:57:34 +0100 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2024-08-01 06:08:09 -0700 |
commit | 82d0777248e5d10a3f780d753c9996b7fd748155 (patch) | |
tree | 693986246286cca8b6b54dcd4caa7638fda0f06b | |
parent | 754724ec73c0e387636dfb33fca94437c83338f3 (diff) | |
download | poky-82d0777248e5d10a3f780d753c9996b7fd748155.tar.gz |
oeqa/sdk/case: Ensure DL_DIR is populated with artefacts if used
Where we're using DL_DIR in sdk archive to try and cache testing artefacts,
copy into the cache so that it gets populated and this doesn't have to be done
manually. Currently we're making a lot of repeat requests to github as this
wasn't being populated.
(From OE-Core rev: 048467673ceb075277c5a4fbbb40b9c3e41864e0)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit a3284958a2cc6c90a5fac26976bddc23f821c972)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r-- | meta/lib/oeqa/sdk/case.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/meta/lib/oeqa/sdk/case.py b/meta/lib/oeqa/sdk/case.py index c45882689c..46a3789f57 100644 --- a/meta/lib/oeqa/sdk/case.py +++ b/meta/lib/oeqa/sdk/case.py | |||
@@ -6,6 +6,7 @@ | |||
6 | 6 | ||
7 | import os | 7 | import os |
8 | import subprocess | 8 | import subprocess |
9 | import shutil | ||
9 | 10 | ||
10 | from oeqa.core.case import OETestCase | 11 | from oeqa.core.case import OETestCase |
11 | 12 | ||
@@ -21,12 +22,14 @@ class OESDKTestCase(OETestCase): | |||
21 | archive = os.path.basename(urlparse(url).path) | 22 | archive = os.path.basename(urlparse(url).path) |
22 | 23 | ||
23 | if dl_dir: | 24 | if dl_dir: |
24 | tarball = os.path.join(dl_dir, archive) | 25 | archive_tarball = os.path.join(dl_dir, archive) |
25 | if os.path.exists(tarball): | 26 | if os.path.exists(archive_tarball): |
26 | return tarball | 27 | return archive_tarball |
27 | 28 | ||
28 | tarball = os.path.join(workdir, archive) | 29 | tarball = os.path.join(workdir, archive) |
29 | subprocess.check_output(["wget", "-O", tarball, url], stderr=subprocess.STDOUT) | 30 | subprocess.check_output(["wget", "-O", tarball, url], stderr=subprocess.STDOUT) |
31 | if dl_dir and not os.path.exists(archive_tarball): | ||
32 | shutil.copyfile(tarball, archive_tarball) | ||
30 | return tarball | 33 | return tarball |
31 | 34 | ||
32 | def check_elf(self, path, target_os=None, target_arch=None): | 35 | def check_elf(self, path, target_os=None, target_arch=None): |