X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/374f8492e6f109e8427816a8f513e5e8feda9049..b49068c566d749130e023536d54588c948c16edf:/test/integration/test-apt-mark diff --git a/test/integration/test-apt-mark b/test/integration/test-apt-mark index 69e0f933d..ec4ed8316 100755 --- a/test/integration/test-apt-mark +++ b/test/integration/test-apt-mark @@ -20,30 +20,41 @@ testdpkginstalled dpkg testnoautopkg() { testempty aptmark showauto - testequal 'bar + testempty aptcache showauto + testsuccessequal 'bar dpkg foo' aptmark showmanual - testequal 'bar + testsuccessequal 'bar foo' aptmark showmanual bar foo uninstalled } -testmarkonpkgasauto() { - testsuccess aptmark $1 foo - testequal 'foo' aptmark showauto - testequal 'foo' aptmark showauto foo - testequal 'bar +testfooisauto() { + testsuccessequal 'foo' aptmark showauto + testsuccessequal 'foo' aptcache showauto + testsuccessequal 'foo' aptmark showauto foo + testsuccessequal 'foo' aptcache showauto foo + testsuccessequal 'bar dpkg' aptmark showmanual - testequal 'bar' aptmark showmanual bar + testsuccessequal 'bar' aptmark showmanual bar +} +testmarkonpkgasauto() { + testsuccess $1 $2 foo + testfooisauto + testsuccess $1 $2 foo + testfooisauto - testsuccess aptmark $2 foo + testsuccess $1 $3 foo + testnoautopkg + testsuccess $1 $3 foo testnoautopkg } -testequal 'E: No packages found' aptmark auto -testequal 'E: No packages found' aptmark manual +testfailureequal 'E: No packages found' aptmark auto +testfailureequal 'E: No packages found' aptmark manual testnoautopkg -testmarkonpkgasauto 'auto' 'manual' -testmarkonpkgasauto 'markauto' 'unmarkauto' +testmarkonpkgasauto 'aptmark' 'auto' 'manual' +testmarkonpkgasauto 'aptmark' 'markauto' 'unmarkauto' +testmarkonpkgasauto 'aptget' 'markauto' 'unmarkauto' testnoholdpkg() { testempty aptmark showhold @@ -51,22 +62,53 @@ testnoholdpkg() { 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 - testequal "$1" aptmark showhold - testequal "$1" aptmark showholds + testpkgonhold $1 + testsuccess aptmark hold $1 + testpkgonhold $1 + testsuccess aptmark unhold $1 + testnoholdpkg testsuccess aptmark unhold $1 testnoholdpkg } -testequal 'E: No packages found' aptmark hold -testequal 'E: No packages found' aptmark unhold +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' -testequal 'uninstalled set on hold.' aptmark hold uninstalled -testequal 'uninstalled-native set on hold.' aptmark hold uninstalled-native +testsuccessequal 'uninstalled set on hold.' aptmark hold uninstalled +testsuccessequal 'uninstalled-native set on hold.' aptmark hold uninstalled-native +#FIXME: holds on uninstalled packages are not persistent in dpkg +testsuccessequal 'Reading package lists... +Building dependency tree... +Reading state information... +The following NEW packages will be installed: + uninstalled uninstalled-native +The following held packages will be changed: + uninstalled-native +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst uninstalled (1 unstable [all]) +Inst uninstalled-native (1 unstable [amd64]) +Conf uninstalled (1 unstable [all]) +Conf uninstalled-native (1 unstable [amd64])' aptget install uninstalled uninstalled-native -s