diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/Makefile | 4 | ||||
-rw-r--r-- | test/integration/framework | 6 | ||||
-rwxr-xr-x | test/integration/test-bug-595691-empty-and-broken-archive-files | 12 | ||||
-rwxr-xr-x | test/integration/test-bug-604222-new-and-autoremove | 4 | ||||
-rwxr-xr-x | test/integration/test-bug-613420-new-garbage-dependency | 2 | ||||
-rwxr-xr-x | test/integration/test-conflicts-loop | 2 | ||||
-rwxr-xr-x | test/integration/test-hashsum-verification | 2 | ||||
-rwxr-xr-x | test/integration/test-pdiff-usage | 2 | ||||
-rwxr-xr-x | test/integration/test-releasefile-verification | 2 | ||||
-rw-r--r-- | test/interactive-helper/extract-control.cc | 3 | ||||
-rw-r--r-- | test/interactive-helper/makefile | 12 | ||||
-rw-r--r-- | test/interactive-helper/testextract.cc | 103 | ||||
-rwxr-xr-x | test/libapt/run-tests | 4 |
13 files changed, 28 insertions, 130 deletions
diff --git a/test/Makefile b/test/Makefile index da0a49b0c..b42a90b25 100644 --- a/test/Makefile +++ b/test/Makefile @@ -6,8 +6,8 @@ ifndef NOISY .SILENT: endif -.PHONY: headers library clean veryclean all binary program doc test -all clean veryclean binary program dirs test: +.PHONY: startup headers library clean veryclean all binary program doc test update-po +startup all clean veryclean binary program dirs test update-po: $(MAKE) -C libapt $@ $(MAKE) -C interactive-helper $@ diff --git a/test/integration/framework b/test/integration/framework index a738d27cc..0670d6a78 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -207,7 +207,9 @@ configdpkg() { if [ "${ARCH}" != "${DPKGARCH}" ]; then dpkg --add-architecture ${ARCH}; fi done if [ "0" = "$(dpkg -l dpkg 2> /dev/null | grep '^i' | wc -l)" ]; then - insertinstalledpackage 'dpkg' "all" '1.16.2~wipmultiarch~fake' + # dpkg doesn't really check the version as long as it is fully installed, + # but just to be sure we choose one above the required version + insertinstalledpackage 'dpkg' "all" '1.16.2+fake' fi fi fi @@ -556,7 +558,7 @@ buildaptarchivefromfiles() { msgninfo "\t${line} fileā¦ " cat ${line} | gzip > ${line}.gz cat ${line} | bzip2 > ${line}.bz2 - cat ${line} | lzma > ${line}.lzma + cat ${line} | xz --format=lzma > ${line}.lzma cat ${line} | xz > ${line}.xz msgdone "info" done diff --git a/test/integration/test-bug-595691-empty-and-broken-archive-files b/test/integration/test-bug-595691-empty-and-broken-archive-files index bb1ac0e54..63883b380 100755 --- a/test/integration/test-bug-595691-empty-and-broken-archive-files +++ b/test/integration/test-bug-595691-empty-and-broken-archive-files @@ -28,10 +28,10 @@ testaptgetupdate() { createemptyarchive() { find aptarchive/ \( -name "Packages*" -o -name "en*" \) -type f -delete if [ "en" = "$1" ]; then - echo -n "" | $COMPRESSOR > aptarchive/Packages.$COMPRESS + echo -n "" | $COMPRESSOR_CMD > aptarchive/Packages.$COMPRESS fi touch aptarchive/Packages - echo -n "" | $COMPRESSOR > aptarchive/${1}.$COMPRESS + echo -n "" | $COMPRESSOR_CMD > aptarchive/${1}.$COMPRESS generatereleasefiles signreleasefiles rm -f aptarchive/Packages @@ -40,7 +40,7 @@ createemptyarchive() { createemptyfile() { find aptarchive/ \( -name "Packages*" -o -name "en*" \) -type f -delete if [ "en" = "$1" ]; then - echo -n "" | $COMPRESSOR > aptarchive/Packages.$COMPRESS + echo -n "" | $COMPRESSOR_CMD > aptarchive/Packages.$COMPRESS fi touch aptarchive/Packages aptarchive/${1}.$COMPRESS generatereleasefiles @@ -50,6 +50,7 @@ createemptyfile() { setupcompressor() { COMPRESSOR="$1" + COMPRESSOR_CMD="$1" case $COMPRESSOR in gzip) COMPRESS="gz";; bzip2) COMPRESS="bz2";; @@ -66,10 +67,13 @@ Dir::Bin::xz \"/does/not/exist\";" > rootdir/etc/apt/apt.conf.d/00compressor echo "Dir::Bin::${COMPRESSOR} \"/bin/${COMPRESSOR}\";" >> rootdir/etc/apt/apt.conf.d/00compressor elif [ -e "/usr/bin/${COMPRESSOR}" ]; then echo "Dir::Bin::${COMPRESSOR} \"/usr/bin/${COMPRESSOR}\";" >> rootdir/etc/apt/apt.conf.d/00compressor + elif [ "${COMPRESSOR}" = 'lzma' ]; then + echo "Dir::Bin::xz \"/usr/bin/xz\";" >> rootdir/etc/apt/apt.conf.d/00compressor + COMPRESSOR_CMD='xz --format=lzma' else msgtest "Test for availability of compressor" "${COMPRESSOR}" msgfail - exit 1 + #exit 1 fi } diff --git a/test/integration/test-bug-604222-new-and-autoremove b/test/integration/test-bug-604222-new-and-autoremove index 2875d547a..5820fb0dc 100755 --- a/test/integration/test-bug-604222-new-and-autoremove +++ b/test/integration/test-bug-604222-new-and-autoremove @@ -16,7 +16,7 @@ Building dependency tree... Reading state information... The following package was automatically installed and is no longer required: libvtk5.4 -Use 'apt-get autoremove' to remove them. +Use 'apt-get autoremove' to remove it. The following NEW packages will be installed: libavcodec52 0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded. @@ -28,7 +28,7 @@ Building dependency tree... Reading state information... The following package was automatically installed and is no longer required: libvtk5.4 -Use 'apt-get autoremove' to remove them. +Use 'apt-get autoremove' to remove it. The following extra packages will be installed: libavcodec52 libopenal-dev libvtk5.4 The following NEW packages will be installed: diff --git a/test/integration/test-bug-613420-new-garbage-dependency b/test/integration/test-bug-613420-new-garbage-dependency index 34cf38cbc..7a08871ca 100755 --- a/test/integration/test-bug-613420-new-garbage-dependency +++ b/test/integration/test-bug-613420-new-garbage-dependency @@ -22,7 +22,7 @@ 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 + libreoffice-officebean openoffice.org-officebean Use 'apt-get autoremove' to remove them. The following extra packages will be installed: libreoffice-core libreoffice-officebean openoffice.org-officebean diff --git a/test/integration/test-conflicts-loop b/test/integration/test-conflicts-loop index 25f005969..4407fbd9d 100755 --- a/test/integration/test-conflicts-loop +++ b/test/integration/test-conflicts-loop @@ -19,10 +19,10 @@ testequal 'Reading package lists... Building dependency tree... The following packages will be upgraded: openjdk-6-jre openjdk-6-jre-headless openjdk-6-jre-lib -3 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. openjdk-6-jre-lib:i386 conflicts with openjdk-6-jre:i386 openjdk-6-jre:i386 conflicts with openjdk-6-jre-headless:i386 openjdk-6-jre-headless:i386 conflicts with openjdk-6-jre:i386 +3 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Remv openjdk-6-jre [6b16-1.8-0ubuntu1] openjdk-6-jre-headless:i386 conflicts with openjdk-6-jre-lib:i386 Remv openjdk-6-jre-lib [6b16-1.8-0ubuntu1] diff --git a/test/integration/test-hashsum-verification b/test/integration/test-hashsum-verification index 3ac9eccfb..99ea8bffa 100755 --- a/test/integration/test-hashsum-verification +++ b/test/integration/test-hashsum-verification @@ -23,7 +23,7 @@ prepare() { find aptarchive -name 'Release' -delete cat aptarchive/Packages | gzip > aptarchive/Packages.gz cat aptarchive/Packages | bzip2 > aptarchive/Packages.bz2 - cat aptarchive/Packages | lzma > aptarchive/Packages.lzma + cat aptarchive/Packages | xz --format=lzma > aptarchive/Packages.lzma # create Release file with incorret checksums cat > aptarchive/Release <<EOF Date: Fri, 05 Aug 2011 09:22:08 UTC diff --git a/test/integration/test-pdiff-usage b/test/integration/test-pdiff-usage index 0a8293018..29301d07d 100755 --- a/test/integration/test-pdiff-usage +++ b/test/integration/test-pdiff-usage @@ -21,7 +21,7 @@ testequal "$(cat ${PKGFILE}) cp ${PKGFILE}-new aptarchive/Packages cat aptarchive/Packages | gzip > aptarchive/Packages.gz cat aptarchive/Packages | bzip2 > aptarchive/Packages.bz2 -cat aptarchive/Packages | lzma > aptarchive/Packages.lzma +cat aptarchive/Packages | xz --format=lzma > aptarchive/Packages.lzma 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 4f65cfa3b..d3ea91de5 100755 --- a/test/integration/test-releasefile-verification +++ b/test/integration/test-releasefile-verification @@ -24,7 +24,7 @@ prepare() { find aptarchive -name 'Release' -delete cat aptarchive/Packages | gzip > aptarchive/Packages.gz cat aptarchive/Packages | bzip2 > aptarchive/Packages.bz2 - cat aptarchive/Packages | lzma > aptarchive/Packages.lzma + cat aptarchive/Packages | xz --format=lzma > aptarchive/Packages.lzma generatereleasefiles "$DATE" } diff --git a/test/interactive-helper/extract-control.cc b/test/interactive-helper/extract-control.cc index a1b3600aa..3f7feabcb 100644 --- a/test/interactive-helper/extract-control.cc +++ b/test/interactive-helper/extract-control.cc @@ -21,8 +21,7 @@ bool ExtractMember(const char *File,const char *Member) if (Extract.Control == 0) return true; - write(STDOUT_FILENO,Extract.Control,Extract.Length); - return true; + return write(STDOUT_FILENO,Extract.Control,Extract.Length) != -1; } int main(int argc, const char *argv[]) diff --git a/test/interactive-helper/makefile b/test/interactive-helper/makefile index b96139fda..10d1e44ec 100644 --- a/test/interactive-helper/makefile +++ b/test/interactive-helper/makefile @@ -11,28 +11,24 @@ SLIBS = SOURCE = mthdcat.cc include $(PROGRAM_H) -# Version compare tester -PROGRAM=testextract -SLIBS = -lapt-pkg -lapt-inst -LIB_MAKES = apt-pkg/makefile apt-inst/makefile -SOURCE = testextract.cc -include $(PROGRAM_H) - # Program for testing the tar/deb extractor PROGRAM=testdeb SLIBS = -lapt-pkg -lapt-inst +LIB_MAKES = apt-pkg/makefile apt-inst/makefile SOURCE = testdeb.cc include $(PROGRAM_H) # Program for testing tar extraction PROGRAM=extract-control SLIBS = -lapt-pkg -lapt-inst +LIB_MAKES = apt-pkg/makefile apt-inst/makefile SOURCE = extract-control.cc include $(PROGRAM_H) # Program for testing udevcdrom PROGRAM=test_udevcdrom -SLIBS = -lapt-pkg +SLIBS = -lapt-pkg +LIB_MAKES = apt-pkg/makefile SOURCE = test_udevcdrom.cc include $(PROGRAM_H) diff --git a/test/interactive-helper/testextract.cc b/test/interactive-helper/testextract.cc deleted file mode 100644 index f7ddb72f0..000000000 --- a/test/interactive-helper/testextract.cc +++ /dev/null @@ -1,103 +0,0 @@ -#include <apt-pkg/dpkgdb.h> -#include <apt-pkg/debfile.h> -#include <apt-pkg/error.h> -#include <apt-pkg/configuration.h> -#include <apt-pkg/progress.h> -#include <apt-pkg/extract.h> -#include <apt-pkg/init.h> -#include <apt-pkg/strutl.h> -#include <apt-pkg/fileutl.h> -#include <apt-pkg/pkgsystem.h> - -#include <stdio.h> -#include <stdlib.h> - -using namespace std; - -bool Go(int argc,char *argv[]) -{ - // Init the database - debDpkgDB Db; - { - OpTextProgress Prog; - - if (Db.ReadyPkgCache(Prog) == false) - return false; - Prog.Done(); - - if (Db.ReadyFileList(Prog) == false) - return false; - } - - for (int I = 1; I < argc; I++) - { - const char *Fake = 0; - for (unsigned J = 0; argv[I][J] != 0; J++) - { - if (argv[I][J] != ',') - continue; - Fake = argv[I] + J + 1; - argv[I][J] = 0; - } - - FileFd F(argv[I],FileFd::ReadOnly); - debDebFile Deb(F); - - if (_error->PendingError() == true) - return false; - - if (Deb.ExtractControl(Db) == false) - return false; - cout << argv[I] << endl; - - pkgCache::VerIterator Ver = Deb.MergeControl(Db); - if (Ver.end() == true) - return false; - - cout << Ver.ParentPkg().Name() << ' ' << Ver.VerStr() << endl; - - pkgExtract Extract(Db.GetFLCache(),Ver); - - if (Fake != 0) - { - pkgExtract::Item Itm; - memset(&Itm,0,sizeof(Itm)); - FILE *F = fopen(Fake,"r"); - while (feof(F) == 0) - { - char Line[300]; - fgets(Line,sizeof(Line),F); - Itm.Name = _strstrip(Line); - Itm.Type = pkgDirStream::Item::File; - if (Line[strlen(Line)-1] == '/') - Itm.Type = pkgDirStream::Item::Directory; - - int Fd; - if (Extract.DoItem(Itm,Fd) == false) { - fclose(F); - return false; - } - } - fclose(F); - } - else - if (Deb.ExtractArchive(Extract) == false) - return false; - } - return true; -} - -int main(int argc,char *argv[]) -{ - pkgInitConfig(*_config); - pkgInitSystem(*_config,_system); - _config->Set("Dir::State::status","/tmp/testing/status"); - - Go(argc,argv); - - if (_error->PendingError() == true) - { - _error->DumpErrors(); - return 0; - } -} diff --git a/test/libapt/run-tests b/test/libapt/run-tests index d4341412d..4ea9a916d 100755 --- a/test/libapt/run-tests +++ b/test/libapt/run-tests @@ -68,8 +68,8 @@ do "${tmppath}/ftp.de.debian.org_debian_dists_sid_main_i18n_Translation-ast_DE" elif [ $name = "HashSums${EXT}" ]; then 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" + echo -n "Testing with ${NAME} " + 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 "$TESTOKAY" || echo "$TESTFAIL" continue elif [ $name = "CompareVersion${EXT}" ]; then tmppath="${DIR}/versions.lst" |