]> git.saurik.com Git - apt.git/blobdiff - test/integration/framework
run update post-invokes even on (partial) failures
[apt.git] / test / integration / framework
index 1f843babfdcc3f277482f615795adf04afc79e94..3f7101170ced769a2dcbe2a15f69bd3416a2bb65 100644 (file)
@@ -339,7 +339,9 @@ setupenvironment() {
        # destroys coverage reporting though, so we disable changing user for the calling gpgv
        echo "Dir::Bin::apt-key \"${BUILDDIRECTORY}/apt-key\";" >> aptconfig.conf
        if [ "$(id -u)" = '0' ]; then
-               echo 'Binary::gpgv::Debug::NoDropPrivs "true";' >>aptconfig.conf
+               echo 'Binary::gpgv::APT::Sandbox::User "root";' >> aptconfig.conf
+               # same for the solver executables
+               echo 'APT::Solver::RunAsUser "root";' >> aptconfig.conf
        fi
 
        cat > "${TMPWORKINGDIRECTORY}/rootdir/usr/bin/dpkg" <<EOF
@@ -421,6 +423,9 @@ EOF
                echo 'Acquire::gpgv::Options { "--weak-digest"; "sha1"; };' > rootdir/etc/apt/apt.conf.d/no-sha1
        fi
 
+       # most tests just need one signed Release file, not both
+       export APT_DONT_SIGN='Release.gpg'
+
        msgdone "info"
 }
 
@@ -534,6 +539,10 @@ EOF
        testempty --nomsg gcc -Wall -Wextra -fPIC -shared -o noopchroot.so noopchroot.c -ldl
 }
 configcompression() {
+       if [ "$1" = 'ALL' ]; then
+               configcompression '.' $(aptconfig dump APT::Compressor --format '%t %v%n' | sed -n 's#^Extension \.\(.*\)$#\1#p')
+               return
+       fi
        local CMD='apthelper cat-file -C'
        while [ -n "$1" ]; do
                case "$1" in
@@ -958,7 +967,7 @@ buildaptarchivefromfiles() {
 }
 
 compressfile() {
-       cat "${TMPWORKINGDIRECTORY}/rootdir/etc/testcase-compressor.conf" | while read compressor extension command; do
+       while read compressor extension command; do
                if [ "$compressor" = '.' ]; then
                        if [ -n "$2" ]; then
                                touch -d "$2" "$1"
@@ -969,7 +978,7 @@ compressfile() {
                if [ -n "$2" ]; then
                        touch -d "$2" "${1}.${extension}"
                fi
-       done
+       done < "${TMPWORKINGDIRECTORY}/rootdir/etc/testcase-compressor.conf"
 }
 
 # can be overridden by testcases for their pleasure
@@ -1694,8 +1703,9 @@ testfailure() {
                local EXITCODE=$?
                if expr match "$1" '^apt.*' >/dev/null; then
                        if [ "$1" = 'aptkey' ]; then
-                               if grep -q -E " Can't check signature: " "$OUTPUT" || \
-                                       grep -q -E " BAD signature from " "$OUTPUT"; then
+                               if grep -q " Can't check signature: 
+ BAD signature from 
+ signature could not be verified" "$OUTPUT"; then
                                        msgpass
                                else
                                        msgfailoutput "run failed with exitcode ${EXITCODE}, but no signature error" "$OUTPUT" "$@"