From 1fbdc04be7547b8c4bb84f400329415ea0bc60b5 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sun, 19 May 2024 19:31:48 +0200 Subject: test: Run working tests against the 3.0 solver Implement --solver, --only, -skip flags for the test suite, and run the test suite with the broken tests skipped against solver3. --- test/integration/framework | 8 +++- test/integration/run-tests | 31 +++++++++++++-- test/integration/solver3.broken | 86 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 121 insertions(+), 4 deletions(-) create mode 100644 test/integration/solver3.broken (limited to 'test/integration') diff --git a/test/integration/framework b/test/integration/framework index ecf5d8703..54bc4da07 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -19,6 +19,9 @@ while [ -n "$1" -a -z "$CHECK_ARGS" ]; do elif [ "$1" = '--level' ]; then export MSGLEVEL=$2 shift + elif [ "$1" = '--solver' ]; then + export APT_SOLVER=$2 + shift else echo >&2 "WARNING: Unknown parameter »$1« will be ignored" fi @@ -537,7 +540,10 @@ exec fakeroot gdb --quiet -ex run '${DPKG:-dpkg}' --args '${DPKG:-dpkg}' --root= EOF chmod +x "${TMPWORKINGDIRECTORY}/rootdir/usr/bin/dpkg" "${TMPWORKINGDIRECTORY}/rootdir/usr/bin/gdb-dpkg" echo "Dir::Bin::dpkg \"${TMPWORKINGDIRECTORY}/rootdir/usr/bin/dpkg\";" > rootdir/etc/apt/apt.conf.d/99dpkg - + # Set the solver for the test case. + if [ "$APT_SOLVER" ]; then + echo "APT::Solver \"$APT_SOLVER\";" >> aptconfig.conf + fi { echo 'quiet "0";' echo 'quiet::NoUpdate "true";' diff --git a/test/integration/run-tests b/test/integration/run-tests index c1cc780f0..badc96cc5 100755 --- a/test/integration/run-tests +++ b/test/integration/run-tests @@ -22,6 +22,15 @@ while [ -n "$1" ]; do elif [ "$1" = '-j' ]; then APT_TEST_JOBS=$2 shift + elif [ "$1" = '--solver' ]; then + export APT_SOLVER="$2" + shift + elif [ "$1" = '--skip' ]; then + export APT_SKIP_TEST_FILE="$2" + shift + elif [ "$1" = '--only' ]; then + TESTLIST="$2" + shift elif [ -x "$1" ]; then TESTTORUN="$1" else @@ -52,14 +61,22 @@ if [ -n "$TESTTORUN" ]; then CURRENTTRAP="rm -f \"$OUTPUT\"; $CURRENTTRAP" trap "$CURRENTTRAP" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM { - if [ "$MSGLEVEL" -le 1 ]; then + if [ "$APT_SKIP_TEST_FILE" ] && grep -qFx "${TESTTORUN##*/}" "$APT_SKIP_TEST_FILE"; then + if [ "$MSGLEVEL" -le 2 ]; then + printf "${CTEST}Skip Testcase ${CHIGH}${TESTTORUN##*/}${CRESET}" + else + printf "${CTEST}Skip Testcase ${CHIGH}${TESTTORUN##*/}${CRESET}\n" + fi + SKIP='yes' + elif [ "$MSGLEVEL" -le 1 ]; then printf "${TESTTORUN##*/}" elif [ "$MSGLEVEL" -le 2 ]; then printf "${CTEST}Testcase ${CHIGH}${TESTTORUN##*/}${CRESET}: " else printf "${CTEST}Run Testcase ${CHIGH}${TESTTORUN##*/}${CRESET}\n" fi - if ! "$TESTTORUN"; then + + if [ "$SKIP" != "yes" ] && ! "$TESTTORUN"; then FAIL='yes' if [ "$MSGLEVEL" -le 2 ]; then printf >&2 "\n${CHIGH}Running ${TESTTORUN##*/} -> FAILED${CRESET}\n" @@ -96,7 +113,11 @@ ALL=0 FAILED_TESTS="" DIR="$(readlink -f "$(dirname "$0")")" cd "$DIR" -TESTLIST="$(find . -mindepth 1 -maxdepth 1 -regex '^\./test-[^/]*$' | sort)" +if [ -e "$TESTLIST" ]; then + TESTLIST="$(sort < "$TESTLIST" | sed 's#^#./#')" +else + TESTLIST="$(find . -mindepth 1 -maxdepth 1 -regex '^\./test-[^/]*$' | sort)" +fi if [ -n "$APT_TEST_JOBS" ]; then if [ "$MSGCOLOR" != 'NO' ]; then export MSGCOLOR='ALWAYS' @@ -125,6 +146,10 @@ if [ "$MSGLEVEL" -le 1 ]; then printf "${CTEST}Running testcases${CRESET}: " fi for testcase in $TESTLIST; do + if [ "$APT_SKIP_TEST_FILE" ] && grep -qFx "${TESTTORUN##*/}" "$APT_SKIP_TEST_FILE"; then + printf "${CTEST}Skipping Testcase ${CHIGH}${TESTTORUN##*/}${CRESET}\n" + continue + fi if [ "$MSGLEVEL" -le 1 ]; then printf "${testcase##*/}" elif [ "$MSGLEVEL" -le 2 ]; then diff --git a/test/integration/solver3.broken b/test/integration/solver3.broken new file mode 100644 index 000000000..020335238 --- /dev/null +++ b/test/integration/solver3.broken @@ -0,0 +1,86 @@ +test-allow-scores-for-all-dependency-types +test-apt-get-autoremove +test-apt-get-autoremove-kernel-module-providers +test-apt-get-autoremove-real-virtual-provider +test-apt-get-build-dep +test-apt-get-build-dep-barbarian +test-apt-get-build-dep-file +test-apt-get-install-deb +test-apt-get-satisfy +test-apt-get-source-only +test-apt-get-upgrade +test-apt-get-upgrade-by-source +test-apt-install-file-reltag +test-apt-install-order-matters-a-bit +test-apt-move-and-forget-manual-sections +test-apt-never-markauto-sections +test-apt-patterns +test-apt-source-and-build-dep +test-bug-470115-new-and-tighten-recommends +test-bug-549968-install-depends-of-not-installed +test-bug-591882-conkeror +test-bug-596498-trusted-unsigned-repo +test-bug-598669-install-postfix-gets-exim-heavy +test-bug-601961-install-info +test-bug-602412-dequote-redirect +test-bug-604222-new-and-autoremove +test-bug-611729-mark-as-manual +test-bug-612099-multiarch-conflicts +test-bug-612557-garbage-upgrade +test-bug-613420-new-garbage-dependency +test-bug-618848-always-respect-user-requests +test-bug-632221-cross-dependency-satisfaction +test-bug-64141-install-dependencies-for-on-hold +test-bug-657695-resolver-breaks-on-virtuals +test-bug-675449-essential-are-protected +test-bug-683786-build-dep-on-virtual-packages +test-bug-686346-package-missing-architecture +test-bug-709560-set-candidate-release +test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch +test-bug-720597-build-dep-purge +test-bug-723586-any-stripped-in-single-arch +test-bug-735967-lib32-to-i386-unavailable +test-bug-745046-candidate-propagation-fails +test-bug-747261-arch-specific-conflicts +test-bug-753297-upgradable +test-bug-758153-versioned-provides-support +test-bug-767891-force-essential-important +test-bug-769609-triggers-still-pending-after-run +test-bug-796070-downgrade-simulate +test-bug-960705-propagate-protected-to-satisfied-conflict +test-bug-960705-propagate-protected-to-satisfied-depends +test-bug-961266-hold-means-hold +test-bug-lp1562402-nomark-removals-as-keep +test-crossgrades +test-dont-forget-conflicts-via-unknown-architectures +test-dpkg-i-apt-install-fix-broken +test-explore-or-groups-in-markinstall +test-external-dependency-solver-protocol +test-external-installation-planner-protocol +test-handling-broken-orgroups +test-ignore-provides-if-versioned-breaks +test-ignore-provides-if-versioned-conflicts +test-kernel-helper-autoremove +test-method-mirror +test-multiarch-allowed +test-multiarch-barbarian +test-multiarch-foreign +test-not-upgrading-removed-depends +test-parse-all-archs-into-cache +test-phased-updates-new-depends +test-phased-updates-upgrade +test-prefer-higher-priority-providers +test-prevent-markinstall-multiarch-same-versionscrew +test-release-candidate-switching +test-resolve-by-keep-new-recommends +test-resolver-delays-remove-decisions +test-resolver-provider-exchange +test-specific-architecture-dependencies +test-suggests-promoted-to-recommends +test-ubuntu-bug-1130419-prefer-installed-ma-same-siblings +test-ubuntu-bug-1304403-obsolete-priority-standard +test-ubuntu-bug-1974196 +test-ubuntu-bug-1990586 +test-ubuntu-bug-2025462-phased-dist-upgrade +test-ubuntu-bug-614993 +test-unpack-different-version-unpacked -- cgit v1.2.3-70-g09d2