From a184cc003ca991a204ebcecf70491d8bac1f3a73 Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Sun, 5 Mar 2023 19:25:13 +0100 Subject: [PATCH] tests: run verbose and debug tests with --variant=standard for maximum output --- coverage.txt | 4 ++-- tests/debug | 15 ++++++++++++--- tests/verbose | 15 ++++++++++++--- 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/coverage.txt b/coverage.txt index 1cb95bf..454dde6 100644 --- a/coverage.txt +++ b/coverage.txt @@ -283,10 +283,10 @@ Test: debootstrap-no-op-options Needs-Root: true Test: verbose -Needs-Root: true +Variants: standard Test: debug -Needs-Root: true +Variants: standard Test: quiet Needs-Root: true diff --git a/tests/debug b/tests/debug index c81ba21..9a24078 100644 --- a/tests/debug +++ b/tests/debug @@ -1,6 +1,15 @@ #!/bin/sh set -eu export LC_ALL=C.UTF-8 -{{ CMD }} --mode=root --variant=apt --debug {{ DIST }} /tmp/debian-chroot {{ MIRROR }} -tar -C /tmp/debian-chroot --one-file-system -c . | tar -t | sort | diff -u tar1.txt - -rm -r /tmp/debian-chroot +export SOURCE_DATE_EPOCH={{ SOURCE_DATE_EPOCH }} + +trap "rm -f /tmp/debian-chroot.tar" EXIT INT TERM + +# we use variant standard in debug mode to see all debug output and the maximum +# number of packages that was chosen in case of USE_HOST_APT_CONFIG=yes +[ {{ VARIANT }} = "standard" ] + +{{ CMD }} --variant={{ VARIANT }} --debug {{ DIST }} /tmp/debian-chroot.tar {{ MIRROR }} + +cmp ./cache/mmdebstrap-{{ DIST }}-{{ VARIANT }}.tar /tmp/debian-chroot.tar \ + || diffoscope ./cache/mmdebstrap-{{ DIST }}-{{ VARIANT }}.tar /tmp/debian-chroot.tar diff --git a/tests/verbose b/tests/verbose index 1388e19..31ad093 100644 --- a/tests/verbose +++ b/tests/verbose @@ -1,6 +1,15 @@ #!/bin/sh set -eu export LC_ALL=C.UTF-8 -{{ CMD }} --mode=root --variant=apt --verbose {{ DIST }} /tmp/debian-chroot {{ MIRROR }} -tar -C /tmp/debian-chroot --one-file-system -c . | tar -t | sort | diff -u tar1.txt - -rm -r /tmp/debian-chroot +export SOURCE_DATE_EPOCH={{ SOURCE_DATE_EPOCH }} + +trap "rm -f /tmp/debian-chroot.tar" EXIT INT TERM + +# we use variant standard in verbose mode to see the maximum number of packages +# that was chosen in case of USE_HOST_APT_CONFIG=yes +[ {{ VARIANT }} = "standard" ] + +{{ CMD }} --variant={{ VARIANT }} --verbose {{ DIST }} /tmp/debian-chroot.tar {{ MIRROR }} + +cmp ./cache/mmdebstrap-{{ DIST }}-{{ VARIANT }}.tar /tmp/debian-chroot.tar \ + || diffoscope ./cache/mmdebstrap-{{ DIST }}-{{ VARIANT }}.tar /tmp/debian-chroot.tar