Skip to content

Commit

Permalink
oeqa/sdk/case: Ensure DL_DIR is populated with artefacts if used
Browse files Browse the repository at this point in the history
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 <[email protected]>
(cherry picked from commit a328495)
Signed-off-by: Steve Sakoman <[email protected]>
  • Loading branch information
rpurdie authored and sakoman committed Jul 29, 2024
1 parent ffbdff9 commit 0265025
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions meta/lib/oeqa/sdk/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import os
import subprocess
import shutil

from oeqa.core.case import OETestCase

Expand All @@ -21,12 +22,14 @@ def fetch(self, workdir, dl_dir, url, archive=None):
archive = os.path.basename(urlparse(url).path)

if dl_dir:
tarball = os.path.join(dl_dir, archive)
if os.path.exists(tarball):
return tarball
archive_tarball = os.path.join(dl_dir, archive)
if os.path.exists(archive_tarball):
return archive_tarball

tarball = os.path.join(workdir, archive)
subprocess.check_output(["wget", "-O", tarball, url], stderr=subprocess.STDOUT)
if dl_dir and not os.path.exists(archive_tarball):
shutil.copyfile(tarball, archive_tarball)
return tarball

def check_elf(self, path, target_os=None, target_arch=None):
Expand Down

0 comments on commit 0265025

Please sign in to comment.