Bug#930541: gnutls28: Fix autopkgtest on 32-bit architectures

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Bug#930541: gnutls28: Fix autopkgtest on 32-bit architectures

Julian Andres Klode-4
Source: gnutls28
Severity: normal
User: [hidden email]
Usertags: origin-ubuntu disco ubuntu-patch

The test suite defaults the size of time_t to 8 if not specified, which
works e.g. during the build, as it gets set there, but it does not work
for autopkgtest, as configure did not run.

The patch below fixes it by looking at whether we support 64-bit dates
in date(1) which is a bit strange, but should work fine, well, until we
transition 32-bit platforms to time64_t.

diff -pruN 3.6.7-3/debian/tests/run-upstream-testsuite 3.6.7-3ubuntu1/debian/tests/run-upstream-testsuite
--- 3.6.7-3/debian/tests/run-upstream-testsuite 2018-12-16 13:18:19.000000000 +0000
+++ 3.6.7-3ubuntu1/debian/tests/run-upstream-testsuite 2019-05-19 15:44:56.000000000 +0000
@@ -16,6 +16,16 @@ export  CLI=/usr/bin/gnutls-cli \
  DCLI=/usr/bin/gnutls-cli-debug \
+# Set the sizeof(time_t) to the correct value for the platform, to ensure we
+# run the correct tests.
+if test -z "${ac_cv_sizeof_time_t}"; then
+ if [ "$(date  --date=@2147483648 +%Y 2>/dev/null)" = "2038" ]; then
+ export ac_cv_sizeof_time_t=8
+ else
+ export ac_cv_sizeof_time_t=4
+ fi
 for i in $(find ../../tests/ -type f -perm -u+rx | \
  grep -Ev 'tests/pkgconfig.sh|/tests/scripts/slow/|tests/slow/|tests/dtls/dtls-resume|tests/dtls/dtls$|tests/destructive/|/cbc-record-check.sh') ; do

-- System Information:
Debian Release: buster/sid
  APT prefers eoan
  APT policy: (991, 'eoan'), (500, 'eoan'), (500, 'cosmic-security')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.0.0-15-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