Merge lp:~mwhudson/ubuntu-cdimage/kernel-bits-2 into lp:ubuntu-cdimage

Proposed by Michael Hudson-Doyle
Status: Merged
Merged at revision: 1771
Proposed branch: lp:~mwhudson/ubuntu-cdimage/kernel-bits-2
Merge into: lp:ubuntu-cdimage
Diff against target: 209 lines (+83/-64)
2 files modified
lib/cdimage/livefs.py (+17/-2)
lib/cdimage/tests/test_livefs.py (+66/-62)
To merge this branch: bzr merge lp:~mwhudson/ubuntu-cdimage/kernel-bits-2
Reviewer Review Type Date Requested Status
Steve Langasek Needs Fixing
Review via email: mp+360039@code.launchpad.net

Commit message

download hwe boot bits for bionic live server builds

Description of the change

Unlike my other branch, this one should work.

To post a comment you must log in.
Revision history for this message
Adam Conrad (adconrad) wrote :

Some thoughts in inline comments.

1766. By Michael Hudson-Doyle

simplifications per review

1767. By Michael Hudson-Doyle

need this

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

I've addressed Adam's comments (and updated my livecd-rootfs branch to match)

Revision history for this message
Steve Langasek (vorlon) :
review: Needs Fixing
1768. By Michael Hudson-Doyle

