diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 09:59:37 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 09:59:37 +0000 |
commit | 76e2632459410dec81337edb6a9fee33c9a660f3 (patch) | |
tree | a73345df208eede4a4daad340515c9328f34625c /test/integration/test-apt-keep-downloaded-pkgs | |
parent | Initial commit. (diff) | |
download | apt-76e2632459410dec81337edb6a9fee33c9a660f3.tar.xz apt-76e2632459410dec81337edb6a9fee33c9a660f3.zip |
Adding upstream version 2.7.12.upstream/2.7.12
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-x | test/integration/test-apt-keep-downloaded-pkgs | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/test/integration/test-apt-keep-downloaded-pkgs b/test/integration/test-apt-keep-downloaded-pkgs new file mode 100755 index 0000000..c5f6295 --- /dev/null +++ b/test/integration/test-apt-keep-downloaded-pkgs @@ -0,0 +1,54 @@ +#!/bin/sh +set -e + +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" + +setupenvironment +configarchitecture 'native' + +buildsimplenativepackage 'pkg1' 'all' '1.0' 'stable' +buildsimplenativepackage 'pkg2' 'all' '1.0' 'stable' +buildsimplenativepackage 'pkg3' 'all' '1.0' 'stable' +buildsimplenativepackage 'pkg4' 'all' '1.0' 'stable' + +# local (file) installs +setupaptarchive + +# a file:// "download" is not a real download and hence passes +testsuccess aptget install pkg1 --no-download --download-only -y +testfailure test -f rootdir/var/cache/apt/archives/pkg1_1.0_all.deb +testsuccess test -f aptarchive/pool/pkg1_1.0_all.deb + +# ensure that install from local sources does not remove debs +testsuccess aptget install pkg1 -o APT::Keep-Downloaded-Packages=false +testsuccess test -f aptarchive/pool/pkg1_1.0_all.deb +testfailure test -f rootdir/var/cache/apt/archives/pkg1_1.0_all.deb + +# now switch to http and downloading debs +changetowebserver +testsuccess aptget update + +# see if no-download really doesn't download the package +testfailuremsg 'E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?' aptget install pkg2 --no-download -y +testsuccess test -f aptarchive/pool/pkg2_1.0_all.deb +testfailure test -f rootdir/var/cache/apt/archives/pkg2_1.0_all.deb + +# ensure that the downloaded pkg is kept with "keep=true" +testsuccess aptget install pkg2 -o APT::Keep-Downloaded-Packages=true +testsuccess test -f aptarchive/pool/pkg2_1.0_all.deb +testsuccess test -f rootdir/var/cache/apt/archives/pkg2_1.0_all.deb + +# ensure that the downloaded pkg is removed when requested +testsuccess aptget install pkg3 -o APT::Keep-Downloaded-Packages=false +testsuccess test -f aptarchive/pool/pkg3_1.0_all.deb +# this was there before, keep it +testsuccess test -f rootdir/var/cache/apt/archives/pkg2_1.0_all.deb +# this got installed so we can remove it now +testfailure test -f rootdir/var/cache/apt/archives/pkg3_1.0_all.deb + + +# ensure that install from the download dir does not delete packages +mv aptarchive/pool/pkg4_1.0_all.deb rootdir/var/cache/apt/archives +testsuccess aptget install $(pwd)/rootdir/var/cache/apt/archives/pkg4_1.0_all.deb -o APT::Keep-Downloaded-Packages=false +testsuccess test -f $(pwd)/rootdir/var/cache/apt/archives/pkg4_1.0_all.deb |