From eb1adc417b0f3c626c545d195e900d1369c751f0 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 5 Jan 2025 21:46:03 +0000 Subject: Resolve autopkgtest failures caused by dpkg >= 1.22.12 Streamlining the rules around the Section field and especially what happens if its isn't present are a good idea in general, but for testing proposes we want a package without a section ~ something dpkg and co do not want us to have for good reasons (outside of tests). While a real nosection package would interact with more of our code, for this test we don't really need a real one and so we can adopt to the new reality of encountering such packages only if they are already installed instead of trying to build a sectionless package by hand. The other failure is a simple and trivial string change around the formatting of the version number in dpkg error message about file overrides, which we can resolve by just not looking at the version to sidestep dealing with the formatting difference. References: https://lists.debian.org/debian-dpkg/2024/12/msg00010.html Closes: #1092090 --- test/integration/framework | 8 +++++--- test/integration/test-apt-never-markauto-sections | 10 ++++++---- test/integration/test-apt-progress-fd-error | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) (limited to 'test/integration') diff --git a/test/integration/framework b/test/integration/framework index bae14e984..7c1b31ca2 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -1112,9 +1112,11 @@ insertinstalledpackage() { for arch in $(getarchitecturesfromcommalist "$ARCH"); do echo "Package: $NAME Status: $STATUS -Priority: $PRIORITY -Section: $SECTION -Installed-Size: 42 +Priority: $PRIORITY" >> "$FILE" + if [ "$SECTION" != '' ]; then + echo "Section: $SECTION" >> "$FILE" + fi + echo "Installed-Size: 42 Maintainer: Joe Sixpack Version: $VERSION" >> "$FILE" test "$arch" = 'none' || echo "Architecture: $arch" >> "$FILE" diff --git a/test/integration/test-apt-never-markauto-sections b/test/integration/test-apt-never-markauto-sections index a1fc87389..85412b17b 100755 --- a/test/integration/test-apt-never-markauto-sections +++ b/test/integration/test-apt-never-markauto-sections @@ -20,16 +20,18 @@ buildsimplenativepackage 'browser' 'amd64' '42' 'unstable' buildsimplenativepackage 'texteditor' 'amd64' '1' 'stable' buildsimplenativepackage 'bad-texteditor' 'amd64' '1' 'stable' 'Depends: texteditor Conflicts: mydesktop-core' -buildsimplenativepackage 'nosection' 'amd64' '1' 'stable' '' '' '' buildsimplenativepackage 'foreignpkg' 'i386' '1' 'stable' 'Multi-Arch: foreign' setupaptarchive -testsuccess aptcache show nosection -testfailure grep 'Section' rootdir/tmp/testsuccess.output -testempty aptmark showmanual +insertinstalledpackage 'nosection' 'amd64' '1' '' '' '' '' '' +testsuccess aptmark auto nosection +testempty aptmark showmanual testsuccess aptget install mydesktop -y -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 -o Debug::pkgDepCache::AutoInstall=1 +testsuccess aptcache show nosection +testfailure grep 'Section' rootdir/tmp/testsuccess.output + testmarkedmanual 'mydesktop' testmarkedauto 'mydesktop-core' 'foreignpkg:i386' 'texteditor' 'browser' 'nosection' diff --git a/test/integration/test-apt-progress-fd-error b/test/integration/test-apt-progress-fd-error index 39c1053a1..ca2c2328f 100755 --- a/test/integration/test-apt-progress-fd-error +++ b/test/integration/test-apt-progress-fd-error @@ -19,7 +19,7 @@ setupaptarchive exec 3> apt-progress.log testfailure aptget install foo1 foo2 -y -o APT::Status-Fd=3 msgtest 'Ensure correct error message' 'file-conflict' -testsuccess --nomsg grep "foo2_0.8.15_[^.]\+.deb:[0-9.]\+:trying to overwrite '/usr/bin/file-conflict', which is also in package foo1 0.8.15" apt-progress.log +testsuccess --nomsg grep "foo2_0.8.15_[^.]\+.deb:[0-9.]\+:trying to overwrite '/usr/bin/file-conflict', which is also in package foo1" apt-progress.log testsuccess test -s rootdir/var/crash/foo2.0.crash testsuccess grep '^Package: foo2 0.8.15$' rootdir/var/crash/foo2.0.crash -- cgit v1.2.3-70-g09d2