]> git.saurik.com Git - apt.git/blame_incremental - test/integration/test-ubuntu-bug-1078697-missing-source-hashes
report warnings&errors consistently in edit-sources
[apt.git] / test / integration / test-ubuntu-bug-1078697-missing-source-hashes
... / ...
CommitLineData
1#!/bin/sh
2set -e
3
4TESTDIR="$(readlink -f "$(dirname "$0")")"
5. "$TESTDIR/framework"
6setupenvironment
7configarchitecture "i386"
8confighashes 'MD5' 'SHA1' 'SHA256' 'SHA512'
9
10msgtest 'Test apt-ftparchive source with missing hashes in .dsc'
11
12touch aptarchive/foo_1.0.tar.gz
13cat > aptarchive/foo_1.0.dsc << EOF
14Format: 3.0 (native)
15Source: foo
16Binary: foo
17Architecture: all
18Version: 1.0
19Package-List:
20 foo deb admin extra
21Files:
22 d41d8cd98f00b204e9800998ecf8427e 0 foo_1.0.tar.gz
23EOF
24
25# check for the SHA hashes
26testsuccess aptftparchive sources aptarchive/
27cp rootdir/tmp/testsuccess.output aptarchive/Sources
28testsuccess grep Checksums-Sha512 aptarchive/Sources
29
30for hash in sha512sum sha256sum sha1sum; do
31 for f in foo_1.0.tar.gz foo_1.0.dsc; do
32 SUM=$($hash aptarchive/$f | cut -d' ' -f1)
33 NEEDLE="$SUM $(stat -c%s aptarchive/$f) $f"
34 testsuccess test -n "$SUM"
35 msgtest "Test $hash hash matches for $f"
36 testsuccess --nomsg grep "$NEEDLE" aptarchive/Sources
37 done
38done