From fc5b60e03814e42b016418574ab994bb63a9dad2 Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Sun, 16 Oct 2022 14:47:55 +0200 Subject: [PATCH] adjust tests as /var/lib/dpkg/arch is now created unconditionally --- tests/as-debootstrap-unshare-wrapper | 1 + tests/check-against-debootstrap-dist | 2 ++ tests/create-directory-dry-run | 1 + tests/include-libmagic-mgc-arm64 | 1 - tests/include-libmagic-mgc-arm64-with-multiple-arch-options | 1 - tests/install-doc-debian | 1 + tests/install-doc-debian-and-test-hooks | 1 + tests/preserve-mode-of-etc-resolv-conf-and-etc-hostname | 3 +++ tests/unpack-doc-debian | 1 + 9 files changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/as-debootstrap-unshare-wrapper b/tests/as-debootstrap-unshare-wrapper index 80a511f..eb251b9 100644 --- a/tests/as-debootstrap-unshare-wrapper +++ b/tests/as-debootstrap-unshare-wrapper @@ -45,6 +45,7 @@ rm /tmp/debian-debootstrap/var/lib/apt/lists/127.0.0.1_debian_dists_unstable_mai rm /tmp/debian-debootstrap/etc/machine-id /tmp/debian-mm/etc/machine-id rm /tmp/debian-mm/var/cache/apt/archives/lock rm /tmp/debian-mm/var/lib/apt/lists/lock +rm /tmp/debian-mm/var/lib/dpkg/arch # check if the file content differs diff --no-dereference --recursive /tmp/debian-debootstrap /tmp/debian-mm >&2 diff --git a/tests/check-against-debootstrap-dist b/tests/check-against-debootstrap-dist index 8a8e0e9..aad1cd7 100644 --- a/tests/check-against-debootstrap-dist +++ b/tests/check-against-debootstrap-dist @@ -77,6 +77,8 @@ rm /tmp/debian-{{ DIST }}-debootstrap/var/lib/dpkg/status-old \ # remove dpkg files rm /tmp/debian-{{ DIST }}-debootstrap/var/lib/dpkg/available rm /tmp/debian-{{ DIST }}-debootstrap/var/lib/dpkg/cmethopt +# remove /var/lib/dpkg/arch +rm /tmp/debian-{{ DIST }}-mm/var/lib/dpkg/arch # since we installed packages directly from the .deb files, Priorities differ # thus we first check for equality and then remove the files chroot /tmp/debian-{{ DIST }}-debootstrap dpkg --list > dpkg1 diff --git a/tests/create-directory-dry-run b/tests/create-directory-dry-run index ad7e046..03226e4 100644 --- a/tests/create-directory-dry-run +++ b/tests/create-directory-dry-run @@ -24,5 +24,6 @@ rm /tmp/debian-chroot/etc/hostname rm /tmp/debian-chroot/etc/resolv.conf rm /tmp/debian-chroot/var/lib/apt/lists/lock rm /tmp/debian-chroot/var/lib/dpkg/status +rm /tmp/debian-chroot/var/lib/dpkg/arch # the rest should be empty directories that we can rmdir recursively find /tmp/debian-chroot -depth -print0 | xargs -0 rmdir diff --git a/tests/include-libmagic-mgc-arm64 b/tests/include-libmagic-mgc-arm64 index 3c7947a..ec5fce6 100644 --- a/tests/include-libmagic-mgc-arm64 +++ b/tests/include-libmagic-mgc-arm64 @@ -10,7 +10,6 @@ set -eu export LC_ALL=C.UTF-8 {{ CMD }} --mode=root --variant=apt --architectures=amd64,arm64 --include=libmagic-mgc:arm64 {{ DIST }} /tmp/debian-chroot {{ MIRROR }} { echo "amd64"; echo "arm64"; } | cmp /tmp/debian-chroot/var/lib/dpkg/arch - -rm /tmp/debian-chroot/var/lib/dpkg/arch rm /tmp/debian-chroot/var/lib/apt/extended_states rm /tmp/debian-chroot/var/lib/dpkg/info/libmagic-mgc.list rm /tmp/debian-chroot/var/lib/dpkg/info/libmagic-mgc.md5sums diff --git a/tests/include-libmagic-mgc-arm64-with-multiple-arch-options b/tests/include-libmagic-mgc-arm64-with-multiple-arch-options index 9a4a308..31d7ee4 100644 --- a/tests/include-libmagic-mgc-arm64-with-multiple-arch-options +++ b/tests/include-libmagic-mgc-arm64-with-multiple-arch-options @@ -3,7 +3,6 @@ set -eu export LC_ALL=C.UTF-8 {{ CMD }} --mode=root --variant=apt --architectures=amd64 --architectures=arm64 --include=libmagic-mgc:arm64 {{ DIST }} /tmp/debian-chroot {{ MIRROR }} { echo "amd64"; echo "arm64"; } | cmp /tmp/debian-chroot/var/lib/dpkg/arch - -rm /tmp/debian-chroot/var/lib/dpkg/arch rm /tmp/debian-chroot/var/lib/apt/extended_states rm /tmp/debian-chroot/var/lib/dpkg/info/libmagic-mgc.list rm /tmp/debian-chroot/var/lib/dpkg/info/libmagic-mgc.md5sums diff --git a/tests/install-doc-debian b/tests/install-doc-debian index 29f1245..cbecaae 100644 --- a/tests/install-doc-debian +++ b/tests/install-doc-debian @@ -24,6 +24,7 @@ rm /tmp/debian-chroot/etc/fstab rm /tmp/debian-chroot/etc/hostname rm /tmp/debian-chroot/etc/resolv.conf rm /tmp/debian-chroot/var/lib/dpkg/status +rm /tmp/debian-chroot/var/lib/dpkg/arch rm /tmp/debian-chroot/var/cache/apt/archives/lock rm /tmp/debian-chroot/var/lib/dpkg/lock rm /tmp/debian-chroot/var/lib/dpkg/lock-frontend diff --git a/tests/install-doc-debian-and-test-hooks b/tests/install-doc-debian-and-test-hooks index 05eb4a3..3e7052c 100644 --- a/tests/install-doc-debian-and-test-hooks +++ b/tests/install-doc-debian-and-test-hooks @@ -27,6 +27,7 @@ rm /tmp/debian-chroot/etc/fstab rm /tmp/debian-chroot/etc/hostname rm /tmp/debian-chroot/etc/resolv.conf rm /tmp/debian-chroot/var/lib/dpkg/status +rm /tmp/debian-chroot/var/lib/dpkg/arch rm /tmp/debian-chroot/var/cache/apt/archives/lock rm /tmp/debian-chroot/var/lib/dpkg/lock rm /tmp/debian-chroot/var/lib/dpkg/lock-frontend diff --git a/tests/preserve-mode-of-etc-resolv-conf-and-etc-hostname b/tests/preserve-mode-of-etc-resolv-conf-and-etc-hostname index 1922e7d..5e5f835 100644 --- a/tests/preserve-mode-of-etc-resolv-conf-and-etc-hostname +++ b/tests/preserve-mode-of-etc-resolv-conf-and-etc-hostname @@ -38,6 +38,7 @@ rm /tmp/debian-chroot/etc/hostname rm /tmp/debian-chroot/etc/resolv.conf rm /tmp/debian-chroot/var/lib/apt/lists/lock rm /tmp/debian-chroot/var/lib/dpkg/status +rm /tmp/debian-chroot/var/lib/dpkg/arch # the rest should be empty directories that we can rmdir recursively find /tmp/debian-chroot -depth -print0 | xargs -0 rmdir for f in /etc/resolv.conf /etc/hostname; do @@ -66,6 +67,7 @@ rm /tmp/debian-chroot/etc/hostname rm /tmp/debian-chroot/etc/resolv.conf rm /tmp/debian-chroot/var/lib/apt/lists/lock rm /tmp/debian-chroot/var/lib/dpkg/status +rm /tmp/debian-chroot/var/lib/dpkg/arch # the rest should be empty directories that we can rmdir recursively find /tmp/debian-chroot -depth -print0 | xargs -0 rmdir for f in /etc/resolv.conf /etc/hostname; do @@ -95,5 +97,6 @@ rm /tmp/debian-chroot/etc/hostname rm /tmp/debian-chroot/etc/resolv.conf rm /tmp/debian-chroot/var/lib/apt/lists/lock rm /tmp/debian-chroot/var/lib/dpkg/status +rm /tmp/debian-chroot/var/lib/dpkg/arch # the rest should be empty directories that we can rmdir recursively find /tmp/debian-chroot -depth -print0 | xargs -0 rmdir diff --git a/tests/unpack-doc-debian b/tests/unpack-doc-debian index 246f608..6241b76 100644 --- a/tests/unpack-doc-debian +++ b/tests/unpack-doc-debian @@ -29,6 +29,7 @@ rm /tmp/debian-chroot/etc/fstab rm /tmp/debian-chroot/etc/hostname rm /tmp/debian-chroot/etc/resolv.conf rm /tmp/debian-chroot/var/lib/dpkg/status +rm /tmp/debian-chroot/var/lib/dpkg/arch rm /tmp/debian-chroot/var/cache/apt/archives/lock rm /tmp/debian-chroot/var/lib/apt/lists/lock ## delete merged usr symlinks