aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2019-08-24 15:30:29 -0700
committerZac Medico <zmedico@gentoo.org>2019-09-01 10:33:54 -0700
commit994ac00aa764615ec6d319c7c1cb8123cf9f2aa1 (patch)
treea8d65c0e6a02fae775dac7cd39f6ab358ba6df65 /lib/portage/tests
parentman/glsa-check.1: remove deprecated "new" target (diff)
downloadportage-994ac00aa764615ec6d319c7c1cb8123cf9f2aa1.tar.gz
portage-994ac00aa764615ec6d319c7c1cb8123cf9f2aa1.tar.bz2
portage-994ac00aa764615ec6d319c7c1cb8123cf9f2aa1.zip
_slot_confict_backtrack: consider masking a package matched by all parent atoms (bug 692746)
When a slot conflict occurs involving a package that is matched by all involved parent atoms, consider masking the package in order to avoid a possible missed update. The included unit test demonstrates the case fixed by this patch. There are 2 previously existing unit tests that require larger backtracking values in order to succeed with this patch, since more possible solutions are now considered. Bug: https://bugs.gentoo.org/692746 Signed-off-by: Zac Medico <zmedico@gentoo.org>
Diffstat (limited to 'lib/portage/tests')
-rw-r--r--lib/portage/tests/resolver/test_slot_conflict_update_virt.py79
-rw-r--r--lib/portage/tests/resolver/test_slot_operator_complete_graph.py2
-rw-r--r--lib/portage/tests/resolver/test_slot_operator_runtime_pkg_mask.py2
3 files changed, 81 insertions, 2 deletions
diff --git a/lib/portage/tests/resolver/test_slot_conflict_update_virt.py b/lib/portage/tests/resolver/test_slot_conflict_update_virt.py
new file mode 100644
index 000000000..0bac095b8
--- /dev/null
+++ b/lib/portage/tests/resolver/test_slot_conflict_update_virt.py
@@ -0,0 +1,79 @@
+# Copyright 2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+from portage.tests import TestCase
+from portage.tests.resolver.ResolverPlayground import (ResolverPlayground,
+ ResolverPlaygroundTestCase)
+
+class SlotConflictUpdateVirtTestCase(TestCase):
+
+ def testSlotConflictUpdateVirt(self):
+
+ ebuilds = {
+ "dev-db/mysql-connector-c-6.1.11-r2" : {
+ "EAPI": "7",
+ "SLOT" : "0/18"
+ },
+
+ "dev-db/mysql-connector-c-8.0.17-r3" : {
+ "EAPI": "7",
+ "SLOT" : "0/21"
+ },
+
+ "virtual/libmysqlclient-18-r1" : {
+ "EAPI": "7",
+ "SLOT" : "0/18",
+ "RDEPEND": "dev-db/mysql-connector-c:0/18",
+ },
+
+ "virtual/libmysqlclient-21" : {
+ "EAPI": "7",
+ "SLOT" : "0/21",
+ "RDEPEND": "dev-db/mysql-connector-c:0/21",
+ },
+
+ "dev-perl/DBD-mysql-4.44.0" : {
+ "EAPI": "7",
+ "RDEPEND": "virtual/libmysqlclient:=",
+ },
+ }
+
+ installed = {
+ "dev-db/mysql-connector-c-6.1.11-r2" : {
+ "EAPI": "7",
+ "SLOT" : "0/18"
+ },
+
+ "virtual/libmysqlclient-18-r1" : {
+ "EAPI": "7",
+ "SLOT" : "0/18",
+ "RDEPEND": "dev-db/mysql-connector-c:0/18",
+ },
+
+ "dev-perl/DBD-mysql-4.44.0" : {
+ "EAPI": "7",
+ "RDEPEND": "virtual/libmysqlclient:0/18=",
+ },
+ }
+
+ world = ["dev-db/mysql-connector-c", "dev-perl/DBD-mysql"]
+
+ test_cases = (
+ # In order to avoid missed updates for bug 692746, consider
+ # masking a package matched by all parent atoms.
+ ResolverPlaygroundTestCase(
+ ['@world'],
+ options = {"--update": True, "--deep": True},
+ success = True,
+ mergelist = ['dev-db/mysql-connector-c-8.0.17-r3', 'virtual/libmysqlclient-21', 'dev-perl/DBD-mysql-4.44.0']),
+ )
+
+ playground = ResolverPlayground(ebuilds=ebuilds,
+ installed=installed, world=world, debug=False)
+ try:
+ for test_case in test_cases:
+ playground.run_TestCase(test_case)
+ self.assertEqual(test_case.test_success, True, test_case.fail_msg)
+ finally:
+ playground.debug = False
+ playground.cleanup()
diff --git a/lib/portage/tests/resolver/test_slot_operator_complete_graph.py b/lib/portage/tests/resolver/test_slot_operator_complete_graph.py
index 1d59bcef1..4dcae71ca 100644
--- a/lib/portage/tests/resolver/test_slot_operator_complete_graph.py
+++ b/lib/portage/tests/resolver/test_slot_operator_complete_graph.py
@@ -115,7 +115,7 @@ class SlotOperatorCompleteGraphTestCase(TestCase):
ResolverPlaygroundTestCase(
["=app-misc/meta-pkg-2", "app-misc/C"],
options = {
- "--backtrack": 5,
+ "--backtrack": 9,
},
success = True,
ambiguous_merge_order = True,
diff --git a/lib/portage/tests/resolver/test_slot_operator_runtime_pkg_mask.py b/lib/portage/tests/resolver/test_slot_operator_runtime_pkg_mask.py
index 0a5a7fa78..f8b53e2b5 100644
--- a/lib/portage/tests/resolver/test_slot_operator_runtime_pkg_mask.py
+++ b/lib/portage/tests/resolver/test_slot_operator_runtime_pkg_mask.py
@@ -110,7 +110,7 @@ class SlotOperatorRuntimePkgMaskTestCase(TestCase):
ResolverPlaygroundTestCase(
["=app-misc/meta-pkg-2"],
options = {
- "--backtrack": 5,
+ "--backtrack": 12,
},
success = True,
ambiguous_merge_order = True,