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
1=== modified file 'scripts/publish_to_snapshots.py'
2--- scripts/publish_to_snapshots.py 2012-04-24 10:41:13 +0000
3+++ scripts/publish_to_snapshots.py 2012-04-24 13:25:36 +0000
4@@ -11,10 +11,10 @@
5 help="Specify the job type (Ex: android/kernel-hwpack)")
6 parser.add_argument("-j", "--job-name", dest="job_name",
7 help="Specify the job name which resulted the archive to be stored.\
8- Ex: ${JOB_NAME} should be specified for android/ubuntu-hwpacks/ubuntu-images/binaries and for \
9+ Ex: ${JOB_NAME} should be specified for android/ubuntu-hwpacks/ubuntu-images/ubuntu-sysroots/binaries and for \
10 kernel-hwpack ${KERNEL_JOB_NAME}")
11 parser.add_argument("-n", "--build-num", dest="build_num", type=int,
12- help="Specify the job build number for android/ubuntu-hwpacks/ubuntu-images/binaries")
13+ help="Specify the job build number for android/ubuntu-hwpacks/ubuntu-images/ubuntu-sysroots/binaries")
14 parser.add_argument("-m", "--manifest", dest="manifest", action='store_true',
15 help="Optional parameter to generate MANIFEST file")
16
17@@ -28,6 +28,7 @@
18 'kernel-hwpack',
19 'ubuntu-hwpacks',
20 'ubuntu-images',
21+ 'ubuntu-sysroots',
22 'binaries'
23 ]
24
25@@ -52,7 +53,8 @@
26 elif args.job_type == "kernel-hwpack":
27 ret_val = jobname.split('_')[0].replace(".", "_")
28 elif args.job_type == "ubuntu-hwpacks" or \
29- args.job_type == "ubuntu-images":
30+ args.job_type == "ubuntu-images" or \
31+ args.job_type == "ubuntu-sysroots":
32 ret_val = jobname.split('-', 2)
33 elif args.job_type == "prebuilt":
34 ret_val = '' #just need non-null since its isn't needed
35@@ -82,7 +84,8 @@
36 args.job_name])
37 target_dir_path = os.path.join(target_path, target_dir)
38 elif args.job_type == "ubuntu-hwpacks" or \
39- args.job_type == "ubuntu-images":
40+ args.job_type == "ubuntu-images" or \
41+ args.job_type == "ubuntu-sysroots":
42 dist_name = ret_val[0]
43 hwpack_image = args.job_type.split("-")[1]
44 board_rootfs_name = ret_val[2]
45
46=== modified file 'testing/test_publish_to_snapshots.py'
47--- testing/test_publish_to_snapshots.py 2012-04-18 08:12:36 +0000
48+++ testing/test_publish_to_snapshots.py 2012-04-24 13:25:36 +0000
49@@ -56,6 +56,9 @@
50 param = self.parser.parse_args(['-t', 'ubuntu-images', '-j', 'dummy_job_name',
51 '-n', '1'])
52 self.publisher.validate_args(param)
53+ param = self.parser.parse_args(['-t', 'ubuntu-sysroots', '-j', 'dummy_job_name',
54+ '-n', '1'])
55+ self.publisher.validate_args(param)
56 param = self.parser.parse_args(['-t', 'binaries', '-j', 'dummy_job_name',
57 '-n', '1'])
58 self.publisher.validate_args(param)
59@@ -281,6 +284,30 @@
60 stdout.seek(0)
61 self.assertIn("Moved the files from", stdout.read())
62
63+ def test_move_artifacts_ubuntu_sysroots_successful_move(self):
64+ orig_stdout = sys.stdout
65+ stdout = sys.stdout = StringIO()
66+ self.publisher = SnapshotsPublisher()
67+ param = self.parser.parse_args(['-t', 'ubuntu-sysroots', '-j',
68+ 'precise-armhf-ubuntu-desktop-dev', '-n', '1'])
69+ self.publisher.validate_args(param)
70+ build_dir = '/'.join([param.job_name, str(param.build_num)])
71+ build_path = os.path.join(self.uploads_path, build_dir)
72+ os.makedirs(build_path)
73+ tempfile.mkstemp(dir=build_path)
74+ try:
75+ uploads_dir_path, target_dir_path = self.publisher.validate_paths(param,
76+ self.uploads_path, self.target_path)
77+ uploads_dir_path = os.path.join(self.orig_dir, uploads_dir_path)
78+ target_dir_path = os.path.join(self.orig_dir, target_dir_path)
79+ self.publisher.move_artifacts(param, uploads_dir_path, target_dir_path)
80+ finally:
81+ sys.stdout = orig_stdout
82+ pass
83+
84+ stdout.seek(0)
85+ self.assertIn("Moved the files from", stdout.read())
86+
87 def test_move_artifacts_binaries_successful_move(self):
88 orig_stdout = sys.stdout
89 stdout = sys.stdout = StringIO()

Subscribers

People subscribed via source and target branches