summaryrefslogtreecommitdiffstats
path: root/tests/t-triggers-db
diff options
context:
space:
mode:
Diffstat (limited to 'tests/t-triggers-db')
-rw-r--r--tests/t-triggers-db/Makefile50
-rw-r--r--tests/t-triggers-db/pkg-triggers-foreign/DEBIAN/control9
-rw-r--r--tests/t-triggers-db/pkg-triggers-foreign/DEBIAN/triggers2
-rw-r--r--tests/t-triggers-db/pkg-triggers-native/DEBIAN/control8
-rw-r--r--tests/t-triggers-db/pkg-triggers-native/DEBIAN/triggers2
-rw-r--r--tests/t-triggers-db/pkg-triggers-same/DEBIAN/control9
-rw-r--r--tests/t-triggers-db/pkg-triggers-same/DEBIAN/triggers2
-rw-r--r--tests/t-triggers-db/tmpl-db-foreign/arch2
-rw-r--r--tests/t-triggers-db/tmpl-db-foreign/info/format1
-rw-r--r--tests/t-triggers-db/tmpl-db-foreign/info/pkg-triggers.list1
-rw-r--r--tests/t-triggers-db/tmpl-db-foreign/info/pkg-triggers.md5sums0
-rw-r--r--tests/t-triggers-db/tmpl-db-foreign/info/pkg-triggers.triggers2
-rw-r--r--tests/t-triggers-db/tmpl-db-foreign/status10
-rw-r--r--tests/t-triggers-db/tmpl-db-foreign/triggers/File1
-rw-r--r--tests/t-triggers-db/tmpl-db-foreign/triggers/a-trigger1
-rw-r--r--tests/t-triggers-db/tmpl-db-native/arch2
-rw-r--r--tests/t-triggers-db/tmpl-db-native/info/format1
-rw-r--r--tests/t-triggers-db/tmpl-db-native/info/pkg-triggers.list1
-rw-r--r--tests/t-triggers-db/tmpl-db-native/info/pkg-triggers.md5sums0
-rw-r--r--tests/t-triggers-db/tmpl-db-native/info/pkg-triggers.triggers2
-rw-r--r--tests/t-triggers-db/tmpl-db-native/status10
-rw-r--r--tests/t-triggers-db/tmpl-db-native/triggers/File1
-rw-r--r--tests/t-triggers-db/tmpl-db-native/triggers/a-trigger1
-rw-r--r--tests/t-triggers-db/tmpl-db-same/arch2
-rw-r--r--tests/t-triggers-db/tmpl-db-same/info/format1
-rw-r--r--tests/t-triggers-db/tmpl-db-same/info/pkg-triggers:amd64.list1
-rw-r--r--tests/t-triggers-db/tmpl-db-same/info/pkg-triggers:amd64.md5sums0
-rw-r--r--tests/t-triggers-db/tmpl-db-same/info/pkg-triggers:amd64.triggers2
-rw-r--r--tests/t-triggers-db/tmpl-db-same/status10
-rw-r--r--tests/t-triggers-db/tmpl-db-same/triggers/File1
-rw-r--r--tests/t-triggers-db/tmpl-db-same/triggers/a-trigger1
31 files changed, 136 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
diff --git a/tests/t-triggers-db/pkg-triggers-foreign/DEBIAN/control b/tests/t-triggers-db/pkg-triggers-foreign/DEBIAN/control
new file mode 100644
index 0000000..a10bb5c
--- /dev/null
+++ b/tests/t-triggers-db/pkg-triggers-foreign/DEBIAN/control
@@ -0,0 +1,9 @@
+Package: pkg-triggers
+Version: 0.0-1
+Section: test
+Priority: extra
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Multi-Arch: foreign
+Architecture: other
+Description: test package - providing triggers
+
diff --git a/tests/t-triggers-db/pkg-triggers-foreign/DEBIAN/triggers b/tests/t-triggers-db/pkg-triggers-foreign/DEBIAN/triggers
new file mode 100644
index 0000000..13d2512
--- /dev/null
+++ b/tests/t-triggers-db/pkg-triggers-foreign/DEBIAN/triggers
@@ -0,0 +1,2 @@
+interest-noawait a-trigger
+interest-noawait /triggers
diff --git a/tests/t-triggers-db/pkg-triggers-native/DEBIAN/control b/tests/t-triggers-db/pkg-triggers-native/DEBIAN/control
new file mode 100644
index 0000000..ff9d5d5
--- /dev/null
+++ b/tests/t-triggers-db/pkg-triggers-native/DEBIAN/control
@@ -0,0 +1,8 @@
+Package: pkg-triggers
+Version: 0.0-1
+Section: test
+Priority: extra
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: all
+Description: test package - providing triggers
+
diff --git a/tests/t-triggers-db/pkg-triggers-native/DEBIAN/triggers b/tests/t-triggers-db/pkg-triggers-native/DEBIAN/triggers
new file mode 100644
index 0000000..13d2512
--- /dev/null
+++ b/tests/t-triggers-db/pkg-triggers-native/DEBIAN/triggers
@@ -0,0 +1,2 @@
+interest-noawait a-trigger
+interest-noawait /triggers
diff --git a/tests/t-triggers-db/pkg-triggers-same/DEBIAN/control b/tests/t-triggers-db/pkg-triggers-same/DEBIAN/control
new file mode 100644
index 0000000..6fbb5cf
--- /dev/null
+++ b/tests/t-triggers-db/pkg-triggers-same/DEBIAN/control
@@ -0,0 +1,9 @@
+Package: pkg-triggers
+Version: 0.0-1
+Section: test
+Priority: extra
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Multi-Arch: same
+Architecture: amd64
+Description: test package - providing triggers
+
diff --git a/tests/t-triggers-db/pkg-triggers-same/DEBIAN/triggers b/tests/t-triggers-db/pkg-triggers-same/DEBIAN/triggers
new file mode 100644
index 0000000..13d2512
--- /dev/null
+++ b/tests/t-triggers-db/pkg-triggers-same/DEBIAN/triggers
@@ -0,0 +1,2 @@
+interest-noawait a-trigger
+interest-noawait /triggers
diff --git a/tests/t-triggers-db/tmpl-db-foreign/arch b/tests/t-triggers-db/tmpl-db-foreign/arch
new file mode 100644
index 0000000..8dfbb4b
--- /dev/null
+++ b/tests/t-triggers-db/tmpl-db-foreign/arch
@@ -0,0 +1,2 @@
+amd64
+other
diff --git a/tests/t-triggers-db/tmpl-db-foreign/info/format b/tests/t-triggers-db/tmpl-db-foreign/info/format
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/tests/t-triggers-db/tmpl-db-foreign/info/format
@@ -0,0 +1 @@
+1
diff --git a/tests/t-triggers-db/tmpl-db-foreign/info/pkg-triggers.list b/tests/t-triggers-db/tmpl-db-foreign/info/pkg-triggers.list
new file mode 100644
index 0000000..90ad5c9
--- /dev/null
+++ b/tests/t-triggers-db/tmpl-db-foreign/info/pkg-triggers.list
@@ -0,0 +1 @@
+/.
diff --git a/tests/t-triggers-db/tmpl-db-foreign/info/pkg-triggers.md5sums b/tests/t-triggers-db/tmpl-db-foreign/info/pkg-triggers.md5sums
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/t-triggers-db/tmpl-db-foreign/info/pkg-triggers.md5sums
diff --git a/tests/t-triggers-db/tmpl-db-foreign/info/pkg-triggers.triggers b/tests/t-triggers-db/tmpl-db-foreign/info/pkg-triggers.triggers
new file mode 100644
index 0000000..daa582c
--- /dev/null
+++ b/tests/t-triggers-db/tmpl-db-foreign/info/pkg-triggers.triggers
@@ -0,0 +1,2 @@
+interest a-trigger
+interest /triggers
diff --git a/tests/t-triggers-db/tmpl-db-foreign/status b/tests/t-triggers-db/tmpl-db-foreign/status
new file mode 100644
index 0000000..d2adcec
--- /dev/null
+++ b/tests/t-triggers-db/tmpl-db-foreign/status
@@ -0,0 +1,10 @@
+Package: pkg-triggers
+Status: install ok installed
+Priority: extra
+Section: test
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: other
+Multi-Arch: foreign
+Version: 0.0-1
+Description: test package - providing triggers
+
diff --git a/tests/t-triggers-db/tmpl-db-foreign/triggers/File b/tests/t-triggers-db/tmpl-db-foreign/triggers/File
new file mode 100644
index 0000000..d3cdd00
--- /dev/null
+++ b/tests/t-triggers-db/tmpl-db-foreign/triggers/File
@@ -0,0 +1 @@
+/triggers pkg-triggers:other
diff --git a/tests/t-triggers-db/tmpl-db-foreign/triggers/a-trigger b/tests/t-triggers-db/tmpl-db-foreign/triggers/a-trigger
new file mode 100644
index 0000000..fd04699
--- /dev/null
+++ b/tests/t-triggers-db/tmpl-db-foreign/triggers/a-trigger
@@ -0,0 +1 @@
+pkg-triggers:other
diff --git a/tests/t-triggers-db/tmpl-db-native/arch b/tests/t-triggers-db/tmpl-db-native/arch
new file mode 100644
index 0000000..8dfbb4b
--- /dev/null
+++ b/tests/t-triggers-db/tmpl-db-native/arch
@@ -0,0 +1,2 @@
+amd64
+other
diff --git a/tests/t-triggers-db/tmpl-db-native/info/format b/tests/t-triggers-db/tmpl-db-native/info/format
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/tests/t-triggers-db/tmpl-db-native/info/format
@@ -0,0 +1 @@
+1
diff --git a/tests/t-triggers-db/tmpl-db-native/info/pkg-triggers.list b/tests/t-triggers-db/tmpl-db-native/info/pkg-triggers.list
new file mode 100644
index 0000000..90ad5c9
--- /dev/null
+++ b/tests/t-triggers-db/tmpl-db-native/info/pkg-triggers.list
@@ -0,0 +1 @@
+/.
diff --git a/tests/t-triggers-db/tmpl-db-native/info/pkg-triggers.md5sums b/tests/t-triggers-db/tmpl-db-native/info/pkg-triggers.md5sums
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/t-triggers-db/tmpl-db-native/info/pkg-triggers.md5sums
diff --git a/tests/t-triggers-db/tmpl-db-native/info/pkg-triggers.triggers b/tests/t-triggers-db/tmpl-db-native/info/pkg-triggers.triggers
new file mode 100644
index 0000000..daa582c
--- /dev/null
+++ b/tests/t-triggers-db/tmpl-db-native/info/pkg-triggers.triggers
@@ -0,0 +1,2 @@
+interest a-trigger
+interest /triggers
diff --git a/tests/t-triggers-db/tmpl-db-native/status b/tests/t-triggers-db/tmpl-db-native/status
new file mode 100644
index 0000000..43ea531
--- /dev/null
+++ b/tests/t-triggers-db/tmpl-db-native/status
@@ -0,0 +1,10 @@
+Package: pkg-triggers
+Status: install ok installed
+Priority: extra
+Section: test
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: all
+Multi-Arch: foreign
+Version: 0.0-1
+Description: test package - providing triggers
+
diff --git a/tests/t-triggers-db/tmpl-db-native/triggers/File b/tests/t-triggers-db/tmpl-db-native/triggers/File
new file mode 100644
index 0000000..8311952
--- /dev/null
+++ b/tests/t-triggers-db/tmpl-db-native/triggers/File
@@ -0,0 +1 @@
+/triggers pkg-triggers
diff --git a/tests/t-triggers-db/tmpl-db-native/triggers/a-trigger b/tests/t-triggers-db/tmpl-db-native/triggers/a-trigger
new file mode 100644
index 0000000..e61fd5f
--- /dev/null
+++ b/tests/t-triggers-db/tmpl-db-native/triggers/a-trigger
@@ -0,0 +1 @@
+pkg-triggers
diff --git a/tests/t-triggers-db/tmpl-db-same/arch b/tests/t-triggers-db/tmpl-db-same/arch
new file mode 100644
index 0000000..8dfbb4b
--- /dev/null
+++ b/tests/t-triggers-db/tmpl-db-same/arch
@@ -0,0 +1,2 @@
+amd64
+other
diff --git a/tests/t-triggers-db/tmpl-db-same/info/format b/tests/t-triggers-db/tmpl-db-same/info/format
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/tests/t-triggers-db/tmpl-db-same/info/format
@@ -0,0 +1 @@
+1
diff --git a/tests/t-triggers-db/tmpl-db-same/info/pkg-triggers:amd64.list b/tests/t-triggers-db/tmpl-db-same/info/pkg-triggers:amd64.list
new file mode 100644
index 0000000..90ad5c9
--- /dev/null
+++ b/tests/t-triggers-db/tmpl-db-same/info/pkg-triggers:amd64.list
@@ -0,0 +1 @@
+/.
diff --git a/tests/t-triggers-db/tmpl-db-same/info/pkg-triggers:amd64.md5sums b/tests/t-triggers-db/tmpl-db-same/info/pkg-triggers:amd64.md5sums
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/t-triggers-db/tmpl-db-same/info/pkg-triggers:amd64.md5sums
diff --git a/tests/t-triggers-db/tmpl-db-same/info/pkg-triggers:amd64.triggers b/tests/t-triggers-db/tmpl-db-same/info/pkg-triggers:amd64.triggers
new file mode 100644
index 0000000..daa582c
--- /dev/null
+++ b/tests/t-triggers-db/tmpl-db-same/info/pkg-triggers:amd64.triggers
@@ -0,0 +1,2 @@
+interest a-trigger
+interest /triggers
diff --git a/tests/t-triggers-db/tmpl-db-same/status b/tests/t-triggers-db/tmpl-db-same/status
new file mode 100644
index 0000000..f8c4918
--- /dev/null
+++ b/tests/t-triggers-db/tmpl-db-same/status
@@ -0,0 +1,10 @@
+Package: pkg-triggers
+Status: install ok installed
+Priority: extra
+Section: test
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: amd64
+Multi-Arch: same
+Version: 0.0-1
+Description: test package - providing triggers
+
diff --git a/tests/t-triggers-db/tmpl-db-same/triggers/File b/tests/t-triggers-db/tmpl-db-same/triggers/File
new file mode 100644
index 0000000..567acba
--- /dev/null
+++ b/tests/t-triggers-db/tmpl-db-same/triggers/File
@@ -0,0 +1 @@
+/triggers pkg-triggers:amd64
diff --git a/tests/t-triggers-db/tmpl-db-same/triggers/a-trigger b/tests/t-triggers-db/tmpl-db-same/triggers/a-trigger
new file mode 100644
index 0000000..37c2cf7
--- /dev/null
+++ b/tests/t-triggers-db/tmpl-db-same/triggers/a-trigger
@@ -0,0 +1 @@
+pkg-triggers:amd64