diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2012-05-21 11:29:05 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2012-05-21 11:29:05 +0200 |
commit | 6c1f5d2c3c8df164e78dda8f24d28667634403e1 (patch) | |
tree | d711a52cf5a92a13b87f248307f5521846a7dbcf /test | |
parent | aa2218b25cb29e8c0677f0f3ede098583c7ae49f (diff) | |
parent | 0baf849d81814fce59d86eecccbe624c8aaf0456 (diff) |
merged from David, uncommited the previous i18n commit first as its part of the merge from David already but for some reason bzr is confused and gives a gazillion of conflicts in doc/po/de.po without the uncommit first
Diffstat (limited to 'test')
-rw-r--r-- | test/Makefile | 2 | ||||
-rwxr-xr-x | test/integration/skip-bug-602412-dequote-redirect | 12 | ||||
-rwxr-xr-x | test/integration/test-673536-pre-depends-breaks-loop | 23 | ||||
-rwxr-xr-x | test/integration/test-bug-632221-cross-dependency-satisfaction | 66 | ||||
-rw-r--r-- | test/libapt/assert.h | 21 | ||||
-rw-r--r-- | test/libapt/getlanguages_test.cc | 15 | ||||
-rwxr-xr-x | test/libapt/run-tests | 3 |
7 files changed, 107 insertions, 35 deletions
diff --git a/test/Makefile b/test/Makefile index b42a90b25..8207ebdab 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: +startup all clean veryclean binary program dirs test update-po manpages: $(MAKE) -C libapt $@ $(MAKE) -C interactive-helper $@ diff --git a/test/integration/skip-bug-602412-dequote-redirect b/test/integration/skip-bug-602412-dequote-redirect index a63d36246..689b671ce 100755 --- a/test/integration/skip-bug-602412-dequote-redirect +++ b/test/integration/skip-bug-602412-dequote-redirect @@ -19,18 +19,20 @@ echo "server.modules = ( \"mod_redirect\" ) server.document-root = \"$(readlink -f ./aptarchive)\" server.port = 8080 server.stat-cache-engine = \"disable\" -url.redirect = ( \"^/pool/(.*)$\" => \"/newpool/\$1\" )" > lighttpd.conf +url.redirect = ( \"^/pool/(.*)$\" => \"/newpool/\$1\", + \"^/dists/(.*)$\" => \"/newdists/\$1\" )" > lighttpd.conf mv aptarchive/pool aptarchive/newpool +mv aptarchive/dists aptarchive/newdists + lighttpd -t -f lighttpd.conf >/dev/null || msgdie 'Can not change to webserver: our lighttpd config is invalid' lighttpd -D -f lighttpd.conf 2>/dev/null >/dev/null & addtrap "kill $!;" -local APTARCHIVE="file://$(readlink -f ./aptarchive)" +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 -aptget update -qq || msgdie 'apt-get update failed' -aptget install unrelated --download-only -qq || msgdie 'downloading package failed' - +aptget update || msgdie 'apt-get update failed' +aptget install unrelated --download-only || msgdie 'downloading package failed' diff --git a/test/integration/test-673536-pre-depends-breaks-loop b/test/integration/test-673536-pre-depends-breaks-loop new file mode 100755 index 000000000..e9d3c4de6 --- /dev/null +++ b/test/integration/test-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-632221-cross-dependency-satisfaction b/test/integration/test-bug-632221-cross-dependency-satisfaction index 30df48604..a128366c5 100755 --- a/test/integration/test-bug-632221-cross-dependency-satisfaction +++ b/test/integration/test-bug-632221-cross-dependency-satisfaction @@ -18,8 +18,10 @@ insertpackage 'unstable' 'libfwibble-dev' 'amd64,armel' '1.0' 'Depends: libfwibb insertpackage 'unstable' 'cool' 'amd64,armel' '1.0' 'Multi-Arch: allowed' insertpackage 'unstable' 'amdboot' 'amd64' '1.0' insertpackage 'unstable' 'foreigner' 'amd64,armel' '1.0' 'Multi-Arch: foreign' +insertpackage 'unstable' 'arm-stuff' 'armel' '1.0' +insertpackage 'unstable' 'linux-stuff' 'amd64,armel' '1.0' -insertsource 'unstable' 'apt' 'any' '0.8.15' 'Build-Depends: doxygen, libc6-dev, libc6-dev:native, cool:any, amdboot:amd64, foreigner, libfwibble-dev' +insertsource 'unstable' 'apt' 'any' '0.8.15' 'Build-Depends: doxygen, libc6-dev, libc6-dev:native, cool:any, amdboot:amd64, foreigner, libfwibble-dev, arm-stuff [any-arm] | linux-stuff [ linux-any]' setupaptarchive @@ -27,7 +29,8 @@ testequal 'Reading package lists... Building dependency tree... The following NEW packages will be installed: amdboot cool doxygen foreigner libc6 libc6-dev libfwibble-dev libfwibble1 -0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded. + linux-stuff +0 upgraded, 9 newly installed, 0 to remove and 0 not upgraded. Inst amdboot (1.0 unstable [amd64]) Inst cool (1.0 unstable [amd64]) Inst doxygen (1.0 unstable [amd64]) @@ -36,6 +39,7 @@ Inst libc6 (1.0 unstable [amd64]) Inst libc6-dev (1.0 unstable [amd64]) Inst libfwibble1 (1.0 unstable [amd64]) Inst libfwibble-dev (1.0 unstable [amd64]) +Inst linux-stuff (1.0 unstable [amd64]) Conf amdboot (1.0 unstable [amd64]) Conf cool (1.0 unstable [amd64]) Conf doxygen (1.0 unstable [amd64]) @@ -43,15 +47,17 @@ Conf foreigner (1.0 unstable [amd64]) Conf libc6 (1.0 unstable [amd64]) Conf libc6-dev (1.0 unstable [amd64]) Conf libfwibble1 (1.0 unstable [amd64]) -Conf libfwibble-dev (1.0 unstable [amd64])' aptget build-dep apt -s +Conf libfwibble-dev (1.0 unstable [amd64]) +Conf linux-stuff (1.0 unstable [amd64])' aptget build-dep apt -s testequal 'Reading package lists... Building dependency tree... The following NEW packages will be installed: - amdboot cool doxygen foreigner libc6 libc6:armel libc6-dev libc6-dev:armel - libfwibble-dev:armel libfwibble1:armel -0 upgraded, 10 newly installed, 0 to remove and 0 not upgraded. + amdboot arm-stuff:armel cool doxygen foreigner libc6 libc6:armel libc6-dev + libc6-dev:armel libfwibble-dev:armel libfwibble1:armel +0 upgraded, 11 newly installed, 0 to remove and 0 not upgraded. Inst amdboot (1.0 unstable [amd64]) +Inst arm-stuff:armel (1.0 unstable [armel]) Inst cool (1.0 unstable [amd64]) Inst doxygen (1.0 unstable [amd64]) Inst foreigner (1.0 unstable [amd64]) @@ -62,6 +68,7 @@ Inst libc6-dev:armel (1.0 unstable [armel]) Inst libfwibble1:armel (1.0 unstable [armel]) Inst libfwibble-dev:armel (1.0 unstable [armel]) Conf amdboot (1.0 unstable [amd64]) +Conf arm-stuff:armel (1.0 unstable [armel]) Conf cool (1.0 unstable [amd64]) Conf doxygen (1.0 unstable [amd64]) Conf foreigner (1.0 unstable [amd64]) @@ -77,10 +84,11 @@ configarchitecture 'armel' 'amd64' testequal 'Reading package lists... Building dependency tree... The following NEW packages will be installed: - amdboot:amd64 cool doxygen foreigner libc6 libc6-dev libfwibble-dev - libfwibble1 -0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded. + amdboot:amd64 arm-stuff cool doxygen foreigner libc6 libc6-dev + libfwibble-dev libfwibble1 +0 upgraded, 9 newly installed, 0 to remove and 0 not upgraded. Inst amdboot:amd64 (1.0 unstable [amd64]) +Inst arm-stuff (1.0 unstable [armel]) Inst cool (1.0 unstable [armel]) Inst doxygen (1.0 unstable [armel]) Inst foreigner (1.0 unstable [armel]) @@ -89,6 +97,7 @@ Inst libc6-dev (1.0 unstable [armel]) Inst libfwibble1 (1.0 unstable [armel]) Inst libfwibble-dev (1.0 unstable [armel]) Conf amdboot:amd64 (1.0 unstable [amd64]) +Conf arm-stuff (1.0 unstable [armel]) Conf cool (1.0 unstable [armel]) Conf doxygen (1.0 unstable [armel]) Conf foreigner (1.0 unstable [armel]) @@ -101,8 +110,8 @@ testequal 'Reading package lists... Building dependency tree... The following NEW packages will be installed: amdboot:amd64 cool doxygen foreigner libc6:amd64 libc6 libc6-dev:amd64 - libc6-dev libfwibble-dev:amd64 libfwibble1:amd64 -0 upgraded, 10 newly installed, 0 to remove and 0 not upgraded. + libc6-dev libfwibble-dev:amd64 libfwibble1:amd64 linux-stuff:amd64 +0 upgraded, 11 newly installed, 0 to remove and 0 not upgraded. Inst amdboot:amd64 (1.0 unstable [amd64]) Inst cool (1.0 unstable [armel]) Inst doxygen (1.0 unstable [armel]) @@ -113,6 +122,7 @@ Inst libc6-dev:amd64 (1.0 unstable [amd64]) Inst libc6-dev (1.0 unstable [armel]) Inst libfwibble1:amd64 (1.0 unstable [amd64]) Inst libfwibble-dev:amd64 (1.0 unstable [amd64]) +Inst linux-stuff:amd64 (1.0 unstable [amd64]) Conf amdboot:amd64 (1.0 unstable [amd64]) Conf cool (1.0 unstable [armel]) Conf doxygen (1.0 unstable [armel]) @@ -122,7 +132,8 @@ Conf libc6 (1.0 unstable [armel]) Conf libc6-dev:amd64 (1.0 unstable [amd64]) Conf libc6-dev (1.0 unstable [armel]) Conf libfwibble1:amd64 (1.0 unstable [amd64]) -Conf libfwibble-dev:amd64 (1.0 unstable [amd64])' aptget build-dep apt -s -a amd64 +Conf libfwibble-dev:amd64 (1.0 unstable [amd64]) +Conf linux-stuff:amd64 (1.0 unstable [amd64])' aptget build-dep apt -s -a amd64 configarchitecture 'amd64' 'armel' @@ -132,28 +143,31 @@ insertinstalledpackage 'foreigner' 'armel' '0.5' testequal 'Reading package lists... Building dependency tree... The following NEW packages will be installed: - amdboot doxygen libc6 libc6-dev libfwibble-dev libfwibble1 -0 upgraded, 6 newly installed, 0 to remove and 2 not upgraded. + amdboot doxygen libc6 libc6-dev libfwibble-dev libfwibble1 linux-stuff +0 upgraded, 7 newly installed, 0 to remove and 2 not upgraded. Inst amdboot (1.0 unstable [amd64]) Inst doxygen (1.0 unstable [amd64]) Inst libc6 (1.0 unstable [amd64]) Inst libc6-dev (1.0 unstable [amd64]) Inst libfwibble1 (1.0 unstable [amd64]) Inst libfwibble-dev (1.0 unstable [amd64]) +Inst linux-stuff (1.0 unstable [amd64]) Conf amdboot (1.0 unstable [amd64]) Conf doxygen (1.0 unstable [amd64]) Conf libc6 (1.0 unstable [amd64]) Conf libc6-dev (1.0 unstable [amd64]) Conf libfwibble1 (1.0 unstable [amd64]) -Conf libfwibble-dev (1.0 unstable [amd64])' aptget build-dep apt -s +Conf libfwibble-dev (1.0 unstable [amd64]) +Conf linux-stuff (1.0 unstable [amd64])' aptget build-dep apt -s testequal 'Reading package lists... Building dependency tree... The following NEW packages will be installed: - amdboot doxygen libc6 libc6:armel libc6-dev libc6-dev:armel + amdboot arm-stuff:armel doxygen libc6 libc6:armel libc6-dev libc6-dev:armel libfwibble-dev:armel libfwibble1:armel -0 upgraded, 8 newly installed, 0 to remove and 2 not upgraded. +0 upgraded, 9 newly installed, 0 to remove and 2 not upgraded. Inst amdboot (1.0 unstable [amd64]) +Inst arm-stuff:armel (1.0 unstable [armel]) Inst doxygen (1.0 unstable [amd64]) Inst libc6 (1.0 unstable [amd64]) Inst libc6:armel (1.0 unstable [armel]) @@ -162,6 +176,7 @@ Inst libc6-dev:armel (1.0 unstable [armel]) Inst libfwibble1:armel (1.0 unstable [armel]) Inst libfwibble-dev:armel (1.0 unstable [armel]) Conf amdboot (1.0 unstable [amd64]) +Conf arm-stuff:armel (1.0 unstable [armel]) Conf doxygen (1.0 unstable [amd64]) Conf libc6 (1.0 unstable [amd64]) Conf libc6:armel (1.0 unstable [armel]) @@ -178,10 +193,12 @@ Building dependency tree... The following packages will be REMOVED: cool:amd64 The following NEW packages will be installed: - amdboot:amd64 cool doxygen libc6 libc6-dev libfwibble-dev libfwibble1 -0 upgraded, 7 newly installed, 1 to remove and 1 not upgraded. + amdboot:amd64 arm-stuff cool doxygen libc6 libc6-dev libfwibble-dev + libfwibble1 +0 upgraded, 8 newly installed, 1 to remove and 1 not upgraded. Remv cool:amd64 [0.5] Inst amdboot:amd64 (1.0 unstable [amd64]) +Inst arm-stuff (1.0 unstable [armel]) Inst cool (1.0 unstable [armel]) Inst doxygen (1.0 unstable [armel]) Inst libc6 (1.0 unstable [armel]) @@ -189,6 +206,7 @@ Inst libc6-dev (1.0 unstable [armel]) Inst libfwibble1 (1.0 unstable [armel]) Inst libfwibble-dev (1.0 unstable [armel]) Conf amdboot:amd64 (1.0 unstable [amd64]) +Conf arm-stuff (1.0 unstable [armel]) Conf cool (1.0 unstable [armel]) Conf doxygen (1.0 unstable [armel]) Conf libc6 (1.0 unstable [armel]) @@ -200,8 +218,8 @@ testequal 'Reading package lists... Building dependency tree... The following NEW packages will be installed: amdboot:amd64 doxygen libc6:amd64 libc6 libc6-dev:amd64 libc6-dev - libfwibble-dev:amd64 libfwibble1:amd64 -0 upgraded, 8 newly installed, 0 to remove and 2 not upgraded. + libfwibble-dev:amd64 libfwibble1:amd64 linux-stuff:amd64 +0 upgraded, 9 newly installed, 0 to remove and 2 not upgraded. Inst amdboot:amd64 (1.0 unstable [amd64]) Inst doxygen (1.0 unstable [armel]) Inst libc6:amd64 (1.0 unstable [amd64]) @@ -210,6 +228,7 @@ Inst libc6-dev:amd64 (1.0 unstable [amd64]) Inst libc6-dev (1.0 unstable [armel]) Inst libfwibble1:amd64 (1.0 unstable [amd64]) Inst libfwibble-dev:amd64 (1.0 unstable [amd64]) +Inst linux-stuff:amd64 (1.0 unstable [amd64]) Conf amdboot:amd64 (1.0 unstable [amd64]) Conf doxygen (1.0 unstable [armel]) Conf libc6:amd64 (1.0 unstable [amd64]) @@ -217,6 +236,5 @@ Conf libc6 (1.0 unstable [armel]) Conf libc6-dev:amd64 (1.0 unstable [amd64]) Conf libc6-dev (1.0 unstable [armel]) Conf libfwibble1:amd64 (1.0 unstable [amd64]) -Conf libfwibble-dev:amd64 (1.0 unstable [amd64])' aptget build-dep apt -s -a amd64 - - +Conf libfwibble-dev:amd64 (1.0 unstable [amd64]) +Conf linux-stuff:amd64 (1.0 unstable [amd64])' aptget build-dep apt -s -a amd64 diff --git a/test/libapt/assert.h b/test/libapt/assert.h index a07be4b57..fdf6740c6 100644 --- a/test/libapt/assert.h +++ b/test/libapt/assert.h @@ -1,6 +1,7 @@ #include <iostream> #define equals(x,y) assertEquals(y, x, __LINE__) +#define equalsNot(x,y) assertEqualsNot(y, x, __LINE__) template < typename X, typename Y > void OutputAssertEqual(X expect, char const* compare, Y get, unsigned long const &line) { @@ -14,6 +15,13 @@ void assertEquals(X expect, Y get, unsigned long const &line) { OutputAssertEqual(expect, "==", get, line); } +template < typename X, typename Y > +void assertEqualsNot(X expect, Y get, unsigned long const &line) { + if (expect != get) + return; + OutputAssertEqual(expect, "!=", get, line); +} + void assertEquals(unsigned int const &expect, int const &get, unsigned long const &line) { if (get < 0) OutputAssertEqual(expect, "==", get, line); @@ -80,6 +88,19 @@ void assertEqualsOr3(X expect1, X expect2, X expect3, Y get, unsigned long const OutputAssertEqualOr3(expect1, expect2, expect3, "==", get, line); } +#define equalsOr4(v,w,x,y,z) assertEqualsOr4(w, x, y, z, v, __LINE__) + +template < typename X, typename Y > +void OutputAssertEqualOr4(X expect1, X expect2, X expect3, X expect4, char const* compare, Y get, unsigned long const &line) { + std::cerr << "Test FAILED: »" << expect1 << "« or »" << expect2 << "« or »" << expect3 << "« or »" << expect4 << "« " << compare << " »" << get << "« at line " << line << std::endl; +} + +template < typename X, typename Y > +void assertEqualsOr4(X expect1, X expect2, X expect3, X expect4, Y get, unsigned long const &line) { + if (expect1 == get || expect2 == get || expect3 == get || expect4 == get) + return; + OutputAssertEqualOr4(expect1, expect2, expect3, expect4, "==", get, line); +} // simple helper to quickly output a vectors template < typename X > diff --git a/test/libapt/getlanguages_test.cc b/test/libapt/getlanguages_test.cc index a1c801ea2..274cf4aa4 100644 --- a/test/libapt/getlanguages_test.cc +++ b/test/libapt/getlanguages_test.cc @@ -126,14 +126,21 @@ int main(int argc,char *argv[]) _config->Set("Dir::State::lists", argv[1]); vec = APT::Configuration::getLanguages(true, false, env); - equals(vec.size(), 7); + equals(vec.size(), 8); equals(vec[0], "de_DE"); equals(vec[1], "de"); equals(vec[2], "en"); equals(vec[3], "none"); - equalsOr3(vec[4], "pt", "tr", "ast_DE"); - equalsOr3(vec[5], "tr", "pt", "ast_DE"); - equalsOr3(vec[6], "tr", "pt", "ast_DE"); + equalsOr4(vec[4], "pt", "tr", "ast_DE", "tlh_DE"); + equalsOr4(vec[5], "tr", "pt", "ast_DE", "tlh_DE"); + equalsOr4(vec[6], "tr", "pt", "ast_DE", "tlh_DE"); + equalsOr4(vec[7], "tr", "pt", "ast_DE", "tlh_DE"); + equalsNot(vec[4], vec[5]); + equalsNot(vec[4], vec[6]); + equalsNot(vec[4], vec[7]); + equalsNot(vec[5], vec[6]); + equalsNot(vec[5], vec[7]); + equalsNot(vec[6], vec[7]); _config->Set("Acquire::Languages", "none"); vec = APT::Configuration::getLanguages(true, false, env); diff --git a/test/libapt/run-tests b/test/libapt/run-tests index 4ea9a916d..45a3157f7 100755 --- a/test/libapt/run-tests +++ b/test/libapt/run-tests @@ -65,7 +65,8 @@ do "${tmppath}/ftp.de.debian.org_debian_dists_sid_main_i18n_Translation-pt" \ "${tmppath}/ftp.de.debian.org_debian_dists_sid_main_i18n_Translation-se~" \ "${tmppath}/ftp.de.debian.org_debian_dists_sid_main_i18n_Translation-st.bak" \ - "${tmppath}/ftp.de.debian.org_debian_dists_sid_main_i18n_Translation-ast_DE" + "${tmppath}/ftp.de.debian.org_debian_dists_sid_main_i18n_Translation-ast_DE" \ + "${tmppath}/ftp.de.debian.org_debian_dists_sid_main_i18n_Translation-tlh%5fDE" elif [ $name = "HashSums${EXT}" ]; then TMP="$(readlink -f "./${0}")" echo -n "Testing with ${NAME} " |