diff options
Diffstat (limited to 'test')
-rwxr-xr-x | test/integration/test-apt-get-source | 2 | ||||
-rwxr-xr-x | test/integration/test-apt-key-net-update | 21 | ||||
-rwxr-xr-x | test/integration/test-apt-progress-fd-conffile | 43 |
3 files changed, 64 insertions, 2 deletions
diff --git a/test/integration/test-apt-get-source b/test/integration/test-apt-get-source index c8db4edbe..3ee7a9e23 100755 --- a/test/integration/test-apt-get-source +++ b/test/integration/test-apt-get-source @@ -62,7 +62,7 @@ Need to get 0 B of source archives. # unavailable one testequal "$HEADER -E: Ignore unavailable version '9.9-not-there' of package 'foo' +E: Can not find version '9.9-not-there' of package 'foo' E: Unable to find a source package for foo" aptget source -q --print-uris foo=9.9-not-there # version and release diff --git a/test/integration/test-apt-key-net-update b/test/integration/test-apt-key-net-update index d5205836f..73545aff7 100755 --- a/test/integration/test-apt-key-net-update +++ b/test/integration/test-apt-key-net-update @@ -21,10 +21,29 @@ TRUSTEDFILE=./etc/apt/trusted.gpg mkdir -p ./var/lib/apt/keyrings TMP_KEYRING=./var/lib/apt/keyrings/maybe-import-keyring.gpg GPG_CMD="gpg --ignore-time-conflict --no-options --no-default-keyring" + +# FIXME: instead of copying this use apt-key and the buildin apt webserver +# to do a real test + +# COPYIED from apt-key.in -------------- + +# gpg needs a trustdb to function, but it can't be invalid (not even empty) +# so we create a temporary directory to store our fresh readable trustdb in +TRUSTDBDIR="$(mktemp -d)" +CURRENTTRAP="${CURRENTTRAP} rm -rf '${TRUSTDBDIR}';" +trap "${CURRENTTRAP}" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM +chmod 700 "$TRUSTDBDIR" +# We also don't use a secret keyring, of course, but gpg panics and +# implodes if there isn't one available - and writeable for imports +SECRETKEYRING="${TRUSTDBDIR}/secring.gpg" +touch $SECRETKEYRING +GPG_CMD="$GPG_CMD --secret-keyring $SECRETKEYRING" +GPG_CMD="$GPG_CMD --trustdb-name ${TRUSTDBDIR}/trustdb.gpg" +#----------------------------------------- END COPY + GPG="$GPG_CMD --keyring $TRUSTEDFILE" MASTER_KEYRING=/usr/share/keyrings/ubuntu-master-keyring.gpg - msgtest "add_keys_with_verify_against_master_keyring" if [ ! -e $MASTER_KEYRING ]; then echo -n "No $MASTER_KEYRING found" diff --git a/test/integration/test-apt-progress-fd-conffile b/test/integration/test-apt-progress-fd-conffile new file mode 100755 index 000000000..0b42b1b2f --- /dev/null +++ b/test/integration/test-apt-progress-fd-conffile @@ -0,0 +1,43 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework + +setupenvironment +configarchitecture 'native' + +# old conffile +setupsimplenativepackage 'compiz-core' 'native' '1.0' 'unstable' +BUILDDIR='incoming/compiz-core-1.0' +mkdir -p ${BUILDDIR}/debian/compiz-core/etc +echo 'foo=bar;' > ${BUILDDIR}/compiz.conf +echo 'compiz.conf /etc/compiz.conf' >> ${BUILDDIR}/debian/install +buildpackage "$BUILDDIR" 'unstable' 'main' 'native' +rm -rf "$BUILDDIR" + +# new conffile +setupsimplenativepackage 'compiz-core' 'native' '2.0' 'unstable' +BUILDDIR='incoming/compiz-core-2.0' +mkdir -p ${BUILDDIR}/debian/compiz-core/etc +echo 'foo2=bar2;' > ${BUILDDIR}/compiz.conf +echo 'compiz.conf /etc/compiz.conf' >> ${BUILDDIR}/debian/install +buildpackage "$BUILDDIR" 'unstable' 'main' 'native' +rm -rf "$BUILDDIR" + +setupaptarchive + +testsuccess aptget install compiz-core=1.0 + +# fake conffile change +echo "meep" >> rootdir/etc/compiz.conf/compiz.conf + +# install +exec 3> apt-progress.log +echo n | aptget install compiz-core=2.0 -o APT::Status-Fd=3 -o Dpkg::Use-Pty=false + +# and ensure there is a conffile message in the file +msgtest "Conffile prompt in apt-progress.log" +grep -q "pmconffile:/etc/compiz.conf/compiz.conf" apt-progress.log && msgpass || (cat apt-progress.log && msgfail) + +cat apt-progress.log
\ No newline at end of file |