diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 06:14:41 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 06:14:41 +0000 |
commit | 549a391d6438e828001eeeaf235b080c054a7bf3 (patch) | |
tree | 1bb6b1ea5987fa167a1d13abe82209cc882dd94b /test/integration/test-bug-814139-pickup-of-different-cache-states | |
parent | Initial commit. (diff) | |
download | apt-549a391d6438e828001eeeaf235b080c054a7bf3.tar.xz apt-549a391d6438e828001eeeaf235b080c054a7bf3.zip |
Adding upstream version 2.2.4.upstream/2.2.4upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/integration/test-bug-814139-pickup-of-different-cache-states')
-rwxr-xr-x | test/integration/test-bug-814139-pickup-of-different-cache-states | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/test/integration/test-bug-814139-pickup-of-different-cache-states b/test/integration/test-bug-814139-pickup-of-different-cache-states new file mode 100755 index 0000000..dffeb73 --- /dev/null +++ b/test/integration/test-bug-814139-pickup-of-different-cache-states @@ -0,0 +1,60 @@ +#!/bin/sh +set -e + +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" + +setupenvironment +configarchitecture 'amd64' + +insertinstalledpackage 'build-essential' 'amd64' '1' + +buildsimplenativepackage 'foo' 'all' '1' 'stable' 'Build-Depends: bar' +buildsimplenativepackage 'bar' 'all' '1' 'stable' + +setupaptarchive + +cp rootdir/var/lib/dpkg/status status.backup + +testrun() { + cp status.backup rootdir/var/lib/dpkg/status + cleanup + testdpkgnotinstalled 'bar' + testsuccess aptget build-dep foo -y + testdpkginstalled 'bar' + cleanup + cd downloaded + testsuccess aptget source foo + testsuccess test -s foo_1.tar.* -a -s foo_1.dsc + rm foo_1.tar.* foo_1.dsc + testsuccess test -d foo-1 + rm -rf foo-1 + cd .. + cleanup + testsuccess aptget install foo -y +} + +msgmsg 'Caches fully up-to-date' +cleanup() { + rm -f rootdir/var/cache/apt/*.bin + testsuccess aptcache gencaches +} +testrun + +msgmsg 'pkgcache.bin is missing' +cleanup() { + rm -f rootdir/var/cache/apt/*.bin + testsuccess aptcache gencaches + rm rootdir/var/cache/apt/pkgcache.bin +} +testrun + +msgmsg 'Caches are not writeable' +rm rootdir/var/cache/apt/*.bin +addtrap 'prefix' 'chmod 755 rootdir/var/cache/apt;' +chmod 555 rootdir/var/cache/apt +testsuccess aptcache gencaches +cleanup() { + testfilestats "${TMPWORKINGDIRECTORY}/rootdir/var/cache/apt" '%a' '=' '555' +} +testrun |