summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2021-06-10 18:06:14 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2021-06-10 19:25:17 +0200
commit8083d4019844f764058efa2a950ed16975178bff (patch)
tree17e99832665981257d251ba4a2e5ea43f496eeb6 /test
parent06da685fc1abe073c379a34151500fc4d2d853fa (diff)
Restore dpkg::chroot-directory functionality
If we call dpkg inside a chroot we have to ensure that the temporary directory we construct to call dpkg --recursive is inside the chroot and that we strip the path to the chroot from the directory name we pass to dpkg. Note that the added test succeeds before and (hopefully) after as we can't really chroot here or fiddle with the needed settings as we are already setting up apt to work with a quasi-chroot. The test perhaps helps in ensuring we don't break it too much in the future though. (Broken five years (and one day) ago this seems to have an immense user base at the moment, but it might in the future via mmdebstrap) References: f495992428a396e0f98886c9a761a804aa161c68 Reported-By: Johannes Schauer Marin Rodrigues on IRC Tested-By: Johannes Schauer Marin Rodrigues
Diffstat (limited to 'test')
-rwxr-xr-xtest/integration/test-apt-get-install-deb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/integration/test-apt-get-install-deb b/test/integration/test-apt-get-install-deb
index 3d0b9a80d..bcf8bae3d 100755
--- a/test/integration/test-apt-get-install-deb
+++ b/test/integration/test-apt-get-install-deb
@@ -228,6 +228,14 @@ echo 'dpkg::install::recursive "true";
dpkg::install::recursive::force "true";
dpkg::install::recursive::minimum "0";' > rootdir/etc/apt/apt.conf.d/lowerminimum.conf
mv ./incoming/pkg-as-it-should-be_0_all.deb ./incoming/pkg-as-it-should-be_0%3a0+0_all.ddeb
+testsuccess aptget install -y ./incoming/pkg-as-it-should-be_0%3a0+0_all.ddeb --reinstall -o Debug::pkgDpkgPm=1
+cp rootdir/tmp/testsuccess.output apt.output
+testsuccess grep "^${TMPWORKINGDIRECTORY}/.*/dpkg.* --recursive .*/apt-dpkg-install-" apt.output
+testsuccess aptget install -y ./incoming/pkg-as-it-should-be_0%3a0+0_all.ddeb --reinstall -o Debug::pkgDpkgPm=1 -o DPkg::Chroot-Directory="${TMPWORKINGDIRECTORY}/rootdir/"
+cp rootdir/tmp/testsuccess.output apt.output
+testsuccess grep 'dpkg.* --recursive .*/apt-dpkg-install-' apt.output
+testfailure grep "^${TMPWORKINGDIRECTORY}/.*/dpkg.* --recursive .*/apt-dpkg-install-" apt.output
+testfailure grep "dpkg.* --recursive ${TMPWORKINGDIRECTORY}" apt.output
testsuccess aptget install -y ./incoming/pkg-as-it-should-be_0%3a0+0_all.ddeb --reinstall
testfailure grep 'is already the newest version' rootdir/tmp/testsuccess.output
testsuccess apt purge -y pkg-as-it-should-be