summaryrefslogtreecommitdiffstats
path: root/tests/t-conffile-conflict
diff options
context:
space:
mode:
Diffstat (limited to 'tests/t-conffile-conflict')
-rw-r--r--tests/t-conffile-conflict/Makefile44
-rw-r--r--tests/t-conffile-conflict/pkg-conff-a/DEBIAN/conffiles1
-rw-r--r--tests/t-conffile-conflict/pkg-conff-a/DEBIAN/control8
-rw-r--r--tests/t-conffile-conflict/pkg-conff-a/test-conffile1
-rw-r--r--tests/t-conffile-conflict/pkg-conff-b/DEBIAN/conffiles1
-rw-r--r--tests/t-conffile-conflict/pkg-conff-b/DEBIAN/control8
-rw-r--r--tests/t-conffile-conflict/pkg-conff-b/test-conffile1
-rw-r--r--tests/t-conffile-conflict/pkg-conff-c/DEBIAN/conffiles1
-rw-r--r--tests/t-conffile-conflict/pkg-conff-c/DEBIAN/control9
-rw-r--r--tests/t-conffile-conflict/pkg-conff-c/test-conffile1
10 files changed, 75 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
diff --git a/tests/t-conffile-conflict/pkg-conff-a/DEBIAN/conffiles b/tests/t-conffile-conflict/pkg-conff-a/DEBIAN/conffiles
new file mode 100644
index 0000000..4fad7e9
--- /dev/null
+++ b/tests/t-conffile-conflict/pkg-conff-a/DEBIAN/conffiles
@@ -0,0 +1 @@
+/test-conffile
diff --git a/tests/t-conffile-conflict/pkg-conff-a/DEBIAN/control b/tests/t-conffile-conflict/pkg-conff-a/DEBIAN/control
new file mode 100644
index 0000000..a346bae
--- /dev/null
+++ b/tests/t-conffile-conflict/pkg-conff-a/DEBIAN/control
@@ -0,0 +1,8 @@
+Package: pkg-conff-a
+Version: 0
+Section: test
+Priority: extra
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: all
+Description: test package - conflicting conffile
+
diff --git a/tests/t-conffile-conflict/pkg-conff-a/test-conffile b/tests/t-conffile-conflict/pkg-conff-a/test-conffile
new file mode 100644
index 0000000..024da49
--- /dev/null
+++ b/tests/t-conffile-conflict/pkg-conff-a/test-conffile
@@ -0,0 +1 @@
+pkg-conff-a
diff --git a/tests/t-conffile-conflict/pkg-conff-b/DEBIAN/conffiles b/tests/t-conffile-conflict/pkg-conff-b/DEBIAN/conffiles
new file mode 100644
index 0000000..4fad7e9
--- /dev/null
+++ b/tests/t-conffile-conflict/pkg-conff-b/DEBIAN/conffiles
@@ -0,0 +1 @@
+/test-conffile
diff --git a/tests/t-conffile-conflict/pkg-conff-b/DEBIAN/control b/tests/t-conffile-conflict/pkg-conff-b/DEBIAN/control
new file mode 100644
index 0000000..e3f6951
--- /dev/null
+++ b/tests/t-conffile-conflict/pkg-conff-b/DEBIAN/control
@@ -0,0 +1,8 @@
+Package: pkg-conff-b
+Version: 0
+Section: test
+Priority: extra
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: all
+Description: test package - conflicting conffile
+
diff --git a/tests/t-conffile-conflict/pkg-conff-b/test-conffile b/tests/t-conffile-conflict/pkg-conff-b/test-conffile
new file mode 100644
index 0000000..006fbc7
--- /dev/null
+++ b/tests/t-conffile-conflict/pkg-conff-b/test-conffile
@@ -0,0 +1 @@
+pkg-conff-b
diff --git a/tests/t-conffile-conflict/pkg-conff-c/DEBIAN/conffiles b/tests/t-conffile-conflict/pkg-conff-c/DEBIAN/conffiles
new file mode 100644
index 0000000..4fad7e9
--- /dev/null
+++ b/tests/t-conffile-conflict/pkg-conff-c/DEBIAN/conffiles
@@ -0,0 +1 @@
+/test-conffile
diff --git a/tests/t-conffile-conflict/pkg-conff-c/DEBIAN/control b/tests/t-conffile-conflict/pkg-conff-c/DEBIAN/control
new file mode 100644
index 0000000..a94ef2e
--- /dev/null
+++ b/tests/t-conffile-conflict/pkg-conff-c/DEBIAN/control
@@ -0,0 +1,9 @@
+Package: pkg-conff-c
+Version: 0
+Section: test
+Priority: extra
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: all
+Conflicts: pkg-conff-a
+Description: test package - conflicting conffile
+
diff --git a/tests/t-conffile-conflict/pkg-conff-c/test-conffile b/tests/t-conffile-conflict/pkg-conff-c/test-conffile
new file mode 100644
index 0000000..a6cfe38
--- /dev/null
+++ b/tests/t-conffile-conflict/pkg-conff-c/test-conffile
@@ -0,0 +1 @@
+pkg-conff-c