]>
git.saurik.com Git - apt.git/blob - test/integration/test-debsrc-hashes
4 TESTDIR
=$(readlink -f $(dirname $0))
8 configarchitecture
"i386"
10 # pkg-sha256-bad has a bad SHA sum, but good MD5 sum. If apt is
11 # checking the best available hash (as it should), this will trigger
14 cat > aptarchive
/Sources
<<EOF
18 Maintainer: Joe Sixpack <joe@example.org>
21 d41d8cd98f00b204e9800998ecf8427e 0 pkg-md5-ok_1.0.dsc
22 d41d8cd98f00b204e9800998ecf8427e 0 pkg-md5-ok_1.0.tar.gz
24 Package: pkg-sha256-ok
27 Maintainer: Joe Sixpack <joe@example.org>
30 d41d8cd98f00b204e9800998ecf8427e 0 pkg-sha256-ok_1.0.dsc
31 d41d8cd98f00b204e9800998ecf8427e 0 pkg-sha256-ok_1.0.tar.gz
33 da39a3ee5e6b4b0d3255bfef95601890afd80709 0 pkg-sha256-ok_1.0.dsc
34 da39a3ee5e6b4b0d3255bfef95601890afd80709 0 pkg-sha256-ok_1.0.tar.gz
36 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 pkg-sha256-ok_1.0.dsc
37 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 pkg-sha256-ok_1.0.tar.gz
39 Package: pkg-sha256-bad
40 Binary: pkg-sha256-bad
42 Maintainer: Joe Sixpack <joe@example.org>
45 d41d8cd98f00b204e9800998ecf8427e 0 pkg-sha256-bad_1.0.dsc
46 d41d8cd98f00b204e9800998ecf8427e 0 pkg-sha256-bad_1.0.tar.gz
48 da39a3ee5e6b4b0d3255bfef95601890afd80709 0 pkg-sha256-bad_1.0.dsc
49 da39a3ee5e6b4b0d3255bfef95601890afd80709 0 pkg-sha256-bad_1.0.tar.gz
51 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 0 pkg-sha256-bad_1.0.dsc
52 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 0 pkg-sha256-bad_1.0.tar.gz
55 # create fetchable files
56 for x
in "pkg-md5-ok" "pkg-sha256-ok" "pkg-sha256-bad"; do
57 touch aptarchive
/${x}_1.0.dsc
58 touch aptarchive
/${x}_1.0.
tar.gz
62 msgtest
"Test for hash ok of" "$*"
63 $
* 2>&1 | grep "Download complete" > /dev
/null
&& msgpass
|| msgfail
67 msgtest
"Test for hash mismatch of" "$*"
68 $
* 2>&1 | grep "Hash Sum mismatch" > /dev
/null
&& msgpass
|| msgfail
75 testok aptget
source -d pkg
-md5-ok
76 testok aptget
source -d pkg
-sha256-ok
77 testmismatch aptget
source -d pkg
-sha256-bad