From 76e2632459410dec81337edb6a9fee33c9a660f3 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 11:59:37 +0200 Subject: Adding upstream version 2.7.12. Signed-off-by: Daniel Baumann --- test/integration/test-apt-cache | 183 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 183 insertions(+) create mode 100755 test/integration/test-apt-cache (limited to 'test/integration/test-apt-cache') diff --git a/test/integration/test-apt-cache b/test/integration/test-apt-cache new file mode 100755 index 0000000..c003fba --- /dev/null +++ b/test/integration/test-apt-cache @@ -0,0 +1,183 @@ +#!/bin/sh +set -e + +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" + +setupenvironment +configarchitecture 'amd64' 'i386' + +DESCR='Some description + That has multiple lines' +insertpackage 'unstable' 'fancy' 'all' '1' +insertpackage 'unstable,installed' 'foo' 'all' '1' 'Depends: bar +Conflicts: foobar +Recommends: cool (>= 2) | cooler (<< 5)' "$DESCR" +insertpackage 'unstable' 'bar' 'all' '1' 'Depends: bar +Breaks: foo (<< 1) +Replaces: foo (<< 1)' "$DESCR" +insertpackage 'unstable' 'specific' 'all' '1' 'Depends: bar:i386, specific:amd64 +Breaks: foo:amd64 (<< 1) +Replaces: foo:i386 (<< 1)' "$DESCR" + +setupaptarchive + +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 +#testsuccess aptcache unmet foo + +# not too useful to test, but makes coverage green… +testsuccess aptcache stats +cp rootdir/tmp/testsuccess.output stats.output +testsuccess test -s stats.output +testfailureequal 'E: apt-cache stats does not take any arguments' aptcache stats foo +testsuccess aptcache xvcg foo +cp rootdir/tmp/testsuccess.output xvcg.output +testsuccess test -s xvcg.output +testsuccess aptcache dotty foo +cp rootdir/tmp/testsuccess.output dotty.output +testsuccess test -s dotty.output +# for this, even the sourcecode says it is useless (expect debugging) +testsuccess aptcache dump +cp rootdir/tmp/testsuccess.output dump.output +testsuccess test -s dump.output + +testsuccessequal 'bar +foo +awesome +specific +fancy' aptcache pkgnames +testsuccessequal 'bar' aptcache pkgnames bar +testsuccessequal 'foo +fancy' aptcache pkgnames f + +testsuccessequal " foo | 1 | file:$(readlink -f .)/aptarchive unstable/main all Packages" aptcache madison foo + +### depends + +testsuccessequal 'foo + Depends: bar + Conflicts: + |Recommends: + Recommends: ' aptcache depends foo +testsuccessequal 'foo + Depends: bar + Conflicts: + |Recommends: + Recommends: ' aptcache depends foo --implicit +testsuccessequal 'foo + Depends: bar + Conflicts: + Recommends: ' aptcache depends foo -o APT::Cache::ShowOnlyFirstOr=1 +testsuccessequal 'foo + Depends: bar + Conflicts: + Recommends: ' aptcache depends foo -o APT::Cache::ShowOnlyFirstOr=1 --implicit +testsuccessequal 'foo + Depends: bar + Conflicts: + |Recommends: (>= 2) + Recommends: (<< 5)' aptcache depends foo -o APT::Cache::ShowVersion=1 +testsuccessequal 'foo + Depends: bar + Conflicts: + |Recommends: (>= 2) + Recommends: (<< 5)' aptcache depends foo -o APT::Cache::ShowVersion=1 --implicit +testsuccessequal 'foo + Depends: bar + Conflicts: ' aptcache depends foo --no-recommends +testsuccessequal 'foo + Depends: bar + Conflicts: ' aptcache depends foo --no-recommends --implicit +testsuccessequal 'foo + Depends: bar' aptcache depends foo --important --implicit +testsuccessequal 'foo + Conflicts: ' aptcache depends foo --important --no-depends --conflicts +testsuccessequal 'foo + Conflicts: ' aptcache depends foo --important --no-depends --conflicts --implicit +testsuccessequal 'foo + Depends: bar + Conflicts: + |Recommends: + Recommends: +bar + Depends: bar + Breaks: foo + Replaces: foo + + +' aptcache depends foo --recurse +testsuccessequal 'foo + Depends: bar + Conflicts: + |Recommends: + Recommends: +bar + Depends: bar + Breaks: foo + Replaces: foo + Breaks: + Replaces: + + + +' aptcache depends foo --recurse --implicit +testsuccessequal 'foo + Depends: bar +bar + Depends: bar + Replaces: foo' aptcache depends foo --recurse --important --replaces +testsuccessequal 'foo + Depends: bar +bar + Depends: bar + Replaces: foo + Replaces: +' aptcache depends foo --recurse --important --replaces --implicit +testsuccessequal 'bar + Depends: bar + Breaks: foo + Replaces: foo' aptcache depends bar +testsuccessequal 'bar + Depends: bar + Breaks: foo + Replaces: foo + Breaks: + Replaces: ' aptcache depends bar --implicit + +testsuccessequal 'specific + Depends: + Depends: + specific + Breaks: + Replaces: ' aptcache depends specific +testsuccessequal 'specific + Depends: + Depends: + specific + Breaks: + Replaces: ' aptcache depends specific --implicit + +## rdepends + +# Note that specific does not appear in this list as it doesn't depend on foo, +# but on an arch-specific foo! +testsuccessequal 'foo +Reverse Depends: + bar + bar' aptcache rdepends foo +testsuccessequal 'foo +Reverse Depends: + Breaks: bar + Replaces: bar' aptcache rdepends foo -o APT::Cache::ShowDependencyType=1 +testsuccessequal 'foo +Reverse Depends: + Breaks: bar (<< 1) + Replaces: bar (<< 1)' aptcache rdepends foo -o APT::Cache::ShowDependencyType=1 -o APT::Cache::ShowVersion=1 +testsuccessequal 'foo +Reverse Depends: + Breaks: bar (<< 1)' aptcache rdepends foo -o APT::Cache::ShowDependencyType=1 -o APT::Cache::ShowVersion=1 --important --breaks -- cgit v1.2.3