summaryrefslogtreecommitdiffstats
path: root/tests/t-triggers-db/Makefile
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-triggers-db/Makefile
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-triggers-db/Makefile50
1 files changed, 50 insertions, 0 deletions
diff --git a/tests/t-triggers-db/Makefile b/tests/t-triggers-db/Makefile
new file mode 100644
index 0000000..c0766d6
--- /dev/null
+++ b/tests/t-triggers-db/Makefile
@@ -0,0 +1,50 @@
+TESTS_DEB := pkg-triggers-native pkg-triggers-foreign pkg-triggers-same
+
+include ../Test.mk
+
+TEST_CASES += test-trigger-db-native-to-same
+TEST_CASES += test-trigger-db-foreign-to-same
+TEST_CASES += test-trigger-db-same-to-same
+
+test-case: $(TEST_CASES)
+
+test-trigger-db-native-to-same: override DPKG_ADMINDIR = db-native
+test-trigger-db-native-to-same:
+ cp -a tmpl-$(DPKG_ADMINDIR) $(DPKG_ADMINDIR)
+ $(call stdout_is,cat "$(DPKG_ADMINDIR)/triggers/a-trigger",pkg-triggers)
+ $(call stdout_is,cat "$(DPKG_ADMINDIR)/triggers/File",/triggers pkg-triggers)
+ $(DPKG_INSTALL) pkg-triggers-native.deb
+ $(call stdout_is,cat "$(DPKG_ADMINDIR)/triggers/a-trigger",pkg-triggers/noawait)
+ grep -q "^/triggers pkg-triggers/noawait$$" "$(DPKG_ADMINDIR)/triggers/File"
+ $(DPKG_INSTALL) pkg-triggers-same.deb
+ $(call stdout_is,cat "$(DPKG_ADMINDIR)/triggers/a-trigger",pkg-triggers:amd64/noawait)
+ $(call stdout_is,cat "$(DPKG_ADMINDIR)/triggers/File",/triggers pkg-triggers:amd64/noawait)
+ $(DPKG_PURGE) pkg-triggers
+
+test-trigger-db-foreign-to-same: override DPKG_ADMINDIR = db-foreign
+test-trigger-db-foreign-to-same:
+ cp -a tmpl-$(DPKG_ADMINDIR) $(DPKG_ADMINDIR)
+ $(call stdout_is,cat "$(DPKG_ADMINDIR)/triggers/a-trigger",pkg-triggers:other)
+ $(call stdout_is,cat "$(DPKG_ADMINDIR)/triggers/File",/triggers pkg-triggers:other)
+ : # The db needs to be reproducible, so it gets normalized on upgrade.
+ $(DPKG_INSTALL) pkg-triggers-foreign.deb
+ $(call stdout_is,cat "$(DPKG_ADMINDIR)/triggers/a-trigger",pkg-triggers/noawait)
+ $(call stdout_is,cat "$(DPKG_ADMINDIR)/triggers/File",/triggers pkg-triggers/noawait)
+ $(DPKG_INSTALL) pkg-triggers-same.deb
+ $(call stdout_is,cat "$(DPKG_ADMINDIR)/triggers/a-trigger",pkg-triggers:amd64/noawait)
+ $(call stdout_is,cat "$(DPKG_ADMINDIR)/triggers/File",/triggers pkg-triggers:amd64/noawait)
+ $(DPKG_PURGE) pkg-triggers
+
+test-trigger-db-same-to-same: override DPKG_ADMINDIR = db-same
+test-trigger-db-same-to-same:
+ cp -a tmpl-$(DPKG_ADMINDIR) $(DPKG_ADMINDIR)
+ $(call stdout_is,cat "$(DPKG_ADMINDIR)/triggers/a-trigger",pkg-triggers:amd64)
+ $(call stdout_is,cat "$(DPKG_ADMINDIR)/triggers/File",/triggers pkg-triggers:amd64)
+ $(DPKG_INSTALL) pkg-triggers-same.deb
+ $(call stdout_is,cat "$(DPKG_ADMINDIR)/triggers/a-trigger",pkg-triggers:amd64/noawait)
+ $(call stdout_is,cat "$(DPKG_ADMINDIR)/triggers/File",/triggers pkg-triggers:amd64/noawait)
+ $(DPKG_PURGE) pkg-triggers
+
+test-clean:
+ $(DPKG_PURGE) pkg-triggers
+ $(RM) -r db-native db-foreign db-same