summaryrefslogtreecommitdiffstats
path: root/tests/t-conffile-root-option
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-root-option
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-root-option')
-rw-r--r--tests/t-conffile-root-option/Makefile39
-rw-r--r--tests/t-conffile-root-option/pkg-conff-a-1/DEBIAN/conffiles1
-rw-r--r--tests/t-conffile-root-option/pkg-conff-a-1/DEBIAN/control7
-rw-r--r--tests/t-conffile-root-option/pkg-conff-a-1/test-conffile1
-rw-r--r--tests/t-conffile-root-option/pkg-conff-a-2/DEBIAN/control7
-rw-r--r--tests/t-conffile-root-option/pkg-conff-b-1/DEBIAN/control7
-rw-r--r--tests/t-conffile-root-option/pkg-conff-b-2/DEBIAN/conffiles1
-rw-r--r--tests/t-conffile-root-option/pkg-conff-b-2/DEBIAN/control7
-rw-r--r--tests/t-conffile-root-option/pkg-conff-b-2/test-conffile1
9 files changed, 71 insertions, 0 deletions
diff --git a/tests/t-conffile-root-option/Makefile b/tests/t-conffile-root-option/Makefile
new file mode 100644
index 0000000..bd98cc7
--- /dev/null
+++ b/tests/t-conffile-root-option/Makefile
@@ -0,0 +1,39 @@
+TESTS_DEB := pkg-conff-a-1 pkg-conff-a-2 pkg-conff-b-1 pkg-conff-b-2
+
+include ../Test.mk
+
+TEST_CASES += test-conffile-move-packages-no-rootdir
+TEST_CASES += test-conffile-move-packages-rootdir
+
+test-case: $(TEST_CASES)
+
+test-conffile-move-packages-no-rootdir:
+ # Install base versions.
+ $(DPKG_INSTALL) pkg-conff-a-1.deb pkg-conff-b-1.deb
+ # Install update, conffile moves from a to b.
+ $(DPKG_INSTALL) pkg-conff-a-2.deb pkg-conff-b-2.deb
+ # Cleanup.
+ -$(DPKG_PURGE) pkg-conff-b
+ -$(DPKG_PURGE) pkg-conff-a
+
+TEST_ROOT := $(CURDIR)/target
+
+test-conffile-move-packages-rootdir: override DPKG_ADMINDIR = $(TEST_ROOT)/var/lib/dpkg
+test-conffile-move-packages-rootdir: override DPKG_INSTDIR = $(TEST_ROOT)
+test-conffile-move-packages-rootdir:
+ # Create template root dir.
+ mkdir -p $(DPKG_ADMINDIR)/info
+ mkdir -p $(DPKG_ADMINDIR)/updates
+ mkdir -p $(DPKG_ADMINDIR)/triggers
+ touch $(DPKG_ADMINDIR)/status
+ # Install base versions.
+ $(DPKG_INSTALL) pkg-conff-a-1.deb pkg-conff-b-1.deb
+ # Install update, conffile moves from a to b.
+ $(DPKG_INSTALL) pkg-conff-a-2.deb pkg-conff-b-2.deb
+ # Cleanup.
+ -$(DPKG_PURGE) pkg-conff-b
+ -$(DPKG_PURGE) pkg-conff-a
+
+test-clean:
+ -$(DPKG_PURGE) pkg-conff-a pkg-conff-b
+ -$(BEROOT) rm -rf $(TEST_ROOT)
diff --git a/tests/t-conffile-root-option/pkg-conff-a-1/DEBIAN/conffiles b/tests/t-conffile-root-option/pkg-conff-a-1/DEBIAN/conffiles
new file mode 100644
index 0000000..4fad7e9
--- /dev/null
+++ b/tests/t-conffile-root-option/pkg-conff-a-1/DEBIAN/conffiles
@@ -0,0 +1 @@
+/test-conffile
diff --git a/tests/t-conffile-root-option/pkg-conff-a-1/DEBIAN/control b/tests/t-conffile-root-option/pkg-conff-a-1/DEBIAN/control
new file mode 100644
index 0000000..a2578e4
--- /dev/null
+++ b/tests/t-conffile-root-option/pkg-conff-a-1/DEBIAN/control
@@ -0,0 +1,7 @@
+Package: pkg-conff-a
+Version: 1
+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-root-option/pkg-conff-a-1/test-conffile b/tests/t-conffile-root-option/pkg-conff-a-1/test-conffile
new file mode 100644
index 0000000..024da49
--- /dev/null
+++ b/tests/t-conffile-root-option/pkg-conff-a-1/test-conffile
@@ -0,0 +1 @@
+pkg-conff-a
diff --git a/tests/t-conffile-root-option/pkg-conff-a-2/DEBIAN/control b/tests/t-conffile-root-option/pkg-conff-a-2/DEBIAN/control
new file mode 100644
index 0000000..21eb309
--- /dev/null
+++ b/tests/t-conffile-root-option/pkg-conff-a-2/DEBIAN/control
@@ -0,0 +1,7 @@
+Package: pkg-conff-a
+Version: 2
+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-root-option/pkg-conff-b-1/DEBIAN/control b/tests/t-conffile-root-option/pkg-conff-b-1/DEBIAN/control
new file mode 100644
index 0000000..0f87276
--- /dev/null
+++ b/tests/t-conffile-root-option/pkg-conff-b-1/DEBIAN/control
@@ -0,0 +1,7 @@
+Package: pkg-conff-b
+Version: 1
+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-root-option/pkg-conff-b-2/DEBIAN/conffiles b/tests/t-conffile-root-option/pkg-conff-b-2/DEBIAN/conffiles
new file mode 100644
index 0000000..4fad7e9
--- /dev/null
+++ b/tests/t-conffile-root-option/pkg-conff-b-2/DEBIAN/conffiles
@@ -0,0 +1 @@
+/test-conffile
diff --git a/tests/t-conffile-root-option/pkg-conff-b-2/DEBIAN/control b/tests/t-conffile-root-option/pkg-conff-b-2/DEBIAN/control
new file mode 100644
index 0000000..57b18ee
--- /dev/null
+++ b/tests/t-conffile-root-option/pkg-conff-b-2/DEBIAN/control
@@ -0,0 +1,7 @@
+Package: pkg-conff-b
+Version: 2
+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-root-option/pkg-conff-b-2/test-conffile b/tests/t-conffile-root-option/pkg-conff-b-2/test-conffile
new file mode 100644
index 0000000..006fbc7
--- /dev/null
+++ b/tests/t-conffile-root-option/pkg-conff-b-2/test-conffile
@@ -0,0 +1 @@
+pkg-conff-b