summaryrefslogtreecommitdiffstats
path: root/tests/t-file-replaces-disappear/Makefile
blob: 719f02bf973f867f049332929c1989f4acb118ba (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
57
58
59
60
61
62
63
64
65
TESTS_DEB := pkg-file-original pkg-file-takeover

include ../Test.mk

TEST_CASES += test-two-run-ordered
TEST_CASES += test-one-run-ordered
TEST_CASES += test-two-run-reverse
TEST_CASES += test-one-run-reverse

test-case: $(TEST_CASES)

define VERIFY
$(call pkg_is_installed,pkg-file-takeover)
test "`$(DPKG_QUERY) -S /test-file`" = "pkg-file-takeover: /test-file"
test "`$(DPKG_QUERY) -S /test-other`" = "pkg-file-takeover: /test-other"
cmp ref-file "$(DPKG_INSTDIR)/test-file"
cmp ref-file "$(DPKG_INSTDIR)/test-other"
endef

test-two-run-ordered:
	# test-two-run-ordered
	$(DPKG_INSTALL) pkg-file-original.deb
	$(DPKG_INSTALL) pkg-file-takeover.deb
	$(call pkg_is_not_installed,pkg-file-original)
	$(VERIFY)
	$(DPKG_PURGE) pkg-file-original pkg-file-takeover
	test ! -f "$(DPKG_INSTDIR)/test-file"
	test ! -f "$(DPKG_INSTDIR)/test-other"

test-one-run-ordered:
	# test-one-run-ordered
	$(DPKG_INSTALL) pkg-file-original.deb pkg-file-takeover.deb
	$(call pkg_is_not_installed,pkg-file-original)
	$(VERIFY)
	$(DPKG_PURGE) pkg-file-original pkg-file-takeover
	test ! -f "$(DPKG_INSTDIR)/test-file"
	test ! -f "$(DPKG_INSTDIR)/test-other"

test-two-run-reverse:
	# test-two-run-reverse
	$(DPKG_INSTALL) pkg-file-takeover.deb
	$(DPKG_INSTALL) pkg-file-original.deb
	$(call pkg_is_installed,pkg-file-original)
	$(VERIFY)
	$(DPKG_PURGE) pkg-file-original
	test -f "$(DPKG_INSTDIR)/test-file"
	test -f "$(DPKG_INSTDIR)/test-other"
	$(DPKG_PURGE) pkg-file-takeover
	test ! -f "$(DPKG_INSTDIR)/test-file"
	test ! -f "$(DPKG_INSTDIR)/test-other"

test-one-run-reverse:
	# test-one-run-reverse
	$(DPKG_INSTALL) pkg-file-takeover.deb pkg-file-original.deb
	$(call pkg_is_installed,pkg-file-original)
	$(VERIFY)
	$(DPKG_PURGE) pkg-file-original
	test -f "$(DPKG_INSTDIR)/test-file"
	test -f "$(DPKG_INSTDIR)/test-other"
	$(DPKG_PURGE) pkg-file-takeover
	test ! -f "$(DPKG_INSTDIR)/test-file"
	test ! -f "$(DPKG_INSTDIR)/test-other"

test-clean:
	$(DPKG_PURGE) pkg-file-original pkg-file-takeover