diff options
Diffstat (limited to 'test')
-rwxr-xr-x | test/integration/skip-aptwebserver | 25 | ||||
-rwxr-xr-x | test/integration/test-apt-get-changelog | 3 | ||||
-rwxr-xr-x | test/integration/test-bug-666772-multiarch-arch-all-build-deps | 118 | ||||
-rwxr-xr-x | test/integration/test-bug-683786-build-dep-on-virtual-packages | 10 | ||||
-rwxr-xr-x | test/integration/test-kernel-helper-autoremove | 55 | ||||
-rw-r--r-- | test/integration/test-kernel-helper-autoremove.fake-dpkg | 13 |
6 files changed, 220 insertions, 4 deletions
diff --git a/test/integration/skip-aptwebserver b/test/integration/skip-aptwebserver new file mode 100755 index 000000000..0622941ce --- /dev/null +++ b/test/integration/skip-aptwebserver @@ -0,0 +1,25 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework + +setupenvironment +configarchitecture 'amd64' + +buildsimplenativepackage 'apt' 'all' '1.0' 'stable' + +setupaptarchive +changetowebserver + +rm -rf rootdir/var/lib/apt/lists +aptget update -qq +testequal 'Hit http://localhost stable InRelease +Hit http://localhost stable/main Sources +Hit http://localhost stable/main amd64 Packages +Hit http://localhost stable/main Translation-en +Reading package lists...' aptget update + +mv rootdir/var/lib/apt/lists/localhost* rootdir/var/lib/apt/lists/partial +aptget update + diff --git a/test/integration/test-apt-get-changelog b/test/integration/test-apt-get-changelog index d013cc458..53210ea06 100755 --- a/test/integration/test-apt-get-changelog +++ b/test/integration/test-apt-get-changelog @@ -36,4 +36,5 @@ aptget changelog apt -d -qq testfileequal 'apt.changelog' "$(cat aptarchive/pool/apt_1.0.changelog)" rm apt.changelog aptarchive/pool/apt_1.0.changelog -testequal 'E: changelog download failed' aptget changelog apt -qq -o APT::Changelogs::Server='http://not-on-the-main-server:8080/' +# note that this output is different on ubuntu and debian +testequal 'E: changelog for this version is not (yet) available; try https://launchpad.net/ubuntu/+source/apt/+changelog' aptget changelog apt -qq -o APT::Changelogs::Server='http://not-on-the-main-server:8080/' diff --git a/test/integration/test-bug-666772-multiarch-arch-all-build-deps b/test/integration/test-bug-666772-multiarch-arch-all-build-deps new file mode 100755 index 000000000..cfae1fef3 --- /dev/null +++ b/test/integration/test-bug-666772-multiarch-arch-all-build-deps @@ -0,0 +1,118 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' 'armhf' + +insertinstalledpackage 'build-essential' 'all' '11.5' + +insertpackage 'unstable' 'doxygen' 'all' '1.0' 'Depends: language-support, language-tool' +insertpackage 'unstable' 'libc6' 'amd64,armhf' '1.0' 'Multi-Arch: same' +insertpackage 'unstable' 'libc6-dev' 'amd64,armhf' '1.0' 'Depends: libc6 +Multi-Arch: same' +insertpackage 'unstable' 'language-support' 'amd64,armhf' '1.0' 'Multi-Arch: foreign' +insertpackage 'unstable' 'language-tool' 'amd64,armhf' '1.0' + +insertsource 'unstable' 'apt' 'any' '0.8.15' 'Build-Depends: doxygen, libc6-dev' + +setupaptarchive + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + doxygen language-support language-tool libc6 libc6-dev +0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded. +Inst language-support (1.0 unstable [amd64]) +Inst language-tool (1.0 unstable [amd64]) +Inst doxygen (1.0 unstable [all]) +Inst libc6 (1.0 unstable [amd64]) +Inst libc6-dev (1.0 unstable [amd64]) +Conf language-support (1.0 unstable [amd64]) +Conf language-tool (1.0 unstable [amd64]) +Conf doxygen (1.0 unstable [all]) +Conf libc6 (1.0 unstable [amd64]) +Conf libc6-dev (1.0 unstable [amd64])' aptget build-dep apt -s + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + doxygen language-support language-tool libc6:armhf libc6-dev:armhf +0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded. +Inst language-support (1.0 unstable [amd64]) +Inst language-tool (1.0 unstable [amd64]) +Inst doxygen (1.0 unstable [all]) +Inst libc6:armhf (1.0 unstable [armhf]) +Inst libc6-dev:armhf (1.0 unstable [armhf]) +Conf language-support (1.0 unstable [amd64]) +Conf language-tool (1.0 unstable [amd64]) +Conf doxygen (1.0 unstable [all]) +Conf libc6:armhf (1.0 unstable [armhf]) +Conf libc6-dev:armhf (1.0 unstable [armhf])' aptget build-dep apt -s -a armhf + +configarchitecture 'armhf' 'amd64' + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + doxygen language-support language-tool libc6 libc6-dev +0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded. +Inst language-support (1.0 unstable [armhf]) +Inst language-tool (1.0 unstable [armhf]) +Inst doxygen (1.0 unstable [all]) +Inst libc6 (1.0 unstable [armhf]) +Inst libc6-dev (1.0 unstable [armhf]) +Conf language-support (1.0 unstable [armhf]) +Conf language-tool (1.0 unstable [armhf]) +Conf doxygen (1.0 unstable [all]) +Conf libc6 (1.0 unstable [armhf]) +Conf libc6-dev (1.0 unstable [armhf])' aptget build-dep apt -s + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + doxygen language-support language-tool libc6:amd64 libc6-dev:amd64 +0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded. +Inst language-support (1.0 unstable [armhf]) +Inst language-tool (1.0 unstable [armhf]) +Inst doxygen (1.0 unstable [all]) +Inst libc6:amd64 (1.0 unstable [amd64]) +Inst libc6-dev:amd64 (1.0 unstable [amd64]) +Conf language-support (1.0 unstable [armhf]) +Conf language-tool (1.0 unstable [armhf]) +Conf doxygen (1.0 unstable [all]) +Conf libc6:amd64 (1.0 unstable [amd64]) +Conf libc6-dev:amd64 (1.0 unstable [amd64])' aptget build-dep apt -s -a amd64 + +configarchitecture 'amd64' 'armhf' + +insertinstalledpackage 'language-support' 'armhf' '0.5' 'Multi-Arch: foreign' + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + doxygen language-tool libc6 libc6-dev +0 upgraded, 4 newly installed, 0 to remove and 1 not upgraded. +Inst language-tool (1.0 unstable [amd64]) +Inst doxygen (1.0 unstable [all]) +Inst libc6 (1.0 unstable [amd64]) +Inst libc6-dev (1.0 unstable [amd64]) +Conf language-tool (1.0 unstable [amd64]) +Conf doxygen (1.0 unstable [all]) +Conf libc6 (1.0 unstable [amd64]) +Conf libc6-dev (1.0 unstable [amd64])' aptget build-dep apt -s + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + doxygen language-tool libc6:armhf libc6-dev:armhf +0 upgraded, 4 newly installed, 0 to remove and 1 not upgraded. +Inst language-tool (1.0 unstable [amd64]) +Inst doxygen (1.0 unstable [all]) +Inst libc6:armhf (1.0 unstable [armhf]) +Inst libc6-dev:armhf (1.0 unstable [armhf]) +Conf language-tool (1.0 unstable [amd64]) +Conf doxygen (1.0 unstable [all]) +Conf libc6:armhf (1.0 unstable [armhf]) +Conf libc6-dev:armhf (1.0 unstable [armhf])' aptget build-dep apt -s -a armhf diff --git a/test/integration/test-bug-683786-build-dep-on-virtual-packages b/test/integration/test-bug-683786-build-dep-on-virtual-packages index 879d6a3bc..c839a0fe6 100755 --- a/test/integration/test-bug-683786-build-dep-on-virtual-packages +++ b/test/integration/test-bug-683786-build-dep-on-virtual-packages @@ -41,9 +41,13 @@ The following NEW packages will be installed: Inst po-debconf (1 unstable, unstable [all]) Conf po-debconf (1 unstable, unstable [all])' aptget build-dep dash -s -testequal 'Reading package lists... -Building dependency tree... -E: Build-Depends dependency for dash cannot be satisfied because the package po-debconf cannot be found' aptget build-dep -aarmel dash -s +# ubuntu has the patch from +# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=666772 +# applied so the following test works in the ubuntu/master branch +# +#testequal 'Reading package lists... +#Building dependency tree... +#E: Build-Depends dependency for dash cannot be satisfied because the package po-debconf cannot be found' aptget build-dep -aarmel dash -s testequal 'Reading package lists... Building dependency tree... diff --git a/test/integration/test-kernel-helper-autoremove b/test/integration/test-kernel-helper-autoremove new file mode 100755 index 000000000..ffcd3963a --- /dev/null +++ b/test/integration/test-kernel-helper-autoremove @@ -0,0 +1,55 @@ +#!/bin/sh + +set -e + +# setup testdir +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework + +TMPDIR=$(mktemp -d) +cd $TMPDIR +addtrap "cd /; rm -rf $TMPDIR" + +# create mock environment +mkdir apt.conf.d +cat > aptconfig.conf <<EOF +Dir::Etc::parts "$TMPDIR/apt.conf.d"; +Dir::bin::dpkg "$TMPDIR/fake-dpkg"; +EOF +APT_CONFIG=aptconfig.conf +export APT_CONFIG + +# install fake-dpkg into it +install -m755 $TESTDIR/test-kernel-helper-autoremove.fake-dpkg $TMPDIR/fake-dpkg + +# run the helper +sh ${TESTDIR}/../../debian/apt.auto-removal.sh + +msgtest 'Check that kernel autoremoval list is correctly created' +# and ensure its there, valid and version 10.0.0-1 is there too +test -e $TMPDIR/apt.conf.d/01autoremove-kernels && msgpass || msgfail + +msgtest 'Check that most recent kernel is saved from autoremoval' +apt-config -c ${APT_CONFIG} dump|grep -q "APT::NeverAutoRemove::.*\^linux-image-10.0.0-1-generic\.\*" && msgpass || msgfail + +# ... and also that the running kernel is excluded +msgtest 'Check that running kernel is saved from autoremoval' +apt-config -c ${APT_CONFIG} dump|grep -q "APT::NeverAutoRemove::.*\^linux-image-$(uname -r)\.\*" && msgpass || msgfail + +# and that the old kernel is *not* excluded from autoremoval +msgtest 'Check that older kernels are not excluded from autoremoval' +apt-config -c ${APT_CONFIG} dump|grep -q "APT::NeverAutoRemove::.*\^linux-image-1\.0\.01-2-generic\.\*" && msgfail || msgpass + +msgtest "Check that the older kernel is retained when it's being installed" +sh ${TESTDIR}/../../debian/apt.auto-removal.sh 1.0.01-2-generic +test -e $TMPDIR/apt.conf.d/01autoremove-kernels +if ! apt-config -c ${APT_CONFIG} dump|grep -q "APT::NeverAutoRemove::.*\^linux-image-10.0.0-1-generic\.\*" \ + || ! apt-config -c ${APT_CONFIG} dump|grep -q "APT::NeverAutoRemove::.*\^linux-image-$(uname -r)\.\*" \ + || ! apt-config -c ${APT_CONFIG} dump|grep -q "APT::NeverAutoRemove::.*\^linux-image-1\.0\.01-2-generic\.\*" +then + msgfail +else + msgpass +fi + +# done diff --git a/test/integration/test-kernel-helper-autoremove.fake-dpkg b/test/integration/test-kernel-helper-autoremove.fake-dpkg new file mode 100644 index 000000000..a365c5370 --- /dev/null +++ b/test/integration/test-kernel-helper-autoremove.fake-dpkg @@ -0,0 +1,13 @@ +#!/bin/sh +set -e + +if [ "$1" = "-l" ]; then + echo "ii linux-image-1.0.0-2-generic 1.0.01-2 amd64" + echo "ii linux-image-$(uname -r) not-used amd64" + echo "ii linux-image-10.0.0-1-generic 10.0.0.1-1 amd64" +elif [ "$1" = "--compare-versions" ]; then + dpkg "$1" "$2" "$3" "$4" +else + dpkg $@ +fi + |