Package: ganeti-instance-debootstrap
Version: 0.16-3
Severity: normal
Tags: patch

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Dear Maintainer,

The package ships autopkgtest but it can never work. Autopkgtests are
executed from unpacked but unconfigured/unbuilt tree. Although one can
trigger a built-tree to be created, I thought it's easier to just
configure/parse common.sh from common.sh.in without doing anything
else.

The test command executed was not not executed with srcdir set, thus
would bail.

The test produces output on stderr. I'm not sure if that is expected
or not, but I have whitelisted to allow stderr output. (By default
autopkgtest enfoces a failure, if any stderr is produced).

There is a bug in common.sh.in code, and fgrep command was incorrectly
invoked.

I've also added a test dependency on debian-archive-keyring, such that
debootstrap is validated.

With all of the above, I can manage to pass the test with an Ubuntu
qemu cloud image based runner.

Please consider applying attached fixed to your package.

Regards,

Dimitri.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJaFr1AAAoJEMrC2LnNLKX5k9MIAJ5SgX9w8lZitO86Y90aSR88
WAHT2Xinv1izZDAB1wo5Xpaa6M8T9cLeNUAgA2M8ATMo6GJslukFO4eoLPQsiyTO
FsWk8BVyKU+syH81YX2gsElZuRNq2/CMM7nLfwNSoUkF+jkSnTnJD+HA2eXm8PEU
fSbtgH6+tb+ZR6yp2VY2ZV3i2W1fTXh7W6Je9fLnNvnvSUAvVmYCGj6HqUoY2cfs
W6GgAP52gJDkuDT+vFcw/6nL3MFOHDEKX8BkqklKMmFdmo3L2aTg1k4F9TaYCYLN
sNl/RjyrGVy5X/yV413anFD9nCyd22PxsLFRJAI3LZOr3gy1dZoI3ilrkkFdu4c=
=trQG
-----END PGP SIGNATURE-----
diff -Nru ganeti-instance-debootstrap-0.16/debian/changelog ganeti-instance-debootstrap-0.16/debian/changelog
--- ganeti-instance-debootstrap-0.16/debian/changelog	2017-09-12 22:18:39.000000000 +0100
+++ ganeti-instance-debootstrap-0.16/debian/changelog	2017-11-23 12:15:59.000000000 +0000
@@ -1,3 +1,15 @@
+ganeti-instance-debootstrap (0.16-3ubuntu1) bionic; urgency=medium
+
+  * Fix autopkgtest:
+    - convert to a script
+    - prepare common.sh, without doing a full build
+    - patch common.sh to invoke grep correctly
+    - add debian-archive-keyring dependency for debootstrap validation
+    - allow-stderr output, as some is generated
+    - the test appears to pass now
+
+ -- Dimitri John Ledkov <x...@ubuntu.com>  Thu, 23 Nov 2017 12:15:59 +0000
+
 ganeti-instance-debootstrap (0.16-3) unstable; urgency=medium
 
   * Depend on fdisk | util-linux (Closes: #872096)
diff -Nru ganeti-instance-debootstrap-0.16/debian/patches/fix-grep-args.patch ganeti-instance-debootstrap-0.16/debian/patches/fix-grep-args.patch
--- ganeti-instance-debootstrap-0.16/debian/patches/fix-grep-args.patch	1970-01-01 01:00:00.000000000 +0100
+++ ganeti-instance-debootstrap-0.16/debian/patches/fix-grep-args.patch	2017-11-23 11:56:37.000000000 +0000
@@ -0,0 +1,15 @@
+Description: patch common.sh to invoke grep correctly
+Author: Dimitri John Ledkov <x...@ubuntu.com>
+
+
+--- ganeti-instance-debootstrap-0.16.orig/common.sh.in
++++ ganeti-instance-debootstrap-0.16/common.sh.in
+@@ -96,7 +96,7 @@ format_disk0() {
+   fi
+   # Some versions of sfdisk need to be told to skip checking using ioctl(dev,
+   # BLKRRPART), as this always fails for DRBD and LVM devices.
+-  if sfdisk --help | fgrep -q '--no-reread'; then
++  if sfdisk --help | fgrep -q -e '--no-reread'; then
+     ARGS="--no-reread $ARGS"
+   fi
+   sfdisk $ARGS --quiet "$1" <<EOF
diff -Nru ganeti-instance-debootstrap-0.16/debian/patches/series ganeti-instance-debootstrap-0.16/debian/patches/series
--- ganeti-instance-debootstrap-0.16/debian/patches/series	2017-09-12 22:18:39.000000000 +0100
+++ ganeti-instance-debootstrap-0.16/debian/patches/series	2017-11-23 11:56:27.000000000 +0000
@@ -1 +1,2 @@
 fix-sfdisk-BLKRRPART.patch
+fix-grep-args.patch
diff -Nru ganeti-instance-debootstrap-0.16/debian/tests/control ganeti-instance-debootstrap-0.16/debian/tests/control
--- ganeti-instance-debootstrap-0.16/debian/tests/control	2017-09-12 22:18:39.000000000 +0100
+++ ganeti-instance-debootstrap-0.16/debian/tests/control	2017-11-23 12:12:48.000000000 +0000
@@ -1,5 +1,5 @@
-Test-Command: ./test/install-export-import
+Tests: install-export-import
 # Use isolation-machine, as we need access to /dev/loop* which are not
 # present in containers.
-Restrictions: needs-root, isolation-machine
-Depends: ganeti-instance-debootstrap
+Restrictions: needs-root, allow-stderr, isolation-machine
+Depends: ganeti-instance-debootstrap, debian-archive-keyring
diff -Nru ganeti-instance-debootstrap-0.16/debian/tests/install-export-import ganeti-instance-debootstrap-0.16/debian/tests/install-export-import
--- ganeti-instance-debootstrap-0.16/debian/tests/install-export-import	1970-01-01 01:00:00.000000000 +0100
+++ ganeti-instance-debootstrap-0.16/debian/tests/install-export-import	2017-11-23 11:47:07.000000000 +0000
@@ -0,0 +1,6 @@
+#!/bin/sh
+set -e
+
+sed -e 's,[@]sysconfdir[@],/etc,g' -e 's,[@]localstatedir[@],/var,g' common.sh.in > common.sh
+
+srcdir=. ./test/install-export-import

Reply via email to