summaryrefslogtreecommitdiffstats
path: root/tests/t-control-bogus
diff options
context:
space:
mode:
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