From 7a948ec719ecc020c2337fe3f41c5fc42699e2c1 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 26 Jun 2013 17:37:57 +0200 Subject: Version 3 for DPkg::Pre-Install-Pkgs with MultiArch info Adds on top of Version 2 to all displayed version numbers the architecture as well as the MultiArch flag for consumption by the hooks. Most of the time the architecture will be the same for both versions displayed, but packages might change from "all" to "any" (or back) between versions so we can't display the architecture for packages. Pseudo-Format for Version 3: Examples: stuff - - none < 1 amd64 none **CONFIGURE** libsame 1 i386 same < 2 i386 same **CONFIGURE** stuff 2 i386 none > 1 i386 none **CONFIGURE** libsame 2 i386 same > - - none **REMOVE** toolkit 1 all foreign > - - none **REMOVE** Closes: #712116 --- ...bug-712116-dpkg-pre-install-pkgs-hook-multiarch | 95 ++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100755 test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch (limited to 'test/integration') diff --git a/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch b/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch new file mode 100755 index 000000000..aee44f76b --- /dev/null +++ b/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch @@ -0,0 +1,95 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' 'i386' + +buildsimplenativepackage 'toolkit' 'all' '1' 'stable' 'Multi-Arch: foreign' +buildsimplenativepackage 'toolkit' 'amd64' '2' 'unstable' 'Multi-Arch: foreign' +buildsimplenativepackage 'libsame' 'i386,amd64' '1' 'stable' 'Multi-Arch: same' +buildsimplenativepackage 'libsame' 'i386,amd64' '2' 'unstable' 'Multi-Arch: same' +buildsimplenativepackage 'stuff' 'i386,amd64' '1' 'stable' 'Depends: libsame (= 1), toolkit (= 1)' +buildsimplenativepackage 'stuff' 'i386,amd64' '2' 'unstable' 'Depends: libsame (= 2), toolkit (= 2)' + +setupaptarchive + +hook='pre-install-pkgs' + +enablehookversion() { + echo "#!/bin/sh +while read line; do + if echo \"\$line\" | grep -Fq '**'; then + echo \"\$line\" + fi +done > ${hook}-v${1}.list" > ${hook}-v${1}.sh + chmod +x ${hook}-v${1}.sh + echo "dpkg::${hook}:: \"./${hook}-v${1}.sh --foo -bar\"; +DPkg::Tools::options::\"./${hook}-v${1}.sh\"::Version \"$1\";" > rootdir/etc/apt/apt.conf.d/hook-v$1 +} + +enablehookversion 2 +enablehookversion 3 + +observehook() { + rm -f ${hook}-v2.list ${hook}-v3.list + msgtest 'Observe hooks while' "$*" + aptget "$@" -y --force-yes >/dev/null 2>&1 && msgpass || msgfail +} + +observehook install stuff -t stable +testfileequal "${hook}-v2.list" 'libsame - < 1 **CONFIGURE** +toolkit - < 1 **CONFIGURE** +stuff - < 1 **CONFIGURE**' +testfileequal "${hook}-v3.list" 'libsame - - none < 1 amd64 same **CONFIGURE** +toolkit - - none < 1 all foreign **CONFIGURE** +stuff - - none < 1 amd64 none **CONFIGURE**' + +observehook install stuff -t unstable +testfileequal "${hook}-v2.list" 'libsame 1 < 2 **CONFIGURE** +toolkit 1 < 2 **CONFIGURE** +stuff 1 < 2 **CONFIGURE**' +testfileequal "${hook}-v3.list" 'libsame 1 amd64 same < 2 amd64 same **CONFIGURE** +toolkit 1 all foreign < 2 amd64 foreign **CONFIGURE** +stuff 1 amd64 none < 2 amd64 none **CONFIGURE**' + +observehook install stuff:i386 -t unstable +testfileequal "${hook}-v2.list" 'stuff 2 > - **REMOVE** +libsame - < 2 **CONFIGURE** +stuff - < 2 **CONFIGURE**' +testfileequal "${hook}-v3.list" 'stuff 2 amd64 none > - - none **REMOVE** +libsame - - none < 2 i386 same **CONFIGURE** +stuff - - none < 2 i386 none **CONFIGURE**' + +observehook remove libsame +testfileequal "${hook}-v2.list" 'libsame 2 > - **REMOVE**' +testfileequal "${hook}-v3.list" 'libsame 2 amd64 same > - - none **REMOVE**' + +observehook install stuff:i386/stable libsame:i386/stable toolkit/stable +testfileequal "${hook}-v2.list" 'libsame 2 > 1 **CONFIGURE** +toolkit 2 > 1 **CONFIGURE** +stuff 2 > 1 **CONFIGURE**' +testfileequal "${hook}-v3.list" 'libsame 2 i386 same > 1 i386 same **CONFIGURE** +toolkit 2 amd64 foreign > 1 all foreign **CONFIGURE** +stuff 2 i386 none > 1 i386 none **CONFIGURE**' + +observehook install 'libsame:*' +testfileequal "${hook}-v2.list" 'libsame 1 < 2 **CONFIGURE** +libsame - < 2 **CONFIGURE** +toolkit 1 < 2 **CONFIGURE** +stuff 1 < 2 **CONFIGURE**' +testfileequal "${hook}-v3.list" 'libsame 1 i386 same < 2 i386 same **CONFIGURE** +libsame - - none < 2 amd64 same **CONFIGURE** +toolkit 1 all foreign < 2 amd64 foreign **CONFIGURE** +stuff 1 i386 none < 2 i386 none **CONFIGURE**' + +observehook purge stuff:i386 'libsame:*' toolkit +testfileequal "${hook}-v2.list" 'libsame 2 > - **REMOVE** +stuff 2 > - **REMOVE** +libsame 2 > - **REMOVE** +toolkit 2 > - **REMOVE**' +testfileequal "${hook}-v3.list" 'libsame 2 amd64 same > - - none **REMOVE** +stuff 2 i386 none > - - none **REMOVE** +libsame 2 i386 same > - - none **REMOVE** +toolkit 2 amd64 foreign > - - none **REMOVE**' -- cgit v1.2.3 From 3d1be93dc4242df2b93de632715a8aa7dd34f96f Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 28 Jun 2013 20:42:18 +0200 Subject: implement arch+= and arch-= for sources.list Default is to acquire all architectures from APT::Architectures which can be changed by arch=, but this isn't very flexible if you want "mostly" the default as you have to hardcode the architectures then, so arch-= and arch+= can be used to add/remove architectures from the default set. On a machine with 'amd64' and 'i386' configured the lines: deb [arch+=armel] http://example.org/debian wheezy rocks deb [arch-=amd64] http://example.org/debian jessie rocks will result in the download of: wheezy Packages for 'amd64', 'i386' and 'armel' jessie Packages for 'i386' --- .../test-sourceslist-arch-plusminus-options | 85 ++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100755 test/integration/test-sourceslist-arch-plusminus-options (limited to 'test/integration') diff --git a/test/integration/test-sourceslist-arch-plusminus-options b/test/integration/test-sourceslist-arch-plusminus-options new file mode 100755 index 000000000..0d4d7448f --- /dev/null +++ b/test/integration/test-sourceslist-arch-plusminus-options @@ -0,0 +1,85 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' + +testbinaries() { + msgtest 'Test acquired archs for' "$1" + shift + rm -f gotarchs.list + aptget update --print-uris | grep -o '/binary-[a-z0-9-]\+/Packages' | sort > gotarchs.list + while [ -n "$1" ]; do + echo "/binary-${1}/Packages" + shift + done | sort | checkdiff - gotarchs.list && msgpass || msgfail +} + +echo 'deb http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testbinaries 'default & native' 'amd64' +configarchitecture 'amd64' 'i386' +testbinaries 'default & native + foreign' 'amd64' 'i386' +configarchitecture 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel' +testbinaries 'default & native + many foreigns' 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel' + +echo 'deb [arch=amd64] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testbinaries 'arch=native' 'amd64' + +echo 'deb [arch=mips] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testbinaries 'arch=foreign' 'mips' + +echo 'deb [arch=kfreebsd-armel] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testbinaries 'arch=unknown' 'kfreebsd-armel' + +echo 'deb [arch=amd64,i386] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testbinaries 'arch=native,foreign' 'amd64' 'i386' + +echo 'deb [arch=mips,armhf] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testbinaries 'arch=foreign,foreign' 'mips' 'armhf' + +echo 'deb [arch=kfreebsd-armel,hurd-powerpc,mipsel,armel] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testbinaries 'arch=unknown,unknown,foreign,foreign' 'kfreebsd-armel' 'hurd-powerpc' 'mipsel' 'armel' + +echo 'deb [arch+=amd64] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testbinaries 'arch+=native' 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel' + +echo 'deb [arch+=mips] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testbinaries 'arch+=foreign' 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel' + +echo 'deb [arch+=mips,armhf,i386] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testbinaries 'arch+=foreign,foreign,foreign' 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel' + +echo 'deb [arch+=hurd-powerpc] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testbinaries 'arch+=unknown' 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel' 'hurd-powerpc' + +echo 'deb [arch+=mips,hurd-powerpc,i386] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testbinaries 'arch+=foreign,unknown,foreign' 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel' 'hurd-powerpc' + +echo 'deb [arch-=amd64] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testbinaries 'arch-=native' 'i386' 'armel' 'armhf' 'mips' 'mipsel' + +echo 'deb [arch-=mips] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testbinaries 'arch-=foreign' 'amd64' 'i386' 'armel' 'armhf' 'mipsel' + +echo 'deb [arch-=mips,armhf,i386] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testbinaries 'arch-=foreign,foreign,foreign' 'amd64' 'armel' 'mipsel' + +echo 'deb [arch-=hurd-powerpc] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testbinaries 'arch-=unknown' 'amd64' 'i386' 'armel' 'armhf' 'mips' 'mipsel' + +echo 'deb [arch-=mips,hurd-powerpc,i386] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testbinaries 'arch-=foreign,unknown,foreign' 'amd64' 'armel' 'armhf' 'mipsel' + +echo 'deb [arch=mips,i386 arch-=mips] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testbinaries 'substract from a arch-set' 'i386' + +echo 'deb [arch=mips,i386 arch-=mips] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testbinaries 'useless substract from a arch-set' 'i386' + +echo 'deb [arch=mips,i386 arch+=armhf] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testbinaries 'addition to a arch-set' 'i386' 'mips' 'armhf' + +echo 'deb [arch=mips,i386 arch+=mips] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list +testbinaries 'useless addition to a arch-set' 'i386' 'mips' -- cgit v1.2.3 From 486d190d3c66bb7271509dc002f8ec9e9eb0166c Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 10 Jul 2013 13:06:05 +0200 Subject: prevent MarkInstall of unsynced Multi-Arch:same siblings Multi-Arch: same packages can be co-installed, but need to have the same version for all installed packages (aka "siblings"). Otherwise the unsynced versions will fight against each other and the auto-install as wel as the problem resolver will later have to decide between holding the packages or to remove one of the siblings (usually a foreign) taking a bunch of packages (like the entire foreign setup) with them. The idea here is now to be more pro-active: MarkInstall will fail for a package if the siblings aren't synced, so we don't allow a situation in which a resolver has to decide if to hold or to remove-upgrade under the assumption that the remove-upgrade decision is always wrong and doesn't deserve to be explored (expect valid out-of-syncs of course). Thats a pretty bold move to take for a library which is used by different solvers so this check is done in IsInstallOk and can be overridden if front-ends want to. --- ...prevent-markinstall-multiarch-same-versionscrew | 100 +++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100755 test/integration/test-prevent-markinstall-multiarch-same-versionscrew (limited to 'test/integration') diff --git a/test/integration/test-prevent-markinstall-multiarch-same-versionscrew b/test/integration/test-prevent-markinstall-multiarch-same-versionscrew new file mode 100755 index 000000000..fed12dad0 --- /dev/null +++ b/test/integration/test-prevent-markinstall-multiarch-same-versionscrew @@ -0,0 +1,100 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' 'i386' 'armel' + +insertpackage 'stable' 'allarchs' 'all' '1' +insertpackage 'unstable' 'allarchs' 'all' '2' + +insertinstalledpackage 'fine' 'i386,amd64' '1' 'Multi-Arch: same' +insertpackage 'stable' 'fine' 'i386,amd64' '1' 'Multi-Arch: same' +insertpackage 'unstable' 'fine' 'amd64,i386' '2' 'Multi-Arch: same' + +insertinstalledpackage 'fine-installed' 'i386,amd64' '1' 'Multi-Arch: same' +insertpackage 'stable' 'fine-installed' 'i386,amd64,armel' '1' 'Multi-Arch: same' +insertpackage 'unstable' 'fine-installed' 'i386,amd64' '2' 'Multi-Arch: same' + +insertinstalledpackage 'out-of-sync-native' 'i386,amd64' '1' 'Multi-Arch: same' +insertpackage 'stable' 'out-of-sync-native' 'i386,amd64' '1' 'Multi-Arch: same' +insertpackage 'unstable' 'out-of-sync-native' 'amd64' '2' 'Multi-Arch: same' + +insertinstalledpackage 'out-of-sync-foreign' 'i386,amd64' '1' 'Multi-Arch: same' +insertpackage 'stable' 'out-of-sync-foreign' 'i386,amd64' '1' 'Multi-Arch: same' +insertpackage 'unstable' 'out-of-sync-foreign' 'i386' '2' 'Multi-Arch: same' + +insertinstalledpackage 'out-of-sync-gone-native' 'i386,amd64' '1' 'Multi-Arch: same' +insertpackage 'stable' 'out-of-sync-gone-native' 'i386' '1' 'Multi-Arch: same' +insertpackage 'unstable' 'out-of-sync-gone-native' 'i386' '2' 'Multi-Arch: same' + +insertinstalledpackage 'out-of-sync-gone-foreign' 'i386,amd64' '1' 'Multi-Arch: same' +insertpackage 'stable' 'out-of-sync-gone-foreign' 'amd64' '1' 'Multi-Arch: same' +insertpackage 'unstable' 'out-of-sync-gone-foreign' 'amd64' '2' 'Multi-Arch: same' + +insertpackage 'stable' 'libsame2' 'i386' '1' 'Multi-Arch: same' +insertpackage 'unstable' 'libsame2' 'amd64' '2' 'Multi-Arch: same' +insertpackage 'unstable' 'depender2' 'all' '2' 'Depends: libsame2 (= 2)' +insertpackage 'stable' 'libsame3' 'i386' '1' 'Multi-Arch: same' +insertpackage 'unstable' 'libsame3' 'i386,amd64' '3' 'Multi-Arch: same' +insertpackage 'unstable' 'depender3' 'all' '3' 'Depends: libsame3 (= 3)' +setupaptarchive + +testequal 'Reading package lists... +Building dependency tree... +The following packages will be REMOVED: + out-of-sync-gone-foreign:i386 out-of-sync-gone-native +The following packages have been kept back: + out-of-sync-foreign:i386 out-of-sync-native +The following packages will be upgraded: + fine fine:i386 fine-installed fine-installed:i386 out-of-sync-gone-foreign + out-of-sync-gone-native:i386 +6 upgraded, 0 newly installed, 2 to remove and 2 not upgraded. +Remv out-of-sync-gone-foreign:i386 [1] +Remv out-of-sync-gone-native [1] +Inst fine [1] (2 unstable [amd64]) [fine:amd64 on fine:i386] [fine:i386 on fine:amd64] [fine:i386 ] +Inst fine:i386 [1] (2 unstable [i386]) +Conf fine (2 unstable [amd64]) +Conf fine:i386 (2 unstable [i386]) +Inst fine-installed [1] (2 unstable [amd64]) [fine-installed:amd64 on fine-installed:i386] [fine-installed:i386 on fine-installed:amd64] [fine-installed:i386 ] +Inst fine-installed:i386 [1] (2 unstable [i386]) +Conf fine-installed (2 unstable [amd64]) +Conf fine-installed:i386 (2 unstable [i386]) +Inst out-of-sync-gone-foreign [1] (2 unstable [amd64]) +Inst out-of-sync-gone-native:i386 [1] (2 unstable [i386]) +Conf out-of-sync-gone-foreign (2 unstable [amd64]) +Conf out-of-sync-gone-native:i386 (2 unstable [i386])' aptget dist-upgrade -s #-o Debug::pkgDepCache::Marker=1 + +rm rootdir/var/lib/dpkg/status +insertinstalledpackage 'libsame2' 'i386' '1' 'Multi-Arch: same' +insertinstalledpackage 'libsame3' 'i386' '1' 'Multi-Arch: same' + +# the error message isn't great, but better than nothing, right? +testequal 'Reading package lists... +Building dependency tree... +Some packages could not be installed. This may mean that you have +requested an impossible situation or if you are using the unstable +distribution that some required packages have not yet been created +or been moved out of Incoming. +The following information may help to resolve the situation: + +The following packages have unmet dependencies: + depender2 : Depends: libsame2 (= 2) but it is not going to be installed +E: Unable to correct problems, you have held broken packages.' aptget install depender2 -s + +testequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + libsame3:i386 libsame3 +The following NEW packages will be installed: + depender3 libsame3 +The following packages will be upgraded: + libsame3:i386 +1 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst libsame3:i386 [1] (3 unstable [i386]) +Inst libsame3 (3 unstable [amd64]) +Inst depender3 (3 unstable [all]) +Conf libsame3:i386 (3 unstable [i386]) +Conf libsame3 (3 unstable [amd64]) +Conf depender3 (3 unstable [all])' aptget install depender3 -s -- cgit v1.2.3 From 86fdeec2a76f6b134ee8400eb1e53d06fe0974fe Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 16 Jul 2013 23:15:55 +0200 Subject: fix if-clause to generate hook-info for 'rc' packages The code incorrectly skips printing of current version information, if the package has no current version (for APT, but for dpkg as it is the case for packages which are removed but not purged) by using an unintended "else if" rather than an "if". Closes: 717006 --- ...bug-712116-dpkg-pre-install-pkgs-hook-multiarch | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'test/integration') diff --git a/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch b/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch index aee44f76b..a89cb7191 100755 --- a/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch +++ b/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch @@ -13,6 +13,13 @@ buildsimplenativepackage 'libsame' 'i386,amd64' '2' 'unstable' 'Multi-Arch: same buildsimplenativepackage 'stuff' 'i386,amd64' '1' 'stable' 'Depends: libsame (= 1), toolkit (= 1)' buildsimplenativepackage 'stuff' 'i386,amd64' '2' 'unstable' 'Depends: libsame (= 2), toolkit (= 2)' +setupsimplenativepackage 'confpkg' 'amd64' '1' 'unstable' +BUILDDIR='incoming/confpkg-1' +echo 'foo "bar";' > ${BUILDDIR}/pkg.conf +echo 'pkg.conf /etc/pkg.conf' >> ${BUILDDIR}/debian/install +buildpackage "$BUILDDIR" 'unstable' 'main' 'amd64' +rm -rf "$BUILDDIR" + setupaptarchive hook='pre-install-pkgs' @@ -93,3 +100,21 @@ testfileequal "${hook}-v3.list" 'libsame 2 amd64 same > - - none **REMOVE** stuff 2 i386 none > - - none **REMOVE** libsame 2 i386 same > - - none **REMOVE** toolkit 2 amd64 foreign > - - none **REMOVE**' + +observehook install confpkg +testfileequal "${hook}-v2.list" 'confpkg - < 1 **CONFIGURE**' +testfileequal "${hook}-v3.list" 'confpkg - - none < 1 amd64 none **CONFIGURE**' + +observehook remove confpkg +testfileequal "${hook}-v2.list" 'confpkg 1 > - **REMOVE**' +testfileequal "${hook}-v3.list" 'confpkg 1 amd64 none > - - none **REMOVE**' + +msgtest 'Conffiles of package remained after remove' 'confpkg' +dpkg -l confpkg | grep -q '^rc' && msgpass || msgfail + +observehook purge confpkg +testfileequal "${hook}-v2.list" 'confpkg 1 > - **REMOVE**' +testfileequal "${hook}-v3.list" 'confpkg 1 amd64 none > - - none **REMOVE**' + +msgtest 'Conffiles are gone after purge' 'confpkg' +dpkg -l confpkg 2>/dev/null | grep -q '^rc' && msgfail || msgpass -- cgit v1.2.3 From 61843f539513b3e661dac55717e6d7cc0b8f9b0c Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 18 Jul 2013 16:52:31 +0200 Subject: skip all Description fields in apt-cache, not just first MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Given a Packages file like: […] Description: foo bar baz moo moo moo Multi-Arch: foreign Description-md5: 97e204a9f4ad8c681dbd54ec7c505251 […] We have to display the Multi-Arch flag field as well as the fields after the Description-md5, but not this field itself, as we already have one printed alongside the Description we display. Closes: 717254 --- .../test-bug-712435-missing-descriptions | 52 +++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) (limited to 'test/integration') diff --git a/test/integration/test-bug-712435-missing-descriptions b/test/integration/test-bug-712435-missing-descriptions index 9b3c2ee50..c61bea452 100755 --- a/test/integration/test-bug-712435-missing-descriptions +++ b/test/integration/test-bug-712435-missing-descriptions @@ -52,7 +52,32 @@ $PACKAGESTANZA Description-md5: dddddddddddddddddddddddddddddddd Package: apt-none -$PACKAGESTANZA" > aptarchive/Packages +$PACKAGESTANZA + +Package: apt-intermixed +$PACKAGESTANZA +$DESCRIPTION +X-Some-Flag: yes +Description-md5: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + +Package: apt-intermixed2 +$PACKAGESTANZA +$DESCRIPTION +X-Some-Flag: yes +$TRANSDESCRIPTION +X-Foo-Flag: Something with a Description +Description-md5: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +X-Bar-Flag: no + +Package: apt-intermixed3 +$PACKAGESTANZA +$DESCRIPTION +X-Some-Flag: yes +$TRANSDESCRIPTION +X-Foo-Flag: Something with a Description +X-Bar-Flag: no +Description-md5: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" > aptarchive/Packages + setupaptarchive @@ -87,3 +112,28 @@ Description-md5: dddddddddddddddddddddddddddddddd testequal "Package: apt-none $PACKAGESTANZA " aptcache show apt-none + +testequal "Package: apt-intermixed +$PACKAGESTANZA +$DESCRIPTION +Description-md5: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +X-Some-Flag: yes +" aptcache show apt-intermixed + +testequal "Package: apt-intermixed2 +$PACKAGESTANZA +$DESCRIPTION +Description-md5: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +X-Some-Flag: yes +X-Foo-Flag: Something with a Description +X-Bar-Flag: no +" aptcache show apt-intermixed2 + +testequal "Package: apt-intermixed3 +$PACKAGESTANZA +$DESCRIPTION +Description-md5: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +X-Some-Flag: yes +X-Foo-Flag: Something with a Description +X-Bar-Flag: no +" aptcache show apt-intermixed3 -- cgit v1.2.3 From 922f07986b93ce7866f89917e3a475e6a4b3941c Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 18 Jul 2013 19:22:29 +0200 Subject: fix 'apt-cache search' crash with missing description Beside the earlier fixed 'apt-cache show', 'showpkg' and 'search' deal with descriptions. 'showpkg' was fixed by fixing the cache generation for 'show', but 'search' still segfaulted. On the upside, it doesn't segfault any longer, on the downside, if a package has no description at all (aka: not in the Packages file and not in a Translation-* file) the package can't be found with 'search', even if we search only by name. That is a shortcoming in the code, but fixing it means rewriting it completely for dubious gain at best. So this commit just skips packages without a description and is done. Closes: 647590 --- .../test-bug-712435-missing-descriptions | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'test/integration') diff --git a/test/integration/test-bug-712435-missing-descriptions b/test/integration/test-bug-712435-missing-descriptions index c61bea452..53ecbbeb3 100755 --- a/test/integration/test-bug-712435-missing-descriptions +++ b/test/integration/test-bug-712435-missing-descriptions @@ -137,3 +137,29 @@ X-Some-Flag: yes X-Foo-Flag: Something with a Description X-Bar-Flag: no " aptcache show apt-intermixed3 + +msgtest 'Test that no description does not destroy' 'showpkg' +aptcache showpkg apt-none | sed 's#/tmp/.*_aptarchive_#/tmp/aptarchive_#' >showpkg.explosion && msgpass || msgfail +testfileequal showpkg.explosion 'Package: apt-none +Versions: +0.9.7.8 (/tmp/aptarchive_Packages) + + +Reverse Depends: +Dependencies: +0.9.7.8 - +Provides: +0.9.7.8 - +Reverse Provides: ' + +testempty aptcache search nonexistentstring + +# packages without a description can't be found +testequal 'apt-normal - commandline package manager +apt-both-below - commandline package manager +apt-both-middle - commandline package manager +apt-both-top - commandline package manager +apt-trans - commandline package manager +apt-intermixed - commandline package manager +apt-intermixed2 - commandline package manager +apt-intermixed3 - commandline package manager' aptcache search apt -- cgit v1.2.3 From a5b9f4890fc2b367b8f89d10ea2bdb88b8aa071a Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 25 Jul 2013 18:51:16 +0200 Subject: pick up Translation-* even if only compressed available On CD-ROMs Translation-* files are only in compressed form included in the Release file. This used to work while we had no record of Translation-* files in the Release file at all as APT would have just guessed the (compressed) filename and accepted it (unchecked), but now that it checks for the presents of entries and if it finds records it expects the uncompressed to be verifiable. This commit relaxes this requirement again to fix the regression. We are still secure "enough" as we can validate the compressed file we have downloaded, so we don't loose anything by not requiring a hashsum for the uncompressed files to double-check them. Closes: 717665 --- .../test-bug-624218-Translation-file-handling | 55 +++++++++++++--------- 1 file changed, 34 insertions(+), 21 deletions(-) (limited to 'test/integration') diff --git a/test/integration/test-bug-624218-Translation-file-handling b/test/integration/test-bug-624218-Translation-file-handling index d146b943c..d3c5b08ac 100755 --- a/test/integration/test-bug-624218-Translation-file-handling +++ b/test/integration/test-bug-624218-Translation-file-handling @@ -14,34 +14,47 @@ changetowebserver rm -rf rootdir/var/lib/apt/lists -msgtest 'No download of non-existent locals' 'with Index' -LC_ALL="" aptget update -o Acquire::Languages=en | grep -q -e 'Translation-[^e][^n] ' && msgfail || msgpass -rm -rf rootdir/var/lib/apt/lists +translationslisted() { + msgtest 'No download of non-existent locals' "$1" + LC_ALL="" aptget update -o Acquire::Languages=en | grep -q -e 'Translation-[^e][^n] ' && msgfail || msgpass + rm -rf rootdir/var/lib/apt/lists -msgtest 'Download of existent locals' 'with Index' -LC_ALL="" aptget update | grep -q -e 'Translation-en ' && msgpass || msgfail -rm -rf rootdir/var/lib/apt/lists + msgtest 'Download of existent locals' "$1" + LC_ALL="" aptget update | grep -q -e 'Translation-en ' && msgpass || msgfail + rm -rf rootdir/var/lib/apt/lists -msgtest 'Download of en in LC_ALL=C' 'with Index' -LC_ALL=C aptget update | grep -q -e 'Translation-en ' && msgpass || msgfail -rm -rf rootdir/var/lib/apt/lists + msgtest 'Download of en in LC_ALL=C' "$1" + LC_ALL=C aptget update | grep -q -e 'Translation-en ' && msgpass || msgfail + rm -rf rootdir/var/lib/apt/lists -msgtest 'Download of en as forced language' 'with Index' -aptget update -o Acquire::Languages=en | grep -q -e 'Translation-en ' && msgpass || msgfail -rm -rf rootdir/var/lib/apt/lists + msgtest 'Download of en as forced language' "$1" + aptget update -o Acquire::Languages=en | grep -q -e 'Translation-en ' && msgpass || msgfail + rm -rf rootdir/var/lib/apt/lists -msgtest 'Download of nothing else in forced language' 'with Index' -aptget update -o Acquire::Languages=en | grep -q -e 'Translation-[^e][^n] ' && msgfail || msgpass -rm -rf rootdir/var/lib/apt/lists + msgtest 'Download of nothing else in forced language' "$1" + aptget update -o Acquire::Languages=en | grep -q -e 'Translation-[^e][^n] ' && msgfail || msgpass + rm -rf rootdir/var/lib/apt/lists -msgtest 'Download no Translation- if forced language is non-existent' 'with Index' -aptget update -o Acquire::Languages=ast_DE | grep -q -e 'Translation-' && msgfail || msgpass -rm -rf rootdir/var/lib/apt/lists + msgtest 'Download no Translation- if forced language is non-existent' "$1" + aptget update -o Acquire::Languages=ast_DE | grep -q -e 'Translation-' && msgfail || msgpass + rm -rf rootdir/var/lib/apt/lists + + msgtest 'Download of nothing if none is forced' "$1" + aptget update -o Acquire::Languages=none | grep -q -e 'Translation' && msgfail || msgpass + rm -rf rootdir/var/lib/apt/lists +} + +translationslisted 'with full Index' + + +# only compressed files available (as it happens on CD-ROM) +sed -i '/i18n\/Translation-[^.]*$/ d' $(find aptarchive -name 'Release') +signreleasefiles + +translationslisted 'with partial Index' -msgtest 'Download of nothing if none is forced' 'with Index' -aptget update -o Acquire::Languages=none | grep -q -e 'Translation' && msgfail || msgpass -rm -rf rootdir/var/lib/apt/lists +# no records at all about Translation files (fallback to guessing) sed -i '/i18n\/Translation-.*$/ d' $(find aptarchive -name 'Release') signreleasefiles -- cgit v1.2.3 From f2380a78aa90ff8a3b76607c0c140810aff84086 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 26 Jul 2013 09:22:52 +0200 Subject: request absolute URIs from proxies again (0.9.9.3 regession) Commit 2b9c9b7f28b18f6ae3e422020e8934872b06c9f3 not only removes keep-alive, but also changes the request URI send to proxies which are required to be absolute URIs rather than the usual absolute paths. Closes: 717891 --- .../test-bug-717891-abolute-uris-for-proxies | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 test/integration/test-bug-717891-abolute-uris-for-proxies (limited to 'test/integration') diff --git a/test/integration/test-bug-717891-abolute-uris-for-proxies b/test/integration/test-bug-717891-abolute-uris-for-proxies new file mode 100755 index 000000000..e9c38492e --- /dev/null +++ b/test/integration/test-bug-717891-abolute-uris-for-proxies @@ -0,0 +1,28 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' + +buildsimplenativepackage 'unrelated' 'all' '0.5~squeeze1' 'unstable' + +setupaptarchive +changetowebserver --request-absolute='uri' + +msgtest 'Check that absolute paths are' 'not accepted' +aptget update >/dev/null 2>&1 && msgfail || msgpass + +echo 'Acquire::http::Proxy "http://localhost:8080";' > rootdir/etc/apt/apt.conf.d/99proxy + +msgtest 'Check that requests to proxies are' 'absolute uris' +aptget update >/dev/null 2>&1 && msgpass || msgfail + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + unrelated +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst unrelated (0.5~squeeze1 unstable [all]) +Conf unrelated (0.5~squeeze1 unstable [all])' aptget install unrelated -s -- cgit v1.2.3 From 55732492ddea83e7d97b2e0c3e6799948fc5f152 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 1 Aug 2013 12:58:20 +0200 Subject: unset LANGUAGE for showing [Y/n] answer hints nl_langinfo is used to acquire the YESEXPR of the language used, but it will return the one from LC_MESSAGES, which might be different from the language chosen for display of the question (based on LANGUAGE) so this commit removes the [Y/n] help text from the questions itself and moves it to the prompt creation in which the usage of LC_MESSAGES is forced for it, so that the helptext shown actually represents the characters accepted as input for the question. There is still room for problems of course starting with an untranslated "[Y/n]" but a translated YESEXPR or the problem that the question is asked in a completely different language which might have a conflicting definition of [Y/n] input or the user simple ignores the helptext and assumes that an answer matching the question language is accepted, but the mayority of users will never have this problem to begin with, so we should be fine (or at least a bit finer than before). Closes nothing really, but should at least help a bit with bugs like deb:194614, deb:471102, lp:1205578, and countless others. --- test/integration/test-bug-596498-trusted-unsigned-repo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/integration') diff --git a/test/integration/test-bug-596498-trusted-unsigned-repo b/test/integration/test-bug-596498-trusted-unsigned-repo index 6ebc4a3bb..5c643c40e 100755 --- a/test/integration/test-bug-596498-trusted-unsigned-repo +++ b/test/integration/test-bug-596498-trusted-unsigned-repo @@ -27,7 +27,7 @@ aptgetupdate testequal "$PKGTEXT WARNING: The following packages cannot be authenticated! cool -Install these packages without verification [y/N]? N +Install these packages without verification? [y/N] N E: Some packages could not be authenticated" aptget install cool --assume-no -d find aptarchive/ \( -name 'Release.gpg' -o -name 'InRelease' \) -delete @@ -37,7 +37,7 @@ aptgetupdate testequal "$PKGTEXT WARNING: The following packages cannot be authenticated! cool -Install these packages without verification [y/N]? N +Install these packages without verification? [y/N] N E: Some packages could not be authenticated" aptget install cool --assume-no -d sed -i -e 's#deb#deb [trusted=yes]#' $DEBFILE -- cgit v1.2.3 From 096bd9f59750f6bea754d3a05e240c9eea0f6b53 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Thu, 1 Aug 2013 13:19:43 +0200 Subject: prefer native arch over higher priority for providers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The rational from the buglog: > The problem here is that the Priority field in one of the Packages files > is incorrect due to a mishap with reprepro configuration, […] the > amd64 version is Priority: standard but the arm64 version is Priority: > optional (and has a stray "optional: interpreters" field). > […] > However, Priority is a rather weak property of a package because it's > typically applied via overrides, and it's easy for maintainers of > third-party repositories to misconfigure them so that overrides aren't > applied correctly. It shouldn't be ranked ahead of choosing packages > from the native architecture. In this case, I have no user-mode > emulation for arm64 set up, so choosing m4:arm64 simply won't work. This effectly makes the priority the least interesting data point in chosing a provider, which is in line with the other checks we have already order above priority in the past and also has a certain appeal by the soft irony it provides. Closes: #718482 --- ...prefer-native-architecture-over-higher-priority | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 test/integration/test-prefer-native-architecture-over-higher-priority (limited to 'test/integration') diff --git a/test/integration/test-prefer-native-architecture-over-higher-priority b/test/integration/test-prefer-native-architecture-over-higher-priority new file mode 100755 index 000000000..2e5696376 --- /dev/null +++ b/test/integration/test-prefer-native-architecture-over-higher-priority @@ -0,0 +1,25 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' 'arm64' + +insertpackage 'unstable' 'm4' 'amd64' '1' 'Multi-Arch: foreign' 'optional' +insertpackage 'unstable' 'm4' 'arm64' '1' 'Multi-Arch: foreign' 'standard' +insertpackage 'unstable' 'autoconf' 'all' '1' 'Depends: m4' + +setupaptarchive + +testequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + m4 +The following NEW packages will be installed: + autoconf m4 +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst m4 (1 unstable [amd64]) +Inst autoconf (1 unstable [all]) +Conf m4 (1 unstable [amd64]) +Conf autoconf (1 unstable [all])' aptget install autoconf -s -- cgit v1.2.3 From 1680800209dc85387c4c2da9a1edfcde44f87807 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 7 Aug 2013 18:00:07 +0200 Subject: specific pins below 1000 cause downgrades MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We start your quest by using the version of a package applying to a specific pin, but that version could very well be below the current version, which causes APT to suggest a downgrade even if it is advertised that it never does this below 1000. Its of course questionable what use a specific pin on a package has which has a newer version already installed, but reacting with the suggestion of a downgrade is really not appropriated (even if its kinda likely that this is actually the intend the user has – it could just as well be an outdated pin) and as pinning is complicated enough we should atleast do what is described in the manpage. So we look out for the specific pin and if we haven't seen it at the moment we see the installed version, we ignore the specific pin. Closes: 543966 --- .../test-bug-543966-downgrade-below-1000-pin | 81 ++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100755 test/integration/test-bug-543966-downgrade-below-1000-pin (limited to 'test/integration') diff --git a/test/integration/test-bug-543966-downgrade-below-1000-pin b/test/integration/test-bug-543966-downgrade-below-1000-pin new file mode 100755 index 000000000..f602bea95 --- /dev/null +++ b/test/integration/test-bug-543966-downgrade-below-1000-pin @@ -0,0 +1,81 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework + +setupenvironment +configarchitecture 'i386' + +insertpackage 'unstable' 'base-files' 'all' '5.0.0' +insertinstalledpackage 'base-files' 'all' '5.0.0-1' + +setupaptarchive + +STATUS=$(readlink -f rootdir/var/lib/dpkg/status) +APTARCHIVE="$(readlink -f aptarchive)/" + +testequal "base-files: + Installed: 5.0.0-1 + Candidate: 5.0.0-1 + Version table: + *** 5.0.0-1 0 + 100 $STATUS + 5.0.0 0 + 500 file:${APTARCHIVE} unstable/main i386 Packages" aptcache policy base-files -o apt::pin=0 + +echo 'Package: base-files +Pin: release a=unstable +Pin-Priority: 99' > rootdir/etc/apt/preferences + +testequal "base-files: + Installed: 5.0.0-1 + Candidate: 5.0.0-1 + Package pin: 5.0.0 + Version table: + *** 5.0.0-1 99 + 100 $STATUS + 5.0.0 99 + 500 file:${APTARCHIVE} unstable/main i386 Packages" aptcache policy base-files -o apt::pin=99 + +echo 'Package: base-files +Pin: release a=unstable +Pin-Priority: 100' > rootdir/etc/apt/preferences + +testequal "base-files: + Installed: 5.0.0-1 + Candidate: 5.0.0-1 + Package pin: 5.0.0 + Version table: + *** 5.0.0-1 100 + 100 $STATUS + 5.0.0 100 + 500 file:${APTARCHIVE} unstable/main i386 Packages" aptcache policy base-files -o apt::pin=100 + +echo 'Package: base-files +Pin: release a=unstable +Pin-Priority: 999' > rootdir/etc/apt/preferences + +testequal "base-files: + Installed: 5.0.0-1 + Candidate: 5.0.0-1 + Package pin: 5.0.0 + Version table: + *** 5.0.0-1 999 + 100 $STATUS + 5.0.0 999 + 500 file:${APTARCHIVE} unstable/main i386 Packages" aptcache policy base-files -o apt::pin=999 + +echo 'Package: base-files +Pin: release a=unstable +Pin-Priority: 1000' > rootdir/etc/apt/preferences + +testequal "base-files: + Installed: 5.0.0-1 + Candidate: 5.0.0 + Package pin: 5.0.0 + Version table: + *** 5.0.0-1 1000 + 100 $STATUS + 5.0.0 1000 + 500 file:${APTARCHIVE} unstable/main i386 Packages" aptcache policy base-files -o apt::pin=1000 -- cgit v1.2.3 From 29a59c460403820d0f039398194e321b7e0921fc Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 9 Aug 2013 22:20:27 +0200 Subject: test Release file handling with expired keys Signing files with expired keys is not as easy as it sounds, so the framework jumps a few loops to do it, but it might come in handy to have an expired key around for later tests even if it is not that different from having no key in regards to APT behaviour. Git-Dch: Ignore --- test/integration/framework | 35 ++++++++++++++++++++----- test/integration/rexexpired.pub | Bin 0 -> 1200 bytes test/integration/rexexpired.sec | Bin 0 -> 2502 bytes test/integration/test-releasefile-verification | 35 +++++++++++++++++++++++-- 4 files changed, 62 insertions(+), 8 deletions(-) create mode 100644 test/integration/rexexpired.pub create mode 100644 test/integration/rexexpired.sec (limited to 'test/integration') diff --git a/test/integration/framework b/test/integration/framework index 7dd7c20a7..f64b8482c 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -711,22 +711,45 @@ setupaptarchive() { signreleasefiles() { local SIGNER="${1:-Joe Sixpack}" + local GPG="gpg --batch --yes --no-default-keyring --trustdb-name rootdir/etc/apt/trustdb.gpg" msgninfo "\tSign archive with $SIGNER key… " - local SECKEYS="" + local REXKEY='keys/rexexpired' + local SECEXPIREBAK="${REXKEY}.sec.bak" + local PUBEXPIREBAK="${REXKEY}.pub.bak" + if [ "${SIGNER}" = 'Rex Expired' ]; then + # the key is expired, so gpg doesn't allow 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 + cp ${REXKEY}.pub $PUBEXPIREBAK + local SECUNEXPIRED="${REXKEY}.sec.unexpired" + local PUBUNEXPIRED="${REXKEY}.pub.unexpired" + if [ -f "$SECUNEXPIRED" ] && [ -f "$PUBUNEXPIRED" ]; then + cp $SECUNEXPIRED ${REXKEY}.sec + cp $PUBUNEXPIRED ${REXKEY}.pub + else + printf "expire\n1w\nsave\n" | $GPG --keyring ${REXKEY}.pub --secret-keyring ${REXKEY}.sec --command-fd 0 --edit-key "${SIGNER}" >/dev/null 2>&1 || true + cp ${REXKEY}.sec $SECUNEXPIRED + cp ${REXKEY}.pub $PUBUNEXPIRED + fi + fi for KEY in $(find keys/ -name '*.sec'); do - SECKEYS="$SECKEYS --secret-keyring $KEY" + GPG="$GPG --secret-keyring $KEY" done - local PUBKEYS="" for KEY in $(find keys/ -name '*.pub'); do - PUBKEYS="$PUBKEYS --keyring $KEY" + GPG="$GPG --keyring $KEY" done for RELEASE in $(find aptarchive/ -name Release); do - gpg --yes --no-default-keyring $SECKEYS $PUBKEYS --default-key "$SIGNER" -abs -o ${RELEASE}.gpg ${RELEASE} + $GPG --default-key "$SIGNER" --armor --detach-sign --sign --output ${RELEASE}.gpg ${RELEASE} local INRELEASE="$(echo "${RELEASE}" | sed 's#/Release$#/InRelease#')" - gpg --yes --no-default-keyring $SECKEYS $PUBKEYS --default-key "$SIGNER" --clearsign -o $INRELEASE $RELEASE + $GPG --default-key "$SIGNER" --clearsign --output $INRELEASE $RELEASE # we might have set a specific date for the Release file, so copy it touch -d "$(stat --format "%y" ${RELEASE})" ${RELEASE}.gpg ${INRELEASE} done + if [ -f "$SECEXPIREBAK" ] && [ -f "$PUBEXPIREBAK" ]; then + mv -f $SECEXPIREBAK ${REXKEY}.sec + mv -f $PUBEXPIREBAK ${REXKEY}.pub + fi msgdone "info" } diff --git a/test/integration/rexexpired.pub b/test/integration/rexexpired.pub new file mode 100644 index 000000000..5ab2e489a Binary files /dev/null and b/test/integration/rexexpired.pub differ diff --git a/test/integration/rexexpired.sec b/test/integration/rexexpired.sec new file mode 100644 index 000000000..dc00168cd Binary files /dev/null and b/test/integration/rexexpired.sec differ diff --git a/test/integration/test-releasefile-verification b/test/integration/test-releasefile-verification index e56f458d3..daba3919b 100755 --- a/test/integration/test-releasefile-verification +++ b/test/integration/test-releasefile-verification @@ -107,13 +107,24 @@ runtest() { " aptcache show apt installaptnew + prepare ${PKGFILE} + rm -rf rootdir/var/lib/apt/lists + cp keys/rexexpired.pub rootdir/etc/apt/trusted.gpg.d/rexexpired.gpg + signreleasefiles 'Rex Expired' + find aptarchive/ -name "$DELETEFILE" -delete + msgtest 'Cold archive signed by' 'Rex Expired' + aptget update 2>&1 | grep -E '^W: .* KEYEXPIRED' > /dev/null && msgpass || msgfail + testequal "$(cat ${PKGFILE}) +" aptcache show apt + failaptold + rm rootdir/etc/apt/trusted.gpg.d/rexexpired.gpg prepare ${PKGFILE} rm -rf rootdir/var/lib/apt/lists signreleasefiles 'Marvin Paranoid' find aptarchive/ -name "$DELETEFILE" -delete msgtest 'Cold archive signed by' 'Marvin Paranoid' - aptget update 2>&1 | grep -E '^(W|E): ' > /dev/null && msgpass || msgfail + aptget update 2>&1 | grep -E '^W: .* NO_PUBKEY' > /dev/null && msgpass || msgfail testequal "$(cat ${PKGFILE}) " aptcache show apt failaptold @@ -147,10 +158,30 @@ runtest() { signreleasefiles 'Marvin Paranoid' find aptarchive/ -name "$DELETEFILE" -delete msgtest 'Good warm archive signed by' 'Marvin Paranoid' - aptget update 2>&1 | grep -E '^(W|E): ' > /dev/null && msgpass || msgfail + aptget update 2>&1 | grep -E '^W: .* NO_PUBKEY' > /dev/null && msgpass || msgfail + testequal "$(cat ${PKGFILE}) +" aptcache show apt + installaptold + + prepare ${PKGFILE}-new + cp keys/rexexpired.pub rootdir/etc/apt/trusted.gpg.d/rexexpired.gpg + signreleasefiles 'Rex Expired' + find aptarchive/ -name "$DELETEFILE" -delete + msgtest 'Good warm archive signed by' 'Rex Expired' + aptget update 2>&1 | grep -E '^W: .* KEYEXPIRED' > /dev/null && msgpass || msgfail testequal "$(cat ${PKGFILE}) " aptcache show apt installaptold + rm rootdir/etc/apt/trusted.gpg.d/rexexpired.gpg + + prepare ${PKGFILE}-new + signreleasefiles + find aptarchive/ -name "$DELETEFILE" -delete + msgtest 'Good warm archive signed by' 'Joe Sixpack' + aptget update 2>&1 | grep -E '^(W|E): ' > /dev/null && msgfail || msgpass + testequal "$(cat ${PKGFILE}-new) +" aptcache show apt + installaptnew } runtest2() { -- cgit v1.2.3 From 0440d936d70b1e331d49bbc32735f1b749632604 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 10 Aug 2013 10:01:06 +0200 Subject: add chronic-like testsuccess/testfailure helpers For many commands the output isn't stable (like then dpkg is called) but the exitcode is, so this helper enhances the common && msgpass || msgfail by generating automatically a msgtest and showing the output of the command in case of failure instead of discarding it unconditionally, the later being chronic-like behaviour Git-Dch: Ignore --- test/integration/framework | 34 ++++++++++++++++++++++ test/integration/test-apt-cdrom | 2 +- test/integration/test-apt-get-autoremove | 10 +++---- .../test-bug-407511-fail-invalid-default-release | 4 +-- test/integration/test-bug-602412-dequote-redirect | 4 +-- .../integration/test-bug-604222-new-and-autoremove | 2 +- .../test-bug-604401-files-are-directories | 10 +++---- test/integration/test-bug-611729-mark-as-manual | 20 ++++++------- .../test-bug-612099-multiarch-conflicts | 12 ++++---- test/integration/test-bug-612557-garbage-upgrade | 4 +-- .../test-bug-612958-use-dpkg-multiarch-config | 4 +-- .../test-bug-613420-new-garbage-dependency | 2 +- ...test-bug-64141-install-dependencies-for-on-hold | 2 +- .../test-bug-673536-pre-depends-breaks-loop | 4 +-- .../test-bug-679371-apt-get-autoclean-multiarch | 4 +-- .../test-bug-686346-package-missing-architecture | 4 +-- ...bug-712116-dpkg-pre-install-pkgs-hook-multiarch | 2 +- .../test-bug-717891-abolute-uris-for-proxies | 4 +-- test/integration/test-compressed-indexes | 34 +++++++++++----------- .../test-cve-2013-1051-InRelease-parsing | 2 +- test/integration/test-disappearing-packages | 2 +- test/integration/test-pdiff-usage | 4 +-- test/integration/test-policy-pinning | 8 ++--- test/integration/test-releasefile-valid-until | 32 ++++++++++---------- .../test-ubuntu-bug-761175-remove-purge | 6 ++-- ...st-ubuntu-bug-784473-InRelease-one-message-only | 2 +- 26 files changed, 125 insertions(+), 93 deletions(-) (limited to 'test/integration') diff --git a/test/integration/framework b/test/integration/framework index f64b8482c..e363977f5 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -928,6 +928,40 @@ testmarkedauto() { aptmark showauto 2>&1 | checkdiff $COMPAREFILE - && msgpass || msgfail } +testsuccess() { + if [ "$1" = '--nomsg' ]; then + shift + else + msgtest 'Test for successful execution of' "$*" + fi + local OUTPUT=$(mktemp) + addtrap "rm $OUTPUT;" + if $@ >${OUTPUT} 2>&1; then + msgpass + else + echo + cat $OUTPUT + msgfail + fi +} + +testfailure() { + if [ "$1" = '--nomsg' ]; then + shift + else + msgtest 'Test for failure in execution of' "$*" + fi + local OUTPUT=$(mktemp) + addtrap "rm $OUTPUT;" + if $@ >${OUTPUT} 2>&1; then + echo + cat $OUTPUT + msgfail + else + msgpass + fi +} + pause() { echo "STOPPED execution. Press enter to continue" local IGNORE diff --git a/test/integration/test-apt-cdrom b/test/integration/test-apt-cdrom index 6e3533152..85c3a2fee 100755 --- a/test/integration/test-apt-cdrom +++ b/test/integration/test-apt-cdrom @@ -102,5 +102,5 @@ aptcache show testing -o Acquire::Languages=en | grep -q '^Description-en: ' && # check that we really can install from a 'cdrom' testdpkgnotinstalled testing -aptget install testing -y > /dev/null 2>&1 +testsuccess aptget install testing -y testdpkginstalled testing diff --git a/test/integration/test-apt-get-autoremove b/test/integration/test-apt-get-autoremove index c25ce3f58..dc30cde34 100755 --- a/test/integration/test-apt-get-autoremove +++ b/test/integration/test-apt-get-autoremove @@ -11,11 +11,11 @@ buildsimplenativepackage 'po-debconf' 'all' '1.0.16' 'unstable' buildsimplenativepackage 'debhelper' 'all' '8.0.0' 'unstable' 'Depends: po-debconf' setupaptarchive -aptget install unrelated debhelper -qq 2>&1 > /dev/null +testsuccess aptget install unrelated debhelper -y testdpkginstalled 'unrelated' 'debhelper' 'po-debconf' testmarkedauto 'po-debconf' -aptget remove debhelper -y -qq 2>&1 > /dev/null +testsuccess aptget remove debhelper -y testdpkgnotinstalled 'debhelper' testdpkginstalled 'po-debconf' 'unrelated' @@ -30,15 +30,15 @@ Remv po-debconf [1.0.16]' aptget autoremove -s testdpkginstalled 'po-debconf' echo 'APT::NeverAutoRemove { "^po-debconf$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove -aptget autoremove -y -qq 2>&1 > /dev/null +testsuccess aptget autoremove -y testdpkginstalled 'po-debconf' echo 'APT::NeverAutoRemove { "^po-.*$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove -aptget autoremove -y -qq 2>&1 > /dev/null +testsuccess aptget autoremove -y testdpkginstalled "po-debconf" rm rootdir/etc/apt/apt.conf.d/00autoremove -aptget autoremove -y -qq 2>&1 > /dev/null +testsuccess aptget autoremove -y testdpkgnotinstalled 'po-debconf' testmarkedauto diff --git a/test/integration/test-bug-407511-fail-invalid-default-release b/test/integration/test-bug-407511-fail-invalid-default-release index 7f23a1e82..3d3b0ada3 100755 --- a/test/integration/test-bug-407511-fail-invalid-default-release +++ b/test/integration/test-bug-407511-fail-invalid-default-release @@ -35,14 +35,14 @@ setupaptarchive passdist() { msgtest 'Test that target-release is accepted' $1 - aptget dist-upgrade -t $1 -qq && msgpass || msgfail + testsuccess --nomsg aptget dist-upgrade -t $1 msgtest 'Test that target-release pins with' $1 aptcache policy -t $1 | grep -q ' 990' && msgpass || msgfail } faildist() { msgtest 'Test that target-release is refused' $1 - aptget dist-upgrade -t $1 -qq 2> /dev/null && msgfail || msgpass + testfailure --nomsg aptget dist-upgrade -t $1 } msgtest 'Test that no default-release is active in this test' 'setup' diff --git a/test/integration/test-bug-602412-dequote-redirect b/test/integration/test-bug-602412-dequote-redirect index c20443559..764e13667 100755 --- a/test/integration/test-bug-602412-dequote-redirect +++ b/test/integration/test-bug-602412-dequote-redirect @@ -16,7 +16,7 @@ mv aptarchive/pool aptarchive/newpool mv aptarchive/dists aptarchive/newdists msgtest 'Test redirection works in' 'apt-get update' -aptget update -qq && msgpass || msgfail +testsuccess --nomsg aptget update # check that I-M-S header is kept in redirections testequal 'Hit http://localhost:8080 unstable InRelease @@ -26,4 +26,4 @@ Hit http://localhost:8080 unstable/main Translation-en Reading package lists...' aptget update #-o debug::pkgacquire=1 -o debug::pkgacquire::worker=1 msgtest 'Test redirection works in' 'package download' -aptget install unrelated --download-only -qq && msgpass || msgfail +testsuccess --nomsg aptget install unrelated --download-only diff --git a/test/integration/test-bug-604222-new-and-autoremove b/test/integration/test-bug-604222-new-and-autoremove index ea73c5775..b29347f64 100755 --- a/test/integration/test-bug-604222-new-and-autoremove +++ b/test/integration/test-bug-604222-new-and-autoremove @@ -8,7 +8,7 @@ configarchitecture "i386" setupaptarchive touch rootdir/var/lib/apt/extended_states -aptmark markauto 'libvtk5.4' +testsuccess aptmark markauto 'libvtk5.4' testmarkedauto 'libvtk5.4' testequal "Reading package lists... diff --git a/test/integration/test-bug-604401-files-are-directories b/test/integration/test-bug-604401-files-are-directories index aae717a19..e6913edcf 100755 --- a/test/integration/test-bug-604401-files-are-directories +++ b/test/integration/test-bug-604401-files-are-directories @@ -11,7 +11,7 @@ test ! -e rootdir/etc/apt/apt.conf || mv rootdir/etc/apt/apt.conf rootdir/etc/ap msgtest "Directory instead of a file as apt.conf ignored" mkdir -p rootdir/etc/apt/apt.conf -aptconfig dump > /dev/null && msgpass || msgfail +testsuccess --nomsg aptconfig dump rmdir rootdir/etc/apt/apt.conf msgtest "Good link instead of a file as apt.conf ignored" @@ -22,7 +22,7 @@ rm rootdir/etc/apt/apt.conf msgtest "Broken link instead of a file as apt.conf ignored" ln -s /tmp/doesnt-exist rootdir/etc/apt/apt.conf -aptconfig dump > /dev/null && msgpass || msgfail +testsuccess --nomsg aptconfig dump rm rootdir/etc/apt/apt.conf @@ -30,7 +30,7 @@ test ! -e rootdir/etc/apt/sources.list || mv rootdir/etc/apt/sources.list rootdi msgtest "Directory instead of a file as sources.list ignored" mkdir -p rootdir/etc/apt/sources.list -aptget update --print-uris 2> /dev/null && msgpass || msgfail +testsuccess --nomsg aptget update --print-uris rmdir rootdir/etc/apt/sources.list msgtest "Good link instead of a file as sources.list ignored" @@ -49,7 +49,7 @@ test ! -e rootdir/etc/apt/preferences || mv rootdir/etc/apt/preferences rootdir/ msgtest "Directory instead of a file as preferences ignored" mkdir -p rootdir/etc/apt/preferences -aptcache policy > /dev/null 2> /dev/null && msgpass || msgfail +testsuccess --nomsg aptcache policy rmdir rootdir/etc/apt/preferences msgtest "Good link instead of a file as preferences ignored" @@ -62,5 +62,5 @@ rm rootdir/etc/apt/preferences msgtest "Broken link instead of a file as preferences ignored" ln -s /tmp/doesnt-exist rootdir/etc/apt/preferences -aptcache policy > /dev/null 2> /dev/null && msgpass || msgfail +testsuccess --nomsg aptcache policy rm rootdir/etc/apt/preferences diff --git a/test/integration/test-bug-611729-mark-as-manual b/test/integration/test-bug-611729-mark-as-manual index 9cf01610c..e3d454f97 100755 --- a/test/integration/test-bug-611729-mark-as-manual +++ b/test/integration/test-bug-611729-mark-as-manual @@ -15,21 +15,21 @@ buildsimplenativepackage "c" "all" "1.0" "stable" "Depends: b" setupaptarchive # dpkg freaks out if the last package is removed so keep one around -aptget install peace-dpkg -y -qq 2>&1 > /dev/null +testsuccess aptget install peace-dpkg -y testdpkginstalled peace-dpkg testmarkedauto -aptget install a -y -qq 2>&1 > /dev/null +testsuccess aptget install a -y testdpkginstalled a b testdpkgnotinstalled c testmarkedauto 'b' -aptget remove a -y -qq 2>&1 > /dev/null +testsuccess aptget remove a -y testdpkgnotinstalled a c testdpkginstalled b testmarkedauto 'b' -aptget install c -y -qq 2>&1 > /dev/null +testsuccess aptget install c -y testdpkgnotinstalled a testdpkginstalled b c testmarkedauto 'b' @@ -50,7 +50,7 @@ testmarkedauto 'b' rm rootdir/var/log/apt/history.log -aptget install b --reinstall -y -qq 2>&1 > /dev/null +testsuccess aptget install b --reinstall -y testdpkgnotinstalled a testdpkginstalled b c testmarkedauto 'b' @@ -67,24 +67,24 @@ b set to manually installed. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget install b testmarkedauto -aptget remove b -y -qq 2>&1 > /dev/null +testsuccess aptget remove b -y testdpkgnotinstalled a b c testmarkedauto -aptget install a b -y -qq 2>&1 > /dev/null +testsuccess aptget install a b -y testdpkginstalled a b testdpkgnotinstalled c testmarkedauto -aptget purge a b -y -qq 2>&1 > /dev/null +testsuccess aptget purge a b -y testdpkgnotinstalled a b c testmarkedauto -aptget install b c -y -qq 2>&1 > /dev/null +testsuccess aptget install b c -y testdpkgnotinstalled a testdpkginstalled b c testmarkedauto -aptget install a -y -qq 2>&1 > /dev/null +testsuccess aptget install a -y testdpkginstalled a b c testmarkedauto diff --git a/test/integration/test-bug-612099-multiarch-conflicts b/test/integration/test-bug-612099-multiarch-conflicts index 530012e5d..b91804826 100755 --- a/test/integration/test-bug-612099-multiarch-conflicts +++ b/test/integration/test-bug-612099-multiarch-conflicts @@ -15,7 +15,7 @@ buildsimplenativepackage 'foobar' 'amd64' '1.0' 'stable' 'Depends: libc6' setupaptarchive -aptget install libc6:i386 -t stable -y -qq 2>&1 > /dev/null +testsuccess aptget install libc6:i386 -t stable -y testdpkginstalled libc6:i386 testequal 'Reading package lists... Building dependency tree... @@ -79,8 +79,8 @@ Conf libc6 (2.0 testing [all])' aptget upgrade -t testing -s # as APT (here i386) disagree about the native architecture, so # we fake it here: #aptget upgrade -y -qq 2>&1 > /dev/null -aptget purge libc6 -y -qq 2>&1 >/dev/null -aptget install libc6:i386 -y -qq 2>&1 >/dev/null +testsuccess aptget purge libc6 -y +testsuccess aptget install libc6:i386 -y testdpkginstalled libc6:all testequal 'Reading package lists... @@ -129,7 +129,7 @@ buildsimplenativepackage 'foobar-same' 'amd64' '1.0' 'stable' 'Depends: libc6-sa setupaptarchive -aptget install libc6-same:i386 -t stable -y -qq 2>&1 > /dev/null +testsuccess aptget install libc6-same:i386 -t stable -y testdpkginstalled libc6-same:i386 testequal 'Reading package lists... @@ -177,8 +177,8 @@ Conf libc6-same (2.0 testing [all])' aptget upgrade -t testing -s # as APT (here i386) disagree about the native architecture, so # we fake it here: #aptget upgrade -y -qq 2>&1 > /dev/null -aptget purge libc6-same -y -qq 2>&1 >/dev/null -aptget install libc6-same:i386 -y -qq 2>&1 >/dev/null +testsuccess aptget purge libc6-same -y +testsuccess aptget install libc6-same:i386 -y testdpkginstalled libc6-same:all diff --git a/test/integration/test-bug-612557-garbage-upgrade b/test/integration/test-bug-612557-garbage-upgrade index 8efd1687a..910b3b149 100755 --- a/test/integration/test-bug-612557-garbage-upgrade +++ b/test/integration/test-bug-612557-garbage-upgrade @@ -13,7 +13,7 @@ insertpackage 'unstable' 'libreoffice-common' 'all' '1:3.3.0-2' 'Conflicts: open setupaptarchive touch rootdir/var/lib/apt/extended_states -aptmark markauto python-uno openoffice.org-common +testsuccess aptmark markauto python-uno openoffice.org-common #aptmark unmarkauto openoffice.org-emailmerge testmarkedauto python-uno openoffice.org-common @@ -32,7 +32,7 @@ The following packages will be upgraded: After this operation, 53.2 MB disk space will be freed. E: Trivial Only specified but this is not a trivial operation.' aptget --trivial-only install python-uno -aptmark markauto openoffice.org-emailmerge +testsuccess aptmark markauto openoffice.org-emailmerge testmarkedauto python-uno openoffice.org-common openoffice.org-emailmerge testequal 'Reading package lists... diff --git a/test/integration/test-bug-612958-use-dpkg-multiarch-config b/test/integration/test-bug-612958-use-dpkg-multiarch-config index 18b964636..4d1f00ca0 100755 --- a/test/integration/test-bug-612958-use-dpkg-multiarch-config +++ b/test/integration/test-bug-612958-use-dpkg-multiarch-config @@ -14,13 +14,13 @@ insertinstalledpackage 'libapt' 'armel' '1.0' testpass() { rm rootdir/var/cache/apt/*.bin msgtest 'Test architecture handling' "$1 with $2" - aptcache show libapt:$2 2> /dev/null > /dev/null && msgpass || msgfail + testsuccess --nomsg aptcache show libapt:$2 } testfail() { rm rootdir/var/cache/apt/*.bin msgtest 'Test architecture handling' "$1 with $2" - aptcache show libapt:$2 2> /dev/null > /dev/null && msgfail || msgpass + testfailure --nomsg aptcache show libapt:$2 } testpass 'no config' 'i386' diff --git a/test/integration/test-bug-613420-new-garbage-dependency b/test/integration/test-bug-613420-new-garbage-dependency index 7a08871ca..9d9f1096a 100755 --- a/test/integration/test-bug-613420-new-garbage-dependency +++ b/test/integration/test-bug-613420-new-garbage-dependency @@ -15,7 +15,7 @@ insertpackage 'unstable' 'openoffice.org-officebean' 'all' '1:3.3.0-5' 'Depends: setupaptarchive touch rootdir/var/lib/apt/extended_states -aptmark markauto openoffice.org-officebean +testsuccess aptmark markauto openoffice.org-officebean testmarkedauto openoffice.org-officebean testequal "Reading package lists... diff --git a/test/integration/test-bug-64141-install-dependencies-for-on-hold b/test/integration/test-bug-64141-install-dependencies-for-on-hold index e2d206fdd..9a9e7be10 100755 --- a/test/integration/test-bug-64141-install-dependencies-for-on-hold +++ b/test/integration/test-bug-64141-install-dependencies-for-on-hold @@ -31,7 +31,7 @@ The following packages will be upgraded: After this operation, 0 B of additional disk space will be used. E: Trivial Only specified but this is not a trivial operation.' aptget dist-upgrade --trivial-only -aptmark hold apt -qq +testsuccess aptmark hold apt testequal 'Reading package lists... Building dependency tree... diff --git a/test/integration/test-bug-673536-pre-depends-breaks-loop b/test/integration/test-bug-673536-pre-depends-breaks-loop index e9d3c4de6..f6a90b21f 100755 --- a/test/integration/test-bug-673536-pre-depends-breaks-loop +++ b/test/integration/test-bug-673536-pre-depends-breaks-loop @@ -15,9 +15,9 @@ setupaptarchive # we check with 'real' packages here as the simulation reports a 'Conf broken' # which is technical correct for the simulation, but testing errormsg is ugly -aptget install basic=1 -qq > /dev/null +testsuccess aptget install basic=1 -y testdpkginstalled basic testdpkgnotinstalled common -aptget dist-upgrade -qq > /dev/null +testsuccess aptget dist-upgrade -y testdpkginstalled basic common diff --git a/test/integration/test-bug-679371-apt-get-autoclean-multiarch b/test/integration/test-bug-679371-apt-get-autoclean-multiarch index ba6857b73..b62d437aa 100755 --- a/test/integration/test-bug-679371-apt-get-autoclean-multiarch +++ b/test/integration/test-bug-679371-apt-get-autoclean-multiarch @@ -14,8 +14,8 @@ setupaptarchive changetowebserver -aptget update -qq -aptget install pkgall pkgnative pkgforeign -y -qq > /dev/null +testsuccess aptget update +testsuccess aptget install pkgall pkgnative pkgforeign -y testdpkginstalled pkgall pkgnative pkgforeign diff --git a/test/integration/test-bug-686346-package-missing-architecture b/test/integration/test-bug-686346-package-missing-architecture index b2c9ec9ee..3b02811ca 100755 --- a/test/integration/test-bug-686346-package-missing-architecture +++ b/test/integration/test-bug-686346-package-missing-architecture @@ -58,13 +58,13 @@ Building dependency tree... # pkgd has no update with an architecture testdpkginstalled pkgd msgtest 'Test apt-get purge' 'pkgd' -aptget purge pkgd -y >/dev/null 2>&1 && msgpass || msgfail +testsuccess --nomsg aptget purge pkgd -y testdpkgnotinstalled pkgd # there is a pkgb with an architecture testdpkginstalled pkgb msgtest 'Test apt-get purge' 'pkgb:none' -aptget purge pkgb:none -y >/dev/null 2>&1 && msgpass || msgfail +testsuccess --nomsg aptget purge pkgb:none -y testdpkgnotinstalled pkgb # check that dependencies are created after the none package exists in the cache diff --git a/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch b/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch index a89cb7191..af65397ea 100755 --- a/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch +++ b/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch @@ -42,7 +42,7 @@ enablehookversion 3 observehook() { rm -f ${hook}-v2.list ${hook}-v3.list msgtest 'Observe hooks while' "$*" - aptget "$@" -y --force-yes >/dev/null 2>&1 && msgpass || msgfail + testsuccess --nomsg aptget "$@" -y --force-yes } observehook install stuff -t stable diff --git a/test/integration/test-bug-717891-abolute-uris-for-proxies b/test/integration/test-bug-717891-abolute-uris-for-proxies index e9c38492e..ac1d6ec11 100755 --- a/test/integration/test-bug-717891-abolute-uris-for-proxies +++ b/test/integration/test-bug-717891-abolute-uris-for-proxies @@ -12,12 +12,12 @@ setupaptarchive changetowebserver --request-absolute='uri' msgtest 'Check that absolute paths are' 'not accepted' -aptget update >/dev/null 2>&1 && msgfail || msgpass +testfailure --nomsg aptget update echo 'Acquire::http::Proxy "http://localhost:8080";' > rootdir/etc/apt/apt.conf.d/99proxy msgtest 'Check that requests to proxies are' 'absolute uris' -aptget update >/dev/null 2>&1 && msgpass || msgfail +testsuccess --nomsg aptget update testequal 'Reading package lists... Building dependency tree... diff --git a/test/integration/test-compressed-indexes b/test/integration/test-compressed-indexes index a5e885745..c6f5ab49e 100755 --- a/test/integration/test-compressed-indexes +++ b/test/integration/test-compressed-indexes @@ -46,10 +46,10 @@ testrun() { msgpass fi msgtest "Check if package is downloadable" - aptget install -d testpkg -qq && msgpass || msgfail - msgtest "\tdeb file is present"; test -f rootdir/var/cache/apt/archives/testpkg_1.0_i386.deb && msgpass || msgfail + testsuccess --nomsg aptget install -d testpkg + msgtest "\tdeb file is present"; testsuccess --nomsg test -f rootdir/var/cache/apt/archives/testpkg_1.0_i386.deb aptget clean - msgtest "\tdeb file is gone"; ! test -f rootdir/var/cache/apt/archives/testpkg_1.0_i386.deb && msgpass || msgfail + msgtest "\tdeb file is gone"; testfailure --nomsg test -f rootdir/var/cache/apt/archives/testpkg_1.0_i386.deb fi rm -f rootdir/var/cache/apt/pkgcache.bin rootdir/var/cache/apt/srcpkgcache.bin testequal "$GOODSHOW" aptcache show testpkg @@ -62,9 +62,9 @@ testrun() { testequal "$GOODSHOWSRC" aptcache showsrc testpkg aptget clean msgtest "Check if the source is aptgetable" - aptget source testpkg -qq 2> /dev/null > /dev/null && msgpass || msgfail - msgtest "\tdsc file is present"; test -f testpkg_1.0.dsc && msgpass || msgfail - msgtest "\tdirectory is present"; test -d testpkg-1.0 && msgpass || msgfail + testsuccess --nomsg aptget source testpkg + msgtest "\tdsc file is present"; testsuccess --nomsg test -f testpkg_1.0.dsc + msgtest "\tdirectory is present"; testsuccess --nomsg test -d testpkg-1.0 rm -rf testpkg-1.0 } @@ -72,11 +72,11 @@ echo 'Acquire::GzipIndexes "false";' > rootdir/etc/apt/apt.conf.d/02compressinde msgmsg "File: Test with uncompressed indexes" testrun -aptget update -qq -o Acquire::Pdiffs=1 +testsuccess aptget update -o Acquire::Pdiffs=1 msgmsg "File: Test with uncompressed indexes (update unchanged with pdiffs)" testrun -aptget update -qq -o Acquire::Pdiffs=0 +testsuccess aptget update -o Acquire::Pdiffs=0 msgmsg "File: Test with uncompressed indexes (update unchanged without pdiffs)" testrun @@ -84,21 +84,21 @@ rm -rf rootdir/var/lib/apt/lists echo 'Acquire::CompressionTypes::Order:: "gz"; Acquire::GzipIndexes "true";' > rootdir/etc/apt/apt.conf.d/02compressindex -aptget update -qq +testsuccess aptget update msgmsg "File: Test with compressed indexes" testrun "compressed" -aptget update -qq -o Acquire::Pdiffs=1 +testsuccess aptget update -o Acquire::Pdiffs=1 msgmsg "File: Test with compressed indexes (update unchanged with pdiffs)" testrun "compressed" -aptget update -qq -o Acquire::Pdiffs=0 +testsuccess aptget update -o Acquire::Pdiffs=0 msgmsg "File: Test with compressed indexes (update unchanged without pdiffs)" testrun "compressed" rm rootdir/etc/apt/apt.conf.d/02compressindex changetowebserver -aptget update -qq +testsuccess aptget update GOODPOLICY="$(aptcache policy testpkg)" test $(echo "$GOODPOLICY" | grep -e '^testpkg:' -e '^ Candidate:' -e '^ Installed: (none)' -e '500 http://' | wc -l) -eq 4 testequal "$GOODPOLICY" aptcache policy testpkg @@ -106,11 +106,11 @@ testequal "$GOODPOLICY" aptcache policy testpkg msgmsg "HTTP: Test with uncompressed indexes" testrun -aptget update -qq -o Acquire::Pdiffs=1 +testsuccess aptget update -o Acquire::Pdiffs=1 msgmsg "HTTP: Test with uncompressed indexes (update unchanged with pdiffs)" testrun -aptget update -qq -o Acquire::Pdiffs=0 +testsuccess aptget update -o Acquire::Pdiffs=0 msgmsg "HTTP: Test with uncompressed indexes (update unchanged without pdiffs)" testrun @@ -118,14 +118,14 @@ rm -rf rootdir/var/lib/apt/lists echo 'Acquire::CompressionTypes::Order:: "gz"; Acquire::GzipIndexes "true";' > rootdir/etc/apt/apt.conf.d/02compressindex -aptget update -qq +testsuccess aptget update msgmsg "HTTP: Test with compressed indexes" testrun "compressed" -aptget update -qq -o Acquire::Pdiffs=1 +testsuccess aptget update -o Acquire::Pdiffs=1 msgmsg "HTTP: Test with compressed indexes (update unchanged with pdiffs)" testrun "compressed" -aptget update -qq -o Acquire::Pdiffs=0 +testsuccess aptget update -o Acquire::Pdiffs=0 msgmsg "HTTP: Test with compressed indexes (update unchanged without pdiffs)" testrun "compressed" diff --git a/test/integration/test-cve-2013-1051-InRelease-parsing b/test/integration/test-cve-2013-1051-InRelease-parsing index 6764fefff..41b27f691 100755 --- a/test/integration/test-cve-2013-1051-InRelease-parsing +++ b/test/integration/test-cve-2013-1051-InRelease-parsing @@ -14,7 +14,7 @@ setupaptarchive changetowebserver ARCHIVE='http://localhost:8080/' msgtest 'Initial apt-get update should work with' 'InRelease' -aptget update -qq && msgpass || msgfail +testsuccess --nomsg aptget update # check that the setup is correct testequal "good-pkg: diff --git a/test/integration/test-disappearing-packages b/test/integration/test-disappearing-packages index d2ac4edc6..09dbf7014 100755 --- a/test/integration/test-disappearing-packages +++ b/test/integration/test-disappearing-packages @@ -29,7 +29,7 @@ rm -rf "$BUILDDIR" setupaptarchive -aptget install old-pkg=1.0 --trivial-only -qq 2>&1 > /dev/null +testsuccess aptget install old-pkg=1.0 --trivial-only testmarkedauto # old-pkg is manual installed diff --git a/test/integration/test-pdiff-usage b/test/integration/test-pdiff-usage index e45326970..994489ee5 100755 --- a/test/integration/test-pdiff-usage +++ b/test/integration/test-pdiff-usage @@ -11,7 +11,7 @@ buildaptarchive setupflataptarchive changetowebserver signreleasefiles -aptget update -qq +testsuccess aptget update testnopackage newstuff PKGFILE="${TESTDIR}/$(echo "$(basename $0)" | sed 's#^test-#Packages-#')" @@ -38,7 +38,7 @@ SHA1-Patches: generatereleasefiles '+1hour' signreleasefiles find aptarchive -name 'Packages*' -type f -delete -aptget update -qq +testsuccess aptget update testnopackage oldstuff testequal "$(cat ${PKGFILE}-new) diff --git a/test/integration/test-policy-pinning b/test/integration/test-policy-pinning index 9e1ea4ac5..8eb4bcbad 100755 --- a/test/integration/test-policy-pinning +++ b/test/integration/test-policy-pinning @@ -228,16 +228,16 @@ testequalpolicycoolstuff "" "2.0~bpo1" 990 500 600 "2.0~bpo1" -o Test=ButAutomat testequalpolicycoolstuff "" "1.0" 100 990 600 "2.0~bpo1" -o Test=ButAutomaticUpgrades -t stable rm rootdir/etc/apt/preferences -aptget install coolstuff -qq > /dev/null 2> /dev/null +testsuccess aptget install coolstuff -y testequalpolicycoolstuff "1.0" "1.0" 100 500 0 "" -o Test=ButAutomaticUpgrades -aptget dist-upgrade -qq > /dev/null 2> /dev/null +testsuccess aptget dist-upgrade -y testequalpolicycoolstuff "1.0" "1.0" 100 500 0 "" -o Test=ButAutomaticUpgrades testequalpolicycoolstuff "1.0" "1.0" 100 990 0 "" -o Test=ButAutomaticUpgrades -t stable testequalpolicycoolstuff "1.0" "2.0~bpo1" 990 500 0 "" -o Test=ButAutomaticUpgrades -t backports -aptget install coolstuff -t backports -qq > /dev/null 2> /dev/null +testsuccess aptget install coolstuff -t backports -y testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 100 500 0 "" -o Test=ButAutomaticUpgrades -aptget dist-upgrade -qq > /dev/null 2> /dev/null +testsuccess aptget dist-upgrade -y testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 100 500 0 "" -o Test=ButAutomaticUpgrades testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 100 990 0 "" -o Test=ButAutomaticUpgrades -t stable testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 990 500 0 "" -o Test=ButAutomaticUpgrades -t backports diff --git a/test/integration/test-releasefile-valid-until b/test/integration/test-releasefile-valid-until index 680a370cb..e673d5f71 100755 --- a/test/integration/test-releasefile-valid-until +++ b/test/integration/test-releasefile-valid-until @@ -32,64 +32,64 @@ aptgetupdate() { setupreleasefile msgtest 'Release file is accepted as it has' 'no Until' -aptgetupdate && msgpass || msgfail +testsuccess --nomsg aptgetupdate setupreleasefile msgtest 'Release file is accepted as it has' 'no Until and good Max-Valid' -aptgetupdate -o Acquire::Max-ValidTime=3600 && msgpass || msgfail +testsuccess --nomsg aptgetupdate -o Acquire::Max-ValidTime=3600 setupreleasefile 'now - 2 days' msgtest 'Release file is rejected as it has' 'no Until, but bad Max-Valid' -aptgetupdate -o Acquire::Max-ValidTime=3600 && msgfail || msgpass +testfailure --nomsg aptgetupdate -o Acquire::Max-ValidTime=3600 setupreleasefile 'now - 3 days' 'now + 1 day' msgtest 'Release file is accepted as it has' 'good Until' -aptgetupdate && msgpass || msgfail +testsuccess --nomsg aptgetupdate setupreleasefile 'now - 7 days' 'now - 4 days' msgtest 'Release file is rejected as it has' 'bad Until' -aptgetupdate && msgfail || msgpass +testfailure --nomsg aptgetupdate setupreleasefile 'now - 7 days' 'now - 4 days' msgtest 'Release file is rejected as it has' 'bad Until (ignore good Max-Valid)' -aptgetupdate -o Acquire::Max-ValidTime=1209600 && msgfail || msgpass +testfailure --nomsg aptgetupdate -o Acquire::Max-ValidTime=1209600 setupreleasefile 'now - 7 days' 'now - 4 days' msgtest 'Release file is rejected as it has' 'bad Max-Valid (bad Until)' -aptgetupdate -o Acquire::Max-ValidTime=86400 && msgfail || msgpass +testfailure --nomsg aptgetupdate -o Acquire::Max-ValidTime=86400 setupreleasefile 'now - 7 days' 'now + 4 days' msgtest 'Release file is rejected as it has' 'bad Max-Valid (good Until)' -aptgetupdate -o Acquire::Max-ValidTime=86400 && msgfail || msgpass +testfailure --nomsg aptgetupdate -o Acquire::Max-ValidTime=86400 setupreleasefile 'now - 7 days' 'now + 4 days' msgtest 'Release file is accepted as it has' 'good labeled Max-Valid' -aptgetupdate -o Acquire::Max-ValidTime=86400 -o Acquire::Max-ValidTime::Testcases=1209600 && msgpass || msgfail +testsuccess --nomsg aptgetupdate -o Acquire::Max-ValidTime=86400 -o Acquire::Max-ValidTime::Testcases=1209600 setupreleasefile 'now - 7 days' 'now + 4 days' msgtest 'Release file is rejected as it has' 'bad labeled Max-Valid' -aptgetupdate -o Acquire::Max-ValidTime=1209600 -o Acquire::Max-ValidTime::Testcases=86400 && msgfail || msgpass +testfailure --nomsg aptgetupdate -o Acquire::Max-ValidTime=1209600 -o Acquire::Max-ValidTime::Testcases=86400 setupreleasefile 'now - 7 days' 'now + 1 days' msgtest 'Release file is accepted as it has' 'good Until (good Min-Valid, no Max-Valid)' -aptgetupdate -o Acquire::Min-ValidTime=1209600 && msgpass || msgfail +testsuccess --nomsg aptgetupdate -o Acquire::Min-ValidTime=1209600 setupreleasefile 'now - 7 days' 'now - 4 days' msgtest 'Release file is accepted as it has' 'good Min-Valid (bad Until, no Max-Valid)' -aptgetupdate -o Acquire::Min-ValidTime=1209600 && msgpass || msgfail +testsuccess --nomsg aptgetupdate -o Acquire::Min-ValidTime=1209600 setupreleasefile 'now - 7 days' 'now - 2 days' msgtest 'Release file is accepted as it has' 'good Min-Valid (bad Until, good Max-Valid) <' -aptgetupdate -o Acquire::Min-ValidTime=1209600 -o Acquire::Max-ValidTime=2419200 && msgpass || msgfail +testsuccess --nomsg aptgetupdate -o Acquire::Min-ValidTime=1209600 -o Acquire::Max-ValidTime=2419200 setupreleasefile 'now - 7 days' 'now - 2 days' msgtest 'Release file is rejected as it has' 'bad Max-Valid (bad Until, good Min-Valid) >' -aptgetupdate -o Acquire::Max-ValidTime=12096 -o Acquire::Min-ValidTime=2419200 && msgfail || msgpass +testfailure --nomsg aptgetupdate -o Acquire::Max-ValidTime=12096 -o Acquire::Min-ValidTime=2419200 setupreleasefile 'now - 7 days' 'now - 2 days' msgtest 'Release file is rejected as it has' 'bad Max-Valid (bad Until, bad Min-Valid) <' -aptgetupdate -o Acquire::Min-ValidTime=12096 -o Acquire::Max-ValidTime=241920 && msgfail || msgpass +testfailure --nomsg aptgetupdate -o Acquire::Min-ValidTime=12096 -o Acquire::Max-ValidTime=241920 setupreleasefile 'now - 7 days' 'now - 2 days' msgtest 'Release file is rejected as it has' 'bad Max-Valid (bad Until, bad Min-Valid) >' -aptgetupdate -o Acquire::Max-ValidTime=12096 -o Acquire::Min-ValidTime=241920 && msgfail || msgpass +testfailure --nomsg aptgetupdate -o Acquire::Max-ValidTime=12096 -o Acquire::Min-ValidTime=241920 diff --git a/test/integration/test-ubuntu-bug-761175-remove-purge b/test/integration/test-ubuntu-bug-761175-remove-purge index f55c6e909..14648e9b8 100755 --- a/test/integration/test-ubuntu-bug-761175-remove-purge +++ b/test/integration/test-ubuntu-bug-761175-remove-purge @@ -18,12 +18,10 @@ setupaptarchive testdpkgnotinstalled compiz-core -msgtest 'Install package' 'compiz-core' -aptget install compiz-core -qq 2>&1 >/dev/null && msgpass || msgfail +testsuccess aptget install compiz-core testdpkginstalled compiz-core -msgtest 'Remove package' 'compiz-core' -aptget remove compiz-core -y -qq 2>&1 >/dev/null && msgpass || msgfail +testsuccess aptget remove compiz-core -y testdpkgnotinstalled compiz-core msgtest 'Check that conffiles are still around for' 'compiz-core' diff --git a/test/integration/test-ubuntu-bug-784473-InRelease-one-message-only b/test/integration/test-ubuntu-bug-784473-InRelease-one-message-only index fad5488fb..e9d684309 100755 --- a/test/integration/test-ubuntu-bug-784473-InRelease-one-message-only +++ b/test/integration/test-ubuntu-bug-784473-InRelease-one-message-only @@ -28,7 +28,7 @@ MD5Sum: done msgtest 'The unsigned garbage before signed block is' 'ignored' -aptget update -qq > /dev/null 2>&1 && msgpass || msgfail +testsuccess --nomsg aptget update ROOTDIR="$(readlink -f .)" testequal "Package files: -- cgit v1.2.3 From ffcccd62f0d5822a71e24baf84126af5c93a5e69 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 10 Aug 2013 12:40:37 +0200 Subject: fix: --print-uris removes authentication MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The constructors of our (clear)sign-acquire-items move a pre-existent file for error-recovery away, which gets restored or discarded later as the acquire progresses, but --print-uris never really starts the acquire process, so the files aren't restored (as they should). To fix this both get a destructor which checks for signs of acquire doing anything and if it hasn't the file is restored. Note that these virtual destructors theoretically break the API, but only with classes extending the sign-acquire-items and nobody does this, as it would be insane for library users to fiddle with Acquire internals – and these classes are internals. Closes: 719263 --- test/integration/test-bug-602412-dequote-redirect | 2 +- ...st-bug-719263-print-uris-removes-authentication | 41 ++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100755 test/integration/test-bug-719263-print-uris-removes-authentication (limited to 'test/integration') diff --git a/test/integration/test-bug-602412-dequote-redirect b/test/integration/test-bug-602412-dequote-redirect index 764e13667..bcebb57b8 100755 --- a/test/integration/test-bug-602412-dequote-redirect +++ b/test/integration/test-bug-602412-dequote-redirect @@ -26,4 +26,4 @@ Hit http://localhost:8080 unstable/main Translation-en Reading package lists...' aptget update #-o debug::pkgacquire=1 -o debug::pkgacquire::worker=1 msgtest 'Test redirection works in' 'package download' -testsuccess --nomsg aptget install unrelated --download-only +testsuccess --nomsg aptget install unrelated --download-only -y diff --git a/test/integration/test-bug-719263-print-uris-removes-authentication b/test/integration/test-bug-719263-print-uris-removes-authentication new file mode 100755 index 000000000..1c1a27ceb --- /dev/null +++ b/test/integration/test-bug-719263-print-uris-removes-authentication @@ -0,0 +1,41 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework + +setupenvironment +configarchitecture 'amd64' + +insertinstalledpackage 'unrelated' 'all' '1' +buildsimplenativepackage 'unrelated' 'all' '2' 'unstable' + +setupaptarchive + +testnoact() { + cp -a rootdir/var/lib/dpkg/status rootdir/var/lib/dpkg/status-backup-noact + touch rootdir/var/lib/apt/extended_states + testequal 'Reading package lists... +Building dependency tree... +Reading state information... +The following packages will be upgraded: + unrelated +1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. +Inst unrelated [1] (2 unstable [all]) +Conf unrelated (2 unstable [all])' aptget install unrelated -s + testsuccess aptget install unrelated -y + testdpkginstalled unrelated + cp -a rootdir/var/lib/dpkg/status-backup-noact rootdir/var/lib/dpkg/status +} + +testnoact +testsuccess aptget update --print-uris +testnoact + +# same thing, just not with InRelease this time +rm -rf rootdir/var/lib/apt/lists +testsuccess aptget update -o Acquire::TryInRelease=0 + +testnoact +testsuccess aptget update --print-uris -o Acquire::TryInRelease=0 +testnoact -- cgit v1.2.3 From 7a2690a3bf59244fff417ab494f68fd9301b74d9 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 13 Jul 2013 22:57:44 +0200 Subject: fix output redirection order First redirect output to a file, then redirect other outputs to this output, not the other way around as this will not work. Git-Dch: Ignore --- test/integration/framework | 6 +++--- test/integration/skip-avoid-avoiding-breaks-predepends | 2 +- test/integration/test-bug-612099-multiarch-conflicts | 4 ++-- test/integration/test-bug-618288-multiarch-same-lockstep | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'test/integration') diff --git a/test/integration/framework b/test/integration/framework index e363977f5..005e31bd3 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -177,7 +177,7 @@ setupenvironment() { echo "DPKG::options:: \"--root=${TMPWORKINGDIRECTORY}/rootdir\";" >> aptconfig.conf echo "DPKG::options:: \"--force-not-root\";" >> aptconfig.conf echo "DPKG::options:: \"--force-bad-path\";" >> aptconfig.conf - if ! $(which dpkg) --assert-multi-arch 2>&1 > /dev/null; then + if ! $(which dpkg) --assert-multi-arch >/dev/null 2>&1; then echo "DPKG::options:: \"--force-architecture\";" >> aptconfig.conf # Added to test multiarch before dpkg is ready for it… fi echo "DPKG::options:: \"--log=${TMPWORKINGDIRECTORY}/rootdir/var/log/dpkg.log\";" >> aptconfig.conf @@ -225,7 +225,7 @@ configdpkg() { echo -n > rootdir/var/lib/dpkg/status fi fi - if $(which dpkg) --assert-multi-arch 2>&1 > /dev/null; then + if $(which dpkg) --assert-multi-arch >/dev/null 2>&1; then local ARCHS="$(getarchitectures)" if echo "$ARCHS" | grep -E -q '[^ ]+ [^ ]+'; then DPKGARCH="$(dpkg --print-architecture)" @@ -851,7 +851,7 @@ testequalor2() { echo "$2" > $COMPAREFILE2 shift 2 msgtest "Test for equality OR of" "$*" - $* 2>&1 1> $COMPAREAGAINST + $* >$COMPAREAGAINST 2>&1 (checkdiff $COMPAREFILE1 $COMPAREAGAINST 1> /dev/null || checkdiff $COMPAREFILE2 $COMPAREAGAINST 1> /dev/null) && msgpass || ( echo "\n${CINFO}Diff against OR 1${CNORMAL}" "$(checkdiff $COMPAREFILE1 $COMPAREAGAINST)" \ diff --git a/test/integration/skip-avoid-avoiding-breaks-predepends b/test/integration/skip-avoid-avoiding-breaks-predepends index a47e8bc2b..ed231bc3f 100755 --- a/test/integration/skip-avoid-avoiding-breaks-predepends +++ b/test/integration/skip-avoid-avoiding-breaks-predepends @@ -17,5 +17,5 @@ Pre-Depends: looping (>= 1.15)' setupaptarchive -aptget dist-upgrade -y -o Debug::pkgOrderList=1 #-qq 2>&1 > /dev/null +aptget dist-upgrade -y -o Debug::pkgOrderList=1 #-qq >/dev/null 2>&1 testdpkginstalled looping loop1 loop2 diff --git a/test/integration/test-bug-612099-multiarch-conflicts b/test/integration/test-bug-612099-multiarch-conflicts index b91804826..20dc3a7e5 100755 --- a/test/integration/test-bug-612099-multiarch-conflicts +++ b/test/integration/test-bug-612099-multiarch-conflicts @@ -78,7 +78,7 @@ Conf libc6 (2.0 testing [all])' aptget upgrade -t testing -s # FIXME: on amd64 systems this test wouldn't run with a real upgrade # as APT (here i386) disagree about the native architecture, so # we fake it here: -#aptget upgrade -y -qq 2>&1 > /dev/null +#aptget upgrade -y -qq >/dev/null 2>&1 testsuccess aptget purge libc6 -y testsuccess aptget install libc6:i386 -y testdpkginstalled libc6:all @@ -176,7 +176,7 @@ Conf libc6-same (2.0 testing [all])' aptget upgrade -t testing -s # FIXME: on amd64 systems this test wouldn't run with a real upgrade # as APT (here i386) disagree about the native architecture, so # we fake it here: -#aptget upgrade -y -qq 2>&1 > /dev/null +#aptget upgrade -y -qq >/dev/null 2>&1 testsuccess aptget purge libc6-same -y testsuccess aptget install libc6-same:i386 -y testdpkginstalled libc6-same:all diff --git a/test/integration/test-bug-618288-multiarch-same-lockstep b/test/integration/test-bug-618288-multiarch-same-lockstep index fde075172..e0305b64b 100755 --- a/test/integration/test-bug-618288-multiarch-same-lockstep +++ b/test/integration/test-bug-618288-multiarch-same-lockstep @@ -16,7 +16,7 @@ buildsimplenativepackage 'apt' 'i386' '2' 'unstable' 'Depends: libsame (= 2)' '' buildsimplenativepackage 'apt2' 'amd64' '2' 'unstable' 'Depends: libsame (= 2)' '' 'required' setupaptarchive -aptget dist-upgrade -s 2>&1 > output.apt +aptget dist-upgrade -s >output.apt 2>&1 # order in switch libsame:{amd64,i386} are unpacked is irrelevant, as both are installed - but we need to do it together LS_U_AMD="$(grep -o -n '^Inst libsame ' output.apt | cut -d: -f1)" -- cgit v1.2.3 From 80f3aeb04d043356bd98de7714fc164b3fff3861 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 12 Aug 2013 00:36:52 +0200 Subject: make the keyring locations in apt-key configurable Might come in handy for more than just a simple testcase. --- test/integration/test-apt-key | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100755 test/integration/test-apt-key (limited to 'test/integration') diff --git a/test/integration/test-apt-key b/test/integration/test-apt-key new file mode 100755 index 000000000..5beb6f220 --- /dev/null +++ b/test/integration/test-apt-key @@ -0,0 +1,39 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework + +setupenvironment +configarchitecture 'amd64' + +msgtest 'Check that paths in list output are not' 'double-slashed' +aptkey list 2>&1 | grep -q '//' && msgfail || msgpass + +msgtest 'Check that paths in finger output are not' 'double-slashed' +aptkey finger 2>&1 | grep -q '//' && msgfail || msgpass + +echo 'APT::Key::ArchiveKeyring "./keys/joesixpack.pub"; +APT::Key::RemovedKeys "./keys/rexexpired.pub";' > rootdir/etc/apt/apt.conf.d/aptkey.conf + +aptkey list | grep '^pub' > aptkey.list +testfileequal ./aptkey.list 'pub 2048R/DBAC8DAE 2010-08-18' + +testequal 'gpg: key DBAC8DAE: "Joe Sixpack (APT Testcases Dummy) " not changed +gpg: Total number processed: 1 +gpg: unchanged: 1' aptkey --fakeroot update + +aptkey list | grep '^pub' > aptkey.list +testfileequal ./aptkey.list 'pub 2048R/DBAC8DAE 2010-08-18' + +testsuccess aptkey --fakeroot add ./keys/rexexpired.pub + +aptkey list | grep '^pub' > aptkey.list +testfileequal ./aptkey.list 'pub 2048R/27CE74F9 2013-07-12 [expired: 2013-07-13] +pub 2048R/DBAC8DAE 2010-08-18' + +msgtest 'Execute update again to trigger removal of' 'Rex Expired key' +testsuccess --nomsg aptkey --fakeroot update + +aptkey list | grep '^pub' > aptkey.list +testfileequal ./aptkey.list 'pub 2048R/DBAC8DAE 2010-08-18' -- cgit v1.2.3 From 804d4a0d92a2e107aad38198ac08f1d2d64b5e53 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 12 Aug 2013 15:51:42 +0200 Subject: ensure that testcases exiting because of set -e aren't successful Git-Dch: Ignore --- test/integration/framework | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'test/integration') diff --git a/test/integration/framework b/test/integration/framework index 005e31bd3..72c899e32 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -131,13 +131,23 @@ exitwithstatus() { exit $((EXIT_CODE <= 255 ? EXIT_CODE : 255)); } +shellsetedetector() { + local exit_status=$? + if [ "$exit_status" != '0' ]; then + echo >&2 "${CERROR}E: Looks like the testcases ended prematurely with exitcode: ${exit_status}${CNORMAL}" + if [ "$EXIT_CODE" = '0' ]; then + EXIT_CODE="$exit_status" + fi + fi +} + addtrap() { if [ "$1" = 'prefix' ]; then CURRENTTRAP="$2 $CURRENTTRAP" else CURRENTTRAP="$CURRENTTRAP $1" fi - trap "$CURRENTTRAP exitwithstatus;" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM + trap "shellsetedetector; $CURRENTTRAP exitwithstatus;" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM } setupenvironment() { -- cgit v1.2.3 From 04937adc655ceda0b3367f540e76df10296cfba1 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 12 Aug 2013 16:19:37 +0200 Subject: let apt-key del work better with softlink and single key keyrings Having fragement files means there is a good chance that there is one key per keyring, so deal with that as well as with setups in which keyrings are linked into trusted.gpg.d as we can't just modify those files (they might be in /usr for example). --- test/integration/test-apt-key | 68 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) (limited to 'test/integration') diff --git a/test/integration/test-apt-key b/test/integration/test-apt-key index 5beb6f220..68b3f9710 100755 --- a/test/integration/test-apt-key +++ b/test/integration/test-apt-key @@ -37,3 +37,71 @@ testsuccess --nomsg aptkey --fakeroot update aptkey list | grep '^pub' > aptkey.list testfileequal ./aptkey.list 'pub 2048R/DBAC8DAE 2010-08-18' + +msgtest "Try to remove a key which exists, but isn't in the" 'forced keyring' +testsuccess --nomsg aptkey --fakeroot --keyring rootdir/etc/apt/trusted.gpg del DBAC8DAE + +aptkey list | grep '^pub' > aptkey.list +testfileequal ./aptkey.list 'pub 2048R/DBAC8DAE 2010-08-18' + +testsuccess aptkey --fakeroot del DBAC8DAE +testempty aptkey list + +# start from a clean plate again +cleanplate() { + rm -rf rootdir/etc/apt/trusted.gpg.d/ rootdir/etc/apt/trusted.gpg + mkdir rootdir/etc/apt/trusted.gpg.d/ +} + +msgtest 'Test key removal with' 'single key in real file' +cleanplate +cp -a keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg +testsuccess --nomsg aptkey --fakeroot del DBAC8DAE +testempty aptkey list +testsuccess test ! -e rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg +testsuccess cmp keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg~ + +msgtest 'Test key removal with' 'single key in softlink' +cleanplate +ln -s $(readlink -f ./keys/joesixpack.pub) rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg +testsuccess --nomsg aptkey --fakeroot del DBAC8DAE +testempty aptkey list +testsuccess test ! -e rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg +testsuccess test -L rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg~ + +cleanplate +testsuccess aptkey --fakeroot add ./keys/joesixpack.pub +testsuccess aptkey --fakeroot add ./keys/marvinparanoid.pub +aptkey list | grep '^pub' > aptkey.list +testfileequal ./aptkey.list 'pub 2048R/DBAC8DAE 2010-08-18 +pub 2048R/528144E2 2011-01-16' +cp -a rootdir/etc/apt/trusted.gpg keys/testcase-multikey.pub # store for reuse + +msgtest 'Test key removal with' 'multi key in real file' +cleanplate +cp -a keys/testcase-multikey.pub rootdir/etc/apt/trusted.gpg.d/multikey.gpg +testsuccess --nomsg aptkey --fakeroot del DBAC8DAE +aptkey list | grep '^pub' > aptkey.list +testfileequal ./aptkey.list 'pub 2048R/528144E2 2011-01-16' +testsuccess cmp keys/testcase-multikey.pub rootdir/etc/apt/trusted.gpg.d/multikey.gpg~ + +msgtest 'Test key removal with' 'multi key in softlink' +cleanplate +ln -s $(readlink -f ./keys/testcase-multikey.pub) rootdir/etc/apt/trusted.gpg.d/multikey.gpg +testsuccess --nomsg aptkey --fakeroot del DBAC8DAE +aptkey list | grep '^pub' > aptkey.list +testfileequal ./aptkey.list 'pub 2048R/528144E2 2011-01-16' +testsuccess cmp keys/testcase-multikey.pub rootdir/etc/apt/trusted.gpg.d/multikey.gpg~ +testsuccess test ! -L rootdir/etc/apt/trusted.gpg.d/multikey.gpg +testsuccess test -L rootdir/etc/apt/trusted.gpg.d/multikey.gpg~ + +msgtest 'Test key removal with' 'multiple files including key' +cleanplate +cp -a keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg +cp -a keys/testcase-multikey.pub rootdir/etc/apt/trusted.gpg.d/multikey.gpg +testsuccess --nomsg aptkey --fakeroot del DBAC8DAE +aptkey list | grep '^pub' > aptkey.list +testfileequal ./aptkey.list 'pub 2048R/528144E2 2011-01-16' +testsuccess test ! -e rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg +testsuccess cmp keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg~ +testsuccess cmp keys/testcase-multikey.pub rootdir/etc/apt/trusted.gpg.d/multikey.gpg~ -- cgit v1.2.3 From 037374fe7260c104771d1b6d31c36a98385c2365 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 15 Aug 2013 16:45:09 +0200 Subject: set MALLOC_CHECK_ and MALLOC_PERTURB_ for testcases In bugreport deb:719629 Paul Wise mentions both to enable some malloc checks and as more testing can't hurt we enable both for all testcases. Git-Dch: Ignore --- test/integration/framework | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/integration') diff --git a/test/integration/framework b/test/integration/framework index 72c899e32..54d35fef8 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -88,11 +88,11 @@ msgdone() { runapt() { msgdebug "Executing: ${CCMD}$*${CDEBUG} " if [ -f ./aptconfig.conf ]; then - APT_CONFIG=aptconfig.conf LD_LIBRARY_PATH=${BUILDDIRECTORY} ${BUILDDIRECTORY}/$* - elif [ -f ../aptconfig.conf ]; then - APT_CONFIG=../aptconfig.conf LD_LIBRARY_PATH=${BUILDDIRECTORY} ${BUILDDIRECTORY}/$* + MALLOC_PERTURB_=21 MALLOC_CHECK_=2 APT_CONFIG=aptconfig.conf LD_LIBRARY_PATH=${BUILDDIRECTORY} ${BUILDDIRECTORY}/$* + elif [ -f ../aptconfig.conf ]; then + MALLOC_PERTURB_=21 MALLOC_CHECK_=2 APT_CONFIG=../aptconfig.conf LD_LIBRARY_PATH=${BUILDDIRECTORY} ${BUILDDIRECTORY}/$* else - LD_LIBRARY_PATH=${BUILDDIRECTORY} ${BUILDDIRECTORY}/$* + MALLOC_PERTURB_=21 MALLOC_CHECK_=2 LD_LIBRARY_PATH=${BUILDDIRECTORY} ${BUILDDIRECTORY}/$* fi } aptconfig() { runapt apt-config $*; } -- cgit v1.2.3 From 48498443e74b2a7e089709b954c50b7df374684b Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 13 Aug 2013 18:18:15 +0200 Subject: allow Pre-Install-Pkgs hooks to get info over an FD != stdin This adds ::InfoFD option alongside the ::Version one to request sending the information to the specified FD, by default it is STDIN as it was the case before. The environment variable APT_HOOK_INFO_FD contains the FD the data is on as a confirmation that the APT version used understood the request. Allowing the hook to choose the FD is needed/helpful e.g. for shellscripts which have a hard time accessing FDs above 9 (as >= 10 are usually used internally by them) Closes: #671728 --- ...bug-712116-dpkg-pre-install-pkgs-hook-multiarch | 94 +++++++++++++--------- 1 file changed, 55 insertions(+), 39 deletions(-) (limited to 'test/integration') diff --git a/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch b/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch index af65397ea..62355a6b5 100755 --- a/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch +++ b/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch @@ -26,95 +26,111 @@ hook='pre-install-pkgs' enablehookversion() { echo "#!/bin/sh -while read line; do +FD=0 +echo -n > ${hook}-v${1}.list +if [ -n \"${2}\" ]; then + FD=\$APT_HOOK_INFO_FD + if [ "\$FD" != \"${2}\" ]; then echo \"ERROR: Information is not on requested FD: \$FD != ${2}\" >> ${hook}-v${1}.list; fi +fi +while read ${hook}-v${1}.list" > ${hook}-v${1}.sh +done >> ${hook}-v${1}.list" > ${hook}-v${1}.sh chmod +x ${hook}-v${1}.sh echo "dpkg::${hook}:: \"./${hook}-v${1}.sh --foo -bar\"; DPkg::Tools::options::\"./${hook}-v${1}.sh\"::Version \"$1\";" > rootdir/etc/apt/apt.conf.d/hook-v$1 + if [ -n "$2" ]; then + echo "DPkg::Tools::options::\"./${hook}-v${1}.sh\"::InfoFD \"${2}\";" >> rootdir/etc/apt/apt.conf.d/hook-v$1 + fi } -enablehookversion 2 -enablehookversion 3 - observehook() { rm -f ${hook}-v2.list ${hook}-v3.list msgtest 'Observe hooks while' "$*" testsuccess --nomsg aptget "$@" -y --force-yes } -observehook install stuff -t stable -testfileequal "${hook}-v2.list" 'libsame - < 1 **CONFIGURE** +testrun() { + observehook install stuff -t stable + testfileequal "${hook}-v2.list" 'libsame - < 1 **CONFIGURE** toolkit - < 1 **CONFIGURE** stuff - < 1 **CONFIGURE**' -testfileequal "${hook}-v3.list" 'libsame - - none < 1 amd64 same **CONFIGURE** + testfileequal "${hook}-v3.list" 'libsame - - none < 1 amd64 same **CONFIGURE** toolkit - - none < 1 all foreign **CONFIGURE** stuff - - none < 1 amd64 none **CONFIGURE**' -observehook install stuff -t unstable -testfileequal "${hook}-v2.list" 'libsame 1 < 2 **CONFIGURE** + observehook install stuff -t unstable + testfileequal "${hook}-v2.list" 'libsame 1 < 2 **CONFIGURE** toolkit 1 < 2 **CONFIGURE** stuff 1 < 2 **CONFIGURE**' -testfileequal "${hook}-v3.list" 'libsame 1 amd64 same < 2 amd64 same **CONFIGURE** + testfileequal "${hook}-v3.list" 'libsame 1 amd64 same < 2 amd64 same **CONFIGURE** toolkit 1 all foreign < 2 amd64 foreign **CONFIGURE** stuff 1 amd64 none < 2 amd64 none **CONFIGURE**' -observehook install stuff:i386 -t unstable -testfileequal "${hook}-v2.list" 'stuff 2 > - **REMOVE** + observehook install stuff:i386 -t unstable + testfileequal "${hook}-v2.list" 'stuff 2 > - **REMOVE** libsame - < 2 **CONFIGURE** stuff - < 2 **CONFIGURE**' -testfileequal "${hook}-v3.list" 'stuff 2 amd64 none > - - none **REMOVE** + testfileequal "${hook}-v3.list" 'stuff 2 amd64 none > - - none **REMOVE** libsame - - none < 2 i386 same **CONFIGURE** stuff - - none < 2 i386 none **CONFIGURE**' -observehook remove libsame -testfileequal "${hook}-v2.list" 'libsame 2 > - **REMOVE**' -testfileequal "${hook}-v3.list" 'libsame 2 amd64 same > - - none **REMOVE**' + observehook remove libsame + testfileequal "${hook}-v2.list" 'libsame 2 > - **REMOVE**' + testfileequal "${hook}-v3.list" 'libsame 2 amd64 same > - - none **REMOVE**' -observehook install stuff:i386/stable libsame:i386/stable toolkit/stable -testfileequal "${hook}-v2.list" 'libsame 2 > 1 **CONFIGURE** + observehook install stuff:i386/stable libsame:i386/stable toolkit/stable + testfileequal "${hook}-v2.list" 'libsame 2 > 1 **CONFIGURE** toolkit 2 > 1 **CONFIGURE** stuff 2 > 1 **CONFIGURE**' -testfileequal "${hook}-v3.list" 'libsame 2 i386 same > 1 i386 same **CONFIGURE** + testfileequal "${hook}-v3.list" 'libsame 2 i386 same > 1 i386 same **CONFIGURE** toolkit 2 amd64 foreign > 1 all foreign **CONFIGURE** stuff 2 i386 none > 1 i386 none **CONFIGURE**' -observehook install 'libsame:*' -testfileequal "${hook}-v2.list" 'libsame 1 < 2 **CONFIGURE** + observehook install 'libsame:*' + testfileequal "${hook}-v2.list" 'libsame 1 < 2 **CONFIGURE** libsame - < 2 **CONFIGURE** toolkit 1 < 2 **CONFIGURE** stuff 1 < 2 **CONFIGURE**' -testfileequal "${hook}-v3.list" 'libsame 1 i386 same < 2 i386 same **CONFIGURE** + testfileequal "${hook}-v3.list" 'libsame 1 i386 same < 2 i386 same **CONFIGURE** libsame - - none < 2 amd64 same **CONFIGURE** toolkit 1 all foreign < 2 amd64 foreign **CONFIGURE** stuff 1 i386 none < 2 i386 none **CONFIGURE**' -observehook purge stuff:i386 'libsame:*' toolkit -testfileequal "${hook}-v2.list" 'libsame 2 > - **REMOVE** + observehook purge stuff:i386 'libsame:*' toolkit + testfileequal "${hook}-v2.list" 'libsame 2 > - **REMOVE** stuff 2 > - **REMOVE** libsame 2 > - **REMOVE** toolkit 2 > - **REMOVE**' -testfileequal "${hook}-v3.list" 'libsame 2 amd64 same > - - none **REMOVE** + testfileequal "${hook}-v3.list" 'libsame 2 amd64 same > - - none **REMOVE** stuff 2 i386 none > - - none **REMOVE** libsame 2 i386 same > - - none **REMOVE** toolkit 2 amd64 foreign > - - none **REMOVE**' -observehook install confpkg -testfileequal "${hook}-v2.list" 'confpkg - < 1 **CONFIGURE**' -testfileequal "${hook}-v3.list" 'confpkg - - none < 1 amd64 none **CONFIGURE**' + observehook install confpkg + testfileequal "${hook}-v2.list" 'confpkg - < 1 **CONFIGURE**' + testfileequal "${hook}-v3.list" 'confpkg - - none < 1 amd64 none **CONFIGURE**' + + observehook remove confpkg + testfileequal "${hook}-v2.list" 'confpkg 1 > - **REMOVE**' + testfileequal "${hook}-v3.list" 'confpkg 1 amd64 none > - - none **REMOVE**' -observehook remove confpkg -testfileequal "${hook}-v2.list" 'confpkg 1 > - **REMOVE**' -testfileequal "${hook}-v3.list" 'confpkg 1 amd64 none > - - none **REMOVE**' + msgtest 'Conffiles of package remained after remove' 'confpkg' + dpkg -l confpkg | grep -q '^rc' && msgpass || msgfail -msgtest 'Conffiles of package remained after remove' 'confpkg' -dpkg -l confpkg | grep -q '^rc' && msgpass || msgfail + observehook purge confpkg + testfileequal "${hook}-v2.list" 'confpkg 1 > - **REMOVE**' + testfileequal "${hook}-v3.list" 'confpkg 1 amd64 none > - - none **REMOVE**' -observehook purge confpkg -testfileequal "${hook}-v2.list" 'confpkg 1 > - **REMOVE**' -testfileequal "${hook}-v3.list" 'confpkg 1 amd64 none > - - none **REMOVE**' + msgtest 'Conffiles are gone after purge' 'confpkg' + dpkg -l confpkg 2>/dev/null | grep -q '^rc' && msgfail || msgpass +} + +enablehookversion 2 +enablehookversion 3 +testrun -msgtest 'Conffiles are gone after purge' 'confpkg' -dpkg -l confpkg 2>/dev/null | grep -q '^rc' && msgfail || msgpass +enablehookversion 2 13 +enablehookversion 3 13 +testrun -- cgit v1.2.3 From 3d4f7190d3349e1515c8f4e41b639d14fa72eb13 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Fri, 16 Aug 2013 12:44:00 +0200 Subject: Add test for bug 507998 --- .../test-bug-507998-dist-upgrade-recommends | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 test/integration/test-bug-507998-dist-upgrade-recommends (limited to 'test/integration') diff --git a/test/integration/test-bug-507998-dist-upgrade-recommends b/test/integration/test-bug-507998-dist-upgrade-recommends new file mode 100755 index 000000000..513421a94 --- /dev/null +++ b/test/integration/test-bug-507998-dist-upgrade-recommends @@ -0,0 +1,25 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' + +insertinstalledpackage 'tshark' 'amd64' '1.0.4-1' 'Depends: wireshark-common' +insertinstalledpackage 'wireshark-common' 'amd64' '1.0.4-1' 'Recommends: wireshark (>= 1.0.4-1) | tshark (>= 1.0.4-1)' +insertpackage 'unstable' 'tshark' 'amd64' '1.2.1-2' 'Depends: wireshark-common (= 1.2.1-2)' +insertpackage 'unstable' 'wireshark-common' 'amd64' '1.2.1-2' 'Recommends: wireshark (>= 1.2.1-2) | tshark (>= 1.2.1-2)' +insertpackage 'unstable' 'wireshark' 'amd64' '1.2.1-2' 'Depends: wireshark-common (= 1.2.1-2)' + +setupaptarchive + +testequal 'Reading package lists... +Building dependency tree... +The following packages will be upgraded: + tshark wireshark-common +2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. +Inst wireshark-common [1.0.4-1] (1.2.1-2 unstable [amd64]) +Inst tshark [1.0.4-1] (1.2.1-2 unstable [amd64]) +Conf wireshark-common (1.2.1-2 unstable [amd64]) +Conf tshark (1.2.1-2 unstable [amd64])' aptget dist-upgrade -s -- cgit v1.2.3 From feae193b0c01181226522a5a2477e696876593d4 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 27 Aug 2013 23:14:49 +0200 Subject: old-style dpkg foreign architecture adding for tests Looks like the travis service runs on Ubuntu in a version which has dpkg with an earlier interface implementation, so lets try if we can't make the framework work with this dpkg version as well. Git-Dch: Ignore --- test/integration/framework | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'test/integration') diff --git a/test/integration/framework b/test/integration/framework index 54d35fef8..cad28af84 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -240,7 +240,13 @@ configdpkg() { if echo "$ARCHS" | grep -E -q '[^ ]+ [^ ]+'; then DPKGARCH="$(dpkg --print-architecture)" for ARCH in ${ARCHS}; do - if [ "${ARCH}" != "${DPKGARCH}" ]; then dpkg --add-architecture ${ARCH}; fi + if [ "${ARCH}" != "${DPKGARCH}" ]; then + if ! dpkg --add-architecture ${ARCH}; then + # old-style used e.g. in Ubuntu-P – and as it seems travis + echo "DPKG::options:: \"--foreign-architecture\";" >> aptconfig.conf + echo "DPKG::options:: \"${ARCH}\";" >> aptconfig.conf + fi + fi done if [ "0" = "$(dpkg -l dpkg 2> /dev/null | grep '^i' | wc -l)" ]; then # dpkg doesn't really check the version as long as it is fully installed, -- cgit v1.2.3 From 276e51dd701590d187ca2999722329518af96121 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 28 Aug 2013 00:24:32 +0200 Subject: configurable compression for testcases Compressing files in 4 different styles eats test-time for no practical gain if we don't test them explicitly, so default to just building 'gz' compressed files as it is the simplest compression algorithm supported Git-Dch: Ignore --- test/integration/framework | 48 ++++++++++++++++++++------ test/integration/test-apt-cdrom | 5 +-- test/integration/test-hashsum-verification | 4 +-- test/integration/test-pdiff-usage | 4 +-- test/integration/test-releasefile-verification | 4 +-- 5 files changed, 41 insertions(+), 24 deletions(-) (limited to 'test/integration') diff --git a/test/integration/framework b/test/integration/framework index cad28af84..4003d932c 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -194,6 +194,7 @@ setupenvironment() { echo 'quiet::NoUpdate "true";' >> aptconfig.conf export LC_ALL=C export PATH="${PATH}:/usr/local/sbin:/usr/sbin:/sbin" + configcompression '.' 'gz' #'bz2' 'lzma' 'xz' msgdone "info" } @@ -257,6 +258,20 @@ configdpkg() { fi } +configcompression() { + while [ -n "$1" ]; do + case "$1" in + '.') echo ".\t.\tcat";; + 'gz') echo "gzip\tgz\tgzip";; + 'bz2') echo "bzip2\tbz2\tbzip2";; + 'lzma') echo "lzma\tlzma\txz --format=lzma";; + 'xz') echo "xz\txz\txz";; + *) echo "$1\t$1\t$1";; + esac + shift + done > ${TMPWORKINGDIRECTORY}/rootdir/etc/testcase-compressor.conf +} + setupsimplenativepackage() { local NAME="$1" local ARCH="$2" @@ -427,6 +442,8 @@ buildaptarchive() { } createaptftparchiveconfig() { + local COMPRESSORS="$(cut -d' ' -f 1 ${TMPWORKINGDIRECTORY}/rootdir/etc/testcase-compressor.conf | tr '\n' ' ')" + COMPRESSORS="${COMPRESSORS%* }" local ARCHS="$(find pool/ -name '*.deb' | grep -oE '_[a-z0-9-]+\.deb$' | sort | uniq | sed -e '/^_all.deb$/ d' -e 's#^_\([a-z0-9-]*\)\.deb$#\1#' | tr '\n' ' ')" if [ -z "$ARCHS" ]; then # the pool is empty, so we will operate on faked packages - let us use the configured archs @@ -444,10 +461,10 @@ createaptftparchiveconfig() { echo -n '"; }; Default { - Packages::Compress ". gzip bzip2 lzma xz"; - Sources::Compress ". gzip bzip2 lzma xz"; - Contents::Compress ". gzip bzip2 lzma xz"; - Translation::Compress ". gzip bzip2 lzma xz"; + Packages::Compress "'"$COMPRESSORS"'"; + Sources::Compress "'"$COMPRESSORS"'"; + Contents::Compress "'"$COMPRESSORS"'"; + Translation::Compress "'"$COMPRESSORS"'"; LongDescription "false"; }; TreeDefault { @@ -617,18 +634,27 @@ buildaptarchivefromfiles() { msginfo "Build APT archive for ${CCMD}$(basename $0)${CINFO} based on prebuild files…" find aptarchive -name 'Packages' -o -name 'Sources' | while read line; do msgninfo "\t${line} file… " - cat ${line} | gzip > ${line}.gz - cat ${line} | bzip2 > ${line}.bz2 - cat ${line} | xz --format=lzma > ${line}.lzma - cat ${line} | xz > ${line}.xz - if [ -n "$1" ]; then - touch -d "$1" ${line}.gz ${line}.bz2 ${line}.lzma ${line}.xz - fi + compressfile "$line" "$1" msgdone "info" done generatereleasefiles "$@" } +compressfile() { + cat ${TMPWORKINGDIRECTORY}/rootdir/etc/testcase-compressor.conf | while read compressor extension command; do + if [ "$compressor" = '.' ]; then + if [ -n "$2" ]; then + touch -d "$2" "$1" + fi + continue + fi + cat "$1" | $command > "${1}.${extension}" + if [ -n "$2" ]; then + touch -d "$2" "${1}.${extension}" + fi + done +} + # can be overridden by testcases for their pleasure getcodenamefromsuite() { echo -n "$1"; } getreleaseversionfromsuite() { true; } diff --git a/test/integration/test-apt-cdrom b/test/integration/test-apt-cdrom index 85c3a2fee..cc3483f9b 100755 --- a/test/integration/test-apt-cdrom +++ b/test/integration/test-apt-cdrom @@ -18,10 +18,7 @@ echo 'Description-de: automatisch generiertes Testpaket testing=0.8.15/stable Diese Pakete sind nur für das testen von APT gedacht, sie erfüllen keinen Zweck auf einem normalen System… ' >> Translation-de -cat Translation-de | gzip > Translation-de.gz -cat Translation-de | bzip2 > Translation-de.bz2 -cat Translation-de | xz --format=lzma > Translation-de.lzma -cat Translation-de | xz > Translation-de.xz +compressfile Translation-de rm Translation-en Translation-de cd - > /dev/null addtrap 'prefix' "chmod -R +w $PWD/rootdir/media/cdrom/dists/;" diff --git a/test/integration/test-hashsum-verification b/test/integration/test-hashsum-verification index 99ea8bffa..e77efb46e 100755 --- a/test/integration/test-hashsum-verification +++ b/test/integration/test-hashsum-verification @@ -21,9 +21,7 @@ prepare() { done cp $1 aptarchive/Packages find aptarchive -name 'Release' -delete - cat aptarchive/Packages | gzip > aptarchive/Packages.gz - cat aptarchive/Packages | bzip2 > aptarchive/Packages.bz2 - cat aptarchive/Packages | xz --format=lzma > aptarchive/Packages.lzma + compressfile aptarchive/Packages # create Release file with incorret checksums cat > aptarchive/Release < aptarchive/Packages.gz -cat aptarchive/Packages | bzip2 > aptarchive/Packages.bz2 -cat aptarchive/Packages | xz --format=lzma > aptarchive/Packages.lzma +compressfile 'aptarchive/Packages' rm -rf aptarchive/Packages.diff mkdir -p aptarchive/Packages.diff PATCHFILE="aptarchive/Packages.diff/$(date +%Y-%m-%d-%H%M.%S)" diff --git a/test/integration/test-releasefile-verification b/test/integration/test-releasefile-verification index daba3919b..a9f4b9775 100755 --- a/test/integration/test-releasefile-verification +++ b/test/integration/test-releasefile-verification @@ -22,9 +22,7 @@ prepare() { aptget clean cp $1 aptarchive/Packages find aptarchive -name 'Release' -delete - cat aptarchive/Packages | gzip > aptarchive/Packages.gz - cat aptarchive/Packages | bzip2 > aptarchive/Packages.bz2 - cat aptarchive/Packages | xz --format=lzma > aptarchive/Packages.lzma + compressfile 'aptarchive/Packages' generatereleasefiles "$DATE" } -- cgit v1.2.3 From 3e2d892340d42053d388bda3d50dfbee99299082 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 12 Sep 2013 13:42:37 +0200 Subject: add a testcase for 100 char long path truncate bug #689582 Git-Dch: Ignore --- .../test-bug-689582-100-char-long-path-names | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 test/integration/test-bug-689582-100-char-long-path-names (limited to 'test/integration') diff --git a/test/integration/test-bug-689582-100-char-long-path-names b/test/integration/test-bug-689582-100-char-long-path-names new file mode 100755 index 000000000..1b4b172b6 --- /dev/null +++ b/test/integration/test-bug-689582-100-char-long-path-names @@ -0,0 +1,35 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' + +mkdir aptarchive/testpkg +cd aptarchive/testpkg + +for i in $(seq 98 102); do + touch "$(printf "%0${i}d" "$i")" +done +tar zcf data.tar.gz 00* + +echo 'Package: testpkg +Version: 1-1 +Architecture: all +Maintainer: Joe Sixpack +Description: Package for test +Section: debug +Priority: extra' > control +tar zcf control.tar.gz control + +echo '2.0' > debian-binary +ar cr ../testpkg.deb debian-binary control.tar.gz data.tar.gz + +cd - > /dev/null + +testequal '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000102 testpkg +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000101 testpkg +0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100 testpkg +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000099 testpkg +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000098 testpkg' aptftparchive contents aptarchive/ -- cgit v1.2.3 From 5985c230c8ac85fe2b2eb504b798377843bdc7cd Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 20 Sep 2013 13:34:22 +0200 Subject: do not trust FileFd::Eof() in pkgTagFile::Fill() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Eof check was added (by me of course) in 0aae6d14390193e25ab6d0fd49295bd7b131954f as part of a fix up ~a month ago (at DebConf). The idea was not that bad, but doesn't make that much sense either as this bit is set by the FileFd based on Actual as well, so this is basically doing the same check again – with the difference that the HitEof bit can still linger from a previous Read we did at the end of the file, but have seek'd away from it now. Combined with the length of entries, entry order and other not that easily controllable conditions you can be 'lucky' enough to hit this problem in a way which even visible (truncating of other fields might not be visible easily, like 'Tags' and others). Closes: 723705 Thanks: Cyril Brulebois --- .../Packages-bug-723705-tagfile-truncates-fields | 167 +++++++++++++++++++++ .../status-bug-723705-tagfile-truncates-fields | 62 ++++++++ .../test-bug-723705-tagfile-truncates-fields | 33 ++++ 3 files changed, 262 insertions(+) create mode 100644 test/integration/Packages-bug-723705-tagfile-truncates-fields create mode 100644 test/integration/status-bug-723705-tagfile-truncates-fields create mode 100755 test/integration/test-bug-723705-tagfile-truncates-fields (limited to 'test/integration') diff --git a/test/integration/Packages-bug-723705-tagfile-truncates-fields b/test/integration/Packages-bug-723705-tagfile-truncates-fields new file mode 100644 index 000000000..c42b85072 --- /dev/null +++ b/test/integration/Packages-bug-723705-tagfile-truncates-fields @@ -0,0 +1,167 @@ +Package: cdebconf-gtk-udeb +Source: cdebconf +Version: 0.185 +Installed-Size: 92 +Maintainer: Debian Install System Team +Architecture: amd64 +Description: Gtk+ frontend for Debian Configuration Management System +Description-md5: 75d036e0a245499123544e2254b92e9c +Section: debian-installer +Priority: optional +Filename: pool/main/c/cdebconf/cdebconf-gtk-udeb_0.185_amd64.udeb +Size: 27278 +MD5sum: a1bbbc1d4fb8e0615b5621abac021924 +SHA1: b1a7ab55a90f61e5337847d02ff1d12d73559def +SHA256: cd79f3205304a7932b3309c4df9898c9a53929bc651912659858e087ebe1c18a + +Package: cdebconf-newt-udeb +Source: cdebconf +Version: 0.185 +Installed-Size: 58 +Maintainer: Debian Install System Team +Architecture: amd64 +Description: Newt frontend for Debian Configuration Management System +Description-md5: e080be5e38cb8c57bca2f3effe9ee030 +Section: debian-installer +Priority: optional +Filename: pool/main/c/cdebconf/cdebconf-newt-udeb_0.185_amd64.udeb +Size: 19192 +MD5sum: de27807f56dae2f2403b3322d5fe6bd2 +SHA1: 57883e223d46a9f25966f9b986e6a3bc2f67d8ef +SHA256: 5f8b9c3a5430f2ec879484a7736582b152d76cc8ba9bc19328268f3635759a1b + +Package: cdebconf-udeb +Source: cdebconf +Version: 0.185 +Installed-Size: 245 +Maintainer: Debian Install System Team +Architecture: amd64 +Provides: debconf-2.0 +Description: Debian Configuration Management System (C-implementation) +Description-md5: 9f3579e9d9f86ac89e667a8707d3cbd3 +Section: debian-installer +Priority: standard +Filename: pool/main/c/cdebconf/cdebconf-udeb_0.185_amd64.udeb +Size: 77376 +MD5sum: e3883706fdbf54c2e5ea959c92b2d37f +SHA1: 0232f1bdf1531db628516ed3a46a27466b267fdc +SHA256: 96345575417a3e4df8a2cadaa55784ec8f6c042defb1e2fc002d941b6116ceab + +Package: cdebconf-gtk-terminal +Source: cdebconf-terminal +Version: 0.22 +Installed-Size: 64 +Maintainer: Debian Install System Team +Architecture: amd64 +Provides: cdebconf-terminal +Depends: cdebconf-gtk-udeb, libc6-udeb (>= 2.17), libglib2.0-udeb (>= 2.36.4), libgtk2.0-0-udeb (>= 2.24.0), libvte9-udeb (>= 1:0.28.0), cdebconf-udeb, cdebconf-gtk-terminal, cdebconf-gtk-terminal, cdebconf-gtk-terminal, cdebconf-gtk-terminal, cdebconf-gtk-terminal, cdebconf-gtk-terminal, cdebconf-gtk-terminal +Description: cdebconf gtk plugin displaying a terminal +Description-md5: 18c4446758aec003eb8cd0a43419f1aa +Section: debian-installer +Priority: extra +Filename: pool/main/c/cdebconf-terminal/cdebconf-gtk-terminal_0.22_amd64.udeb +Size: 14734 +MD5sum: f9c3a7354560cb88e0396e2b7ba54363 +SHA1: 9c1c93328e758bfd9de2752466b271aaf38c8177 +SHA256: ca749853fc3b93db1d08ccdc6b46de27633de52bc5b880fa65275897ebcaaf69 + +Package: cdebconf-newt-terminal +Source: cdebconf-terminal +Version: 0.22 +Installed-Size: 43 +Maintainer: Debian Install System Team +Architecture: amd64 +Provides: cdebconf-terminal +Depends: cdebconf-newt-udeb (>= 0.146), libc6-udeb (>= 2.17), libnewt0.52 +Description: cdebconf newt plugin to provide a clean terminal +Description-md5: 4109a053022081b573d864d84d6eb16d +Section: debian-installer +Priority: extra +Filename: pool/main/c/cdebconf-terminal/cdebconf-newt-terminal_0.22_amd64.udeb +Size: 4538 +MD5sum: 20db6152fce5081fcbf49c7c08f21246 +SHA1: fa2a40f777a2f48b9634866bc780fb059e60b2fe +SHA256: c4d99ef27285f0c9090005313165627e56e0972e687af7e68c2b1d1538e2ae09 + +Package: libc6-udeb +Source: eglibc (2.17-92) +Version: 2.17-92+b1 +Installed-Size: 3126 +Maintainer: GNU Libc Maintainers +Architecture: amd64 +Provides: glibc-2.17-1, libc-udeb, libc6 +Description: Embedded GNU C Library: Shared libraries - udeb +Description-md5: 9552ce73b7b3fb466e3d89fe8db9a563 +Section: debian-installer +Priority: extra +Filename: pool/main/e/eglibc/libc6-udeb_2.17-92+b1_amd64.udeb +Size: 1056000 +MD5sum: 7fd7032eeeecf7f76eff79a0543fbd72 +SHA1: 724b6a81b8fbc9d4d2bb43d656c08de73f7ada25 +SHA256: 137d4c001bbfde8161315c36e6cb8653ae2c50a8d6b6d2d27396c492d91a1723 + +Package: libglib2.0-udeb +Source: glib2.0 +Version: 2.36.4-1 +Installed-Size: 10070 +Maintainer: Debian GNOME Maintainers +Architecture: amd64 +Description: GLib library of C routines - minimal runtime +Description-md5: 0244040042870a89aa49f037cce3f1e9 +Section: debian-installer +Priority: optional +Filename: pool/main/g/glib2.0/libglib2.0-udeb_2.36.4-1_amd64.udeb +Size: 1714604 +MD5sum: 72da029f1bbb36057d874f1f82a5d00a +SHA1: 32bce78a052ef19a620f43ecbe12404fa570c0f1 +SHA256: 8edbc7cb872c0a82705913563f93f9eec5750881e4378c5a48770cde840cd6eb + +Package: libgtk2.0-0-udeb +Source: gtk+2.0 +Version: 2.24.20-1 +Installed-Size: 5035 +Maintainer: Debian GNOME Maintainers +Architecture: amd64 +Provides: gtk2.0-binver-2.10.0 +Description: GTK+ graphical user interface library - minimal runtime +Description-md5: 32e5112b80c02578837cff4f65dfec84 +Section: debian-installer +Priority: extra +Filename: pool/main/g/gtk+2.0/libgtk2.0-0-udeb_2.24.20-1_amd64.udeb +Size: 1643046 +MD5sum: 25513478eb2e02e5766c0eea0b411ca9 +SHA1: 9274f05bfa930a3406403441ce061bade04e2064 +SHA256: d5f611f48928ae02f759105cf8cff467cde1cb44df56ad31067168b46a80f8bc + +Package: libvte9-udeb +Source: vte +Version: 1:0.28.2-5 +Installed-Size: 628 +Maintainer: Debian GNOME Maintainers +Architecture: amd64 +Description: Terminal emulator widget for GTK+ 2.0 - minimal runtime +Description-md5: e7993385c30bae6e96c8cb87795a513c +Section: debian-installer +Priority: extra +Filename: pool/main/v/vte/libvte9-udeb_0.28.2-5_amd64.udeb +Size: 216968 +MD5sum: 7da7201effaf5ced19abd9d0b45aa2c6 +SHA1: a424cf779e7614d79740c422b6342de04fed3646 +SHA256: 4963033cbda5a8ba7eb8ebf1debae34463b8e63b821259860cfb51c1ab99562d + +Package: zlib1g-udeb +Source: zlib +Version: 1:1.2.8.dfsg-1 +Installed-Size: 115 +Maintainer: Mark Brown +Architecture: amd64 +Description: compression library - runtime for Debian installer +Description-md5: 9cab974e3eab657c53bc17611b894c7a +Section: debian-installer +Priority: optional +Filename: pool/main/z/zlib/zlib1g-udeb_1.2.8.dfsg-1_amd64.udeb +Size: 45270 +MD5sum: c02884420f79a3ae4569cf67782f3e74 +SHA1: 7cd1a7c8be4e086de733a0ce76f87d42b8b2173b +SHA256: 61641ee2b5e185232108333438b72bec71ef549fe0e0df1b2b3afa37174e53a7 + diff --git a/test/integration/status-bug-723705-tagfile-truncates-fields b/test/integration/status-bug-723705-tagfile-truncates-fields new file mode 100644 index 000000000..fe18506c8 --- /dev/null +++ b/test/integration/status-bug-723705-tagfile-truncates-fields @@ -0,0 +1,62 @@ +Package: libc6 +Status: install ok installed +Priority: required +Section: libs +Installed-Size: 10164 +Maintainer: GNU Libc Maintainers +Architecture: amd64 +Multi-Arch: same +Source: eglibc (2.17-92) +Version: 2.17-92+b1 +Replaces: libc6-amd64 +Provides: glibc-2.17-1 +Suggests: glibc-doc, debconf | debconf-2.0, locales +Breaks: locales (<< 2.17), locales-all (<< 2.17), lsb-core (<= 3.2-27), nscd (<< 2.17) +Conflicts: prelink (<= 0.0.20090311-1), tzdata (<< 2007k-1), tzdata-etch +Conffiles: + /etc/ld.so.conf.d/x86_64-linux-gnu.conf 593ad12389ab2b6f952e7ede67b8fbbf +Description: Embedded GNU C Library: Shared libraries + Contains the standard libraries that are used by nearly all programs on + the system. This package includes shared versions of the standard C library + and the standard math library, as well as many others. +Homepage: http://www.eglibc.org + +Package: libnewt0.52 +Status: install ok installed +Priority: important +Section: libs +Installed-Size: 820 +Maintainer: Alastair McKinstry +Architecture: amd64 +Multi-Arch: same +Source: newt +Version: 0.52.15-3 +Recommends: libfribidi0 +Conffiles: + /etc/newt/palette.original d41d8cd98f00b204e9800998ecf8427e +Description: Not Erik's Windowing Toolkit - text mode windowing with slang + Newt is a windowing toolkit for text mode built from the slang library. + It allows color text mode applications to easily use stackable windows, + push buttons, check boxes, radio buttons, lists, entry fields, labels, + and displayable text. Scrollbars are supported, and forms may be nested + to provide extra functionality. This package contains the shared library + for programs that have been built with newt. +Homepage: https://fedorahosted.org/newt/ + +Package: libgcc1 +Status: install ok installed +Priority: required +Section: libs +Installed-Size: 128 +Maintainer: Debian GCC Maintainers +Architecture: amd64 +Multi-Arch: same +Source: gcc-4.8 (4.8.1-10) +Version: 1:4.8.1-10 +Breaks: gcc-4.1, gcc-4.3 (<< 4.3.6-1), gcc-4.4 (<< 4.4.6-4), gcc-4.5 (<< 4.5.3-2) +Description: GCC support library + Shared version of the support library, a library of internal subroutines + that GCC uses to overcome shortcomings of particular machines, or + special needs for some languages. +Homepage: http://gcc.gnu.org/ + diff --git a/test/integration/test-bug-723705-tagfile-truncates-fields b/test/integration/test-bug-723705-tagfile-truncates-fields new file mode 100755 index 000000000..3180e7fc9 --- /dev/null +++ b/test/integration/test-bug-723705-tagfile-truncates-fields @@ -0,0 +1,33 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' + +setupaptarchive + +aptget install --print-uris -y cdebconf-newt-terminal cdebconf-gtk-terminal 2>&1 | sed 's#file:///tmp/tmp.[^/]\+#file:///tmp#g' > filename.log + +testfileequal filename.log "Reading package lists... +Building dependency tree... +The following extra packages will be installed: + cdebconf-gtk-udeb cdebconf-newt-udeb cdebconf-udeb libc6-udeb + libglib2.0-udeb libgtk2.0-0-udeb libvte9-udeb +The following NEW packages will be installed: + cdebconf-gtk-terminal cdebconf-gtk-udeb cdebconf-newt-terminal + cdebconf-newt-udeb cdebconf-udeb libc6-udeb libglib2.0-udeb libgtk2.0-0-udeb + libvte9-udeb +0 upgraded, 9 newly installed, 0 to remove and 0 not upgraded. +Need to get 0 B/4774 kB of archives. +After this operation, 19.8 MB of additional disk space will be used. +'file:///tmp/aptarchive/pool/main/c/cdebconf/cdebconf-udeb_0.185_amd64.udeb' cdebconf-udeb_0.185_amd64.udeb 77376 MD5Sum:e3883706fdbf54c2e5ea959c92b2d37f +'file:///tmp/aptarchive/pool/main/c/cdebconf/cdebconf-gtk-udeb_0.185_amd64.udeb' cdebconf-gtk-udeb_0.185_amd64.udeb 27278 MD5Sum:a1bbbc1d4fb8e0615b5621abac021924 +'file:///tmp/aptarchive/pool/main/c/cdebconf/cdebconf-newt-udeb_0.185_amd64.udeb' cdebconf-newt-udeb_0.185_amd64.udeb 19192 MD5Sum:de27807f56dae2f2403b3322d5fe6bd2 +'file:///tmp/aptarchive/pool/main/g/glib2.0/libglib2.0-udeb_2.36.4-1_amd64.udeb' libglib2.0-udeb_2.36.4-1_amd64.udeb 1714604 MD5Sum:72da029f1bbb36057d874f1f82a5d00a +'file:///tmp/aptarchive/pool/main/e/eglibc/libc6-udeb_2.17-92+b1_amd64.udeb' libc6-udeb_2.17-92+b1_amd64.udeb 1056000 MD5Sum:7fd7032eeeecf7f76eff79a0543fbd72 +'file:///tmp/aptarchive/pool/main/g/gtk+2.0/libgtk2.0-0-udeb_2.24.20-1_amd64.udeb' libgtk2.0-0-udeb_2.24.20-1_amd64.udeb 1643046 MD5Sum:25513478eb2e02e5766c0eea0b411ca9 +'file:///tmp/aptarchive/pool/main/v/vte/libvte9-udeb_0.28.2-5_amd64.udeb' libvte9-udeb_1%3a0.28.2-5_amd64.udeb 216968 MD5Sum:7da7201effaf5ced19abd9d0b45aa2c6 +'file:///tmp/aptarchive/pool/main/c/cdebconf-terminal/cdebconf-gtk-terminal_0.22_amd64.udeb' cdebconf-gtk-terminal_0.22_amd64.udeb 14734 MD5Sum:f9c3a7354560cb88e0396e2b7ba54363 +'file:///tmp/aptarchive/pool/main/c/cdebconf-terminal/cdebconf-newt-terminal_0.22_amd64.udeb' cdebconf-newt-terminal_0.22_amd64.udeb 4538 MD5Sum:20db6152fce5081fcbf49c7c08f21246" -- cgit v1.2.3 From b4140ecf132d15adf740f23330054b6788d4f9a6 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 21 Sep 2013 14:23:02 +0200 Subject: don't strip :any from dependencies in single-arch The parser goes a bit to far by stripping :any from dependencies in a single architecture environment. the flag "Multi-Arch: allowed" doesn't care any architecture restrictions in that case (as in single arch everything is native), but it still limits the possible versions statisfying the dependency so stripping :any over-simplifies in upgrade situations from "Multi-Arch: none" to "Multi-Arch: allowed". Closes: 723586 --- .../test-bug-723586-any-stripped-in-single-arch | 54 ++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100755 test/integration/test-bug-723586-any-stripped-in-single-arch (limited to 'test/integration') diff --git a/test/integration/test-bug-723586-any-stripped-in-single-arch b/test/integration/test-bug-723586-any-stripped-in-single-arch new file mode 100755 index 000000000..392b88e9f --- /dev/null +++ b/test/integration/test-bug-723586-any-stripped-in-single-arch @@ -0,0 +1,54 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' + +insertinstalledpackage 'python3' 'all' '3.2.3-6' + +insertpackage 'unstable' 'python3' 'amd64' '3.3.2-16' 'Multi-Arch: allowed' +insertpackage 'stable' 'python3-gnupg' 'all' '0.3.5-2' 'Depends: python3:any (>= 3.2.3-3~)' + +insertpackage 'unstable' 'python-mips' 'amd64' '3' 'Depends: python3:mips' + +setupaptarchive + +INSTALLLOG='Reading package lists... +Building dependency tree... +The following extra packages will be installed: + python3 +The following NEW packages will be installed: + python3-gnupg +The following packages will be upgraded: + python3 +1 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst python3 [3.2.3-6] (3.3.2-16 unstable [amd64]) +Inst python3-gnupg (0.3.5-2 stable [all]) +Conf python3 (3.3.2-16 unstable [amd64]) +Conf python3-gnupg (0.3.5-2 stable [all])' + +FAILLOG='Reading package lists... +Building dependency tree... +Some packages could not be installed. This may mean that you have +requested an impossible situation or if you are using the unstable +distribution that some required packages have not yet been created +or been moved out of Incoming. +The following information may help to resolve the situation: + +The following packages have unmet dependencies: + python-mips : Depends: python3:mips but it is not installable +E: Unable to correct problems, you have held broken packages.' + +testequal "$INSTALLLOG" aptget install python3-gnupg -s +aptcache showpkg python3 > showpkg.log +testequal "$FAILLOG" aptget install python-mips -s + +# same test, but this time in a multi-arch environment +configarchitecture 'amd64' 'armhf' +rm rootdir/var/cache/apt/*.bin + +testequal "$INSTALLLOG" aptget install python3-gnupg -s +testequal "$(sed 's#3.3.2-16 - python3#3.3.2-16 - python3:any:armhf python3#' showpkg.log)" aptcache showpkg python3 +testequal "$FAILLOG" aptget install python-mips -s -- cgit v1.2.3 From 6c34cccad778bd8db0ce03b7596cbef03afa9688 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 26 Sep 2013 13:32:49 +0200 Subject: pkg from only trusted sources keeps being trusted --allow-unauthenticated switches the download to a pre-0.6 system in which a package can come from any source, rather than that trusted packages can only come from trusted sources. To allow this the flag used to set all packages as untrusted, which is a bit much, so we check now if the package can be acquired via an untrusted source and only if this is the case set it as untrusted. As APT nowadays supports setting sources as trusted via a flag in the sources.list this mode shouldn't be used that much anymore though. [Note that this is not the patch from the BTS] Closes: 617690 --- .../test-bug-596498-trusted-unsigned-repo | 9 ++++ ...17690-allow-unauthenticated-makes-all-untrusted | 52 ++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100755 test/integration/test-bug-617690-allow-unauthenticated-makes-all-untrusted (limited to 'test/integration') diff --git a/test/integration/test-bug-596498-trusted-unsigned-repo b/test/integration/test-bug-596498-trusted-unsigned-repo index 5c643c40e..06c9c8285 100755 --- a/test/integration/test-bug-596498-trusted-unsigned-repo +++ b/test/integration/test-bug-596498-trusted-unsigned-repo @@ -21,6 +21,9 @@ DEBFILE='rootdir/etc/apt/sources.list.d/apt-test-unstable-deb.list' testequal "$PKGTEXT Download complete and in download only mode" aptget install cool --assume-no -d +testequal "$PKGTEXT +Download complete and in download only mode" aptget install cool --assume-no -d --allow-unauthenticated + sed -i -e 's#deb#deb [trusted=no]#' $DEBFILE aptgetupdate @@ -40,6 +43,12 @@ WARNING: The following packages cannot be authenticated! Install these packages without verification? [y/N] N E: Some packages could not be authenticated" aptget install cool --assume-no -d +testequal "$PKGTEXT +WARNING: The following packages cannot be authenticated! + cool +Authentication warning overridden. +Download complete and in download only mode" aptget install cool --assume-no -d --allow-unauthenticated + sed -i -e 's#deb#deb [trusted=yes]#' $DEBFILE aptgetupdate diff --git a/test/integration/test-bug-617690-allow-unauthenticated-makes-all-untrusted b/test/integration/test-bug-617690-allow-unauthenticated-makes-all-untrusted new file mode 100755 index 000000000..1c2514938 --- /dev/null +++ b/test/integration/test-bug-617690-allow-unauthenticated-makes-all-untrusted @@ -0,0 +1,52 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'i386' + +buildsimplenativepackage 'cool' 'i386' '1.0' 'unstable' + +setupaptarchive --no-update + +testfileexists() { + msgtest 'Test for existance of file' "$1" + test -e "$1" && msgpass || msgfail + rm -f "$1" +} + +testfilemissing() { + msgtest 'Test for non-existance of file' "$1" + test -e "$1" && msgfail || msgpass + rm -f "$1" +} + +testrun() { + rm -rf rootdir/var/lib/apt + testsuccess aptget update + + testsuccess aptget download cool + testfileexists 'cool_1.0_i386.deb' + + mv aptarchive/pool/cool_1.0_i386.deb aptarchive/pool/cool_1.0_i386.deb.bak + echo 'this is not a good package' > aptarchive/pool/cool_1.0_i386.deb + # FIXME: apt-get download should exit non-zero if download fails + aptget download cool + testfilemissing cool_1.0_i386.deb + + # FIXME: apt-get download should exit non-zero if download fails + aptget download cool --allow-unauthenticated # unauthenticated doesn't mean unchecked + testfilemissing cool_1.0_i386.deb + + rm -f aptarchive/pool/cool_1.0_i386.deb + mv aptarchive/pool/cool_1.0_i386.deb.bak aptarchive/pool/cool_1.0_i386.deb + testsuccess aptget download cool --allow-unauthenticated + testfileexists 'cool_1.0_i386.deb' +} + +testrun + +find aptarchive/ \( -name 'Release.gpg' -o -name 'InRelease' \) -delete +# FIXME: apt-get download should warn about untrusted downloads +testrun -- cgit v1.2.3 From ac69a4d8aa837d1ab31447bbaa9a7ea95917bac9 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 26 Sep 2013 14:56:45 +0200 Subject: print-uris prints regardless of quiet-level again MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While the InstallPackages code was moved from apt-get into the private library the output was moved from (std::)cout to c1out which isn't shown in quiet level 2 (and above), so we flip back to std::cout to ensure that it is always printed as you are not going to use --print-uris if you don't want to see the uris… Closes: 722207 --- .../test-bug-722207-print-uris-even-if-very-quiet | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 test/integration/test-bug-722207-print-uris-even-if-very-quiet (limited to 'test/integration') diff --git a/test/integration/test-bug-722207-print-uris-even-if-very-quiet b/test/integration/test-bug-722207-print-uris-even-if-very-quiet new file mode 100755 index 000000000..2743281b4 --- /dev/null +++ b/test/integration/test-bug-722207-print-uris-even-if-very-quiet @@ -0,0 +1,24 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework + +setupenvironment +configarchitecture 'amd64' + +insertinstalledpackage 'apt' 'all' '1' +insertpackage 'unstable' 'apt' 'all' '2' +insertsource 'unstable' 'apt' 'all' '2' + +setupaptarchive + +APTARCHIVE=$(readlink -f ./aptarchive) + +testequal "'file://${APTARCHIVE}/pool/main/apt/apt_2_all.deb' apt_2_all.deb 0 MD5Sum:" aptget upgrade -qq --print-uris +testequal "'file://${APTARCHIVE}/pool/main/apt/apt_2_all.deb' apt_2_all.deb 0 MD5Sum:" aptget dist-upgrade -qq --print-uris +testequal "'file://${APTARCHIVE}/pool/main/apt/apt_2_all.deb' apt_2_all.deb 0 MD5Sum:" aptget install apt -qq --print-uris +testequal "'file://${APTARCHIVE}/pool/main/apt/apt_2_all.deb' apt_2_all.deb 0 :" aptget download apt -qq --print-uris +testequal "'file://${APTARCHIVE}/apt_2.dsc' apt_2.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e +'file://${APTARCHIVE}/apt_2.tar.gz' apt_2.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source apt -qq --print-uris +testequal "'http://packages.debian.org/changelogs/pool/main/apt/apt_2/changelog'" aptget changelog apt -qq --print-uris -- cgit v1.2.3 From 318289bb17b827611fea6570f71df525b60a0e97 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 26 Sep 2013 16:25:11 +0200 Subject: test: apt-get source with more than one argument Closes: 722549 Git-Dch: Ignore --- test/integration/test-bug-722207-print-uris-even-if-very-quiet | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/integration') diff --git a/test/integration/test-bug-722207-print-uris-even-if-very-quiet b/test/integration/test-bug-722207-print-uris-even-if-very-quiet index 2743281b4..9524bab07 100755 --- a/test/integration/test-bug-722207-print-uris-even-if-very-quiet +++ b/test/integration/test-bug-722207-print-uris-even-if-very-quiet @@ -10,6 +10,7 @@ configarchitecture 'amd64' insertinstalledpackage 'apt' 'all' '1' insertpackage 'unstable' 'apt' 'all' '2' insertsource 'unstable' 'apt' 'all' '2' +insertsource 'unstable' 'apt2' 'all' '1' setupaptarchive @@ -22,3 +23,8 @@ testequal "'file://${APTARCHIVE}/pool/main/apt/apt_2_all.deb' apt_2_all.deb 0 :" testequal "'file://${APTARCHIVE}/apt_2.dsc' apt_2.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e 'file://${APTARCHIVE}/apt_2.tar.gz' apt_2.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source apt -qq --print-uris testequal "'http://packages.debian.org/changelogs/pool/main/apt/apt_2/changelog'" aptget changelog apt -qq --print-uris + +testequal "'file://${APTARCHIVE}/apt_2.dsc' apt_2.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e +'file://${APTARCHIVE}/apt_2.tar.gz' apt_2.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e +'file://${APTARCHIVE}/apt2_1.dsc' apt2_1.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e +'file://${APTARCHIVE}/apt2_1.tar.gz' apt2_1.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source apt apt2 -qq --print-uris -- cgit v1.2.3 From 331e8396ee5a4f2e7d276eddc54749b2a13dd789 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 16 Sep 2013 23:21:11 +0200 Subject: retry without partial data after a 416 response If we get a 416 from the server it means the Range we asked for is above the real filesize of the file on the server. Mostly this happens if the server isn't supporting If-Range, but regardless of how we end up with the partial data, the data is invalid so we discard it and retry with a fresh plate and hope for the best. Old behavior was to consider 416 an error and retry with a different compression until we ran out of compression and requested the uncompressed file (which doesn't exist on most mirrors) with an accept line which server answered with "406 Not Acceptable". Closes: 710924 --- test/integration/test-releasefile-verification | 59 +++++++++++++++++++------- 1 file changed, 43 insertions(+), 16 deletions(-) (limited to 'test/integration') diff --git a/test/integration/test-releasefile-verification b/test/integration/test-releasefile-verification index a9f4b9775..9d34a521a 100755 --- a/test/integration/test-releasefile-verification +++ b/test/integration/test-releasefile-verification @@ -11,18 +11,24 @@ buildaptarchive setupflataptarchive changetowebserver +downloadfile "http://localhost:8080/_config/set/aptwebserver::support::range/false" '/dev/null' >/dev/null + prepare() { local DATE="${2:-now}" - if [ "$DATE" = 'now' -a "$1" = "${PKGFILE}-new" ]; then - DATE='now + 6 days' + if [ "$DATE" = 'now' ]; then + if [ "$1" = "${PKGFILE}-new" ]; then + DATE='now - 1 day' + else + DATE='now - 7 day' + fi fi for release in $(find rootdir/var/lib/apt/lists 2> /dev/null); do - touch -d 'now - 6 hours' $release + touch -d 'now - 1 year' $release done aptget clean cp $1 aptarchive/Packages find aptarchive -name 'Release' -delete - compressfile 'aptarchive/Packages' + compressfile 'aptarchive/Packages' "$DATE" generatereleasefiles "$DATE" } @@ -85,13 +91,34 @@ touch aptarchive/apt.deb PKGFILE="${TESTDIR}/$(echo "$(basename $0)" | sed 's#^test-#Packages-#')" +updatesuccess() { + local LOG='update.log' + if aptget update >$LOG 2>&1 || grep -q -E '^(W|E): ' $LOG; then + msgpass + else + cat $LOG + msgfail + fi +} + +updatefailure() { + local LOG='update.log' + aptget update >$LOG 2>&1 || true + if grep -q -E "$1" $LOG; then + msgpass + else + cat $LOG + msgfail + fi +} + runtest() { prepare ${PKGFILE} rm -rf rootdir/var/lib/apt/lists signreleasefiles 'Joe Sixpack' find aptarchive/ -name "$DELETEFILE" -delete msgtest 'Cold archive signed by' 'Joe Sixpack' - aptget update 2>&1 | grep -E '^(W|E): ' > /dev/null && msgfail || msgpass + updatesuccess testequal "$(cat ${PKGFILE}) " aptcache show apt installaptold @@ -100,7 +127,7 @@ runtest() { signreleasefiles 'Joe Sixpack' find aptarchive/ -name "$DELETEFILE" -delete msgtest 'Good warm archive signed by' 'Joe Sixpack' - aptget update 2>&1 | grep -E '^(W|E): ' > /dev/null && msgfail || msgpass + updatesuccess testequal "$(cat ${PKGFILE}-new) " aptcache show apt installaptnew @@ -111,7 +138,7 @@ runtest() { signreleasefiles 'Rex Expired' find aptarchive/ -name "$DELETEFILE" -delete msgtest 'Cold archive signed by' 'Rex Expired' - aptget update 2>&1 | grep -E '^W: .* KEYEXPIRED' > /dev/null && msgpass || msgfail + updatefailure '^W: .* KEYEXPIRED' testequal "$(cat ${PKGFILE}) " aptcache show apt failaptold @@ -122,7 +149,7 @@ runtest() { signreleasefiles 'Marvin Paranoid' find aptarchive/ -name "$DELETEFILE" -delete msgtest 'Cold archive signed by' 'Marvin Paranoid' - aptget update 2>&1 | grep -E '^W: .* NO_PUBKEY' > /dev/null && msgpass || msgfail + updatefailure '^W: .* NO_PUBKEY' testequal "$(cat ${PKGFILE}) " aptcache show apt failaptold @@ -136,7 +163,7 @@ runtest() { signreleasefiles 'Joe Sixpack' find aptarchive/ -name "$DELETEFILE" -delete msgtest 'Bad warm archive signed by' 'Joe Sixpack' - aptget update 2>&1 | grep -E '^(W|E): ' > /dev/null && msgfail || msgpass + updatesuccess testequal "$(cat ${PKGFILE}-new) " aptcache show apt installaptnew @@ -147,7 +174,7 @@ runtest() { signreleasefiles 'Joe Sixpack' find aptarchive/ -name "$DELETEFILE" -delete msgtest 'Cold archive signed by' 'Joe Sixpack' - aptget update 2>&1 | grep -E '^(W|E): ' > /dev/null && msgfail || msgpass + updatesuccess testequal "$(cat ${PKGFILE}) " aptcache show apt installaptold @@ -156,7 +183,7 @@ runtest() { signreleasefiles 'Marvin Paranoid' find aptarchive/ -name "$DELETEFILE" -delete msgtest 'Good warm archive signed by' 'Marvin Paranoid' - aptget update 2>&1 | grep -E '^W: .* NO_PUBKEY' > /dev/null && msgpass || msgfail + updatefailure '^W: .* NO_PUBKEY' testequal "$(cat ${PKGFILE}) " aptcache show apt installaptold @@ -166,7 +193,7 @@ runtest() { signreleasefiles 'Rex Expired' find aptarchive/ -name "$DELETEFILE" -delete msgtest 'Good warm archive signed by' 'Rex Expired' - aptget update 2>&1 | grep -E '^W: .* KEYEXPIRED' > /dev/null && msgpass || msgfail + updatefailure '^W: .* KEYEXPIRED' testequal "$(cat ${PKGFILE}) " aptcache show apt installaptold @@ -176,7 +203,7 @@ runtest() { signreleasefiles find aptarchive/ -name "$DELETEFILE" -delete msgtest 'Good warm archive signed by' 'Joe Sixpack' - aptget update 2>&1 | grep -E '^(W|E): ' > /dev/null && msgfail || msgpass + updatesuccess testequal "$(cat ${PKGFILE}-new) " aptcache show apt installaptnew @@ -187,7 +214,7 @@ runtest2() { rm -rf rootdir/var/lib/apt/lists signreleasefiles 'Joe Sixpack' msgtest 'Cold archive signed by' 'Joe Sixpack' - aptget update 2>&1 | grep -E '^(W|E): ' > /dev/null && msgfail || msgpass + updatesuccess # New .deb but now an unsigned archive. For example MITM to circumvent # package verification. @@ -195,7 +222,7 @@ runtest2() { find aptarchive/ -name InRelease -delete find aptarchive/ -name Release.gpg -delete msgtest 'Warm archive signed by' 'nobody' - aptget update 2>&1 | grep -E '^(W|E): ' > /dev/null && msgfail || msgpass + updatesuccess testequal "$(cat ${PKGFILE}-new) " aptcache show apt failaptnew @@ -203,7 +230,7 @@ runtest2() { # Unsigned archive from the beginning must also be detected. rm -rf rootdir/var/lib/apt/lists msgtest 'Cold archive signed by' 'nobody' - aptget update 2>&1 | grep -E '^(W|E): ' > /dev/null && msgfail || msgpass + updatesuccess testequal "$(cat ${PKGFILE}-new) " aptcache show apt failaptnew -- cgit v1.2.3 From fd46d30571eb240ec3aae792e7a56061ede50524 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 30 Sep 2013 16:41:16 +0200 Subject: handle complete responses to https range requests Servers might respond with a complete file either because they don't support Ranges at all or the If-Range condition isn't statisfied, so we have to parse the headers curl gets ourself to seek or truncate the file we have so far. This also finially adds the testcase testing a bunch of partial situations for both, http and https - which is now all green. Closes: 617643, 667699 LP: 1157943 --- test/integration/apt.pem | 49 +++++++++++++ test/integration/framework | 92 +++++++++++++++++++------ test/integration/test-partial-file-support | 107 +++++++++++++++++++++++++++++ 3 files changed, 226 insertions(+), 22 deletions(-) create mode 100644 test/integration/apt.pem create mode 100755 test/integration/test-partial-file-support (limited to 'test/integration') diff --git a/test/integration/apt.pem b/test/integration/apt.pem new file mode 100644 index 000000000..f48df054d --- /dev/null +++ b/test/integration/apt.pem @@ -0,0 +1,49 @@ +-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCt4R1Q2oYF6utL +19GBhnlHW8L2BI7PRFWge/ZpqIZWsaFcb30FV86Z6aXXZmgfEJ2814ZZYD1IKeCe +JsJpns7B4vYe1v64r995ZNBQAAKIYjICkKZOBgOphV+ChBfrCctVXgfLbMP6iBdH +J02wHzSCCdZm0sdVl9tB5l/OyJU8Mb4KB3btBhfZfY2M6lU+FOjcXs1LOduUrv7K +fZ+DEalvVGkomLtHtD0qb2vkqFrTjVCkziUVWhhxFFflt08oQ01Clxpl+uv7rOQo +jtkJ1LrMuv7iPfaZ/z3qLiFxZYG1BCGEwTOKCtJo6bgFzXiN3q7Q5FFlmv851x2J +Dn8C7Qm7AgMBAAECggEAE3q6vAofJZ6Ryadd8zLLd3ESQFl2XkX7icUZb/DPS/sO +ZrqeuPCDVr7UM3NnisNjyHoktPKRKvp2DYGuGgMOiq4QgJf5ZVten8zpgWze28SU +cbEe0HLgCifE8Ww2+b/ZJbEpEmMW+YQxh2khzO9SBJdxi4dliXM/vvw+E35pKZsB +s6glrz6VQAxxa9fY4fLnB2DafHy+pUvRVw8gC6PCM9jXN9tMYAqztsJu7aaanNyT +HX2UDWa8hxVx6t5UQZuxvst9N+RcEwmVCR2qlfZt/VRBRibBm62crEKbTD00mNHQ +4AIDn3g6Y3SXpDlgtNpjLyBL3fODPIwqwGdblaSKkQKBgQDYXecu0Eda7kbR5ciW +IAn8XOxsBIkkh8YVl2gRiiajRVoeiYBHaW9TyuQiaWrftiDQxB/N4G2focTXy/7O +VJn6e/SUoO/ZGRw2GbTxLUQptgvFsejYCcW9XpC8MCwE/y2swiY7JM0WR8cV2nCk +a/Cls6f1LjL13aFO0PAorEcahQKBgQDNuth6EHZVwfDgUuqhRw4HIIpfsfiA3UOd +b5k/NsfQIev1YUqnfucgInNPDq2Jf8eTQw3TKaszo2DCjDffCsEgM09Tym143Bd6 +AsMuqAStsE3IEC7pnmh95l29/7mh4OuG5cp5JUx0Pi5PkuJ6ywA8P1rM1MB9Zf52 +NGJCo1pnPwKBgQCx/n4i+uDYo1DLd/dN2UmdvGwaaJjR3ohMVuQcGcSzaGg82u0W +0lvtWOnYjVSIeXIBjHaFjW1hd1lSFdWms96AO9z3MHZf6NJWh0tdZNnAXqzMlBFz +OIbdxJ/Y0OBFtA9FIesFmL7G54GWLr+f49Ry3Jr9jmYJ8au0BRqsux07aQKBgC4q +CT2KyCMCO/z6XjAGc71hres/UlYIUI3ZZvfqYPfxRLNxO4FOVqq9UEajMomyJKSE +3WtO5F3YAXRmZnskPKXvHZPdzqbaLGJykD298h7PewSzrPM7WpM1yD9ETPFoOTGy +CrcYiYlkEpxEh5GqT8k1JjjkXLVG18zKgGoXocedAoGAQyU2DCNfxwzIJfFHKZEG +zpni72cR68Tu3AhW/38vMR2ZPca4KzXrUA52T+j7vkQC38LHm/mzNXNP7Vya0PJ3 +WoYOcLtg2uFPh0P/35ArEzuNooLsvulgg1jsamPbF8KAvJZKZHr30hlC/JGYSBbV +bnkzJTShsKzHIUiLtQ8Ja+E= +-----END PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +MIIDezCCAmOgAwIBAgIJAJ39xapQo0vLMA0GCSqGSIb3DQEBBQUAMFMxCzAJBgNV +BAYTAkRFMRMwEQYDVQQIDApTb21lLVN0YXRlMRswGQYDVQQKDBJBUFQgVGVzdGNh +c2VzIEdtYkgxEjAQBgNVBAMMCWxvY2FsaG9zdDAgFw0xMzA5MTYwODQ4MzVaGA80 +NzUxMDgxMzA4NDgzNVowUzELMAkGA1UEBhMCREUxEzARBgNVBAgMClNvbWUtU3Rh +dGUxGzAZBgNVBAoMEkFQVCBUZXN0Y2FzZXMgR21iSDESMBAGA1UEAwwJbG9jYWxo +b3N0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAreEdUNqGBerrS9fR +gYZ5R1vC9gSOz0RVoHv2aaiGVrGhXG99BVfOmeml12ZoHxCdvNeGWWA9SCngnibC +aZ7OweL2Htb+uK/feWTQUAACiGIyApCmTgYDqYVfgoQX6wnLVV4Hy2zD+ogXRydN +sB80ggnWZtLHVZfbQeZfzsiVPDG+Cgd27QYX2X2NjOpVPhTo3F7NSznblK7+yn2f +gxGpb1RpKJi7R7Q9Km9r5Kha041QpM4lFVoYcRRX5bdPKENNQpcaZfrr+6zkKI7Z +CdS6zLr+4j32mf896i4hcWWBtQQhhMEzigrSaOm4Bc14jd6u0ORRZZr/OdcdiQ5/ +Au0JuwIDAQABo1AwTjAdBgNVHQ4EFgQUhd26E7ykEYRTDbgMzkYtFtENhSkwHwYD +VR0jBBgwFoAUhd26E7ykEYRTDbgMzkYtFtENhSkwDAYDVR0TBAUwAwEB/zANBgkq +hkiG9w0BAQUFAAOCAQEAWcyMKi0Vc4beGV7w4Qft0/2P68jjMlQRdgkz+gGXbMVr +//KhqR3PbgFmHHpUsZ718AHeerNNdfFzOUptiAiOqH2muyAGdeWCxJ8KcU0sic8x +/h3TOzMYfEozhgMSJp9YW1z655uHcb15S7jb4zZwXwGyQzxwXT35SKj2mCqSbjIb +G987DGI+MtyoGRXhIwnBEsGTI1ck3NoeXBJ/tS/Ma8gUUC2xldMSprtHjeUHvZV2 +iz/HTqGlMLGW96AVeZiFNiC1fJ6pvref2XW5MkkvQm8tOi2cSrwJc9CgnCpCxkLp +liRsbwAduwkA26XzEomMR7yyYS5pm0Eu0cO9X39FKQ== +-----END CERTIFICATE----- diff --git a/test/integration/framework b/test/integration/framework index 4003d932c..a2bb871cc 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -795,6 +795,13 @@ signreleasefiles() { msgdone "info" } +rewritesourceslist() { + local APTARCHIVE="file://$(readlink -f "${TMPWORKINGDIRECTORY}/aptarchive")" + for LIST in $(find rootdir/etc/apt/sources.list.d/ -name 'apt-test-*.list'); do + sed -i $LIST -e "s#$APTARCHIVE#${1}#" -e "s#http://localhost:8080/#${1}#" -e "s#http://localhost:4433/#${1}#" + done +} + changetowebserver() { local LOG='/dev/null' if test -x ${BUILDDIRECTORY}/aptwebserver; then @@ -806,31 +813,32 @@ changetowebserver() { fi addtrap "kill $PID;" cd - > /dev/null - elif [ $# -gt 0 ]; then - msgdie 'Need the aptwebserver when passing arguments for the webserver' - elif which weborf > /dev/null; then - weborf -xb aptarchive/ >$LOG 2>&1 & - addtrap "kill $!;" - elif which gatling > /dev/null; then - cd aptarchive - gatling -p 8080 -F -S >$LOG 2>&1 & - addtrap "kill $!;" - cd - > /dev/null - elif which lighttpd > /dev/null; then - echo "server.document-root = \"$(readlink -f ./aptarchive)\" -server.port = 8080 -server.stat-cache-engine = \"disable\"" > lighttpd.conf - lighttpd -t -f lighttpd.conf >/dev/null || msgdie 'Can not change to webserver: our lighttpd config is invalid' - lighttpd -D -f lighttpd.conf >$LOG 2>&1 & - addtrap "kill $!;" else msgdie 'You have to build aptwerbserver or install a webserver' fi - local APTARCHIVE="file://$(readlink -f ./aptarchive)" - for LIST in $(find rootdir/etc/apt/sources.list.d/ -name 'apt-test-*.list'); do - sed -i $LIST -e "s#$APTARCHIVE#http://localhost:8080/#" - done - return 0 + if [ "$1" != '--no-rewrite' ]; then + rewritesourceslist 'http://localhost:8080/' + fi +} + +changetohttpswebserver() { + if ! which stunnel4 >/dev/null; then + msgdie 'You need to install stunnel4 for https testcases' + fi + if [ ! -e "${TMPWORKINGDIRECTORY}/aptarchive/aptwebserver.pid" ]; then + changetowebserver --no-rewrite + fi + echo "pid = ${TMPWORKINGDIRECTORY}/aptarchive/stunnel.pid +cert = ${TESTDIRECTORY}/apt.pem + +[https] +accept = 4433 +connect = 8080 +" > ${TMPWORKINGDIRECTORY}/stunnel.conf + stunnel4 "${TMPWORKINGDIRECTORY}/stunnel.conf" + local PID="$(cat ${TMPWORKINGDIRECTORY}/aptarchive/stunnel.pid)" + addtrap 'prefix' "kill ${PID};" + rewritesourceslist 'https://localhost:4433/' } changetocdrom() { @@ -848,6 +856,46 @@ changetocdrom() { find rootdir/etc/apt/sources.list.d/ -name 'apt-test-*.list' -delete } +downloadfile() { + PROTO="$(echo "$1" | cut -d':' -f 1)" + local DOWNLOG="${TMPWORKINGDIRECTORY}/download.log" + rm -f "$DOWNLOG" + touch "$DOWNLOG" + { + echo "601 Configuration +Config-Item: Acquire::https::CaInfo=${TESTDIR}/apt.pem +Config-Item: Debug::Acquire::${PROTO}=1 + +600 Acquire URI +URI: $1 +Filename: ${2} +" + # simple worker keeping stdin open until we are done (201) or error (400) + # and requesting new URIs on try-agains/redirects inbetween + { tail -n 999 -f "$DOWNLOG" & echo "TAILPID: $!"; } | while read f1 f2; do + if [ "$f1" = 'TAILPID:' ]; then + TAILPID="$f2" + elif [ "$f1" = 'New-URI:' ]; then + echo "600 Acquire URI +URI: $f2 +Filename: ${2} +" + elif [ "$f1" = '201' ] || [ "$f1" = '400' ]; then + # tail would only die on next read – which never happens + test -z "$TAILPID" || kill -s HUP "$TAILPID" + break + fi + done + } | LD_LIBRARY_PATH=${BUILDDIRECTORY} ${BUILDDIRECTORY}/methods/${PROTO} 2>&1 | tee "$DOWNLOG" + rm "$DOWNLOG" + # only if the file exists the download was successful + if [ -e "$2" ]; then + return 0 + else + return 1 + fi +} + checkdiff() { local DIFFTEXT="$($(which diff) -u $* | sed -e '/^---/ d' -e '/^+++/ d' -e '/^@@/ d')" if [ -n "$DIFFTEXT" ]; then diff --git a/test/integration/test-partial-file-support b/test/integration/test-partial-file-support new file mode 100755 index 000000000..8d1c51ae0 --- /dev/null +++ b/test/integration/test-partial-file-support @@ -0,0 +1,107 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' + +changetowebserver + +copysource() { + dd if="$1" bs=1 count="$2" of="$3" 2>/dev/null + touch -d "$(stat --format '%y' "${TESTFILE}")" "$3" +} + +testdownloadfile() { + local DOWNLOG='download-testfile.log' + rm -f "$DOWNLOG" + msgtest "Testing download of file $2 with" "$1" + if ! downloadfile "$2" "$3" > "$DOWNLOG"; then + cat "$DOWNLOG" + msgfail + else + msgpass + fi + cat "$DOWNLOG" | while read field hash; do + local EXPECTED + case "$field" in + 'MD5Sum-Hash:') EXPECTED="$(md5sum "$TESTFILE" | cut -d' ' -f 1)";; + 'SHA1-Hash:') EXPECTED="$(sha1sum "$TESTFILE" | cut -d' ' -f 1)";; + 'SHA256-Hash:') EXPECTED="$(sha256sum "$TESTFILE" | cut -d' ' -f 1)";; + 'SHA512-Hash:') EXPECTED="$(sha512sum "$TESTFILE" | cut -d' ' -f 1)";; + *) continue;; + esac + if [ "$4" = '=' ]; then + msgtest 'Test downloaded file for correct' "$field" + else + msgtest 'Test downloaded file does not match in' "$field" + fi + if [ "$EXPECTED" "$4" "$hash" ]; then + msgpass + else + cat "$DOWNLOG" + msgfail "expected: $EXPECTED ; got: $hash" + fi + done +} + +testwebserverlaststatuscode() { + STATUS="$(mktemp)" + addtrap "rm $STATUS;" + msgtest 'Test last status code from the webserver was' "$1" + downloadfile "http://localhost:8080/_config/find/aptwebserver::last-status-code" "$STATUS" >/dev/null + if [ "$(cat "$STATUS")" = "$1" ]; then + msgpass + else + cat download-testfile.log + msgfail "Status was $(cat "$STATUS")" + fi +} + + +TESTFILE='aptarchive/testfile' +cp -a ${TESTDIR}/framework $TESTFILE + +testrun() { + downloadfile "$1/_config/set/aptwebserver::support::range/true" '/dev/null' >/dev/null + testwebserverlaststatuscode '200' + + copysource $TESTFILE 0 ./testfile + testdownloadfile 'no data' "${1}/testfile" './testfile' '=' + testwebserverlaststatuscode '200' + + copysource $TESTFILE 20 ./testfile + testdownloadfile 'valid partial data' "${1}/testfile" './testfile' '=' + testwebserverlaststatuscode '206' + + copysource /dev/zero 20 ./testfile + testdownloadfile 'invalid partial data' "${1}/testfile" './testfile' '!=' + testwebserverlaststatuscode '206' + + copysource $TESTFILE 1M ./testfile + testdownloadfile 'completely downloaded file' "${1}/testfile" './testfile' '=' + testwebserverlaststatuscode '416' + + copysource /dev/zero 1M ./testfile + testdownloadfile 'too-big partial file' "${1}/testfile" './testfile' '=' + testwebserverlaststatuscode '200' + + copysource /dev/zero 20 ./testfile + touch ./testfile + testdownloadfile 'old data' "${1}/testfile" './testfile' '=' + testwebserverlaststatuscode '200' + + downloadfile "$1/_config/set/aptwebserver::support::range/false" '/dev/null' >/dev/null + testwebserverlaststatuscode '200' + + copysource $TESTFILE 20 ./testfile + testdownloadfile 'no server support' "${1}/testfile" './testfile' '=' + testwebserverlaststatuscode '200' +} + +testrun 'http://localhost:8080' + +changetohttpswebserver + +testrun 'https://localhost:4433' -- cgit v1.2.3 From 8fa042ca39dcb39d544f015f4a924c5dbc10ad2c Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 30 Sep 2013 18:51:40 +0200 Subject: don't consider holds for autoremoval MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We can't remove packages which are held back by the user with a hold, so marking them (or its dependencies) as garbage will lead our autoremover into madness – and given that the package is important enough that the user has held it back it can't be garbage (at least at the moment), so even if a front-end wants to use the info just for information display its a good idea to not consider it garbage for them. Closes: 724995 --- test/integration/test-apt-get-autoremove | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'test/integration') diff --git a/test/integration/test-apt-get-autoremove b/test/integration/test-apt-get-autoremove index dc30cde34..68ea1c574 100755 --- a/test/integration/test-apt-get-autoremove +++ b/test/integration/test-apt-get-autoremove @@ -49,3 +49,23 @@ Install: unrelated:i386 (1), debhelper:i386 (8.0.0), po-debconf:i386 (1.0.16, au Remove: debhelper:i386 (8.0.0) Remove: po-debconf:i386 (1.0.16)' + +testsuccess aptget install debhelper -y +testdpkginstalled 'unrelated' 'debhelper' 'po-debconf' +testsuccess aptmark auto debhelper + +testmarkedauto 'debhelper' 'po-debconf' +testequal 'Reading package lists... +Building dependency tree... +Reading state information... +The following packages will be REMOVED: + debhelper po-debconf +0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded. +Remv debhelper [8.0.0] +Remv po-debconf [1.0.16]' aptget autoremove -s + +testsuccess aptmark hold debhelper +testequal 'Reading package lists... +Building dependency tree... +Reading state information... +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget autoremove -s -- cgit v1.2.3 From 18908589a096719eb4ce76123596865093d6ff9d Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 2 Oct 2013 13:34:59 +0200 Subject: tests: fix some problems travis encounters Git-Dch: Ignore --- test/integration/framework | 82 ++++++------- .../skip-bug-601016-description-translation | 133 +++++++++++++++++++++ .../test-bug-601016-description-translation | 133 --------------------- ...est-bug-633350-do-not-kill-last-char-in-Release | 2 +- .../test-bug-679371-apt-get-autoclean-multiarch | 5 +- .../test-bug-686346-package-missing-architecture | 13 +- 6 files changed, 187 insertions(+), 181 deletions(-) create mode 100755 test/integration/skip-bug-601016-description-translation delete mode 100755 test/integration/test-bug-601016-description-translation (limited to 'test/integration') diff --git a/test/integration/framework b/test/integration/framework index a2bb871cc..d899bb574 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -216,14 +216,13 @@ getarchitectures() { } configarchitecture() { - local CONFFILE=rootdir/etc/apt/apt.conf.d/01multiarch.conf - rm -f $CONFFILE - echo "APT::Architecture \"$(getarchitecture $1)\";" > $CONFFILE - shift - while [ -n "$1" ]; do - echo "APT::Architectures:: \"$(getarchitecture $1)\";" >> $CONFFILE - shift - done + { + echo "APT::Architecture \"$(getarchitecture $1)\";" + while [ -n "$1" ]; do + echo "APT::Architectures:: \"$(getarchitecture $1)\";" + shift + done + } >rootdir/etc/apt/apt.conf.d/01multiarch.conf configdpkg } @@ -236,16 +235,17 @@ configdpkg() { echo -n > rootdir/var/lib/dpkg/status fi fi + rm -f rootdir/etc/apt/apt.conf.d/00foreigndpkg if $(which dpkg) --assert-multi-arch >/dev/null 2>&1; then local ARCHS="$(getarchitectures)" if echo "$ARCHS" | grep -E -q '[^ ]+ [^ ]+'; then DPKGARCH="$(dpkg --print-architecture)" for ARCH in ${ARCHS}; do if [ "${ARCH}" != "${DPKGARCH}" ]; then - if ! dpkg --add-architecture ${ARCH}; then + if ! dpkg --add-architecture ${ARCH} >/dev/null 2>&1; then # old-style used e.g. in Ubuntu-P – and as it seems travis - echo "DPKG::options:: \"--foreign-architecture\";" >> aptconfig.conf - echo "DPKG::options:: \"${ARCH}\";" >> aptconfig.conf + echo "DPKG::options:: \"--foreign-architecture\";" >> rootdir/etc/apt/apt.conf.d/00foreigndpkg + echo "DPKG::options:: \"${ARCH}\";" >> rootdir/etc/apt/apt.conf.d/00foreigndpkg fi fi done @@ -278,7 +278,11 @@ setupsimplenativepackage() { local VERSION="$3" local RELEASE="${4:-unstable}" local DEPENDENCIES="$5" - local DESCRIPTION="$6" + local DESCRIPTION="${6:-"Description: an autogenerated dummy ${NAME}=${VERSION}/${RELEASE} + If you find such a package installed on your system, + something went horribly wrong! They are autogenerated + und used only by testcases and surf no other propose…"}" + local SECTION="${7:-others}" local DISTSECTION if [ "$SECTION" = "$(echo "$SECTION" | cut -d'/' -f 2)" ]; then @@ -310,14 +314,8 @@ Package: $NAME" > debian/control echo "Architecture: any" >> debian/control fi test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> debian/control - if [ -z "$DESCRIPTION" ]; then - echo "Description: an autogenerated dummy ${NAME}=${VERSION}/${RELEASE} - If you find such a package installed on your system, - YOU did something horribly wrong! They are autogenerated - und used only by testcases for APT and surf no other propose…" >> debian/control - else - echo "Description: $DESCRIPTION" >> debian/control - fi + echo "Description: $DESCRIPTION" >> debian/control + test -e debian/compat || echo "7" > debian/compat test -e debian/source/format || echo "3.0 (native)" > debian/source/format test -e debian/rules || cp /usr/share/doc/debhelper/examples/rules.tiny debian/rules @@ -330,7 +328,11 @@ buildsimplenativepackage() { local VERSION="$3" local RELEASE="${4:-unstable}" local DEPENDENCIES="$5" - local DESCRIPTION="$6" + local DESCRIPTION="${6:-"Description: an autogenerated dummy ${NAME}=${VERSION}/${RELEASE} + If you find such a package installed on your system, + something went horribly wrong! They are autogenerated + und used only by testcases and surf no other propose…"}" + local SECTION="${7:-others}" local PRIORITY="${8:-optional}" local DISTSECTION @@ -370,14 +372,7 @@ Package: $NAME" >> ${BUILDDIR}/debian/control fi local DEPS="$(echo "$DEPENDENCIES" | grep -v '^Build-')" test -z "$DEPS" || echo "$DEPS" >> ${BUILDDIR}/debian/control - if [ -z "$DESCRIPTION" ]; then - echo "Description: an autogenerated dummy ${NAME}=${VERSION}/${RELEASE} - If you find such a package installed on your system, - YOU did something horribly wrong! They are autogenerated - und used only by testcases for APT and surf no other propose…" >> ${BUILDDIR}/debian/control - else - echo "Description: $DESCRIPTION" >> ${BUILDDIR}/debian/control - fi + echo "Description: $DESCRIPTION" >> ${BUILDDIR}/debian/control echo '3.0 (native)' > ${BUILDDIR}/debian/source/format (cd ${BUILDDIR}/..; dpkg-source -b ${NAME}-${VERSION} 2>&1) | sed -n 's#^dpkg-source: info: building [^ ]\+ in ##p' \ @@ -526,7 +521,10 @@ insertpackage() { local VERSION="$4" local DEPENDENCIES="$5" local PRIORITY="${6:-optional}" - local DESCRIPTION="${7}" + local DESCRIPTION="${7:-"Description: an autogenerated dummy ${NAME}=${VERSION}/${RELEASE} + If you find such a package installed on your system, + something went horribly wrong! They are autogenerated + und used only by testcases and surf no other propose…"}" local ARCHS="" for arch in $(echo "$ARCH" | sed -e 's#,#\n#g' | sed -e "s#^native\$#$(getarchitecture 'native')#"); do if [ "$arch" = 'all' -o "$arch" = 'none' ]; then @@ -548,15 +546,7 @@ Maintainer: Joe Sixpack " >> $FILE echo "Version: $VERSION Filename: pool/main/${NAME}/${NAME}_${VERSION}_${arch}.deb" >> $FILE test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> $FILE - echo -n 'Description: ' >> $FILE - if [ -z "$DESCRIPTION" ]; then - echo "an autogenerated dummy ${NAME}=${VERSION}/${RELEASE} - If you find such a package installed on your system, - YOU did something horribly wrong! They are autogenerated - und used only by testcases for APT and surf no other propose…" >> $FILE - else - echo "$DESCRIPTION" >> $FILE - fi + echo "Description: $DESCRIPTION" >> $FILE echo >> $FILE done done @@ -591,6 +581,11 @@ insertinstalledpackage() { local DEPENDENCIES="$4" local PRIORITY="${5:-optional}" local STATUS="${6:-install ok installed}" + local DESCRIPTION="${7:-"Description: an autogenerated dummy ${NAME}=${VERSION}/installed + If you find such a package installed on your system, + something went horribly wrong! They are autogenerated + und used only by testcases and surf no other propose…"}" + local FILE='rootdir/var/lib/dpkg/status' local INFO='rootdir/var/lib/dpkg/info' for arch in $(echo "$ARCH" | sed -e 's#,#\n#g' | sed -e "s#^native\$#$(getarchitecture 'native')#"); do @@ -603,11 +598,8 @@ Maintainer: Joe Sixpack Version: $VERSION" >> $FILE test "$arch" = 'none' || echo "Architecture: $arch" >> $FILE test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> $FILE - echo "Description: an autogenerated dummy ${NAME}=${VERSION}/installed - If you find such a package installed on your system, - YOU did something horribly wrong! They are autogenerated - und used only by testcases for APT and surf no other propose… -" >> $FILE + echo "Description: $DESCRIPTION" >> $FILE + echo >> $FILE if [ "$(dpkg-query -W --showformat='${Multi-Arch}')" = 'same' ]; then echo -n > ${INFO}/${NAME}:${arch}.list else @@ -941,7 +933,7 @@ testequalor2() { echo "$2" > $COMPAREFILE2 shift 2 msgtest "Test for equality OR of" "$*" - $* >$COMPAREAGAINST 2>&1 + $* >$COMPAREAGAINST 2>&1 || true (checkdiff $COMPAREFILE1 $COMPAREAGAINST 1> /dev/null || checkdiff $COMPAREFILE2 $COMPAREAGAINST 1> /dev/null) && msgpass || ( echo "\n${CINFO}Diff against OR 1${CNORMAL}" "$(checkdiff $COMPAREFILE1 $COMPAREAGAINST)" \ diff --git a/test/integration/skip-bug-601016-description-translation b/test/integration/skip-bug-601016-description-translation new file mode 100755 index 000000000..33c209e9d --- /dev/null +++ b/test/integration/skip-bug-601016-description-translation @@ -0,0 +1,133 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'i386' 'amd64' + +# we need a valid locale here, otherwise the language configuration +# will be overridden by LC_ALL=C +LOCALE="$(echo "$LANG" | cut -d'_' -f 1)" +MD5Sum='Description-md5: d41ee493aa9fcc6cbc9ce4eb7069959c' + +PACKAGESTANZA='Package: apt +Priority: important +Section: admin +Installed-Size: 5984 +Maintainer: APT Development Team +Architecture: i386 +Version: 0.8.7 +Filename: pool/main/a/apt/apt_0.8.7_i386.deb +Size: 2140230 +MD5sum: 74769bfbcef9ebc4fa74f7a5271b9c08' + +PACKAGESTANZA2='Package: apt +Priority: important +Section: admin +Installed-Size: 5984 +Maintainer: APT Development Team +Architecture: amd64 +Version: 0.8.7 +Filename: pool/main/a/apt/apt_0.8.7_amd64.deb +Size: 2210342 +MD5sum: 4a869bfbdef9ebc9fa74f7a5271e8d1a' + +echo "$PACKAGESTANZA +Description: Advanced front-end for dpkg +$MD5Sum + +$PACKAGESTANZA2 +Description: Advanced front-end for dpkg +$MD5Sum" > aptarchive/Packages + +echo "Package: apt +Description-${LOCALE}: Mächtige Oberfläche für dpkg + Das Paket bietet dem Nutzer technisch führende Methoden für den Zugriff + 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 + +# 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 + +NOLONGSTANZA="$PACKAGESTANZA +Description: Advanced front-end for dpkg +$MD5Sum +" + +ENGLISHSTANZA="$PACKAGESTANZA +Description: Advanced front-end for dpkg +$MD5Sum +" + +LOCALESTANZA="$PACKAGESTANZA +Description-${LOCALE}: Mächtige Oberfläche für dpkg + Das Paket bietet dem Nutzer technisch führende Methoden für den Zugriff + 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 +" +LOCALESTANZA2="$PACKAGESTANZA2 +Description-${LOCALE}: Mächtige Oberfläche für dpkg + Das Paket bietet dem Nutzer technisch führende Methoden für den Zugriff + 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 +" + +testrun() { + echo "Acquire::Languages { \"${LOCALE}\"; \"en\"; };" > rootdir/etc/apt/apt.conf.d/00languages + export LC_ALL="" + rm -rf rootdir/var/lib/apt/lists + setupaptarchive + testequal "$LOCALESTANZA" aptcache show apt -o Test=File-${LOCALE} + testequal "$LOCALESTANZA" aptcache show apt:i386 -o Test=File-${LOCALE} + 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} + 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} + echo "Acquire::Languages { \"ww\"; \"en\"; };" > rootdir/etc/apt/apt.conf.d/00languages + testequal "$ENGLISHSTANZA" aptcache show apt -o Test=File-ww +} + +testrun + +echo "$PACKAGESTANZA +Description: Advanced front-end for dpkg +$MD5Sum + +$PACKAGESTANZA2 +Description: Advanced front-end for dpkg +$MD5Sum" > 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" | bzip2 > aptarchive/en.bz2 + +ENGLISHSTANZA="$PACKAGESTANZA +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 +" +ENGLISHSTANZA2="$PACKAGESTANZA2 +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 +" + +testrun diff --git a/test/integration/test-bug-601016-description-translation b/test/integration/test-bug-601016-description-translation deleted file mode 100755 index 33c209e9d..000000000 --- a/test/integration/test-bug-601016-description-translation +++ /dev/null @@ -1,133 +0,0 @@ -#!/bin/sh -set -e - -TESTDIR=$(readlink -f $(dirname $0)) -. $TESTDIR/framework -setupenvironment -configarchitecture 'i386' 'amd64' - -# we need a valid locale here, otherwise the language configuration -# will be overridden by LC_ALL=C -LOCALE="$(echo "$LANG" | cut -d'_' -f 1)" -MD5Sum='Description-md5: d41ee493aa9fcc6cbc9ce4eb7069959c' - -PACKAGESTANZA='Package: apt -Priority: important -Section: admin -Installed-Size: 5984 -Maintainer: APT Development Team -Architecture: i386 -Version: 0.8.7 -Filename: pool/main/a/apt/apt_0.8.7_i386.deb -Size: 2140230 -MD5sum: 74769bfbcef9ebc4fa74f7a5271b9c08' - -PACKAGESTANZA2='Package: apt -Priority: important -Section: admin -Installed-Size: 5984 -Maintainer: APT Development Team -Architecture: amd64 -Version: 0.8.7 -Filename: pool/main/a/apt/apt_0.8.7_amd64.deb -Size: 2210342 -MD5sum: 4a869bfbdef9ebc9fa74f7a5271e8d1a' - -echo "$PACKAGESTANZA -Description: Advanced front-end for dpkg -$MD5Sum - -$PACKAGESTANZA2 -Description: Advanced front-end for dpkg -$MD5Sum" > aptarchive/Packages - -echo "Package: apt -Description-${LOCALE}: Mächtige Oberfläche für dpkg - Das Paket bietet dem Nutzer technisch führende Methoden für den Zugriff - 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 - -# 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 - -NOLONGSTANZA="$PACKAGESTANZA -Description: Advanced front-end for dpkg -$MD5Sum -" - -ENGLISHSTANZA="$PACKAGESTANZA -Description: Advanced front-end for dpkg -$MD5Sum -" - -LOCALESTANZA="$PACKAGESTANZA -Description-${LOCALE}: Mächtige Oberfläche für dpkg - Das Paket bietet dem Nutzer technisch führende Methoden für den Zugriff - 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 -" -LOCALESTANZA2="$PACKAGESTANZA2 -Description-${LOCALE}: Mächtige Oberfläche für dpkg - Das Paket bietet dem Nutzer technisch führende Methoden für den Zugriff - 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 -" - -testrun() { - echo "Acquire::Languages { \"${LOCALE}\"; \"en\"; };" > rootdir/etc/apt/apt.conf.d/00languages - export LC_ALL="" - rm -rf rootdir/var/lib/apt/lists - setupaptarchive - testequal "$LOCALESTANZA" aptcache show apt -o Test=File-${LOCALE} - testequal "$LOCALESTANZA" aptcache show apt:i386 -o Test=File-${LOCALE} - 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} - 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} - echo "Acquire::Languages { \"ww\"; \"en\"; };" > rootdir/etc/apt/apt.conf.d/00languages - testequal "$ENGLISHSTANZA" aptcache show apt -o Test=File-ww -} - -testrun - -echo "$PACKAGESTANZA -Description: Advanced front-end for dpkg -$MD5Sum - -$PACKAGESTANZA2 -Description: Advanced front-end for dpkg -$MD5Sum" > 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" | bzip2 > aptarchive/en.bz2 - -ENGLISHSTANZA="$PACKAGESTANZA -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 -" -ENGLISHSTANZA2="$PACKAGESTANZA2 -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 -" - -testrun diff --git a/test/integration/test-bug-633350-do-not-kill-last-char-in-Release b/test/integration/test-bug-633350-do-not-kill-last-char-in-Release index 2aae7cfcc..988f8c9d0 100755 --- a/test/integration/test-bug-633350-do-not-kill-last-char-in-Release +++ b/test/integration/test-bug-633350-do-not-kill-last-char-in-Release @@ -8,7 +8,7 @@ configarchitecture 'amd64' insertpackage 'unstable' 'cool' 'amd64' '1.0' -setupaptarchive 2> /dev/null +setupaptarchive --no-update echo 'NotAutomatic: yes' >> aptarchive/dists/unstable/Release diff --git a/test/integration/test-bug-679371-apt-get-autoclean-multiarch b/test/integration/test-bug-679371-apt-get-autoclean-multiarch index b62d437aa..3de7d69f9 100755 --- a/test/integration/test-bug-679371-apt-get-autoclean-multiarch +++ b/test/integration/test-bug-679371-apt-get-autoclean-multiarch @@ -17,7 +17,10 @@ changetowebserver testsuccess aptget update testsuccess aptget install pkgall pkgnative pkgforeign -y -testdpkginstalled pkgall pkgnative pkgforeign +# if we work with an old dpkg, pkgforeign will be listed differently, +# so test with aptcache for install status instead +testdpkginstalled pkgall pkgnative +testsuccess aptcache show pkgforeign/installed testequal 'Reading package lists... Building dependency tree... diff --git a/test/integration/test-bug-686346-package-missing-architecture b/test/integration/test-bug-686346-package-missing-architecture index 3b02811ca..dc51861ab 100755 --- a/test/integration/test-bug-686346-package-missing-architecture +++ b/test/integration/test-bug-686346-package-missing-architecture @@ -73,7 +73,7 @@ insertinstalledpackage 'pkgb' 'none' '1' insertinstalledpackage 'pkgf' 'none' '1' 'Conflicts: pkgb' insertinstalledpackage 'pkgg' 'amd64' '1' 'Conflicts: pkgb' insertinstalledpackage 'pkgb' 'amd64' '2' -testequal "Reading package lists... +testequalor2 "Reading package lists... Building dependency tree... Reading state information... You might want to run 'apt-get -f install' to correct these. @@ -84,6 +84,17 @@ 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... +Building dependency tree... +Reading state information... +You might want to run 'apt-get -f 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 + pkgf:none : Conflicts: pkgb but 2 is installed + 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 # check that dependencies are generated for none-packages -- cgit v1.2.3 From d57f6084aaa3972073114973d149ea2291b36682 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 3 Oct 2013 15:11:21 +0200 Subject: use pkgAcqArchive in 'download' for proper errors With a bit of trickery we can reuse the usual infrastructure we have in place to acquire deb files for the 'download' operation as well, which gains us authentification check & display, error messages, correct filenames and "downloads" from the root-owned archives. --- test/integration/test-apt-get-download | 3 ++- ...17690-allow-unauthenticated-makes-all-untrusted | 29 +++++++++++++++------- .../test-bug-722207-print-uris-even-if-very-quiet | 2 +- 3 files changed, 23 insertions(+), 11 deletions(-) (limited to 'test/integration') diff --git a/test/integration/test-apt-get-download b/test/integration/test-apt-get-download index 420b2e380..6eac079f3 100755 --- a/test/integration/test-apt-get-download +++ b/test/integration/test-apt-get-download @@ -20,13 +20,14 @@ testdownload() { fi msgtest "Test download of package file $1 with" "$APT" aptget -qq download ${APT} && test -f $1 && msgpass || msgfail + rm $1 } testdownload apt_1.0_all.deb apt stable testdownload apt_2.0_all.deb apt DEBFILE="$(readlink -f aptarchive)/pool/apt_2.0_all.deb" -testequal "'file://${DEBFILE}' apt_2.0_all.deb $(stat -c%s $DEBFILE) sha512:$(sha512sum $DEBFILE | cut -d' ' -f 1)" aptget download apt --print-uris +testequal "'file://${DEBFILE}' apt_2.0_all.deb $(stat -c%s $DEBFILE) SHA512:$(sha512sum $DEBFILE | cut -d' ' -f 1)" aptget download apt --print-uris # deb:677887 testequal "E: Can't find a source to download version '1.0' of 'vrms:i386'" aptget download vrms diff --git a/test/integration/test-bug-617690-allow-unauthenticated-makes-all-untrusted b/test/integration/test-bug-617690-allow-unauthenticated-makes-all-untrusted index 1c2514938..633c197c0 100755 --- a/test/integration/test-bug-617690-allow-unauthenticated-makes-all-untrusted +++ b/test/integration/test-bug-617690-allow-unauthenticated-makes-all-untrusted @@ -26,17 +26,26 @@ testrun() { rm -rf rootdir/var/lib/apt testsuccess aptget update - testsuccess aptget download cool - testfileexists 'cool_1.0_i386.deb' + if [ "$1" = 'trusted' ]; then + testsuccess aptget download cool + testfileexists 'cool_1.0_i386.deb' + + testsuccess aptget download cool --allow-unauthenticated + testfileexists 'cool_1.0_i386.deb' + else + testfailure aptget download cool + testfilemissing 'cool_1.0_i386.deb' + + testsuccess aptget download cool --allow-unauthenticated + testfileexists 'cool_1.0_i386.deb' + fi mv aptarchive/pool/cool_1.0_i386.deb aptarchive/pool/cool_1.0_i386.deb.bak echo 'this is not a good package' > aptarchive/pool/cool_1.0_i386.deb - # FIXME: apt-get download should exit non-zero if download fails - aptget download cool + testfailure aptget download cool testfilemissing cool_1.0_i386.deb - # FIXME: apt-get download should exit non-zero if download fails - aptget download cool --allow-unauthenticated # unauthenticated doesn't mean unchecked + testfailure aptget download cool --allow-unauthenticated # unauthenticated doesn't mean unchecked testfilemissing cool_1.0_i386.deb rm -f aptarchive/pool/cool_1.0_i386.deb @@ -45,8 +54,10 @@ testrun() { testfileexists 'cool_1.0_i386.deb' } -testrun +testrun 'trusted' find aptarchive/ \( -name 'Release.gpg' -o -name 'InRelease' \) -delete -# FIXME: apt-get download should warn about untrusted downloads -testrun +testrun 'untrusted' + +changetowebserver +testrun 'untrusted' diff --git a/test/integration/test-bug-722207-print-uris-even-if-very-quiet b/test/integration/test-bug-722207-print-uris-even-if-very-quiet index 9524bab07..f2d95da19 100755 --- a/test/integration/test-bug-722207-print-uris-even-if-very-quiet +++ b/test/integration/test-bug-722207-print-uris-even-if-very-quiet @@ -19,7 +19,7 @@ APTARCHIVE=$(readlink -f ./aptarchive) testequal "'file://${APTARCHIVE}/pool/main/apt/apt_2_all.deb' apt_2_all.deb 0 MD5Sum:" aptget upgrade -qq --print-uris testequal "'file://${APTARCHIVE}/pool/main/apt/apt_2_all.deb' apt_2_all.deb 0 MD5Sum:" aptget dist-upgrade -qq --print-uris testequal "'file://${APTARCHIVE}/pool/main/apt/apt_2_all.deb' apt_2_all.deb 0 MD5Sum:" aptget install apt -qq --print-uris -testequal "'file://${APTARCHIVE}/pool/main/apt/apt_2_all.deb' apt_2_all.deb 0 :" aptget download apt -qq --print-uris +testequal "'file://${APTARCHIVE}/pool/main/apt/apt_2_all.deb' apt_2_all.deb 0 MD5Sum:" aptget download apt -qq --print-uris testequal "'file://${APTARCHIVE}/apt_2.dsc' apt_2.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e 'file://${APTARCHIVE}/apt_2.tar.gz' apt_2.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source apt -qq --print-uris testequal "'http://packages.debian.org/changelogs/pool/main/apt/apt_2/changelog'" aptget changelog apt -qq --print-uris -- cgit v1.2.3 From df7d029c6d7ff15b81f7b439991bfaef19adcaf6 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 3 Oct 2013 22:49:58 +0200 Subject: test: use a multiarch capable dpkg rather than workaround The tests require nowadays a (somewhat) multiarch-capable dpkg, so replace the workaround as marked in the FIXME with a proper install as the workaround isn't working always correctly, letting the test fail. Git-Dch: Ignore --- test/integration/test-ubuntu-bug-859188-multiarch-reinstall | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'test/integration') diff --git a/test/integration/test-ubuntu-bug-859188-multiarch-reinstall b/test/integration/test-ubuntu-bug-859188-multiarch-reinstall index 0fdf97485..be86f2e91 100755 --- a/test/integration/test-ubuntu-bug-859188-multiarch-reinstall +++ b/test/integration/test-ubuntu-bug-859188-multiarch-reinstall @@ -8,14 +8,13 @@ configarchitecture 'amd64' 'i386' 'armel' buildsimplenativepackage 'libsame' 'amd64,i386,armel' '1.0' 'unstable' 'Multi-Arch: same' -# FIXME: hack around dpkg's current inability to handle multiarch, a clean install would be better… -insertinstalledpackage 'libsame' 'amd64,i386' '1.0' 'Multi-Arch: same' -sed -e 's#/installed#/unstable#' -e 's#Installed-Size: 42#Installed-Size: 1#' -i rootdir/var/lib/dpkg/status - setupaptarchive +testsuccess aptget install libsame libsame:i386 + REINSTALL='Reading package lists... Building dependency tree... +Reading state information... 0 upgraded, 0 newly installed, 2 reinstalled, 0 to remove and 0 not upgraded. Inst libsame [1.0] (1.0 unstable [amd64]) Inst libsame:i386 [1.0] (1.0 unstable [i386]) -- cgit v1.2.3 From be297c7ab3c16edcbdd6afc699c73a58e545b599 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 3 Oct 2013 22:58:55 +0200 Subject: tests: install --no-install-recommends and stunnel4 for travis stunnel4 is required for https tests Git-Dch: Ignore --- test/integration/test-bug-254770-segfault-if-cache-not-buildable | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/integration') diff --git a/test/integration/test-bug-254770-segfault-if-cache-not-buildable b/test/integration/test-bug-254770-segfault-if-cache-not-buildable index 8fa337ccc..59102ddc9 100755 --- a/test/integration/test-bug-254770-segfault-if-cache-not-buildable +++ b/test/integration/test-bug-254770-segfault-if-cache-not-buildable @@ -18,7 +18,7 @@ testsegfault() { msgpass else echo - echo $TEST + echo "$TEST" msgfail fi } -- cgit v1.2.3 From 08d3d7e93e4aba1998dd89a8e10da5046ad7dcb6 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 9 Oct 2013 07:58:31 +0200 Subject: add test for upgrade, upgrade --with-new-pkgs, dist-upgrade --- test/integration/test-apt-get-upgrade | 69 +++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100755 test/integration/test-apt-get-upgrade (limited to 'test/integration') diff --git a/test/integration/test-apt-get-upgrade b/test/integration/test-apt-get-upgrade new file mode 100755 index 000000000..39d0ac22f --- /dev/null +++ b/test/integration/test-apt-get-upgrade @@ -0,0 +1,69 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework + +setupenvironment +configarchitecture "i386" + +# FIXME: use simulated packages instead + +buildsimplenativepackage 'foo' 'all' '1.0' +buildsimplenativepackage 'bar' 'all' '1.0' + +buildsimplenativepackage 'apx' 'all' '1.0' 'stable' +buildsimplenativepackage 'apx' 'all' '2.0' 'unstable' 'Conflicts: foo' + +buildsimplenativepackage 'apc' 'all' '1.0' 'stable' +buildsimplenativepackage 'apc' 'all' '2.0' 'unstable' 'Depends: bar' + +insertinstalledpackage 'apx' 'all' '1.0' +insertinstalledpackage 'apc' 'all' '1.0' +insertinstalledpackage 'foo' 'all' '1.0' + +setupaptarchive + +msgtest "Test normal upgrade works" +testequal 'Reading package lists... +Building dependency tree... +The following packages have been kept back: + apc apx +The following packages will be upgraded: + foo +1 upgraded, 0 newly installed, 0 to remove and 2 not upgraded. +Inst foo [1.0] (1.0 unstable [all]) +Conf foo (1.0 unstable [all])' aptget -s upgrade && msgpass || msgfail + +msgtest "Test if upgrade --with-new-pkgs works" +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + bar +The following packages have been kept back: + apx foo +The following packages will be upgraded: + apc +1 upgraded, 1 newly installed, 0 to remove and 2 not upgraded. +Inst bar (1.0 unstable [all]) +Inst apc [1.0] (2.0 unstable [all]) +Conf bar (1.0 unstable [all]) +Conf apc (2.0 unstable [all])' aptget -s upgrade --with-new-pkgs && msgpass || msgfail + +msgtest "Test dist-upgrade works" +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + bar +The following packages have been kept back: + apx +The following packages will be upgraded: + apc foo +2 upgraded, 1 newly installed, 0 to remove and 1 not upgraded. +Inst bar (1.0 unstable [all]) +Inst apc [1.0] (2.0 unstable [all]) +Inst foo [1.0] (1.0 unstable [all]) +Conf bar (1.0 unstable [all]) +Conf apc (2.0 unstable [all]) +Conf foo (1.0 unstable [all])' aptget -s dist-upgrade && msgpass || msgfail + -- cgit v1.2.3 From a8c2236baff38fdae5b28e4469a7b2a68e88e3b6 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 9 Oct 2013 11:01:18 +0200 Subject: use "insertpackage" instead of "buildsimplenativepackage" --- test/integration/test-apt-get-upgrade | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'test/integration') diff --git a/test/integration/test-apt-get-upgrade b/test/integration/test-apt-get-upgrade index 39d0ac22f..46662f198 100755 --- a/test/integration/test-apt-get-upgrade +++ b/test/integration/test-apt-get-upgrade @@ -9,14 +9,16 @@ configarchitecture "i386" # FIXME: use simulated packages instead -buildsimplenativepackage 'foo' 'all' '1.0' -buildsimplenativepackage 'bar' 'all' '1.0' +insertpackage 'stable' 'foo' 'all' '1.0' +insertpackage 'unstable' 'foo' 'all' '2.0' -buildsimplenativepackage 'apx' 'all' '1.0' 'stable' -buildsimplenativepackage 'apx' 'all' '2.0' 'unstable' 'Conflicts: foo' +insertpackage 'unstable' 'bar' 'all' '1.0' -buildsimplenativepackage 'apc' 'all' '1.0' 'stable' -buildsimplenativepackage 'apc' 'all' '2.0' 'unstable' 'Depends: bar' +insertpackage 'stable' 'apx' 'all' '1.0' +insertpackage 'unstable' 'apx' 'all' '2.0' 'Conflicts: foo' + +insertpackage 'stable' 'apc' 'all' '1.0' +insertpackage 'unstable' 'apc' 'all' '2.0' 'Depends: bar' insertinstalledpackage 'apx' 'all' '1.0' insertinstalledpackage 'apc' 'all' '1.0' @@ -32,8 +34,8 @@ The following packages have been kept back: The following packages will be upgraded: foo 1 upgraded, 0 newly installed, 0 to remove and 2 not upgraded. -Inst foo [1.0] (1.0 unstable [all]) -Conf foo (1.0 unstable [all])' aptget -s upgrade && msgpass || msgfail +Inst foo [1.0] (2.0 unstable [all]) +Conf foo (2.0 unstable [all])' aptget -s upgrade && msgpass || msgfail msgtest "Test if upgrade --with-new-pkgs works" testequal 'Reading package lists... @@ -62,8 +64,8 @@ The following packages will be upgraded: 2 upgraded, 1 newly installed, 0 to remove and 1 not upgraded. Inst bar (1.0 unstable [all]) Inst apc [1.0] (2.0 unstable [all]) -Inst foo [1.0] (1.0 unstable [all]) +Inst foo [1.0] (2.0 unstable [all]) Conf bar (1.0 unstable [all]) Conf apc (2.0 unstable [all]) -Conf foo (1.0 unstable [all])' aptget -s dist-upgrade && msgpass || msgfail +Conf foo (2.0 unstable [all])' aptget -s dist-upgrade && msgpass || msgfail -- cgit v1.2.3 From 60b3bf0ca99f868182567c143cf17b8d0a6191cc Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 9 Oct 2013 12:37:52 +0200 Subject: really fix test --- test/integration/test-apt-get-upgrade | 79 +++++++++++++++++++---------------- 1 file changed, 43 insertions(+), 36 deletions(-) (limited to 'test/integration') diff --git a/test/integration/test-apt-get-upgrade b/test/integration/test-apt-get-upgrade index 46662f198..017c46cec 100755 --- a/test/integration/test-apt-get-upgrade +++ b/test/integration/test-apt-get-upgrade @@ -7,22 +7,24 @@ TESTDIR=$(readlink -f $(dirname $0)) setupenvironment configarchitecture "i386" -# FIXME: use simulated packages instead +# simple case +insertpackage 'stable' 'upgrade-simple' 'all' '1.0' +insertpackage 'unstable' 'upgrade-simple' 'all' '2.0' +insertinstalledpackage 'upgrade-simple' 'all' '1.0' -insertpackage 'stable' 'foo' 'all' '1.0' -insertpackage 'unstable' 'foo' 'all' '2.0' +# upgrade with a new dependency +insertpackage 'stable' 'upgrade-with-new-dep' 'all' '1.0' +insertpackage 'unstable' 'upgrade-with-new-dep' 'all' '2.0' 'Depends: new-dep' +insertpackage 'stable' 'new-dep' 'all' '1.0' +insertinstalledpackage 'upgrade-with-new-dep' 'all' '1.0' -insertpackage 'unstable' 'bar' 'all' '1.0' +# upgrade with conflict and a new pkg with higher priority than conflict +insertpackage 'stable' 'upgrade-with-conflict' 'all' '1.0' +insertpackage 'unstable' 'upgrade-with-conflict' 'all' '2.0' 'Conflicts: conflicting-dep' 'standard' +insertpackage 'stable' 'conflicting-dep' 'all' '1.0' +insertinstalledpackage 'upgrade-with-conflict' 'all' '1.0' +insertinstalledpackage 'conflicting-dep' 'all' '1.0' -insertpackage 'stable' 'apx' 'all' '1.0' -insertpackage 'unstable' 'apx' 'all' '2.0' 'Conflicts: foo' - -insertpackage 'stable' 'apc' 'all' '1.0' -insertpackage 'unstable' 'apc' 'all' '2.0' 'Depends: bar' - -insertinstalledpackage 'apx' 'all' '1.0' -insertinstalledpackage 'apc' 'all' '1.0' -insertinstalledpackage 'foo' 'all' '1.0' setupaptarchive @@ -30,42 +32,47 @@ msgtest "Test normal upgrade works" testequal 'Reading package lists... Building dependency tree... The following packages have been kept back: - apc apx + upgrade-with-conflict upgrade-with-new-dep The following packages will be upgraded: - foo + upgrade-simple 1 upgraded, 0 newly installed, 0 to remove and 2 not upgraded. -Inst foo [1.0] (2.0 unstable [all]) -Conf foo (2.0 unstable [all])' aptget -s upgrade && msgpass || msgfail +Inst upgrade-simple [1.0] (2.0 unstable [all]) +Conf upgrade-simple (2.0 unstable [all])' aptget -s upgrade && msgpass || msgfail msgtest "Test if upgrade --with-new-pkgs works" testequal 'Reading package lists... Building dependency tree... The following NEW packages will be installed: - bar + new-dep The following packages have been kept back: - apx foo + upgrade-with-conflict The following packages will be upgraded: - apc -1 upgraded, 1 newly installed, 0 to remove and 2 not upgraded. -Inst bar (1.0 unstable [all]) -Inst apc [1.0] (2.0 unstable [all]) -Conf bar (1.0 unstable [all]) -Conf apc (2.0 unstable [all])' aptget -s upgrade --with-new-pkgs && msgpass || msgfail + upgrade-simple upgrade-with-new-dep +2 upgraded, 1 newly installed, 0 to remove and 1 not upgraded. +Inst new-dep (1.0 stable [all]) +Inst upgrade-simple [1.0] (2.0 unstable [all]) +Inst upgrade-with-new-dep [1.0] (2.0 unstable [all]) +Conf new-dep (1.0 stable [all]) +Conf upgrade-simple (2.0 unstable [all]) +Conf upgrade-with-new-dep (2.0 unstable [all])' aptget -s upgrade --with-new-pkgs && msgpass || msgfail msgtest "Test dist-upgrade works" testequal 'Reading package lists... Building dependency tree... +The following packages will be REMOVED: + conflicting-dep The following NEW packages will be installed: - bar -The following packages have been kept back: - apx + new-dep The following packages will be upgraded: - apc foo -2 upgraded, 1 newly installed, 0 to remove and 1 not upgraded. -Inst bar (1.0 unstable [all]) -Inst apc [1.0] (2.0 unstable [all]) -Inst foo [1.0] (2.0 unstable [all]) -Conf bar (1.0 unstable [all]) -Conf apc (2.0 unstable [all]) -Conf foo (2.0 unstable [all])' aptget -s dist-upgrade && msgpass || msgfail + upgrade-simple upgrade-with-conflict upgrade-with-new-dep +3 upgraded, 1 newly installed, 1 to remove and 0 not upgraded. +Remv conflicting-dep [1.0] +Inst upgrade-with-conflict [1.0] (2.0 unstable [all]) +Inst new-dep (1.0 stable [all]) +Inst upgrade-simple [1.0] (2.0 unstable [all]) +Inst upgrade-with-new-dep [1.0] (2.0 unstable [all]) +Conf upgrade-with-conflict (2.0 unstable [all]) +Conf new-dep (1.0 stable [all]) +Conf upgrade-simple (2.0 unstable [all]) +Conf upgrade-with-new-dep (2.0 unstable [all])' aptget -s dist-upgrade && msgpass || msgfail -- cgit v1.2.3 From d029b71845cd10ecb46893627dfe6de669ba689d Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 9 Oct 2013 14:02:42 +0200 Subject: fixup various UI issues in the test --- test/integration/test-apt-get-upgrade | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'test/integration') diff --git a/test/integration/test-apt-get-upgrade b/test/integration/test-apt-get-upgrade index 017c46cec..23446299c 100755 --- a/test/integration/test-apt-get-upgrade +++ b/test/integration/test-apt-get-upgrade @@ -28,7 +28,7 @@ insertinstalledpackage 'conflicting-dep' 'all' '1.0' setupaptarchive -msgtest "Test normal upgrade works" +# Test if normal upgrade works as expected testequal 'Reading package lists... Building dependency tree... The following packages have been kept back: @@ -37,9 +37,9 @@ The following packages will be upgraded: upgrade-simple 1 upgraded, 0 newly installed, 0 to remove and 2 not upgraded. Inst upgrade-simple [1.0] (2.0 unstable [all]) -Conf upgrade-simple (2.0 unstable [all])' aptget -s upgrade && msgpass || msgfail +Conf upgrade-simple (2.0 unstable [all])' aptget -s upgrade -msgtest "Test if upgrade --with-new-pkgs works" +# Test if apt-get upgrade --with-new-pkgs works testequal 'Reading package lists... Building dependency tree... The following NEW packages will be installed: @@ -54,9 +54,9 @@ Inst upgrade-simple [1.0] (2.0 unstable [all]) Inst upgrade-with-new-dep [1.0] (2.0 unstable [all]) Conf new-dep (1.0 stable [all]) Conf upgrade-simple (2.0 unstable [all]) -Conf upgrade-with-new-dep (2.0 unstable [all])' aptget -s upgrade --with-new-pkgs && msgpass || msgfail +Conf upgrade-with-new-dep (2.0 unstable [all])' aptget -s upgrade --with-new-pkgs -msgtest "Test dist-upgrade works" +# Test if apt-get dist-upgrade works testequal 'Reading package lists... Building dependency tree... The following packages will be REMOVED: @@ -74,5 +74,5 @@ Inst upgrade-with-new-dep [1.0] (2.0 unstable [all]) Conf upgrade-with-conflict (2.0 unstable [all]) Conf new-dep (1.0 stable [all]) Conf upgrade-simple (2.0 unstable [all]) -Conf upgrade-with-new-dep (2.0 unstable [all])' aptget -s dist-upgrade && msgpass || msgfail +Conf upgrade-with-new-dep (2.0 unstable [all])' aptget -s dist-upgrade -- cgit v1.2.3 From 42c1513b712818823e0a136c949f0d93c46907d7 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 15 Oct 2013 18:07:44 +0200 Subject: tests, do not send pkgname with arch via the status-fd --- test/integration/framework | 10 ++- test/integration/test-apt-progress-fd | 71 ++++++++++++++++++++++ test/integration/test-apt-progress-fd-error | 22 +++++++ .../test-apt-progress-fd-error-postinst | 22 +++++++ 4 files changed, 124 insertions(+), 1 deletion(-) create mode 100755 test/integration/test-apt-progress-fd create mode 100755 test/integration/test-apt-progress-fd-error create mode 100755 test/integration/test-apt-progress-fd-error-postinst (limited to 'test/integration') diff --git a/test/integration/framework b/test/integration/framework index d899bb574..0f57d0259 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -335,6 +335,7 @@ buildsimplenativepackage() { local SECTION="${7:-others}" local PRIORITY="${8:-optional}" + local FILE_TREE="$9" local DISTSECTION if [ "$SECTION" = "$(echo "$SECTION" | cut -d'/' -f 2)" ]; then DISTSECTION="main" @@ -391,9 +392,16 @@ Package: $NAME" >> ${BUILDDIR}/debian/control mkdir -p ${BUILDDIR}/debian/tmp/DEBIAN ${BUILDDIR}/debian/tmp/usr/share/doc/${NAME} ${BUILDDIR}/debian/tmp/usr/bin cp ${BUILDDIR}/debian/copyright ${BUILDDIR}/debian/changelog ${BUILDDIR}/FEATURES ${BUILDDIR}/debian/tmp/usr/share/doc/${NAME} cp ${BUILDDIR}/${NAME} ${BUILDDIR}/debian/tmp/usr/bin/${NAME}-${arch} + if [ -n "$FILE_TREE" ]; then + cp -ar "$FILE_TREE" ${BUILDDIR}/debian/tmp + fi + if [ -n "$POSTINST" ]; then + echo "$POSTINST" > ${BUILDDIR}/debian/tmp/DEBIAN/postinst + chmod +x ${BUILDDIR}/debian/tmp/DEBIAN/postinst + fi + (cd ${BUILDDIR}; dpkg-gencontrol -DArchitecture=$arch) (cd ${BUILDDIR}/debian/tmp; md5sum $(find usr/ -type f) > DEBIAN/md5sums) - dpkg-deb --build ${BUILDDIR}/debian/tmp ${BUILDDIR}/.. 2> /dev/null > /dev/null echo "pool/${NAME}_${VERSION}_${arch}.deb" >> ${BUILDDIR}/../${RELEASE}.${DISTSECTION}.pkglist done diff --git a/test/integration/test-apt-progress-fd b/test/integration/test-apt-progress-fd new file mode 100755 index 000000000..5f73c8f8c --- /dev/null +++ b/test/integration/test-apt-progress-fd @@ -0,0 +1,71 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework + +setupenvironment +configarchitecture 'amd64' 'i386' + +buildsimplenativepackage 'testing' 'amd64' '0.1' 'stable' +buildsimplenativepackage 'testing' 'amd64' '0.8.15' 'stable' +buildsimplenativepackage 'testing2' 'amd64,i386' '0.8.15' 'stable' +setupaptarchive + +# install native +exec 3> apt-progress.log +testsuccess aptget install testing=0.1 -y -o APT::Status-Fd=3 +testequal "dlstatus:1:0:Retrieving file 1 of 1 +dlstatus:1:0:Retrieving file 1 of 1 +pmstatus:dpkg-exec:0:Running dpkg +pmstatus:testing:0:Installing testing +pmstatus:testing:20:Preparing testing +pmstatus:testing:40:Unpacking testing +pmstatus:testing:60:Preparing to configure testing +pmstatus:dpkg-exec:60:Running dpkg +pmstatus:testing:60:Configuring testing +pmstatus:testing:80:Configuring testing +pmstatus:testing:100:Installed testing" cat apt-progress.log + +# upgrade +exec 3> apt-progress.log +testsuccess aptget install testing=0.8.15 -y -o APT::Status-Fd=3 +testequal "dlstatus:1:0:Retrieving file 1 of 1 +dlstatus:1:0:Retrieving file 1 of 1 +pmstatus:dpkg-exec:0:Running dpkg +pmstatus:testing:20:Preparing testing +pmstatus:testing:40:Unpacking testing +pmstatus:testing:60:Preparing to configure testing +pmstatus:dpkg-exec:60:Running dpkg +pmstatus:testing:60:Configuring testing +pmstatus:testing:80:Configuring testing +pmstatus:testing:100:Installed testing" cat apt-progress.log + +# and remove +exec 3> apt-progress.log +testsuccess aptget remove testing -y -o APT::Status-Fd=3 +testequal "pmstatus:dpkg-exec:0:Running dpkg +pmstatus:testing:0:Removing testing +pmstatus:testing:33.3333:Preparing for removal of testing +pmstatus:testing:66.6667:Removing testing +pmstatus:testing:100:Removed testing" cat apt-progress.log + + +# install non-native and ensure we get proper progress info +exec 3> apt-progress.log +testsuccess aptget install testing2:i386 -y -o APT::Status-Fd=3 + +# and compare +testequal "dlstatus:1:0:Retrieving file 1 of 1 +dlstatus:1:0:Retrieving file 1 of 1 +pmstatus:dpkg-exec:0:Running dpkg +pmstatus:testing2:0:Installing testing2 +pmstatus:testing2:20:Preparing testing2 +pmstatus:testing2:40:Unpacking testing2 +pmstatus:testing2:60:Preparing to configure testing2 +pmstatus:dpkg-exec:60:Running dpkg +pmstatus:testing2:60:Configuring testing2 +pmstatus:testing2:80:Configuring testing2 +pmstatus:testing2:100:Installed testing2" cat apt-progress.log + +rm -f apt-progress*.log \ No newline at end of file diff --git a/test/integration/test-apt-progress-fd-error b/test/integration/test-apt-progress-fd-error new file mode 100755 index 000000000..0cd59410e --- /dev/null +++ b/test/integration/test-apt-progress-fd-error @@ -0,0 +1,22 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework + +setupenvironment +configarchitecture 'amd64' 'i386' + +mkdir -p usr/bin +touch usr/bin/file-conflict + +buildsimplenativepackage 'foo1' 'amd64,i386' '0.8.15' 'stable' '' 'pkg with file conflicts' '' '' 'usr/' +buildsimplenativepackage 'foo2' 'amd64,i386' '0.8.15' 'stable' '' 'pkg with file conflicts' '' '' 'usr/' + +setupaptarchive + +exec 3> apt-progress.log +testfailure aptget install foo1 foo2 -y -o APT::Status-Fd=3 +msgtest "Ensure correct error message" +grep -q "aptarchive/pool/foo2_0.8.15_amd64.deb :40:trying to overwrite '/usr/bin/file-conflict', which is also in package foo1 0.8.15" apt-progress.log && msgpass || msgfail + diff --git a/test/integration/test-apt-progress-fd-error-postinst b/test/integration/test-apt-progress-fd-error-postinst new file mode 100755 index 000000000..0b6e70212 --- /dev/null +++ b/test/integration/test-apt-progress-fd-error-postinst @@ -0,0 +1,22 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework + +setupenvironment +configarchitecture 'amd64' 'i386' + +mkdir -p DEBIAN/ +echo "#!/bin/sh\nexit 1" > DEBIAN/postinst +chmod 755 DEBIAN/postinst + +buildsimplenativepackage 'postinst-error' 'amd64,i386' '0.8.15' 'stable' '' 'pkg with posinst error' '' '' './DEBIAN' + +setupaptarchive + +exec 3> apt-progress.log +testfailure aptget install postinst-error -y -o APT::Status-Fd=3 +msgtest "Ensure correct error message for postinst error" +grep -q "pmerror:postinst-error :80:subprocess installed post-installation script returned error exit status 2" apt-progress.log && msgpass || msgfail + -- cgit v1.2.3 From 7ff4de5b121928a8e800bc31cbc6aa74d11dd47c Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 15 Oct 2013 18:09:09 +0200 Subject: remove POSTINST from framework, file tree can be used for this --- test/integration/framework | 4 ---- 1 file changed, 4 deletions(-) (limited to 'test/integration') diff --git a/test/integration/framework b/test/integration/framework index 0f57d0259..28ccb4d9f 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -395,10 +395,6 @@ Package: $NAME" >> ${BUILDDIR}/debian/control if [ -n "$FILE_TREE" ]; then cp -ar "$FILE_TREE" ${BUILDDIR}/debian/tmp fi - if [ -n "$POSTINST" ]; then - echo "$POSTINST" > ${BUILDDIR}/debian/tmp/DEBIAN/postinst - chmod +x ${BUILDDIR}/debian/tmp/DEBIAN/postinst - fi (cd ${BUILDDIR}; dpkg-gencontrol -DArchitecture=$arch) (cd ${BUILDDIR}/debian/tmp; md5sum $(find usr/ -type f) > DEBIAN/md5sums) -- cgit v1.2.3 From 6161edd7a310209faae5288a2a174bf3251ef656 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 18 Oct 2013 08:32:14 +0200 Subject: add $* to gdb to make it more useful --- test/integration/framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/integration') diff --git a/test/integration/framework b/test/integration/framework index 28ccb4d9f..20f3487cc 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -116,7 +116,7 @@ aptitude() { } gdb() { echo "gdb: run »$*«" - APT_CONFIG=aptconfig.conf LD_LIBRARY_PATH=${BUILDDIRECTORY} $(which gdb) ${BUILDDIRECTORY}/$1 + APT_CONFIG=aptconfig.conf LD_LIBRARY_PATH=${BUILDDIRECTORY} $(which gdb) ${BUILDDIRECTORY}/$1 --args $* } http() { LD_LIBRARY_PATH=${BUILDDIRECTORY} ${BUILDDIRECTORY}/methods/http -- cgit v1.2.3 From 11ef54810d6241b6d2433d27099b43763dabaee3 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 18 Oct 2013 08:32:36 +0200 Subject: reshuffle dpkgpm.cc code a bit more --- test/integration/test-apt-progress-fd-error | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/integration') diff --git a/test/integration/test-apt-progress-fd-error b/test/integration/test-apt-progress-fd-error index 0cd59410e..96d66371a 100755 --- a/test/integration/test-apt-progress-fd-error +++ b/test/integration/test-apt-progress-fd-error @@ -18,5 +18,5 @@ setupaptarchive exec 3> apt-progress.log testfailure aptget install foo1 foo2 -y -o APT::Status-Fd=3 msgtest "Ensure correct error message" -grep -q "aptarchive/pool/foo2_0.8.15_amd64.deb :40:trying to overwrite '/usr/bin/file-conflict', which is also in package foo1 0.8.15" apt-progress.log && msgpass || msgfail +grep -q "aptarchive/pool/foo2_0.8.15_amd64.deb :40:trying to overwrite '/usr/bin/file-conflict', which is also in package foo1 0.8.15" apt-progress.log && msgpass || (cat apt-progress.log && msgfail) -- cgit v1.2.3