diff options
author | Michael Vogt <mvo@debian.org> | 2015-06-23 12:17:35 +0100 |
---|---|---|
committer | Michael Vogt <mvo@debian.org> | 2015-06-23 12:17:35 +0100 |
commit | 245dde96193702f7f51389d3583dee547f8ba366 (patch) | |
tree | 6cf8c191641c760bcc6a6c08fb0ff65d27e0cffd /test/integration/test-apt-mark | |
parent | 5530255b5f3ad7de2e23dfcb39ce325001126501 (diff) | |
parent | c8a4ce6cbed57ae108dc955d4a850f9b129a0693 (diff) |
Merge remote-tracking branch 'donkult/debian/experimental' into debian/experimental
Diffstat (limited to 'test/integration/test-apt-mark')
-rwxr-xr-x | test/integration/test-apt-mark | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/test/integration/test-apt-mark b/test/integration/test-apt-mark new file mode 100755 index 000000000..9b68945f9 --- /dev/null +++ b/test/integration/test-apt-mark @@ -0,0 +1,101 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' 'i386' + +insertpackage 'unstable' 'bar' 'amd64,i386' '1' +insertpackage 'unstable' 'uninstalled' 'all' '1' +insertpackage 'unstable' 'uninstalled-native' 'amd64' '1' + +insertinstalledpackage 'foo' 'all' '1' +insertinstalledpackage 'bar' 'amd64' '1' + +setupaptarchive + +# dpkg is "installed" by our test framework +testdpkginstalled dpkg + +testnoautopkg() { + testempty aptmark showauto + testempty aptcache showauto + testsuccessequal 'bar +dpkg +foo' aptmark showmanual + testsuccessequal 'bar +foo' aptmark showmanual bar foo uninstalled +} +testfooisauto() { + testsuccessequal 'foo' aptmark showauto + testsuccessequal 'foo' aptcache showauto + testsuccessequal 'foo' aptmark showauto foo + testsuccessequal 'foo' aptcache showauto foo + testsuccessequal 'bar +dpkg' aptmark showmanual + testsuccessequal 'bar' aptmark showmanual bar +} +testmarkonpkgasauto() { + testsuccess $1 $2 foo + testfooisauto + testsuccess $1 $2 foo + testfooisauto + + testsuccess $1 $3 foo + testnoautopkg + testsuccess $1 $3 foo + testnoautopkg +} + +testfailureequal 'E: No packages found' aptmark auto +testfailureequal 'E: No packages found' aptmark manual + +testnoautopkg +testmarkonpkgasauto 'aptmark' 'auto' 'manual' +testmarkonpkgasauto 'aptmark' 'markauto' 'unmarkauto' +testmarkonpkgasauto 'aptget' 'markauto' 'unmarkauto' + +testnoholdpkg() { + testempty aptmark showhold + testempty aptmark showholds # typical "typo" + testempty aptmark showhold dpkg + testempty aptmark showholds dpkg +} +testpkgonhold() { + testsuccessequal "$1" aptmark showhold + testsuccessequal "$1" aptmark showholds + testsuccessequal "$1" aptmark showhold $1 + testsuccessequal "$1" aptmark showholds $1 +} +testmarkonepkgashold() { + testsuccess aptmark hold $1 + testpkgonhold $1 + testsuccess aptmark hold $1 + testpkgonhold $1 + testsuccess aptmark unhold $1 + testnoholdpkg + testsuccess aptmark unhold $1 + testnoholdpkg +} + +testfailureequal 'E: No packages found' aptmark hold +testfailureequal 'E: No packages found' aptmark unhold + +testnoholdpkg +testmarkonepkgashold 'foo' +testmarkonepkgashold 'bar' + +msgtest 'dpkg supports --merge-avail via' 'stdin' +if dpkg --merge-avail - < /dev/null >/dev/null 2>&1; then + msgpass +else + msgskip 'dpkg version too old' + exit 0 +fi + +testmarkonepkgashold 'uninstalled' +testmarkonepkgashold 'uninstalled-native' + +testsuccessequal 'uninstalled set on hold.' aptmark hold uninstalled +testsuccessequal 'uninstalled-native set on hold.' aptmark hold uninstalled-native |