<feed xmlns='http://www.w3.org/2005/Atom'>
<title>apt/test/integration/test-kernel-helper-autoremove, branch main</title>
<subtitle>Debians commandline package manager</subtitle>
<id>https://git.kalnischkies.de/apt/atom?h=main</id>
<link rel='self' href='https://git.kalnischkies.de/apt/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/'/>
<updated>2025-09-02T18:50:04Z</updated>
<entry>
<title>Support kernel images with + in uname in kernel autoremove test</title>
<updated>2025-09-02T18:50:04Z</updated>
<author>
<name>David Kalnischkies</name>
<email>david@kalnischkies.de</email>
</author>
<published>2025-09-02T17:04:14Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=3c9399e643a07074d47c9bceca88e8d43ff55d36'/>
<id>urn:sha1:3c9399e643a07074d47c9bceca88e8d43ff55d36</id>
<content type='text'>
autopkgtest run on stable can have an uname like "6.12.41+deb13-amd64".
The +deb13 being relatively new in the package name. The code doing the
autoremoval has no problem with it and its a legal package name, but
the test that wants to check if the right regexes are generated does not
escape the + correctly (aka at all) so it isn't finding the regex it is
looking for failing the test.
</content>
</entry>
<entry>
<title>Show command in test failure messages if default is overridden</title>
<updated>2025-09-02T18:50:04Z</updated>
<author>
<name>David Kalnischkies</name>
<email>david@kalnischkies.de</email>
</author>
<published>2025-09-02T16:48:49Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=4f162c2f63796411467b816ccd80a20b2c248e72'/>
<id>urn:sha1:4f162c2f63796411467b816ccd80a20b2c248e72</id>
<content type='text'>
Tests usually print the command they run, but it can be overridden with
a chosen message to make clearer what is actually tested. To debug
failures it can be useful to know the command run through especially if
its a partly generated command depending on the test environment
(like in the kernel autoremove test).
</content>
</entry>
<entry>
<title>Drop sudo-related envvars in testing framework</title>
<updated>2024-04-24T13:16:21Z</updated>
<author>
<name>David Kalnischkies</name>
<email>david@kalnischkies.de</email>
</author>
<published>2024-04-23T16:13:46Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=9c06578c37ff77b70b9d978d48528df13e13530f'/>
<id>urn:sha1:9c06578c37ff77b70b9d978d48528df13e13530f</id>
<content type='text'>
Our autoremoval-advertisment is modified by SUDO_USER as if the current
apt call was made with sudo it seems a good idea to show the ad with
sudo as well. That is annoying for our tests through as normally the
tests are run locally or by autopkgtest without sudo, but in Gitlab CI
we use it (to run our tests as user… as we are already root) and so
individual tests had to deal with this.

That is annoying and really not needed as we can have our autoremove
test check that this ad gets displayed the right way and ignore it the
rest of the time.
</content>
</entry>
<entry>
<title>Only protect two kernels, not last installed one</title>
<updated>2022-04-07T11:19:52Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>julian.klode@canonical.com</email>
</author>
<published>2022-04-06T11:51:08Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=824651ded0bcf8603e9b508860b8fe5a68fc53ff'/>
<id>urn:sha1:824651ded0bcf8603e9b508860b8fe5a68fc53ff</id>
<content type='text'>
The kernel autoremoval algorithm was written to accomodate
for Ubuntu's boot partition sizing, which was written to
accomodate 3 kernels - 2 installed ones + a new one being
unpacked.

It seems that when the algorithm was designed, it was overlooked
that it actually kept 3 kernels.

LP: #1968154
</content>
</entry>
<entry>
<title>Determine autoremovable kernels at run-time</title>
<updated>2021-01-04T09:46:48Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>julian.klode@canonical.com</email>
</author>
<published>2020-12-17T12:24:56Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=04085f46dea9a95dd86123ac00187a63cc4ba2c0'/>
<id>urn:sha1:04085f46dea9a95dd86123ac00187a63cc4ba2c0</id>
<content type='text'>
Our kernel autoremoval helper script protects the currently booted
kernel, but it only runs whenever we install or remove a kernel,
causing it to protect the kernel that was booted at that point in time,
which is not necessarily the same kernel as the one that is running
right now.

