diff options
Diffstat (limited to 'test/integration')
-rwxr-xr-x | test/integration/test-apt-patterns | 11 | ||||
-rwxr-xr-x | test/integration/test-authentication-basic | 2 | ||||
-rwxr-xr-x | test/integration/test-kernel-helper-autoremove | 12 | ||||
-rwxr-xr-x | test/integration/test-packages-require-authorization | 61 | ||||
-rwxr-xr-x | test/integration/test-provides-arch-all | 28 |
5 files changed, 37 insertions, 77 deletions
diff --git a/test/integration/test-apt-patterns b/test/integration/test-apt-patterns index 06c552479..cdba76146 100755 --- a/test/integration/test-apt-patterns +++ b/test/integration/test-apt-patterns @@ -34,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... @@ -57,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" diff --git a/test/integration/test-authentication-basic b/test/integration/test-authentication-basic index 5aafaade0..784a00c03 100755 --- a/test/integration/test-authentication-basic +++ b/test/integration/test-authentication-basic @@ -96,6 +96,8 @@ 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 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 |