diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 18:07:13 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 18:07:13 +0000 |
commit | 636c7dc17286d93d788c741d15fd756aeda066d5 (patch) | |
tree | e7ae158cc54f591041a061b9865bcae51854f15c /test/integration/test-apt-cache-remapping | |
parent | Initial commit. (diff) | |
download | apt-636c7dc17286d93d788c741d15fd756aeda066d5.tar.xz apt-636c7dc17286d93d788c741d15fd756aeda066d5.zip |
Adding upstream version 1.8.2.3.upstream/1.8.2.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/integration/test-apt-cache-remapping')
-rwxr-xr-x | test/integration/test-apt-cache-remapping | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/test/integration/test-apt-cache-remapping b/test/integration/test-apt-cache-remapping new file mode 100755 index 0000000..31a406c --- /dev/null +++ b/test/integration/test-apt-cache-remapping @@ -0,0 +1,47 @@ +#!/bin/sh +set -e + +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" + +setupenvironment +configarchitecture 'amd64' + +buildsimplenativepackage 'foo' 'amd64' '1' + +# the default is 1MB – too much for our simple tests +echo 'APT::Cache-Grow "1000";' > rootdir/etc/apt/apt.conf.d/limit-cachegrow.conf + +# experiment with cache remapping +rm -f rootdir/var/cache/apt/*.bin +testsuccess apt install ./incoming/foo_1_amd64.deb -s +msgtest 'Cache files are generated in tests' +if [ ! -e rootdir/var/cache/apt/srcpkgcache.bin -o ! -e rootdir/var/cache/apt/pkgcache.bin ]; then + msgfail 'files do not exist' + ls -l rootdir/var/cache/apt/*.bin + exit 1 +else + msgpass +fi + +SLSIZE="$(stat -c '%s' rootdir/var/cache/apt/srcpkgcache.bin)" +STSIZE="$(stat -c '%s' rootdir/var/cache/apt/pkgcache.bin)" +rm -f rootdir/var/cache/apt/*.bin +testfailure apt install ./incoming/foo_1_amd64.deb -s -o APT::Cache-Start="$SLSIZE" -o APT::Cache-Grow=0 +testfailure test -e rootdir/var/cache/apt/pkgcache.bin +rm -f rootdir/var/cache/apt/*.bin +testfailure apt install ./incoming/foo_1_amd64.deb -s -o APT::Cache-Start="$SLSIZE" -o APT::Cache-Limit="$SLSIZE" +testfailure test -e rootdir/var/cache/apt/pkgcache.bin +rm -f rootdir/var/cache/apt/*.bin +testsuccess apt install ./incoming/foo_1_amd64.deb -s -o APT::Cache-Start="$SLSIZE" +testsuccess test -e rootdir/var/cache/apt/srcpkgcache.bin -a -e rootdir/var/cache/apt/pkgcache.bin + +rm -f rootdir/var/cache/apt/*.bin +testfailure apt install ./incoming/foo_1_amd64.deb -s -o APT::Cache-Start="$STSIZE" -o APT::Cache-Grow=0 +rm -f rootdir/var/cache/apt/*.bin +testfailure apt install ./incoming/foo_1_amd64.deb -s -o APT::Cache-Start="$STSIZE" -o APT::Cache-Limit="$SLSIZE" +rm -f rootdir/var/cache/apt/*.bin +testfailure apt install ./incoming/foo_1_amd64.deb -s -o APT::Cache-Start="$STSIZE" -o APT::Cache-Limit="$STSIZE" +rm -f rootdir/var/cache/apt/*.bin +testsuccess apt install ./incoming/foo_1_amd64.deb -s -o APT::Cache-Start="$STSIZE" +testsuccess test -e rootdir/var/cache/apt/srcpkgcache.bin -a -e rootdir/var/cache/apt/pkgcache.bin |