]>
Commit | Line | Data |
---|---|---|
0f2def05 MV |
1 | #!/bin/sh |
2 | set -e | |
3 | ||
3abb6a6a DK |
4 | TESTDIR="$(readlink -f "$(dirname "$0")")" |
5 | . "$TESTDIR/framework" | |
0f2def05 MV |
6 | setupenvironment |
7 | configarchitecture "i386" | |
c5ede4ca | 8 | confighashes 'MD5' 'SHA1' 'SHA256' 'SHA512' |
0f2def05 MV |
9 | |
10 | msgtest 'Test apt-ftparchive source with missing hashes in .dsc' | |
11 | ||
12 | touch aptarchive/foo_1.0.tar.gz | |
13 | cat > aptarchive/foo_1.0.dsc << EOF | |
14 | Format: 3.0 (native) | |
15 | Source: foo | |
16 | Binary: foo | |
17 | Architecture: all | |
18 | Version: 1.0 | |
19 | Package-List: | |
20 | foo deb admin extra | |
21 | Files: | |
22 | d41d8cd98f00b204e9800998ecf8427e 0 foo_1.0.tar.gz | |
23 | EOF | |
24 | ||
25 | # check for the SHA hashes | |
c5ede4ca DK |
26 | testsuccess aptftparchive sources aptarchive/ |
27 | cp rootdir/tmp/testsuccess.output aptarchive/Sources | |
28 | testsuccess grep Checksums-Sha512 aptarchive/Sources | |
0f2def05 MV |
29 | |
30 | for 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 |
38 | done |