summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2016-08-16 07:47:44 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2016-08-17 07:55:46 +0200
commit77e274f5ad23d79294f28ecc9868fc6f534214a4 (patch)
tree508ee0bdc4c43fd7bf9d86f1f31e0a864fc5ea98 /test
parenta99bb943e97883af6f063af9eb14e20b7a7320fc (diff)
support compression and by-hash for .diff/Index files
In af81ab9030229b4ce6cbe28f0f0831d4896fda01 by-hash got implemented as a special compression type for our usual index files like Packages. Missing in this scheme was the special .diff/Index index file containing the info about individual patches for this index file. Deriving from the index file class directly we inherent the compression handling infrastructure and in this way also by-hash nearly for free. Closes: #824926
Diffstat (limited to 'test')
-rwxr-xr-xtest/integration/test-pdiff-usage29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/integration/test-pdiff-usage b/test/integration/test-pdiff-usage
index 39d847203..59a3fd8af 100755
--- a/test/integration/test-pdiff-usage
+++ b/test/integration/test-pdiff-usage
@@ -35,6 +35,7 @@ wasmergeused() {
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.*')"
@@ -116,6 +117,34 @@ SHA256-Download:
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