]> git.saurik.com Git - apt.git/blame - test/integration/test-ubuntu-bug-1078697-missing-source-hashes
ensure filesize of deb is included in the hashes list
[apt.git] / test / integration / test-ubuntu-bug-1078697-missing-source-hashes
CommitLineData
0f2def05
MV
1#!/bin/sh
2set -e
3
3abb6a6a
DK
4TESTDIR="$(readlink -f "$(dirname "$0")")"
5. "$TESTDIR/framework"
0f2def05
MV
6setupenvironment
7configarchitecture "i386"
c5ede4ca 8confighashes 'MD5' 'SHA1' 'SHA256' 'SHA512'
0f2def05
MV
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
c5ede4ca
DK
26testsuccess aptftparchive sources aptarchive/
27cp rootdir/tmp/testsuccess.output aptarchive/Sources
28testsuccess grep Checksums-Sha512 aptarchive/Sources
0f2def05
MV
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)
0f2def05 33 NEEDLE="$SUM $(stat -c%s aptarchive/$f) $f"
c5ede4ca
DK
34 testsuccess test -n "$SUM"
35 msgtest "Test $hash hash matches for $f"
36 testsuccess --nomsg grep "$NEEDLE" aptarchive/Sources
0f2def05
MV
37 done
38done