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