]> git.saurik.com Git - apt.git/commitdiff
Fix test case breakage from the new policy implementation
authorJulian Andres Klode <jak@debian.org>
Mon, 10 Aug 2015 13:36:51 +0000 (15:36 +0200)
committerJulian Andres Klode <jak@debian.org>
Mon, 10 Aug 2015 13:36:51 +0000 (15:36 +0200)
Everything's working now.

test/integration/test-acquire-same-repository-multiple-times
test/integration/test-apt-translation-has-no-packages
test/integration/test-bug-543966-downgrade-below-1000-pin
test/integration/test-cve-2013-1051-InRelease-parsing
test/integration/test-policy-pinning

index a46e0d73ca83f4342db5f65639a654d07623cd0e..ad9cd6d7e76461be60813737101ee8b6f6a99414 100755 (executable)
@@ -50,7 +50,7 @@ tworepos() {
   Installed: (none)
   Candidate: 1.0
   Version table:
-     1.0 0
+     1.0 500
         500 $1:$2 jessie/main amd64 Packages
         500 $1:$2 stable/main amd64 Packages" aptcache policy foo
        testfailure aptcache show foo/unstable
index cf5b56243eee5e8e7fc82acb6c9e3f122a351ecb..ec2e1e43b0db99f060b31f080ddc06d6d3b2a537 100755 (executable)
@@ -37,5 +37,5 @@ testsuccessequal "foo:
   Installed: (none)
   Candidate: 1.0
   Version table:
-     1.0 0
+     1.0 500
         500 file:$APTARCHIVE unstable/main amd64 Packages" aptcache policy foo
index 18039386749d75c06f1f9b63bb6b253b16d07ee7..ede9ad6aa6bfce0f0b7eecf64c51005b72b4beca 100755 (executable)
@@ -19,9 +19,9 @@ testsuccessequal "base-files:
   Installed: 5.0.0-1
   Candidate: 5.0.0-1
   Version table:
- *** 5.0.0-1 0
+ *** 5.0.0-1 100
         100 $STATUS
-     5.0.0 0
+     5.0.0 500
         500 file:${APTARCHIVE} unstable/main i386 Packages" aptcache policy base-files -o apt::pin=0
 
 writepin() {
@@ -34,7 +34,7 @@ Pin-Priority: $2" > rootdir/etc/apt/preferences
 
 testpinning() {
        local PKGPIN=''
-       local PKGPINPRIO='0'
+       local PKGPINPRIO=''
        local REPPINPRIO=''
        if [ "$1" != '*' ]; then
                PKGPINPRIO=''
@@ -47,7 +47,7 @@ testpinning() {
   Installed: 5.0.0-1
   Candidate: 5.0.0-1
   ${PKGPIN}Version table:
- *** 5.0.0-1 ${PKGPINPRIO:-99}
+ *** 5.0.0-1 100
         100 $STATUS
      5.0.0 ${PKGPINPRIO:-99}
        ${REPPINPRIO:-  99} file:${APTARCHIVE} unstable/main i386 Packages" aptcache policy base-files -o apt::pin=99
@@ -57,7 +57,7 @@ testpinning() {
   Installed: 5.0.0-1
   Candidate: 5.0.0-1
   ${PKGPIN}Version table:
- *** 5.0.0-1 ${PKGPINPRIO:-100}
+ *** 5.0.0-1 100
         100 $STATUS
      5.0.0 ${PKGPINPRIO:-100}
        ${REPPINPRIO:- 100} file:${APTARCHIVE} unstable/main i386 Packages" aptcache policy base-files -o apt::pin=100
@@ -67,7 +67,7 @@ testpinning() {
   Installed: 5.0.0-1
   Candidate: 5.0.0-1
   ${PKGPIN}Version table:
- *** 5.0.0-1 ${PKGPINPRIO:-999}
+ *** 5.0.0-1 100
         100 $STATUS
      5.0.0 ${PKGPINPRIO:-999}
        ${REPPINPRIO:- 999} file:${APTARCHIVE} unstable/main i386 Packages" aptcache policy base-files -o apt::pin=999
@@ -77,7 +77,7 @@ testpinning() {
   Installed: 5.0.0-1
   Candidate: 5.0.0
   ${PKGPIN}Version table:
- *** 5.0.0-1 ${PKGPINPRIO:-1000}
+ *** 5.0.0-1 100
         100 $STATUS
      5.0.0 ${PKGPINPRIO:-1000}
        ${REPPINPRIO:-1000} file:${APTARCHIVE} unstable/main i386 Packages" aptcache policy base-files -o apt::pin=1000
index 933cbbd921b49760d3776d385fd9975e97bebd69..a503ad0fea82734e7ea8af0a99dad6f99ad94c4d 100755 (executable)
@@ -21,7 +21,7 @@ testsuccessequal "good-pkg:
   Installed: (none)
   Candidate: 1.0
   Version table:
-     1.0 0
+     1.0 500
         500 ${ARCHIVE} stable/main i386 Packages" aptcache policy good-pkg
 
 # now exchange to the Packages file, note that this could be
@@ -62,5 +62,5 @@ testsuccessequal "good-pkg:
   Installed: (none)
   Candidate: 1.0
   Version table:
-     1.0 0
+     1.0 500
         500 ${ARCHIVE} stable/main i386 Packages" aptcache policy good-pkg
index 9f7f457ae426b8e6f5f59229986b7412e2bd49cc..c4f478efceaa84753101457922cfeaa34a55605d 100755 (executable)
@@ -105,10 +105,11 @@ testequalpolicycoolstuff() {
        local BPO1ARCHIVE=""
        local BPO2ARCHIVE=""
        if [ ! "$7" = "2.0~bpo2" ]; then
+               BPO1PIN="$AB"
                BPO1ARCHIVE="        $(echo "$AB" | awk '{ printf("%3s\n",$0) }') file:${APTARCHIVE} backports/main i386 Packages"
        else
                BPO2ARCHIVE="
-     2.0~bpo2 $PB
+     2.0~bpo2 $AB
         $(echo "$AB" | awk '{ printf("%3s\n",$0) }') file:${APTARCHIVE} backports/main i386 Packages"
                SB="$(echo "$SB" | tail -n 1)"
                shift
@@ -120,25 +121,25 @@ testequalpolicycoolstuff() {
   ${PINVERSION}Version table:${BPO2ARCHIVE}
  $IB 2.0~bpo1 $PB
 ${BPO1ARCHIVE}$SB
- $IS 1.0 $PB
+ $IS 1.0 $AS
         $(echo "$AS" | awk '{ printf("%3s\n",$0) }') file:${APTARCHIVE} stable/main i386 Packages$SS" \
                aptcache policy coolstuff -o Policy=${INSTALLED}-${CANDIDATE}-${AB}-${AS}-${PB} $*
 }
 
-testequalpolicycoolstuff "" "2.0~bpo1" 500 500 0 ""
-testequalpolicycoolstuff "" "1.0" 500 990 0 "" -t stable
-testequalpolicycoolstuff "" "2.0~bpo1" 990 500 0 "" -t backports
+testequalpolicycoolstuff "" "2.0~bpo1" 500 500 500 ""
+testequalpolicycoolstuff "" "1.0" 500 990 500 "" -t stable
+testequalpolicycoolstuff "" "2.0~bpo1" 990 500 990 "" -t backports
 echo "Package: *
 Pin: release n=backports
 Pin-Priority: 200" > rootdir/etc/apt/preferences
-testequalpolicycoolstuff "" "1.0" 200 500 0 "" -o Test=GlobalPin
-testequalpolicycoolstuff "" "1.0" 200 990 0 "" -o Test=GlobalPin -t stable
-testequalpolicycoolstuff "" "2.0~bpo1" 990 500 0 "" -o Test=GlobalPin -t backports
+testequalpolicycoolstuff "" "1.0" 200 500 200 "" -o Test=GlobalPin
+testequalpolicycoolstuff "" "1.0" 200 990 200 "" -o Test=GlobalPin -t stable
+testequalpolicycoolstuff "" "2.0~bpo1" 990 500 990 "" -o Test=GlobalPin -t backports
 echo "Package: *
 Pin: release n=backports
 Pin-Priority: 600" > rootdir/etc/apt/preferences
-testequalpolicycoolstuff "" "2.0~bpo1" 600 500 0 "" -o Test=GlobalPin
-testequalpolicycoolstuff "" "1.0" 600 990 0 "" -o Test=GlobalPin -t stable
+testequalpolicycoolstuff "" "2.0~bpo1" 600 500 600 "" -o Test=GlobalPin
+testequalpolicycoolstuff "" "1.0" 600 990 600 "" -o Test=GlobalPin -t stable
 echo "Package: coolstuff
 Pin: release n=backports
 Pin-Priority: 200" > rootdir/etc/apt/preferences
@@ -165,18 +166,18 @@ sed -i aptarchive/dists/backports/Release -e 1i"NotAutomatic: yes"
 signreleasefiles
 aptgetupdate
 
-testequalpolicycoolstuff "" "1.0" 1 500 0 "" -o Test=NotAutomatic
-testequalpolicycoolstuff "" "1.0" 1 990 0 "" -o Test=NotAutomatic -t stable
-testequalpolicycoolstuff "" "2.0~bpo1" 990 500 0 "" -o Test=NotAutomatic -t backports
+testequalpolicycoolstuff "" "1.0" 1 500 1 "" -o Test=NotAutomatic
+testequalpolicycoolstuff "" "1.0" 1 990 1 "" -o Test=NotAutomatic -t stable
+testequalpolicycoolstuff "" "2.0~bpo1" 990 500 990 "" -o Test=NotAutomatic -t backports
 echo "Package: *
 Pin: release n=backports
 Pin-Priority: 200" > rootdir/etc/apt/preferences
-testequalpolicycoolstuff "" "1.0" 200 500 0 "" -o Test=NotAutomatic
+testequalpolicycoolstuff "" "1.0" 200 500 200 "" -o Test=NotAutomatic
 echo "Package: *
 Pin: release n=backports
 Pin-Priority: 600" > rootdir/etc/apt/preferences
-testequalpolicycoolstuff "" "2.0~bpo1" 600 500 0 "" -o Test=NotAutomatic
-testequalpolicycoolstuff "" "1.0" 600 990 0 "" -o Test=NotAutomatic -t stable
+testequalpolicycoolstuff "" "2.0~bpo1" 600 500 600 "" -o Test=NotAutomatic
+testequalpolicycoolstuff "" "1.0" 600 990 600 "" -o Test=NotAutomatic -t stable
 echo "Package: coolstuff
 Pin: release n=backports
 Pin-Priority: 200" > rootdir/etc/apt/preferences
@@ -193,18 +194,18 @@ sed -i aptarchive/dists/backports/Release -e 1i"ButAutomaticUpgrades: yes"
 signreleasefiles
 aptgetupdate
 
-testequalpolicycoolstuff "" "1.0" 100 500 0 "" -o Test=ButAutomaticUpgrades
-testequalpolicycoolstuff "" "1.0" 100 990 0 "" -o Test=ButAutomaticUpgrades -t stable
-testequalpolicycoolstuff "" "2.0~bpo1" 990 500 0 "" -o Test=ButAutomaticUpgrades -t backports
+testequalpolicycoolstuff "" "1.0" 100 500 100 "" -o Test=ButAutomaticUpgrades
+testequalpolicycoolstuff "" "1.0" 100 990 100 "" -o Test=ButAutomaticUpgrades -t stable
+testequalpolicycoolstuff "" "2.0~bpo1" 990 500 990 "" -o Test=ButAutomaticUpgrades -t backports
 echo "Package: *
 Pin: release n=backports
 Pin-Priority: 200" > rootdir/etc/apt/preferences
-testequalpolicycoolstuff "" "1.0" 200 500 0 "" -o Test=ButAutomaticUpgrades
+testequalpolicycoolstuff "" "1.0" 200 500 200 "" -o Test=ButAutomaticUpgrades
 echo "Package: *
 Pin: release n=backports
 Pin-Priority: 600" > rootdir/etc/apt/preferences
-testequalpolicycoolstuff "" "2.0~bpo1" 600 500 0 "" -o Test=ButAutomaticUpgrades
-testequalpolicycoolstuff "" "1.0" 600 990 0 "" -o Test=ButAutomaticUpgrades -t stable
+testequalpolicycoolstuff "" "2.0~bpo1" 600 500 600 "" -o Test=ButAutomaticUpgrades
+testequalpolicycoolstuff "" "1.0" 600 990 600 "" -o Test=ButAutomaticUpgrades -t stable
 echo "Package: coolstuff
 Pin: release n=backports
 Pin-Priority: 200" > rootdir/etc/apt/preferences
@@ -218,18 +219,18 @@ testequalpolicycoolstuff "" "1.0" 100 990 600 "2.0~bpo1" -o Test=ButAutomaticUpg
 
 rm rootdir/etc/apt/preferences
 testsuccess aptget install coolstuff -y
-testequalpolicycoolstuff "1.0" "1.0" 100 500 0 "" -o Test=ButAutomaticUpgrades
+testequalpolicycoolstuff "1.0" "1.0" 100 500 100 "" -o Test=ButAutomaticUpgrades
 testsuccess aptget dist-upgrade -y
-testequalpolicycoolstuff "1.0" "1.0" 100 500 0 "" -o Test=ButAutomaticUpgrades
-testequalpolicycoolstuff "1.0" "1.0" 100 990 0 "" -o Test=ButAutomaticUpgrades -t stable
-testequalpolicycoolstuff "1.0" "2.0~bpo1" 990 500 0 "" -o Test=ButAutomaticUpgrades -t backports
+testequalpolicycoolstuff "1.0" "1.0" 100 500 100 "" -o Test=ButAutomaticUpgrades
+testequalpolicycoolstuff "1.0" "1.0" 100 990 100 "" -o Test=ButAutomaticUpgrades -t stable
+testequalpolicycoolstuff "1.0" "2.0~bpo1" 990 500 990 "" -o Test=ButAutomaticUpgrades -t backports
 
 testsuccess aptget install coolstuff -t backports -y
-testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 100 500 0 "" -o Test=ButAutomaticUpgrades
+testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 100 500 100 "" -o Test=ButAutomaticUpgrades
 testsuccess aptget dist-upgrade -y
-testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 100 500 0 "" -o Test=ButAutomaticUpgrades
-testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 100 990 0 "" -o Test=ButAutomaticUpgrades -t stable
-testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 990 500 0 "" -o Test=ButAutomaticUpgrades -t backports
+testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 100 500 100 "" -o Test=ButAutomaticUpgrades
+testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 100 990 100 "" -o Test=ButAutomaticUpgrades -t stable
+testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 990 500 990 "" -o Test=ButAutomaticUpgrades -t backports
 
 rm incoming/backports.main.pkglist incoming/backports.main.srclist
 buildsimplenativepackage "coolstuff" "all" "2.0~bpo2" "backports"
@@ -239,14 +240,14 @@ sed -i aptarchive/dists/backports/Release -e 1i"NotAutomatic: yes"
 signreleasefiles
 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
-testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo2" 990 500 0 "" "2.0~bpo2" -o Test=NotAutomatic -t backports
+testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 1 500 100 "" "2.0~bpo2" -o Test=NotAutomatic
+testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo1" 1 990 100 "" "2.0~bpo2" -o Test=NotAutomatic -t stable
+testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo2" 990 500 100 "" "2.0~bpo2" -o Test=NotAutomatic -t backports
 
 sed -i aptarchive/dists/backports/Release -e 1i"ButAutomaticUpgrades: yes"
 signreleasefiles
 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
-testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo2" 990 500 0 "" "2.0~bpo2" -o Test=ButAutomaticUpgrades -t backports
+testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo2" 100 500 100 "" "2.0~bpo2" -o Test=ButAutomaticUpgrades
+testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo2" 100 990 100 "" "2.0~bpo2" -o Test=ButAutomaticUpgrades -t stable
+testequalpolicycoolstuff "2.0~bpo1" "2.0~bpo2" 990 500 100 "" "2.0~bpo2" -o Test=ButAutomaticUpgrades -t backports