diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2011-11-10 16:10:55 +0100 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2011-11-10 16:10:55 +0100 |
commit | 37adedc9d0b66eeae7efb88aebd08dfbc6e06f77 (patch) | |
tree | b0769df88e2b6496f23e3d899aeb1c240a3488d9 /test/integration/test-policy-pinning | |
parent | cf4f17a9d87a36b20ef5afa2cb5145e466d8ad3b (diff) | |
parent | 04340db392f14e2610189db6f8787e10fbf3c6d0 (diff) |
merged from lp:~donkult/apt/experimental
Diffstat (limited to 'test/integration/test-policy-pinning')
-rwxr-xr-x | test/integration/test-policy-pinning | 58 |
1 files 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 |