Browse Source

Redo autopkgtest

Turns out manually emulating upstream's meson.build is no longer
feasible. So do the actual building to benefit from the compiled test
(test-util.c) as well. But manipulate PATH to make sure the tang*
binaries from the package are used.

Also maintain the modifications as a patch.
Christoph Biedl 3 years ago
parent
commit
3cb22e4ffa
4 changed files with 31 additions and 21 deletions
  1. 9 3
      debian/tests/control
  2. 1 0
      debian/tests/patches/series
  3. 15 0
      debian/tests/patches/tests.patch
  4. 6 18
      debian/tests/run-testsuite

+ 9 - 3
debian/tests/control

@@ -1,11 +1,17 @@
 Tests: run-testsuite
 Depends:
-    tang (>= 7-3~),
+    build-essential,
+    cmake,
     curl,
-    dpkg-dev,
-    moreutils,
+    jose,
+    libhttp-parser-dev (>= 2.8.0),
+    libjansson-dev (>= 2.10),
+    libjose-dev (>= 8),
+    meson,
+    pkg-config,
     socat,
     systemd,
+    tang (>= 8-3~),
 Restrictions:
     allow-stderr,
 Architecture: linux-any

+ 1 - 0
debian/tests/patches/series

@@ -0,0 +1 @@
+tests.patch

+ 15 - 0
debian/tests/patches/tests.patch

@@ -0,0 +1,15 @@
+Subject: Don't use the just-built binaries in autopkgtest
+Author: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
+Date: 2021-05-10
+
+--- a/tests/meson.build
++++ b/tests/meson.build
+@@ -25,8 +25,6 @@
+ 
+ env = environment()
+ env.prepend('PATH',
+-  join_paths(meson.source_root(), 'src'),
+-  join_paths(meson.build_root(), 'src'),
+   join_paths(meson.source_root(), 'tests'),
+   join_paths(meson.build_root(), 'tests'),
+   separator: ':'

+ 6 - 18
debian/tests/run-testsuite

@@ -2,24 +2,12 @@
 
 set -eu
 
-export PATH="$PATH:/usr/libexec:/usr/lib/$(dpkg-architecture --query=DEB_HOST_GNU_TYPE 2>/dev/null)"
+export PATH="$PATH:/usr/libexec"
 
-cd tests
+patch -p1 <debian/tests/patches/tests.patch
 
-EXIT=0
+meson setup build
+cd build
+ninja test
 
-for f in $(find . -type f -executable | sort) ; do
-    echo "I: Preparing test $f"
-    # replace socket activation with socat, systemd-socket-activate
-    # results in spurious errors I've already spent hours debugging.
-    if [ "$f" = './adv' ] ; then
-        sed -i -e 's;\$SD_ACTIVATE -l "127.0.0.1:\$PORT" -a \$VALGRIND tangd \$TMP/db;socat TCP-LISTEN:$PORT,bind=127.0.0.1,fork "EXEC:tangd $TMP/db";' $f
-    elif [ "$f" = './rec' ] ; then
-        sed -i -e 's;\$SD_ACTIVATE -l 127.0.0.1:\$port -a \$VALGRIND tangd \$TMP/db;socat TCP-LISTEN:$port,bind=127.0.0.1,fork "EXEC:tangd $TMP/db";' $f
-    fi
-    echo "I: Running test $f"
-    # test are very noisy, keep them silent as long as they pass
-    chronic "$f" || EXIT=1
-done
-
-exit $EXIT
+exit 0