From 82c6f7528d583431722ef180b6064b86b644ad85 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 12 Jun 2012 15:40:56 +0200 Subject: add a testcase for #675449, which i forgot to commit --- .../test-673536-pre-depends-breaks-loop | 23 ------ .../test-bug-673536-pre-depends-breaks-loop | 23 ++++++ .../test-bug-675449-essential-are-protected | 88 ++++++++++++++++++++++ 3 files changed, 111 insertions(+), 23 deletions(-) delete mode 100755 test/integration/test-673536-pre-depends-breaks-loop create mode 100755 test/integration/test-bug-673536-pre-depends-breaks-loop create mode 100755 test/integration/test-bug-675449-essential-are-protected (limited to 'test') diff --git a/test/integration/test-673536-pre-depends-breaks-loop b/test/integration/test-673536-pre-depends-breaks-loop deleted file mode 100755 index e9d3c4de6..000000000 --- a/test/integration/test-673536-pre-depends-breaks-loop +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -set -e - -TESTDIR=$(readlink -f $(dirname $0)) -. $TESTDIR/framework -setupenvironment -configarchitecture 'native' - -buildsimplenativepackage 'basic' 'native' '1' 'stable' -buildsimplenativepackage 'basic' 'native' '2' 'unstable' 'Pre-Depends: common' -buildsimplenativepackage 'common' 'native' '2' 'unstable' 'Breaks: basic (<= 1)' - -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 -testdpkginstalled basic -testdpkgnotinstalled common - -aptget dist-upgrade -qq > /dev/null -testdpkginstalled basic common diff --git a/test/integration/test-bug-673536-pre-depends-breaks-loop b/test/integration/test-bug-673536-pre-depends-breaks-loop new file mode 100755 index 000000000..e9d3c4de6 --- /dev/null +++ b/test/integration/test-bug-673536-pre-depends-breaks-loop @@ -0,0 +1,23 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'native' + +buildsimplenativepackage 'basic' 'native' '1' 'stable' +buildsimplenativepackage 'basic' 'native' '2' 'unstable' 'Pre-Depends: common' +buildsimplenativepackage 'common' 'native' '2' 'unstable' 'Breaks: basic (<= 1)' + +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 +testdpkginstalled basic +testdpkgnotinstalled common + +aptget dist-upgrade -qq > /dev/null +testdpkginstalled basic common diff --git a/test/integration/test-bug-675449-essential-are-protected b/test/integration/test-bug-675449-essential-are-protected new file mode 100755 index 000000000..7d8cc3484 --- /dev/null +++ b/test/integration/test-bug-675449-essential-are-protected @@ -0,0 +1,88 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' 'i386' + +insertinstalledpackage 'pkg-native' 'amd64' '1' 'Multi-Arch: foreign +Essential: yes' +insertinstalledpackage 'pkg-foreign' 'i386' '1' 'Multi-Arch: foreign +Essential: yes' +insertinstalledpackage 'pkg-none-native' 'amd64' '1' 'Essential: yes' +insertinstalledpackage 'pkg-none-foreign' 'i386' '1' 'Essential: yes' + +insertpackage 'unstable' 'pkg-native' 'amd64,i386' '2' 'Multi-Arch: foreign +Essential: yes' +insertpackage 'unstable' 'pkg-foreign' 'amd64,i386' '2' 'Multi-Arch: foreign +Depends: pkg-depends-new +Essential: yes' +insertpackage 'unstable' 'pkg-none-native' 'amd64,i386' '2' 'Essential: yes' +insertpackage 'unstable' 'pkg-none-foreign' 'amd64,i386' '2' 'Essential: yes +Depends: pkg-depends-new' + +insertpackage 'unstable' 'pkg-none-new' 'amd64,i386' '2' 'Essential: yes' +insertpackage 'unstable' 'pkg-depends-new' 'amd64,i386' '2' 'Essential: yes' + +setupaptarchive + +testequal 'Reading package lists... +Building dependency tree... +The following packages will be REMOVED: + pkg-native* +WARNING: The following essential packages will be removed. +This should NOT be done unless you know exactly what you are doing! + pkg-native +0 upgraded, 0 newly installed, 1 to remove and 3 not upgraded. +Purg pkg-native [1]' aptget purge pkg-native -s + +testequal 'Reading package lists... +Building dependency tree... +The following packages will be REMOVED: + pkg-foreign:i386* +WARNING: The following essential packages will be removed. +This should NOT be done unless you know exactly what you are doing! + pkg-foreign:i386 +0 upgraded, 0 newly installed, 1 to remove and 3 not upgraded. +Purg pkg-foreign:i386 [1]' aptget purge pkg-foreign:i386 -s + +testequal 'Reading package lists... +Building dependency tree... +The following packages will be REMOVED: + pkg-none-native* +WARNING: The following essential packages will be removed. +This should NOT be done unless you know exactly what you are doing! + pkg-none-native +0 upgraded, 0 newly installed, 1 to remove and 3 not upgraded. +Purg pkg-none-native [1]' aptget purge pkg-none-native -s + +testequal 'Reading package lists... +Building dependency tree... +The following packages will be REMOVED: + pkg-none-foreign:i386* +WARNING: The following essential packages will be removed. +This should NOT be done unless you know exactly what you are doing! + pkg-none-foreign:i386 +0 upgraded, 0 newly installed, 1 to remove and 3 not upgraded. +Purg pkg-none-foreign:i386 [1]' aptget purge pkg-none-foreign:i386 -s + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + pkg-depends-new:i386 pkg-none-new +The following packages will be upgraded: + pkg-foreign:i386 pkg-native pkg-none-foreign:i386 pkg-none-native +4 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst pkg-depends-new:i386 (2 unstable [i386]) +Conf pkg-depends-new:i386 (2 unstable [i386]) +Inst pkg-foreign:i386 [1] (2 unstable [i386]) +Conf pkg-foreign:i386 (2 unstable [i386]) +Inst pkg-native [1] (2 unstable [amd64]) +Conf pkg-native (2 unstable [amd64]) +Inst pkg-none-foreign:i386 [1] (2 unstable [i386]) +Conf pkg-none-foreign:i386 (2 unstable [i386]) +Inst pkg-none-native [1] (2 unstable [amd64]) +Conf pkg-none-native (2 unstable [amd64]) +Inst pkg-none-new (2 unstable [amd64]) +Conf pkg-none-new (2 unstable [amd64])' aptget dist-upgrade -s -- cgit v1.2.3 From 01f520ce27c7f466dc6191c45507ace79d685725 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 14 Jun 2012 19:07:15 +0200 Subject: add two tests for architecture specifications --- test/integration/framework | 13 ++- .../test-architecture-specification-parsing | 96 ++++++++++++++++++++++ .../test-cachecontainer-architecture-specification | 87 ++++++++++++++++++++ test/libapt/parsedepends_test.cc | 10 +-- 4 files changed, 197 insertions(+), 9 deletions(-) create mode 100755 test/integration/test-architecture-specification-parsing create mode 100755 test/integration/test-cachecontainer-architecture-specification (limited to 'test') diff --git a/test/integration/framework b/test/integration/framework index dba8c0162..2d6ada117 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -304,23 +304,28 @@ echo '$NAME says \"Hello!\"'" > ${BUILDDIR}/${NAME} Section: $SECTION Priority: $PRIORITY Maintainer: Joe Sixpack -Standards-Version: 3.9.1 +Standards-Version: 3.9.3" > ${BUILDDIR}/debian/control + local BUILDDEPS="$(echo "$DEPENDENCIES" | grep '^Build-')" + test -z "$BUILDDEPS" || echo "$BUILDDEPS" >> ${BUILDDIR}/debian/control + echo " +Package: $NAME" >> ${BUILDDIR}/debian/control -Package: $NAME" > ${BUILDDIR}/debian/control if [ "$ARCH" = 'all' ]; then echo "Architecture: all" >> ${BUILDDIR}/debian/control else echo "Architecture: any" >> ${BUILDDIR}/debian/control fi - test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> ${BUILDDIR}/debian/control + 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" >> ${BUILDIR}/debian/control + echo "Description: $DESCRIPTION" >> ${BUILDDIR}/debian/control fi + echo '3.0 (native)' > ${BUILDDIR}/debian/source/format local SRCS="$( (cd ${BUILDDIR}/..; dpkg-source -b ${NAME}-${VERSION} 2>&1) | grep '^dpkg-source: info: building' | grep -o '[a-z0-9._+~-]*$')" for SRC in $SRCS; do diff --git a/test/integration/test-architecture-specification-parsing b/test/integration/test-architecture-specification-parsing new file mode 100755 index 000000000..8f365dd55 --- /dev/null +++ b/test/integration/test-architecture-specification-parsing @@ -0,0 +1,96 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' + +buildsimplenativepackage 'pkg-arch-foo' 'amd64' '1.0' 'stable' 'Build-Depends: foo [amd64 !amd64] +Depends: foo [amd64 !amd64]' +buildsimplenativepackage 'pkg-arch-no-foo' 'amd64' '1.0' 'stable' 'Build-Depends: foo [!amd64 amd64] +Depends: foo [!amd64 amd64]' +buildsimplenativepackage 'pkg-arch-foo-unrelated-no' 'amd64' '1.0' 'stable' 'Build-Depends: foo [!kfreebsd-any amd64] +Depends: foo [!kfreebsd-any amd64]' +buildsimplenativepackage 'pkg-arch-foo-unrelated-no2' 'amd64' '1.0' 'stable' 'Build-Depends: foo [amd64 !kfreebsd-any] +Depends: foo [amd64 !kfreebsd-any]' + +buildsimplenativepackage 'foo' 'amd64' '1.0' 'stable' + +insertinstalledpackage 'build-essential' 'all' '11.5' 'Multi-Arch: foreign' + +setupaptarchive + +testequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + foo +The following NEW packages will be installed: + foo pkg-arch-foo +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst foo (1.0 stable [amd64]) +Inst pkg-arch-foo (1.0 stable [amd64]) +Conf foo (1.0 stable [amd64]) +Conf pkg-arch-foo (1.0 stable [amd64])' aptget install pkg-arch-foo -s + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + pkg-arch-no-foo +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst pkg-arch-no-foo (1.0 stable [amd64]) +Conf pkg-arch-no-foo (1.0 stable [amd64])' aptget install pkg-arch-no-foo -s + +testequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + foo +The following NEW packages will be installed: + foo pkg-arch-foo-unrelated-no +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst foo (1.0 stable [amd64]) +Inst pkg-arch-foo-unrelated-no (1.0 stable [amd64]) +Conf foo (1.0 stable [amd64]) +Conf pkg-arch-foo-unrelated-no (1.0 stable [amd64])' aptget install pkg-arch-foo-unrelated-no -s + +testequal 'Reading package lists... +Building dependency tree... +The following extra packages will be installed: + foo +The following NEW packages will be installed: + foo pkg-arch-foo-unrelated-no2 +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst foo (1.0 stable [amd64]) +Inst pkg-arch-foo-unrelated-no2 (1.0 stable [amd64]) +Conf foo (1.0 stable [amd64]) +Conf pkg-arch-foo-unrelated-no2 (1.0 stable [amd64])' aptget install pkg-arch-foo-unrelated-no2 -s + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + foo +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst foo (1.0 stable [amd64]) +Conf foo (1.0 stable [amd64])' aptget build-dep pkg-arch-foo -s + +testequal 'Reading package lists... +Building dependency tree... +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget build-dep pkg-arch-no-foo -s + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + foo +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst foo (1.0 stable [amd64]) +Conf foo (1.0 stable [amd64])' aptget build-dep pkg-arch-foo-unrelated-no -s + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + foo +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst foo (1.0 stable [amd64]) +Conf foo (1.0 stable [amd64])' aptget build-dep pkg-arch-foo-unrelated-no2 -s + + diff --git a/test/integration/test-cachecontainer-architecture-specification b/test/integration/test-cachecontainer-architecture-specification new file mode 100755 index 000000000..174efb087 --- /dev/null +++ b/test/integration/test-cachecontainer-architecture-specification @@ -0,0 +1,87 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' 'armel' + +#insertinstalledpackage 'xserver-xorg-core' 'amd64' '2:1.7.6-2ubuntu7.10' +insertpackage 'unstable' 'libsame' 'armel,amd64' '1' 'Multi-Arch: same' + +setupaptarchive + +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + libsame +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst libsame (1 unstable [amd64]) +Conf libsame (1 unstable [amd64])' aptget -s install libsame +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + libsame:armel +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst libsame:armel (1 unstable [armel]) +Conf libsame:armel (1 unstable [armel])' aptget -s install libsame:armel +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + libsame +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst libsame (1 unstable [amd64]) +Conf libsame (1 unstable [amd64])' aptget -s install libsame:amd64 +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + libsame libsame:armel +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst libsame (1 unstable [amd64]) +Inst libsame:armel (1 unstable [armel]) +Conf libsame (1 unstable [amd64]) +Conf libsame:armel (1 unstable [armel])' aptget -s install libsame:armel libsame:amd64 +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + libsame libsame:armel +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst libsame (1 unstable [amd64]) +Inst libsame:armel (1 unstable [armel]) +Conf libsame (1 unstable [amd64]) +Conf libsame:armel (1 unstable [armel])' aptget -s install libsame:* +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + libsame +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst libsame (1 unstable [amd64]) +Conf libsame (1 unstable [amd64])' aptget -s install libsame:any +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + libsame libsame:armel +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst libsame (1 unstable [amd64]) +Inst libsame:armel (1 unstable [armel]) +Conf libsame (1 unstable [amd64]) +Conf libsame:armel (1 unstable [armel])' aptget -s install libsame:a* +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + libsame +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst libsame (1 unstable [amd64]) +Conf libsame (1 unstable [amd64])' aptget -s install libsame:linux-any +testequal 'Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + libsame libsame:armel +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst libsame (1 unstable [amd64]) +Inst libsame:armel (1 unstable [armel]) +Conf libsame (1 unstable [amd64]) +Conf libsame:armel (1 unstable [armel])' aptget -s install libsame:linux-* +testequal 'Reading package lists... +Building dependency tree... +E: Unable to locate package libsame' aptget -s install libsame:windows-any diff --git a/test/libapt/parsedepends_test.cc b/test/libapt/parsedepends_test.cc index b5d92d9d2..677b1c892 100644 --- a/test/libapt/parsedepends_test.cc +++ b/test/libapt/parsedepends_test.cc @@ -10,7 +10,7 @@ int main(int argc,char *argv[]) { unsigned int Null = 0; bool StripMultiArch = true; bool ParseArchFlags = false; - _config->Set("APT::Architecture","dsk"); + _config->Set("APT::Architecture","amd64"); const char* Depends = "debhelper:any (>= 5.0), " @@ -19,13 +19,13 @@ int main(int argc,char *argv[]) { "libcurl4-gnutls-dev:native | libcurl3-gnutls-dev (>> 7.15.5), " "debiandoc-sgml, " "apt (>= 0.7.25), " - "not-for-me [ !dsk ], " - "only-for-me [ dsk ], " + "not-for-me [ !amd64 ], " + "only-for-me [ amd64 ], " "any-for-me [ any ], " "not-for-darwin [ !darwin-any ], " - "cpu-for-me [ any-dsk ], " + "cpu-for-me [ any-amd64 ], " "os-for-me [ linux-any ], " - "cpu-not-for-me [ any-amd64 ], " + "cpu-not-for-me [ any-armel ], " "os-not-for-me [ kfreebsd-any ], " "overlord-dev:any (= 7.15.3~) | overlord-dev:native (>> 7.15.5), " ; -- cgit v1.2.3 From 567785b979d9b71ceb92edda82e4f15bb40a2e61 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 18 Jun 2012 13:19:47 +0200 Subject: * cmdline/apt-get.cc: - print a friendly message in 'download' if a package can't be downloaded (Closes: #677887) --- test/integration/test-apt-get-download | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test') diff --git a/test/integration/test-apt-get-download b/test/integration/test-apt-get-download index 4edb7c173..b164f7dba 100755 --- a/test/integration/test-apt-get-download +++ b/test/integration/test-apt-get-download @@ -9,6 +9,7 @@ configarchitecture "i386" buildsimplenativepackage 'apt' 'all' '1.0' 'stable' buildsimplenativepackage 'apt' 'all' '2.0' 'unstable' +insertinstalledpackage 'vrms' 'all' '1.0' setupaptarchive @@ -26,3 +27,6 @@ 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) sha256:$(sha256sum $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 -- cgit v1.2.3 From 1098ae37273547d0b4c7d05c8c6b36db56c25443 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 29 Jun 2012 13:52:52 +0200 Subject: * debian/control: - demote debiandoc-sgml to Build-Depends-Indep * doc/makefile: - separate translation building of debiandoc from manpages so that we don't need to build debiandoc for binary packages --- test/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/Makefile b/test/Makefile index 8207ebdab..74bffccb7 100644 --- a/test/Makefile +++ b/test/Makefile @@ -7,7 +7,7 @@ ifndef NOISY endif .PHONY: startup headers library clean veryclean all binary program doc test update-po -startup all clean veryclean binary program dirs test update-po manpages: +startup all clean veryclean binary program dirs test update-po manpages debiandoc: $(MAKE) -C libapt $@ $(MAKE) -C interactive-helper $@ -- cgit v1.2.3