diff options
author | David Kalnischkies <david@kalnischkies.de> | 2022-08-31 21:49:33 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2022-09-02 16:55:45 +0200 |
commit | 3498fbedafbf30e5c91deeaefa6a60d1e387593a (patch) | |
tree | 45428464f191427a27b3d97a4ec601571aee70bd | |
parent | 49f9cfba5567cd034bf729a63b3f6e9badd9bc35 (diff) |
Avoid dealing with a fake dpkg stanza in the tests
We needed a fake dpkg in our status file for dpkg --assert-multi-arch to
work in the past, but recent dpkg versions do not require this anymore,
so we can remove this somewhat surprising hackery in favour of better
hidden hackery we only use if we work with an older dpkg (e.g. on
current Debian stable).
-rw-r--r-- | test/integration/framework | 60 | ||||
-rwxr-xr-x | test/integration/test-apt-cache | 10 | ||||
-rwxr-xr-x | test/integration/test-apt-cli-json-hooks | 16 | ||||
-rwxr-xr-x | test/integration/test-apt-cli-list | 2 | ||||
-rwxr-xr-x | test/integration/test-apt-get-changelog | 26 | ||||
-rwxr-xr-x | test/integration/test-apt-mark | 9 | ||||
-rwxr-xr-x | test/integration/test-apt-move-and-forget-manual-sections | 6 | ||||
-rwxr-xr-x | test/integration/test-apt-never-markauto-sections | 12 | ||||
-rwxr-xr-x | test/integration/test-apt-patterns | 2 | ||||
-rwxr-xr-x | test/integration/test-apt-update-nofallback | 3 | ||||
-rwxr-xr-x | test/integration/test-apt-update-rollback | 6 | ||||
-rwxr-xr-x | test/integration/test-bug-728500-tempdir | 3 | ||||
-rwxr-xr-x | test/integration/test-bug-753297-upgradable | 1 | ||||
-rwxr-xr-x | test/integration/test-external-dependency-solver-protocol | 2 | ||||
-rwxr-xr-x | test/integration/test-external-installation-planner-protocol | 2 | ||||
-rwxr-xr-x | test/integration/test-prevent-markinstall-multiarch-same-versionscrew | 2 | ||||
-rwxr-xr-x | test/integration/test-ubuntu-bug-1876495-pkgnames-virtual | 8 |
17 files changed, 96 insertions, 74 deletions
diff --git a/test/integration/framework b/test/integration/framework index 8bb8c00d6..5e1e68a98 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -473,10 +473,56 @@ if [ -r '${TMPWORKINGDIRECTORY}/noopchroot.so' ]; then export LD_PRELOAD="noopchroot.so" fi fi +EXEC='exec' EOF cp "${TMPWORKINGDIRECTORY}/rootdir/usr/bin/dpkg" "${TMPWORKINGDIRECTORY}/rootdir/usr/bin/gdb-dpkg" + local DPKG_VERSION="$(command dpkg-query --showformat '${VERSION}' --show dpkg)" + if command dpkg --compare-versions "${DPKG_VERSION}" '<<' '1.21.0'; then + cat >> "${TMPWORKINGDIRECTORY}/rootdir/usr/bin/dpkg" <<EOF +dpkg_assert_call() { + while [ -n "\$1" ]; do + if [ "\${1#*--assert-}" != "\$1" ]; then return 0; fi + if [ "\$1" = '--' ]; then break; fi + shift + done + return 1 +} +if dpkg_assert_call "\$@" && ! command dpkg-checkbuilddeps --admindir='${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg' -d 'dpkg' /dev/null >/dev/null 2>&1; then + EXEC='' + ORIGINAL="${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status" + BACKUP="${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status.apt-backup" + restoredpkgstatus() { + if [ -n "\$BACKUP" ]; then + if [ -e "\$BACKUP" ]; then + mv -f "\$BACKUP" "\$ORIGINAL" + else + rm -f "\$ORIGINAL" + fi + BACKUP='' + fi + } + trap "restoredpkgstatus;" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM + if [ -e "\$ORIGINAL" ]; then + cp -a "\$ORIGINAL" "\$BACKUP" + fi + cat >> "${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status" << EOS + +Package: dpkg +Architecture: all +Version: ${DPKG_VERSION}+fake +Status: install ok installed +Maintainer: Joe Sixpack <joe@example.org> +Installed-Size: 42 +Description: tells dpkg it supports what we need + Some versions of dpkg check its own version from the status file + to know if it supports multi-arch and stuff in --assert-*. + +EOS +fi +EOF + fi cat >> "${TMPWORKINGDIRECTORY}/rootdir/usr/bin/dpkg" <<EOF -exec fakeroot '${DPKG:-dpkg}' --root='${TMPWORKINGDIRECTORY}/rootdir' \\ +\$EXEC fakeroot '${DPKG:-dpkg}' --root='${TMPWORKINGDIRECTORY}/rootdir' \\ --admindir="${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg" \\ --log='${TMPWORKINGDIRECTORY}/rootdir/var/log/dpkg.log' \\ --force-not-root --force-bad-path "\$@" @@ -491,9 +537,6 @@ EOF echo "Dir::Bin::dpkg \"${TMPWORKINGDIRECTORY}/rootdir/usr/bin/dpkg\";" > rootdir/etc/apt/apt.conf.d/99dpkg { - if ! command dpkg --assert-multi-arch >/dev/null 2>&1; then - echo "DPKG::options:: \"--force-architecture\";" # Added to test multiarch before dpkg is ready for it… - fi echo 'quiet "0";' echo 'quiet::NoUpdate "true";' echo 'quiet::NoStatistic "true";' @@ -588,12 +631,6 @@ configdpkg() { fi fi rm -f rootdir/etc/apt/apt.conf.d/00foreigndpkg - # make sure dpkg can detect itself as capable of it - if [ "0" = "$(dpkg -l dpkg 2> /dev/null | grep '^i' | wc -l)" ]; then - # dpkg doesn't really check the version as long as it is fully installed, - # but just to be sure we choose one above the required version - insertinstalledpackage 'dpkg' "all" '1.16.2+fake' - fi if dpkg --assert-multi-arch >/dev/null 2>&1 ; then local ARCHS="$(getarchitectures)" local DPKGARCH="$(dpkg --print-architecture)" @@ -613,6 +650,9 @@ configdpkg() { fi fi done + else + # test multiarch before dpkg is ready for it… + echo "DPKG::options:: \"--force-architecture\";" > rootdir/etc/apt/apt.conf.d/00foreigndpkg fi } diff --git a/test/integration/test-apt-cache b/test/integration/test-apt-cache index 56c3268fb..c003fba8c 100755 --- a/test/integration/test-apt-cache +++ b/test/integration/test-apt-cache @@ -22,9 +22,9 @@ Replaces: foo:i386 (<< 1)' "$DESCR" setupaptarchive -# dpkg is installed by our framework -testdpkginstalled 'dpkg' -testempty aptcache unmet dpkg +insertinstalledpackage 'awesome' 'all' '1' +testdpkginstalled 'awesome' +testempty aptcache unmet awesome # FIXME: Find some usecase for unmet as it seems kinda useless/broken #testsuccess aptcache unmet @@ -46,9 +46,9 @@ testsuccess aptcache dump cp rootdir/tmp/testsuccess.output dump.output testsuccess test -s dump.output -testsuccessequal 'dpkg -bar +testsuccessequal 'bar foo +awesome specific fancy' aptcache pkgnames testsuccessequal 'bar' aptcache pkgnames bar diff --git a/test/integration/test-apt-cli-json-hooks b/test/integration/test-apt-cli-json-hooks index 17bd17814..9a3208c3c 100755 --- a/test/integration/test-apt-cli-json-hooks +++ b/test/integration/test-apt-cli-json-hooks @@ -169,7 +169,7 @@ Calculating upgrade... HOOK: HELLO HOOK: request {"jsonrpc":"2.0","method":"org.debian.apt.hooks.hello","id":0,"params":{"versions":["0.1","0.2"]}} HOOK: empty -HOOK: request {"jsonrpc":"2.0","method":"org.debian.apt.hooks.install.pre-prompt","params":{"command":"dist-upgrade","search-terms":[],"unknown-packages":[],"packages":[{"id":1,"name":"upgrade","architecture":"i386","mode":"upgrade","automatic":false,"versions":{"candidate":{"id":1,"version":"2.0","architecture":"i386","pin":500,"origins":[{"archive":"testing","codename":"testing","origin":"Oranges","label":"Lemons","site":""}]},"install":{"id":1,"version":"2.0","architecture":"i386","pin":500,"origins":[{"archive":"testing","codename":"testing","origin":"Oranges","label":"Lemons","site":""}]},"current":{"id":4,"version":"1.0","architecture":"i386","pin":100,"origins":[]}}}]}} +HOOK: request {"jsonrpc":"2.0","method":"org.debian.apt.hooks.install.pre-prompt","params":{"command":"dist-upgrade","search-terms":[],"unknown-packages":[],"packages":[{"id":1,"name":"upgrade","architecture":"i386","mode":"upgrade","automatic":false,"versions":{"candidate":{"id":1,"version":"2.0","architecture":"i386","pin":500,"origins":[{"archive":"testing","codename":"testing","origin":"Oranges","label":"Lemons","site":""}]},"install":{"id":1,"version":"2.0","architecture":"i386","pin":500,"origins":[{"archive":"testing","codename":"testing","origin":"Oranges","label":"Lemons","site":""}]},"current":{"id":3,"version":"1.0","architecture":"i386","pin":100,"origins":[]}}}]}} HOOK: empty HOOK: BYE The following packages will be upgraded: @@ -177,14 +177,14 @@ The following packages will be upgraded: HOOK: HELLO HOOK: request {"jsonrpc":"2.0","method":"org.debian.apt.hooks.hello","id":0,"params":{"versions":["0.1","0.2"]}} HOOK: empty -HOOK: request {"jsonrpc":"2.0","method":"org.debian.apt.hooks.install.package-list","params":{"command":"dist-upgrade","search-terms":[],"unknown-packages":[],"packages":[{"id":1,"name":"upgrade","architecture":"i386","mode":"upgrade","automatic":false,"versions":{"candidate":{"id":1,"version":"2.0","architecture":"i386","pin":500,"origins":[{"archive":"testing","codename":"testing","origin":"Oranges","label":"Lemons","site":""}]},"install":{"id":1,"version":"2.0","architecture":"i386","pin":500,"origins":[{"archive":"testing","codename":"testing","origin":"Oranges","label":"Lemons","site":""}]},"current":{"id":4,"version":"1.0","architecture":"i386","pin":100,"origins":[]}}}]}} +HOOK: request {"jsonrpc":"2.0","method":"org.debian.apt.hooks.install.package-list","params":{"command":"dist-upgrade","search-terms":[],"unknown-packages":[],"packages":[{"id":1,"name":"upgrade","architecture":"i386","mode":"upgrade","automatic":false,"versions":{"candidate":{"id":1,"version":"2.0","architecture":"i386","pin":500,"origins":[{"archive":"testing","codename":"testing","origin":"Oranges","label":"Lemons","site":""}]},"install":{"id":1,"version":"2.0","architecture":"i386","pin":500,"origins":[{"archive":"testing","codename":"testing","origin":"Oranges","label":"Lemons","site":""}]},"current":{"id":3,"version":"1.0","architecture":"i386","pin":100,"origins":[]}}}]}} HOOK: empty HOOK: BYE 1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. HOOK: HELLO HOOK: request {"jsonrpc":"2.0","method":"org.debian.apt.hooks.hello","id":0,"params":{"versions":["0.1","0.2"]}} HOOK: empty -HOOK: request {"jsonrpc":"2.0","method":"org.debian.apt.hooks.install.statistics","params":{"command":"dist-upgrade","search-terms":[],"unknown-packages":[],"packages":[{"id":1,"name":"upgrade","architecture":"i386","mode":"upgrade","automatic":false,"versions":{"candidate":{"id":1,"version":"2.0","architecture":"i386","pin":500,"origins":[{"archive":"testing","codename":"testing","origin":"Oranges","label":"Lemons","site":""}]},"install":{"id":1,"version":"2.0","architecture":"i386","pin":500,"origins":[{"archive":"testing","codename":"testing","origin":"Oranges","label":"Lemons","site":""}]},"current":{"id":4,"version":"1.0","architecture":"i386","pin":100,"origins":[]}}}]}} +HOOK: request {"jsonrpc":"2.0","method":"org.debian.apt.hooks.install.statistics","params":{"command":"dist-upgrade","search-terms":[],"unknown-packages":[],"packages":[{"id":1,"name":"upgrade","architecture":"i386","mode":"upgrade","automatic":false,"versions":{"candidate":{"id":1,"version":"2.0","architecture":"i386","pin":500,"origins":[{"archive":"testing","codename":"testing","origin":"Oranges","label":"Lemons","site":""}]},"install":{"id":1,"version":"2.0","architecture":"i386","pin":500,"origins":[{"archive":"testing","codename":"testing","origin":"Oranges","label":"Lemons","site":""}]},"current":{"id":3,"version":"1.0","architecture":"i386","pin":100,"origins":[]}}}]}} HOOK: empty HOOK: BYE Inst upgrade [1.0] (2.0 Lemons:testing [i386]) @@ -192,7 +192,7 @@ Conf upgrade (2.0 Lemons:testing [i386]) HOOK: HELLO HOOK: request {"jsonrpc":"2.0","method":"org.debian.apt.hooks.hello","id":0,"params":{"versions":["0.1","0.2"]}} HOOK: empty -HOOK: request {"jsonrpc":"2.0","method":"org.debian.apt.hooks.install.post","params":{"command":"dist-upgrade","search-terms":[],"unknown-packages":[],"packages":[{"id":1,"name":"upgrade","architecture":"i386","mode":"upgrade","automatic":false,"versions":{"candidate":{"id":1,"version":"2.0","architecture":"i386","pin":500,"origins":[{"archive":"testing","codename":"testing","origin":"Oranges","label":"Lemons","site":""}]},"install":{"id":1,"version":"2.0","architecture":"i386","pin":500,"origins":[{"archive":"testing","codename":"testing","origin":"Oranges","label":"Lemons","site":""}]},"current":{"id":4,"version":"1.0","architecture":"i386","pin":100,"origins":[]}}}]}} +HOOK: request {"jsonrpc":"2.0","method":"org.debian.apt.hooks.install.post","params":{"command":"dist-upgrade","search-terms":[],"unknown-packages":[],"packages":[{"id":1,"name":"upgrade","architecture":"i386","mode":"upgrade","automatic":false,"versions":{"candidate":{"id":1,"version":"2.0","architecture":"i386","pin":500,"origins":[{"archive":"testing","codename":"testing","origin":"Oranges","label":"Lemons","site":""}]},"install":{"id":1,"version":"2.0","architecture":"i386","pin":500,"origins":[{"archive":"testing","codename":"testing","origin":"Oranges","label":"Lemons","site":""}]},"current":{"id":3,"version":"1.0","architecture":"i386","pin":100,"origins":[]}}}]}} HOOK: empty HOOK: BYE' apt dist-upgrade -s @@ -206,7 +206,7 @@ Calculating upgrade... HOOK: HELLO HOOK: request {"jsonrpc":"2.0","method":"org.debian.apt.hooks.hello","id":0,"params":{"versions":["0.1","0.2"]}} HOOK: empty -HOOK: request {"jsonrpc":"2.0","method":"org.debian.apt.hooks.install.pre-prompt","params":{"command":"dist-upgrade","search-terms":[],"unknown-packages":[],"packages":[{"id":1,"name":"upgrade","architecture":"i386","mode":"install","automatic":false,"versions":{"candidate":{"id":1,"version":"2.0","architecture":"i386","pin":500,"origins":[{"archive":"testing","codename":"testing","origin":"Oranges","label":"Lemons","site":""}]},"install":{"id":1,"version":"2.0","architecture":"i386","pin":500,"origins":[{"archive":"testing","codename":"testing","origin":"Oranges","label":"Lemons","site":""}]},"current":{"id":4,"version":"1.0","architecture":"i386","pin":100,"origins":[]}}}]}} +HOOK: request {"jsonrpc":"2.0","method":"org.debian.apt.hooks.install.pre-prompt","params":{"command":"dist-upgrade","search-terms":[],"unknown-packages":[],"packages":[{"id":1,"name":"upgrade","architecture":"i386","mode":"install","automatic":false,"versions":{"candidate":{"id":1,"version":"2.0","architecture":"i386","pin":500,"origins":[{"archive":"testing","codename":"testing","origin":"Oranges","label":"Lemons","site":""}]},"install":{"id":1,"version":"2.0","architecture":"i386","pin":500,"origins":[{"archive":"testing","codename":"testing","origin":"Oranges","label":"Lemons","site":""}]},"current":{"id":3,"version":"1.0","architecture":"i386","pin":100,"origins":[]}}}]}} HOOK: empty HOOK: BYE The following packages will be upgraded: @@ -214,14 +214,14 @@ The following packages will be upgraded: HOOK: HELLO HOOK: request {"jsonrpc":"2.0","method":"org.debian.apt.hooks.hello","id":0,"params":{"versions":["0.1","0.2"]}} HOOK: empty -HOOK: request {"jsonrpc":"2.0","method":"org.debian.apt.hooks.install.package-list","params":{"command":"dist-upgrade","search-terms":[],"unknown-packages":[],"packages":[{"id":1,"name":"upgrade","architecture":"i386","mode":"install","automatic":false,"versions":{"candidate":{"id":1,"version":"2.0","architecture":"i386","pin":500,"origins":[{"archive":"testing","codename":"testing","origin":"Oranges","label":"Lemons","site":""}]},"install":{"id":1,"version":"2.0","architecture":"i386","pin":500,"origins":[{"archive":"testing","codename":"testing","origin":"Oranges","label":"Lemons","site":""}]},"current":{"id":4,"version":"1.0","architecture":"i386","pin":100,"origins":[]}}}]}} +HOOK: request {"jsonrpc":"2.0","method":"org.debian.apt.hooks.install.package-list","params":{"command":"dist-upgrade","search-terms":[],"unknown-packages":[],"packages":[{"id":1,"name":"upgrade","architecture":"i386","mode":"install","automatic":false,"versions":{"candidate":{"id":1,"version":"2.0","architecture":"i386","pin":500,"origins":[{"archive":"testing","codename":"testing","origin":"Oranges","label":"Lemons","site":""}]},"install":{"id":1,"version":"2.0","architecture":"i386","pin":500,"origins":[{"archive":"testing","codename":"testing","origin":"Oranges","label":"Lemons","site":""}]},"current":{"id":3,"version":"1.0","architecture":"i386","pin":100,"origins":[]}}}]}} HOOK: empty HOOK: BYE 1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. HOOK: HELLO HOOK: request {"jsonrpc":"2.0","method":"org.debian.apt.hooks.hello","id":0,"params":{"versions":["0.1","0.2"]}} HOOK: empty -HOOK: request {"jsonrpc":"2.0","method":"org.debian.apt.hooks.install.statistics","params":{"command":"dist-upgrade","search-terms":[],"unknown-packages":[],"packages":[{"id":1,"name":"upgrade","architecture":"i386","mode":"install","automatic":false,"versions":{"candidate":{"id":1,"version":"2.0","architecture":"i386","pin":500,"origins":[{"archive":"testing","codename":"testing","origin":"Oranges","label":"Lemons","site":""}]},"install":{"id":1,"version":"2.0","architecture":"i386","pin":500,"origins":[{"archive":"testing","codename":"testing","origin":"Oranges","label":"Lemons","site":""}]},"current":{"id":4,"version":"1.0","architecture":"i386","pin":100,"origins":[]}}}]}} +HOOK: request {"jsonrpc":"2.0","method":"org.debian.apt.hooks.install.statistics","params":{"command":"dist-upgrade","search-terms":[],"unknown-packages":[],"packages":[{"id":1,"name":"upgrade","architecture":"i386","mode":"install","automatic":false,"versions":{"candidate":{"id":1,"version":"2.0","architecture":"i386","pin":500,"origins":[{"archive":"testing","codename":"testing","origin":"Oranges","label":"Lemons","site":""}]},"install":{"id":1,"version":"2.0","architecture":"i386","pin":500,"origins":[{"archive":"testing","codename":"testing","origin":"Oranges","label":"Lemons","site":""}]},"current":{"id":3,"version":"1.0","architecture":"i386","pin":100,"origins":[]}}}]}} HOOK: empty HOOK: BYE Inst upgrade [1.0] (2.0 Lemons:testing [i386]) @@ -229,7 +229,7 @@ Conf upgrade (2.0 Lemons:testing [i386]) HOOK: HELLO HOOK: request {"jsonrpc":"2.0","method":"org.debian.apt.hooks.hello","id":0,"params":{"versions":["0.1","0.2"]}} HOOK: empty -HOOK: request {"jsonrpc":"2.0","method":"org.debian.apt.hooks.install.post","params":{"command":"dist-upgrade","search-terms":[],"unknown-packages":[],"packages":[{"id":1,"name":"upgrade","architecture":"i386","mode":"install","automatic":false,"versions":{"candidate":{"id":1,"version":"2.0","architecture":"i386","pin":500,"origins":[{"archive":"testing","codename":"testing","origin":"Oranges","label":"Lemons","site":""}]},"install":{"id":1,"version":"2.0","architecture":"i386","pin":500,"origins":[{"archive":"testing","codename":"testing","origin":"Oranges","label":"Lemons","site":""}]},"current":{"id":4,"version":"1.0","architecture":"i386","pin":100,"origins":[]}}}]}} +HOOK: request {"jsonrpc":"2.0","method":"org.debian.apt.hooks.install.post","params":{"command":"dist-upgrade","search-terms":[],"unknown-packages":[],"packages":[{"id":1,"name":"upgrade","architecture":"i386","mode":"install","automatic":false,"versions":{"candidate":{"id":1,"version":"2.0","architecture":"i386","pin":500,"origins":[{"archive":"testing","codename":"testing","origin":"Oranges","label":"Lemons","site":""}]},"install":{"id":1,"version":"2.0","architecture":"i386","pin":500,"origins":[{"archive":"testing","codename":"testing","origin":"Oranges","label":"Lemons","site":""}]},"current":{"id":3,"version":"1.0","architecture":"i386","pin":100,"origins":[]}}}]}} HOOK: empty HOOK: BYE' apt dist-upgrade -s diff --git a/test/integration/test-apt-cli-list b/test/integration/test-apt-cli-list index 3a9ca2c15..e81a3b7b3 100755 --- a/test/integration/test-apt-cli-list +++ b/test/integration/test-apt-cli-list @@ -26,7 +26,6 @@ setupaptarchive testsuccessequal "Listing... bar/now 1.0 i386 [installed,local] baz/unstable 2.0 all [upgradable from: 0.1] -dpkg/now 1.16.2+fake all [installed,local] foo/unstable 1.0 all foobar/unstable 2.0 i386 [upgradable from: 1.0] foreign/unstable 2.0 armel [upgradable from: 1.0] @@ -48,7 +47,6 @@ foreign/unstable 2.0 armel [upgradable from: 1.0]" apt list --upgradable testsuccessequal "Listing... bar/now 1.0 i386 [installed,local] baz/now 0.1 all [installed,upgradable to: 2.0] -dpkg/now 1.16.2+fake all [installed,local] foobar/now 1.0 i386 [installed,upgradable to: 2.0] foreign/now 1.0 armel [installed,upgradable to: 2.0]" apt list --installed diff --git a/test/integration/test-apt-get-changelog b/test/integration/test-apt-get-changelog index 9ac9b063a..b216f6f9a 100755 --- a/test/integration/test-apt-get-changelog +++ b/test/integration/test-apt-get-changelog @@ -7,7 +7,7 @@ TESTDIR="$(readlink -f "$(dirname "$0")")" setupenvironment configarchitecture 'native' -buildsimplenativepackage 'dpkg' 'native' '42' 'stable' +buildsimplenativepackage 'awesome' 'native' '42' 'stable' buildsimplenativepackage 'foo' 'all' '1.0' 'stable' buildsimplenativepackage 'libbar' 'all' '1.0' 'stable' @@ -118,20 +118,20 @@ testdpkgnotinstalled 'foo' testsuccessequal "'http://localhost:${APTHTTPPORT}/pool/main/f/foo/foo_1.0/changelog' foo.changelog" apt changelog foo --print-uris -o Acquire::Changelogs::AlwaysOnline=false testsuccessequal "'http://localhost:${APTHTTPPORT}/pool/main/f/foo/foo_1.0/changelog' foo.changelog" apt changelog foo --print-uris -o Acquire::Changelogs::AlwaysOnline=true -testsuccess apt install dpkg -y +testsuccess apt install awesome -y # at this moment, we still have the Releasefile claim to be origin:ubuntu echo 'Acquire::Changelogs::AlwaysOnline::Origin::Ubuntu "false";' >> rootdir/etc/apt/apt.conf.d/nooriginchangelogs -testsuccessequal "'http://localhost:${APTHTTPPORT}/pool/main/d/dpkg/dpkg_42/changelog' dpkg.changelog" apt changelog dpkg --print-uris -testsuccessequal "'copy://${TMPWORKINGDIRECTORY}/rootdir/usr/share/doc/dpkg/changelog' dpkg.changelog" apt changelog dpkg --print-uris -o Acquire::Changelogs::AlwaysOnline=false -testsuccessequal "'http://localhost:${APTHTTPPORT}/pool/main/d/dpkg/dpkg_42/changelog' dpkg.changelog" apt changelog dpkg --print-uris -o Acquire::Changelogs::AlwaysOnline=true -testsuccessequal "'http://localhost:${APTHTTPPORT}/pool/main/d/dpkg/dpkg_42/changelog' dpkg.changelog" apt changelog dpkg --print-uris -o Acquire::Changelogs::AlwaysOnline=false -o Acquire::Changelogs::AlwaysOnline::Origin::Ubuntu=true -testsuccessequal "'copy://${TMPWORKINGDIRECTORY}/rootdir/usr/share/doc/dpkg/changelog' dpkg.changelog" apt changelog dpkg --print-uris -o Acquire::Changelogs::AlwaysOnline=false -o Acquire::Changelogs::AlwaysOnline::Origin::Debian=true - -testsuccess apt changelog dpkg -d -testfilestats 'dpkg.changelog' '%U:%G:%a' '=' "${TEST_DEFAULT_USER}:${TEST_DEFAULT_GROUP}:644" -head -n 3 dpkg.changelog > dpkg.change -testfileequal 'dpkg.change' "$(apthelper cat-file 'rootdir/usr/share/doc/dpkg/changelog' | head -n 3)" -rm -f dpkg.change dpkg.changelog +testsuccessequal "'http://localhost:${APTHTTPPORT}/pool/main/a/awesome/awesome_42/changelog' awesome.changelog" apt changelog awesome --print-uris +testsuccessequal "'copy://${TMPWORKINGDIRECTORY}/rootdir/usr/share/doc/awesome/changelog' awesome.changelog" apt changelog awesome --print-uris -o Acquire::Changelogs::AlwaysOnline=false +testsuccessequal "'http://localhost:${APTHTTPPORT}/pool/main/a/awesome/awesome_42/changelog' awesome.changelog" apt changelog awesome --print-uris -o Acquire::Changelogs::AlwaysOnline=true +testsuccessequal "'http://localhost:${APTHTTPPORT}/pool/main/a/awesome/awesome_42/changelog' awesome.changelog" apt changelog awesome --print-uris -o Acquire::Changelogs::AlwaysOnline=false -o Acquire::Changelogs::AlwaysOnline::Origin::Ubuntu=true +testsuccessequal "'copy://${TMPWORKINGDIRECTORY}/rootdir/usr/share/doc/awesome/changelog' awesome.changelog" apt changelog awesome --print-uris -o Acquire::Changelogs::AlwaysOnline=false -o Acquire::Changelogs::AlwaysOnline::Origin::Debian=true + +testsuccess apt changelog awesome -d +testfilestats 'awesome.changelog' '%U:%G:%a' '=' "${TEST_DEFAULT_USER}:${TEST_DEFAULT_GROUP}:644" +head -n 3 awesome.changelog > awesome.change +testfileequal 'awesome.change' "$(apthelper cat-file 'rootdir/usr/share/doc/awesome/changelog' | head -n 3)" +rm -f awesome.change awesome.changelog # no package specified testfailureequal 'E: No packages found' aptget changelog diff --git a/test/integration/test-apt-mark b/test/integration/test-apt-mark index 630a0d460..d1c65ad7c 100755 --- a/test/integration/test-apt-mark +++ b/test/integration/test-apt-mark @@ -15,14 +15,10 @@ insertinstalledpackage 'bar' 'amd64' '1' setupaptarchive -# dpkg is "installed" by our test framework -testdpkginstalled dpkg - testnoautopkg() { testempty aptmark showauto testempty aptcache -q=1 showauto testsuccessequal 'bar -dpkg foo' aptmark showmanual testsuccessequal 'bar foo' aptmark showmanual bar foo uninstalled @@ -32,8 +28,7 @@ testfooisauto() { testsuccessequal 'foo' aptcache -q=1 showauto testsuccessequal 'foo' aptmark showauto foo testsuccessequal 'foo' aptcache -q=1 showauto foo - testsuccessequal 'bar -dpkg' aptmark showmanual + testsuccessequal 'bar' aptmark showmanual testsuccessequal 'bar' aptmark showmanual bar } testmarkonpkgasauto() { @@ -59,8 +54,6 @@ testmarkonpkgasauto 'aptget' 'markauto' 'unmarkauto' testnoholdpkg() { testempty aptmark showhold testempty aptmark showholds # typical "typo" - testempty aptmark showhold dpkg - testempty aptmark showholds dpkg } testpkgonhold() { testsuccessequal "$1" aptmark showhold diff --git a/test/integration/test-apt-move-and-forget-manual-sections b/test/integration/test-apt-move-and-forget-manual-sections index 69a7d9f1d..4617abab3 100755 --- a/test/integration/test-apt-move-and-forget-manual-sections +++ b/test/integration/test-apt-move-and-forget-manual-sections @@ -15,17 +15,17 @@ buildsimplenativepackage 'libdef' 'native' '1' 'unstable' '' '' 'libs' setupaptarchive testmarkedauto -testmarkedmanual 'dpkg' +testmarkedmanual testsuccess aptget install libabc/stable -y testdpkginstalled 'libabc' testdpkgnotinstalled 'libdef' -testmarkedmanual 'dpkg' 'libabc' +testmarkedmanual 'libabc' testmarkedauto testsuccess aptget dist-upgrade -y testdpkginstalled 'libabc' 'libdef' testmarkedauto 'libabc' -testmarkedmanual 'dpkg' 'libdef' +testmarkedmanual 'libdef' diff --git a/test/integration/test-apt-never-markauto-sections b/test/integration/test-apt-never-markauto-sections index 6ad89c506..a77d6b22b 100755 --- a/test/integration/test-apt-never-markauto-sections +++ b/test/integration/test-apt-never-markauto-sections @@ -25,11 +25,11 @@ setupaptarchive testsuccess aptcache show nosection testfailure grep 'Section' rootdir/tmp/testsuccess.output -testequal 'dpkg' aptmark showmanual +testempty aptmark showmanual testsuccess aptget install mydesktop -y -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 -o Debug::pkgDepCache::AutoInstall=1 -testmarkedmanual 'dpkg' 'mydesktop' +testmarkedmanual 'mydesktop' testmarkedauto 'mydesktop-core' 'foreignpkg:i386' 'texteditor' 'browser' 'nosection' # if the remove is from a user, don't do manual-bit passing @@ -60,22 +60,22 @@ testsuccess aptget autoremove texteditor -y testdpkgnotinstalled mydesktop mydesktop-core texteditor testdpkginstalled browser -testmarkedmanual 'browser' 'dpkg' 'foreignpkg:i386' 'nosection' +testmarkedmanual 'browser' 'foreignpkg:i386' 'nosection' testmarkedauto # test that installed/upgraded auto-pkgs are not set to manual testsuccess aptget install browser=41 -y --allow-downgrades -testmarkedmanual 'browser' 'dpkg' 'foreignpkg:i386' 'nosection' +testmarkedmanual 'browser' 'foreignpkg:i386' 'nosection' testmarkedauto testsuccess aptmark auto browser testmarkedauto 'browser' testsuccess aptmark auto nosection testmarkedauto 'browser' 'nosection' -testmarkedmanual 'dpkg' 'foreignpkg:i386' +testmarkedmanual 'foreignpkg:i386' testsuccess aptget install mydesktop -y -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 -o Debug::pkgDepCache::AutoInstall=1 -testmarkedmanual 'dpkg' 'foreignpkg:i386' 'mydesktop' +testmarkedmanual 'foreignpkg:i386' 'mydesktop' testmarkedauto 'browser' 'mydesktop-core' 'texteditor' 'nosection' diff --git a/test/integration/test-apt-patterns b/test/integration/test-apt-patterns index b015655d9..7f202710c 100755 --- a/test/integration/test-apt-patterns +++ b/test/integration/test-apt-patterns @@ -91,7 +91,6 @@ automatic2/now 1.0 i386 [installed,local] available/unstable 1.0 all broken/now 1.0 i386 [installed,local] conf-only/now 1.0 i386 [residual-config] -dpkg/now 1.16.2+fake all [installed,local] essential/now 1.0 i386 [installed,local] foreign/unstable 2.0 amd64 manual1/now 1.0 i386 [installed,local] @@ -180,7 +179,6 @@ testsuccessequal "Listing... automatic1/now 1.0 i386 [installed,local] automatic2/now 1.0 i386 [installed,local] broken/now 1.0 i386 [installed,local] -dpkg/now 1.16.2+fake all [installed,local] essential/now 1.0 i386 [installed,local] manual1/now 1.0 i386 [installed,local] manual2/now 1.0 i386 [installed,local] diff --git a/test/integration/test-apt-update-nofallback b/test/integration/test-apt-update-nofallback index 637716543..18f12b1e3 100755 --- a/test/integration/test-apt-update-nofallback +++ b/test/integration/test-apt-update-nofallback @@ -41,8 +41,7 @@ N: See apt-secure(8) manpage for repository creation and user configuration deta assert_repo_is_intact() { - testsuccessequal "dpkg/now 1.16.2+fake all [installed,local] -foo/unstable 2.0 all" apt list -qq + testsuccessequal 'foo/unstable 2.0 all' apt list -qq testsuccess aptget install -y -s foo testfailure aptget install -y evil testsuccess aptget source foo --print-uris diff --git a/test/integration/test-apt-update-rollback b/test/integration/test-apt-update-rollback index ea431c816..8235968bb 100755 --- a/test/integration/test-apt-update-rollback +++ b/test/integration/test-apt-update-rollback @@ -39,8 +39,7 @@ start_with_good_inrelease() { create_fresh_archive testsuccess aptget update listcurrentlistsdirectory > lists.before - testsuccessequal 'dpkg/now 1.16.2+fake all [installed,local] -old/unstable 1.0 all' apt list -qq + testsuccessequal 'old/unstable 1.0 all' apt list -qq } test_inrelease_to_new_inrelease() { @@ -49,8 +48,7 @@ test_inrelease_to_new_inrelease() { add_new_package '+1hour' testsuccess aptget update -o Debug::Acquire::Transaction=1 - testsuccessequal 'dpkg/now 1.16.2+fake all [installed,local] -new/unstable 1.0 all + testsuccessequal 'new/unstable 1.0 all old/unstable 1.0 all' apt list -qq } diff --git a/test/integration/test-bug-728500-tempdir b/test/integration/test-bug-728500-tempdir index 8fab8f28f..7497ffcf8 100755 --- a/test/integration/test-bug-728500-tempdir +++ b/test/integration/test-bug-728500-tempdir @@ -18,6 +18,5 @@ export TMPDIR=/does-not-exists testsuccess aptget update -o Debug::Acquire::gpg=1 unset TMPDIR -testsuccessequal 'dpkg -coolstuff' aptcache pkgnames +testsuccessequal 'coolstuff' aptcache pkgnames testsuccess ls rootdir/var/lib/apt/lists/*InRelease diff --git a/test/integration/test-bug-753297-upgradable b/test/integration/test-bug-753297-upgradable index 353728db0..f33a6591d 100755 --- a/test/integration/test-bug-753297-upgradable +++ b/test/integration/test-bug-753297-upgradable @@ -31,5 +31,4 @@ N: There is 1 additional version. Please use the '-a' switch to see it" apt list testsuccessequal "Listing... bar/testing 2 all [upgradable from: 1] -dpkg/now 1.16.2+fake all [installed,local] foo/testing,now 1 all [installed]" apt list diff --git a/test/integration/test-external-dependency-solver-protocol b/test/integration/test-external-dependency-solver-protocol index 0091263b7..485a77068 100755 --- a/test/integration/test-external-dependency-solver-protocol +++ b/test/integration/test-external-dependency-solver-protocol @@ -213,7 +213,7 @@ APT-Candidate: yes Package: stuff Architecture: all Version: 1 -APT-ID: 8 +APT-ID: 7 Source: stuff Source-Version: 1 Priority: optional diff --git a/test/integration/test-external-installation-planner-protocol b/test/integration/test-external-installation-planner-protocol index 56a7ad1d6..192f21bb3 100755 --- a/test/integration/test-external-installation-planner-protocol +++ b/test/integration/test-external-installation-planner-protocol @@ -43,7 +43,7 @@ Remove: bar:amd64 Install: foo:amd64 libfoo:amd64 Planner: internal' head -n 6 "$EIPPLOG" aptinternalplanner < "$EIPPLOG" > planner.log || true -testsuccessequal 'Remove: 7 +testsuccessequal 'Remove: 6 Unpack: 2 Unpack: 4' grep -e '^Unpack:' -e '^Install:' -e '^Configure:' -e '^Remove:' planner.log diff --git a/test/integration/test-prevent-markinstall-multiarch-same-versionscrew b/test/integration/test-prevent-markinstall-multiarch-same-versionscrew index 63fdb88d9..796623840 100755 --- a/test/integration/test-prevent-markinstall-multiarch-same-versionscrew +++ b/test/integration/test-prevent-markinstall-multiarch-same-versionscrew @@ -97,7 +97,7 @@ Conf out-of-sync-gone-foreign (2 unstable [amd64]) Conf out-of-sync-gone-native:i386 (2 unstable [i386])' aptget dist-upgrade -s #-o Debug::pkgDepCache::Marker=1 testempty dpkg -C -rm rootdir/var/lib/dpkg/status +rm -f rootdir/var/lib/dpkg/status insertinstalledpackage 'libsame2' 'i386' '1' 'Multi-Arch: same' insertinstalledpackage 'libsame3' 'i386' '1' 'Multi-Arch: same' diff --git a/test/integration/test-ubuntu-bug-1876495-pkgnames-virtual b/test/integration/test-ubuntu-bug-1876495-pkgnames-virtual index 2391c7e2d..627bd0c78 100755 --- a/test/integration/test-ubuntu-bug-1876495-pkgnames-virtual +++ b/test/integration/test-ubuntu-bug-1876495-pkgnames-virtual @@ -14,10 +14,8 @@ setupaptarchive changetowebserver testsuccess aptget update -o Debug::Acquire::gpg=1 -testsuccessequal "dpkg -coolstuff" aptcache pkgnames +testsuccessequal 'coolstuff' aptcache pkgnames -testsuccessequal "dpkg -source-package +testsuccessequal 'source-package virtual-package -coolstuff" aptcache pkgnames --all-names +coolstuff' aptcache pkgnames --all-names |