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
1=== modified file 'scripts/publish_to_snapshots.py'
2--- scripts/publish_to_snapshots.py 2012-05-01 10:08:32 +0000
3+++ scripts/publish_to_snapshots.py 2012-05-02 18:36:17 +0000
4@@ -30,6 +30,7 @@
5 'kernel-hwpack',
6 'ubuntu-hwpacks',
7 'ubuntu-images',
8+ 'ubuntu-restricted',
9 'ubuntu-sysroots',
10 'binaries'
11 ]
12@@ -55,7 +56,8 @@
13 elif args.job_type == "kernel-hwpack":
14 ret_val = jobname.split('_')[0].replace(".", "_")
15 elif args.job_type == "ubuntu-hwpacks" or \
16- args.job_type == "ubuntu-images" or \
17+ args.job_type == "ubuntu-images" or\
18+ args.job_type == "ubuntu-restricted" or\
19 args.job_type == "ubuntu-sysroots":
20 ret_val = jobname.split('-', 2)
21 elif args.job_type == "prebuilt":
22@@ -86,7 +88,8 @@
23 args.job_name])
24 target_dir_path = os.path.join(target_path, target_dir)
25 elif args.job_type == "ubuntu-hwpacks" or \
26- args.job_type == "ubuntu-images" or \
27+ args.job_type == "ubuntu-images" or\
28+ args.job_type == "ubuntu-restricted" or\
29 args.job_type == "ubuntu-sysroots":
30 dist_name = ret_val[0]
31 hwpack_image = args.job_type.split("-")[1]
32@@ -218,6 +221,7 @@
33 if args.job_type == "android" or\
34 args.job_type == "ubuntu-hwpacks" or\
35 args.job_type == "ubuntu-images" or\
36+ args.job_type == "ubuntu-restricted" or\
37 args.job_type == "ubuntu-sysroots":
38 ret = self.create_symlink(args, target_dir_path)
39 if ret != PASS:
40
41=== modified file 'testing/test_publish_to_snapshots.py'
42--- testing/test_publish_to_snapshots.py 2012-04-30 16:20:02 +0000
43+++ testing/test_publish_to_snapshots.py 2012-05-02 18:36:17 +0000
44@@ -56,6 +56,9 @@
45 param = self.parser.parse_args(['-t', 'ubuntu-images', '-j', 'dummy_job_name',
46 '-n', '1'])
47 self.publisher.validate_args(param)
48+ param = self.parser.parse_args(['-t', 'ubuntu-restricted', '-j', 'dummy_job_name',
49+ '-n', '1'])
50+ self.publisher.validate_args(param)
51 param = self.parser.parse_args(['-t', 'ubuntu-sysroots', '-j', 'dummy_job_name',
52 '-n', '1'])
53 self.publisher.validate_args(param)
54@@ -284,6 +287,31 @@
55 stdout.seek(0)
56 self.assertIn("Moved the files from", stdout.read())
57
58+ def test_move_artifacts_ubuntu_restricted_successful_move(self):
59+ orig_stdout = sys.stdout
60+ stdout = sys.stdout = StringIO()
61+ self.publisher = SnapshotsPublisher()
62+ param = self.parser.parse_args(['-t', 'ubuntu-restricted', '-j',
63+ 'precise-armhf-integrated-big.little-fastmodels',
64+ '-n', '1'])
65+ self.publisher.validate_args(param)
66+ build_dir = '/'.join([param.job_name, str(param.build_num)])
67+ build_path = os.path.join(self.uploads_path, build_dir)
68+ os.makedirs(build_path)
69+ tempfile.mkstemp(dir=build_path)
70+ try:
71+ uploads_dir_path, target_dir_path = self.publisher.validate_paths(param,
72+ self.uploads_path, self.target_path)
73+ uploads_dir_path = os.path.join(self.orig_dir, uploads_dir_path)
74+ target_dir_path = os.path.join(self.orig_dir, target_dir_path)
75+ self.publisher.move_artifacts(param, uploads_dir_path, target_dir_path)
76+ finally:
77+ sys.stdout = orig_stdout
78+ pass
79+
80+ stdout.seek(0)
81+ self.assertIn("Moved the files from", stdout.read())
82+
83 def test_move_artifacts_ubuntu_sysroots_successful_move(self):
84 orig_stdout = sys.stdout
85 stdout = sys.stdout = StringIO()

Subscribers

People subscribed via source and target branches