Merge ~jslarraz/ubuntu-security-tools:add-apt-source-to-autopkgtest into ubuntu-security-tools:master

Proposed by Jorge Sancho Larraz
Status: Merged
Merged at revision: 694291ebf928872abfccd3b0a88e73980216e390
Proposed branch: ~jslarraz/ubuntu-security-tools:add-apt-source-to-autopkgtest
Merge into: ubuntu-security-tools:master
Diff against target: 39 lines (+26/-2)
1 file modified
build-tools/umt (+26/-2)
Reviewer Review Type Date Requested Status
Marc Deslauriers Approve
Review via email: mp+461357@code.launchpad.net

Commit message

umt/autopkgtest: add add apt source by default

Description of the change

when running autopkgtest for python-cryptography/noble, it ended with following error:

No VM guests are running outdated hypervisor (qemu) binaries on this host.
(Reading database ... 66760 files and directories currently installed.)
Removing autopkgtest-satdep (0) ...
E: You must put some 'deb-src' URIs in your sources.list
E: You must put some 'deb-src' URIs in your sources.list
qemu-system-x86_64: terminating on signal 15 from pid 200712 (/usr/bin/python3)
autopkgtest [15:16:45]: ERROR: testbed failure: rules extract failed with exit code 100 (apt failure)

Proposed change fixed the issue, however I'm not sure if there is a better way to fix this issue

To post a comment you must log in.
Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

So, this is a hack until autopkgtest is properly fixed: https://salsa.debian.org/ci-team/autopkgtest/-/merge_requests/287

Could you make it only apply to noble, and put a comment that describes that as being a hack along with the url above.

Also, please make it honor build_tools_sbuildmirror like the code higher up does, and if that's not set default to the main repo, not a local mirror.

review: Needs Fixing
Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

This is probably LP: #2052639, please add that to the comment also.

Revision history for this message
Jorge Sancho Larraz (jslarraz) wrote :

MR updated according to your commentaries.

I've been experimenting a very weird behavior. The MR worked perfectly when configuring build_tools_sbuildmirror with any mirror other than main archive. However, when using the main archive, apt update didn't fetch metadata properly (I could observe a hit instead of a get in the debug info), what resulted in apt crashing when tried to download a package version that no longer exist.
(In my case binutils-common2.42-2ubuntu1, which has been replaced by version 2.42-3ubuntu1).

Forcing apt update to download all the information by clearing apt's index (i.e. rm /var/lib/apt/lists/*_*) fixed the issue, but it looks even more hacky. I wonder if you have any clue of what may be happening here.

Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

I don't really know why you're experiencing the apt issue, but apt often needs an "apt update" after modifying the list of sources. Could you try "apt clean" before doing the "apt update" instead of removing the files manually?

Revision history for this message
Jorge Sancho Larraz (jslarraz) wrote :

Changing `sudo rm /var/lib/apt/lists/*_*` for `apt clean` results in the error previously explained

E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/b/binutils/binutils_2.42-2ubuntu1_amd64.deb 404 Not Found [IP: 91.189.91.81 80]

Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

Hrm, that's odd. Ok, ack on this for now. Thanks!

review: Approve
Revision history for this message
Jorge Sancho Larraz (jslarraz) wrote :

Yup, agree it is really odd. It has took me forever realize what was happening...

Considering how hacky it looks and that we really want to get rid of it as soon as possible I wonder if it would be better to keep it in a separate branch we can pull when/if need to run autopkgtest for noble instead of merging to master. I'm not completely sure.

What's your opinion on that?

Revision history for this message
Marc Deslauriers (mdeslaur) wrote (last edit ):

We might as well add the hack so that others don't waste time investigating the same issue. But, please subscribe to the upstream merge commit and the bug and remove it when it's no longer necessary.

Revision history for this message
Jorge Sancho Larraz (jslarraz) wrote :

Done!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/build-tools/umt b/build-tools/umt
index 3ff8767..ba53424 100755
--- a/build-tools/umt
+++ b/build-tools/umt
@@ -3275,8 +3275,32 @@ def run_autopkgtest_tests(opt, args, details):
3275 print("Executing autopkgtest baseline test for %s on %s..." % (details["package"], image))3275 print("Executing autopkgtest baseline test for %s on %s..." % (details["package"], image))
3276 cmd = ["/usr/bin/autopkgtest",3276 cmd = ["/usr/bin/autopkgtest",
3277 "-U", # apt upgrade for latest archive3277 "-U", # apt upgrade for latest archive
3278 "-o", os.path.join(autopkgtest_dest, prev_version),3278 "-o", os.path.join(autopkgtest_dest, prev_version)]
3279 details["package"]]3279 # FIXME this is a hack needed because noble cloud images does not include deb-src currently,
3280 # possibly because of the new deb822 format. This should be removed when fixed in autopkgtest.
3281 # https://salsa.debian.org/ci-team/autopkgtest/-/merge_requests/287
3282 # https://bugs.launchpad.net/ubuntu/+source/autopkgtest/+bug/2052639
3283 if details["series"] == "noble":
3284 archive_url = "http://archive.ubuntu.com/ubuntu"
3285 if opt.arch in ["amd64", "i386"] and \
3286 'build_tools_sbuildmirror' in ust and \
3287 ust['build_tools_sbuildmirror'] is not None:
3288 archive_url = ust['build_tools_sbuildmirror']
3289 cmd.append("--add-apt-source")
3290 cmd.append("deb-src %s noble main restricted universe multiverse" % archive_url)
3291 cmd.append("--add-apt-source")
3292 cmd.append("deb-src %s noble-updates main restricted universe multiverse" % archive_url)
3293 cmd.append("--add-apt-source")
3294 cmd.append("deb-src %s noble-security main restricted universe multiverse" % archive_url)
3295 # For a reason I don't know, when using the main archive (i.e. http://archive.ubuntu.com/ubuntu)
3296 # apt update does not fetch sources information properly (I can observe a hit instead of a get)
3297 # that result in apt crashing when tries to download a package version that no longer exists
3298 # (in my case binutils-common2.42-2ubuntu1, which has been replaced by version 2.42-3ubuntu1)
3299 # Removing apt cached info before running update seems to fix the problem.
3300 cmd.append("--setup-commands-boot")
3301 cmd.append("sudo rm /var/lib/apt/lists/*_*; sudo apt update")
3302 # END OF HACK
3303 cmd.append(details["package"])
3280 if opt.autopkgtest_config is not None:3304 if opt.autopkgtest_config is not None:
3281 cmd.append(opt.autopkgtest_config)3305 cmd.append(opt.autopkgtest_config)
3282 if opt.test_name is not None:3306 if opt.test_name is not None:

Subscribers

People subscribed via source and target branches