]> git.saurik.com Git - apt.git/blobdiff - test/integration/framework
* ftparchive/writer.cc:
[apt.git] / test / integration / framework
index 59d2f0e85e548ad8762514168fe3b13f3af395ae..6545cf3ce4ad08c5f782db95ccc53de3dd4a6b56 100644 (file)
@@ -64,6 +64,8 @@ runapt() {
        msgdebug "Executing: ${CCMD}$*${CDEBUG} "
        if [ -f ./aptconfig.conf ]; then
                APT_CONFIG=aptconfig.conf LD_LIBRARY_PATH=${BUILDDIRECTORY} ${BUILDDIRECTORY}/$*
+        elif [ -f ../aptconfig.conf ]; then
+                APT_CONFIG=../aptconfig.conf LD_LIBRARY_PATH=${BUILDDIRECTORY} ${BUILDDIRECTORY}/$*
        else
                LD_LIBRARY_PATH=${BUILDDIRECTORY} ${BUILDDIRECTORY}/$*
        fi
@@ -111,6 +113,7 @@ setupenvironment() {
        cp $(find $TESTDIR -name '*.pub' -o -name '*.sec') keys/
        ln -s ${TMPWORKINGDIRECTORY}/keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
        echo "Dir \"${TMPWORKINGDIRECTORY}/rootdir\";" > aptconfig.conf
+       echo "Dir::state::status \"${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status\";" >> aptconfig.conf
        echo "Debug::NoLocking \"true\";" >> aptconfig.conf
        echo "APT::Get::Show-User-Simulation-Note \"false\";" >> aptconfig.conf
        echo "Dir::Bin::dpkg \"fakeroot\";" >> aptconfig.conf
@@ -248,9 +251,9 @@ createaptftparchiveconfig() {
        echo -n '";
 };
 Default {
-       Packages::Compress ". gzip bzip2 lzma";
-       Sources::Compress ". gzip bzip2 lzma";
-       Contents::Compress ". gzip bzip2 lzma";
+       Packages::Compress ". gzip bzip2 lzma xz";
+       Sources::Compress ". gzip bzip2 lzma xz";
+       Contents::Compress ". gzip bzip2 lzma xz";
 };
 TreeDefault {
        Directory "pool/";
@@ -329,6 +332,7 @@ buildaptarchivefromfiles() {
                cat Packages | gzip > Packages.gz
                cat Packages | bzip2 > Packages.bz2
                cat Packages | lzma > Packages.lzma
+               cat Packages | xz > Packages.xz
                msgdone "info"
        fi
        if [ -f Sources ]; then
@@ -336,6 +340,7 @@ buildaptarchivefromfiles() {
                cat Sources | gzip > Sources.gz
                cat Sources | bzip2 > Sources.bz2
                cat Sources | lzma > Sources.lzma
+               cat Sources | xz > Sources.xz
                msgdone "info"
        fi
        msgninfo "\tRelease fileā€¦ "
@@ -499,3 +504,27 @@ testnopackage() {
        fi
        msgpass
 }
+
+testdpkginstalled() {
+       msgtest "Test for correctly installed package(s) with" "dpkg -l $*"
+       local PKGS="$(dpkg -l $* | grep '^[a-z]' | grep '^[^i]' | wc -l)"
+       if [ "$PKGS" != 0 ]; then
+               echo $PKGS
+               dpkg -l $* | grep '^[a-z]'
+               msgfail
+               return 1
+       fi
+       msgpass
+}
+
+testdpkgnoninstalled() {
+       msgtest "Test for correctly non-installed package(s) with" "dpkg -l $*"
+       local PKGS="$(dpkg -l $* | grep '^[a-z]' | grep '^[^u]' | wc -l)"
+       if [ "$PKGS" != 0 ]; then
+               echo
+               dpkg -l $* | grep '^[a-z]'
+               msgfail
+               return 1
+       fi
+       msgpass
+}