]> git.saurik.com Git - apt.git/blame - test/integration/test-apt-update-weak-hashes
Fix crash with empty architecture list
[apt.git] / test / integration / test-apt-update-weak-hashes
CommitLineData
bd4a8f51
DK
1#!/bin/sh
2set -e
3
4TESTDIR="$(readlink -f "$(dirname "$0")")"
5. "$TESTDIR/framework"
6
7setupenvironment
8configarchitecture 'i386'
9confighashes 'MD5'
10
11insertpackage 'unstable' 'foo' 'i386' '1.0'
12insertsource 'unstable' 'foo' 'any' '1.0'
13
14setupaptarchive --no-update
15APTARCHIVE="$(readlink -f ./aptarchive)"
16
17msgmsg 'Release contains only weak hashes'
18FILENAME="${APTARCHIVE}/dists/unstable/InRelease"
19MANGLED="$(readlink -f ./rootdir)/var/lib/apt/lists/partial/$(echo "$FILENAME" | sed 's#/#_#g')"
20testfailuremsg "W: Failed to fetch file:${FILENAME} No Hash entry in Release file ${MANGLED}, which is considered strong enough for security purposes
21E: Some index files failed to download. They have been ignored, or old ones used instead." apt update
22testnopackage foo
23testnosrcpackage foo
24
25msgmsg 'Release contains no hashes'
26sed -i -e '/^ / d' -e '/^MD5Sum:/ d' "$APTARCHIVE/dists/unstable/Release"
27signreleasefiles
28testfailuremsg "W: Failed to fetch file:${FILENAME} No Hash entry in Release file ${MANGLED}
29E: Some index files failed to download. They have been ignored, or old ones used instead." apt update
30testnopackage foo
31testnosrcpackage foo
32
33msgmsg 'Release contains only weak hashes for some files'
34confighashes 'MD5' 'SHA256'
35generatereleasefiles
36sed -i '/^ [0-9a-fA-Z]\{64\} .*Sources$/d' "$APTARCHIVE/dists/unstable/Release"
37signreleasefiles
38testwarningmsg "W: Skipping acquire of configured file 'main/source/Sources' as repository 'file:${APTARCHIVE} unstable InRelease' provides only weak security information for it" apt update
39testsuccess apt show foo
40testnosrcpackage foo