Merge lp:~ubuntu-desktop/ubuntu-cdimage/ubuntu-next-system-image into lp:ubuntu-cdimage
- ubuntu-next-system-image
- Merge into mainline
Status: | Merged |
---|---|
Merged at revision: | 1518 |
Proposed branch: | lp:~ubuntu-desktop/ubuntu-cdimage/ubuntu-next-system-image |
Merge into: | lp:ubuntu-cdimage |
Diff against target: |
269 lines (+105/-13) 7 files modified
etc/crontab (+1/-1) etc/default-arches (+1/-1) etc/qa-products (+1/-0) lib/cdimage/build.py (+28/-8) lib/cdimage/livefs.py (+8/-3) lib/cdimage/tests/test_build.py (+61/-0) lib/cdimage/tree.py (+5/-0) |
To merge this branch: | bzr merge lp:~ubuntu-desktop/ubuntu-cdimage/ubuntu-next-system-image |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Colin Watson (community) | Approve | ||
Review via email: mp+257057@code.launchpad.net |
Commit message
Description of the change
Experimenting transforming ubuntu-desktop-next to a system-image base
Didier Roche-Tolomelli (didrocks) wrote : | # |
In addition to my inline comments, I did push some fixes which should address all your comments. Working with robert on the tests now.
The release team has been poked and the isotracker change will be soon there (thanks Laney). Please see the reasoning why I'm not renaming the image removing the -next suffix.
Thanks for the initial review (and explanations when there is no need to add the system-image subproject differentiation).
- 1509. By Didier Roche-Tolomelli
-
Ensure we are backward compatible to build older desktop-next images, various typo fixes and factorize some work in functions
Colin Watson (cjwatson) wrote : | # |
Your call on the image naming. There are some Boolean logic problems here that need to be fixed, but aside from that I'm happy.
- 1510. By Didier Roche-Tolomelli
-
Correct logic for ubuntu-desktop-next and non system-image case
Fix as well some pep8 issues and missing is_live_fs_only() parameter
in call. - 1511. By Didier Roche-Tolomelli
-
Fix existing ubuntu-desktop-next test
- 1512. By Didier Roche-Tolomelli
-
Merge Robert's ubuntu-
desktop- next-test - 1513. By Didier Roche-Tolomelli
-
Add a test for desktop-next system image
Didier Roche-Tolomelli (didrocks) wrote : | # |
We added a test for ubuntu-desktop-next system image, based on the existing ubuntu-desktop-next one.
Just a note, we are unsure if the artefacts that we counted (as they are the same than the other tests) makes sense.
Preview Diff
1 | === modified file 'etc/crontab' |
2 | --- etc/crontab 2015-04-16 20:24:54 +0000 |
3 | +++ etc/crontab 2015-04-22 15:04:54 +0000 |
4 | @@ -20,7 +20,7 @@ |
5 | 32 14 * * * DIST=trusty for-project ubuntu-gnome cron.daily-live --live |
6 | # regular vivid daily builds |
7 | 31 7 * * * for-project ubuntu cron.daily-live --live |
8 | -22 3 * * * for-project ubuntu-desktop-next cron.daily-live --live |
9 | +22 3 * * * SUBPROJECT=system-image for-project ubuntu-desktop-next cron.daily-preinstalled --live |
10 | 14 5 * * * for-project kubuntu cron.daily-live --live |
11 | 24 0 * * * for-project edubuntu cron.dvd --live |
12 | 50 9 * * * for-project xubuntu cron.daily-live --live |
13 | |
14 | === modified file 'etc/default-arches' |
15 | --- etc/default-arches 2015-03-20 20:01:29 +0000 |
16 | +++ etc/default-arches 2015-04-22 15:04:54 +0000 |
17 | @@ -55,7 +55,7 @@ |
18 | ubuntu daily-live raring-trusty amd64 amd64+mac i386 |
19 | ubuntu daily-live utopic- amd64 i386 |
20 | |
21 | -ubuntu-desktop-next * * amd64 i386 |
22 | +ubuntu-desktop-next * * amd64 i386 armhf |
23 | |
24 | ubuntu-gnome * * amd64 i386 |
25 | |
26 | |
27 | === modified file 'etc/qa-products' |
28 | --- etc/qa-products 2015-02-25 11:39:07 +0000 |
29 | +++ etc/qa-products 2015-04-22 15:04:54 +0000 |
30 | @@ -50,6 +50,7 @@ |
31 | Ubuntu Desktop Preinstalled armhf+nexus7 ubuntu daily-preinstalled preinstalled-desktop armhf+nexus7 iso |
32 | |
33 | # Ubuntu Desktop Next |
34 | +Ubuntu Desktop (Unity 8) armhf ubuntu-desktop-next daily-live desktop armhf iso |
35 | Ubuntu Desktop (Unity 8) amd64 ubuntu-desktop-next daily-live desktop amd64 iso |
36 | Ubuntu Desktop (Unity 8) i386 ubuntu-desktop-next daily-live desktop i386 iso |
37 | |
38 | |
39 | === modified file 'lib/cdimage/build.py' |
40 | --- lib/cdimage/build.py 2015-01-29 04:56:17 +0000 |
41 | +++ lib/cdimage/build.py 2015-04-22 15:04:54 +0000 |
42 | @@ -458,7 +458,9 @@ |
43 | log_marker("Downloading live filesystem images") |
44 | download_live_filesystems(config) |
45 | |
46 | - if config.project in ("ubuntu-core", "ubuntu-touch"): |
47 | + if (config.project in ("ubuntu-core", "ubuntu-touch") or |
48 | + (config.project == "ubuntu-desktop-next" and |
49 | + config.subproject == "system-image")): |
50 | log_marker("Copying images to debian-cd output directory") |
51 | scratch_dir = os.path.join( |
52 | config.root, "scratch", config.project, config.full_series, |
53 | @@ -482,6 +484,16 @@ |
54 | output_prefix = os.path.join( |
55 | output_dir, |
56 | "%s-preinstalled-touch-%s" % (config.series, arch)) |
57 | + elif config.project == "ubuntu-desktop-next": |
58 | + if config.image_type == "daily-preinstalled": |
59 | + output_prefix = os.path.join( |
60 | + output_dir, |
61 | + "%s-preinstalled-desktop-next-%s" % |
62 | + (config.series, arch)) |
63 | + else: |
64 | + output_prefix = os.path.join( |
65 | + output_dir, "%s-desktop-next-%s" % |
66 | + (config.series, arch)) |
67 | shutil.copy2(rootfs, "%s.raw" % output_prefix) |
68 | with open("%s.type" % output_prefix, "w") as f: |
69 | print("tar archive", file=f) |
70 | @@ -495,7 +507,7 @@ |
71 | if os.path.exists(custom): |
72 | shutil.copy2( |
73 | custom, "%s.custom.tar.gz" % output_prefix) |
74 | - if config.project == "ubuntu-core": |
75 | + if config.project in ("ubuntu-core", "ubuntu-desktop-next"): |
76 | device = "%s.device.tar.gz" % live_prefix |
77 | if os.path.exists(device): |
78 | shutil.copy2( |
79 | @@ -639,15 +651,23 @@ |
80 | body.close() |
81 | |
82 | |
83 | +def is_live_fs_only(config): |
84 | + live_fs_only = False |
85 | + if config.project in ("livecd-base", "ubuntu-core", "ubuntu-touch"): |
86 | + live_fs_only = True |
87 | + elif (config.project == "ubuntu-desktop-next" and |
88 | + config.subproject == "system-image"): |
89 | + live_fs_only = True |
90 | + elif config.subproject == "wubi": |
91 | + live_fs_only = True |
92 | + return live_fs_only |
93 | + |
94 | + |
95 | def build_image_set_locked(config, options, semaphore_state): |
96 | image_type = config.image_type |
97 | config["CDIMAGE_DATE"] = date = next_build_id(config, image_type) |
98 | log_path = None |
99 | |
100 | - live_fs_only = ( |
101 | - config.project in ("livecd-base", "ubuntu-core", "ubuntu-touch") or |
102 | - config.subproject == "wubi") |
103 | - |
104 | try: |
105 | configure_for_project(config) |
106 | log_path = open_log(config) |
107 | @@ -659,7 +679,7 @@ |
108 | else: |
109 | tracker_set_rebuild_status(config, [0, 1], 2) |
110 | |
111 | - if not live_fs_only: |
112 | + if not is_live_fs_only(config): |
113 | sync_local_mirror(config, semaphore_state) |
114 | |
115 | if config["LOCAL"]: |
116 | @@ -673,7 +693,7 @@ |
117 | |
118 | if config["UBUNTU_DEFAULTS_LOCALE"]: |
119 | build_ubuntu_defaults_locale(config) |
120 | - elif live_fs_only: |
121 | + elif is_live_fs_only(config): |
122 | build_livecd_base(config) |
123 | else: |
124 | if not config["CDIMAGE_PREINSTALLED"]: |
125 | |
126 | === modified file 'lib/cdimage/livefs.py' |
127 | --- lib/cdimage/livefs.py 2014-11-13 07:16:42 +0000 |
128 | +++ lib/cdimage/livefs.py 2015-04-22 15:04:54 +0000 |
129 | @@ -121,7 +121,9 @@ |
130 | elif subarch in ("ac100", "nexus7"): |
131 | options.extend(["-f", "plain"]) |
132 | |
133 | - if config.project in ("ubuntu-core", "ubuntu-touch"): |
134 | + if (config.project in ("ubuntu-core", "ubuntu-touch") or |
135 | + (config.project == "ubuntu-desktop-next" and |
136 | + config.subproject == "system-image")): |
137 | options.extend(["-f", "plain"]) |
138 | |
139 | if config.subproject == "wubi": |
140 | @@ -882,6 +884,8 @@ |
141 | |
142 | if (project not in ("livecd-base", "ubuntu-core", |
143 | "kubuntu-active") and |
144 | + (project != "ubuntu-desktop-next" or |
145 | + config.subproject == "system-image") and |
146 | (project != "edubuntu" or series >= "precise") and |
147 | (project != "ubuntukylin" or series < "utopic")): |
148 | if series <= "feisty": |
149 | @@ -912,7 +916,8 @@ |
150 | config, arch, "wubi.exe", |
151 | "Install %s" % autorun_project) |
152 | |
153 | - if project not in ("livecd-base", "ubuntu-core", "edubuntu"): |
154 | + if project not in ("livecd-base", "ubuntu-core", |
155 | + "ubuntu-desktop-next", "edubuntu"): |
156 | if (project in ("kubuntu-active", "ubuntu-netbook", |
157 | "ubuntu-moblin-remix") or |
158 | config["CDIMAGE_DVD"] or |
159 | @@ -947,7 +952,7 @@ |
160 | ) |
161 | download_live_items(config, arch, "custom.tar.gz") |
162 | |
163 | - if config.project == "ubuntu-core": |
164 | + if config.project in ("ubuntu-core", "ubuntu-desktop-next"): |
165 | for arch in config.arches: |
166 | download_live_items(config, arch, "device.tar.gz") |
167 | |
168 | |
169 | === modified file 'lib/cdimage/tests/test_build.py' |
170 | --- lib/cdimage/tests/test_build.py 2015-01-29 04:56:17 +0000 |
171 | +++ lib/cdimage/tests/test_build.py 2015-04-22 15:04:54 +0000 |
172 | @@ -343,6 +343,67 @@ |
173 | self.assertTrue(os.path.exists( |
174 | os.path.join(output_dir, recovery_img))) |
175 | |
176 | + @mock.patch("cdimage.osextras.fetch") |
177 | + def test_ubuntu_desktop_next(self, mock_fetch): |
178 | + def fetch_side_effect(config, source, target): |
179 | + if (target.endswith(".manifest") or |
180 | + target.endswith(".rootfs.tar.gz")): |
181 | + touch(target) |
182 | + else: |
183 | + raise osextras.FetchError |
184 | + |
185 | + mock_fetch.side_effect = fetch_side_effect |
186 | + self.config["PROJECT"] = "ubuntu-desktop-next" |
187 | + self.config["DIST"] = "utopic" |
188 | + self.config["IMAGE_TYPE"] = "daily" |
189 | + self.config["ARCHES"] = "i386" |
190 | + self.capture_logging() |
191 | + build_livecd_base(self.config) |
192 | + self.assertLogEqual([ |
193 | + "===== Downloading live filesystem images =====", |
194 | + self.epoch_date, |
195 | + ]) |
196 | + output_dir = os.path.join( |
197 | + self.temp_dir, "scratch", "ubuntu-desktop-next", "utopic", "daily", |
198 | + "live") |
199 | + self.assertTrue(os.path.isdir(output_dir)) |
200 | + self.assertCountEqual([ |
201 | + "i386.manifest", |
202 | + "i386.rootfs.tar.gz", |
203 | + ], os.listdir(output_dir)) |
204 | + |
205 | + @mock.patch("cdimage.osextras.fetch") |
206 | + def test_ubuntu_desktop_next_system_image(self, mock_fetch): |
207 | + def fetch_side_effect(config, source, target): |
208 | + if (target.endswith(".manifest") or |
209 | + target.endswith(".rootfs.tar.gz")): |
210 | + touch(target) |
211 | + else: |
212 | + raise osextras.FetchError |
213 | + |
214 | + mock_fetch.side_effect = fetch_side_effect |
215 | + self.config["PROJECT"] = "ubuntu-desktop-next" |
216 | + self.config["SUBPROJECT"] = "system-image" |
217 | + self.config["DIST"] = "utopic" |
218 | + self.config["IMAGE_TYPE"] = "daily" |
219 | + self.config["ARCHES"] = "i386" |
220 | + self.capture_logging() |
221 | + build_livecd_base(self.config) |
222 | + self.assertLogEqual([ |
223 | + "===== Downloading live filesystem images =====", |
224 | + self.epoch_date, |
225 | + "===== Copying images to debian-cd output directory =====", |
226 | + self.epoch_date, |
227 | + ]) |
228 | + output_dir = os.path.join( |
229 | + self.temp_dir, "scratch", "ubuntu-desktop-next", "utopic", "daily", |
230 | + "live") |
231 | + self.assertTrue(os.path.isdir(output_dir)) |
232 | + self.assertCountEqual([ |
233 | + "i386.manifest", |
234 | + "i386.rootfs.tar.gz", |
235 | + ], os.listdir(output_dir)) |
236 | + |
237 | |
238 | class TestExtractDebootstrap(TestCase): |
239 | def setUp(self): |
240 | |
241 | === modified file 'lib/cdimage/tree.py' |
242 | --- lib/cdimage/tree.py 2015-02-26 14:29:10 +0000 |
243 | +++ lib/cdimage/tree.py 2015-04-22 15:04:54 +0000 |
244 | @@ -380,6 +380,8 @@ |
245 | return "preinstalled-touch" |
246 | elif self.project == "ubuntu-core": |
247 | return "preinstalled-core" |
248 | + elif self.project == "ubuntu-desktop-next": |
249 | + return "preinstalled-desktop-next" |
250 | else: |
251 | return "preinstalled-desktop" |
252 | elif self.image_type.endswith("-live"): |
253 | @@ -529,6 +531,8 @@ |
254 | return "preinstalled touch image" |
255 | elif publish_type == "preinstalled-core": |
256 | return "preinstalled core image" |
257 | + elif publish_type == "preinstalled-desktop-next": |
258 | + return "preinstalled desktop next image" |
259 | elif publish_type == "wubi": |
260 | return "Wubi %s" % cd |
261 | else: |
262 | @@ -1107,6 +1111,7 @@ |
263 | "preinstalled-mobile", "preinstalled-active", |
264 | "preinstalled-headless", "preinstalled-server", |
265 | "preinstalled-touch", "preinstalled-core", "wubi", |
266 | + "preinstalled-desktop-next", |
267 | ) |
268 | |
269 | all_arches = ( |
As well as the inline comments below, could you please look into adding unit tests for at least some of this?