Merge ~vorlon/launchpad-buildd:main into launchpad-buildd:master

Proposed by Steve Langasek
Status: Needs review
Proposed branch: ~vorlon/launchpad-buildd:main
Merge into: launchpad-buildd:master
Diff against target: 108 lines (+57/-0)
4 files modified
lpbuildd/livefs.py (+3/-0)
lpbuildd/target/build_livefs.py (+9/-0)
lpbuildd/target/tests/test_build_livefs.py (+32/-0)
lpbuildd/tests/test_livefs.py (+13/-0)
Reviewer Review Type Date Requested Status
Philip Roche (community) Approve
John Chittum (community) Approve
Canonical Launchpad Engineering Pending
Review via email: mp+421250@code.launchpad.net

Description of the change

The purpose of this is to provide a generic interface for requesting cherry-picks of packages from the -proposed pocket when building images, for the purpose of doing per-package, image-level verification of SRUs.

This is particularly relevant for packages included in cloud images - e.g. cloud-init whose behavior at first boot of an image is important for an SRU.

The interface is modeled on autopkgtest's existing --apt-pocket commandline option.

To post a comment you must log in.
Revision history for this message
John Chittum (jchittum) :
review: Approve
Revision history for this message
Philip Roche (philroche) :
review: Needs Information
Revision history for this message
Steve Langasek (vorlon) :
Revision history for this message
Philip Roche (philroche) :
review: Approve

Unmerged commits

1043395... by Steve Langasek

Support passing apt pocket arguments to livecd-rootfs

