summaryrefslogtreecommitdiffstats
path: root/tests/t-unpack-hardlink/Makefile
blob: 3412ca5ce259b92af89b789a230a0aaf6a24ca0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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