Reimplement the logic in C++ such that we can calculate it at run-time:
Provide a function to produce a regular expression that matches all
kernels that need protecting, and by changing the default root set
function in the DepCache to make use of that expression.

Note that the code groups the kernels by versions as before, and then
marks all kernel packages with the same version.

This optimized version inserts a virtual package $kernel into the cache
when building it to avoid having to iterate over all packages in the
cache to find the installed ones, significantly improving performance at
a minor cost when building the cache.

LP: #1615381
</content>
</entry>
<entry>
<title>Widen regular expressions for versioned kernel packages</title>
<updated>2020-01-30T15:58:23Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>julian.klode@canonical.com</email>
</author>
<published>2019-04-15T07:40:20Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=4f9c58d25ff52fbb69cd3439fc1484bea47e1566'/>
<id>urn:sha1:4f9c58d25ff52fbb69cd3439fc1484bea47e1566</id>
<content type='text'>
Since we append a concrete kernel version to each pattern, and then
anchor the pattern, let's just pick any package starting with a
kernel name (linux-, kfreebsd-, gnumach-), and not worry about
linux-headers, linux-tools, etc specifically, as they'll be caught
by the generic pattern.

LP: #1607845
</content>
</entry>
<entry>
<title>support COLUMNS environment variable in apt tools</title>
<updated>2017-11-19T17:26:19Z</updated>
<author>
<name>David Kalnischkies</name>
<email>david@kalnischkies.de</email>
</author>
<published>2017-11-18T02:48:59Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=3f8664036e63d2a2d58120ab6c1e8a0a09937c71'/>
<id>urn:sha1:3f8664036e63d2a2d58120ab6c1e8a0a09937c71</id>
<content type='text'>
apt usually gets the width of the window from the terminal or failing
that has a default value, but especially for testing it can be handy
to control the size as you can't be sure that variable sized content
will always be linebreaked as expected in the testcases.
</content>
</entry>
<entry>
<title>Lower-case uname -r output in kernel autoremove helper</title>
<updated>2016-08-26T20:24:24Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>jak@debian.org</email>
</author>
<published>2016-08-24T14:28:47Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=15134a8e5458fc634482386f1fd2acbccc3ac892'/>
<id>urn:sha1:15134a8e5458fc634482386f1fd2acbccc3ac892</id>
<content type='text'>
This is needed on FreeBSD which has versions like 11.0-RC1,
otherwise the tests would fail.
</content>
</entry>
<entry>
<title>Add kernels with "+" in the package name to APT::NeverAutoRemove</title>
<updated>2016-07-08T06:44:05Z</updated>
<author>
<name>Andrew Patterson</name>
<email>andrew.patterson@hpe.com</email>
</author>
<published>2016-07-06T19:40:16Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=130176bcb6ce65c98d5692196c55cc18b4c210e0'/>
<id>urn:sha1:130176bcb6ce65c98d5692196c55cc18b4c210e0</id>
<content type='text'>
Escape "+" in kernel package names when generating APT::NeverAutoRemove
list so it is not treated as a regular expression meta-character.

[Changed by David Kalnischkies: let test actually test the change]

Closes: #830159
</content>
</entry>
<entry>
<title>tests: support spaces in path and TMPDIR</title>
<updated>2015-12-19T22:04:34Z</updated>
<author>
<name>David Kalnischkies</name>
<email>david@kalnischkies.de</email>
</author>
<published>2015-12-15T16:20:26Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=3abb6a6a1e485b3bc899b64b0a1b7dc2db25a9c2'/>
<id>urn:sha1:3abb6a6a1e485b3bc899b64b0a1b7dc2db25a9c2</id>
<content type='text'>
This doesn't allow all tests to run cleanly, but it at least allows to
write tests which could run successfully in such environments.

Git-Dch: Ignore
</content>
</entry>
</feed>
