summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2021-01-09 00:57:30 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2021-09-04 15:35:15 +0200
commit61d4ee5347f2c802f84c6ec44448fc16e45949ec (patch)
tree563be76abeaf4fdac5ebbe366e3cbe88117f1d55
parent8ff4e226af55a9feb168477a2b1a99f9c5152e54 (diff)
Ensure dpkg -C works correctly in our testcases
Gbp-Dch: Ignore
-rw-r--r--test/integration/framework10
-rwxr-xr-xtest/integration/test-multiarch-allowed1
-rwxr-xr-xtest/integration/test-prevent-markinstall-multiarch-same-versionscrew3
3 files changed, 12 insertions, 2 deletions
diff --git a/test/integration/framework b/test/integration/framework
index 8c9abfbe4..42445508e 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -204,6 +204,9 @@ aptinternalplanner() { runapt "${APTINTERNALPLANNER}" "$@"; }
dpkg() {
"${TMPWORKINGDIRECTORY}/rootdir/usr/bin/dpkg" "$@"
}
+dpkgquery() {
+ command dpkg-query --admindir="${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg" "$@"
+}
dpkg_version() {
command perl -MDpkg -E 'say $Dpkg::PROGVERSION'
}
@@ -372,7 +375,8 @@ setupenvironment() {
mkdir -p usr/bin var/cache var/lib var/log var/crash tmp
mkdir -p var/lib/dpkg/info var/lib/dpkg/updates var/lib/dpkg/triggers
mkdir -p usr/lib/apt/solvers usr/lib/apt/planners
- touch var/lib/dpkg/available
+ touch var/lib/dpkg/available var/lib/dpkg/lock
+ echo '1' > var/lib/dpkg/info/format
ln -s "${METHODSDIR}" usr/lib/apt/methods
ln -s "${APTDUMPSOLVER}" usr/lib/apt/solvers/dump
ln -s "${APTDUMPSOLVER}" usr/lib/apt/planners/dump
@@ -1049,10 +1053,12 @@ Version: $VERSION" >> "$FILE"
test -z "$DEPENDENCIES" || printf "%b\n" "$DEPENDENCIES" >> "$FILE"
printf "%b\n" "Description: $DESCRIPTION" >> "$FILE"
echo >> "$FILE"
- if [ "$(dpkg-query -W --showformat='${Multi-Arch}')" = 'same' ]; then
+ if [ "$(dpkgquery -W --showformat='${Multi-Arch}' "${NAME}:${arch}" 2>/dev/null)" = 'same' ]; then
echo -n > "${INFO}/${NAME}:${arch}.list"
+ echo -n > "${INFO}/${NAME}:${arch}.md5sums"
else
echo -n > "${INFO}/${NAME}.list"
+ echo -n > "${INFO}/${NAME}.md5sums"
fi
done
}
diff --git a/test/integration/test-multiarch-allowed b/test/integration/test-multiarch-allowed
index a091635f0..b9af20084 100755
--- a/test/integration/test-multiarch-allowed
+++ b/test/integration/test-multiarch-allowed
@@ -252,6 +252,7 @@ testfailureequal "$NEEDSFOO2NATIVE" aptget install needsfoover2 -s
solveableinsinglearch2
solveableinsinglearch3
+testempty dpkg -C
msgmsg 'multi-arch with barbarian archs'
configarchitecture 'amd64' 'i386'
insertinstalledpackage 'foo' 'armel' '1' 'Multi-Arch: allowed'
diff --git a/test/integration/test-prevent-markinstall-multiarch-same-versionscrew b/test/integration/test-prevent-markinstall-multiarch-same-versionscrew
index a45c0d55d..63fdb88d9 100755
--- a/test/integration/test-prevent-markinstall-multiarch-same-versionscrew
+++ b/test/integration/test-prevent-markinstall-multiarch-same-versionscrew
@@ -96,6 +96,7 @@ Conf fine-installed:i386 (3 experimental [i386])
Conf out-of-sync-gone-foreign (2 unstable [amd64])
Conf out-of-sync-gone-native:i386 (2 unstable [i386])' aptget dist-upgrade -s #-o Debug::pkgDepCache::Marker=1
+testempty dpkg -C
rm rootdir/var/lib/dpkg/status
insertinstalledpackage 'libsame2' 'i386' '1' 'Multi-Arch: same'
insertinstalledpackage 'libsame3' 'i386' '1' 'Multi-Arch: same'
@@ -128,3 +129,5 @@ Inst depender3 (3 unstable [all])
Conf libsame3:i386 (3 unstable [i386])
Conf libsame3 (3 unstable [amd64])
Conf depender3 (3 unstable [all])' aptget install depender3 -s
+
+testempty dpkg -C