]>
Commit | Line | Data |
---|---|---|
949e033c DK |
1 | #!/bin/sh |
2 | set -e | |
3 | ||
3abb6a6a DK |
4 | TESTDIR="$(readlink -f "$(dirname "$0")")" |
5 | . "$TESTDIR/framework" | |
949e033c | 6 | setupenvironment |
016bea82 DK |
7 | configarchitecture 'amd64' 'i386' |
8 | ||
9 | buildcompizpkg() { | |
10 | setupsimplenativepackage "compiz-core-$1" "$2" "$3" "$4" | |
11 | BUILDDIR="incoming/compiz-core-$1-$3" | |
12 | mkdir -p ${BUILDDIR}/debian/compiz-core/etc | |
13 | echo 'foo=bar;' > ${BUILDDIR}/compiz.conf | |
14 | echo 'compiz.conf /etc/compiz.conf' >> ${BUILDDIR}/debian/install | |
15 | buildpackage "$BUILDDIR" "$4" 'main' "$2" | |
16 | rm -rf "$BUILDDIR" | |
17 | } | |
18 | buildcompizpkg 'native' 'all' '1.0' 'stable' | |
19 | buildcompizpkg 'all' 'native' '1.0' 'stable' | |
20 | buildcompizpkg 'native' 'native' '2.0' 'unstable' | |
21 | buildcompizpkg 'all' 'all' '2.0' 'unstable' | |
949e033c DK |
22 | |
23 | setupaptarchive | |
24 | ||
016bea82 | 25 | runtests() { |
33190fe3 DK |
26 | local PKG="$1" |
27 | local RELEASE="${2}" | |
28 | shift 2 | |
29 | testdpkgnotinstalled compiz-core-${PKG} | |
30 | testsuccess aptget install compiz-core-${PKG} -t "${RELEASE}" "$@" | |
31 | testdpkginstalled compiz-core-${PKG} | |
949e033c | 32 | |
33190fe3 DK |
33 | testsuccess aptget remove compiz-core-${PKG} -y "$@" |
34 | testdpkgnotinstalled compiz-core-${PKG} | |
35 | testdpkgstatus 'rc' '1' "compiz-core-${PKG}" | |
949e033c | 36 | |
33190fe3 DK |
37 | if [ -z "$1" ]; then |
38 | testsuccessequal "Reading package lists... | |
949e033c DK |
39 | Building dependency tree... |
40 | Reading state information... | |
41 | The following packages will be REMOVED: | |
33190fe3 | 42 | compiz-core-${PKG}* |
949e033c | 43 | 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. |
33190fe3 DK |
44 | Purg compiz-core-${PKG}" aptget purge compiz-core-${PKG} -s "$@" |
45 | else | |
46 | # check that the rc-version isn't passed to the external resolver if its only in dpkg/status | |
47 | export APT_EDSP_DUMP_FILENAME="${TMPWORKINGDIRECTORY}/dump-${PKG}.edsp" | |
48 | testfailure aptget purge compiz-core-${PKG} -y "$@" -s --solver dump | |
49 | testsuccessequal '2' grep -c "^Package: compiz-core-${PKG}\$" "$APT_EDSP_DUMP_FILENAME" | |
50 | mv rootdir/etc/apt/sources.list.d/apt-test-stable-deb.list rootdir/etc/apt/sources.list.d/apt-test-stable-deb.disabled | |
51 | testfailure aptget purge compiz-core-${PKG} -y "$@" -s --solver dump | |
52 | testsuccessequal '1' grep -c "^Package: compiz-core-${PKG}\$" "$APT_EDSP_DUMP_FILENAME" | |
53 | mv rootdir/etc/apt/sources.list.d/apt-test-stable-deb.disabled rootdir/etc/apt/sources.list.d/apt-test-stable-deb.list | |
54 | ||
55 | testsuccessequal "Reading package lists... | |
56 | Building dependency tree... | |
57 | Reading state information... | |
58 | Execute external solver... | |
59 | The following packages will be REMOVED: | |
60 | compiz-core-${PKG}* | |
61 | 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. | |
62 | Purg compiz-core-${PKG}" aptget purge compiz-core-${PKG} -s "$@" | |
63 | fi | |
64 | testsuccess aptget purge compiz-core-${PKG} -y "$@" | |
41fadd29 | 65 | echo -n '' > rootdir/var/lib/dpkg/available # dpkg -l < 1.16.2 reads the available file by default, where the package can be found |
33190fe3 DK |
66 | testequalor2 "dpkg-query: no packages found matching compiz-core-${PKG}" "No packages found matching compiz-core-${PKG}." dpkg -l compiz-core-${PKG} |
67 | } | |
68 | runtestround() { | |
69 | runtests 'native' 'unstable' "$@" | |
70 | runtests 'all' 'unstable' "$@" | |
71 | runtests 'native' 'stable' "$@" | |
72 | runtests 'all' 'stable' "$@" | |
016bea82 | 73 | } |
33190fe3 DK |
74 | testround() { |
75 | msgmsg 'Test in multi arch environment' "$@" | |
76 | configarchitecture 'amd64' 'i386' | |
77 | runtestround "$@" | |
016bea82 | 78 | |
33190fe3 DK |
79 | msgmsg 'Test in single arch environment' "$@" |
80 | configarchitecture 'amd64' | |
81 | runtestround "$@" | |
82 | } | |
83 | testround | |
84 | testround --solver apt |