summaryrefslogtreecommitdiffstats
path: root/tests/t-db
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 09:40:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 09:40:31 +0000
commitb86570f63e533abcbcb97c2572e0e5732a96307b (patch)
treecabc83be691530ae685c45a8bc7620ccc0e1ebdf /tests/t-db
parentInitial commit. (diff)
downloaddpkg-b86570f63e533abcbcb97c2572e0e5732a96307b.tar.xz
dpkg-b86570f63e533abcbcb97c2572e0e5732a96307b.zip
Adding upstream version 1.20.13.upstream/1.20.13upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/t-db')
-rw-r--r--tests/t-db/Makefile60
-rw-r--r--tests/t-db/db-bogus-dupe-diff-single/status18
-rw-r--r--tests/t-db/db-bogus-dupe-diff-single/updates/.keep0
-rw-r--r--tests/t-db/db-bogus-dupe-same-single/status18
-rw-r--r--tests/t-db/db-bogus-dupe-same-single/updates/.keep0
-rw-r--r--tests/t-db/db-bogus-multi-update/status16
-rw-r--r--tests/t-db/db-bogus-multi-update/updates/000110
-rw-r--r--tests/t-db/db-bogus-multi-update/updates/00029
-rw-r--r--tests/t-db/db-bogus-multi/status29
-rw-r--r--tests/t-db/db-bogus-multi/updates/.keep0
-rw-r--r--tests/t-db/db-bogus-single/status19
-rw-r--r--tests/t-db/db-bogus-single/updates/.keep0
-rw-r--r--tests/t-db/db-cross-multi-update/status10
-rw-r--r--tests/t-db/db-cross-multi-update/updates/000110
-rw-r--r--tests/t-db/db-cross-multi-update/updates/000210
-rw-r--r--tests/t-db/db-cross-multi-update/updates/00039
-rw-r--r--tests/t-db/db-cross-single-update/status9
-rw-r--r--tests/t-db/db-cross-single-update/updates/000110
-rw-r--r--tests/t-db/db-cross-single-update/updates/00029
-rw-r--r--tests/t-db/db-dupe-multi/status20
-rw-r--r--tests/t-db/db-dupe-multi/updates/.keep0
-rw-r--r--tests/t-db/db-field-blank-lines-update/status13
-rw-r--r--tests/t-db/db-field-blank-lines-update/updates/.keep0
-rw-r--r--tests/t-db/db-field-blank-lines-update/updates/000113
-rw-r--r--tests/t-db/db-field-blank-lines/status27
-rw-r--r--tests/t-db/db-field-blank-lines/updates/.keep0
26 files changed, 319 insertions, 0 deletions
diff --git a/tests/t-db/Makefile b/tests/t-db/Makefile
new file mode 100644
index 0000000..2e5b621
--- /dev/null
+++ b/tests/t-db/Makefile
@@ -0,0 +1,60 @@
+# Copyright © 2012 Guillem Jover <guillem@debian.org>
+
+TESTS_DEB :=
+
+include ../Test.mk
+
+PKG_TUPLE = LC_ALL=C $(DPKG_QUERY) -f '$${Package}:$${Architecture}:$${Version}' -W
+
+TEST_CASES += test-field-blank-lines
+TEST_CASES += test-field-blank-lines-update
+TEST_CASES += test-dupe-multi
+TEST_CASES += test-cross-single-update
+TEST_CASES += test-cross-multi-update
+TEST_CASES += test-bogus-single
+TEST_CASES += test-bogus-dupe-same-single
+TEST_CASES += test-bogus-dupe-diff-single
+TEST_CASES += test-bogus-multi
+TEST_CASES += test-bogus-multi-update
+
+test-case: $(TEST_CASES)
+
+test-field-blank-lines: override DPKG_ADMINDIR = db-field-blank-lines
+test-field-blank-lines:
+ $(call stderr_has,$(PKG_TUPLE),warning)
+
+test-field-blank-lines-update: override DPKG_ADMINDIR = db-field-blank-lines-update
+test-field-blank-lines-update:
+ $(call stderr_has,$(PKG_TUPLE),warning)
+
+test-dupe-multi: override DPKG_ADMINDIR = db-dupe-multi
+test-dupe-multi:
+ $(call stdout_is,$(PKG_TUPLE),pkg-multi:amd64:1.0)
+
+test-cross-single-update: override DPKG_ADMINDIR = db-cross-single-update
+test-cross-single-update:
+ $(call stdout_is,$(PKG_TUPLE),pkg-single:armel:3.0)
+
+test-cross-multi-update: override DPKG_ADMINDIR = db-cross-multi-update
+test-cross-multi-update:
+ $(call stdout_is,$(PKG_TUPLE),pkg-multi:armel:4.0)
+
+test-bogus-dupe-same-single: override DPKG_ADMINDIR = db-bogus-dupe-same-single
+test-bogus-dupe-same-single:
+ $(call stderr_has,$(PKG_TUPLE),error)
+
+test-bogus-dupe-diff-single: override DPKG_ADMINDIR = db-bogus-dupe-diff-single
+test-bogus-dupe-diff-single:
+ $(call stderr_has,$(PKG_TUPLE),error)
+
+test-bogus-single: override DPKG_ADMINDIR = db-bogus-single
+test-bogus-single:
+ $(call stderr_has,$(PKG_TUPLE),error)
+
+test-bogus-multi: override DPKG_ADMINDIR = db-bogus-multi
+test-bogus-multi:
+ $(call stderr_has,$(PKG_TUPLE),error)
+
+test-bogus-multi-update: override DPKG_ADMINDIR = db-bogus-multi-update
+test-bogus-multi-update:
+ $(call stderr_has,$(PKG_TUPLE),error)
diff --git a/tests/t-db/db-bogus-dupe-diff-single/status b/tests/t-db/db-bogus-dupe-diff-single/status
new file mode 100644
index 0000000..0274528
--- /dev/null
+++ b/tests/t-db/db-bogus-dupe-diff-single/status
@@ -0,0 +1,18 @@
+Package: pkg-single
+Status: install ok installed
+Priority: extra
+Section: test
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: amd64
+Version: 1.0
+Description: test package
+
+Package: pkg-single
+Status: install ok installed
+Priority: extra
+Section: test
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: i386
+Version: 2.0
+Description: test package
+
diff --git a/tests/t-db/db-bogus-dupe-diff-single/updates/.keep b/tests/t-db/db-bogus-dupe-diff-single/updates/.keep
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/t-db/db-bogus-dupe-diff-single/updates/.keep
diff --git a/tests/t-db/db-bogus-dupe-same-single/status b/tests/t-db/db-bogus-dupe-same-single/status
new file mode 100644
index 0000000..b336494
--- /dev/null
+++ b/tests/t-db/db-bogus-dupe-same-single/status
@@ -0,0 +1,18 @@
+Package: pkg-single
+Status: install ok config-files
+Priority: extra
+Section: test
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: amd64
+Version: 1.0
+Description: test package
+
+Package: pkg-single
+Status: install ok half-installed
+Priority: extra
+Section: test
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: amd64
+Version: 2.0
+Description: test package
+
diff --git a/tests/t-db/db-bogus-dupe-same-single/updates/.keep b/tests/t-db/db-bogus-dupe-same-single/updates/.keep
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/t-db/db-bogus-dupe-same-single/updates/.keep
diff --git a/tests/t-db/db-bogus-multi-update/status b/tests/t-db/db-bogus-multi-update/status
new file mode 100644
index 0000000..d605d4b
--- /dev/null
+++ b/tests/t-db/db-bogus-multi-update/status
@@ -0,0 +1,16 @@
+Package: pkg-multi
+Status: install ok config-files
+Priority: extra
+Section: test
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: amd64
+Multi-Arch: same
+Version: 1.0
+Description: test package
+
+Package: pkg-multi
+Status: install ok not-installed
+Priority: extra
+Section: test
+Architecture: armel
+
diff --git a/tests/t-db/db-bogus-multi-update/updates/0001 b/tests/t-db/db-bogus-multi-update/updates/0001
new file mode 100644
index 0000000..4c00629
--- /dev/null
+++ b/tests/t-db/db-bogus-multi-update/updates/0001
@@ -0,0 +1,10 @@
+Package: pkg-multi
+Status: install ok half-installed
+Priority: extra
+Section: test
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: i386
+Multi-Arch: same
+Version: 1.0
+Description: test package
+
diff --git a/tests/t-db/db-bogus-multi-update/updates/0002 b/tests/t-db/db-bogus-multi-update/updates/0002
new file mode 100644
index 0000000..468518a
--- /dev/null
+++ b/tests/t-db/db-bogus-multi-update/updates/0002
@@ -0,0 +1,9 @@
+Package: pkg-multi
+Status: install ok unpacked
+Priority: extra
+Section: test
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: armel
+Version: 1.0
+Description: test package
+
diff --git a/tests/t-db/db-bogus-multi/status b/tests/t-db/db-bogus-multi/status
new file mode 100644
index 0000000..c79b950
--- /dev/null
+++ b/tests/t-db/db-bogus-multi/status
@@ -0,0 +1,29 @@
+Package: pkg-multi
+Status: install ok config-files
+Priority: extra
+Section: test
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: amd64
+Multi-Arch: same
+Version: 1.0
+Description: test package
+
+Package: pkg-multi
+Status: install ok half-installed
+Priority: extra
+Section: test
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: armel
+Version: 1.0
+Description: test package
+
+Package: pkg-multi
+Status: install ok unpacked
+Priority: extra
+Section: test
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: i386
+Multi-Arch: same
+Version: 1.0
+Description: test package
+
diff --git a/tests/t-db/db-bogus-multi/updates/.keep b/tests/t-db/db-bogus-multi/updates/.keep
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/t-db/db-bogus-multi/updates/.keep
diff --git a/tests/t-db/db-bogus-single/status b/tests/t-db/db-bogus-single/status
new file mode 100644
index 0000000..87eed5d
--- /dev/null
+++ b/tests/t-db/db-bogus-single/status
@@ -0,0 +1,19 @@
+Package: pkg-single
+Status: install ok config-files
+Priority: extra
+Section: test
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: amd64
+Multi-Arch: same
+Version: 1.0
+Description: test package
+
+Package: pkg-single
+Status: install ok half-configured
+Priority: extra
+Section: test
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: i386
+Version: 1.0
+Description: test package
+
diff --git a/tests/t-db/db-bogus-single/updates/.keep b/tests/t-db/db-bogus-single/updates/.keep
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/t-db/db-bogus-single/updates/.keep
diff --git a/tests/t-db/db-cross-multi-update/status b/tests/t-db/db-cross-multi-update/status
new file mode 100644
index 0000000..cfa1c04
--- /dev/null
+++ b/tests/t-db/db-cross-multi-update/status
@@ -0,0 +1,10 @@
+Package: pkg-multi
+Status: install ok config-files
+Priority: extra
+Section: test
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: amd64
+Multi-Arch: same
+Version: 1.0
+Description: test package
+
diff --git a/tests/t-db/db-cross-multi-update/updates/0001 b/tests/t-db/db-cross-multi-update/updates/0001
new file mode 100644
index 0000000..a0fea54
--- /dev/null
+++ b/tests/t-db/db-cross-multi-update/updates/0001
@@ -0,0 +1,10 @@
+Package: pkg-multi
+Status: install ok half-installed
+Priority: extra
+Section: test
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: i386
+Multi-Arch: same
+Version: 2.0
+Description: test package
+
diff --git a/tests/t-db/db-cross-multi-update/updates/0002 b/tests/t-db/db-cross-multi-update/updates/0002
new file mode 100644
index 0000000..7850eef
--- /dev/null
+++ b/tests/t-db/db-cross-multi-update/updates/0002
@@ -0,0 +1,10 @@
+Package: pkg-multi
+Status: install ok not-installed
+Priority: extra
+Section: test
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: i386
+Multi-Arch: same
+Version: 2.0
+Description: test package
+
diff --git a/tests/t-db/db-cross-multi-update/updates/0003 b/tests/t-db/db-cross-multi-update/updates/0003
new file mode 100644
index 0000000..3759577
--- /dev/null
+++ b/tests/t-db/db-cross-multi-update/updates/0003
@@ -0,0 +1,9 @@
+Package: pkg-multi
+Status: install ok unpacked
+Priority: extra
+Section: test
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: armel
+Version: 4.0
+Description: test package
+
diff --git a/tests/t-db/db-cross-single-update/status b/tests/t-db/db-cross-single-update/status
new file mode 100644
index 0000000..10c934b
--- /dev/null
+++ b/tests/t-db/db-cross-single-update/status
@@ -0,0 +1,9 @@
+Package: pkg-single
+Status: install ok config-files
+Priority: extra
+Section: test
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: amd64
+Version: 1.0
+Description: test package
+
diff --git a/tests/t-db/db-cross-single-update/updates/0001 b/tests/t-db/db-cross-single-update/updates/0001
new file mode 100644
index 0000000..ae9d517
--- /dev/null
+++ b/tests/t-db/db-cross-single-update/updates/0001
@@ -0,0 +1,10 @@
+Package: pkg-single
+Status: install ok half-installed
+Priority: extra
+Section: test
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: i386
+Multi-Arch: same
+Version: 2.0
+Description: test package
+
diff --git a/tests/t-db/db-cross-single-update/updates/0002 b/tests/t-db/db-cross-single-update/updates/0002
new file mode 100644
index 0000000..11be9c5
--- /dev/null
+++ b/tests/t-db/db-cross-single-update/updates/0002
@@ -0,0 +1,9 @@
+Package: pkg-single
+Status: install ok unpacked
+Priority: extra
+Section: test
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: armel
+Version: 3.0
+Description: test package
+
diff --git a/tests/t-db/db-dupe-multi/status b/tests/t-db/db-dupe-multi/status
new file mode 100644
index 0000000..e2e1a7d
--- /dev/null
+++ b/tests/t-db/db-dupe-multi/status
@@ -0,0 +1,20 @@
+Package: pkg-multi
+Status: install ok installed
+Priority: extra
+Section: test
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: amd64
+Multi-Arch: same
+Version: 1.0
+Description: test package
+
+Package: pkg-multi
+Status: install ok installed
+Priority: extra
+Section: test
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: amd64
+Multi-Arch: same
+Version: 1.0
+Description: test package
+
diff --git a/tests/t-db/db-dupe-multi/updates/.keep b/tests/t-db/db-dupe-multi/updates/.keep
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/t-db/db-dupe-multi/updates/.keep
diff --git a/tests/t-db/db-field-blank-lines-update/status b/tests/t-db/db-field-blank-lines-update/status
new file mode 100644
index 0000000..7b58a81
--- /dev/null
+++ b/tests/t-db/db-field-blank-lines-update/status
@@ -0,0 +1,13 @@
+Package: pkg-correct
+Status: install ok installed
+Priority: extra
+Section: test
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: amd64
+Version: 1.0
+Description: test package
+ This description splits
+ .
+ lines correctly
+ .
+ with dots.
diff --git a/tests/t-db/db-field-blank-lines-update/updates/.keep b/tests/t-db/db-field-blank-lines-update/updates/.keep
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/t-db/db-field-blank-lines-update/updates/.keep
diff --git a/tests/t-db/db-field-blank-lines-update/updates/0001 b/tests/t-db/db-field-blank-lines-update/updates/0001
new file mode 100644
index 0000000..6d9c599
--- /dev/null
+++ b/tests/t-db/db-field-blank-lines-update/updates/0001
@@ -0,0 +1,13 @@
+Package: pkg-blank-lines
+Status: install ok installed
+Priority: extra
+Section: test
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: amd64
+Version: 1.0
+Description: test package
+ This description splits
+
+ lines incorrectly
+
+ with blank lines, but is still tolerated.
diff --git a/tests/t-db/db-field-blank-lines/status b/tests/t-db/db-field-blank-lines/status
new file mode 100644
index 0000000..a9759da
--- /dev/null
+++ b/tests/t-db/db-field-blank-lines/status
@@ -0,0 +1,27 @@
+Package: pkg-blank-lines
+Status: install ok installed
+Priority: extra
+Section: test
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: amd64
+Version: 1.0
+Description: test package
+ This description splits
+
+ lines incorrectly
+
+ with blank lines, but is still tolerated.
+
+Package: pkg-correct
+Status: install ok installed
+Priority: extra
+Section: test
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: amd64
+Version: 1.0
+Description: test package
+ This description splits
+ .
+ lines correctly
+ .
+ with dots.
diff --git a/tests/t-db/db-field-blank-lines/updates/.keep b/tests/t-db/db-field-blank-lines/updates/.keep
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/t-db/db-field-blank-lines/updates/.keep