summaryrefslogtreecommitdiffstats
path: root/tests/t-conffile-conflict/Makefile
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 14:58:51 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 14:58:51 +0000
commitcbffab246997fb5a06211dfb706b54e5ae5bb59f (patch)
tree0573c5d96f58d74d76a49c0f2a70398e389a36d3 /tests/t-conffile-conflict/Makefile
parentInitial commit. (diff)
downloaddpkg-upstream.tar.xz
dpkg-upstream.zip
Adding upstream version 1.21.22.upstream/1.21.22upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/t-conffile-conflict/Makefile')
-rw-r--r--tests/t-conffile-conflict/Makefile44
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/t-conffile-conflict/Makefile b/tests/t-conffile-conflict/Makefile
new file mode 100644
index 0000000..c7af965
--- /dev/null
+++ b/tests/t-conffile-conflict/Makefile
@@ -0,0 +1,44 @@
+TESTS_DEB := pkg-conff-a pkg-conff-b pkg-conff-c
+
+include ../Test.mk
+
+TEST_CASES += test-conflict-installed-implicit
+TEST_CASES += test-conflict-removed-implicit
+TEST_CASES += test-conflict-removed-explicit
+
+test-case: $(TEST_CASES)
+
+test-conflict-installed-implicit:
+ # test if packages fail on install due to conflicting conffile
+ $(DPKG_INSTALL) pkg-conff-a.deb
+ ! $(DPKG_INSTALL) pkg-conff-b.deb
+ -$(DPKG_PURGE) pkg-conff-b
+ $(DPKG_PURGE) pkg-conff-a
+
+test-conflict-removed-implicit:
+ # test that conffile of removed package can be taken over
+ $(DPKG_INSTALL) pkg-conff-a.deb
+ $(DPKG_REMOVE) pkg-conff-a
+ $(DPKG_INSTALL) pkg-conff-b.deb
+ # Verify the new conffile has been installed
+ grep -q pkg-conff-b "$(DPKG_INSTDIR)/test-conffile"
+ # Verify it's kept after purge of old package
+ $(DPKG_PURGE) pkg-conff-a
+ test -e "$(DPKG_INSTDIR)/test-conffile"
+ $(DPKG_PURGE) pkg-conff-b
+
+test-conflict-removed-explicit:
+ # test that conffile of removed package can be taken over even if
+ # the new package is conflicting with the old one
+ $(DPKG_INSTALL) pkg-conff-a.deb
+ $(DPKG_REMOVE) pkg-conff-a
+ $(DPKG_INSTALL) pkg-conff-c.deb
+ # Verify the new conffile has been installed
+ grep -q pkg-conff-c "$(DPKG_INSTDIR)/test-conffile"
+ # Verify it's kept after purge of old package
+ $(DPKG_PURGE) pkg-conff-a
+ test -e "$(DPKG_INSTDIR)/test-conffile"
+ $(DPKG_PURGE) pkg-conff-c
+
+test-clean:
+ -$(DPKG_PURGE) pkg-conff-a pkg-conff-b pkg-conff-c