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

Proposed by Fathi Boudra
Status: Merged
Merged at revision: 61
Proposed branch: lp:~fboudra/linaro-license-protection/add-ubuntu-sysroots-job-type-lp987234
Merge into: lp:~linaro-automation/linaro-license-protection/trunk
Diff against target: 89 lines (+34/-4)
2 files modified
scripts/publish_to_snapshots.py (+7/-4)
testing/test_publish_to_snapshots.py (+27/-0)
To merge this branch: bzr merge lp:~fboudra/linaro-license-protection/add-ubuntu-sysroots-job-type-lp987234
Reviewer Review Type Date Requested Status
Deepti B. Kalakeri (community) Approve
Review via email: mp+103278@code.launchpad.net

Description of the change

Add ubuntu-sysroots job type. (LP: #987234)

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

Looks good.
+1

Thanks!!!
Deepti.

review: Approve

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-04-24 10:41:13 +0000
+++ scripts/publish_to_snapshots.py 2012-04-24 13:25:36 +0000
@@ -11,10 +11,10 @@
11 help="Specify the job type (Ex: android/kernel-hwpack)")11 help="Specify the job type (Ex: android/kernel-hwpack)")
12parser.add_argument("-j", "--job-name", dest="job_name",12parser.add_argument("-j", "--job-name", dest="job_name",
13 help="Specify the job name which resulted the archive to be stored.\13 help="Specify the job name which resulted the archive to be stored.\
14 Ex: ${JOB_NAME} should be specified for android/ubuntu-hwpacks/ubuntu-images/binaries and for \14 Ex: ${JOB_NAME} should be specified for android/ubuntu-hwpacks/ubuntu-images/ubuntu-sysroots/binaries and for \
15 kernel-hwpack ${KERNEL_JOB_NAME}")15 kernel-hwpack ${KERNEL_JOB_NAME}")
16parser.add_argument("-n", "--build-num", dest="build_num", type=int,16parser.add_argument("-n", "--build-num", dest="build_num", type=int,
17 help="Specify the job build number for android/ubuntu-hwpacks/ubuntu-images/binaries")17 help="Specify the job build number for android/ubuntu-hwpacks/ubuntu-images/ubuntu-sysroots/binaries")
18parser.add_argument("-m", "--manifest", dest="manifest", action='store_true',18parser.add_argument("-m", "--manifest", dest="manifest", action='store_true',
19 help="Optional parameter to generate MANIFEST file")19 help="Optional parameter to generate MANIFEST file")
2020
@@ -28,6 +28,7 @@
28 'kernel-hwpack',28 'kernel-hwpack',
29 'ubuntu-hwpacks',29 'ubuntu-hwpacks',
30 'ubuntu-images',30 'ubuntu-images',
31 'ubuntu-sysroots',
31 'binaries'32 'binaries'
32 ]33 ]
3334
@@ -52,7 +53,8 @@
52 elif args.job_type == "kernel-hwpack":53 elif args.job_type == "kernel-hwpack":
53 ret_val = jobname.split('_')[0].replace(".", "_")54 ret_val = jobname.split('_')[0].replace(".", "_")
54 elif args.job_type == "ubuntu-hwpacks" or \55 elif args.job_type == "ubuntu-hwpacks" or \
55 args.job_type == "ubuntu-images":56 args.job_type == "ubuntu-images" or \
57 args.job_type == "ubuntu-sysroots":
56 ret_val = jobname.split('-', 2)58 ret_val = jobname.split('-', 2)
57 elif args.job_type == "prebuilt":59 elif args.job_type == "prebuilt":
58 ret_val = '' #just need non-null since its isn't needed60 ret_val = '' #just need non-null since its isn't needed
@@ -82,7 +84,8 @@
82 args.job_name])84 args.job_name])
83 target_dir_path = os.path.join(target_path, target_dir)85 target_dir_path = os.path.join(target_path, target_dir)
84 elif args.job_type == "ubuntu-hwpacks" or \86 elif args.job_type == "ubuntu-hwpacks" or \
85 args.job_type == "ubuntu-images":87 args.job_type == "ubuntu-images" or \
88 args.job_type == "ubuntu-sysroots":
86 dist_name = ret_val[0]89 dist_name = ret_val[0]
87 hwpack_image = args.job_type.split("-")[1]90 hwpack_image = args.job_type.split("-")[1]
88 board_rootfs_name = ret_val[2]91 board_rootfs_name = ret_val[2]
8992
=== modified file 'testing/test_publish_to_snapshots.py'
--- testing/test_publish_to_snapshots.py 2012-04-18 08:12:36 +0000
+++ testing/test_publish_to_snapshots.py 2012-04-24 13:25:36 +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-sysroots', '-j', 'dummy_job_name',
60 '-n', '1'])
61 self.publisher.validate_args(param)
59 param = self.parser.parse_args(['-t', 'binaries', '-j', 'dummy_job_name',62 param = self.parser.parse_args(['-t', 'binaries', '-j', 'dummy_job_name',
60 '-n', '1'])63 '-n', '1'])
61 self.publisher.validate_args(param)64 self.publisher.validate_args(param)
@@ -281,6 +284,30 @@
281 stdout.seek(0)284 stdout.seek(0)
282 self.assertIn("Moved the files from", stdout.read())285 self.assertIn("Moved the files from", stdout.read())
283286
287 def test_move_artifacts_ubuntu_sysroots_successful_move(self):
288 orig_stdout = sys.stdout
289 stdout = sys.stdout = StringIO()
290 self.publisher = SnapshotsPublisher()
291 param = self.parser.parse_args(['-t', 'ubuntu-sysroots', '-j',
292 'precise-armhf-ubuntu-desktop-dev', '-n', '1'])
293 self.publisher.validate_args(param)
294 build_dir = '/'.join([param.job_name, str(param.build_num)])
295 build_path = os.path.join(self.uploads_path, build_dir)
296 os.makedirs(build_path)
297 tempfile.mkstemp(dir=build_path)
298 try:
299 uploads_dir_path, target_dir_path = self.publisher.validate_paths(param,
300 self.uploads_path, self.target_path)
301 uploads_dir_path = os.path.join(self.orig_dir, uploads_dir_path)
302 target_dir_path = os.path.join(self.orig_dir, target_dir_path)
303 self.publisher.move_artifacts(param, uploads_dir_path, target_dir_path)
304 finally:
305 sys.stdout = orig_stdout
306 pass
307
308 stdout.seek(0)
309 self.assertIn("Moved the files from", stdout.read())
310
284 def test_move_artifacts_binaries_successful_move(self):311 def test_move_artifacts_binaries_successful_move(self):
285 orig_stdout = sys.stdout312 orig_stdout = sys.stdout
286 stdout = sys.stdout = StringIO()313 stdout = sys.stdout = StringIO()

Subscribers

People subscribed via source and target branches