summaryrefslogtreecommitdiff
path: root/test/integration/framework
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/framework')
-rw-r--r--test/integration/framework25
1 files changed, 12 insertions, 13 deletions
diff --git a/test/integration/framework b/test/integration/framework
index 9e183057f..c9445065b 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -1178,10 +1178,13 @@ testnopackage() {
fi
}
-testdpkginstalled() {
- msgtest "Test for correctly installed package(s) with" "dpkg -l $*"
- local PKGS="$(dpkg -l "$@" 2>/dev/null | grep '^i' | wc -l)"
- if [ "$PKGS" != $# ]; then
+testdpkgstatus() {
+ local STATE="$1"
+ local NR="$2"
+ shift 2
+ msgtest "Test that $NR package(s) are in state $STATE with" "dpkg -l $*"
+ local PKGS="$(dpkg -l "$@" 2>/dev/null | grep "^${STATE}" | wc -l)"
+ if [ "$PKGS" != $NR ]; then
echo >&2 $PKGS
dpkg -l "$@" | grep '^[a-z]' >&2
msgfail
@@ -1190,16 +1193,12 @@ testdpkginstalled() {
fi
}
+testdpkginstalled() {
+ testdpkgstatus 'ii' "$#" "$@"
+}
+
testdpkgnotinstalled() {
- msgtest "Test for correctly not-installed package(s) with" "dpkg -l $*"
- local PKGS="$(dpkg -l "$@" 2> /dev/null | grep '^i' | wc -l)"
- if [ "$PKGS" != 0 ]; then
- echo
- dpkg -l "$@" | grep '^[a-z]' >&2
- msgfail
- else
- msgpass
- fi
+ testdpkgstatus 'ii' '0' "$@"
}
testmarkedauto() {