diff options
Diffstat (limited to 'test/integration/test-apt-by-hash-update')
-rwxr-xr-x | test/integration/test-apt-by-hash-update | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/integration/test-apt-by-hash-update b/test/integration/test-apt-by-hash-update index 9701f97f9..f4794a84f 100755 --- a/test/integration/test-apt-by-hash-update +++ b/test/integration/test-apt-by-hash-update @@ -77,3 +77,31 @@ ensureitsbroken -o Acquire::By-Hash=0 sed -i "s#^\(deb\(-src\)\?\) \[by-hash=yes\] #\1 [by-hash=force] #" rootdir/etc/apt/sources.list.d/* ensureitworks #ensureitsbroken -o Acquire::By-Hash=0 + + + +msgmsg 'Test InRelease by-hash via' 'sources option' + +rm -rf aptarchive/dists +cp -a aptarchive/dists.bak aptarchive/dists +mkdir -p aptarchive/dists/unstable/by-hash/SHA256 +inrelease_hash=$(sha256sum aptarchive/dists/unstable/InRelease | awk '{print $1}') +mv aptarchive/dists/unstable/InRelease aptarchive/dists/unstable/by-hash/SHA256/$inrelease_hash +#ensureitworks -o Acquire::By-Hash=force +ensureitsbroken -o Acquire::By-Hash=1 +ensureitsbroken -o Acquire::By-Hash=0 + +sed -i "s#^\(deb\(-src\)\?\) \[by-hash=force\] #\1 [by-hash=force inrelease-path=by-hash/SHA256/$inrelease_hash] #" rootdir/etc/apt/sources.list.d/* +ensureitworks +#ensureitsbroken -o Acquire::By-Hash=0 + +msgmsg 'Test InRelease by-hash with' 'no fallback' + +rm -rf aptarchive/dists +cp -a aptarchive/dists.bak aptarchive/dists + +testfailureequal "Get:1 file:${TMPWORKINGDIRECTORY}/aptarchive unstable InRelease +Err:1 file:${TMPWORKINGDIRECTORY}/aptarchive unstable InRelease + File not found - ${TMPWORKINGDIRECTORY}/aptarchive/dists/unstable/by-hash/SHA256/${inrelease_hash} (2: No such file or directory) +Reading package lists... +E: Failed to fetch file://${TMPWORKINGDIRECTORY}/aptarchive/dists/unstable/InRelease File not found - ${TMPWORKINGDIRECTORY}/aptarchive/dists/unstable/by-hash/SHA256/${inrelease_hash} (2: No such file or directory)" aptget update |