summaryrefslogtreecommitdiff
path: root/test/integration/test-ubuntu-bug-761175-remove-purge
blob: c2e2aadf10cfe6a1a757214ebf8a030932610075 (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
#!/bin/sh
set -e

TESTDIR=$(readlink -f $(dirname $0))
. $TESTDIR/framework
setupenvironment
configarchitecture 'amd64' 'i386'

buildcompizpkg() {
	setupsimplenativepackage "compiz-core-$1" "$2" "$3" "$4"
	BUILDDIR="incoming/compiz-core-$1-$3"
	mkdir -p ${BUILDDIR}/debian/compiz-core/etc
	echo 'foo=bar;' > ${BUILDDIR}/compiz.conf
	echo 'compiz.conf	/etc/compiz.conf' >> ${BUILDDIR}/debian/install
	buildpackage "$BUILDDIR" "$4" 'main' "$2"
	rm -rf "$BUILDDIR"
}
buildcompizpkg 'native' 'all' '1.0' 'stable'
buildcompizpkg 'all' 'native' '1.0' 'stable'
buildcompizpkg 'native' 'native' '2.0' 'unstable'
buildcompizpkg 'all' 'all' '2.0' 'unstable'

setupaptarchive

runtests() {
	testdpkgnotinstalled compiz-core-$1
	testsuccess aptget install compiz-core-$1 -t "${2:-unstable}"
	testdpkginstalled compiz-core-$1

	testsuccess aptget remove compiz-core-$1 -y
	testdpkgnotinstalled compiz-core-$1
	testdpkgstatus 'rc' '1' "compiz-core-$1"

	testsuccessequal "Reading package lists...
Building dependency tree...
Reading state information...
The following packages will be REMOVED:
  compiz-core-$1*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
Purg compiz-core-$1" aptget purge compiz-core-$1 -s
	testsuccess aptget purge compiz-core-$1 -y
	testfailureequal "dpkg-query: no packages found matching compiz-core-$1" dpkg -l compiz-core-$1
}

msgmsg 'Test in multi arch environment'
runtests 'native'
runtests 'all'
runtests 'native' 'stable'
runtests 'all' 'stable'

msgmsg 'Test in single arch environment'
configarchitecture 'amd64'
runtests 'native'
runtests 'all'
runtests 'native' 'stable'
runtests 'all' 'stable'