]>
Commit | Line | Data |
---|---|---|
1 | #!/bin/sh | |
2 | set -e | |
3 | ||
4 | TESTDIR=$(readlink -f $(dirname $0)) | |
5 | . $TESTDIR/framework | |
6 | ||
7 | setupenvironment | |
8 | configarchitecture 'native' | |
9 | ||
10 | # old conffile | |
11 | setupsimplenativepackage 'compiz-core' 'native' '1.0' 'unstable' | |
12 | BUILDDIR='incoming/compiz-core-1.0' | |
13 | mkdir -p ${BUILDDIR}/debian/compiz-core/etc | |
14 | echo 'foo=bar;' > ${BUILDDIR}/compiz.conf | |
15 | echo 'compiz.conf /etc/compiz.conf' >> ${BUILDDIR}/debian/install | |
16 | buildpackage "$BUILDDIR" 'unstable' 'main' 'native' | |
17 | rm -rf "$BUILDDIR" | |
18 | ||
19 | # new conffile | |
20 | setupsimplenativepackage 'compiz-core' 'native' '2.0' 'unstable' | |
21 | BUILDDIR='incoming/compiz-core-2.0' | |
22 | mkdir -p ${BUILDDIR}/debian/compiz-core/etc | |
23 | echo 'foo2=bar2;' > ${BUILDDIR}/compiz.conf | |
24 | echo 'compiz.conf /etc/compiz.conf' >> ${BUILDDIR}/debian/install | |
25 | buildpackage "$BUILDDIR" 'unstable' 'main' 'native' | |
26 | rm -rf "$BUILDDIR" | |
27 | ||
28 | setupaptarchive | |
29 | ||
30 | testsuccess aptget install compiz-core=1.0 | |
31 | ||
32 | # fake conffile change | |
33 | echo "meep" >> rootdir/etc/compiz.conf/compiz.conf | |
34 | ||
35 | # FIXME: Is there really no way to see if dpkg actually prompts? | |
36 | msgtest 'Test for successful execution of' 'apt-get install compiz-core=2.0' | |
37 | OUTPUT=$(mktemp) | |
38 | addtrap "rm $OUTPUT;" | |
39 | exec 3> apt-progress.log | |
40 | if aptget install compiz-core=2.0 -o APT::Status-Fd=3 -o Dpkg::Use-Pty=false -o dpkg::options::='--force-confold' >${OUTPUT} 2>&1; then | |
41 | msgpass | |
42 | else | |
43 | echo | |
44 | cat $OUTPUT | |
45 | msgfail | |
46 | fi | |
47 | ||
48 | # and ensure there is a conffile message in the file | |
49 | msgtest 'Test status fd for an included' 'pmconffile msg' | |
50 | grep -q "pmconffile:/etc/compiz.conf/compiz.conf" apt-progress.log && msgpass || (cat apt-progress.log && msgfail) |