diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/integration/framework | 9 | ||||
-rwxr-xr-x | test/integration/test-dpkg-assert-multi-arch | 50 | ||||
-rw-r--r-- | test/libapt/globalerror_test.cc | 7 | ||||
-rwxr-xr-x | test/libapt/run-tests | 4 |
4 files changed, 61 insertions, 9 deletions
diff --git a/test/integration/framework b/test/integration/framework index 2ea1844f0..d7526a100 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -25,7 +25,14 @@ msgnwarn() { echo -n "${CWARNING}W: $1${CNORMAL}" >&2; } msgnmsg() { echo -n "${CMSG}$1${CNORMAL}" >&2; } msgninfo() { echo -n "${CINFO}I: $1${CNORMAL}" >&2; } msgndebug() { echo -n "${CDEBUG}D: $1${CNORMAL}" >&2; } -msgtest() { echo -n "${CINFO}$1 ${CCMD}$(echo "$2" | sed -e 's/^aptc/apt-c/' -e 's/^aptg/apt-g/' -e 's/^aptf/apt-f/')${CINFO} …${CNORMAL} " >&2; } +msgtest() { + while [ -n "$1" ]; do + echo -n "${CINFO}$1${CCMD} " >&2; + echo -n "$(echo "$2" | sed -e 's/^aptc/apt-c/' -e 's/^aptg/apt-g/' -e 's/^aptf/apt-f/')${CINFO} " >&2; + shift 2 + done + echo -n "…${CNORMAL} " >&2; +} msgpass() { echo "${CPASS}PASS${CNORMAL}" >&2; } msgskip() { echo "${CWARNING}SKIP${CNORMAL}" >&2; } msgfail() { echo "${CFAIL}FAIL${CNORMAL}" >&2; } diff --git a/test/integration/test-dpkg-assert-multi-arch b/test/integration/test-dpkg-assert-multi-arch index b1ec73e18..177d7489b 100755 --- a/test/integration/test-dpkg-assert-multi-arch +++ b/test/integration/test-dpkg-assert-multi-arch @@ -9,19 +9,29 @@ configarchitecture 'amd64' 'i386' buildsimplenativepackage 'native-pkg' 'amd64' '1.0' 'stable' buildsimplenativepackage 'foreign-pkg' 'i386' '0.5' 'stable' 'Multi-Arch: foreign' buildsimplenativepackage 'same-lib' 'amd64,i386' '0.5' 'stable' 'Multi-Arch: same' +buildsimplenativepackage 'all-pkg' 'all' '2.0' 'stable' +buildsimplenativepackage 'all-foreign-pkg' 'all' '2.0' 'stable' 'Multi-Arch: foreign' setupaptarchive testqualifier() { - msgtest 'Test for correct qualifier mode' $2 - GIVEN="$(aptget install $1 -qq -o Debug::pkgDPkgPM=1 2>&1 | grep -- '--configure' | sed -e 's/^.*--configure \([^ ]*\).*$/\1/')" - test "$GIVEN" = "$2" && msgpass || msgfail + msgtest 'Test with' $1 'for correct qualifier mode' $2 + GIVEN="$(aptget install $1 -qq -o Debug::pkgDPkgPM=1 2>&1 | grep -v -- '--unpack' | sed -e 's/^.*--[^u][^ ]* \([^ ]*\).*$/\1/')" + if [ "$GIVEN" = "$2" ]; then + msgpass + else + echo + echo "$GIVEN" + msgfail + fi } # non-multiarch or "ubuntus" old multiarchified dpkg echo 'Dir::Bin::dpkg "./dpkg-wrapper";' > rootdir/etc/apt/apt.conf.d/99dpkgwrapper echo '#! /bin/sh if echo "$*" | grep -q -- "--assert-multi-arch"; then + echo >&2 'dpkg: Fehler: unbekannte Option --assert-multi-arch' + echo >&1 'dpkg: Info: unbekannte Option --assert-multi-arch' return 2; fi return $*' > ./dpkg-wrapper @@ -34,9 +44,27 @@ testqualifier 'foreign-pkg:i386' 'foreign-pkg:i386' testqualifier 'same-lib' 'same-lib' testqualifier 'same-lib:amd64' 'same-lib' testqualifier 'same-lib:i386' 'same-lib:i386' +testqualifier 'all-pkg' 'all-pkg' +testqualifier 'all-pkg:amd64' 'all-pkg' +testqualifier 'all-foreign-pkg' 'all-foreign-pkg' +testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg' +insertinstalledpackage 'all-pkg' 'amd64' '1.0' +insertinstalledpackage 'all-foreign-pkg' 'amd64' '1.0' 'Multi-Arch: foreign' +testqualifier 'all-pkg' 'all-pkg' +testqualifier 'all-pkg:amd64' 'all-pkg' +testqualifier 'all-foreign-pkg' 'all-foreign-pkg' +testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg' +insertinstalledpackage 'always-all-pkg' 'all' '1.0' +insertinstalledpackage 'always-all-foreign-pkg' 'all' '1.0' 'Multi-Arch: foreign' +testqualifier 'all-pkg-' 'all-pkg' +testqualifier 'all-foreign-pkg-' 'all-foreign-pkg' +testqualifier 'always-all-pkg-' 'always-all-pkg' +testqualifier 'always-all-foreign-pkg-' 'always-all-foreign-pkg' # multiarch dpkg (new interface version) +rm rootdir/var/lib/dpkg/status +touch rootdir/var/lib/dpkg/status echo 'Dir::Bin::dpkg "./dpkg-wrapper";' > rootdir/etc/apt/apt.conf.d/99dpkgwrapper echo '#! /bin/sh if echo "$*" | grep -q -- "--assert-multi-arch"; then @@ -51,3 +79,19 @@ testqualifier 'foreign-pkg:i386' 'foreign-pkg:i386' testqualifier 'same-lib' 'same-lib:amd64' testqualifier 'same-lib:amd64' 'same-lib:amd64' testqualifier 'same-lib:i386' 'same-lib:i386' +testqualifier 'all-pkg' 'all-pkg:all' +testqualifier 'all-pkg:amd64' 'all-pkg:all' +testqualifier 'all-foreign-pkg' 'all-foreign-pkg:all' +testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg:all' +insertinstalledpackage 'all-pkg' 'amd64' '1.0' +insertinstalledpackage 'all-foreign-pkg' 'amd64' '1.0' 'Multi-Arch: foreign' +testqualifier 'all-pkg' 'all-pkg:all' +testqualifier 'all-pkg:amd64' 'all-pkg:all' +testqualifier 'all-foreign-pkg' 'all-foreign-pkg:all' +testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg:all' +insertinstalledpackage 'always-all-pkg' 'all' '1.0' +insertinstalledpackage 'always-all-foreign-pkg' 'all' '1.0' 'Multi-Arch: foreign' +testqualifier 'all-pkg-' 'all-pkg:amd64' +testqualifier 'all-foreign-pkg-' 'all-foreign-pkg:amd64' +testqualifier 'always-all-pkg-' 'always-all-pkg:all' +testqualifier 'always-all-foreign-pkg-' 'always-all-foreign-pkg:all' diff --git a/test/libapt/globalerror_test.cc b/test/libapt/globalerror_test.cc index 5d27414f9..72044d493 100644 --- a/test/libapt/globalerror_test.cc +++ b/test/libapt/globalerror_test.cc @@ -3,9 +3,12 @@ #include "assert.h" #include <string> #include <errno.h> +#include <string.h> int main(int argc,char *argv[]) { + std::string const textOfErrnoZero(strerror(0)); + equals(_error->empty(), true); equals(_error->PendingError(), false); equals(_error->Notice("%s Notice", "A"), false); @@ -80,7 +83,7 @@ int main(int argc,char *argv[]) equals(_error->PendingError(), true); equals(_error->PopMessage(text), true); equals(_error->PendingError(), false); - equals(text, "Something horrible happend 2 times - errno (0: Success)"); + equals(text, std::string("Something horrible happend 2 times - errno (0: ").append(textOfErrnoZero).append(")")); equals(_error->empty(), true); std::string longText; @@ -92,7 +95,7 @@ int main(int argc,char *argv[]) equals(_error->Errno("errno", "%s horrible %s %d times", longText.c_str(), "happend", 2), false); equals(_error->PopMessage(text), true); - equals(text, std::string(longText).append(" horrible happend 2 times - errno (0: Success)")); + equals(text, std::string(longText).append(" horrible happend 2 times - errno (0: ").append(textOfErrnoZero).append(")")); equals(_error->Warning("Репозиторий не обновлён и будут %d %s", 4, "test"), false); equals(_error->PopMessage(text), false); diff --git a/test/libapt/run-tests b/test/libapt/run-tests index 5fff4ecca..d4341412d 100755 --- a/test/libapt/run-tests +++ b/test/libapt/run-tests @@ -67,11 +67,9 @@ do "${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" elif [ $name = "HashSums${EXT}" ]; then - TMP="$(mktemp)" - dmesg > $TMP + TMP="$(readlink -f "./${0}")" echo -n "Testing with \033[1;35m${name}\033[0m ... " LD_LIBRARY_PATH=${LDPATH} ${testapp} $TMP $(md5sum $TMP | cut -d' ' -f 1) $(sha1sum $TMP | cut -d' ' -f 1) $(sha256sum $TMP | cut -d' ' -f 1) $(sha512sum $TMP | cut -d' ' -f 1) && echo "\033[1;32mOKAY\033[0m" || echo "\033[1;31mFAILED\033[0m" - rm $TMP continue elif [ $name = "CompareVersion${EXT}" ]; then tmppath="${DIR}/versions.lst" |