From 081eb9844f93a5f338588fdbb7c4efe80e781be4 Mon Sep 17 00:00:00 2001
From: Niels Thykier <niels@thykier.net>
Date: Sun, 3 May 2020 19:27:12 +0000
Subject: [PATCH] t-conffile-declarative-removal: Add --unpack + --configure
 variant of test

Signed-off-by: Niels Thykier <niels@thykier.net>
---
 t-conffile-declarative-removal/Makefile | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/t-conffile-declarative-removal/Makefile b/t-conffile-declarative-removal/Makefile
index 31f7ccb..64efe50 100644
--- a/t-conffile-declarative-removal/Makefile
+++ b/t-conffile-declarative-removal/Makefile
@@ -14,6 +14,22 @@ test-case:
 	$(DPKG_PURGE) pkg-conffile
 	test ! -f "$(DPKG_INSTDIR)/test-dir/test-conffile-to-be-removed"
 
+	# Unmodified case - but force it to happen via two invocations
+	$(DPKG_INSTALL) pkg-conffile-v1.deb
+	test -f "$(DPKG_INSTDIR)/test-dir/test-conffile-to-be-removed"
+	$(DPKG_UNPACK) pkg-conffile-v2.deb
+	# The old file is still present when unpacked
+	test -f "$(DPKG_INSTDIR)/test-dir/test-conffile-to-be-removed"
+	test ! -f "$(DPKG_INSTDIR)/test-dir/test-conffile-to-be-removed.dpkg-old"
+	$(DPKG_CONFIGURE) pkg-conffile
+	# After configure, the file is removed
+	test ! -f "$(DPKG_INSTDIR)/test-dir/test-conffile-to-be-removed"
+	test ! -f "$(DPKG_INSTDIR)/test-dir/test-conffile-to-be-removed.dpkg-old"
+
+	# Reset
+	$(DPKG_PURGE) pkg-conffile
+	test ! -f "$(DPKG_INSTDIR)/test-dir/test-conffile-to-be-removed"
+
 	# Modified; should store .dpkg-old
 	$(DPKG_INSTALL) pkg-conffile-v1.deb
 	test -f "$(DPKG_INSTDIR)/test-dir/test-conffile-to-be-removed"
-- 
2.26.2

