]>
Commit | Line | Data |
---|---|---|
adf379e7 MV |
1 | #!/bin/sh |
2 | set -e | |
3 | ||
3abb6a6a DK |
4 | TESTDIR="$(readlink -f "$(dirname "$0")")" |
5 | . "$TESTDIR/framework" | |
adf379e7 MV |
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 | ||
d603afd9 | 29 | HEADER='Reading package lists...' |
9d2a8a73 | 30 | DOWNLOAD10="Need to get 0 B/25 B of source archives. |
55ae7a51 MV |
31 | 'file://${APTARCHIVE}/foo_1.0.dsc' foo_1.0.dsc 11 SHA256:ed7c25c832596339bee13e4e7c45cf49f869b60d2bf57252f18191d75866c2a7 |
32 | 'file://${APTARCHIVE}/foo_1.0.tar.gz' foo_1.0.tar.gz 14 SHA256:f3da8c6ebc62c8ef2dae439a498dddcdacc1a07f45ff67ad12f44b6e2353c239" | |
adf379e7 MV |
33 | |
34 | # pick :amd64 | |
25b86db1 | 35 | testsuccessequal "$HEADER |
9d2a8a73 | 36 | $DOWNLOAD10" aptget source -q --print-uris foo:amd64 |
adf379e7 MV |
37 | |
38 | # pick :i386 | |
25b86db1 | 39 | testsuccessequal "$HEADER |
9d2a8a73 | 40 | Need to get 0 B/25 B of source archives. |
55ae7a51 MV |
41 | 'file://${APTARCHIVE}/foo_2.0.dsc' foo_2.0.dsc 11 SHA256:0fcb803ffbeef26db884625aaf06e75f3eda5c994634980e7c20fd37ed1fc104 |
42 | 'file://${APTARCHIVE}/foo_2.0.tar.gz' foo_2.0.tar.gz 14 SHA256:ca9b0b828ca22372502af2b80f61f0bd9063910ece9fc34eeaf9d9e31aa8195a" aptget source -q --print-uris foo:i386 | |
adf379e7 MV |
43 | |
44 | # pick :i386 by release | |
25b86db1 | 45 | testsuccessequal "$HEADER |
adf379e7 | 46 | Selected version '0.1' (oldstable) for foo |
9d2a8a73 | 47 | Need to get 0 B/25 B of source archives. |
55ae7a51 MV |
48 | 'file://${APTARCHIVE}/foo_0.1.dsc' foo_0.1.dsc 11 SHA256:72af24b0290fe1d13a3e25fddd2633e43c87ff79d249bc850009e47bcce73565 |
49 | 'file://${APTARCHIVE}/foo_0.1.tar.gz' foo_0.1.tar.gz 14 SHA256:ec748ad88a71f98bfdc012e1a7632377d05fe3ebbf9c0922e0691fe4d79c0585" aptget source -q --print-uris foo:i386/oldstable | |
adf379e7 MV |
50 | |
51 | # pick :i386 by version | |
25b86db1 | 52 | testsuccessequal "$HEADER |
9d2a8a73 | 53 | $DOWNLOAD10" aptget source -q --print-uris foo:i386=1.0 |
adf379e7 MV |
54 | |
55 | # error on unknown arch | |
25b86db1 | 56 | testfailureequal "$HEADER |
adf379e7 MV |
57 | E: Can not find a package for architecture 'not-a-available-arch' |
58 | 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 |
59 | |
60 | # error on unavailable version for arch | |
25b86db1 | 61 | testfailureequal "$HEADER |
c9829e07 | 62 | E: Can not find a package 'foo:amd64' with version '2.0' |
37f45a57 MV |
63 | E: Unable to find a source package for foo:amd64=2.0" aptget source -q --print-uris foo:amd64=2.0 |
64 | ||
25b86db1 DK |
65 | # error on unavailable release for arch |
66 | testfailureequal "$HEADER | |
c9829e07 | 67 | E: Can not find a package 'foo:amd64' with release 'oldstable' |
37f45a57 | 68 | E: Unable to find a source package for foo:amd64/oldstable" aptget source -q --print-uris foo:amd64/oldstable |