Browse Source

Rework cryptsetup backend failure workaround

There is a special exit code 77. Using that one, the failing test will
not about the test.
Christoph Biedl 1 year ago
parent
commit
55f85c9bac
2 changed files with 12 additions and 8 deletions
  1. 11 7
      debian/patches/work-around-socket-error-in-testsuite.patch
  2. 1 1
      debian/patches/series

+ 11 - 7
debian/patches/work-around-socket-error-in-testsuite.patch

@@ -1,11 +1,11 @@
-Description: Don't fail test if cryptsetup fails
+Description: Don't fail test if cryptsetup fails for disabled module loading
 Author: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
-Date: 2017-11-16
+Date: 2017-11-20
 Forwarded: not-needed
 Bug-Debian: https://bugs.debian.org/881864
 
-    This is fairly weird: On the Debian buildds and porter boxes, the
-    crypt_format call in libcryptsetup fails for unknown reason:
+    On the Debian buildds and porter boxes, the crypt_format call in
+    libcryptsetup fails:
 
     socket(AF_ALG, SOCK_SEQPACKET, 0) = -1 EAFNOSUPPORT (Address family not supported by protocol)
 
@@ -13,7 +13,11 @@ Bug-Debian: https://bugs.debian.org/881864
     $ fallocate --length 8m test.img
     $ echo foo | /sbin/cryptsetup luksFormat test.img -
 
-    Make the according tests non-fatal.
+    The actual reason is DSA disabled automatic module loading by
+    setting /proc/sys/kernel/modules_disabled to 1, for obvious reaons.
+
+    Make the tests non-fatal if they fail at that place, by using the
+    special exit code 77.
 
 --- a/test.c
 +++ b/test.c
@@ -23,7 +27,7 @@ Bug-Debian: https://bugs.debian.org/881864
                       NULL, NULL, 32, NULL);
 +    if (r == -5) {
 +        fprintf(stderr, "crypt_format failed, assuming AF_ALG,SOCK_SEQPACKET failure\n");
-+        exit(0);
++        exit(77);
 +    }
      if (r < 0)
          error(EXIT_FAILURE, -r, "%s:%d", __FILE__, __LINE__);
@@ -40,7 +44,7 @@ Bug-Debian: https://bugs.debian.org/881864
 +PST="$(md5sum $tmp)"
 +if [ "$PRE" = "$PST" ] ; then
 +    echo 'cryptsetup failed, assuming AF_ALG,SOCK_SEQPACKET failure'
-+    exit 0
++    exit 77
 +fi
  
  ! ./luksmeta test -d $tmp

+ 1 - 1
debian/patches/series

@@ -3,4 +3,4 @@ cherry-pick.v8-1-g83cd0c3.fix-invalid-man-page-section-reference.patch
 cherry-pick.v8-2-g278d01d.fix-typos-in-the-man-page.patch
 
 test-luksmeta.patch
-work-around-socket-error-in-testsuite.patch
+dont-fail-tests-for-disabled-module-load.patch