]> git.saurik.com Git - apt.git/blobdiff - test/integration/test-pdiff-usage
add a testcase for support of various build-dependency types
[apt.git] / test / integration / test-pdiff-usage
index 91528389b967666a3a386c3b53e136a7af2d5027..59a3fd8afffb4e7dbf641b7bbe2c353dadcbccda 100755 (executable)
@@ -35,6 +35,7 @@ wasmergeused() {
        fi
 
        testsuccess apt update "$@"
        fi
 
        testsuccess apt update "$@"
+       #apt update "$@" 2>&1 | tee rootdir/tmp/testsuccess.output
 
        msgtest 'No intermediate patch files' 'still exist'
        local EDS="$(find rootdir/var/lib/apt/lists -name '*.ed' -o -name '*.ed.*')"
 
        msgtest 'No intermediate patch files' 'still exist'
        local EDS="$(find rootdir/var/lib/apt/lists -name '*.ed' -o -name '*.ed.*')"
@@ -116,6 +117,34 @@ SHA256-Download:
        testsuccessequal "$(cat "${PKGFILE}-new")
 " aptcache show apt newstuff
 
        testsuccessequal "$(cat "${PKGFILE}-new")
 " aptcache show apt newstuff
 
+       msgmsg "Testcase: apply with compressed Index and one patch: $*"
+       cp "${PKGFILE}-new" aptarchive/Packages
+       compressfile 'aptarchive/Packages'
+       cat "$PATCHINDEX" | gzip > "${PATCHINDEX}.gz"
+       generatereleasefiles '+1hour'
+       signreleasefiles
+       find aptarchive -name 'Packages*' -type f -delete
+       rm "$PATCHINDEX"
+       rm -rf rootdir/var/lib/apt/lists
+       cp -a rootdir/var/lib/apt/lists-bak rootdir/var/lib/apt/lists
+       wasmergeused "$@"
+       testnopackage oldstuff
+       testsuccessequal "$(cat "${PKGFILE}-new")
+" aptcache show apt newstuff
+
+       msgmsg "Testcase: apply with by-hash compressed Index and one patch: $*"
+       local NORMAL="$(readlink -f "./aptarchive/Packages.diff")"
+       local BYHASH="${NORMAL}/by-hash/SHA256"
+       mkdir -p "${BYHASH}"
+       find "${NORMAL}/" -maxdepth 1 -name "Index*" -exec mv '{}' "$BYHASH" \;
+       ln -s "${BYHASH}/Index.gz" "${BYHASH}/$(sha256sum "${BYHASH}/Index.gz" | cut -f1 -d' ')"
+       rm -rf rootdir/var/lib/apt/lists
+       cp -a rootdir/var/lib/apt/lists-bak rootdir/var/lib/apt/lists
+       wasmergeused "$@" -o Acquire::By-Hash=force
+       testnopackage oldstuff
+       testsuccessequal "$(cat "${PKGFILE}-new")
+" aptcache show apt newstuff
+
        msgmsg "Testcase: SHA1-only patches are not used: $*"
        find aptarchive -name 'Packages*' -type f -delete
        cp "${PKGFILE}-new" aptarchive/Packages
        msgmsg "Testcase: SHA1-only patches are not used: $*"
        find aptarchive -name 'Packages*' -type f -delete
        cp "${PKGFILE}-new" aptarchive/Packages
@@ -317,7 +346,7 @@ Debug::Acquire::Transaction "true";
 Debug::pkgAcquire::Worker "true";
 Debug::Acquire::http "true";
 Debug::pkgAcquire "true";
 Debug::pkgAcquire::Worker "true";
 Debug::Acquire::http "true";
 Debug::pkgAcquire "true";
-Debug::pkgAcquire::rred "true";' > rootdir/etc/apt/apt.conf.d/rreddebug.conf
+Debug::Acquire::rred "true";' > rootdir/etc/apt/apt.conf.d/rreddebug.conf
 
 testcase() {
        testrun -o Acquire::PDiffs::Merge=0 -o APT::Get::List-Cleanup=1 "$@"
 
 testcase() {
        testrun -o Acquire::PDiffs::Merge=0 -o APT::Get::List-Cleanup=1 "$@"