]>
Commit | Line | Data |
---|---|---|
adf379e7 MV |
1 | #!/bin/sh |
2 | set -e | |
3 | ||
4 | TESTDIR=$(readlink -f $(dirname $0)) | |
5 | . $TESTDIR/framework | |
6 | ||
7 | setupenvironment | |
8 | configarchitecture "i386" "amd64" | |
9 | ||
10 | ||
11 | # different version for the individual arches | |
12 | insertpackage 'stable' 'foo' 'amd64' '1.0' | |
13 | insertsource 'stable' 'foo' 'amd64' '1.0' | |
14 | ||
15 | insertpackage 'stable' 'foo' 'i386' '1.0' | |
16 | insertsource 'stable' 'foo' 'i386' '1.0' | |
17 | insertpackage 'stable' 'foo' 'i386' '2.0' | |
18 | insertsource 'stable' 'foo' 'i386' '2.0' | |
19 | ||
20 | insertpackage 'oldstable' 'foo' 'i386' '0.1' | |
21 | insertsource 'oldstable' 'foo' 'i386' '0.1' | |
22 | # just needed so that there is a release file entry for the test | |
23 | insertpackage 'oldstable' 'unreleated' 'amd64' '0.1' | |
24 | ||
25 | setupaptarchive | |
26 | ||
27 | APTARCHIVE=$(readlink -f ./aptarchive) | |
28 | ||
29 | HEADER="Reading package lists... | |
30 | Building dependency tree..." | |
31 | ||
32 | # pick :amd64 | |
25b86db1 | 33 | testsuccessequal "$HEADER |
adf379e7 MV |
34 | Need to get 0 B of source archives. |
35 | 'file://${APTARCHIVE}/foo_1.0.dsc' foo_1.0.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e | |
36 | 'file://${APTARCHIVE}/foo_1.0.tar.gz' foo_1.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo:amd64 | |
37 | ||
38 | # pick :i386 | |
25b86db1 | 39 | testsuccessequal "$HEADER |
adf379e7 MV |
40 | Need to get 0 B of source archives. |
41 | 'file://${APTARCHIVE}/foo_2.0.dsc' foo_2.0.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e | |
42 | 'file://${APTARCHIVE}/foo_2.0.tar.gz' foo_2.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo:i386 | |
43 | ||
44 | # pick :i386 by release | |
25b86db1 | 45 | testsuccessequal "$HEADER |
adf379e7 MV |
46 | Selected version '0.1' (oldstable) for foo |
47 | Need to get 0 B of source archives. | |
48 | 'file://${APTARCHIVE}/foo_0.1.dsc' foo_0.1.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e | |
49 | 'file://${APTARCHIVE}/foo_0.1.tar.gz' foo_0.1.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo:i386/oldstable | |
50 | ||
51 | # pick :i386 by version | |
25b86db1 | 52 | testsuccessequal "$HEADER |
adf379e7 MV |
53 | Need to get 0 B of source archives. |
54 | 'file://${APTARCHIVE}/foo_1.0.dsc' foo_1.0.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e | |
55 | 'file://${APTARCHIVE}/foo_1.0.tar.gz' foo_1.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo:i386=1.0 | |
56 | ||
57 | # error on unknown arch | |
25b86db1 | 58 | testfailureequal "$HEADER |
adf379e7 MV |
59 | E: Can not find a package for architecture 'not-a-available-arch' |
60 | E: Unable to find a source package for foo:not-a-available-arch" aptget source -q --print-uris foo:not-a-available-arch | |
37f45a57 MV |
61 | |
62 | # error on unavailable version for arch | |
25b86db1 | 63 | testfailureequal "$HEADER |
c9829e07 | 64 | E: Can not find a package 'foo:amd64' with version '2.0' |
37f45a57 MV |
65 | E: Unable to find a source package for foo:amd64=2.0" aptget source -q --print-uris foo:amd64=2.0 |
66 | ||
25b86db1 DK |
67 | # error on unavailable release for arch |
68 | testfailureequal "$HEADER | |
c9829e07 | 69 | E: Can not find a package 'foo:amd64' with release 'oldstable' |
37f45a57 | 70 | E: Unable to find a source package for foo:amd64/oldstable" aptget source -q --print-uris foo:amd64/oldstable |