summaryrefslogtreecommitdiffstats
path: root/tests/t-unpack-hardlink
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 18:35:28 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 18:35:28 +0000
commitea314d2f45c40a006c0104157013ab4b857f665f (patch)
tree3ef2971cb3675c318b8d9effd987854ad3f6d3e8 /tests/t-unpack-hardlink
parentInitial commit. (diff)
downloaddpkg-ea314d2f45c40a006c0104157013ab4b857f665f.tar.xz
dpkg-ea314d2f45c40a006c0104157013ab4b857f665f.zip
Adding upstream version 1.22.4.upstream/1.22.4
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--tests/t-unpack-hardlink/Makefile56
-rw-r--r--tests/t-unpack-hardlink/pkg-hardlink/DEBIAN/conffiles2
-rw-r--r--tests/t-unpack-hardlink/pkg-hardlink/DEBIAN/control8
3 files changed, 66 insertions, 0 deletions
diff --git a/tests/t-unpack-hardlink/Makefile b/tests/t-unpack-hardlink/Makefile
new file mode 100644
index 0000000..3412ca5
--- /dev/null
+++ b/tests/t-unpack-hardlink/Makefile
@@ -0,0 +1,56 @@
+PKG := pkg-hardlink
+
+TESTS_DEB := $(PKG)
+
+include ../Test.mk
+
+$(PKG)/test-conffile-link0:
+ echo "test hard linked conffile" >$@
+ link $@ $(PKG)/test-conffile-link1
+
+$(PKG)/test-file-link0:
+ echo "test hard linked file" >$@
+ link $@ $(PKG)/test-file-link1
+
+$(PKG)/test-fifo-link0:
+ mkfifo $@
+ link $@ $(PKG)/test-fifo-link1
+
+$(PKG)/test-null-link0:
+ $(BEROOT) mknod $@ c 1 3
+ $(BEROOT) link $@ $(PKG)/test-null-link1
+
+$(PKG)/test-ram0-link0:
+ $(BEROOT) mknod $@ b 1 0
+ $(BEROOT) link $@ $(PKG)/test-ram0-link1
+
+TEST_LINKS := \
+ $(PKG)/test-conffile-link0 \
+ $(PKG)/test-file-link0 \
+ $(PKG)/test-fifo-link0 \
+ # EOL
+
+ifdef DPKG_AS_ROOT
+TEST_LINKS += \
+ $(PKG)/test-null-link0 \
+ $(PKG)/test-ram0-link0 \
+ # EOL
+endif
+
+build-hook: $(TEST_LINKS)
+
+clean-hook:
+ rm -f $(PKG)/test-conffile-link0 $(PKG)/test-conffile-link1
+ rm -f $(PKG)/test-file-link0 $(PKG)/test-file-link1
+ rm -f $(PKG)/test-fifo-link0 $(PKG)/test-fifo-link1
+ rm -f $(PKG)/test-null-link0 $(PKG)/test-null-link1
+ rm -f $(PKG)/test-ram0-link0 $(PKG)/test-ram0-link1
+
+test-case:
+ # test unpacking hardlinks
+ $(DPKG_INSTALL) pkg-hardlink.deb
+ $(call pkg_is_installed,pkg-hardlink)
+
+test-clean:
+ $(DPKG_PURGE) pkg-hardlink
+
diff --git a/tests/t-unpack-hardlink/pkg-hardlink/DEBIAN/conffiles b/tests/t-unpack-hardlink/pkg-hardlink/DEBIAN/conffiles
new file mode 100644
index 0000000..4634045
--- /dev/null
+++ b/tests/t-unpack-hardlink/pkg-hardlink/DEBIAN/conffiles
@@ -0,0 +1,2 @@
+/test-conffile-link0
+/test-conffile-link1
diff --git a/tests/t-unpack-hardlink/pkg-hardlink/DEBIAN/control b/tests/t-unpack-hardlink/pkg-hardlink/DEBIAN/control
new file mode 100644
index 0000000..c513f9c
--- /dev/null
+++ b/tests/t-unpack-hardlink/pkg-hardlink/DEBIAN/control
@@ -0,0 +1,8 @@
+Package: pkg-hardlink
+Version: 0.0-1
+Section: test
+Priority: extra
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: all
+Description: test package - unpack hardlinks
+