summaryrefslogtreecommitdiffstats
path: root/tests/t-control-bogus
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-control-bogus
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-control-bogus')
-rw-r--r--tests/t-control-bogus/Makefile32
-rw-r--r--tests/t-control-bogus/pkg-bogus-blank/DEBIAN/control18
-rw-r--r--tests/t-control-bogus/pkg-bogus-colon/DEBIAN/control8
-rw-r--r--tests/t-control-bogus/pkg-bogus-fieldname-empty/DEBIAN/control8
-rw-r--r--tests/t-control-bogus/pkg-bogus-fieldname-partial/DEBIAN/control7
-rw-r--r--tests/t-control-bogus/pkg-bogus-format-string/DEBIAN/control7
6 files changed, 80 insertions, 0 deletions
diff --git a/tests/t-control-bogus/Makefile b/tests/t-control-bogus/Makefile
new file mode 100644
index 0000000..ec042dd
--- /dev/null
+++ b/tests/t-control-bogus/Makefile
@@ -0,0 +1,32 @@
+include ../Test.mk
+
+test-case:
+ # test building package with bogus control files
+ ! $(DPKG_BUILD_DEB) pkg-bogus-colon
+ ! $(DPKG_BUILD_DEB) pkg-bogus-blank
+ ! $(DPKG_BUILD_DEB) pkg-bogus-fieldname-empty
+ ! $(DPKG_BUILD_DEB) pkg-bogus-fieldname-partial
+ ! $(DPKG_BUILD_DEB) pkg-bogus-format-string
+
+ # build bogus packages
+ $(DPKG_BUILD_DEB) --nocheck pkg-bogus-colon
+ $(DPKG_BUILD_DEB) --nocheck pkg-bogus-blank
+ $(DPKG_BUILD_DEB) --nocheck pkg-bogus-fieldname-empty
+ $(DPKG_BUILD_DEB) --nocheck pkg-bogus-fieldname-partial
+ $(DPKG_BUILD_DEB) --nocheck pkg-bogus-format-string
+
+ # test installing packages with bogus control files
+ ! $(DPKG_INSTALL) pkg-bogus-colon.deb
+ $(call pkg_is_not_installed,pkg-bogus-colon)
+ ! $(DPKG_INSTALL) pkg-bogus-blank.deb
+ $(call pkg_is_not_installed,pkg-bogus-blank)
+ ! $(DPKG_INSTALL) pkg-bogus-fieldname-empty.deb
+ $(call pkg_is_not_installed,pkg-bogus-fieldname-empty)
+ ! $(DPKG_INSTALL) pkg-bogus-fieldname-partial.deb
+ $(call pkg_is_not_installed,pkg-bogus-fieldname-partial)
+ ! $(DPKG_INSTALL) pkg-bogus-format-string.deb
+ $(call pkg_is_not_installed,pkg-bogus-format-string)
+
+test-clean:
+ rm -f pkg-bogus-colon.deb
+ rm -f pkg-bogus-blank.deb
diff --git a/tests/t-control-bogus/pkg-bogus-blank/DEBIAN/control b/tests/t-control-bogus/pkg-bogus-blank/DEBIAN/control
new file mode 100644
index 0000000..7904382
--- /dev/null
+++ b/tests/t-control-bogus/pkg-bogus-blank/DEBIAN/control
@@ -0,0 +1,18 @@
+Package: pkg-bogus-blank
+Version: 0.0-1
+Section: test
+Priority: extra
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: all
+Description: test package - bogus control file w/ blank lines in fields
+ This is an invalid description, containing lines with one space:
+
+ or two:
+
+ or even more:
+
+ Instead of the correct blank line using a dot as delimiter:
+ .
+ Or valid lines with multiple spaces with content:
+ line 1
+ line 2
diff --git a/tests/t-control-bogus/pkg-bogus-colon/DEBIAN/control b/tests/t-control-bogus/pkg-bogus-colon/DEBIAN/control
new file mode 100644
index 0000000..3b32476
--- /dev/null
+++ b/tests/t-control-bogus/pkg-bogus-colon/DEBIAN/control
@@ -0,0 +1,8 @@
+Package: pkg-bogus
+BOGUS-LINE
+Version: 0.0-1
+Section: test
+Priority: extra
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: all
+Description: test package - bogus control file
diff --git a/tests/t-control-bogus/pkg-bogus-fieldname-empty/DEBIAN/control b/tests/t-control-bogus/pkg-bogus-fieldname-empty/DEBIAN/control
new file mode 100644
index 0000000..ad433ca
--- /dev/null
+++ b/tests/t-control-bogus/pkg-bogus-fieldname-empty/DEBIAN/control
@@ -0,0 +1,8 @@
+Package: pkg-bogus-fieldname-empty
+Version: 0.0-1
+Section: test
+Priority: extra
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: all
+: value
+Description: test package - bogus control file w/ empty field name
diff --git a/tests/t-control-bogus/pkg-bogus-fieldname-partial/DEBIAN/control b/tests/t-control-bogus/pkg-bogus-fieldname-partial/DEBIAN/control
new file mode 100644
index 0000000..dd28c0b
--- /dev/null
+++ b/tests/t-control-bogus/pkg-bogus-fieldname-partial/DEBIAN/control
@@ -0,0 +1,7 @@
+Pack: pkg-bogus-fieldname-partial
+Vers: 0.0-1
+Sect: test
+Prio: extra
+Main: Dpkg Developers <debian-dpkg@lists.debian.org>
+Arch: all
+Desc: test package - bogus control file w/ partial field names
diff --git a/tests/t-control-bogus/pkg-bogus-format-string/DEBIAN/control b/tests/t-control-bogus/pkg-bogus-format-string/DEBIAN/control
new file mode 100644
index 0000000..bbb181a
--- /dev/null
+++ b/tests/t-control-bogus/pkg-bogus-format-string/DEBIAN/control
@@ -0,0 +1,7 @@
+Package: %s
+Version: 0.0-1
+Section: test
+Priority: extra
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: %s
+Description: test package - bogus control file w/ format string in values