From 019dfaedcc169837f88cc0b971fd8897828d93bf Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 4 Dec 2013 07:58:37 +0100 Subject: add test, deal with InRelease --- test/integration/test-apt-get-source | 45 ++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 test/integration/test-apt-get-source (limited to 'test/integration') diff --git a/test/integration/test-apt-get-source b/test/integration/test-apt-get-source new file mode 100755 index 000000000..d2b8deafd --- /dev/null +++ b/test/integration/test-apt-get-source @@ -0,0 +1,45 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework + +setupenvironment +configarchitecture "i386" + +# we need to insert a package into "unstable" so that a Release file is +# create for the test +insertpackage 'wheezy' 'unreleated-package' 'all' '1.0' + +# a "normal" package with source and binary +insertpackage 'unstable' 'foo' 'all' '2.0' +insertsource 'unstable' 'foo' 'all' '2.0' + +insertpackage 'stable' 'foo' 'all' '1.0' +insertsource 'stable' 'foo' 'all' '1.0' + +# this package exists only as source +insertsource 'wheezy' 'foo' 'all' '0.1' + +setupaptarchive + +APTARCHIVE=$(readlink -f ./aptarchive) + +# normal operation gets highest version number +testequal "'file://${APTARCHIVE}/foo_2.0.dsc' foo_2.0.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e +'file://${APTARCHIVE}/foo_2.0.tar.gz' foo_2.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -qq --print-uris foo + +# select by release +testequal "Selectied version '1.0' (stable) for foo +'file://${APTARCHIVE}/foo_1.0.dsc' foo_1.0.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e +'file://${APTARCHIVE}/foo_1.0.tar.gz' foo_1.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -qq --print-uris foo/stable + +# select by version +testequal "'file://${APTARCHIVE}/foo_1.0.dsc' foo_1.0.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e +'file://${APTARCHIVE}/foo_1.0.tar.gz' foo_1.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -qq --print-uris foo=1.0 + +# select by release with no binary package (Bug#731102) +testequal "Selectied version '0.1' (wheezy) for foo +'file://${APTARCHIVE}/foo_0.1.dsc' foo_0.1.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e +'file://${APTARCHIVE}/foo_0.1.tar.gz' foo_0.1.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -qq --print-uris foo/wheezy + -- cgit v1.2.3 From 4652a9eee39df1cefa49ab177c0cfc50b9aad567 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 4 Dec 2013 08:41:23 +0100 Subject: further refactor, extract GetReleaseForSourceRecord() out of FindSrc(), write out the selection notice to c1out to be consistent with the rest of the source --- test/integration/test-apt-get-source | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'test/integration') diff --git a/test/integration/test-apt-get-source b/test/integration/test-apt-get-source index d2b8deafd..0f9e29c80 100755 --- a/test/integration/test-apt-get-source +++ b/test/integration/test-apt-get-source @@ -26,20 +26,30 @@ setupaptarchive APTARCHIVE=$(readlink -f ./aptarchive) # normal operation gets highest version number -testequal "'file://${APTARCHIVE}/foo_2.0.dsc' foo_2.0.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e -'file://${APTARCHIVE}/foo_2.0.tar.gz' foo_2.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -qq --print-uris foo +HEADER="Reading package lists... +Building dependency tree..." +testequal "$HEADER +Need to get 0 B of source archives. +'file://${APTARCHIVE}/foo_2.0.dsc' foo_2.0.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e +'file://${APTARCHIVE}/foo_2.0.tar.gz' foo_2.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo # select by release -testequal "Selectied version '1.0' (stable) for foo +testequal "$HEADER +Selectied version '1.0' (stable) for foo +Need to get 0 B of source archives. 'file://${APTARCHIVE}/foo_1.0.dsc' foo_1.0.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e -'file://${APTARCHIVE}/foo_1.0.tar.gz' foo_1.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -qq --print-uris foo/stable +'file://${APTARCHIVE}/foo_1.0.tar.gz' foo_1.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo/stable # select by version -testequal "'file://${APTARCHIVE}/foo_1.0.dsc' foo_1.0.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e -'file://${APTARCHIVE}/foo_1.0.tar.gz' foo_1.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -qq --print-uris foo=1.0 +testequal "$HEADER +Need to get 0 B of source archives. +'file://${APTARCHIVE}/foo_1.0.dsc' foo_1.0.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e +'file://${APTARCHIVE}/foo_1.0.tar.gz' foo_1.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo=1.0 # select by release with no binary package (Bug#731102) -testequal "Selectied version '0.1' (wheezy) for foo +testequal "$HEADER +Selectied version '0.1' (wheezy) for foo +Need to get 0 B of source archives. 'file://${APTARCHIVE}/foo_0.1.dsc' foo_0.1.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e -'file://${APTARCHIVE}/foo_0.1.tar.gz' foo_0.1.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -qq --print-uris foo/wheezy +'file://${APTARCHIVE}/foo_0.1.tar.gz' foo_0.1.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo/wheezy -- cgit v1.2.3 From c6b83f9c68aafa3f2bd1b695a6beb724d7520bc5 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 4 Dec 2013 16:26:57 +0100 Subject: add test for aptget source for unavailable package --- test/integration/test-apt-get-source | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/integration') diff --git a/test/integration/test-apt-get-source b/test/integration/test-apt-get-source index 0f9e29c80..5bef781f1 100755 --- a/test/integration/test-apt-get-source +++ b/test/integration/test-apt-get-source @@ -53,3 +53,8 @@ Need to get 0 B of source archives. 'file://${APTARCHIVE}/foo_0.1.dsc' foo_0.1.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e 'file://${APTARCHIVE}/foo_0.1.tar.gz' foo_0.1.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo/wheezy +# unavailable one +testequal "$HEADER +E: Ignore unavailable 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 + -- cgit v1.2.3 From 651ae5ce5f376ae5274933c621a3b897ac5152a6 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 10 Dec 2013 16:35:44 +0100 Subject: if there is only deb-src pick higest version in deb-src release matching --- test/integration/test-apt-get-source | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'test/integration') diff --git a/test/integration/test-apt-get-source b/test/integration/test-apt-get-source index 5bef781f1..6bca22145 100755 --- a/test/integration/test-apt-get-source +++ b/test/integration/test-apt-get-source @@ -15,10 +15,14 @@ insertpackage 'wheezy' 'unreleated-package' 'all' '1.0' insertpackage 'unstable' 'foo' 'all' '2.0' insertsource 'unstable' 'foo' 'all' '2.0' +# its possible to have multiple src versions in the sources file, do not break +# in this case (bts #731853) +insertsource 'stable' 'foo' 'all' '1.5' insertpackage 'stable' 'foo' 'all' '1.0' insertsource 'stable' 'foo' 'all' '1.0' -# this package exists only as source +# this packages exists only as source +insertsource 'wheezy' 'foo' 'all' '0.0.1' insertsource 'wheezy' 'foo' 'all' '0.1' setupaptarchive @@ -46,7 +50,8 @@ Need to get 0 B of source archives. 'file://${APTARCHIVE}/foo_1.0.dsc' foo_1.0.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e 'file://${APTARCHIVE}/foo_1.0.tar.gz' foo_1.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo=1.0 -# select by release with no binary package (Bug#731102) +# select by release with no binary package (Bug#731102) but ensure to get +# higest version testequal "$HEADER Selectied version '0.1' (wheezy) for foo Need to get 0 B of source archives. -- cgit v1.2.3 From 66f13784f0a05bbd60106d21447f10273c68b0d8 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 10 Dec 2013 16:43:25 +0100 Subject: improve test for #731853 and comments --- test/integration/test-apt-get-source | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'test/integration') diff --git a/test/integration/test-apt-get-source b/test/integration/test-apt-get-source index 6bca22145..e2536ae7a 100755 --- a/test/integration/test-apt-get-source +++ b/test/integration/test-apt-get-source @@ -15,13 +15,15 @@ insertpackage 'wheezy' 'unreleated-package' 'all' '1.0' insertpackage 'unstable' 'foo' 'all' '2.0' insertsource 'unstable' 'foo' 'all' '2.0' -# its possible to have multiple src versions in the sources file, do not break -# in this case (bts #731853) +# its possible to have multiple src versions in the sources file, ensure +# to pick the correct one in this case (bts #731853) insertsource 'stable' 'foo' 'all' '1.5' +insertsource 'stable' 'foo' 'all' '0.5' insertpackage 'stable' 'foo' 'all' '1.0' insertsource 'stable' 'foo' 'all' '1.0' -# this packages exists only as source +# this packages exists only as sources, add two versions to ensure that +# apt will pick the higher version number (bts #731853) insertsource 'wheezy' 'foo' 'all' '0.0.1' insertsource 'wheezy' 'foo' 'all' '0.1' -- cgit v1.2.3 From bfa7bfc8e426f662ee5a5d0fcba3daeea23fe2ae Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 10 Dec 2013 17:02:30 +0100 Subject: fix typo --- test/integration/test-apt-get-source | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/integration') diff --git a/test/integration/test-apt-get-source b/test/integration/test-apt-get-source index e2536ae7a..b98ebbada 100755 --- a/test/integration/test-apt-get-source +++ b/test/integration/test-apt-get-source @@ -41,7 +41,7 @@ Need to get 0 B of source archives. # select by release testequal "$HEADER -Selectied version '1.0' (stable) for foo +Selected version '1.0' (stable) for foo Need to get 0 B of source archives. 'file://${APTARCHIVE}/foo_1.0.dsc' foo_1.0.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e 'file://${APTARCHIVE}/foo_1.0.tar.gz' foo_1.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo/stable @@ -55,7 +55,7 @@ Need to get 0 B of source archives. # select by release with no binary package (Bug#731102) but ensure to get # higest version testequal "$HEADER -Selectied version '0.1' (wheezy) for foo +Selected version '0.1' (wheezy) for foo Need to get 0 B of source archives. 'file://${APTARCHIVE}/foo_0.1.dsc' foo_0.1.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e 'file://${APTARCHIVE}/foo_0.1.tar.gz' foo_0.1.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo/wheezy -- cgit v1.2.3 From 65dcff55dc5c9b47230d340a70c5067921eec4bf Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 10 Dec 2013 17:09:56 +0100 Subject: user-requested version tag gets precedence in apt-get source -t dist pkg=version requests --- test/integration/test-apt-get-source | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/integration') diff --git a/test/integration/test-apt-get-source b/test/integration/test-apt-get-source index b98ebbada..c8db4edbe 100755 --- a/test/integration/test-apt-get-source +++ b/test/integration/test-apt-get-source @@ -65,3 +65,8 @@ testequal "$HEADER E: Ignore unavailable 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 +testequal "$HEADER +Need to get 0 B of source archives. +'file://${APTARCHIVE}/foo_0.0.1.dsc' foo_0.0.1.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e +'file://${APTARCHIVE}/foo_0.0.1.tar.gz' foo_0.0.1.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris -t unstable foo=0.0.1 -- cgit v1.2.3 From adf379e7ad1900db6d3942ac7dca5cec4737d9a1 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 11 Dec 2013 08:21:04 +0100 Subject: add support for "apt-get source pkg:arch" --- test/integration/test-apt-get-source-arch | 60 +++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100755 test/integration/test-apt-get-source-arch (limited to 'test/integration') diff --git a/test/integration/test-apt-get-source-arch b/test/integration/test-apt-get-source-arch new file mode 100755 index 000000000..3ac6907a9 --- /dev/null +++ b/test/integration/test-apt-get-source-arch @@ -0,0 +1,60 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework + +setupenvironment +configarchitecture "i386" "amd64" + + +# different version for the individual arches +insertpackage 'stable' 'foo' 'amd64' '1.0' +insertsource 'stable' 'foo' 'amd64' '1.0' + +insertpackage 'stable' 'foo' 'i386' '1.0' +insertsource 'stable' 'foo' 'i386' '1.0' +insertpackage 'stable' 'foo' 'i386' '2.0' +insertsource 'stable' 'foo' 'i386' '2.0' + +insertpackage 'oldstable' 'foo' 'i386' '0.1' +insertsource 'oldstable' 'foo' 'i386' '0.1' +# just needed so that there is a release file entry for the test +insertpackage 'oldstable' 'unreleated' 'amd64' '0.1' + +setupaptarchive + +APTARCHIVE=$(readlink -f ./aptarchive) + +HEADER="Reading package lists... +Building dependency tree..." + +# pick :amd64 +testequal "$HEADER +Need to get 0 B of source archives. +'file://${APTARCHIVE}/foo_1.0.dsc' foo_1.0.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e +'file://${APTARCHIVE}/foo_1.0.tar.gz' foo_1.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo:amd64 + +# pick :i386 +testequal "$HEADER +Need to get 0 B of source archives. +'file://${APTARCHIVE}/foo_2.0.dsc' foo_2.0.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e +'file://${APTARCHIVE}/foo_2.0.tar.gz' foo_2.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo:i386 + +# pick :i386 by release +testequal "$HEADER +Selected version '0.1' (oldstable) for foo +Need to get 0 B of source archives. +'file://${APTARCHIVE}/foo_0.1.dsc' foo_0.1.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e +'file://${APTARCHIVE}/foo_0.1.tar.gz' foo_0.1.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo:i386/oldstable + +# pick :i386 by version +testequal "$HEADER +Need to get 0 B of source archives. +'file://${APTARCHIVE}/foo_1.0.dsc' foo_1.0.dsc 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e +'file://${APTARCHIVE}/foo_1.0.tar.gz' foo_1.0.tar.gz 0 MD5Sum:d41d8cd98f00b204e9800998ecf8427e" aptget source -q --print-uris foo:i386=1.0 + +# error on unknown arch +testequal "$HEADER +E: Can not find a package for architecture 'not-a-available-arch' +E: Unable to find a source package for foo:not-a-available-arch" aptget source -q --print-uris foo:not-a-available-arch -- cgit v1.2.3 From 37f45a579d4344c3ef6a044b12b992353e238301 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 11 Dec 2013 09:21:26 +0100 Subject: improve error message for apt-get source pkg:arch{=ver,/release} --- test/integration/test-apt-get-source-arch | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/integration') diff --git a/test/integration/test-apt-get-source-arch b/test/integration/test-apt-get-source-arch index 3ac6907a9..97d0e096a 100755 --- a/test/integration/test-apt-get-source-arch +++ b/test/integration/test-apt-get-source-arch @@ -58,3 +58,13 @@ Need to get 0 B of source archives. testequal "$HEADER E: Can not find a package for architecture 'not-a-available-arch' E: Unable to find a source package for foo:not-a-available-arch" aptget source -q --print-uris foo:not-a-available-arch + +# error on unavailable version for arch +testequal "$HEADER +E: Can not find a package 'foo:amd64' with version '2.0' and release '' +E: Unable to find a source package for foo:amd64=2.0" aptget source -q --print-uris foo:amd64=2.0 + +# error on unavailable release for arch +testequal "$HEADER +E: Can not find a package 'foo:amd64' with version '' and release 'oldstable' +E: Unable to find a source package for foo:amd64/oldstable" aptget source -q --print-uris foo:amd64/oldstable -- cgit v1.2.3 From c9829e0744ca678e105aa0af26b87588023d7536 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 11 Dec 2013 14:03:53 +0100 Subject: improve error message --- test/integration/test-apt-get-source-arch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/integration') diff --git a/test/integration/test-apt-get-source-arch b/test/integration/test-apt-get-source-arch index 97d0e096a..d7ed56dc9 100755 --- a/test/integration/test-apt-get-source-arch +++ b/test/integration/test-apt-get-source-arch @@ -61,10 +61,10 @@ E: Unable to find a source package for foo:not-a-available-arch" aptget source - # error on unavailable version for arch testequal "$HEADER -E: Can not find a package 'foo:amd64' with version '2.0' and release '' +E: Can not find a package 'foo:amd64' with version '2.0' E: Unable to find a source package for foo:amd64=2.0" aptget source -q --print-uris foo:amd64=2.0 # error on unavailable release for arch testequal "$HEADER -E: Can not find a package 'foo:amd64' with version '' and release 'oldstable' +E: Can not find a package 'foo:amd64' with release 'oldstable' E: Unable to find a source package for foo:amd64/oldstable" aptget source -q --print-uris foo:amd64/oldstable -- cgit v1.2.3 From fc85b0d8f3c2d63efcad2590e021d70c2ba700da Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 11 Dec 2013 15:08:30 +0100 Subject: fix test/integration/test-apt-key-net-update (code copy/DRY violation) --- test/integration/test-apt-key-net-update | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test/integration') diff --git a/test/integration/test-apt-key-net-update b/test/integration/test-apt-key-net-update index d5205836f..2e72d1d62 100755 --- a/test/integration/test-apt-key-net-update +++ b/test/integration/test-apt-key-net-update @@ -24,6 +24,21 @@ GPG_CMD="gpg --ignore-time-conflict --no-options --no-default-keyring" GPG="$GPG_CMD --keyring $TRUSTEDFILE" MASTER_KEYRING=/usr/share/keyrings/ubuntu-master-keyring.gpg +# 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 msgtest "add_keys_with_verify_against_master_keyring" if [ ! -e $MASTER_KEYRING ]; then -- cgit v1.2.3 From 017d3f3b4b0da976b1d2ecfcd26251369c5aec88 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 12 Dec 2013 07:41:17 +0100 Subject: clarify error message when apt-get source=ver fails, print a real error message instead of "ignoring" --- test/integration/test-apt-get-source | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/integration') 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 -- cgit v1.2.3 From 9b7c10509c534b7d413b5102231cb0ca387f1c65 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 12 Dec 2013 07:49:43 +0100 Subject: fix test/integration/test-apt-key-net-update --- test/integration/test-apt-key-net-update | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'test/integration') diff --git a/test/integration/test-apt-key-net-update b/test/integration/test-apt-key-net-update index 2e72d1d62..73545aff7 100755 --- a/test/integration/test-apt-key-net-update +++ b/test/integration/test-apt-key-net-update @@ -21,8 +21,9 @@ 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" -GPG="$GPG_CMD --keyring $TRUSTEDFILE" -MASTER_KEYRING=/usr/share/keyrings/ubuntu-master-keyring.gpg + +# FIXME: instead of copying this use apt-key and the buildin apt webserver +# to do a real test # COPYIED from apt-key.in -------------- @@ -40,6 +41,9 @@ 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" -- cgit v1.2.3 From c23e6cd58242470daad78ddad85285f9cd7aed0f Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 12 Dec 2013 15:11:01 +0100 Subject: Fix conffile prompt regression (LP: #1260297) This fixes a regression in the conffile prompt for the progress-fd and adds a testcase to ensure this does not regress again. --- test/integration/test-apt-progress-fd-conffile | 43 ++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 test/integration/test-apt-progress-fd-conffile (limited to 'test/integration') 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 -- cgit v1.2.3