make names more consistent

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/cdimage/livefs.py'
2--- lib/cdimage/livefs.py 2018-03-02 15:28:21 +0000
3+++ lib/cdimage/livefs.py 2018-12-12 20:29:45 +0000
4@@ -676,9 +676,11 @@
5 for url in urls_for("livecd.%s.%s" % (liveproject_subarch, item)):
6 yield url
7 elif item in (
8- "kernel", "initrd", "bootimg"
9+ "kernel", "initrd", "bootimg", "modules.squashfs"
10 ):
11- for flavour in flavours(config, arch):
12+ our_flavours = flavours(config, arch)
13+ our_flavours.extend(["%s-hwe" % (f,) for f in our_flavours])
14+ for flavour in our_flavours:
15 base = "livecd.%s.%s-%s" % (liveproject_subarch, item, flavour)
16 for url in urls_for(base):
17 yield url
18@@ -776,6 +778,18 @@
19 except osextras.FetchError:
20 pass
21 elif item in (
22+ "modules.squashfs",
23+ ):
24+ for url in urls:
25+ base = unquote(os.path.basename(url))
26+ base = "%s.%s" % (arch, base.split('.', 2)[2])
27+ target = os.path.join(output_dir, base)
28+ try:
29+ osextras.fetch(config, url, target)
30+ found = True
31+ except osextras.FetchError:
32+ pass
33+ elif item in (
34 "recovery-%s+%s.img" % (target.android_arch, target.subarch)
35 for target in Touch.list_targets_by_ubuntu_arch(arch)
36 ):
37@@ -898,6 +912,7 @@
38 download_live_items(config, arch, "installer.squashfs")
39 download_live_items(config, arch, "maas-rack.squashfs")
40 download_live_items(config, arch, "maas-region.squashfs")
41+ download_live_items(config, arch, "modules.squashfs")
42 got_image = True
43 elif download_live_items(config, arch, "rootfs.tar.gz"):
44 got_image = True
45
46=== modified file 'lib/cdimage/tests/test_livefs.py'
47--- lib/cdimage/tests/test_livefs.py 2018-03-02 14:21:47 +0000
48+++ lib/cdimage/tests/test_livefs.py 2018-12-12 20:29:45 +0000
49@@ -1032,13 +1032,16 @@
50 for item in ("kernel", "initrd", "bootimg"):
51 root = "http://kapok.buildd/~buildd/LiveCD/precise/kubuntu/current"
52 self.assertPathsEqual(
53- ["%s/livecd.kubuntu.%s-generic" % (root, item)],
54+ ["%s/livecd.kubuntu.%s-generic" % (root, item),
55+ "%s/livecd.kubuntu.%s-generic-hwe" % (root, item)],
56 "amd64", item, "kubuntu", "precise")
57 root = ("http://royal.buildd/~buildd/LiveCD/hardy/ubuntu-ps3/"
58 "current")
59 self.assertPathsEqual(
60 ["%s/livecd.ubuntu-ps3.%s-powerpc" % (root, item),
61- "%s/livecd.ubuntu-ps3.%s-powerpc64-smp" % (root, item)],
62+ "%s/livecd.ubuntu-ps3.%s-powerpc64-smp" % (root, item),
63+ "%s/livecd.ubuntu-ps3.%s-powerpc-hwe" % (root, item),
64+ "%s/livecd.ubuntu-ps3.%s-powerpc64-smp-hwe" % (root, item)],
65 "powerpc+ps3", item, "ubuntu", "hardy")
66
67 def test_kernel_efi_signed(self):
68@@ -1206,11 +1209,16 @@
69 self.assertTrue(download_live_items(self.config, "i386", "kernel"))
70 prefix = ("http://cardamom.buildd/~buildd/LiveCD/raring/ubuntu/"
71 "current/livecd.ubuntu.kernel-")
72- target_dir = os.path.join(
73- self.temp_dir, "scratch", "ubuntu", "raring", "daily-live", "live")
74- mock_fetch.assert_called_once_with(
75- self.config, prefix + "generic",
76- os.path.join(target_dir, "i386.kernel-generic"))
77+ calls = []
78+ for suffix in '', '-hwe':
79+ target_dir = os.path.join(
80+ self.temp_dir, "scratch", "ubuntu", "raring", "daily-live",
81+ "live")
82+ calls.append(
83+ mock.call(
84+ self.config, prefix + "generic" + suffix,
85+ os.path.join(target_dir, "i386.kernel-generic" + suffix)))
86+ self.assertCountEqual(mock_fetch.call_args_list, calls)
87
88 @mock.patch("cdimage.osextras.fetch")
89 def test_download_live_items_kernel_efi_signed(self, mock_fetch):
90@@ -1236,12 +1244,17 @@
91 download_live_items(self.config, "armhf+omap4", "bootimg"))
92 url = ("http://kishi00.buildd/~buildd/LiveCD/raring/ubuntu-omap4/"
93 "current/livecd.ubuntu-omap4.bootimg-omap4")
94- target_dir = os.path.join(
95- self.temp_dir, "scratch", "ubuntu", "raring", "daily-preinstalled",
96- "live")
97- mock_fetch.assert_called_once_with(
98- self.config, url,
99- os.path.join(target_dir, "armhf+omap4.bootimg-omap4"))
100+ calls = []
101+ for suffix in '', '-hwe':
102+ target_dir = os.path.join(
103+ self.temp_dir, "scratch", "ubuntu", "raring",
104+ "daily-preinstalled", "live")
105+ calls.append(
106+ mock.call(
107+ self.config, url + suffix,
108+ os.path.join(
109+ target_dir, "armhf+omap4.bootimg-omap4" + suffix)))
110+ self.assertCountEqual(mock_fetch.call_args_list, calls)
111
112 @mock.patch("cdimage.osextras.fetch")
113 def test_download_live_items_wubi(self, mock_fetch):
114@@ -1321,55 +1334,46 @@
115 self.config, url, os.path.join(target_dir, "i386.server-squashfs"))
116
117 @mock.patch("cdimage.osextras.fetch")
118- def test_download_live_items_maas_rack_squashfs(self, mock_fetch):
119- self.config["PROJECT"] = "ubuntu-server"
120- self.config["SUBPROJECT"] = "live"
121- self.config["DIST"] = "bionic"
122- self.config["IMAGE_TYPE"] = "daily-live"
123- self.assertTrue(
124- download_live_items(self.config, "amd64", "maas-rack.squashfs"))
125- url = ("http://kapok.buildd/~buildd/LiveCD/bionic/ubuntu-server-live/"
126- "current/livecd.ubuntu-server.maas-rack.squashfs")
127- target_dir = os.path.join(
128- self.temp_dir, "scratch", "ubuntu-server", "bionic", "daily-live",
129- "live")
130- mock_fetch.assert_called_once_with(
131- self.config, url, os.path.join(target_dir,
132- "amd64.maas-rack.squashfs"))
133-
134- @mock.patch("cdimage.osextras.fetch")
135- def test_download_live_items_maas_region_squashfs(self, mock_fetch):
136- self.config["PROJECT"] = "ubuntu-server"
137- self.config["SUBPROJECT"] = "live"
138- self.config["DIST"] = "bionic"
139- self.config["IMAGE_TYPE"] = "daily-live"
140- self.assertTrue(
141- download_live_items(self.config, "amd64", "maas-region.squashfs"))
142- url = ("http://kapok.buildd/~buildd/LiveCD/bionic/ubuntu-server-live/"
143- "current/livecd.ubuntu-server.maas-region.squashfs")
144- target_dir = os.path.join(
145- self.temp_dir, "scratch", "ubuntu-server", "bionic", "daily-live",
146- "live")
147- mock_fetch.assert_called_once_with(
148- self.config, url, os.path.join(target_dir,
149- "amd64.maas-region.squashfs"))
150-
151- @mock.patch("cdimage.osextras.fetch")
152- def test_download_live_items_installer_squashfs(self, mock_fetch):
153- self.config["PROJECT"] = "ubuntu-server"
154- self.config["SUBPROJECT"] = "live"
155- self.config["DIST"] = "xenial"
156- self.config["IMAGE_TYPE"] = "daily-live"
157- self.assertTrue(
158- download_live_items(self.config, "amd64", "installer.squashfs"))
159- url = ("http://kapok.buildd/~buildd/LiveCD/xenial/ubuntu-server-live/"
160- "current/livecd.ubuntu-server.installer.squashfs")
161- target_dir = os.path.join(
162- self.temp_dir, "scratch", "ubuntu-server", "xenial", "daily-live",
163- "live")
164- mock_fetch.assert_called_once_with(
165- self.config, url, os.path.join(target_dir,
166- "amd64.installer.squashfs"))
167+ def assert_server_live_download_items(self, series, item, filenames,
168+ mock_fetch):
169+ self.config["PROJECT"] = "ubuntu-server"
170+ self.config["SUBPROJECT"] = "live"
171+ self.config["DIST"] = series
172+ self.config["IMAGE_TYPE"] = "daily-live"
173+ self.assertTrue(
174+ download_live_items(self.config, "amd64", item))
175+ calls = []
176+ for filename in filenames:
177+ url = ("http://kapok.buildd/~buildd/LiveCD/%s/ubuntu-server-live/"
178+ "current/livecd.ubuntu-server.%s") % (series, filename)
179+ target = os.path.join(
180+ self.temp_dir, "scratch", "ubuntu-server", series,
181+ "daily-live", "live", "amd64." + filename)
182+ calls.append(mock.call(self.config, url, target))
183+ self.assertCountEqual(mock_fetch.call_args_list, calls)
184+
185+ def test_download_live_items_installer_squashfs(self):
186+ self.assert_server_live_download_items(
187+ "bionic", "installer.squashfs", ["installer.squashfs"])
188+
189+ def test_download_live_items_maas_rack_squashfs(self):
190+ self.assert_server_live_download_items(
191+ "bionic", "maas-rack.squashfs", ["maas-rack.squashfs"])
192+
193+ def test_download_live_items_maas_region_squashfs(self):
194+ self.assert_server_live_download_items(
195+ "bionic", "maas-region.squashfs", ["maas-region.squashfs"])
196+
197+ def test_download_live_server_boot_items(self):
198+ self.assert_server_live_download_items(
199+ "bionic", "kernel",
200+ ["kernel-generic", "kernel-generic-hwe"])
201+ self.assert_server_live_download_items(
202+ "bionic", "initrd",
203+ ["initrd-generic", "initrd-generic-hwe"])
204+ self.assert_server_live_download_items(
205+ "bionic", "modules.squashfs",
206+ ["modules.squashfs-generic", "modules.squashfs-generic-hwe"])
207
208 def test_write_autorun(self):
209 self.config["PROJECT"] = "ubuntu"

Subscribers

People subscribed via source and target branches