From 451ea3d4046d95a82856b78087449519ec7e8487 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 15 Sep 2011 11:02:43 +0200 Subject: update the test to ensure that NotAutomatic and co is used also if the archive is signed, but the signature can't be checked as the key is missing (debbugs #597301 - fix in r2105) --- test/integration/test-policy-pinning | 58 +++++++++++++++++++++++++++++++----- 1 file changed, 50 insertions(+), 8 deletions(-) diff --git a/test/integration/test-policy-pinning b/test/integration/test-policy-pinning index 6b1473564..9e1ea4ac5 100755 --- a/test/integration/test-policy-pinning +++ b/test/integration/test-policy-pinning @@ -25,28 +25,70 @@ testequalpolicy() { Pinned packages:" aptcache policy $* } -aptget update -qq +aptgetupdate() { + # just to be sure that no old files are used + rm -rf rootdir/var/lib/apt + if aptget update -qq 2>&1 | grep '^E: '; then + msgwarn 'apt-get update failed with an error' + fi +} + +### not signed archive + +aptgetupdate testequalpolicy 100 500 testequalpolicy 990 500 -t now sed -i aptarchive/Release -e 1i"NotAutomatic: yes" -aptget update -qq +aptgetupdate testequalpolicy 100 1 -o Test=NotAutomatic testequalpolicy 990 1 -o Test=NotAutomatic -t now sed -i aptarchive/Release -e 1i"ButAutomaticUpgrades: yes" -aptget update -qq +aptgetupdate testequalpolicy 100 100 -o Test=ButAutomaticUpgrades testequalpolicy 990 100 -o Test=ButAutomaticUpgrades -t now sed -i aptarchive/Release -e 's#NotAutomatic: yes#NotAutomatic: no#' -e '/ButAutomaticUpgrades: / d' -aptget update -qq +aptgetupdate testequalpolicy 100 500 -o Test=Automatic testequalpolicy 990 500 -o Test=Automatic -t now +sed -i aptarchive/Release -e '/NotAutomatic: / d' -e '/ButAutomaticUpgrades: / d' + +### signed but no key in trusted + +signreleasefiles 'Marvin Paranoid' +aptgetupdate +testequalpolicy 100 500 +testequalpolicy 990 500 -t now + +sed -i aptarchive/Release -e 1i"NotAutomatic: yes" +signreleasefiles 'Marvin Paranoid' +aptgetupdate + +testequalpolicy 100 1 -o Test=NotAutomatic +testequalpolicy 990 1 -o Test=NotAutomatic -t now + +sed -i aptarchive/Release -e 1i"ButAutomaticUpgrades: yes" +signreleasefiles 'Marvin Paranoid' +aptgetupdate + +testequalpolicy 100 100 -o Test=ButAutomaticUpgrades +testequalpolicy 990 100 -o Test=ButAutomaticUpgrades -t now + +sed -i aptarchive/Release -e 's#NotAutomatic: yes#NotAutomatic: no#' -e '/ButAutomaticUpgrades: / d' +signreleasefiles 'Marvin Paranoid' +aptgetupdate + +testequalpolicy 100 500 -o Test=Automatic +testequalpolicy 990 500 -o Test=Automatic -t now + +### signed and valid key + buildsimplenativepackage "coolstuff" "all" "1.0" "stable" buildsimplenativepackage "coolstuff" "all" "2.0~bpo1" "backports" @@ -132,7 +174,7 @@ Pin-Priority: -1" > rootdir/etc/apt/preferences rm rootdir/etc/apt/preferences sed -i aptarchive/dists/backports/Release -e 1i"NotAutomatic: yes" signreleasefiles -aptget update -qq +aptgetupdate testequalpolicycoolstuff "" "1.0" 1 500 0 "" -o Test=NotAutomatic testequalpolicycoolstuff "" "1.0" 1 990 0 "" -o Test=NotAutomatic -t stable @@ -160,7 +202,7 @@ testequalpolicycoolstuff "" "1.0" 1 990 600 "2.0~bpo1" -o Test=NotAutomatic -t s rm rootdir/etc/apt/preferences sed -i aptarchive/dists/backports/Release -e 1i"ButAutomaticUpgrades: yes" signreleasefiles -aptget update -qq +aptgetupdate testequalpolicycoolstuff "" "1.0" 100 500 0 "" -o Test=ButAutomaticUpgrades testequalpolicycoolstuff "" "1.0" 100 990 0 "" -o Test=ButAutomaticUpgrades -t stable @@ -206,7 +248,7 @@ setupaptarchive sed -i aptarchive/dists/backports/Release -e 1i"NotAutomatic: yes" signreleasefiles -aptget update -qq +aptgetupdate testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 1 500 0 "" "2.0~bpo2" -o Test=NotAutomatic testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 1 990 0 "" "2.0~bpo2" -o Test=NotAutomatic -t stable @@ -214,7 +256,7 @@ testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo2" 990 500 0 "" "2.0~bpo2" -o Test=N sed -i aptarchive/dists/backports/Release -e 1i"ButAutomaticUpgrades: yes" signreleasefiles -aptget update -qq +aptgetupdate testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo2" 100 500 0 "" "2.0~bpo2" -o Test=ButAutomaticUpgrades testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo2" 100 990 0 "" "2.0~bpo2" -o Test=ButAutomaticUpgrades -t stable -- cgit v1.2.3