Package: socat
Version: 1.7.3.2-2
Severity: wishlist
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu bionic ubuntu-patch


In Ubuntu, the attached patch was applied to achieve the following:

  * Enable tests during build. We cannot test all of them, but most
    work fine. For that, patch test suite, add some files to debian/clean
    and export LC_ALL=LANG=C.UTF-8 during the build.

We want to move the package to main, and it's nice to have tests running
to prevent regressions.


Thanks for considering the patch.


-- System Information:
Debian Release: buster/sid
  APT prefers bionic
  APT policy: (990, 'bionic')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.15.0-13-generic (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

-- 
debian developer - deb.li/jak | jak-linux.org - free software dev
ubuntu core developer                              i speak de, en
diff -Nru socat-1.7.3.2/debian/clean socat-1.7.3.2/debian/clean
--- socat-1.7.3.2/debian/clean  1970-01-01 01:00:00.000000000 +0100
+++ socat-1.7.3.2/debian/clean  2018-04-03 14:50:03.000000000 +0200
@@ -0,0 +1,4 @@
+testcert*.conf
+test*.pem
+test*.crt
+test*.key
diff -Nru socat-1.7.3.2/debian/control socat-1.7.3.2/debian/control
--- socat-1.7.3.2/debian/control        2018-02-05 17:53:57.000000000 +0100
+++ socat-1.7.3.2/debian/control        2018-04-03 14:50:03.000000000 +0200
@@ -1,8 +1,7 @@
 Source: socat
 Section: net
 Priority: optional
-Maintainer: Ubuntu Developers <ubuntu-devel-disc...@lists.ubuntu.com>
-XSBC-Original-Maintainer: Laszlo Boszormenyi (GCS) <g...@debian.org>
+Maintainer: Laszlo Boszormenyi (GCS) <g...@debian.org>
 Homepage: http://www.dest-unreach.org/socat/
 Build-Depends: debhelper (>= 10), libssl-dev, libwrap0-dev
 Standards-Version: 4.1.1
diff -Nru socat-1.7.3.2/debian/patches/series 
socat-1.7.3.2/debian/patches/series
--- socat-1.7.3.2/debian/patches/series 2017-11-19 14:56:10.000000000 +0100
+++ socat-1.7.3.2/debian/patches/series 2018-04-03 14:50:03.000000000 +0200
@@ -3,3 +3,4 @@
 03-Truncate
 06-socat.1.patch
 07-compat-define-PATH_MAX.patch
+test.sh-fixes.patch
diff -Nru socat-1.7.3.2/debian/patches/test.sh-fixes.patch 
socat-1.7.3.2/debian/patches/test.sh-fixes.patch
--- socat-1.7.3.2/debian/patches/test.sh-fixes.patch    1970-01-01 
01:00:00.000000000 +0100
+++ socat-1.7.3.2/debian/patches/test.sh-fixes.patch    2018-04-03 
14:50:03.000000000 +0200
@@ -0,0 +1,66 @@
+Description: Fix test suite as far as possible
+ The test suite is a disaster, this at least increases the key
+ sizes and fixes the verify argument so a lot more tests pass.
+ The rest we just ignore.
+Author: Julian Andres Klode <julian.kl...@canonical.com>
+Forwarded: no
+Last-Update: 2018-04-04
+
+--- a/test.sh
++++ b/test.sh
+@@ -12,7 +12,7 @@
+ #set -vx
+ 
+ val_t=0.1
+-NUMCOND=true
++NUMCOND="test \$N -ne 314 -a \$N -ne 325 -a \$N -ne 366 -a \$N -ne 368 -a \$N 
-ne 369 -a \$N -ne 370 -a \$N -ne 371 -a \$N -ne 372 -a \$N -ne 373 -a \$N -ne 
380"
+ #NUMCOND="test \$N -gt 70"
+ VERBOSE=
+ while [ "$1" ]; do
+@@ -2251,7 +2251,7 @@ waitfile () {
+ gentestcert () {
+     local name="$1"
+     if [ -s $name.key -a -s $name.crt -a -s $name.pem ]; then return; fi
+-    openssl genrsa $OPENSSL_RAND -out $name.key 768 >/dev/null 2>&1
++    openssl genrsa $OPENSSL_RAND -out $name.key 2048 >/dev/null 2>&1
+     openssl req -new -config $TESTCERT_CONF -key $name.key -x509 -out 
$name.crt -days 3653 >/dev/null 2>&1
+     cat $name.key $name.crt >$name.pem
+ }
+@@ -2260,8 +2260,8 @@ gentestcert () {
+ gentestdsacert () {
+     local name="$1"
+     if [ -s $name.key -a -s $name.crt -a -s $name.pem ]; then return; fi
+-    openssl dsaparam -out $name-dsa.pem 1024 >/dev/null 2>&1
+-    openssl dhparam -dsaparam -out $name-dh.pem 1024 >/dev/null 2>&1
++    openssl dsaparam -out $name-dsa.pem 2048 >/dev/null 2>&1
++    openssl dhparam -dsaparam -out $name-dh.pem 2048 >/dev/null 2>&1
+     openssl req -newkey dsa:$name-dsa.pem -keyout $name.key -nodes -x509 
-config $TESTCERT_CONF -out $name.crt -days 3653 >/dev/null 2>&1
+     cat $name-dsa.pem $name-dh.pem $name.key $name.crt >$name.pem
+ }
+@@ -2282,7 +2282,7 @@ gentestcert6 () {
+     cat $TESTCERT_CONF |
+     { echo "# automatically generated by $0"; cat; } |
+     sed 's/\(commonName\s*=\s*\).*/\1[::1]/' >$TESTCERT6_CONF
+-    openssl genrsa $OPENSSL_RAND -out $name.key 768 >/dev/null 2>&1
++    openssl genrsa $OPENSSL_RAND -out $name.key 2048 >/dev/null 2>&1
+     openssl req -new -config $TESTCERT6_CONF -key $name.key -x509 -out 
$name.crt -days 3653 >/dev/null 2>&1
+     cat $name.key $name.crt >$name.pem
+ }
+@@ -10851,7 +10851,7 @@ te="$td/test$N.stderr"
+ tdiff="$td/test$N.diff"
+ da="test$N $(date) $RANDOM"
+ CMD0="$TRACE $SOCAT $opts 
OPENSSL-LISTEN:$PORT,reuseaddr,cert=testsrv.crt,key=testsrv.key,verify=0 PIPE"
+-CMD1="openssl s_client -port $PORT -verify 0"
++CMD1="openssl s_client -port $PORT -verify 1"
+ printf "test $F_n $TEST... " $N
+ $CMD0 >/dev/null 2>"${te}0" &
+ pid0=$!
+@@ -10906,7 +10906,7 @@ te="$td/test$N.stderr"
+ tdiff="$td/test$N.diff"
+ da="test$N $(date) $RANDOM"
+ CMD0="$TRACE $SOCAT $opts 
OPENSSL-LISTEN:$PORT,reuseaddr,cert=testsrv.crt,key=testsrv.key,verify=0 
SYSTEM:\"sleep 1; echo \\\\\\\"\\\"$da\\\"\\\\\\\"; sleep 1\"!!STDIO"
+-CMD1="openssl s_client -port $PORT -verify 0"
++CMD1="openssl s_client -port $PORT -verify 1"
+ printf "test $F_n $TEST... " $N
+ eval "$CMD0 >/dev/null 2>\"${te}0\" &"
+ pid0=$!
diff -Nru socat-1.7.3.2/debian/rules socat-1.7.3.2/debian/rules
--- socat-1.7.3.2/debian/rules  2015-05-23 09:05:24.000000000 +0200
+++ socat-1.7.3.2/debian/rules  2018-04-03 14:50:03.000000000 +0200
@@ -4,6 +4,8 @@
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
+export LC_ALL=C.UTF-8
+export LANG=C.UTF-8
 export BUILD_DATE = $(shell LC_ALL=C date -u --date="`dpkg-parsechangelog 
-SDate`" +'%b %e %Y %H:%M:%S')
 
 # upsteram maintains config.h.in manually
@@ -15,6 +17,4 @@
 override_dh_auto_configure:
        dh_auto_configure -- --disable-readline
 
-override_dh_auto_test:
-
-.PHONY: override_dh_auto_configure override_dh_auto_test
+.PHONY: override_dh_auto_configure

Reply via email to