diff options
Diffstat (limited to 'test/integration')
-rw-r--r-- | test/integration/framework | 11 | ||||
-rwxr-xr-x | test/integration/test-external-installation-planer-protocol | 48 |
2 files changed, 52 insertions, 7 deletions
diff --git a/test/integration/framework b/test/integration/framework index 93e17e454..cd8597f80 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -309,8 +309,8 @@ setupenvironment() { ln -s "${BUILDDIRECTORY}/apt-dump-solver" usr/lib/apt/planers/dump ln -s "${BUILDDIRECTORY}/apt-internal-solver" usr/lib/apt/solvers/apt ln -s "${BUILDDIRECTORY}/apt-internal-planer" usr/lib/apt/planers/apt - echo "Dir::Bin::Solvers \"${TMPWORKINGDIRECTORY}/rootdir/usr/lib/apt/solvers\";" > etc/apt/apt.conf.d/externalsolver.conf - echo "Dir::Bin::Planers \"${TMPWORKINGDIRECTORY}/rootdir/usr/lib/apt/planers\";" > etc/apt/apt.conf.d/externalplaner.conf + echo "Dir::Bin::Solvers \"${TMPWORKINGDIRECTORY}/rootdir/usr/lib/apt/solvers\";" >> ../aptconfig.conf + echo "Dir::Bin::Planers \"${TMPWORKINGDIRECTORY}/rootdir/usr/lib/apt/planers\";" >> ../aptconfig.conf fi # use the autoremove from the BUILDDIRECTORY if its there, otherwise # system @@ -333,7 +333,7 @@ setupenvironment() { chmod 644 keys/* ln -s "${TMPWORKINGDIRECTORY}/keys/joesixpack.pub" rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg - echo "Dir \"${TMPWORKINGDIRECTORY}/rootdir\";" > aptconfig.conf + echo "Dir \"${TMPWORKINGDIRECTORY}/rootdir\";" >> aptconfig.conf echo "Dir::state::status \"${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status\";" >> aptconfig.conf echo "APT::Get::Show-User-Simulation-Note \"false\";" >> aptconfig.conf echo "Dir::Bin::Methods \"${TMPWORKINGDIRECTORY}/rootdir/usr/lib/apt/methods\";" >> aptconfig.conf @@ -1571,12 +1571,13 @@ msgfailoutput() { local MSG="$1" local OUTPUT="$2" shift 2 - if [ "$1" = 'grep' ]; then + local CMD="$1" + if [ "$1" = 'grep' -o "$1" = 'tail' -o "$1" = 'head' ]; then echo >&2 while [ -n "$2" ]; do shift; done echo "#### Complete file: $1 ####" catfile "$1" - echo '#### grep output ####' + echo "#### $CMD output ####" elif [ "$1" = 'test' ]; then echo >&2 # doesn't support ! or non-file flags diff --git a/test/integration/test-external-installation-planer-protocol b/test/integration/test-external-installation-planer-protocol index 605efcd7b..15ecd23a3 100755 --- a/test/integration/test-external-installation-planer-protocol +++ b/test/integration/test-external-installation-planer-protocol @@ -20,12 +20,56 @@ insertinstalledpackage 'unrelated-1' 'all' '1' setupaptarchive --no-update +EIPPLOG="${TMPWORKINGDIRECTORY}/rootdir/var/log/apt/eipp.log" +echo "Dir::Log::Planer \"$EIPPLOG\";" > ./rootdir/etc/apt/apt.conf.d/eipp-logging + testsuccess apt update export APT_EDSP_DUMP_FILENAME="${TMPWORKINGDIRECTORY}/eipp.dump" +testfailure test -r "$EIPPLOG" testfailure aptget install foo --planer dump -y +testfailure test -r "$EIPPLOG" testfailure grep 'unrelated-2' "$APT_EDSP_DUMP_FILENAME" testsuccessequal '2' grep -c '^Package: foo$' "$APT_EDSP_DUMP_FILENAME" testsuccessequal '1' grep -c '^Package: libfoo$' "$APT_EDSP_DUMP_FILENAME" -#less "$APT_EDSP_DUMP_FILENAME" +testsuccessequal 'Planer: dump' grep '^Planer: ' "$APT_EDSP_DUMP_FILENAME" + +testsuccess aptget install foo -s +testsuccess aptget install foo -y +testsuccess test -r "$EIPPLOG" +testsuccessequal 'Request: EIPP 0.1 +Architecture: amd64 +Architectures: amd64 +Remove: bar:amd64 +Install: libfoo:amd64 foo:amd64 +Planer: internal' head -n 6 "$EIPPLOG" +aptinternalplaner < "$EIPPLOG" > planer.log || true +testsuccessequal 'Remove: 6 +Unpack: 2 +Unpack: 4 +Configure: 2 +Configure: 4' grep -e '^Unpack:' -e '^Install:' -e '^Configure:' -e '^Remove:' planer.log + +rm -f "$EIPPLOG" +testsuccess aptget install foo -s --reinstall +testsuccess aptget install foo -y --reinstall +testsuccess test -r "$EIPPLOG" +testsuccessequal 'Request: EIPP 0.1 +Architecture: amd64 +Architectures: amd64 +ReInstall: foo:amd64 +Planer: internal' head -n 5 "$EIPPLOG" +aptinternalplaner < "$EIPPLOG" > planer.log || true +testsuccessequal 'Unpack: 4 +Configure: 4' grep -e '^Unpack:' -e '^Install:' -e '^Configure:' -e '^Remove:' planer.log -aptget install foo -ys #--planer apt +rm -f "$EIPPLOG" +testsuccess aptget purge foo -s +testsuccess aptget purge foo -y +testsuccess test -r "$EIPPLOG" +testsuccessequal 'Request: EIPP 0.1 +Architecture: amd64 +Architectures: amd64 +Remove: foo:amd64 +Planer: internal' head -n 5 "$EIPPLOG" +aptinternalplaner < "$EIPPLOG" > planer.log || true +testsuccessequal 'Remove: 4' grep -e '^Unpack:' -e '^Install:' -e '^Configure:' -e '^Remove:' planer.log |