summaryrefslogtreecommitdiffstats
path: root/tests/t-conffile-obsolete/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-obsolete/Makefile
parentInitial commit. (diff)
downloaddpkg-cbffab246997fb5a06211dfb706b54e5ae5bb59f.tar.xz
dpkg-cbffab246997fb5a06211dfb706b54e5ae5bb59f.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-obsolete/Makefile')
-rw-r--r--tests/t-conffile-obsolete/Makefile42
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/t-conffile-obsolete/Makefile b/tests/t-conffile-obsolete/Makefile
new file mode 100644
index 0000000..55d9477
--- /dev/null
+++ b/tests/t-conffile-obsolete/Makefile
@@ -0,0 +1,42 @@
+TESTS_DEB := pkg-conff-obsolete-0 pkg-conff-obsolete-1 pkg-conff-obsolete-2
+
+include ../Test.mk
+
+test-case:
+ $(DPKG_INSTALL) pkg-conff-obsolete-0.deb
+ $(DPKG_INSTALL) pkg-conff-obsolete-1.deb
+ test -f '$(DPKG_INSTDIR)/test-conffile'
+ $(DPKG_PURGE) pkg-conff-obsolete
+ test ! -f '$(DPKG_INSTDIR)/test-conffile'
+ # Unmodified conffile is autoremoved for the user
+ $(DPKG_INSTALL) pkg-conff-obsolete-0.deb
+ $(DPKG_UNPACK) pkg-conff-obsolete-2.deb
+ test -f '$(DPKG_INSTDIR)/test-conffile.dpkg-remove'
+ test ! -f '$(DPKG_INSTDIR)/test-conffile.dpkg-backup'
+ $(DPKG_CONFIGURE) pkg-conff-obsolete
+ test ! -f '$(DPKG_INSTDIR)/test-conffile'
+ test ! -f '$(DPKG_INSTDIR)/test-conffile.dpkg-bak'
+ test ! -f '$(DPKG_INSTDIR)/test-conffile.dpkg-backup'
+ test ! -f '$(DPKG_INSTDIR)/test-conffile.dpkg-remove'
+ $(DPKG_PURGE) pkg-conff-obsolete
+ # Modified conffile is moved away in .dpkg-bak for the user
+ $(DPKG_INSTALL) pkg-conff-obsolete-0.deb
+ $(BEROOT) sh -c "echo foo >>'$(DPKG_INSTDIR)/test-conffile'"
+ $(DPKG_INSTALL) pkg-conff-obsolete-2.deb
+ test ! -f '$(DPKG_INSTDIR)/test-conffile'
+ test -f '$(DPKG_INSTDIR)/test-conffile.dpkg-bak'
+ $(DPKG_PURGE) pkg-conff-obsolete
+ test ! -f '$(DPKG_INSTDIR)/test-conffile.dpkg-bak'
+ # Abort-upgrade restores the to-be-removed conffile
+ $(DPKG_INSTALL) pkg-conff-obsolete-0.deb
+ $(BEROOT) touch '$(DPKG_INSTDIR)/fail-preinst'
+ $(DPKG_INSTALL) pkg-conff-obsolete-2.deb || true
+ $(BEROOT) rm -f '$(DPKG_INSTDIR)/fail-preinst'
+ test -f '$(DPKG_INSTDIR)/test-conffile'
+ test ! -f '$(DPKG_INSTDIR)/test-conffile.dpkg-remove'
+ test ! -f '$(DPKG_INSTDIR)/test-conffile.dpkg-bak'
+ test ! -f '$(DPKG_INSTDIR)/test-conffile.dpkg-backup'
+
+test-clean:
+ $(DPKG_PURGE) pkg-conff-obsolete
+