From ea314d2f45c40a006c0104157013ab4b857f665f Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 20:35:28 +0200 Subject: Adding upstream version 1.22.4. Signed-off-by: Daniel Baumann --- tests/t-unpack-divert-overwrite/Makefile | 64 ++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 tests/t-unpack-divert-overwrite/Makefile (limited to 'tests/t-unpack-divert-overwrite/Makefile') diff --git a/tests/t-unpack-divert-overwrite/Makefile b/tests/t-unpack-divert-overwrite/Makefile new file mode 100644 index 0000000..1ddfdab --- /dev/null +++ b/tests/t-unpack-divert-overwrite/Makefile @@ -0,0 +1,64 @@ +TESTS_DEB := pkg-files pkg-divert pkg-replaces + +include ../Test.mk + +test-case: + # Test failure to install a package overwriting a diversion (order 1). + $(DPKG_INSTALL) pkg-divert.deb + test -e $(DPKG_INSTDIR)/test-file + ! test -e $(DPKG_INSTDIR)/test-other + $(DPKG_INSTALL) pkg-files.deb + test -e $(DPKG_INSTDIR)/test-file + test -e $(DPKG_INSTDIR)/test-other + ! $(DPKG_INSTALL) pkg-replaces.deb + test -e $(DPKG_INSTDIR)/test-file + test -e $(DPKG_INSTDIR)/test-other + $(call pkg_is_installed,pkg-divert) + $(call pkg_is_not_installed,pkg-replaces) + $(DPKG_PURGE) pkg-files + $(DPKG_PURGE) pkg-divert + $(DPKG_PURGE) pkg-replaces + ! test -e $(DPKG_INSTDIR)/test-file + ! test -e $(DPKG_INSTDIR)/test-other + : + # Test failure to install a package overwriting a diversion (order 2). + $(DPKG_INSTALL) pkg-files.deb + test -e $(DPKG_INSTDIR)/test-file + ! test -e $(DPKG_INSTDIR)/test-other + $(DPKG_INSTALL) pkg-divert.deb + test -e $(DPKG_INSTDIR)/test-file + test -e $(DPKG_INSTDIR)/test-other + ! $(DPKG_INSTALL) pkg-replaces.deb + test -e $(DPKG_INSTDIR)/test-file + test -e $(DPKG_INSTDIR)/test-other + $(call pkg_is_installed,pkg-divert) + $(call pkg_is_not_installed,pkg-replaces) + $(DPKG_PURGE) pkg-files + $(DPKG_PURGE) pkg-divert + $(DPKG_PURGE) pkg-replaces + ! test -e $(DPKG_INSTDIR)/test-file + ! test -e $(DPKG_INSTDIR)/test-other + : + # Test success to install a package overwriting a diversion (forced). + $(DPKG_INSTALL) pkg-files.deb + test -e $(DPKG_INSTDIR)/test-file + ! test -e $(DPKG_INSTDIR)/test-other + $(DPKG_INSTALL) pkg-divert.deb + test -e $(DPKG_INSTDIR)/test-file + test -e $(DPKG_INSTDIR)/test-other + $(DPKG_INSTALL) --force-overwrite-diverted pkg-replaces.deb + test -e $(DPKG_INSTDIR)/test-file + test -e $(DPKG_INSTDIR)/test-other + $(call pkg_is_installed,pkg-divert) + $(call pkg_is_installed,pkg-replaces) + $(DPKG_PURGE) pkg-replaces + $(DPKG_PURGE) pkg-divert + $(DPKG_PURGE) pkg-files + ! test -e $(DPKG_INSTDIR)/test-file + ! test -e $(DPKG_INSTDIR)/test-other + + # XXX: In the force case, if we purge pkg-replaces last, then it + # will leave behind on the fsys an unowned file. + +test-clean: + $(DPKG_PURGE) pkg-files pkg-divert pkg-replaces -- cgit v1.2.3