| 1 | #!/bin/sh |
| 2 | set -e |
| 3 | |
| 4 | TESTDIR=$(readlink -f $(dirname $0)) |
| 5 | . $TESTDIR/framework |
| 6 | setupenvironment |
| 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' |
| 22 | |
| 23 | setupaptarchive |
| 24 | |
| 25 | runtests() { |
| 26 | testdpkgnotinstalled compiz-core-$1 |
| 27 | testsuccess aptget install compiz-core-$1 -t "${2:-unstable}" |
| 28 | testdpkginstalled compiz-core-$1 |
| 29 | |
| 30 | testsuccess aptget remove compiz-core-$1 -y |
| 31 | testdpkgnotinstalled compiz-core-$1 |
| 32 | testdpkgstatus 'rc' '1' "compiz-core-$1" |
| 33 | |
| 34 | testsuccessequal "Reading package lists... |
| 35 | Building dependency tree... |
| 36 | Reading state information... |
| 37 | The following packages will be REMOVED: |
| 38 | compiz-core-$1* |
| 39 | 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. |
| 40 | Purg compiz-core-$1" aptget purge compiz-core-$1 -s |
| 41 | testsuccess aptget purge compiz-core-$1 -y |
| 42 | echo -n '' > rootdir/var/lib/dpkg/available # dpkg -l < 1.16.2 reads the available file by default, where the package can be found |
| 43 | testequalor2 "dpkg-query: no packages found matching compiz-core-$1" "No packages found matching compiz-core-$1." dpkg -l compiz-core-$1 |
| 44 | } |
| 45 | |
| 46 | msgmsg 'Test in multi arch environment' |
| 47 | runtests 'native' |
| 48 | runtests 'all' |
| 49 | runtests 'native' 'stable' |
| 50 | runtests 'all' 'stable' |
| 51 | |
| 52 | msgmsg 'Test in single arch environment' |
| 53 | configarchitecture 'amd64' |
| 54 | runtests 'native' |
| 55 | runtests 'all' |
| 56 | runtests 'native' 'stable' |
| 57 | runtests 'all' 'stable' |