~ubuntu-branches/debian/stretch/apt/stretch

« back to all changes in this revision

Viewing changes to test/integration/framework

  • Committer: Package Import Robot
  • Author(s): David Kalnischkies, David Kalnischkies, James McCoy, Jean-Pierre Giraud, Zhou Mo, Kenshi Muto, Theppitak Karoonboonyanan
  • Date: 2014-12-23 13:22:42 UTC
  • Revision ID: package-import@ubuntu.com-20141223132242-a3vmwlbok4lap2bp
Tags: 1.0.9.5
[ David Kalnischkies ]
* dispose http(s) 416 error page as non-content (Closes: 768797)
* do not make PTY slave the controlling terminal (Closes: 772641)
* always run 'dpkg --configure -a' at the end of our dpkg callings
  (Closes: 769609)
* pass-through stdin fd instead of content if not a terminal (Closes: 773061)

[ James McCoy ]
* tighten filtering of kernel images in apt.auto-removal (Closes: 772732)

[ Jean-Pierre Giraud ]
* French manpages translation update (Closes: 771967)

[ Zhou Mo ]
* Chinese (simplified) program translation update (Closes: 771982)

[ Kenshi Muto ]
* Japanese program translation update (Closes: 772678)

[ Theppitak Karoonboonyanan ]
* Thai program translation update (Closes: 772913)

Show diffs side-by-side

added added

removed removed

Lines of Context:
102
102
        local CMD="$1"
103
103
        shift
104
104
        case $CMD in
105
 
        sh|aptitude|*/*) ;;
 
105
        sh|aptitude|*/*|command) ;;
106
106
        *) CMD="${BUILDDIRECTORY}/$CMD";;
107
107
        esac
108
108
        MALLOC_PERTURB_=21 MALLOC_CHECK_=2 APT_CONFIG="$(getaptconfig)" LD_LIBRARY_PATH=${BUILDDIRECTORY} $CMD "$@"
1064
1064
}
1065
1065
 
1066
1066
downloadfile() {
1067
 
        local PROTO="$(echo "$1" | cut -d':' -f 1 )"
1068
 
        apthelper -o Debug::Acquire::${PROTO}=1 \
 
1067
        local PROTO="${1%%:*}"
 
1068
        apthelper -o Debug::Acquire::${PROTO}=1 -o Debug::pkgAcquire::Worker=1 \
1069
1069
                download-file "$1" "$2" 2>&1 || true
1070
1070
        # only if the file exists the download was successful
1071
1071
        if [ -e "$2" ]; then
1178
1178
        fi
1179
1179
}
1180
1180
 
 
1181
testdpkgstatus() {
 
1182
        local STATE="$1"
 
1183
        local NR="$2"
 
1184
        shift 2
 
1185
        msgtest "Test that $NR package(s) are in state $STATE with" "dpkg -l $*"
 
1186
        local PKGS="$(dpkg -l "$@" 2>/dev/null | grep "^${STATE}" | wc -l)"
 
1187
        if [ "$PKGS" != $NR ]; then
 
1188
                echo >&2 $PKGS
 
1189
                dpkg -l "$@" | grep '^[a-z]' >&2
 
1190
                msgfail
 
1191
        else
 
1192
                msgpass
 
1193
        fi
 
1194
}
 
1195
 
1181
1196
testdpkginstalled() {
1182
 
        msgtest "Test for correctly installed package(s) with" "dpkg -l $*"
1183
 
        local PKGS="$(dpkg -l "$@" 2>/dev/null | grep '^i' | wc -l)"
1184
 
        if [ "$PKGS" != $# ]; then
1185
 
                echo >&2 $PKGS
1186
 
                dpkg -l "$@" | grep '^[a-z]' >&2
1187
 
                msgfail
1188
 
        else
1189
 
                msgpass
1190
 
        fi
 
1197
        testdpkgstatus 'ii' "$#" "$@"
1191
1198
}
1192
1199
 
1193
1200
testdpkgnotinstalled() {
1194
 
        msgtest "Test for correctly not-installed package(s) with" "dpkg -l $*"
1195
 
        local PKGS="$(dpkg -l "$@" 2> /dev/null | grep '^i' | wc -l)"
1196
 
        if [ "$PKGS" != 0 ]; then
1197
 
                echo
1198
 
                dpkg -l "$@" | grep '^[a-z]' >&2
1199
 
                msgfail
1200
 
        else
1201
 
                msgpass
1202
 
        fi
 
1201
        testdpkgstatus 'ii' '0' "$@"
1203
1202
}
1204
1203
 
1205
1204
testmarkedauto() {
1221
1220
                msgtest 'Test for successful execution of' "$*"
1222
1221
        fi
1223
1222
        local OUTPUT="${TMPWORKINGDIRECTORY}/rootdir/tmp/testsuccess.output"
1224
 
        if $@ >${OUTPUT} 2>&1; then
 
1223
        if "$@" >${OUTPUT} 2>&1; then
1225
1224
                msgpass
1226
1225
        else
1227
1226
                echo >&2