diff options
Diffstat (limited to 'test')
-rwxr-xr-x | test/integration/test-apt-get-autoremove | 25 | ||||
-rwxr-xr-x | test/integration/test-bug-611729-mark-as-manual | 2 | ||||
-rwxr-xr-x | test/integration/test-disappearing-packages | 2 | ||||
-rwxr-xr-x | test/integration/test-partial-file-support | 2 | ||||
-rwxr-xr-x | test/integration/test-pdiff-usage | 5 |
5 files changed, 32 insertions, 4 deletions
diff --git a/test/integration/test-apt-get-autoremove b/test/integration/test-apt-get-autoremove index 6f3452fbd..4dba4f164 100755 --- a/test/integration/test-apt-get-autoremove +++ b/test/integration/test-apt-get-autoremove @@ -9,6 +9,12 @@ configarchitecture 'i386' buildsimplenativepackage 'unrelated' 'all' '1' 'unstable' buildsimplenativepackage 'po-debconf' 'all' '1.0.16' 'unstable' buildsimplenativepackage 'debhelper' 'all' '8.0.0' 'unstable' 'Depends: po-debconf' +buildsimplenativepackage 'base-files' 'all' '10' 'unstable' 'Essential: yes' +buildsimplenativepackage 'fdisk' 'all' '2.30.2' 'unstable' 'XB-Important: yes' +buildsimplenativepackage 'linux-image' 'all' '4.9.80' 'unstable' +buildsimplenativepackage 'hold-me' 'all' '1.0' 'unstable' +buildsimplenativepackage 'remove-me' 'all' '1.0' 'unstable' +buildsimplenativepackage 'system-base' 'all' '1.0' 'unstable' 'Depends: unrelated, base-files, fdisk, linux-image, hold-me, remove-me' setupaptarchive testsuccess aptget install unrelated debhelper -y @@ -158,6 +164,25 @@ testsuccess aptget install debhelper --solver apt -y -o Debug::pkgDepCache::Mark testmarkedauto 'po-debconf' testdpkgstatus 'pi' '1' 'unrelated' +testsuccess aptget install system-base debhelper -y +testdpkginstalled 'debhelper' 'po-debconf' 'system-base' 'base-files' 'fdisk' 'linux-image' 'hold-me' 'remove-me' +testsuccess aptmark hold 'hold-me' +echo 'APT::NeverAutoRemove { "^linux-image$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove +testsuccess aptget remove system-base -y +testsuccess aptget autoremove -y -o Debug::pkgAutoRemove=yes +DEBUGLOG=${TMPWORKINGDIRECTORY}/rootdir/tmp/autoremove.debuglog +cp "${TMPWORKINGDIRECTORY}/rootdir/tmp/testsuccess.output" "$DEBUGLOG" +testsuccess grep -Fx 'Marking: fdisk:i386 2.30.2 (Important)' "$DEBUGLOG" +testsuccess grep -Fx 'Marking: base-files:i386 10 (Essential)' "$DEBUGLOG" +testsuccess grep -Fx 'Marking: unrelated:i386 1 (Manual-Installed)' "$DEBUGLOG" +testsuccess grep -Fx 'Marking: hold-me:i386 1.0 (Hold)' "$DEBUGLOG" +testsuccess grep -Fx 'Marking: po-debconf:i386 1.0.16 (Dependency)' "$DEBUGLOG" +testsuccess grep -Fx 'Marking: linux-image:i386 4.9.80 (Blacklisted [APT::NeverAutoRemove])' "$DEBUGLOG" +testdpkginstalled 'debhelper' 'po-debconf' 'base-files' 'fdisk' 'linux-image' +testdpkgstatus 'hi' '1' 'hold-me' +testdpkgnotinstalled 'remove-me' +testdpkgstatus 'pi' '1' 'unrelated' + insertinstalledpackage 'bar' 'all' '1' 'Depends: foo-provider' insertinstalledpackage 'foo-multi1-1' 'all' '1' 'Provides: foo-provider Source: foo-multi (1)' diff --git a/test/integration/test-bug-611729-mark-as-manual b/test/integration/test-bug-611729-mark-as-manual index 97ef846e3..63f8245a7 100755 --- a/test/integration/test-bug-611729-mark-as-manual +++ b/test/integration/test-bug-611729-mark-as-manual @@ -56,7 +56,7 @@ testdpkginstalled b c testmarkedauto 'b' sed -i rootdir/var/log/apt/history.log -e '/^Commandline: / d' -e '/^Start-Date: / d' -e '/^End-Date: / d' -if [ -n "$SUDO_USER" ]; then +if [ -n "$SUDO_USER" ] && [ "$(id -u "$SUDO_USER")" -gt 0 ]; then testfileequal 'rootdir/var/log/apt/history.log' " Requested-By: $SUDO_USER ($(id -u "$SUDO_USER")) Reinstall: b:i386 (1.0)" diff --git a/test/integration/test-disappearing-packages b/test/integration/test-disappearing-packages index e8748e6bc..f3fed04f3 100755 --- a/test/integration/test-disappearing-packages +++ b/test/integration/test-disappearing-packages @@ -60,7 +60,7 @@ all files have been overwritten by other packages: Note: This is done automatically and on purpose by dpkg.' tail -n 4 disappear.output sed -i rootdir/var/log/apt/history.log -e '/^Commandline: / d' -e '/^Start-Date: / d' -e '/^End-Date: / d' -e "s#:$(getarchitecture 'native') #:native #" -if [ -n "$SUDO_USER" ]; then +if [ -n "$SUDO_USER" ] && [ "$(id -u "$SUDO_USER")" -gt 0 ]; then testfileequal 'rootdir/var/log/apt/history.log' " Requested-By: $SUDO_USER ($(id -u "$SUDO_USER")) Install: old-pkg:native (1) diff --git a/test/integration/test-partial-file-support b/test/integration/test-partial-file-support index 9b5eed1e5..88fa91324 100755 --- a/test/integration/test-partial-file-support +++ b/test/integration/test-partial-file-support @@ -24,7 +24,7 @@ testdownloadfile() { else msgpass fi - sed -e '/^ <- / s#%20# #g' -e '/^ <- / s#%0a#\n#g' "$DOWNLOADLOG" | grep '^.*-Hash: ' > receivedhashes.log + sed -e '/^ <- / s#%20# #g' -e '/^ <- / s#%0a#\n#g' "$DOWNLOADLOG" | grep '^.*-Hash: ' > receivedhashes.log || true testsuccess test -s receivedhashes.log local HASHES_OK=0 local HASHES_BAD=0 diff --git a/test/integration/test-pdiff-usage b/test/integration/test-pdiff-usage index 5a650ad83..7cda2ee45 100755 --- a/test/integration/test-pdiff-usage +++ b/test/integration/test-pdiff-usage @@ -138,6 +138,8 @@ SHA256-Download: mkdir -p "${BYHASH}" find "${NORMAL}/" -maxdepth 1 -name "Index*" -exec mv '{}' "$BYHASH" \; ln -s "${BYHASH}/Index.gz" "${BYHASH}/$(sha256sum "${BYHASH}/Index.gz" | cut -f1 -d' ')" + echo 'foobar' > "${BYHASH}/$(sha256sum "$PATCHFILE" | cut -f1 -d' ')" + echo 'foobar' > "${BYHASH}/$(sha256sum "${PATCHFILE}.gz" | cut -f1 -d' ')" rm -rf rootdir/var/lib/apt/lists cp -a rootdir/var/lib/apt/lists-bak rootdir/var/lib/apt/lists wasmergeused "$@" -o Acquire::By-Hash=force @@ -398,7 +400,8 @@ testcase -o Acquire::IndexTargets::deb::Packages::KeepCompressed=true partialleftovers() { generatepartialleftovers "redirectme_Packages.${LOWCOSTEXT}" "redirectme_Packages-patched.${LOWCOSTEXT}"; } -webserverconfig 'aptwebserver::redirect::replace::/redirectme/' "http://0.0.0.0:${APTHTTPPORT}/" +# redirect the InRelease file only – the other files are auto-redirected by apt +webserverconfig 'aptwebserver::redirect::replace::/redirectme/I' "http://0.0.0.0:${APTHTTPPORT}/I" rewritesourceslist "http://localhost:${APTHTTPPORT}/redirectme" aptautotest_apt_update() { aptautotest_aptget_update "$@" |