From adee3bae782f5b7d83819bf92ab419663ef4ee64 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 15 Feb 2011 16:04:46 +0100 Subject: test/integration/: remove a bunch of "local" statements from the shellscript, keep tests running even on failure but log failures --- test/integration/create-test-data | 2 +- test/integration/run-tests | 9 ++++++++- test/integration/test-bug-254770-segfault-if-cache-not-buildable | 2 +- test/integration/test-bug-330162-encoded-tar-header | 2 +- test/integration/test-bug-593360-modifiers-in-names | 2 +- test/integration/test-bug-601961-install-info | 2 +- test/integration/test-bug-604222-new-and-autoremove | 2 +- test/integration/test-bug-604401-files-are-directories | 2 +- test/integration/test-bug-605394-versioned-or-groups | 2 +- test/integration/test-bug-612557-garbage-upgrade | 2 +- test/integration/test-release-candidate-switching | 2 +- test/integration/test-ubuntu-bug-365611-long-package-names | 2 +- 12 files changed, 19 insertions(+), 12 deletions(-) (limited to 'test/integration') diff --git a/test/integration/create-test-data b/test/integration/create-test-data index 581b62910..effbe1ea3 100755 --- a/test/integration/create-test-data +++ b/test/integration/create-test-data @@ -6,7 +6,7 @@ if [ -z "$1" -o -z "$2" ]; then exit 1 fi -local TESTDIR=$(readlink -f $(dirname $0)) +TESTDIR=$(readlink -f $(dirname $0)) . $TESTDIR/framework BUILDDIRECTORY="${TESTDIR}/../../build/bin" diff --git a/test/integration/run-tests b/test/integration/run-tests index 7314e6b61..edac07dbf 100755 --- a/test/integration/run-tests +++ b/test/integration/run-tests @@ -1,6 +1,7 @@ #!/bin/sh set -e +FAIL=0 DIR=$(readlink -f $(dirname $0)) if [ "$1" = "-q" ]; then export MSGLEVEL=2 @@ -13,8 +14,14 @@ for testcase in $(run-parts --list $DIR | grep '/test-'); do else echo "\033[1;32mRun Testcase \033[1;35m$(basename ${testcase})\033[0m" fi - ${testcase} + if ! ${testcase}; then + FAIL=$((FAIL+1)) + echo "$(basename $testcase) ... FAIL" + fi if [ "$1" = "-q" ]; then echo fi done + +echo "failures: $FAIL" +exit $FAIL 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 25c564daa..b9f45b131 100755 --- a/test/integration/test-bug-254770-segfault-if-cache-not-buildable +++ b/test/integration/test-bug-254770-segfault-if-cache-not-buildable @@ -1,7 +1,7 @@ #!/bin/sh set -e -local TESTDIR=$(readlink -f $(dirname $0)) +TESTDIR=$(readlink -f $(dirname $0)) . $TESTDIR/framework setupenvironment configarchitecture "i386" diff --git a/test/integration/test-bug-330162-encoded-tar-header b/test/integration/test-bug-330162-encoded-tar-header index fa01e0379..b3fae6bac 100755 --- a/test/integration/test-bug-330162-encoded-tar-header +++ b/test/integration/test-bug-330162-encoded-tar-header @@ -1,7 +1,7 @@ #!/bin/sh set -e -local TESTDIR=$(readlink -f $(dirname $0)) +TESTDIR=$(readlink -f $(dirname $0)) . $TESTDIR/framework setupenvironment configarchitecture "i386" diff --git a/test/integration/test-bug-593360-modifiers-in-names b/test/integration/test-bug-593360-modifiers-in-names index c12503b0d..83a3cfabf 100755 --- a/test/integration/test-bug-593360-modifiers-in-names +++ b/test/integration/test-bug-593360-modifiers-in-names @@ -1,7 +1,7 @@ #!/bin/sh set -e -local TESTDIR=$(readlink -f $(dirname $0)) +TESTDIR=$(readlink -f $(dirname $0)) . $TESTDIR/framework setupenvironment configarchitecture "i386" diff --git a/test/integration/test-bug-601961-install-info b/test/integration/test-bug-601961-install-info index b91bf3615..914910597 100755 --- a/test/integration/test-bug-601961-install-info +++ b/test/integration/test-bug-601961-install-info @@ -1,7 +1,7 @@ #!/bin/sh set -e -local TESTDIR=$(readlink -f $(dirname $0)) +TESTDIR=$(readlink -f $(dirname $0)) . $TESTDIR/framework setupenvironment configarchitecture "i386" diff --git a/test/integration/test-bug-604222-new-and-autoremove b/test/integration/test-bug-604222-new-and-autoremove index 9187dd1cd..2875d547a 100755 --- a/test/integration/test-bug-604222-new-and-autoremove +++ b/test/integration/test-bug-604222-new-and-autoremove @@ -1,7 +1,7 @@ #!/bin/sh set -e -local TESTDIR=$(readlink -f $(dirname $0)) +TESTDIR=$(readlink -f $(dirname $0)) . $TESTDIR/framework setupenvironment configarchitecture "i386" diff --git a/test/integration/test-bug-604401-files-are-directories b/test/integration/test-bug-604401-files-are-directories index 917fb106f..aae717a19 100755 --- a/test/integration/test-bug-604401-files-are-directories +++ b/test/integration/test-bug-604401-files-are-directories @@ -1,7 +1,7 @@ #!/bin/sh set -e -local TESTDIR=$(readlink -f $(dirname $0)) +TESTDIR=$(readlink -f $(dirname $0)) . $TESTDIR/framework setupenvironment configarchitecture "i386" diff --git a/test/integration/test-bug-605394-versioned-or-groups b/test/integration/test-bug-605394-versioned-or-groups index 0d7ad77f6..0f09d2927 100755 --- a/test/integration/test-bug-605394-versioned-or-groups +++ b/test/integration/test-bug-605394-versioned-or-groups @@ -1,7 +1,7 @@ #!/bin/sh set -e -local TESTDIR=$(readlink -f $(dirname $0)) +TESTDIR=$(readlink -f $(dirname $0)) . $TESTDIR/framework setupenvironment configarchitecture "i386" diff --git a/test/integration/test-bug-612557-garbage-upgrade b/test/integration/test-bug-612557-garbage-upgrade index e2ffe615f..3112e618c 100755 --- a/test/integration/test-bug-612557-garbage-upgrade +++ b/test/integration/test-bug-612557-garbage-upgrade @@ -1,7 +1,7 @@ #!/bin/sh set -e -local TESTDIR=$(readlink -f $(dirname $0)) +TESTDIR=$(readlink -f $(dirname $0)) . $TESTDIR/framework setupenvironment configarchitecture "i386" diff --git a/test/integration/test-release-candidate-switching b/test/integration/test-release-candidate-switching index 5736945ab..b6dbe99db 100755 --- a/test/integration/test-release-candidate-switching +++ b/test/integration/test-release-candidate-switching @@ -1,7 +1,7 @@ #!/bin/sh set -e -local TESTDIR=$(readlink -f $(dirname $0)) +TESTDIR=$(readlink -f $(dirname $0)) . $TESTDIR/framework setupenvironment configarchitecture "i386" diff --git a/test/integration/test-ubuntu-bug-365611-long-package-names b/test/integration/test-ubuntu-bug-365611-long-package-names index 28b55df3b..894c8dc97 100755 --- a/test/integration/test-ubuntu-bug-365611-long-package-names +++ b/test/integration/test-ubuntu-bug-365611-long-package-names @@ -1,7 +1,7 @@ #!/bin/sh set -e -local TESTDIR=$(readlink -f $(dirname $0)) +TESTDIR=$(readlink -f $(dirname $0)) . $TESTDIR/framework setupenvironment configarchitecture "i386" -- cgit v1.2.3 From c8b9897314d24f97047b6a86573b5e9063c7c4d3 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 15 Feb 2011 20:47:04 +0100 Subject: * cmdline/apt-get.cc: - don't remove new dependencies of garbage packages (Closes: #613420) --- .../status-bug-613420-new-garbage-dependency | 22 +++++++++++++ .../test-bug-613420-new-garbage-dependency | 37 ++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 test/integration/status-bug-613420-new-garbage-dependency create mode 100755 test/integration/test-bug-613420-new-garbage-dependency (limited to 'test/integration') diff --git a/test/integration/status-bug-613420-new-garbage-dependency b/test/integration/status-bug-613420-new-garbage-dependency new file mode 100644 index 000000000..166a3930f --- /dev/null +++ b/test/integration/status-bug-613420-new-garbage-dependency @@ -0,0 +1,22 @@ +Package: openoffice.org-officebean +Status: install ok installed +Priority: optional +Section: java +Installed-Size: 1656 +Maintainer: Debian OpenOffice Team +Architecture: i386 +Source: openoffice.org +Version: 1:3.2.1-11+squeeze2 +Depends: openoffice.org-core (= 1:3.2.1-11+squeeze2) +Description: office productivity suite -- Java bean + +Package: openoffice.org-core +Status: install ok installed +Priority: optional +Section: editors +Installed-Size: 121724 +Maintainer: Debian OpenOffice Team +Architecture: i386 +Source: openoffice.org +Version: 1:3.2.1-11+squeeze2 +Description: office productivity suite -- arch-dependent files diff --git a/test/integration/test-bug-613420-new-garbage-dependency b/test/integration/test-bug-613420-new-garbage-dependency new file mode 100755 index 000000000..34cf38cbc --- /dev/null +++ b/test/integration/test-bug-613420-new-garbage-dependency @@ -0,0 +1,37 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture "i386" + +insertpackage 'unstable' 'libreoffice' 'all' '1:3.3.1~rc1-2' 'Depends: libreoffice-core' +insertpackage 'unstable' 'libreoffice-core' 'all' '1:3.3.1~rc1-2' 'Conflicts: openoffice.org-core' +insertpackage 'unstable' 'libreoffice-officebean' 'all' '1:3.3.1~rc1-2' 'Depends: libreoffice-core' +insertpackage 'unstable' 'openoffice.org-officebean' 'all' '1:3.3.0-5' 'Depends: libreoffice-officebean' + + +setupaptarchive + +touch rootdir/var/lib/apt/extended_states +aptmark markauto openoffice.org-officebean +testmarkedauto openoffice.org-officebean + +testequal "Reading package lists... +Building dependency tree... +Reading state information... +The following packages were automatically installed and are no longer required: + openoffice.org-officebean libreoffice-officebean +Use 'apt-get autoremove' to remove them. +The following extra packages will be installed: + libreoffice-core libreoffice-officebean openoffice.org-officebean +The following packages will be REMOVED: + openoffice.org-core +The following NEW packages will be installed: + libreoffice libreoffice-core libreoffice-officebean +The following packages will be upgraded: + openoffice.org-officebean +1 upgraded, 3 newly installed, 1 to remove and 0 not upgraded. +After this operation, 126 MB disk space will be freed. +E: Trivial Only specified but this is not a trivial operation." aptget install libreoffice --trivial-only -- cgit v1.2.3