]> git.saurik.com Git - apt.git/blob - test/integration/test-ubuntu-bug-1078697-missing-source-hashes
tests: activate dpkg multi-arch even if test is single arch
[apt.git] / test / integration / test-ubuntu-bug-1078697-missing-source-hashes
1 #!/bin/sh
2 set -e
3
4 TESTDIR="$(readlink -f "$(dirname "$0")")"
5 . "$TESTDIR/framework"
6 setupenvironment
7 configarchitecture "i386"
8 confighashes 'MD5' 'SHA1' 'SHA256' 'SHA512'
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
26 testsuccess aptftparchive sources aptarchive/
27 cp rootdir/tmp/testsuccess.output aptarchive/Sources
28 testsuccess grep Checksums-Sha512 aptarchive/Sources
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)
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
38 done