From c4ffa0428b617cd844f0f9dfd5d16ae0553675ac Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 26 Sep 2014 20:59:56 +0200 Subject: Print warning for unauthenticated repositories --- .../integration/test-apt-get-update-unauth-warning | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 test/integration/test-apt-get-update-unauth-warning (limited to 'test/integration/test-apt-get-update-unauth-warning') diff --git a/test/integration/test-apt-get-update-unauth-warning b/test/integration/test-apt-get-update-unauth-warning new file mode 100755 index 000000000..4411a7430 --- /dev/null +++ b/test/integration/test-apt-get-update-unauth-warning @@ -0,0 +1,30 @@ +#!/bin/sh +# +# ensure we print warnings for unauthenticated repositories +# +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework + +setupenvironment +configarchitecture "i386" + +# a "normal" package with source and binary +buildsimplenativepackage 'foo' 'all' '2.0' + +setupaptarchive --no-update + +APTARCHIVE=$(readlink -f ./aptarchive) +rm -f $APTARCHIVE/dists/unstable/*Release* + +# update without authenticated InRelease file +testequal "Ign file: unstable InRelease +Ign file: unstable Release +Reading package lists... +W: The data from 'file: unstable Release' is not signed. Packages from that repository can not be authenticated." aptget update + +# ensure we can not install the package +testequal "WARNING: The following packages cannot be authenticated! + foo +E: There are problems and -y was used without --force-yes" aptget install -qq -y foo -- cgit v1.2.3 From bca84917c326fa3158e120147c8aecebe0789b47 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 26 Sep 2014 22:45:18 +0200 Subject: test fixes --- test/integration/test-apt-get-update-unauth-warning | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'test/integration/test-apt-get-update-unauth-warning') diff --git a/test/integration/test-apt-get-update-unauth-warning b/test/integration/test-apt-get-update-unauth-warning index 4411a7430..b1c676738 100755 --- a/test/integration/test-apt-get-update-unauth-warning +++ b/test/integration/test-apt-get-update-unauth-warning @@ -18,11 +18,21 @@ setupaptarchive --no-update APTARCHIVE=$(readlink -f ./aptarchive) rm -f $APTARCHIVE/dists/unstable/*Release* -# update without authenticated InRelease file +# update without authenticated files leads to warning testequal "Ign file: unstable InRelease Ign file: unstable Release Reading package lists... -W: The data from 'file: unstable Release' is not signed. Packages from that repository can not be authenticated." aptget update +W: The data from 'file: unstable Release' is not signed. Packages from that repository can not be authenticated. +W: Use --allow-unauthenticated to force the update" aptget update + +# no package foo +testequal "Listing..." apt list foo + +# allow override +testequal "Ign file: unstable InRelease +Ign file: unstable Release +Reading package lists... +W: The data from 'file: unstable Release' is not signed. Packages from that repository can not be authenticated." aptget update --allow-unauthenticated # ensure we can not install the package testequal "WARNING: The following packages cannot be authenticated! -- cgit v1.2.3 From c99fe2e169243fc6e1a3278ce3768f0f521e260b Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 1 Oct 2014 12:21:55 +0200 Subject: Use Acquire::Allow{InsecureRepositories,DowngradeToInsecureRepositories} The configuration key Acquire::AllowInsecureRepositories controls if apt allows loading of unsigned repositories at all. The configuration Acquire::AllowDowngradeToInsecureRepositories controls if a signed repository can ever become unsigned. This should really never be needed but we provide it to avoid having to mess around in /var/lib/apt/lists if there is a use-case for this (which I can't think of right now). --- test/integration/test-apt-get-update-unauth-warning | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/integration/test-apt-get-update-unauth-warning') diff --git a/test/integration/test-apt-get-update-unauth-warning b/test/integration/test-apt-get-update-unauth-warning index b1c676738..510249747 100755 --- a/test/integration/test-apt-get-update-unauth-warning +++ b/test/integration/test-apt-get-update-unauth-warning @@ -23,7 +23,7 @@ testequal "Ign file: unstable InRelease Ign file: unstable Release Reading package lists... W: The data from 'file: unstable Release' is not signed. Packages from that repository can not be authenticated. -W: Use --allow-unauthenticated to force the update" aptget update +W: Use --allow-insecure-repositories to force the update" aptget update # no package foo testequal "Listing..." apt list foo @@ -32,7 +32,7 @@ testequal "Listing..." apt list foo testequal "Ign file: unstable InRelease Ign file: unstable Release Reading package lists... -W: The data from 'file: unstable Release' is not signed. Packages from that repository can not be authenticated." aptget update --allow-unauthenticated +W: The data from 'file: unstable Release' is not signed. Packages from that repository can not be authenticated." aptget update --allow-insecure-repositories # ensure we can not install the package testequal "WARNING: The following packages cannot be authenticated! -- cgit v1.2.3 From 0f56b51e125d24cf5af68459077ad1b682743bc2 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 6 Oct 2014 09:34:06 +0200 Subject: update test --- test/integration/test-apt-get-update-unauth-warning | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'test/integration/test-apt-get-update-unauth-warning') diff --git a/test/integration/test-apt-get-update-unauth-warning b/test/integration/test-apt-get-update-unauth-warning index 510249747..75863615e 100755 --- a/test/integration/test-apt-get-update-unauth-warning +++ b/test/integration/test-apt-get-update-unauth-warning @@ -20,13 +20,17 @@ rm -f $APTARCHIVE/dists/unstable/*Release* # update without authenticated files leads to warning testequal "Ign file: unstable InRelease -Ign file: unstable Release -Reading package lists... +Err file: unstable Release + W: The data from 'file: unstable Release' is not signed. Packages from that repository can not be authenticated. -W: Use --allow-insecure-repositories to force the update" aptget update +W: Use --allow-insecure-repositories to force the update +W: Failed to fetch file:$APTARCHIVE/dists/unstable/Release + +E: Some index files failed to download. They have been ignored, or old ones used instead." aptget update # no package foo testequal "Listing..." apt list foo +testequal "partial" ls rootdir/var/lib/apt/lists # allow override testequal "Ign file: unstable InRelease -- cgit v1.2.3 From 673c9469abd656a92c7e8f1f91f919cad09f391e Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 6 Oct 2014 14:34:38 +0200 Subject: cleanup pkgAcq*::Failed() --- test/integration/test-apt-get-update-unauth-warning | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/integration/test-apt-get-update-unauth-warning') diff --git a/test/integration/test-apt-get-update-unauth-warning b/test/integration/test-apt-get-update-unauth-warning index 75863615e..37bcea623 100755 --- a/test/integration/test-apt-get-update-unauth-warning +++ b/test/integration/test-apt-get-update-unauth-warning @@ -22,7 +22,7 @@ rm -f $APTARCHIVE/dists/unstable/*Release* testequal "Ign file: unstable InRelease Err file: unstable Release -W: The data from 'file: unstable Release' is not signed. Packages from that repository can not be authenticated. +W: The repository 'file: unstable Release' does not have a Release file. This is deprecated, please contact the owner of the repository. W: Use --allow-insecure-repositories to force the update W: Failed to fetch file:$APTARCHIVE/dists/unstable/Release -- cgit v1.2.3 From 42299a28ac40721f6cf29c9b786924c2cd4a210f Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 6 Oct 2014 14:43:05 +0200 Subject: fix test --- test/integration/test-apt-get-update-unauth-warning | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'test/integration/test-apt-get-update-unauth-warning') diff --git a/test/integration/test-apt-get-update-unauth-warning b/test/integration/test-apt-get-update-unauth-warning index 37bcea623..27160b5f9 100755 --- a/test/integration/test-apt-get-update-unauth-warning +++ b/test/integration/test-apt-get-update-unauth-warning @@ -36,8 +36,7 @@ testequal "partial" ls rootdir/var/lib/apt/lists testequal "Ign file: unstable InRelease Ign file: unstable Release Reading package lists... -W: The data from 'file: unstable Release' is not signed. Packages from that repository can not be authenticated." aptget update --allow-insecure-repositories - +W: The repository 'file: unstable Release' does not have a Release file. This is deprecated, please contact the owner of the repository." aptget update --allow-insecure-repositories # ensure we can not install the package testequal "WARNING: The following packages cannot be authenticated! foo -- cgit v1.2.3 From 4dbfe436c60880f2625e4d3a9d0127a83dd6276e Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 7 Oct 2014 01:46:30 +0200 Subject: display errortext for all Err as well as Ign logs consistently using Item::Failed in all specializec classes helps setting up some information bits otherwise unset, so some errors had an empty reason as an error. Ign is upgraded to display the error message we ignored to further help in understanding what happens. --- test/integration/test-apt-get-update-unauth-warning | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'test/integration/test-apt-get-update-unauth-warning') diff --git a/test/integration/test-apt-get-update-unauth-warning b/test/integration/test-apt-get-update-unauth-warning index 27160b5f9..8e212a3c4 100755 --- a/test/integration/test-apt-get-update-unauth-warning +++ b/test/integration/test-apt-get-update-unauth-warning @@ -20,11 +20,12 @@ rm -f $APTARCHIVE/dists/unstable/*Release* # update without authenticated files leads to warning testequal "Ign file: unstable InRelease + File not found Err file: unstable Release - + File not found W: The repository 'file: unstable Release' does not have a Release file. This is deprecated, please contact the owner of the repository. W: Use --allow-insecure-repositories to force the update -W: Failed to fetch file:$APTARCHIVE/dists/unstable/Release +W: Failed to fetch file:$APTARCHIVE/dists/unstable/Release File not found E: Some index files failed to download. They have been ignored, or old ones used instead." aptget update @@ -34,7 +35,9 @@ testequal "partial" ls rootdir/var/lib/apt/lists # allow override testequal "Ign file: unstable InRelease + File not found Ign file: unstable Release + File not found Reading package lists... W: The repository 'file: unstable Release' does not have a Release file. This is deprecated, please contact the owner of the repository." aptget update --allow-insecure-repositories # ensure we can not install the package -- cgit v1.2.3 From 9d653a6de2ca952247cc4e628256259d225570a6 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 13 Oct 2014 09:54:21 +0200 Subject: fix compile and tests error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I am pretty sure I did that before committing broken stuff… Git-Dch: Ignore --- test/integration/test-apt-get-update-unauth-warning | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'test/integration/test-apt-get-update-unauth-warning') diff --git a/test/integration/test-apt-get-update-unauth-warning b/test/integration/test-apt-get-update-unauth-warning index 8e212a3c4..fe0cb45a4 100755 --- a/test/integration/test-apt-get-update-unauth-warning +++ b/test/integration/test-apt-get-update-unauth-warning @@ -24,10 +24,7 @@ testequal "Ign file: unstable InRelease Err file: unstable Release File not found W: The repository 'file: unstable Release' does not have a Release file. This is deprecated, please contact the owner of the repository. -W: Use --allow-insecure-repositories to force the update -W: Failed to fetch file:$APTARCHIVE/dists/unstable/Release File not found - -E: Some index files failed to download. They have been ignored, or old ones used instead." aptget update +E: Use --allow-insecure-repositories to force the update" aptget update # no package foo testequal "Listing..." apt list foo -- cgit v1.2.3 From 68ba0b7f4e1c03edfb6f621e7e7314ea610af96b Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 15 Oct 2014 03:47:50 +0200 Subject: testcases runable as root Running the testcases is usually not a good idea, but it can be handy to check if the privilege dropping works. Git-Dch: Ignore --- test/integration/test-apt-get-update-unauth-warning | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/integration/test-apt-get-update-unauth-warning') diff --git a/test/integration/test-apt-get-update-unauth-warning b/test/integration/test-apt-get-update-unauth-warning index fe0cb45a4..0389415c1 100755 --- a/test/integration/test-apt-get-update-unauth-warning +++ b/test/integration/test-apt-get-update-unauth-warning @@ -24,7 +24,7 @@ testequal "Ign file: unstable InRelease Err file: unstable Release File not found W: The repository 'file: unstable Release' does not have a Release file. This is deprecated, please contact the owner of the repository. -E: Use --allow-insecure-repositories to force the update" aptget update +E: Use --allow-insecure-repositories to force the update" aptget update --no-allow-insecure-repositories # no package foo testequal "Listing..." apt list foo -- cgit v1.2.3 From 546dbfc82ad9ff0308b365bca3731a1118b1d251 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 9 Nov 2014 21:26:20 +0100 Subject: disable the lock disabling in the tests We create our own directories here and work without root in them, so we can also test the locking with them as it is how we usually operate. Git-Dch: Ignore --- test/integration/test-apt-get-update-unauth-warning | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'test/integration/test-apt-get-update-unauth-warning') diff --git a/test/integration/test-apt-get-update-unauth-warning b/test/integration/test-apt-get-update-unauth-warning index 0389415c1..80c51152d 100755 --- a/test/integration/test-apt-get-update-unauth-warning +++ b/test/integration/test-apt-get-update-unauth-warning @@ -27,8 +27,9 @@ W: The repository 'file: unstable Release' does not have a Release file. This is E: Use --allow-insecure-repositories to force the update" aptget update --no-allow-insecure-repositories # no package foo -testequal "Listing..." apt list foo -testequal "partial" ls rootdir/var/lib/apt/lists +testequal 'Listing...' apt list foo +testequal 'lock +partial' ls rootdir/var/lib/apt/lists # allow override testequal "Ign file: unstable InRelease -- cgit v1.2.3 From 25b86db159fbc3c043628e285c0c1ef24dec2c6e Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 10 Mar 2015 00:59:44 +0100 Subject: test exitcode as well as string equality We use test{success,failure} now all over the place in the framework, so its only consequencial to do this in the situations in which we test for a specific output as well. Git-Dch: Ignore --- test/integration/test-apt-get-update-unauth-warning | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/integration/test-apt-get-update-unauth-warning') diff --git a/test/integration/test-apt-get-update-unauth-warning b/test/integration/test-apt-get-update-unauth-warning index 80c51152d..81c01ba3e 100755 --- a/test/integration/test-apt-get-update-unauth-warning +++ b/test/integration/test-apt-get-update-unauth-warning @@ -19,7 +19,7 @@ APTARCHIVE=$(readlink -f ./aptarchive) rm -f $APTARCHIVE/dists/unstable/*Release* # update without authenticated files leads to warning -testequal "Ign file: unstable InRelease +testfailureequal "Ign file: unstable InRelease File not found Err file: unstable Release File not found @@ -27,18 +27,18 @@ W: The repository 'file: unstable Release' does not have a Release file. This is E: Use --allow-insecure-repositories to force the update" aptget update --no-allow-insecure-repositories # no package foo -testequal 'Listing...' apt list foo +testsuccessequal 'Listing...' apt list foo testequal 'lock partial' ls rootdir/var/lib/apt/lists # allow override -testequal "Ign file: unstable InRelease +testwarningequal "Ign file: unstable InRelease File not found Ign file: unstable Release File not found Reading package lists... W: The repository 'file: unstable Release' does not have a Release file. This is deprecated, please contact the owner of the repository." aptget update --allow-insecure-repositories # ensure we can not install the package -testequal "WARNING: The following packages cannot be authenticated! +testfailureequal "WARNING: The following packages cannot be authenticated! foo E: There are problems and -y was used without --force-yes" aptget install -qq -y foo -- cgit v1.2.3