[debsums] 01/04: Add check for handling of empty md5sums files

Axel Beckert abe at deuxchevaux.org
Thu Mar 26 02:37:06 UTC 2015


This is an automated email from the git hooks/post-receive script.

abe pushed a commit to branch master
in repository debsums.

commit 466482a1f2af2a1ccd0c69913a32325e18170f49
Author: Axel Beckert <abe at deuxchevaux.org>
Date:   Thu Mar 26 03:22:48 2015 +0100

    Add check for handling of empty md5sums files
---
 t/debsums.t                                               |  14 ++++++++++++++
 .../empty/usr/share/doc/fakepkg/changelog.Debian.gz       | Bin 0 -> 161 bytes
 t/fakechroots/empty/usr/share/doc/fakepkg/copyright       |  14 ++++++++++++++
 t/fakechroots/empty/var/lib/dpkg/info/fakepkg.list        |   6 ++++++
 t/fakechroots/empty/var/lib/dpkg/info/fakepkg.md5sums     |   0
 t/fakechroots/empty/var/lib/dpkg/status                   |  10 ++++++++++
 t/fakechroots/empty/var/lib/dpkg/updates/.emptydir        |   0
 7 files changed, 44 insertions(+)

diff --git a/t/debsums.t b/t/debsums.t
index fd4341b..f6fdf78 100644
--- a/t/debsums.t
+++ b/t/debsums.t
@@ -133,6 +133,20 @@ is(stderr, '', 'STDERR is empty');
 is(stdout, "fakepkg\n", 'Affected package listed');
 expected_rc(0);
 
+##############################################
+# Checks for handling of empty md5sums files #
+##############################################
+
+# Expect a warning
+$chroot = "t/fakechroots/empty";
+ at command = ($command, "--root=$chroot");
+run(@command);
+is(stderr,
+   "$chroot/var/lib/dpkg/info/fakepkg.md5sums is empty but shouldn't!\n",
+   'Warning on STDERR');
+is(stdout, '', 'STDOUT is empty');
+expected_rc(2);
+
 done_testing();
 
 sub sort_lines {
diff --git a/t/fakechroots/empty/usr/share/doc/fakepkg/changelog.Debian.gz b/t/fakechroots/empty/usr/share/doc/fakepkg/changelog.Debian.gz
new file mode 100644
index 0000000..bdbec22
Binary files /dev/null and b/t/fakechroots/empty/usr/share/doc/fakepkg/changelog.Debian.gz differ
diff --git a/t/fakechroots/empty/usr/share/doc/fakepkg/copyright b/t/fakechroots/empty/usr/share/doc/fakepkg/copyright
new file mode 100644
index 0000000..ecf2c92
--- /dev/null
+++ b/t/fakechroots/empty/usr/share/doc/fakepkg/copyright
@@ -0,0 +1,14 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Comment: This is a fake copyright file, part of debsums' test suite
+
+Files: *
+Copyright:
+  2015  Axel Beckert <abe at debian.org>
+License: GPL
+ This is free software, licensed under the terms of the GNU General Public
+ License.  There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
+ PARTICULAR PURPOSE.
+ .
+ You are free to distribute this software under the terms of the GNU General
+ Public License. On Debian systems, the complete text of the GNU General
+ Public License can be found in /usr/share/common-licenses/GPL file.
diff --git a/t/fakechroots/empty/var/lib/dpkg/info/fakepkg.list b/t/fakechroots/empty/var/lib/dpkg/info/fakepkg.list
new file mode 100644
index 0000000..7285486
--- /dev/null
+++ b/t/fakechroots/empty/var/lib/dpkg/info/fakepkg.list
@@ -0,0 +1,6 @@
+/usr
+/usr/share
+/usr/share/doc
+/usr/share/doc/fakepkg
+/usr/share/doc/fakepkg/copyright
+/usr/share/doc/fakepkg/changelog.Debian.gz
diff --git a/t/fakechroots/empty/var/lib/dpkg/info/fakepkg.md5sums b/t/fakechroots/empty/var/lib/dpkg/info/fakepkg.md5sums
new file mode 100644
index 0000000..e69de29
diff --git a/t/fakechroots/empty/var/lib/dpkg/status b/t/fakechroots/empty/var/lib/dpkg/status
new file mode 100644
index 0000000..4c51cf0
--- /dev/null
+++ b/t/fakechroots/empty/var/lib/dpkg/status
@@ -0,0 +1,10 @@
+Package: fakepkg
+Status: install ok installed
+Priority: extra
+Section: metapackages
+Installed-Size: 123
+Maintainer: Axel Beckert <abe+debsums-testsuite at debian.org>
+Architecture: all
+Version: 1
+Description: dummy package for debsums' test suite
+ This is an empty dummy package just used for debsums' test suite.
diff --git a/t/fakechroots/empty/var/lib/dpkg/updates/.emptydir b/t/fakechroots/empty/var/lib/dpkg/updates/.emptydir
new file mode 100644
index 0000000..e69de29

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/debsums.git



More information about the Pkg-perl-cvs-commits mailing list