]>
Commit | Line | Data |
---|---|---|
a3bbbab7 DK |
1 | #!/bin/sh |
2 | set -e | |
3 | ||
4 | TESTDIR=$(readlink -f $(dirname $0)) | |
5 | . $TESTDIR/framework | |
6 | setupenvironment | |
7 | configarchitecture 'i386' | |
8 | ||
9 | insertpackage 'unstable' 'cool' 'all' '1.0-1' | |
10 | ||
11 | getcodenamefromsuite() { | |
12 | if [ "$SUITE" = 'unstable' ]; then | |
13 | echo -n 'sid' | |
14 | else | |
15 | echo -n "$SUITE" | |
16 | fi | |
17 | } | |
18 | getreleaseversionfromsuite() { | |
19 | if [ "$SUITE" = 'unstable' ]; then | |
20 | echo -n '42.0' | |
21 | else | |
22 | echo -n '0.8.15' | |
23 | fi | |
24 | } | |
25 | ||
061c58b6 DK |
26 | getlabelfromsuite() { |
27 | if [ "$SUITE" = 'unstable' ]; then | |
28 | echo -n 'UnstableTestcases' | |
29 | else | |
30 | echo -n 'Testcases' | |
31 | fi | |
32 | } | |
33 | ||
a3bbbab7 DK |
34 | setupaptarchive |
35 | ||
36 | passdist() { | |
061c58b6 | 37 | msgtest 'Test that target-release is accepted' $1 |
0440d936 | 38 | testsuccess --nomsg aptget dist-upgrade -t $1 |
061c58b6 DK |
39 | msgtest 'Test that target-release pins with' $1 |
40 | aptcache policy -t $1 | grep -q ' 990' && msgpass || msgfail | |
a3bbbab7 DK |
41 | } |
42 | ||
43 | faildist() { | |
061c58b6 | 44 | msgtest 'Test that target-release is refused' $1 |
0440d936 | 45 | testfailure --nomsg aptget dist-upgrade -t $1 |
a3bbbab7 DK |
46 | } |
47 | ||
061c58b6 DK |
48 | msgtest 'Test that no default-release is active in this test' 'setup' |
49 | aptcache policy | grep -q ' 990' && msgfall || msgpass | |
50 | ||
a3bbbab7 DK |
51 | passdist unstable |
52 | passdist sid | |
53 | faildist sidd | |
54 | faildist stable | |
55 | passdist 42.0 | |
56 | passdist 42.* | |
57 | passdist 42* | |
58 | passdist 4*.0 | |
59 | faildist 21.0 | |
60 | faildist 21* | |
061c58b6 DK |
61 | # we accept, but don't validate the following |
62 | passdist a=unstable | |
63 | passdist n=sid | |
64 | passdist v=42.0 | |
65 | passdist c=main | |
66 | passdist l=UnstableTestcases |