Merge lp:~fboudra/linaro-license-protection/ubuntu-restricted-job-type into lp:~linaro-automation/linaro-license-protection/trunk

Proposed by Fathi Boudra
Status: Merged
Approved by: Deepti B. Kalakeri
Approved revision: 67
Merged at revision: 67
Proposed branch: lp:~fboudra/linaro-license-protection/ubuntu-restricted-job-type
Merge into: lp:~linaro-automation/linaro-license-protection/trunk
Diff against target: 85 lines (+34/-2)
2 files modified
scripts/publish_to_snapshots.py (+6/-2)
testing/test_publish_to_snapshots.py (+28/-0)
To merge this branch: bzr merge lp:~fboudra/linaro-license-protection/ubuntu-restricted-job-type
Reviewer Review Type Date Requested Status
Linaro Infrastructure Pending
Review via email: mp+104433@code.launchpad.net

Description of the change

Add ubuntu-restricted job type.

To post a comment you must log in.
Revision history for this message
Deepti B. Kalakeri (deeptik) wrote :

Looks good.+1

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'scripts/publish_to_snapshots.py'
--- scripts/publish_to_snapshots.py 2012-05-01 10:08:32 +0000
+++ scripts/publish_to_snapshots.py 2012-05-02 18:36:17 +0000
@@ -30,6 +30,7 @@
30 'kernel-hwpack',30 'kernel-hwpack',
31 'ubuntu-hwpacks',31 'ubuntu-hwpacks',
32 'ubuntu-images',32 'ubuntu-images',
33 'ubuntu-restricted',
33 'ubuntu-sysroots',34 'ubuntu-sysroots',
34 'binaries'35 'binaries'
35 ]36 ]
@@ -55,7 +56,8 @@
55 elif args.job_type == "kernel-hwpack":56 elif args.job_type == "kernel-hwpack":
56 ret_val = jobname.split('_')[0].replace(".", "_")57 ret_val = jobname.split('_')[0].replace(".", "_")
57 elif args.job_type == "ubuntu-hwpacks" or \58 elif args.job_type == "ubuntu-hwpacks" or \
58 args.job_type == "ubuntu-images" or \59 args.job_type == "ubuntu-images" or\
60 args.job_type == "ubuntu-restricted" or\
59 args.job_type == "ubuntu-sysroots":61 args.job_type == "ubuntu-sysroots":
60 ret_val = jobname.split('-', 2)62 ret_val = jobname.split('-', 2)
61 elif args.job_type == "prebuilt":63 elif args.job_type == "prebuilt":
@@ -86,7 +88,8 @@
86 args.job_name])88 args.job_name])
87 target_dir_path = os.path.join(target_path, target_dir)89 target_dir_path = os.path.join(target_path, target_dir)
88 elif args.job_type == "ubuntu-hwpacks" or \90 elif args.job_type == "ubuntu-hwpacks" or \
89 args.job_type == "ubuntu-images" or \91 args.job_type == "ubuntu-images" or\
92 args.job_type == "ubuntu-restricted" or\
90 args.job_type == "ubuntu-sysroots":93 args.job_type == "ubuntu-sysroots":
91 dist_name = ret_val[0]94 dist_name = ret_val[0]
92 hwpack_image = args.job_type.split("-")[1]95 hwpack_image = args.job_type.split("-")[1]
@@ -218,6 +221,7 @@
218 if args.job_type == "android" or\221 if args.job_type == "android" or\
219 args.job_type == "ubuntu-hwpacks" or\222 args.job_type == "ubuntu-hwpacks" or\
220 args.job_type == "ubuntu-images" or\223 args.job_type == "ubuntu-images" or\
224 args.job_type == "ubuntu-restricted" or\
221 args.job_type == "ubuntu-sysroots":225 args.job_type == "ubuntu-sysroots":
222 ret = self.create_symlink(args, target_dir_path)226 ret = self.create_symlink(args, target_dir_path)
223 if ret != PASS:227 if ret != PASS:
224228
=== modified file 'testing/test_publish_to_snapshots.py'
--- testing/test_publish_to_snapshots.py 2012-04-30 16:20:02 +0000
+++ testing/test_publish_to_snapshots.py 2012-05-02 18:36:17 +0000
@@ -56,6 +56,9 @@
56 param = self.parser.parse_args(['-t', 'ubuntu-images', '-j', 'dummy_job_name',56 param = self.parser.parse_args(['-t', 'ubuntu-images', '-j', 'dummy_job_name',
57 '-n', '1'])57 '-n', '1'])
58 self.publisher.validate_args(param)58 self.publisher.validate_args(param)
59 param = self.parser.parse_args(['-t', 'ubuntu-restricted', '-j', 'dummy_job_name',
60 '-n', '1'])
61 self.publisher.validate_args(param)
59 param = self.parser.parse_args(['-t', 'ubuntu-sysroots', '-j', 'dummy_job_name',62 param = self.parser.parse_args(['-t', 'ubuntu-sysroots', '-j', 'dummy_job_name',
60 '-n', '1'])63 '-n', '1'])
61 self.publisher.validate_args(param)64 self.publisher.validate_args(param)
@@ -284,6 +287,31 @@
284 stdout.seek(0)287 stdout.seek(0)
285 self.assertIn("Moved the files from", stdout.read())288 self.assertIn("Moved the files from", stdout.read())
286289
290 def test_move_artifacts_ubuntu_restricted_successful_move(self):
291 orig_stdout = sys.stdout
292 stdout = sys.stdout = StringIO()
293 self.publisher = SnapshotsPublisher()
294 param = self.parser.parse_args(['-t', 'ubuntu-restricted', '-j',
295 'precise-armhf-integrated-big.little-fastmodels',
296 '-n', '1'])
297 self.publisher.validate_args(param)
298 build_dir = '/'.join([param.job_name, str(param.build_num)])
299 build_path = os.path.join(self.uploads_path, build_dir)
300 os.makedirs(build_path)
301 tempfile.mkstemp(dir=build_path)
302 try:
303 uploads_dir_path, target_dir_path = self.publisher.validate_paths(param,
304 self.uploads_path, self.target_path)
305 uploads_dir_path = os.path.join(self.orig_dir, uploads_dir_path)
306 target_dir_path = os.path.join(self.orig_dir, target_dir_path)
307 self.publisher.move_artifacts(param, uploads_dir_path, target_dir_path)
308 finally:
309 sys.stdout = orig_stdout
310 pass
311
312 stdout.seek(0)
313 self.assertIn("Moved the files from", stdout.read())
314
287 def test_move_artifacts_ubuntu_sysroots_successful_move(self):315 def test_move_artifacts_ubuntu_sysroots_successful_move(self):
288 orig_stdout = sys.stdout316 orig_stdout = sys.stdout
289 stdout = sys.stdout = StringIO()317 stdout = sys.stdout = StringIO()

Subscribers

People subscribed via source and target branches