Browse Source

test: Use valgrind to ensure Acquire::Queue-Mode=access does not crash

Unfortunately for us, apt update with Acquire::Queue-Mode=access
does not always crash on a real system, so run the whole thing
in valgrind.
tags/devuan/2.0.1+devuan1
Julian Andres Klode 1 year ago
parent
commit
56820d4c24
3 changed files with 25 additions and 2 deletions
  1. +2
    -1
      debian/tests/control
  2. +21
    -0
      test/integration/framework
  3. +2
    -1
      test/integration/test-apt-update-simple

+ 2
- 1
debian/tests/control View File

@@ -6,4 +6,5 @@ Depends: @, @builddeps@, dpkg, fakeroot, wget, stunnel4, lsof, db-util,
gpgv (>= 2) | gpgv2,
gpgv1 | gpgv (<< 2),
libfile-fcntllock-perl, python3-apt, aptitude,
pkg-config
pkg-config,
valgrind

+ 21
- 0
test/integration/framework View File

@@ -229,6 +229,27 @@ gdb() {
fi
runapt command gdb --quiet -ex "directory '$SOURCEDIRECTORY'" -ex run "$CMD" --args "$CMD" "$@"
}

valgrind() {
local CMD
case "$1" in
aptget) CMD="apt-get";;
aptcache) CMD="apt-cache";;
aptcdrom) CMD="apt-cdrom";;
aptconfig) CMD="apt-config";;
aptmark) CMD="apt-mark";;
apthelper) CMD="apt-helper";;
aptftparchive) CMD="apt-ftparchive";;
dpkg) shift; runapt "${TMPWORKINGDIRECTORY}/rootdir/usr/bin/gdb-dpkg" "$@"; return;;
*) CMD="$1";;
esac
shift
if [ "${CMD##*/}" = "$CMD" ]; then
CMD="${BUILDDIRECTORY}/${CMD}"
fi
runapt command valgrind "$CMD" "$@"
}

lastmodification() {
date -u -d "@$(stat -c '%Y' "${TMPWORKINGDIRECTORY}/$1")" -R
}


+ 2
- 1
test/integration/test-apt-update-simple View File

@@ -32,5 +32,6 @@ main/binary-all/Packages
main/i18n/Translation-en
main/i18n/Translation-de' aptget indextargets --format '$(METAKEY)'

# Check that -o Acquire::Queue-Mode=access does not crash
find rootdir/var/lib/apt/lists/ -type f -delete
testsuccess aptget update -o Acquire::Queue-Mode=access
testsuccess valgrind aptget update -o Acquire::Queue-Mode=access

Loading…
Cancel
Save