[debsums] 04/04: Add checks for handling of missing files

Axel Beckert abe at deuxchevaux.org
Thu Mar 26 02:37:07 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 5254920585eb144e7238aeebcf918a9b1cca8a76
Author: Axel Beckert <abe at deuxchevaux.org>
Date:   Thu Mar 26 03:34:18 2015 +0100

    Add checks for handling of missing files
---
 t/debsums.t                                             |  16 ++++++++++++++++
 .../missing/usr/share/doc/fakepkg/changelog.Debian.gz   | Bin 0 -> 161 bytes
 t/fakechroots/missing/var/lib/dpkg/info/fakepkg.list    |   6 ++++++
 t/fakechroots/missing/var/lib/dpkg/info/fakepkg.md5sums |   2 ++
 t/fakechroots/missing/var/lib/dpkg/status               |  10 ++++++++++
 t/fakechroots/missing/var/lib/dpkg/updates/.emptydir    |   0
 6 files changed, 34 insertions(+)

diff --git a/t/debsums.t b/t/debsums.t
index 1ceedbc..7db7bc9 100644
--- a/t/debsums.t
+++ b/t/debsums.t
@@ -147,6 +147,22 @@ is(stderr,
 is(stdout, '', 'STDOUT is empty');
 expected_rc(2);
 
+########################################
+# Checks for handling of missing files #
+########################################
+
+# Expect a warning
+$chroot = "t/fakechroots/missing";
+ at command = ($command, "--root=$chroot");
+foreach my $option (qw(-c -s)) {
+    run(@command, $option);
+    is(stderr,
+       "debsums: missing file $chroot/usr/share/doc/fakepkg/copyright (from fakepkg package)\n",
+       'Warning on STDERR');
+    is(stdout, '', 'STDOUT is empty');
+    expected_rc(2);
+}
+
 #######################
 ### All checks done ###
 #######################
diff --git a/t/fakechroots/missing/usr/share/doc/fakepkg/changelog.Debian.gz b/t/fakechroots/missing/usr/share/doc/fakepkg/changelog.Debian.gz
new file mode 100644
index 0000000..bdbec22
Binary files /dev/null and b/t/fakechroots/missing/usr/share/doc/fakepkg/changelog.Debian.gz differ
diff --git a/t/fakechroots/missing/var/lib/dpkg/info/fakepkg.list b/t/fakechroots/missing/var/lib/dpkg/info/fakepkg.list
new file mode 100644
index 0000000..7285486
--- /dev/null
+++ b/t/fakechroots/missing/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/missing/var/lib/dpkg/info/fakepkg.md5sums b/t/fakechroots/missing/var/lib/dpkg/info/fakepkg.md5sums
new file mode 100644
index 0000000..05dad8d
--- /dev/null
+++ b/t/fakechroots/missing/var/lib/dpkg/info/fakepkg.md5sums
@@ -0,0 +1,2 @@
+52f02364e60d4865543a2e935533ef33  usr/share/doc/fakepkg/copyright
+082797d51b0c32d421e274b05926618a  usr/share/doc/fakepkg/changelog.Debian.gz
diff --git a/t/fakechroots/missing/var/lib/dpkg/status b/t/fakechroots/missing/var/lib/dpkg/status
new file mode 100644
index 0000000..4c51cf0
--- /dev/null
+++ b/t/fakechroots/missing/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/missing/var/lib/dpkg/updates/.emptydir b/t/fakechroots/missing/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