summaryrefslogtreecommitdiffstats
path: root/scripts/test-remote-image
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/test-remote-image')
-rwxr-xr-xscripts/test-remote-image27
1 files changed, 16 insertions, 11 deletions
diff --git a/scripts/test-remote-image b/scripts/test-remote-image
index 7d02a84806..8120a6257f 100755
--- a/scripts/test-remote-image
+++ b/scripts/test-remote-image
@@ -78,6 +78,7 @@ def get_args_parser():
78 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.') 78 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.')
79 parser.add_argument('--targetprofile', required=False, action="store", nargs=1, dest="targetprofile", default='AutoTargetProfile', help='The target profile to be used.') 79 parser.add_argument('--targetprofile', required=False, action="store", nargs=1, dest="targetprofile", default='AutoTargetProfile', help='The target profile to be used.')
80 parser.add_argument('--repoprofile', required=False, action="store", nargs=1, dest="repoprofile", default='PublicAB', help='The repo profile to be used.') 80 parser.add_argument('--repoprofile', required=False, action="store", nargs=1, dest="repoprofile", default='PublicAB', help='The repo profile to be used.')
81 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.')
81 return parser 82 return parser
82 83
83class BaseTargetProfile(object): 84class BaseTargetProfile(object):
@@ -248,13 +249,14 @@ class PublicAB(BaseRepoProfile):
248 249
249class HwAuto(): 250class HwAuto():
250 251
251 def __init__(self, image_types, repolink, required_packages, targetprofile, repoprofile): 252 def __init__(self, image_types, repolink, required_packages, targetprofile, repoprofile, skip_download):
252 log.info('Initializing..') 253 log.info('Initializing..')
253 self.image_types = image_types 254 self.image_types = image_types
254 self.repolink = repolink 255 self.repolink = repolink
255 self.required_packages = required_packages 256 self.required_packages = required_packages
256 self.targetprofile = targetprofile 257 self.targetprofile = targetprofile
257 self.repoprofile = repoprofile 258 self.repoprofile = repoprofile
259 self.skip_download = skip_download
258 self.repo = self.get_repo_profile(self.repolink) 260 self.repo = self.get_repo_profile(self.repolink)
259 261
260 # Get the repository profile; for now we only look inside this module. 262 # Get the repository profile; for now we only look inside this module.
@@ -304,15 +306,18 @@ class HwAuto():
304 # For each image type, download the needed files and run the tests. 306 # For each image type, download the needed files and run the tests.
305 noissuesfound = True 307 noissuesfound = True
306 for image_type in self.image_types: 308 for image_type in self.image_types:
307 target = self.get_target_profile(image_type) 309 if self.skip_download:
308 files_dict = target.get_files_dict() 310 log.info("Skipping downloading the images..")
309 log.info("Downloading files for %s" % image_type) 311 else:
310 for f in files_dict: 312 target = self.get_target_profile(image_type)
311 if self.repo.check_old_file(files_dict[f]): 313 files_dict = target.get_files_dict()
312 filepath = os.path.join(self.repo.localdir, files_dict[f]) 314 log.info("Downloading files for %s" % image_type)
313 if os.path.exists(filepath): 315 for f in files_dict:
314 os.remove(filepath) 316 if self.repo.check_old_file(files_dict[f]):
315 self.repo.fetch(files_dict[f]) 317 filepath = os.path.join(self.repo.localdir, files_dict[f])
318 if os.path.exists(filepath):
319 os.remove(filepath)
320 self.repo.fetch(files_dict[f])
316 321
317 result = self.runTestimageBuild(image_type) 322 result = self.runTestimageBuild(image_type)
318 if result.status != 0: 323 if result.status != 0:
@@ -331,7 +336,7 @@ def main():
331 parser = get_args_parser() 336 parser = get_args_parser()
332 args = parser.parse_args() 337 args = parser.parse_args()
333 338
334 hwauto = HwAuto(image_types=args.image_types, repolink=args.repo_link, required_packages=args.required_packages, targetprofile=args.targetprofile, repoprofile=args.repoprofile) 339 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)
335 340
336 hwauto.run() 341 hwauto.run()
337 342