This uses the same semantics as --apt-pocket option to autopkgtest

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/lpbuildd/livefs.py b/lpbuildd/livefs.py
index f627e76..37aeba9 100644
--- a/lpbuildd/livefs.py
+++ b/lpbuildd/livefs.py
@@ -62,6 +62,9 @@ class LiveFilesystemBuildManager(DebianBuildManager):
62 args.extend(["--image-format", self.image_format])62 args.extend(["--image-format", self.image_format])
63 if self.pocket == "proposed":63 if self.pocket == "proposed":
64 args.append("--proposed")64 args.append("--proposed")
65 elif type(self.pocket) is list:
66 for pocket in self.pocket:
67 args.extend(["--apt-pocket", pocket])
65 if self.locale:68 if self.locale:
66 args.extend(["--locale", self.locale])69 args.extend(["--locale", self.locale])
67 for ppa in self.extra_ppas:70 for ppa in self.extra_ppas:
diff --git a/lpbuildd/target/build_livefs.py b/lpbuildd/target/build_livefs.py
index 1d576d0..c951d43 100644
--- a/lpbuildd/target/build_livefs.py
+++ b/lpbuildd/target/build_livefs.py
@@ -69,6 +69,13 @@ class BuildLiveFS(SnapStoreOperationMixin, Operation):
69 "--extra-snap", dest="extra_snaps", default=[], action="append",69 "--extra-snap", dest="extra_snaps", default=[], action="append",
70 help="use this additional snap")70 help="use this additional snap")
71 parser.add_argument(71 parser.add_argument(
72 "--apt-pocket", dest="apt_pocket", default=[], action="append",
73 metavar="POCKETNAME",
74 help="Enable additional apt source for release-POCKETNAME. "
75 "If packages are given, set up apt pinning to use only "
76 "those packages from release-POCKETNAME; src:srcname "
77 "expands to all binaries of srcname")
78 parser.add_argument(
72 "--channel", metavar="CHANNEL",79 "--channel", metavar="CHANNEL",
73 help="pull snaps from channel CHANNEL for ubuntu-core image")80 help="pull snaps from channel CHANNEL for ubuntu-core image")
74 parser.add_argument(81 parser.add_argument(
@@ -132,6 +139,8 @@ class BuildLiveFS(SnapStoreOperationMixin, Operation):
132 self.args.repo_snapshot_stamp)139 self.args.repo_snapshot_stamp)
133 if self.args.cohort_key:140 if self.args.cohort_key:
134 base_lb_env["COHORT_KEY"] = self.args.cohort_key141 base_lb_env["COHORT_KEY"] = self.args.cohort_key
142 if self.args.apt_pocket:
143 base_lb_env["APT_POCKET"] = " ".join(self.args.apt_pocket)
135 lb_env = base_lb_env.copy()144 lb_env = base_lb_env.copy()
136 lb_env["SUITE"] = self.args.series145 lb_env["SUITE"] = self.args.series
137 if self.args.datestamp is not None:146 if self.args.datestamp is not None:
diff --git a/lpbuildd/target/tests/test_build_livefs.py b/lpbuildd/target/tests/test_build_livefs.py
index e8fa92a..64dc230 100644
--- a/lpbuildd/target/tests/test_build_livefs.py
+++ b/lpbuildd/target/tests/test_build_livefs.py
@@ -156,6 +156,38 @@ class TestBuildLiveFS(TestCase):
156 ["lb", "build"], PROJECT="ubuntu-core", ARCH="amd64"),156 ["lb", "build"], PROJECT="ubuntu-core", ARCH="amd64"),
157 ]))157 ]))
158158
159 def test_build_apt_pocket(self):
160 args = [
161 "buildlivefs",
162 "--backend=fake", "--series=jammy", "--arch=amd64", "1",
163 "--project=ubuntu",
164 "--apt-pocket", "proposed=src:src1",
165 "--apt-pocket", "proposed=pkg2",
166 ]
167 build_livefs = parse_args(args=args).operation
168 build_livefs.build()
169 self.assertThat(build_livefs.backend.run.calls, MatchesListwise([
170 RanBuildCommand(["rm", "-rf", "auto", "local"]),
171 RanBuildCommand(["mkdir", "-p", "auto"]),
172 RanBuildCommand(
173 ["ln", "-s",
174 "/usr/share/livecd-rootfs/live-build/auto/config", "auto/"]),
175 RanBuildCommand(
176 ["ln", "-s",
177 "/usr/share/livecd-rootfs/live-build/auto/build", "auto/"]),
178 RanBuildCommand(
179 ["ln", "-s",
180 "/usr/share/livecd-rootfs/live-build/auto/clean", "auto/"]),
181 RanBuildCommand(["lb", "clean", "--purge"]),
182 RanBuildCommand(
183 ["lb", "config"],
184 PROJECT="ubuntu", ARCH="amd64", SUITE="jammy",
185 APT_POCKET="proposed=src:src1 proposed=pkg2"),
186 RanBuildCommand(
187 ["lb", "build"], PROJECT="ubuntu", ARCH="amd64",
188 APT_POCKET="proposed=src:src1 proposed=pkg2"),
189 ]))
190
159 def test_build_debug(self):191 def test_build_debug(self):
160 args = [192 args = [
161 "buildlivefs",193 "buildlivefs",
diff --git a/lpbuildd/tests/test_livefs.py b/lpbuildd/tests/test_livefs.py
index d121837..a2b5c1c 100644
--- a/lpbuildd/tests/test_livefs.py
+++ b/lpbuildd/tests/test_livefs.py
@@ -149,6 +149,19 @@ class TestLiveFilesystemBuildManagerIteration(TestCase):
149 ])149 ])
150150
151 @defer.inlineCallbacks151 @defer.inlineCallbacks
152 def test_iterate_apt_pocket(self):
153 # The build manager can be told to specify apt pockets for different
154 # packages on the backend.
155 yield self.startBuild(
156 args={
157 "pocket": ["proposed=src:apt", "proposed=python3-apt"],
158 },
159 options=[
160 "--apt-pocket", "proposed=src:apt",
161 "--apt-pocket", "proposed=python3-apt",
162 ])
163
164 @defer.inlineCallbacks
152 def test_iterate_snap_store_proxy(self):165 def test_iterate_snap_store_proxy(self):
153 # The build manager can be told to use a snap store proxy.166 # The build manager can be told to use a snap store proxy.
154 self.builder._config.set(167 self.builder._config.set(

Subscribers

People subscribed via source and target branches