summaryrefslogtreecommitdiffstats
path: root/tests/t-triggers-db/Makefile
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-triggers-db/Makefile
parentInitial commit. (diff)
downloaddpkg-cbffab246997fb5a06211dfb706b54e5ae5bb59f.tar.xz
dpkg-cbffab246997fb5a06211dfb706b54e5ae5bb59f.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-triggers-db/Makefile')
-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