diff options
Diffstat (limited to 'test/integration')
27 files changed, 324 insertions, 37 deletions
diff --git a/test/integration/framework b/test/integration/framework index 05c8fcd2a..a424f1559 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -340,6 +340,7 @@ setupenvironment() { # ----- cd "$TMPWORKINGDIRECTORY" + echo "#x-apt-configure-index \"${SOURCEDIRECTORY}/doc/examples/configure-index\";" > aptconfig.conf mkdir rootdir aptarchive keys cd rootdir mkdir -p etc/apt/apt.conf.d etc/apt/sources.list.d etc/apt/trusted.gpg.d etc/apt/preferences.d @@ -1157,6 +1158,30 @@ setupaptarchive() { fi } +killgpgagent() { + if [ -z "${TMPWORKINGDIRECTORY}" ]; then return; fi + local GPGHOME="${TMPWORKINGDIRECTORY}/signinghome" + if [ -e "${GPGHOME}" ]; then return; fi + # ensure the agent dies quickly as different versions have different suicide heuristics + GNUPGHOME="${GPGHOME}" gpgconf --kill gpg-agent >/dev/null 2>&1 || true + rm -rf "$GPGHOME" +} +dosigning() { + local KEY="$1" + shift + local GPGHOME="${TMPWORKINGDIRECTORY}/signinghome" + if [ -n "$APT_TEST_SIGNINGHOME" ]; then + GPGHOME="$APT_TEST_SIGNINGHOME" + else + if [ ! -e "$GPGHOME" ]; then + mkdir -p --mode=700 "${GPGHOME}" + addtrap 'prefix' 'killgpgagent;' + fi + fi + testsuccess aptkey --quiet --keyring ${KEY}.pub --secret-keyring ${KEY}.sec --readonly \ + --homedir "${GPGHOME}" adv --batch --yes --digest-algo "${APT_TESTS_DIGEST_ALGO:-SHA512}" \ + "$@" +} signreleasefiles() { local SIGNERS="${1:-Joe Sixpack}" local REPODIR="${2:-aptarchive}" @@ -1177,7 +1202,7 @@ signreleasefiles() { # FIXME: This should be the full name, but we can't encode the space properly currently SIGUSERS="${SIGUSERS} -u ${SIGNER#* }" if [ "${SIGNER}" = 'Rex Expired' ]; then - # the key is expired, so gpg doesn't allow to sign with and the --faked-system-time + # the key is expired, so gpg doesn't allow one to sign with and the --faked-system-time # option doesn't exist anymore (and using faketime would add a new obscure dependency) # therefore we 'temporary' make the key not expired and restore a backup after signing cp "${REXKEY}.sec" "$SECEXPIREBAK" @@ -1208,21 +1233,20 @@ signreleasefiles() { mv "${KEY}.new.pub" "${KEY}.pub" mv "${KEY}.new.sec" "${KEY}.sec" fi - local GPG="aptkey --quiet --keyring ${KEY}.pub --secret-keyring ${KEY}.sec --readonly adv --batch --yes --digest-algo ${APT_TESTS_DIGEST_ALGO:-SHA512}" for RELEASE in $(find "${REPODIR}/" -name Release); do # we might have set a specific date for the Release file, so copy it local DATE="$(stat --format "%y" "${RELEASE}")" if [ "$APT_DONT_SIGN" = 'Release.gpg' ]; then rm -f "${RELEASE}.gpg" else - testsuccess $GPG "$@" $SIGUSERS --armor --detach-sign --sign --output "${RELEASE}.gpg" "${RELEASE}" + dosigning "$KEY" "$@" $SIGUSERS --armor --detach-sign --sign --output "${RELEASE}.gpg" "${RELEASE}" touch -d "$DATE" "${RELEASE}.gpg" fi local INRELEASE="${RELEASE%/*}/InRelease" if [ "$APT_DONT_SIGN" = 'InRelease' ]; then rm -f "$INRELEASE" else - testsuccess $GPG "$@" $SIGUSERS --clearsign --output "$INRELEASE" "$RELEASE" + dosigning "$KEY" "$@" $SIGUSERS --clearsign --output "$INRELEASE" "$RELEASE" touch -d "$DATE" "${INRELEASE}" fi done @@ -1404,12 +1428,12 @@ checkdiff() { local TMPFILE2="${TMPWORKINGDIRECTORY}/rootdir/tmp/checkdiff.2.tmp" touch "$TMPFILE1" "$TMPFILE2" if [ "$1" != '-' ]; then - sed -e '/^profiling:/ d' < "$1" >"$TMPFILE1" + sed -e '/^profiling:/ d' -e '/\.\.\.profiling:/{N;s#\.\.\.profiling:.*\n#...#g}' < "$1" >"$TMPFILE1" else TMPFILE1='-' fi if [ "$2" != '-' ]; then - sed -e '/^profiling:/ d' < "$2" >"$TMPFILE2" + sed -e '/^profiling:/ d' -e '/\.\.\.profiling:/{N;s#\.\.\.profiling:.*\n#...#g}' < "$2" >"$TMPFILE2" else TMPFILE2='-' fi diff --git a/test/integration/run-tests b/test/integration/run-tests index 7c0b74ce2..80f1fc61d 100755 --- a/test/integration/run-tests +++ b/test/integration/run-tests @@ -107,6 +107,17 @@ if [ -n "$APT_TEST_JOBS" ]; then fi exec $parallel -j "$APT_TEST_JOBS" "./$(basename "$0")" -- $(echo "$TESTLIST") fi + +APT_TEST_SIGNINGHOME="$(mktemp --directory --tmpdir 'apt-key-signinghome.XXXXXXXXXX')" +removesigninghome() { + if [ -z "$APT_TEST_SIGNINGHOME" ]; then return; fi + GNUPGHOME="${APT_TEST_SIGNINGHOME}" gpgconf --kill gpg-agent >/dev/null 2>&1 || true + rm -rf -- "$APT_TEST_SIGNINGHOME" +} +trap "exit 1" 0 HUP INT ILL ABRT FPE SEGV PIPE TERM +trap "removesigninghome" 0 QUIT +export APT_TEST_SIGNINGHOME + TOTAL="$(echo "$TESTLIST" | wc -l)" if [ "$MSGLEVEL" -le 1 ]; then printf "${CTEST}Running testcases${CRESET}: " diff --git a/test/integration/test-00-commands-have-help b/test/integration/test-00-commands-have-help index 699cdef15..2d8fa1105 100755 --- a/test/integration/test-00-commands-have-help +++ b/test/integration/test-00-commands-have-help @@ -63,3 +63,26 @@ testsuccess aptget moo moo moo testsuccess aptget moo moo moo -q=2 testsuccess aptget moo moo moo moo testsuccess aptget moo moo moo moo -q=2 + +export SOURCE_DATE_EPOCH=moo +testwarningmsg 'W: Environment variable SOURCE_DATE_EPOCH was ignored as it has an invalid value: "moo"' apt moo +testmoo() { + export SOURCE_DATE_EPOCH="$(date -d "$1" +'%s')" + testsuccess aptget moo + cp rootdir/tmp/testsuccess.output moo.output + testsuccess grep "$2" moo.output + testsuccessequal "$2" apt moo -qqq + unset SOURCE_DATE_EPOCH +} +testmoo '@0' 'Have you mooed today?' +# the year 0 is too early for 32bit architectures +testmoo '2000-12-25' 'Happy package management day!' +testmoo '1930-02-18' "It's a Bird ... It's a Plane ... It's Super Cow!" +testmoo '1966-11-07' 'Whoever needs milk, bows to the animal.' +testmoo '1988-03-29' 'Have you mooed today?' +testmoo '1993-08-16' 'Three moos for Debian!' +testmoo '1998-04-01' 'Have you smashed some milk today?' +testmoo '@1484822790' 'Have you mooed today?' +testmoo '@1484822791' 'Have you mooed today?' +testmoo '@1484822792' 'Have you mooed today?' +testmoo '@1484822793' 'Have you mooed today?' diff --git a/test/integration/test-apt-cdrom b/test/integration/test-apt-cdrom index 212f0baa4..01680c461 100755 --- a/test/integration/test-apt-cdrom +++ b/test/integration/test-apt-cdrom @@ -112,7 +112,7 @@ Conf testing:i386 (0.8.15 stable [i386])' aptget install testing:i386 -s rm -f testing_0.8.15_amd64.deb rm -f testing_0.8.15.dsc - testsuccess aptget source testing --dsc-only -d + testsuccess aptget source testing --dsc-only testsuccess test -s testing_0.8.15.dsc rm -f testing_0.8.15.dsc cd - >/dev/null diff --git a/test/integration/test-apt-cli-update b/test/integration/test-apt-cli-update index b423072c3..cc8d051d2 100755 --- a/test/integration/test-apt-cli-update +++ b/test/integration/test-apt-cli-update @@ -15,6 +15,7 @@ setupaptarchive --no-update testfailuremsg 'E: The update command takes no arguments' apt update arguments +testempty apt update -qq -o pkgCacheFile::Generate=false testsuccessequal "1 package can be upgraded. Run 'apt list --upgradable' to see it." apt update -qq cp dpkg.status rootdir/var/lib/dpkg/status diff --git a/test/integration/test-apt-ftparchive-by-hash b/test/integration/test-apt-ftparchive-by-hash index 75fb0cf2c..ccfc62734 100755 --- a/test/integration/test-apt-ftparchive-by-hash +++ b/test/integration/test-apt-ftparchive-by-hash @@ -23,7 +23,7 @@ confighashes 'SHA256' 'SHA512' # enable by-hash in apt-ftparchive echo 'APT::FTPArchive::DoByHash "1";' >> aptconfig.conf -# build one pacakge +# build one package buildsimplenativepackage 'foo' 'i386' '1' 'unstable' buildaptarchivefromincoming diff --git a/test/integration/test-apt-ftparchive-cachedb b/test/integration/test-apt-ftparchive-cachedb index 1a06ff343..73d762cc8 100755 --- a/test/integration/test-apt-ftparchive-cachedb +++ b/test/integration/test-apt-ftparchive-cachedb @@ -64,7 +64,7 @@ Tree "dists/test" { }; EOF -# build one pacakge +# build one package buildsimplenativepackage 'foo' 'i386' '1' 'test' mv incoming/* aptarchive/pool/main/ diff --git a/test/integration/test-apt-ftparchive-cachedb-lp1274466 b/test/integration/test-apt-ftparchive-cachedb-lp1274466 index 3a5527230..b0bcae8ec 100755 --- a/test/integration/test-apt-ftparchive-cachedb-lp1274466 +++ b/test/integration/test-apt-ftparchive-cachedb-lp1274466 @@ -16,7 +16,7 @@ if command -v db_dump-5 >/dev/null 2>&1; then db_dump=db_dump-5 fi -# gather the db and the deb, ensure mtime is not modfied as its saved in the DB +# gather the db and the deb, ensure mtime is not modified as its saved in the DB cp -p "$TESTDIR/deb-lp1274466-cachedb.deb" foo_1_i386.deb cp -p "$TESTDIR/cachedb-lp1274466-old-format.db" old-format.db diff --git a/test/integration/test-apt-get-autoremove b/test/integration/test-apt-get-autoremove index 8af864acb..6f3452fbd 100755 --- a/test/integration/test-apt-get-autoremove +++ b/test/integration/test-apt-get-autoremove @@ -46,6 +46,47 @@ Reading state information... 1 package was automatically installed and is no longer required. Use '$AUTOREMOVE' to remove it. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s -o APT::Get::HideAutoRemove=small +testequal "Reading package lists... +Building dependency tree... +Reading state information... +Calculating upgrade... +The following package was automatically installed and is no longer required: + po-debconf +Use '$AUTOREMOVE' to remove it. +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget upgrade -s +testsuccessequal 'Reading package lists... +Building dependency tree... +Reading state information... +The following packages will be REMOVED: + po-debconf +0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. +Remv po-debconf [1.0.16]' aptget install -s --autoremove +testsuccessequal 'Reading package lists... +Building dependency tree... +Reading state information... +Calculating upgrade... +The following packages will be REMOVED: + po-debconf +0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. +Remv po-debconf [1.0.16]' aptget upgrade -s --autoremove +echo 'APT::Get::AutomaticRemove "true";' > rootdir/etc/apt/apt.conf.d/autoremoval +testsuccessequal 'Reading package lists... +Building dependency tree... +Reading state information... +The following packages will be REMOVED: + po-debconf +0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. +Remv po-debconf [1.0.16]' aptget install -s +testequal "Reading package lists... +Building dependency tree... +Reading state information... +Calculating upgrade... +The following package was automatically installed and is no longer required: + po-debconf +Use '$AUTOREMOVE' to remove it. +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget upgrade -s +rm -f rootdir/etc/apt/apt.conf.d/autoremoval + testdpkginstalled 'po-debconf' echo 'APT::NeverAutoRemove { "^po-debconf$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove diff --git a/test/integration/test-apt-get-build-dep b/test/integration/test-apt-get-build-dep index 6a3a2b6c2..403de8f35 100755 --- a/test/integration/test-apt-get-build-dep +++ b/test/integration/test-apt-get-build-dep @@ -8,6 +8,7 @@ setupenvironment configarchitecture 'i386' insertpackage 'stable' 'build-essential' 'i386' '1' +insertpackage 'stable' 'build-essential2' 'i386' '1' insertpackage 'stable' 'build-depends' 'i386' '1' insertpackage 'stable' 'build-depends-arch' 'i386' '1' insertpackage 'stable' 'build-depends-indep' 'i386' '1' @@ -56,6 +57,67 @@ testsuccessequal "Note, using file './foobar.dsc' to get the build dependencies Reading package lists... Building dependency tree... The following packages will be REMOVED: + build-conflicts build-conflicts-arch build-conflicts-indep +The following NEW packages will be installed: + build-depends build-depends-arch build-depends-indep build-essential2 +0 upgraded, 4 newly installed, 3 to remove and 0 not upgraded. +Remv build-conflicts [1] +Remv build-conflicts-arch [1] +Remv build-conflicts-indep [1] +Inst build-depends (1 stable [i386]) +Inst build-depends-arch (1 stable [i386]) +Inst build-depends-indep (1 stable [i386]) +Inst build-essential2 (1 stable [i386]) +Conf build-depends (1 stable [i386]) +Conf build-depends-arch (1 stable [i386]) +Conf build-depends-indep (1 stable [i386]) +Conf build-essential2 (1 stable [i386])" aptget build-dep --simulate ./foobar.dsc -o APT::Build-Essential="build-essential2" + +testsuccessequal "Note, using file './foobar.dsc' to get the build dependencies +Reading package lists... +Building dependency tree... +The following packages will be REMOVED: + build-conflicts build-conflicts-arch build-conflicts-indep +The following NEW packages will be installed: + build-depends build-depends-arch build-depends-indep +0 upgraded, 3 newly installed, 3 to remove and 0 not upgraded. +Remv build-conflicts [1] +Remv build-conflicts-arch [1] +Remv build-conflicts-indep [1] +Inst build-depends (1 stable [i386]) +Inst build-depends-arch (1 stable [i386]) +Inst build-depends-indep (1 stable [i386]) +Conf build-depends (1 stable [i386]) +Conf build-depends-arch (1 stable [i386]) +Conf build-depends-indep (1 stable [i386])" aptget build-dep --simulate ./foobar.dsc -o APT::Build-Essential="," + +testsuccessequal "Note, using file './foobar.dsc' to get the build dependencies +Reading package lists... +Building dependency tree... +The following packages will be REMOVED: + build-conflicts build-conflicts-arch build-conflicts-indep +The following NEW packages will be installed: + build-depends build-depends-arch build-depends-indep build-essential + build-essential2 +0 upgraded, 5 newly installed, 3 to remove and 0 not upgraded. +Remv build-conflicts [1] +Remv build-conflicts-arch [1] +Remv build-conflicts-indep [1] +Inst build-depends (1 stable [i386]) +Inst build-depends-arch (1 stable [i386]) +Inst build-depends-indep (1 stable [i386]) +Inst build-essential (1 stable [i386]) +Inst build-essential2 (1 stable [i386]) +Conf build-depends (1 stable [i386]) +Conf build-depends-arch (1 stable [i386]) +Conf build-depends-indep (1 stable [i386]) +Conf build-essential (1 stable [i386]) +Conf build-essential2 (1 stable [i386])" aptget build-dep --simulate ./foobar.dsc -o APT::Build-Essential::="build-essential2" + +testsuccessequal "Note, using file './foobar.dsc' to get the build dependencies +Reading package lists... +Building dependency tree... +The following packages will be REMOVED: build-conflicts build-conflicts-arch The following NEW packages will be installed: build-depends build-depends-arch build-essential @@ -68,3 +130,20 @@ Inst build-essential (1 stable [i386]) Conf build-depends (1 stable [i386]) Conf build-depends-arch (1 stable [i386]) Conf build-essential (1 stable [i386])" aptget build-dep --simulate ./foobar.dsc --arch-only + +testsuccessequal "Note, using file './foobar.dsc' to get the build dependencies +Reading package lists... +Building dependency tree... +The following packages will be REMOVED: + build-conflicts build-conflicts-indep +The following NEW packages will be installed: + build-depends build-depends-indep build-essential +0 upgraded, 3 newly installed, 2 to remove and 0 not upgraded. +Remv build-conflicts [1] +Remv build-conflicts-indep [1] +Inst build-depends (1 stable [i386]) +Inst build-depends-indep (1 stable [i386]) +Inst build-essential (1 stable [i386]) +Conf build-depends (1 stable [i386]) +Conf build-depends-indep (1 stable [i386]) +Conf build-essential (1 stable [i386])" aptget build-dep --simulate ./foobar.dsc --indep-only diff --git a/test/integration/test-apt-get-build-dep-file b/test/integration/test-apt-get-build-dep-file index ed850fa40..07de8bb30 100755 --- a/test/integration/test-apt-get-build-dep-file +++ b/test/integration/test-apt-get-build-dep-file @@ -39,7 +39,8 @@ Files: EOF test2vcardbuilddep() { - testsuccessequal "Note, using file './2vcard_0.5-3.dsc' to get the build dependencies + local name="$1" + testsuccessequal "Note, using file './$name' to get the build dependencies Reading package lists... Building dependency tree... The following packages will be REMOVED: @@ -51,14 +52,16 @@ Remv build-conflict [1] Inst build-essential (1 stable [i386]) Inst debhelper (7 stable [i386]) Conf build-essential (1 stable [i386]) -Conf debhelper (7 stable [i386])" aptget build-dep -s ./2vcard_0.5-3.dsc -testfailure aptget build-dep --simulate 2vcard_0.5-3.dsc +Conf debhelper (7 stable [i386])" aptget build-dep -s ./$name +testfailure aptget build-dep --simulate $name cd downloaded -testsuccess aptget build-dep --simulate ../2vcard_0.5-3.dsc -testsuccess aptget build-dep --simulate "$(readlink -f ../2vcard_0.5-3.dsc)" +testsuccess aptget build-dep --simulate ../$name +testsuccess aptget build-dep --simulate "$(readlink -f ../$name)" cd .. } -test2vcardbuilddep +test2vcardbuilddep "2vcard_0.5-3.dsc" +cp "2vcard_0.5-3.dsc" "2VCard_0.5-3.dsc" +test2vcardbuilddep "2VCard_0.5-3.dsc" msgmsg 'Test with' 'signed dsc' cat > 2vcard_0.5-3.dsc <<EOF @@ -93,7 +96,9 @@ z2UAn1oXgTai6opwhVfkxrlmJ+iRxzuc =4eRd -----END PGP SIGNATURE----- EOF -test2vcardbuilddep +test2vcardbuilddep "2vcard_0.5-3.dsc" +cp "2vcard_0.5-3.dsc" "2VCard_0.5-3.dsc" +test2vcardbuilddep "2VCard_0.5-3.dsc" msgmsg 'Test with' 'unpacked source dir' diff --git a/test/integration/test-apt-keep-downloaded-pkgs b/test/integration/test-apt-keep-downloaded-pkgs index 4cc7fbb04..c5f62954c 100755 --- a/test/integration/test-apt-keep-downloaded-pkgs +++ b/test/integration/test-apt-keep-downloaded-pkgs @@ -15,14 +15,25 @@ buildsimplenativepackage 'pkg4' 'all' '1.0' 'stable' # local (file) installs setupaptarchive +# a file:// "download" is not a real download and hence passes +testsuccess aptget install pkg1 --no-download --download-only -y +testfailure test -f rootdir/var/cache/apt/archives/pkg1_1.0_all.deb +testsuccess test -f aptarchive/pool/pkg1_1.0_all.deb + # ensure that install from local sources does not remove debs testsuccess aptget install pkg1 -o APT::Keep-Downloaded-Packages=false testsuccess test -f aptarchive/pool/pkg1_1.0_all.deb +testfailure test -f rootdir/var/cache/apt/archives/pkg1_1.0_all.deb # now switch to http and downloading debs changetowebserver testsuccess aptget update +# see if no-download really doesn't download the package +testfailuremsg 'E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?' aptget install pkg2 --no-download -y +testsuccess test -f aptarchive/pool/pkg2_1.0_all.deb +testfailure test -f rootdir/var/cache/apt/archives/pkg2_1.0_all.deb + # ensure that the downloaded pkg is kept with "keep=true" testsuccess aptget install pkg2 -o APT::Keep-Downloaded-Packages=true testsuccess test -f aptarchive/pool/pkg2_1.0_all.deb @@ -40,4 +51,4 @@ testfailure test -f rootdir/var/cache/apt/archives/pkg3_1.0_all.deb # ensure that install from the download dir does not delete packages mv aptarchive/pool/pkg4_1.0_all.deb rootdir/var/cache/apt/archives testsuccess aptget install $(pwd)/rootdir/var/cache/apt/archives/pkg4_1.0_all.deb -o APT::Keep-Downloaded-Packages=false -testsuccess test -f $(pwd)/rootdir/var/cache/apt/archives/pkg4_1.0_all.deb
\ No newline at end of file +testsuccess test -f $(pwd)/rootdir/var/cache/apt/archives/pkg4_1.0_all.deb diff --git a/test/integration/test-apt-source-and-build-dep b/test/integration/test-apt-source-and-build-dep index 5fa87d57d..7f7457217 100755 --- a/test/integration/test-apt-source-and-build-dep +++ b/test/integration/test-apt-source-and-build-dep @@ -28,7 +28,7 @@ insertsource 'stable' 'foo' 'all' '0.5' insertpackage 'stable' 'foo' 'all' '1.0' insertsource 'stable' 'foo' 'all' '1.0' -# this packages exists only as sources, add two versions to ensure that +# these packages exists only as sources, add two versions to ensure that # apt will pick the higher version number (bts #731853) insertsource 'wheezy' 'foo' 'all' '0.0.1' insertsource 'wheezy' 'foo' 'all' '0.1' diff --git a/test/integration/test-apt-update-expected-size b/test/integration/test-apt-update-expected-size index f7b825d98..710d05d18 100755 --- a/test/integration/test-apt-update-expected-size +++ b/test/integration/test-apt-update-expected-size @@ -25,6 +25,7 @@ test_inreleasetoobig() { rm -f update.output # ensure the failed InRelease file got renamed testsuccess ls rootdir/var/lib/apt/lists/partial/*InRelease.FAILED + testfailure test -e rootdir/var/lib/apt/lists/partial/Old.FAILED } test_packagestoobig() { @@ -40,6 +41,8 @@ test_packagestoobig() { NEW_SIZE="$(stat --printf=%s aptarchive/dists/unstable/main/binary-i386/Packages.gz)" testfailuremsg "E: Failed to fetch ${1}/dists/unstable/main/binary-i386/Packages.gz Writing more data than expected ($NEW_SIZE > $SIZE) E: Some index files failed to download. They have been ignored, or old ones used instead." aptget update -o Debug::pkgAcquire::Worker=1 -o Debug::Acquire::Transaction=0 + testsuccess ls rootdir/var/lib/apt/lists/partial/*Packages*.FAILED + testfailure test -e rootdir/var/lib/apt/lists/partial/Old.FAILED } methodtest() { @@ -51,6 +54,7 @@ methodtest() { rm -rf rootdir/var/lib/apt/lists rootdir/var/lib/apt/lists.good # normal update works fine testsuccess aptget update + touch rootdir/var/lib/apt/lists/partial/Old.FAILED mv rootdir/var/lib/apt/lists rootdir/var/lib/apt/lists.good # starting fresh works diff --git a/test/integration/test-bug-632221-cross-dependency-satisfaction b/test/integration/test-bug-632221-cross-dependency-satisfaction index 066e29d99..d52652cad 100755 --- a/test/integration/test-bug-632221-cross-dependency-satisfaction +++ b/test/integration/test-bug-632221-cross-dependency-satisfaction @@ -21,7 +21,7 @@ insertpackage 'unstable' 'foreigner' 'amd64,armel' '1.0' 'Multi-Arch: foreign' insertpackage 'unstable' 'arm-stuff' 'armel' '1.0' insertpackage 'unstable' 'linux-stuff' 'amd64,armel' '1.0' -insertsource 'unstable' 'apt' 'any' '0.8.15' 'Build-Depends: doxygen, libc6-dev, libc6-dev:native, cool:any, amdboot:amd64, foreigner, libfwibble-dev, arm-stuff [any-armel] | linux-stuff [ linux-any]' +insertsource 'unstable' 'apt' 'any' '0.8.15' 'Build-Depends: doxygen, libc6-dev, libc6-dev:native, cool:any, amdboot:amd64, foreigner, libfwibble-dev, arm-stuff [eabi-any-any-arm gnueabi-any-arm] | linux-stuff [ linux-any]' insertsource 'unstable' 'forbidden-no' 'any' '1' 'Build-Depends: amdboot:any' insertsource 'unstable' 'forbidden-same' 'any' '1' 'Build-Depends: libc6:any' diff --git a/test/integration/test-bug-686346-package-missing-architecture b/test/integration/test-bug-686346-package-missing-architecture index 8f9536a09..d28600a4f 100755 --- a/test/integration/test-bug-686346-package-missing-architecture +++ b/test/integration/test-bug-686346-package-missing-architecture @@ -69,7 +69,7 @@ insertinstalledpackage 'pkgb' 'amd64' '2' testequalor2 "Reading package lists... Building dependency tree... Reading state information... -You might want to run 'apt-get -f install' to correct these. +You might want to run 'apt --fix-broken install' to correct these. The following packages have unmet dependencies: pkgb : Conflicts: pkgb:none but 1 is installed pkgb:none : Conflicts: pkgb but 2 is installed @@ -77,10 +77,10 @@ The following packages have unmet dependencies: Conflicts: pkgb but 2 is installed pkgg : Conflicts: pkgb but 2 is installed Conflicts: pkgb:none but 1 is installed -E: Unmet dependencies. Try using -f." "Reading package lists... +E: Unmet dependencies. Try using --fix-broken." "Reading package lists... Building dependency tree... Reading state information... -You might want to run 'apt-get -f install' to correct these. +You might want to run 'apt --fix-broken install' to correct these. The following packages have unmet dependencies: pkgb : Conflicts: pkgb:none but 1 is installed pkgb:none : Conflicts: pkgb but 2 is installed @@ -88,7 +88,7 @@ The following packages have unmet dependencies: Conflicts: pkgb:none but 1 is installed pkgg : Conflicts: pkgb but 2 is installed Conflicts: pkgb:none but 1 is installed -E: Unmet dependencies. Try using -f." aptget check +E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution)." aptget check # check that dependencies are generated for none-packages rm rootdir/var/lib/dpkg/status diff --git a/test/integration/test-bug-738785-switch-protocol b/test/integration/test-bug-738785-switch-protocol index 690e8727e..471d12e53 100755 --- a/test/integration/test-bug-738785-switch-protocol +++ b/test/integration/test-bug-738785-switch-protocol @@ -47,4 +47,4 @@ cd - >/dev/null # check that downgrades from https to http are not allowed webserverconfig 'aptwebserver::support::http' 'true' sed -i -e "s#:${APTHTTPPORT}/redirectme#:${APTHTTPSPORT}/downgrademe#" -e 's# http:# https:#' rootdir/etc/apt/sources.list.d/* -testfailure aptget update --allow-insecure-repositories -o Acquire::https::Timeout=1 +testfailure aptget update --allow-insecure-repositories -o Acquire::https::Timeout=1 -o Debug::pkgAcquire::Worker=1 -o Debug::Acquire::https=1 diff --git a/test/integration/test-bug-770291-reinstall b/test/integration/test-bug-770291-reinstall index 389fb1814..a1caf25f8 100755 --- a/test/integration/test-bug-770291-reinstall +++ b/test/integration/test-bug-770291-reinstall @@ -56,7 +56,7 @@ Conf dependsb (1 unstable [i386]) Conf dependsa (1 unstable [i386])' aptget install --reinstall dependsa dependsb -s # there is a chance dpkg can actually do these, BUT this depends on the maintainerscripts (not) present -# which is very very risky to depend on (and apt doesn't know about that anyhow). +# which is very risky to depend on (and apt doesn't know about that anyhow). testfailure aptget install --reinstall predependsa predependsb -s -o Debug::pkgPackageManager=1 testsuccess grep "^E: Couldn't configure predependsa:i386, probably a dependency cycle.$" rootdir/tmp/testfailure.output @@ -89,7 +89,7 @@ Conf dependsb (1 unstable [i386]) Conf dependsa (1 unstable [i386])' aptget install dependsa dependsb -s # there is a chance dpkg can actually do these, BUT this depends on the maintainerscripts (not) present -# which is very very risky to depend on (and apt doesn't know about that anyhow). +# which is very risky to depend on (and apt doesn't know about that anyhow). testfailure aptget install predependsa predependsb -s -o Debug::pkgPackageManager=1 testsuccess grep "^E: Couldn't configure predependsa:i386, probably a dependency cycle.$" rootdir/tmp/testfailure.output diff --git a/test/integration/test-bug-lp1694697-build-dep-architecture-limited-alternative b/test/integration/test-bug-lp1694697-build-dep-architecture-limited-alternative new file mode 100755 index 000000000..7f8e4ad3d --- /dev/null +++ b/test/integration/test-bug-lp1694697-build-dep-architecture-limited-alternative @@ -0,0 +1,58 @@ +#!/bin/sh +set -e + +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" + +setupenvironment +configarchitecture 'i386' + + +insertpackage 'stable' 'build-depends' 'i386' '1' +insertpackage 'stable' 'foo' 'i386' '1' +insertinstalledpackage 'build-essential' 'i386' '1' + +setupaptarchive + +# This used to be interpreted as build-depends | foo +cat > foobar.dsc <<EOF +Format: 3.0 (native) +Source: foobar +Binary: foobar +Architecture: all +Version: 1 +Maintainer: Joe Sixpack <joe@example.org> +Build-Depends: build-depends [i386] | build-depends [amd64], foo +Standards-Version: 3.9.8 +EOF +testsuccessequal "Note, using file './foobar.dsc' to get the build dependencies +Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + build-depends foo +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst build-depends (1 stable [i386]) +Inst foo (1 stable [i386]) +Conf build-depends (1 stable [i386]) +Conf foo (1 stable [i386])" aptget build-dep --simulate ./foobar.dsc + + +# This caused a segmentation fault +cat > foobar.dsc <<EOF +Format: 3.0 (native) +Source: foobar +Binary: foobar +Architecture: all +Version: 1 +Maintainer: Joe Sixpack <joe@example.org> +Build-Depends: build-depends [i386] | build-depends [amd64] +Standards-Version: 3.9.8 +EOF +testsuccessequal "Note, using file './foobar.dsc' to get the build dependencies +Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + build-depends +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst build-depends (1 stable [i386]) +Conf build-depends (1 stable [i386])" aptget build-dep --simulate ./foobar.dsc diff --git a/test/integration/test-cve-2013-1051-InRelease-parsing b/test/integration/test-cve-2013-1051-InRelease-parsing index 3cc012e35..6238057c3 100755 --- a/test/integration/test-cve-2013-1051-InRelease-parsing +++ b/test/integration/test-cve-2013-1051-InRelease-parsing @@ -45,8 +45,10 @@ touch -d '+1hour' aptarchive/dists/stable/InRelease # part of the InRelease listcurrentlistsdirectory | sed '/_InRelease/ d' > listsdir.lst msgtest 'apt-get update should ignore unsigned data in the' 'InRelease' -testsuccessequal "Get:1 http://localhost:${APTHTTPPORT} stable InRelease [$(stat -c%s aptarchive/dists/stable/InRelease) B] -Reading package lists..." --nomsg aptget update +testwarningequal "Get:1 http://localhost:${APTHTTPPORT} stable InRelease [$(stat -c%s aptarchive/dists/stable/InRelease) B] +Reading package lists... +W: Clearsigned file '${TMPWORKINGDIRECTORY}/rootdir/var/lib/apt/lists/partial/localhost:${APTHTTPPORT}_dists_stable_InRelease' contains unsigned lines. +W: Clearsigned file '${TMPWORKINGDIRECTORY}/rootdir/var/lib/apt/lists/localhost:${APTHTTPPORT}_dists_stable_InRelease' contains unsigned lines." --nomsg aptget update testfileequal './listsdir.lst' "$(listcurrentlistsdirectory | sed '/_InRelease/ d')" # ensure there is no package diff --git a/test/integration/test-external-dependency-solver-protocol b/test/integration/test-external-dependency-solver-protocol index d126cd84b..2c451d5f9 100755 --- a/test/integration/test-external-dependency-solver-protocol +++ b/test/integration/test-external-dependency-solver-protocol @@ -148,7 +148,16 @@ testsuccess aptget upgrade -s --solver apt testfailure aptget install awesome badstuff -s testfailure aptget install awesome badstuff -s --solver apt testsuccess grep 'ERR_UNSOLVABLE' rootdir/tmp/testfailure.output - +msgtest 'A resolving error is format as' 'valid parseable EDSP error' +if dpkg-checkbuilddeps -d 'dctrl-tools' /dev/null >/dev/null 2>&1; then + if apthelper cat-file rootdir/var/log/apt/edsp.last.xz | aptinternalsolver > solver.result 2>&1; then + testsuccess --nomsg grep-dctrl -FError ERR -- solver.result + else + msgfail + fi +else + msgskip 'dctrl-tools not installed' +fi configarchitecture 'armel' testfailure aptget install --solver apt awesomecoolstuff:i386 -s msgtest 'An invalid EDSP file generates a' 'hard error' diff --git a/test/integration/test-parse-all-archs-into-cache b/test/integration/test-parse-all-archs-into-cache index 65222f0fe..7485431db 100755 --- a/test/integration/test-parse-all-archs-into-cache +++ b/test/integration/test-parse-all-archs-into-cache @@ -22,10 +22,10 @@ setupaptarchive testfailureequal "Reading package lists... Building dependency tree... -You might want to run 'apt-get -f install' to correct these. +You might want to run 'apt --fix-broken install' to correct these. The following packages have unmet dependencies: foo:amd64 : Depends: libfoo1:amd64 but it is not installable -E: Unmet dependencies. Try using -f." aptget check -s +E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution)." aptget check -s insertinstalledpackage 'libfoo1' 'amd64' '1' 'Multi-Arch: same' diff --git a/test/integration/test-pdiff-usage b/test/integration/test-pdiff-usage index 59a3fd8af..430551fa4 100755 --- a/test/integration/test-pdiff-usage +++ b/test/integration/test-pdiff-usage @@ -210,7 +210,7 @@ Filename: pool/futurestuff_1.0_i386.deb Size: 202200 SHA256: b46fd154615edaae5ba33c56a5cc0e7deaef23e2da3e4f129727fd660f28f050 Description: some cool and shiny future stuff - This package will appear in the next next mirror update + This package will appear in the next^2 mirror update Description-md5: d5f89fbbc2ce34c455dfee9b67d82b6b' >> aptarchive/Packages compressfile 'aptarchive/Packages' diff --git a/test/integration/test-releasefile-valid-until b/test/integration/test-releasefile-valid-until index f64c6329d..b18dde2b6 100755 --- a/test/integration/test-releasefile-valid-until +++ b/test/integration/test-releasefile-valid-until @@ -48,7 +48,7 @@ runtest 'rejected' 'bad Max-Valid (bad Until, bad Min-Valid) <' 'now - 7 days' ' runtest 'rejected' 'bad Max-Valid (bad Until, bad Min-Valid) >' 'now - 7 days' 'now - 2 days' -o Acquire::Max-ValidTime=12096 -o Acquire::Min-ValidTime=241920 sed -i -e 's#\(deb\(-src\)\?\) #\1 [check-valid-until=no] #' rootdir/etc/apt/sources.list.d/* -runtest 'accepted' 'bad Until but overriden by sources option' 'now - 7 days' 'now - 4 days' +runtest 'accepted' 'bad Until but overridden by sources option' 'now - 7 days' 'now - 4 days' sed -i -e 's#\(deb\(-src\)\?\) \[check-valid-until=no\] #\1 [valid-until-max=86400] #' rootdir/etc/apt/sources.list.d/* runtest 'rejected' 'bad Max-Valid (good Until) via sources option' 'now - 7 days' 'now + 4 days' diff --git a/test/integration/test-releasefile-verification b/test/integration/test-releasefile-verification index e043fa8b5..36a90f9d5 100755 --- a/test/integration/test-releasefile-verification +++ b/test/integration/test-releasefile-verification @@ -383,7 +383,7 @@ runtest3() { done } -# diable some protection by default and ensure we still do the verification +# disable some protection by default and ensure we still do the verification # correctly cat > rootdir/etc/apt/apt.conf.d/weaken-security <<EOF Acquire::AllowInsecureRepositories "1"; diff --git a/test/integration/test-sourceslist-trusted-options b/test/integration/test-sourceslist-trusted-options index 94de11ef7..1eee3b09a 100755 --- a/test/integration/test-sourceslist-trusted-options +++ b/test/integration/test-sourceslist-trusted-options @@ -26,7 +26,7 @@ foo/stable 1 amd64 testsuccess test -s foo_1_amd64.deb -o -s foo_2_amd64.deb rm -f foo_1.dsc foo_2.dsc - testsuccess aptget source foo --dsc-only -d "$@" + testsuccess aptget source foo --dsc-only "$@" testsuccess test -s foo_1.dsc -o -s foo_2.dsc cd - >/dev/null } @@ -48,7 +48,7 @@ E: Some packages could not be authenticated' testfailure test -s foo_1_amd64.deb -o -s foo_2_amd64.deb rm -f foo_1.dsc foo_2.dsc - testfailure aptget source foo --dsc-only -d "$@" + testfailure aptget source foo --dsc-only "$@" testequal "$WARNING" tail -n 3 ../rootdir/tmp/testfailure.output testfailure test -s foo_1.dsc -o -s foo_2.dsc cd - >/dev/null diff --git a/test/integration/test-ubuntu-bug-1651923-requote-https-uri b/test/integration/test-ubuntu-bug-1651923-requote-https-uri new file mode 100755 index 000000000..cf56a6af4 --- /dev/null +++ b/test/integration/test-ubuntu-bug-1651923-requote-https-uri @@ -0,0 +1,19 @@ +#!/bin/sh +set -e + +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" + +setupenvironment +configarchitecture "i386" + +mkdir "aptarchive/target with space" +echo 'alright' > "aptarchive/target with space/working" +changetohttpswebserver +webserverconfig 'aptwebserver::redirect::replace::/targetwithoutspace/' '/target%20with%20space/' +webserverconfig 'aptwebserver::redirect::replace::/targetwithoutspace2/' '/target with space/' + +testsuccess downloadfile "http://localhost:${APTHTTPPORT}/targetwithoutspace/working" httpfile1 +testsuccess downloadfile "http://localhost:${APTHTTPPORT}/targetwithoutspace2/working" httpfile2 +testsuccess downloadfile "https://localhost:${APTHTTPSPORT}/targetwithoutspace/working" httpsfile1 +testsuccess downloadfile "https://localhost:${APTHTTPSPORT}/targetwithoutspace2/working" httpsfile2 |