summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2021-10-19 15:02:17 +0000
committerJulian Andres Klode <jak@debian.org>2021-10-19 15:02:17 +0000
commit9d9ccbbc685035e410e9f3dd5dd488a21d48661d (patch)
tree858d35d97fa3ac432bb1bebe6c96cf52591c1cde /test
parent400a6895566b67d70bcde43dc8a1cc1c7121f87d (diff)
parent572810e9f321237873d1536c88991d7825c6f1db (diff)
Merge branch 'feature/install-versioned-provides' into 'main'
Allow =version and /release selectors on virtual packages See merge request apt-team/apt!121
Diffstat (limited to 'test')
-rwxr-xr-xtest/integration/test-apt-get-install-virtual-pkgs74
-rwxr-xr-xtest/integration/test-bug-758153-versioned-provides-support26
2 files changed, 100 insertions, 0 deletions
diff --git a/test/integration/test-apt-get-install-virtual-pkgs b/test/integration/test-apt-get-install-virtual-pkgs
index b2fd7499c..99e01ab2c 100755
--- a/test/integration/test-apt-get-install-virtual-pkgs
+++ b/test/integration/test-apt-get-install-virtual-pkgs
@@ -23,6 +23,11 @@ insertpackage 'unstable' 'foo4' 'i386' '2' 'Provides: foo-prv4:amd64'
insertpackage 'experimental' 'baz5' 'amd64' '1' 'Provides: foo-prv5:amd64'
insertpackage 'experimental' 'foo5' 'i386' '2' 'Provides: foo-prv5:amd64'
+insertpackage 'stable' 'debhelper' 'amd64,i386' '1' 'Provides: debhelper-compat (= 12)'
+insertpackage 'unstable,testing' 'debhelper' 'amd64,i386' '2' 'Provides: debhelper-compat (= 13)'
+insertpackage 'experimental' 'debhelper' 'amd64,i386' '3' 'Provides: debhelper-compat (= 13)'
+insertpackage 'experimental' 'debhelper-ng' 'amd64,i386' '4' 'Provides: debhelper-compat (= 13)'
+
setupaptarchive
testsuccessequal "Reading package lists...
@@ -62,3 +67,72 @@ Package foo-prv5 is a virtual package provided by:
baz5 1 [Not candidate version]
E: Package 'foo-prv5' has no installation candidate" aptget install foo-prv5 -s
+
+testsuccessequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+ debhelper
+0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Inst debhelper (2 testing, unstable [amd64])
+Conf debhelper (2 testing, unstable [amd64])' apt install debhelper -s
+testsuccessequal "Reading package lists...
+Building dependency tree...
+Note, selecting 'debhelper' instead of 'debhelper-compat'
+The following NEW packages will be installed:
+ debhelper
+0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Inst debhelper (2 testing, unstable [amd64])
+Conf debhelper (2 testing, unstable [amd64])" apt install debhelper-compat -s
+testsuccessequal "Reading package lists...
+Building dependency tree...
+Note, selecting 'debhelper' instead of 'debhelper-compat'
+Selected version '1' (stable [amd64]) for 'debhelper'
+The following NEW packages will be installed:
+ debhelper
+0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Inst debhelper (1 stable [amd64])
+Conf debhelper (1 stable [amd64])" apt install debhelper-compat=12 -s
+testsuccessequal "Reading package lists...
+Building dependency tree...
+Note, selecting 'debhelper' instead of 'debhelper-compat'
+Selected version '1' (stable [amd64]) for 'debhelper'
+The following NEW packages will be installed:
+ debhelper
+0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Inst debhelper (1 stable [amd64])
+Conf debhelper (1 stable [amd64])" apt install debhelper-compat/stable -s
+# by version selection we have selected the experimental debhelper-ng here
+# but dehelper stays at the candidate as it already provides 13
+testfailureequal "Reading package lists...
+Building dependency tree...
+Package debhelper-compat is a virtual package provided by:
+ debhelper 2 (= 13)
+ debhelper-ng 4 (= 13)
+You should explicitly select one to install.
+
+E: Version '13' for 'debhelper-compat' was not found" apt install debhelper-compat=13 -s
+testsuccessequal "Reading package lists...
+Building dependency tree...
+Note, selecting 'debhelper' instead of 'debhelper-compat'
+Selected version '2' (testing, unstable [amd64]) for 'debhelper'
+The following NEW packages will be installed:
+ debhelper
+0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Inst debhelper (2 testing, unstable [amd64])
+Conf debhelper (2 testing, unstable [amd64])" apt install debhelper-compat/unstable -s
+testfailureequal "Reading package lists...
+Building dependency tree...
+Package debhelper-compat is a virtual package provided by:
+ debhelper-ng 4 (= 13)
+ debhelper 3 (= 13)
+You should explicitly select one to install.
+
+E: Version '13' for 'debhelper-compat' was not found" apt install debhelper-compat=13 -st experimental
+testfailureequal "Reading package lists...
+Building dependency tree...
+Package debhelper-compat is a virtual package provided by:
+ debhelper-ng 4 (= 13)
+ debhelper 3 (= 13)
+You should explicitly select one to install.
+
+E: Release 'experimental' for 'debhelper-compat' was not found" apt install debhelper-compat/experimental -s
diff --git a/test/integration/test-bug-758153-versioned-provides-support b/test/integration/test-bug-758153-versioned-provides-support
index fb8ed39e8..7bf9d76bd 100755
--- a/test/integration/test-bug-758153-versioned-provides-support
+++ b/test/integration/test-bug-758153-versioned-provides-support
@@ -337,6 +337,32 @@ E: Unable to correct problems, you have held broken packages." aptget install ne
fi
testsuccessequal "$HEADER
+The following NEW packages will be installed:
+ selfprov
+0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
+Inst selfprov (2 unstable [amd64])
+Conf selfprov (2 unstable [amd64])" apt install selfprov -s --solver $solver
+ if [ "$solver" = 'apt' ]; then
+ HEADER_POST_NL="
+$HEADER_POST"
+ else
+ HEADER_POST_NL=''
+ fi
+ testsuccessequal "$HEADER_PRE
+Selected version '2' (unstable [amd64]) for 'selfprov'$HEADER_POST_NL
+The following NEW packages will be installed:
+ selfprov
+0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
+Inst selfprov (2 unstable [amd64])
+Conf selfprov (2 unstable [amd64])" apt install selfprov=1 -s --solver $solver
+ testsuccessequal "$HEADER
+The following NEW packages will be installed:
+ selfprov
+0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
+Inst selfprov (2 unstable [amd64])
+Conf selfprov (2 unstable [amd64])" apt install selfprov=2 -s --solver $solver
+
+ testsuccessequal "$HEADER
The following additional packages will be installed:
selfprov
The following NEW packages will be installed: