]> git.saurik.com Git - apt.git/blobdiff - test/integration/test-policy-pinning
treat .ddeb files like .deb, especially for dpkg
[apt.git] / test / integration / test-policy-pinning
index 635dcb8742c45c5838d4c0ed3a969622507703ef..30238bd87056d027462a32631aca212e45e5f646 100755 (executable)
@@ -273,7 +273,6 @@ Pin-Priority: -32768
 " > rootdir/etc/apt/preferences
 testsuccess aptget install -s coolstuff -o PinPriority=-32768
 
 " > rootdir/etc/apt/preferences
 testsuccess aptget install -s coolstuff -o PinPriority=-32768
 
-
 # Check for 32-bit integers
 echo "Package: coolstuff
 Pin: release n=backports
 # Check for 32-bit integers
 echo "Package: coolstuff
 Pin: release n=backports
@@ -306,6 +305,26 @@ E: Cannot convert 2147483648 to integer: out of range
 E: ${tmppath}/rootdir/etc/apt/preferences: Value 2147483648 is outside the range of valid pin priorities (-32768 to 32767)" \
  aptget install -s coolstuff -o PinPriority=2147483648
 
 E: ${tmppath}/rootdir/etc/apt/preferences: Value 2147483648 is outside the range of valid pin priorities (-32768 to 32767)" \
  aptget install -s coolstuff -o PinPriority=2147483648
 
+# Check that short-max/min is a valid pin
+currentpin() {
+echo "Package: *
+Pin: release n=backports
+Pin-Priority: $1
+" > rootdir/etc/apt/preferences
+testsuccessequal "coolstuff:
+  Installed: 2.0~bpo1
+  Candidate: $2
+  Version table:
+     2.0~bpo2 $1
+       $1 file:${tmppath}/aptarchive backports/main all Packages
+ *** 2.0~bpo1 100
+        100 ${tmppath}/rootdir/var/lib/dpkg/status
+     1.0 500
+        500 file:${tmppath}/aptarchive stable/main all Packages" apt policy coolstuff
+}
+currentpin '32767' '2.0~bpo2'
+currentpin '-32768' '2.0~bpo1'
+
 # Check for 0
 echo "Package: coolstuff
 Pin: release n=backports
 # Check for 0
 echo "Package: coolstuff
 Pin: release n=backports
@@ -315,3 +334,28 @@ Pin-Priority: 0
 testfailureequal "Reading package lists...
 E: No priority (or zero) specified for pin" \
  aptget install -s coolstuff -o PinPriority=0
 testfailureequal "Reading package lists...
 E: No priority (or zero) specified for pin" \
  aptget install -s coolstuff -o PinPriority=0
+
+# Check with comments
+echo "#Package: coolstuff
+#Pin: release n=backports
+#Pin-Priority: 0
+
+# Test
+
+Package: coolstuff
+Pin: release n=backports
+#Pin: release n=unstable
+#Pin-Priority: 999
+Pin-Priority: 999
+#Pin-Priority: 999" > rootdir/etc/apt/preferences
+
+testsuccessequal "coolstuff:
+  Installed: 2.0~bpo1
+  Candidate: 2.0~bpo2
+  Version table:
+     2.0~bpo2 999
+        100 file:${tmppath}/aptarchive backports/main all Packages
+ *** 2.0~bpo1 100
+        100 ${tmppath}/rootdir/var/lib/dpkg/status
+     1.0 500
+        500 file:${tmppath}/aptarchive stable/main all Packages" aptcache policy coolstuff