use 'best' hash for source authentication
[ntk/apt.git] / test / integration / test-apt-get-build-dep
CommitLineData
feab34c5
MV
1#!/bin/sh
2set -e
3
4TESTDIR=$(readlink -f $(dirname $0))
5. $TESTDIR/framework
6
7setupenvironment
8configarchitecture "i386"
9
10buildsimplenativepackage 'debhelper' 'i386' '7' 'stable'
11buildsimplenativepackage 'build-essential' 'i386' '1' 'stable'
12
13setupaptarchive
14cat > 2vcard_0.5-3.dsc <<EOF
15Format: 1.0
16Source: 2vcard
17Binary: 2vcard
18Architecture: all
19Version: 0.5-3
20Maintainer: Martin Albisetti <argentina@gmail.com>
21Uploaders: Marcela Tiznado <mlt@debian.org>
22Standards-Version: 3.8.0
23Build-Depends: debhelper (>= 5.0.37)
24Checksums-Sha1:
25 b7f1ce31ec856414a3f0f1090689f91aa7456d56 9398 2vcard_0.5.orig.tar.gz
26 5f9acd07ebda6ab00fa6b4fe3198c13e94090862 2036 2vcard_0.5-3.diff.gz
27Checksums-Sha256:
28 efdc22859ac2f8f030d038dc4faa9020082ebae34212498c288968ffd45c9764 9398 2vcard_0.5.orig.tar.gz
29 82673ff3456af571094066c89bcea87b25c23c87cf1d0050b731e5222563626b 2036 2vcard_0.5-3.diff.gz
30Files:
31 f73a69c170f772f3f6e75f2d11bbb792 9398 2vcard_0.5.orig.tar.gz
32 1e806d32233af87437258d86b1561f57 2036 2vcard_0.5-3.diff.gz
33EOF
34
35testequal "Reading package lists...
36Building dependency tree...
37The following NEW packages will be installed:
38 build-essential debhelper
390 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
40Inst build-essential (1 stable [i386])
41Inst debhelper (7 stable [i386])
42Conf build-essential (1 stable [i386])
43Conf debhelper (7 stable [i386])" aptget build-dep -s 2vcard_0.5-3.dsc
44
45cat > 2vcard_0.5-3.dsc <<EOF
46-----BEGIN PGP SIGNED MESSAGE-----
47Hash: SHA1
48
49Format: 1.0
50Source: 2vcard
51Binary: 2vcard
52Architecture: all
53Version: 0.5-3
54Maintainer: Martin Albisetti <argentina@gmail.com>
55Uploaders: Marcela Tiznado <mlt@debian.org>
56Standards-Version: 3.8.0
57Build-Depends: debhelper (>= 5.0.37)
58Checksums-Sha1:
59 b7f1ce31ec856414a3f0f1090689f91aa7456d56 9398 2vcard_0.5.orig.tar.gz
60 5f9acd07ebda6ab00fa6b4fe3198c13e94090862 2036 2vcard_0.5-3.diff.gz
61Checksums-Sha256:
62 efdc22859ac2f8f030d038dc4faa9020082ebae34212498c288968ffd45c9764 9398 2vcard_0.5.orig.tar.gz
63 82673ff3456af571094066c89bcea87b25c23c87cf1d0050b731e5222563626b 2036 2vcard_0.5-3.diff.gz
64Files:
65 f73a69c170f772f3f6e75f2d11bbb792 9398 2vcard_0.5.orig.tar.gz
66 1e806d32233af87437258d86b1561f57 2036 2vcard_0.5-3.diff.gz
67
68-----BEGIN PGP SIGNATURE-----
69Version: GnuPG v1.4.9 (GNU/Linux)
70
71iEYEARECAAYFAkijKhsACgkQsrBfRdYmq7aA2gCfaOW9riTYVQMx5ajKQVAcctlC
72z2UAn1oXgTai6opwhVfkxrlmJ+iRxzuc
73=4eRd
74-----END PGP SIGNATURE-----
75EOF
76
77testequal "Reading package lists...
78Building dependency tree...
79The following NEW packages will be installed:
80 build-essential debhelper
810 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
82Inst build-essential (1 stable [i386])
83Inst debhelper (7 stable [i386])
84Conf build-essential (1 stable [i386])
85Conf debhelper (7 stable [i386])" aptget build-dep --simulate 2vcard_0.5-3.dsc
77da39b9
MV
86
87
88# unpacked source dir
89mkdir -p foo-1.0/debian
90cat > foo-1.0/debian/control <<'EOF'
91Source: apturl
92Section: admin
93Priority: optional
94Maintainer: Michael Vogt <mvo@ubuntu.com>
95Build-Depends: debhelper (>= 7)
96X-Python3-Version: >= 3.2
97Standards-Version: 3.9.3
98
99Package: apturl-common
100Architecture: any
101Depends: ${python3:Depends},
102 ${shlibs:Depends},
103 ${misc:Depends},
104 python3-apt,
105 python3-update-manager
106Replaces: apturl (<< 0.3.6ubuntu2)
107Description: install packages using the apt protocol - common data
108 AptUrl is a simple graphical application that takes an URL (which follows the
109 apt-protocol) as a command line option, parses it and carries out the
110 operations that the URL describes (that is, it asks the user if he wants the
111 indicated packages to be installed and if the answer is positive does so for
112 him).
113 .
114 This package contains the common data shared between the frontends.
115
116EOF
117
118testequal "Reading package lists...
119Building dependency tree...
120The following NEW packages will be installed:
121 build-essential debhelper
1220 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
123Inst build-essential (1 stable [i386])
124Inst debhelper (7 stable [i386])
125Conf build-essential (1 stable [i386])
126Conf debhelper (7 stable [i386])" aptget build-dep --simulate ./foo-1.0