summaryrefslogtreecommitdiffstats
path: root/scripts/test-remote-image
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/test-remote-image')
-rwxr-xr-xscripts/test-remote-image41
1 files changed, 28 insertions, 13 deletions
diff --git a/scripts/test-remote-image b/scripts/test-remote-image
index 7d02a84806..f3a44ebe51 100755
--- a/scripts/test-remote-image
+++ b/scripts/test-remote-image
@@ -32,8 +32,15 @@ import logging
import shutil
from abc import ABCMeta, abstractmethod
+# Add path to scripts/lib in sys.path;
+scripts_path = os.path.abspath(os.path.dirname(os.path.abspath(sys.argv[0])))
+lib_path = scripts_path + '/lib'
+sys.path = sys.path + [lib_path]
+
+import scriptpath
+
# Add meta/lib to sys.path
-sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'meta/lib')))
+scriptpath.add_oe_lib_path()
import oeqa.utils.ftools as ftools
from oeqa.utils.commands import runCmd, bitbake, get_bb_var
@@ -43,7 +50,10 @@ for path in get_bb_var('BBPATH').split(":"):
sys.path.insert(0, os.path.abspath(os.path.join(path, 'lib')))
# In order to import modules that contain target controllers, we need the bitbake libraries in sys.path .
-sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'bitbake/lib')))
+bitbakepath = scriptpath.add_bitbake_lib_path()
+if not bitbakepath:
+ sys.stderr.write("Unable to find bitbake by searching parent directory of this script or PATH\n")
+ sys.exit(1)
# create a logger
def logger_create():
@@ -78,6 +88,7 @@ def get_args_parser():
parser.add_argument('--required-packages', required=False, action="store", nargs='*', dest="required_packages", default=None, help='Required packages for the tests. They will be built before the testing begins.')
parser.add_argument('--targetprofile', required=False, action="store", nargs=1, dest="targetprofile", default='AutoTargetProfile', help='The target profile to be used.')
parser.add_argument('--repoprofile', required=False, action="store", nargs=1, dest="repoprofile", default='PublicAB', help='The repo profile to be used.')
+ parser.add_argument('--skip-download', required=False, action="store_true", dest="skip_download", default=False, help='Skip downloading the images completely. This needs the correct files to be present in the directory specified by the target profile.')
return parser
class BaseTargetProfile(object):
@@ -248,13 +259,14 @@ class PublicAB(BaseRepoProfile):
class HwAuto():
- def __init__(self, image_types, repolink, required_packages, targetprofile, repoprofile):
+ def __init__(self, image_types, repolink, required_packages, targetprofile, repoprofile, skip_download):
log.info('Initializing..')
self.image_types = image_types
self.repolink = repolink
self.required_packages = required_packages
self.targetprofile = targetprofile
self.repoprofile = repoprofile
+ self.skip_download = skip_download
self.repo = self.get_repo_profile(self.repolink)
# Get the repository profile; for now we only look inside this module.
@@ -304,15 +316,18 @@ class HwAuto():
# For each image type, download the needed files and run the tests.
noissuesfound = True
for image_type in self.image_types:
- target = self.get_target_profile(image_type)
- files_dict = target.get_files_dict()
- log.info("Downloading files for %s" % image_type)
- for f in files_dict:
- if self.repo.check_old_file(files_dict[f]):
- filepath = os.path.join(self.repo.localdir, files_dict[f])
- if os.path.exists(filepath):
- os.remove(filepath)
- self.repo.fetch(files_dict[f])
+ if self.skip_download:
+ log.info("Skipping downloading the images..")
+ else:
+ target = self.get_target_profile(image_type)
+ files_dict = target.get_files_dict()
+ log.info("Downloading files for %s" % image_type)
+ for f in files_dict:
+ if self.repo.check_old_file(files_dict[f]):
+ filepath = os.path.join(self.repo.localdir, files_dict[f])
+ if os.path.exists(filepath):
+ os.remove(filepath)
+ self.repo.fetch(files_dict[f])
result = self.runTestimageBuild(image_type)
if result.status != 0:
@@ -331,7 +346,7 @@ def main():
parser = get_args_parser()
args = parser.parse_args()
- hwauto = HwAuto(image_types=args.image_types, repolink=args.repo_link, required_packages=args.required_packages, targetprofile=args.targetprofile, repoprofile=args.repoprofile)
+ hwauto = HwAuto(image_types=args.image_types, repolink=args.repo_link, required_packages=args.required_packages, targetprofile=args.targetprofile, repoprofile=args.repoprofile, skip_download=args.skip_download)
hwauto.run()