blob: 5669e47b344a8b8d730f5b85079766dc1d2e9a29 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
#!/bin/sh
set -e
TESTDIR="$(readlink -f "$(dirname "$0")")"
. "$TESTDIR/framework"
setupenvironment
configarchitecture 'amd64'
insertpackage 'unstable' 'okay' 'all' '1'
insertpackage 'unstable' 'upgrade' 'all' '2'
insertpackage 'unstable' 'unneeded' 'all' '1'
insertpackage 'unstable' 'later' 'all' '1'
insertpackage 'unstable' 'bad-level0' 'all' '1' 'Depends: unneeded, unknown'
insertpackage 'unstable' 'bad-level1' 'all' '1' 'Depends: bad-level0'
insertpackage 'unstable' 'bad-upgrade-level0' 'all' '2' 'Depends: unneeded, unknown'
insertpackage 'unstable' 'bad-upgrade-level1' 'all' '2' 'Depends: bad-upgrade-level0 (>= 2)'
insertpackage 'unstable' 'bad-conflict-level0' 'all' '1' 'Depends: unneeded
Conflicts: bad-conflict-level2'
insertpackage 'unstable' 'bad-conflict-level1' 'all' '1' 'Depends: bad-conflict-level0'
insertpackage 'unstable' 'bad-conflict-level2' 'all' '1' 'Depends: bad-conflict-level1'
insertinstalledpackage 'upgrade' 'all' '1'
insertinstalledpackage 'bad-upgrade' 'all' '1'
insertinstalledpackage 'bad-upgrade-level0' 'all' '1'
insertinstalledpackage 'bad-upgrade-level1' 'all' '1'
insertfoos() {
insertpackage 'unstable' "foo-${1}-level0" 'all' '1' "${2}: unknown | unknown | okay | later"
insertpackage 'unstable' "foo-${1}-level1" 'all' '1' "${2}: bad-level0 | bad-level0 | okay | later"
insertpackage 'unstable' "foo-${1}-level2" 'all' '1' "${2}: bad-level1 | bad-level1 | okay | later"
insertpackage 'unstable' "foo-${1}-upgrade-level0" 'all' '1' "${2}: bad-upgrade (>= 2) | okay | upgrade (>= 2) | later"
insertpackage 'unstable' "foo-${1}-upgrade-level1" 'all' '1' "${2}: bad-upgrade-level0 (>= 2) | bad-upgrade-level0 (>= 2) | bad-level0 | okay | upgrade (>= 2) | later"
insertpackage 'unstable' "foo-${1}-upgrade-level2" 'all' '1' "${2}: bad-upgrade-level1 (>= 2) | bad-upgrade-level1 (>= 2) | bad-level1 | okay | upgrade (>= 2) | later"
insertpackage 'unstable' "foo-${1}-conflict" 'all' '1' "${2}: unknown | bad-conflict-level2 | okay | later"
}
insertfoos 'd' 'Depends'
insertfoos 'r' 'Recommends'
setupaptarchive
testsuccessheadequal() {
msggroup 'testsuccessheadequal'
local HEADLINES="$1"
local CMP="$2"
shift 2
testsuccesswithglobalerror 'testsuccess' 'EW' "$@"
cp "${TMPWORKINGDIRECTORY}/rootdir/tmp/testsuccess.output" "${TMPWORKINGDIRECTORY}/rootdir/tmp/testsuccessheadequal.output"
testsuccessequal "$CMP" head -n "$HEADLINES" "${TMPWORKINGDIRECTORY}/rootdir/tmp/testsuccessheadequal.output"
msggroup
}
checkfoos() {
msgmsg 'Install checks with foos dependency type' "$2"
for level in 0 1 2; do
testsuccessheadequal 7 "Reading package lists...
Building dependency tree...
The following additional packages will be installed:
okay
The following NEW packages will be installed:
foo-${1}-level${level} okay
0 upgraded, 2 newly installed, 0 to remove and 3 not upgraded." apt install foo-${1}-level${level} -s
testsuccessheadequal 9 "Reading package lists...
Building dependency tree...
The following additional packages will be installed:
upgrade
The following NEW packages will be installed:
foo-${1}-upgrade-level${level}
The following packages will be upgraded:
upgrade
1 upgraded, 1 newly installed, 0 to remove and $((2-${level})) not upgraded." apt install foo-${1}-upgrade-level${level} -s
done
testsuccessheadequal 7 "Reading package lists...
Building dependency tree...
The following additional packages will be installed:
okay
The following NEW packages will be installed:
foo-${1}-conflict okay
0 upgraded, 2 newly installed, 0 to remove and 3 not upgraded." apt install foo-${1}-conflict -s
}
checkfoos 'd' 'Depends'
checkfoos 'r' 'Recommends'
|