summaryrefslogtreecommitdiff
path: root/test/integration
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration')
-rwxr-xr-xtest/integration/skip-bug-601016-description-translation13
-rwxr-xr-xtest/integration/test-apt-cli-show76
-rwxr-xr-xtest/integration/test-apt-get-remove-depends29
-rwxr-xr-xtest/integration/test-apt-get-satisfy4
-rwxr-xr-xtest/integration/test-apt-patterns67
-rwxr-xr-xtest/integration/test-apt-update-repeated-ims-hit75
-rwxr-xr-xtest/integration/test-authentication-basic44
-rwxr-xr-xtest/integration/test-bug-490000-search-in-all-translations107
-rwxr-xr-xtest/integration/test-kernel-helper-autoremove12
-rwxr-xr-xtest/integration/test-packages-require-authorization61
-rwxr-xr-xtest/integration/test-provides-arch-all28
11 files changed, 420 insertions, 96 deletions
diff --git a/test/integration/skip-bug-601016-description-translation b/test/integration/skip-bug-601016-description-translation
index fd0465acd..3f68ce2d5 100755
--- a/test/integration/skip-bug-601016-description-translation
+++ b/test/integration/skip-bug-601016-description-translation
@@ -47,11 +47,11 @@ Description-${LOCALE}: Mächtige Oberfläche für dpkg
auf den dpkg-Paketmanager. Es beinhaltet das apt-get-Werkzeug und die
APT-Dselect-Methode. Beides sind einfache und sicherere Wege,
um Pakete zu installieren und Upgrades durchzuführen.
-$MD5Sum" | bzip2 > aptarchive/${LOCALE}.bz2
+$MD5Sum" > "aptarchive/${LOCALE}"
-# the $LOCALE translation file will not be included as it is a flat archive it came from and therefore
-# its name can not be guessed correctly… (in non-flat archives the files are called Translation-*)
-echo 'APT::Cache::Generate "false";' > rootdir/etc/apt/apt.conf.d/00nogenerate
+# add our $LOCALE translation file explicitly to be picked up by apt-ftparchive
+echo "APT::FTPArchive::Release::Patterns:: \"en\";
+APT::FTPArchive::Release::Patterns:: \"${LOCALE}\";" > rootdir/etc/apt/apt.conf.d/ftparchivepattern
NOLONGSTANZA="$PACKAGESTANZA
Description: Advanced front-end for dpkg
@@ -90,7 +90,8 @@ testrun() {
testequal "$LOCALESTANZA2" aptcache show apt:amd64 -o Test=File-${LOCALE}
testequal "$NOLONGSTANZA" aptcache show apt -o Acquire::Languages="ww" -o Test=File-${LOCALE}
testequal "$LOCALESTANZA" aptcache show apt -o Acquire::Languages::="ww" -o Test=File-${LOCALE}
- LC_ALL=C testequal "$ENGLISHSTANZA" aptcache show apt -o Test=File-${LOCALE}
+ LC_ALL=C.UTF-8 testequal "$LOCALESTANZA" aptcache show apt -o Test=File-${LOCALE}
+ LC_ALL=C.UTF-8 testequal "$ENGLISHSTANZA" aptcache show apt -o Test=File-${LOCALE} -o Acquire::Languages="environment,${LOCALE}"
export LC_ALL=""
echo "Acquire::Languages { \"ww\"; \"${LOCALE}\"; \"en\"; };" > rootdir/etc/apt/apt.conf.d/00languages
testequal "$LOCALESTANZA" aptcache show apt -o Test=File-ww-${LOCALE}
@@ -113,7 +114,7 @@ Description-en: Advanced front-end for dpkg
This is Debian's next generation front-end for the dpkg package manager.
It provides the apt-get utility and APT dselect method that provides a
simpler, safer way to install and upgrade packages.
-$MD5Sum" | bzip2 > aptarchive/en.bz2
+$MD5Sum" > aptarchive/en
ENGLISHSTANZA="$PACKAGESTANZA
Description-en: Advanced front-end for dpkg
diff --git a/test/integration/test-apt-cli-show b/test/integration/test-apt-cli-show
index a37dbd8e6..4f9e9a16c 100755
--- a/test/integration/test-apt-cli-show
+++ b/test/integration/test-apt-cli-show
@@ -20,6 +20,8 @@ insertpackage 'unstable' 'bar' 'i386,amd64' '1' '' '' "$DESCR"
insertpackage 'unstable' 'big' 'i386,amd64' '1' 'Installed-Size: 4129421' '' "$DESCR"
insertpackage 'unstable' 'large' 'all' '1' "Provides: pkga$(generatelotsofnames)" '' "$DESCR"
insertpackage 'unstable' 'large2' 'all' '1' "Provides: foobar, pkga$(generatelotsofnames)" '' "$DESCR"
+insertpackage 'unstable' 'multi' 'all' '1.0' '' '' "$DESCR"
+insertpackage 'unstable' 'multi' 'all' '2.0' '' '' "$DESCR"
insertinstalledpackage 'foo' 'all' '1.0'
setupaptarchive
@@ -99,6 +101,80 @@ Description: Some description
That has multiple lines
" apt show large2
+# Test for multiple versions
+testsuccessequal "Package: multi
+Version: 2.0
+Priority: optional
+Section: other
+Maintainer: Joe Sixpack <joe@example.org>
+Installed-Size: 43.0 kB
+Download-Size: unknown
+APT-Sources: file:$APTARCHIVE unstable/main all Packages
+Description: Some description
+ That has multiple lines
+
+N: There is 1 additional record. Please use the '-a' switch to see it" apt show multi
+
+testsuccessequal "Package: multi
+Version: 2.0
+Priority: optional
+Section: other
+Maintainer: Joe Sixpack <joe@example.org>
+Installed-Size: 43.0 kB
+Download-Size: unknown
+APT-Sources: file:$APTARCHIVE unstable/main all Packages
+Description: Some description
+ That has multiple lines
+
+Package: multi
+Version: 1.0
+Priority: optional
+Section: other
+Maintainer: Joe Sixpack <joe@example.org>
+Installed-Size: 43.0 kB
+Download-Size: unknown
+APT-Sources: file:$APTARCHIVE unstable/main all Packages
+Description: Some description
+ That has multiple lines
+" apt show multi -a
+
+# test apt info
+testsuccessequal "Package: multi
+Version: 2.0
+Priority: optional
+Section: other
+Maintainer: Joe Sixpack <joe@example.org>
+Installed-Size: 43.0 kB
+Download-Size: unknown
+APT-Sources: file:$APTARCHIVE unstable/main all Packages
+Description: Some description
+ That has multiple lines
+
+N: There is 1 additional record. Please use the '-a' switch to see it" apt info multi
+
+testsuccessequal "Package: multi
+Version: 2.0
+Priority: optional
+Section: other
+Maintainer: Joe Sixpack <joe@example.org>
+Installed-Size: 43.0 kB
+Download-Size: unknown
+APT-Sources: file:$APTARCHIVE unstable/main all Packages
+Description: Some description
+ That has multiple lines
+
+Package: multi
+Version: 1.0
+Priority: optional
+Section: other
+Maintainer: Joe Sixpack <joe@example.org>
+Installed-Size: 43.0 kB
+Download-Size: unknown
+APT-Sources: file:$APTARCHIVE unstable/main all Packages
+Description: Some description
+ That has multiple lines
+" apt info multi -a
+
# this is the default, but disabled by the testcases
testsuccess apt show foo -o Apt::Cmd::Disable-Script-Warning=0
cp rootdir/tmp/testsuccess.output aptshow.output
diff --git a/test/integration/test-apt-get-remove-depends b/test/integration/test-apt-get-remove-depends
new file mode 100755
index 000000000..2d2cf0dd6
--- /dev/null
+++ b/test/integration/test-apt-get-remove-depends
@@ -0,0 +1,29 @@
+#!/bin/sh
+set -e
+
+TESTDIR="$(readlink -f "$(dirname "$0")")"
+. "$TESTDIR/framework"
+setupenvironment
+configarchitecture 'i386'
+
+buildsimplenativepackage 'alpha' 'all' '1' 'unstable' 'Depends: beta'
+buildsimplenativepackage 'beta' 'all' '1' 'unstable'
+setupaptarchive
+
+testsuccess aptget install alpha -y
+
+cat > rootdir/var/lib/dpkg/info/alpha.prerm << EOF
+#!/bin/sh
+exit 42
+EOF
+chmod 755 rootdir/var/lib/dpkg/info/alpha.prerm
+
+
+testdpkginstalled 'alpha' 'beta'
+
+
+testfailure aptget remove -y beta
+
+# Beta should not be removed because alpha failed to be removed and depends on it
+
+testdpkginstalled 'alpha' 'beta'
diff --git a/test/integration/test-apt-get-satisfy b/test/integration/test-apt-get-satisfy
index f2e04d789..23daf069a 100755
--- a/test/integration/test-apt-get-satisfy
+++ b/test/integration/test-apt-get-satisfy
@@ -70,3 +70,7 @@ testfailureequal "E: Invalid operator '>' at offset 5, did you mean '>>' or '>='
msgmsg "Unsupported dependency type"
testfailureequal "E: Problem parsing dependency: Recommends: foo" aptget satisfy 'Recommends: foo' -s
+
+
+msgmsg "Empty dependency"
+testfailureequal "E: Problem parsing dependency: " aptget satisfy '' -s
diff --git a/test/integration/test-apt-patterns b/test/integration/test-apt-patterns
index 92c76edd1..cdba76146 100755
--- a/test/integration/test-apt-patterns
+++ b/test/integration/test-apt-patterns
@@ -5,15 +5,16 @@ TESTDIR="$(readlink -f "$(dirname "$0")")"
setupenvironment
configarchitecture 'i386' 'amd64'
-insertpackage 'unstable' 'available' 'all' '1.0'
+insertpackage 'unstable' 'available' 'all' '1.0' 'Section: asection'
insertinstalledpackage 'manual1' 'i386' '1.0' 'Depends: automatic1'
insertinstalledpackage 'manual2' 'i386' '1.0'
-insertinstalledpackage 'automatic1' 'i386' '1.0'
-insertinstalledpackage 'automatic2' 'i386' '1.0'
+insertinstalledpackage 'automatic1' 'i386' '1.0' 'Source: automatic (0)'
+insertinstalledpackage 'automatic2' 'i386' '1.0' 'Source: automatic (1)'
-insertinstalledpackage 'essential' 'i386' '1.0' 'Essential: yes'
+insertinstalledpackage 'essential' 'i386' '1.0' 'Essential: yes
+Section: asection'
insertinstalledpackage 'conf-only' 'i386' '1.0' '' '' 'deinstall ok config-files'
insertinstalledpackage 'broken' 'i386' '1.0' 'Depends: does-not-exist'
@@ -22,6 +23,7 @@ insertpackage 'unstable' 'not-obsolete' 'all' '2.0'
insertpackage 'unstable' 'foreign' 'amd64' '2.0'
+getoriginfromsuite() { echo -n 'meow'; }
setupaptarchive
testsuccess aptmark auto automatic1 automatic2
@@ -32,16 +34,10 @@ testfailureequal "E: input:0-14: error: Unrecognized pattern '?not-a-pattern'
?not-a-pattern
^^^^^^^^^^^^^^
N: Unable to locate package ?not-a-pattern
-N: Couldn't find any package by glob '?not-a-pattern'
-E: Regex compilation error - Invalid preceding regular expression
-N: Couldn't find any package by regex '?not-a-pattern'
E: input:0-14: error: Unrecognized pattern '?not-a-pattern'
?not-a-pattern
^^^^^^^^^^^^^^
N: Unable to locate package ?not-a-pattern
-N: Couldn't find any package by glob '?not-a-pattern'
-E: Regex compilation error - Invalid preceding regular expression
-N: Couldn't find any package by regex '?not-a-pattern'
E: No packages found" apt show '?not-a-pattern'
testfailureequal "Listing...
@@ -55,10 +51,7 @@ Reading state information...
E: input:0-14: error: Unrecognized pattern '?not-a-pattern'
?not-a-pattern
^^^^^^^^^^^^^^
-E: Unable to locate package ?not-a-pattern
-E: Couldn't find any package by glob '?not-a-pattern'
-E: Regex compilation error - Invalid preceding regular expression
-E: Couldn't find any package by regex '?not-a-pattern'" apt install -s '?not-a-pattern'
+E: Unable to locate package ?not-a-pattern" apt install -s '?not-a-pattern'
msgmsg "Ensure that argument lists are present where needed, and absent elsewhere"
@@ -103,6 +96,27 @@ testsuccessequal "Listing...
automatic1/now 1.0 i386 [installed,local]" apt list '?and(?name(^automatic),?name(1$))'
+msgmsg "Narrow and friends"
+testsuccessequal "Listing...
+not-obsolete/unstable 2.0 i386 [upgradable from: 1.0]
+N: There is 1 additional version. Please use the '-a' switch to see it" apt list '?and(?version(^1\.0$),?version(^2\.0$))'
+
+testsuccessequal "Listing..." apt list '?any-version(?and(?version(^1\.0$),?version(^2\.0$)))'
+testsuccessequal "Listing..." apt list '?narrow(?version(^1\.0$),?version(^2\.0$))'
+
+# XXX FIXME: I guess we do want this to only show version 1.0?
+testsuccessequal "Listing...
+not-obsolete/unstable 2.0 i386 [upgradable from: 1.0]
+N: There is 1 additional version. Please use the '-a' switch to see it" apt list '?any-version(?and(?version(^1\.0$),?name(not-obsolete)))'
+testsuccessequal "Listing...
+not-obsolete/unstable 2.0 i386 [upgradable from: 1.0]
+N: There is 1 additional version. Please use the '-a' switch to see it" apt list '?narrow(?version(^1\.0$),?name(not-obsolete))'
+
+
+testsuccessequal "Listing...
+foreign/unstable 2.0 amd64
+not-obsolete/unstable 2.0 i386 [upgradable from: 1.0]" apt list '?not(?all-versions(?version(^1)))'
+
msgmsg "Package patterns"
testsuccessequal "Listing...
@@ -113,6 +127,11 @@ testsuccessequal "Listing..." apt list '?architecture(foreign)'
testsuccessequal "Listing..." apt list '?architecture(native)'
testsuccessequal "Listing...
+available/unstable 1.0 all
+foreign/unstable 2.0 amd64
+not-obsolete/unstable 2.0 i386 [upgradable from: 1.0]" apt list '?archive(^unstable$)'
+
+testsuccessequal "Listing...
automatic1/now 1.0 i386 [installed,local]
automatic2/now 1.0 i386 [installed,local]" apt list '?automatic'
@@ -158,9 +177,29 @@ foreign/unstable 2.0 amd64
not-obsolete/unstable 2.0 i386 [upgradable from: 1.0]" apt list '?not(?obsolete)'
testsuccessequal "Listing...
+available/unstable 1.0 all
+foreign/unstable 2.0 amd64
+not-obsolete/unstable 2.0 i386 [upgradable from: 1.0]" apt list '?origin(^meow$)'
+
+testsuccessequal "Listing...
+available/unstable 1.0 all
+essential/now 1.0 i386 [installed,local]" apt list '?section(asection)'
+
+testsuccessequal "Listing...
+automatic1/now 1.0 i386 [installed,local]
+automatic2/now 1.0 i386 [installed,local]" apt list '?source-package(^automatic$)'
+
+testsuccessequal "Listing...
+automatic2/now 1.0 i386 [installed,local]" apt list '?source-version(^1$)'
+
+testsuccessequal "Listing...
not-obsolete/unstable 2.0 i386 [upgradable from: 1.0]
N: There is 1 additional version. Please use the '-a' switch to see it" apt list '?upgradable'
+testsuccessequal "Listing...
+foreign/unstable 2.0 amd64
+not-obsolete/unstable 2.0 i386 [upgradable from: 1.0]" apt list '?version(2.0)'
+
testsuccessequal "Package: does-not-exist
State: not a real package (virtual)
N: Can't select candidate version from package does-not-exist as it has no candidate
diff --git a/test/integration/test-apt-update-repeated-ims-hit b/test/integration/test-apt-update-repeated-ims-hit
new file mode 100755
index 000000000..74d46b31b
--- /dev/null
+++ b/test/integration/test-apt-update-repeated-ims-hit
@@ -0,0 +1,75 @@
+#!/bin/sh
+set -e
+
+TESTDIR="$(readlink -f "$(dirname "$0")")"
+. "$TESTDIR/framework"
+setupenvironment
+configarchitecture 'amd64'
+configcompression '.' 'bz2'
+
+echo 'Package: apt
+Priority: important
+Section: admin
+Installed-Size: 5984
+Maintainer: APT Development Team <deity@lists.debian.org>
+Architecture: i386
+Version: 0.8.7
+Filename: pool/main/a/apt/apt_0.8.7_i386.deb
+Size: 2140230
+MD5sum: 74769bfbcef9ebc4fa74f7a5271b9c08
+Description: Advanced front-end for dpkg
+Description-md5: d41ee493aa9fcc6cbc9ce4eb7069959c' > aptarchive/Packages
+compressfile aptarchive/Packages
+
+echo "Package: apt
+Description-en: Advanced front-end for dpkg
+ This is Debian's next generation front-end for the dpkg package manager.
+ It provides the apt-get utility and APT dselect method that provides a
+ simpler, safer way to install and upgrade packages.
+$MD5Sum" > aptarchive/en
+compressfile aptarchive/en
+
+echo "APT::FTPArchive::Release::Patterns:: \"en\";
+APT::FTPArchive::Release::Patterns:: \"en.*\";" > rootdir/etc/apt/apt.conf.d/ftparchivepattern
+
+export APT_DONT_SIGN='InRelease'
+setupaptarchive --no-update
+rm -f aptarchive/Packages aptarchive/en
+
+rm -f rootdir/etc/apt/trusted.gpg.d/*
+sed -i -e 's#^deb #deb [trusted=yes] #' rootdir/etc/apt/sources.list.d/*
+
+APTARCHIVE="$(readlink -f ./aptarchive)"
+GPGERROR="W: GPG error: file:$APTARCHIVE Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 5A90D141DBAC8DAE"
+
+msgmsg 'Running update again does not change result' '0'
+testwarningmsg "$GPGERROR" apt update
+listcurrentlistsdirectory > lists.before
+testsuccess grep 'aptarchive_en$' lists.before
+testsuccess grep 'aptarchive_Packages$' lists.before
+testsuccess grep 'aptarchive_Release$' lists.before
+testfailure grep 'aptarchive_Release.gpg$' lists.before
+
+for i in $(seq 1 3); do
+ msgmsg 'Running update again does not change result' "$i"
+ testwarningmsg "$GPGERROR" apt update
+ testfileequal lists.before "$(listcurrentlistsdirectory)"
+done
+
+find rootdir/var/lib/apt/lists -name '*Release*' -delete
+msgmsg 'Running update with a repository gaining hashsums'
+testwarningmsg "$GPGERROR" apt update
+testfileequal lists.before "$(listcurrentlistsdirectory)"
+
+changetowebserver
+find aptarchive -name '*Release*' -delete
+rm -rf rootdir/var/lib/apt/lists
+
+msgmsg 'Running update with no indexes' '0'
+testsuccess apt update
+listcurrentlistsdirectory > lists.before
+for i in $(seq 1 3); do
+ msgmsg 'Running update with no indexes' "$i"
+ testsuccess apt update -o Debug::pkgAcquire::Worker=1 -o Debug::Acquire::Transaction=1
+ testfileequal lists.before "$(listcurrentlistsdirectory)"
+done
diff --git a/test/integration/test-authentication-basic b/test/integration/test-authentication-basic
index 211c73e35..784a00c03 100755
--- a/test/integration/test-authentication-basic
+++ b/test/integration/test-authentication-basic
@@ -65,35 +65,61 @@ runtest() {
authfile ''
testauthfailure "$1"
+ protocol="${1%%://*}"
+
# good auth
- authfile 'machine localhost
+ authfile "machine ${protocol}://localhost
login star@irc
-password hunter2'
+password hunter2"
testauthsuccess "$1"
# bad auth
- authfile 'machine localhost
+ authfile "machine ${protocol}://localhost
login anonymous
-password hunter2'
+password hunter2"
testauthfailure "$1"
# 2 stanzas: unmatching + good auth
- authfile 'machine debian.org
+ authfile "machine ${protocol}://debian.org
login debian
password jessie
-machine localhost
+machine ${protocol}://localhost
login star@irc
-password hunter2'
+password hunter2"
testauthsuccess "$1"
+ # no protocol specifier
+ authfile "machine localhost
+login star@irc
+password hunter2"
+ if [ "$protocol" = "https" ]; then
+ testauthsuccess "$1"
+ else
+ testfailure apthelper download-file "${1}/bash" ./downloaded/bash
+ testsuccessequal "W: ${1}/bash: ${TMPWORKINGDIRECTORY}/rootdir/etc/apt/auth.conf: Credentials for localhost match, but the protocol is not encrypted. Annotate with http:// to use." grep "Credentials.*match" rootdir/tmp/testfailure.output
+ testauthfailure "$1"
+ fi
+
+ # wrong protocol specifier
+ if [ "$protocol" = "https" ]; then
+ authfile "machine http://localhost
+login star@irc
+password hunter2"
+ else
+ authfile "machine https://localhost
+login star@irc
+password hunter2"
+ fi
+ testauthfailure "$1"
+
# delete file, make sure it fails; add auth.conf.d snippet, works again.
rm rootdir/etc/apt/auth.conf
testauthfailure "$1"
- authfile 'machine localhost
+ authfile "machine ${protocol}://localhost
login star@irc
-password hunter2' rootdir/etc/apt/auth.conf.d/myauth.conf
+password hunter2" rootdir/etc/apt/auth.conf.d/myauth.conf
testauthsuccess "$1"
rm rootdir/etc/apt/auth.conf.d/myauth.conf
}
diff --git a/test/integration/test-bug-490000-search-in-all-translations b/test/integration/test-bug-490000-search-in-all-translations
new file mode 100755
index 000000000..3a034bc49
--- /dev/null
+++ b/test/integration/test-bug-490000-search-in-all-translations
@@ -0,0 +1,107 @@
+#!/bin/sh
+
+set -e
+
+TESTDIR="$(readlink -f "$(dirname "$0")")"
+. "${TESTDIR}/framework"
+
+setupenvironment
+
+ARCH='amd64'
+DIST='unstable'
+
+PKG_NAME='foo'
+PKG_VERSION='1.0'
+
+SHORT_DESCRIPTION_EN='have you fooed today?'
+LONG_DESCRIPTION_EN="${SHORT_DESCRIPTION_EN}
+ Where there's foo, there's fire."
+
+SHORT_DESCRIPTION_ZZ='bar alter ego'
+LONG_DESCRIPTION_ZZ="${SHORT_DESCRIPTION_ZZ}
+ He who foos last foos best."
+
+configure_languages()
+{
+ {
+ echo '#clear Acquire::Languages;'
+ echo 'Acquire::Languages {'
+ for language in "$@"
+ do
+ echo " \"${language}\";"
+ done
+ echo '};'
+ } > rootdir/etc/apt/apt.conf.d/languages.conf
+}
+
+new_translation_record()
+{
+ echo "Package: ${1:?Package name expected}"
+ echo "Description-md5: ${2:?Description-md5 expected}"
+ echo "Description-${3:?Language code expected}: ${4:?Package description expected}"
+ echo
+}
+
+str_md5sum()
+{
+ echo -n "${1:?String expected}" | md5sum | cut -d ' ' -f 1
+}
+
+configarchitecture "${ARCH}"
+
+insertpackage "${DIST}" "${PKG_NAME}" "${ARCH}" "${PKG_VERSION}" '' '' "${LONG_DESCRIPTION_EN}"
+# English translation was already added by insertpackage above
+new_translation_record "${PKG_NAME}" "$(str_md5sum "${LONG_DESCRIPTION_EN}")" 'zz' "${LONG_DESCRIPTION_ZZ}" > "aptarchive/dists/${DIST}/main/i18n/Translation-zz"
+
+configure_languages en zz
+setupaptarchive
+
+# ===========================
+#
+# Tests
+#
+# ===========================
+
+# ----------[ apt ]----------
+
+# Test that all translations are searched, but the short
+# description is in the first configured language
+
+configure_languages en zz
+testequal "${PKG_NAME}/${DIST} ${PKG_VERSION} ${ARCH}
+ ${SHORT_DESCRIPTION_EN}
+" apt -qq search alter ego
+
+configure_languages zz en
+testequal "${PKG_NAME}/${DIST} ${PKG_VERSION} ${ARCH}
+ ${SHORT_DESCRIPTION_ZZ}
+" apt -qq search you today
+
+# Search in configured languages only
+configure_languages zz
+testempty apt -qq search where fire
+
+# Patterns are AND-ed i.e. all must match against a single
+# description translation
+configure_languages en zz
+testempty apt -qq search there best
+
+# -------[ apt-cache ]-------
+
+# Test that all translations are searched, but the short
+# description is in the first configured language
+
+configure_languages en zz
+testequal "${PKG_NAME} - ${SHORT_DESCRIPTION_EN}" aptcache search alter ego
+
+configure_languages zz en
+testequal "${PKG_NAME} - ${SHORT_DESCRIPTION_ZZ}" aptcache search you today
+
+# Search in configured languages only
+configure_languages zz
+testempty aptcache search where fire
+
+# Patterns are AND-ed i.e. all must match against a single
+# description translation
+configure_languages en zz
+testempty aptcache search there best
diff --git a/test/integration/test-kernel-helper-autoremove b/test/integration/test-kernel-helper-autoremove
index 8cde3432f..9cc978645 100755
--- a/test/integration/test-kernel-helper-autoremove
+++ b/test/integration/test-kernel-helper-autoremove
@@ -46,10 +46,10 @@ testprotected() {
testfailure --nomsg grep '^[A-Z]: ' protected.list
msgtest 'Check kernel autoremoval protection list includes' 'most recent kernel'
- testsuccess --nomsg grep '^\^linux-image-100\\\.0\\\.0-1-generic\$$' protected.list
+ testsuccess --nomsg grep '^\^linux-.*-100\\\.0\\\.0-1-generic\$$' protected.list
msgtest 'Check kernel autoremoval protection list includes' 'running kernel'
- testsuccess --nomsg grep "^\\^linux-image-$(uname -r | tr '[A-Z]' '[a-z]' | sed -e 's#\.#\\\\.#g')\\\$\$" protected.list
+ testsuccess --nomsg grep "^\\^linux-.*-$(uname -r | tr '[A-Z]' '[a-z]' | sed -e 's#\.#\\\\.#g')\\\$\$" protected.list
msgtest 'Check kernel autoremoval protection list does not include' 'metapackages'
testfailure --nomsg grep -e '^\^linux-image-amd64\$$' -e '^\^linux-image-686-pae\$$' -e ':i386' protected.list
@@ -115,7 +115,7 @@ Remv ${CURRENTKERNEL}-dbg [5-1]" aptget autoremove -sV
msgmsg "run without parameter"
testprotected
msgtest 'Check kernel autoremoval protection list does not include' 'old kernel'
-testfailure --nomsg grep '^\^linux-image-1\\\.0\\\.0-2-generic\$$' protected.list
+testfailure --nomsg grep '^\^linux-.*-1\\\.0\\\.0-2-generic\$$' protected.list
export COLUMNS=99999
testsuccessequal "Reading package lists...
Building dependency tree...
@@ -134,9 +134,9 @@ msgmsg "install unknown kernel"
# know for sure without complicated detection mechanisms
testprotected 1.0.0-2-ungeneric
msgtest 'Check kernel autoremoval protection list does not include' 'old kernel'
-testfailure --nomsg grep '^\^linux-image-1\\\.0\\\.0-2-generic\$$' protected.list
+testfailure --nomsg grep '^\^linux-.*-1\\\.0\\\.0-2-generic\$$' protected.list
msgtest 'Check kernel autoremoval protection list does include' 'unknown installed kernel'
-testsuccess --nomsg grep '^\^linux-image-1\\\.0\\\.0-2-ungeneric\$$' protected.list
+testsuccess --nomsg grep '^\^linux-.*-1\\\.0\\\.0-2-ungeneric\$$' protected.list
export COLUMNS=9
testsuccessequal "Reading package lists...
Building dependency tree...
@@ -154,7 +154,7 @@ unset COLUMNS
msgmsg "install an old kernel"
testprotected 1.0.0-2-generic
msgtest 'Check kernel autoremoval protection list includes' 'installed kernel'
-testsuccess --nomsg grep '^\^linux-image-1\\\.0\\\.0-2-generic\$$' protected.list
+testsuccess --nomsg grep '^\^linux-.*-1\\\.0\\\.0-2-generic\$$' protected.list
export COLUMNS=9
testsuccessequal "Reading package lists...
Building dependency tree...
diff --git a/test/integration/test-packages-require-authorization b/test/integration/test-packages-require-authorization
deleted file mode 100755
index 527497ce5..000000000
--- a/test/integration/test-packages-require-authorization
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/bin/sh
-set -e
-
-TESTDIR="$(readlink -f "$(dirname "$0")")"
-. "$TESTDIR/framework"
-setupenvironment
-configarchitecture 'amd64'
-
-insertpackage 'unstable' 'cool' 'amd64' '1.0'
-
-export APT_DONT_SIGN='InRelease'
-setupaptarchive --no-update
-changetowebserver
-
-echo 'Packages-Require-Authorization: yes' >> aptarchive/dists/unstable/Release
-signreleasefiles
-
-testsuccess aptget update
-testsuccessequal "Package files:
- 100 ${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status
- release a=now
--32768 http://localhost:${APTHTTPPORT} unstable/main amd64 Packages
- release a=unstable,n=sid,c=main,b=amd64
- origin localhost
-Pinned packages:" aptcache policy
-
-mkdir rootdir/etc/apt/auth.conf.d
-cat > rootdir/etc/apt/auth.conf.d/myauth.conf << EOF
-machine localhost
-login username
-password usersPassword
-EOF
-
-
-testsuccessequal "Package files:
- 100 ${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status
- release a=now
- 500 http://localhost:${APTHTTPPORT} unstable/main amd64 Packages
- release a=unstable,n=sid,c=main,b=amd64
- origin localhost
-Pinned packages:" aptcache policy
-
-
-cat > rootdir/etc/apt/preferences.d/myauth.pref << EOF
-Package: *
-Pin: origin localhost
-Pin-Priority: 990
-
-Package: cool
-Pin: origin localhost
-Pin-Priority: 990
-EOF
-
-testsuccessequal "Package files:
- 100 ${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status
- release a=now
- 990 http://localhost:${APTHTTPPORT} unstable/main amd64 Packages
- release a=unstable,n=sid,c=main,b=amd64
- origin localhost
-Pinned packages:
- cool -> 1.0 with priority 990" aptcache policy
diff --git a/test/integration/test-provides-arch-all b/test/integration/test-provides-arch-all
new file mode 100755
index 000000000..f212b513c
--- /dev/null
+++ b/test/integration/test-provides-arch-all
@@ -0,0 +1,28 @@
+#!/bin/sh
+#
+# In apt 1.9.6, this test would have failed, outputting:
+# The following packages will be REMOVED:
+# libltdl-dev
+# 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
+# Remv libltdl-dev [1]
+#
+# Because we started inserting groups without packages, and then could not
+# properly insert the provides.
+
+set -e
+
+TESTDIR="$(readlink -f "$(dirname "$0")")"
+. "$TESTDIR/framework"
+setupenvironment
+configarchitecture "i386"
+
+insertinstalledpackage 'automake' 'i386' '1' 'Provides: automake-1.16
+Source: automake-1.16
+Multi-Arch: foreign'
+insertinstalledpackage 'libltdl-dev' 'i386' '1' 'Depends: automake-1.16'
+
+setupaptarchive
+
+testsuccessequal 'Reading package lists...
+Building dependency tree...
+0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget install -f -s