summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-09-11 11:49:36 -0700
committerZac Medico <zmedico@gentoo.org>2011-09-11 11:49:36 -0700
commit676d6b23b096ef65d97fb9f02cc61959004d9edf (patch)
tree906e3a94752e207d155d0039ab164e904c1e2fe5 /pym
parenta83f1864180ac88675bfd633617d835e9e42c1de (diff)
downloadportage-676d6b23b096ef65d97fb9f02cc61959004d9edf.tar.gz
portage-676d6b23b096ef65d97fb9f02cc61959004d9edf.tar.bz2
portage-676d6b23b096ef65d97fb9f02cc61959004d9edf.zip
Add VirtualSlotResolverTestCase for bug #382557.
Diffstat (limited to 'pym')
-rw-r--r--pym/portage/tests/resolver/test_virtual_slot.py46
1 files changed, 46 insertions, 0 deletions
diff --git a/pym/portage/tests/resolver/test_virtual_slot.py b/pym/portage/tests/resolver/test_virtual_slot.py
new file mode 100644
index 000000000..40ed73b11
--- /dev/null
+++ b/pym/portage/tests/resolver/test_virtual_slot.py
@@ -0,0 +1,46 @@
+# Copyright 2011 Gentoo Foundation
+# 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 VirtualSlotResolverTestCase(TestCase):
+
+ def testLicenseMaskedVirtualSlotUpdate(self):
+
+ ebuilds = {
+ "dev-java/oracle-jdk-bin-1.7.0" : {"SLOT": "1.7", "LICENSE": "TEST"},
+ "dev-java/sun-jdk-1.6.0" : {"SLOT": "1.6", "LICENSE": "TEST"},
+ "dev-java/icedtea-6.1.10.3" : {"SLOT": "6"},
+ "app-misc/java-app-1": {"RDEPEND": ">=virtual/jdk-1.6.0"},
+ "virtual/jdk-1.6.0": {"SLOT": "1.6", "RDEPEND": "|| ( =dev-java/icedtea-6* =dev-java/sun-jdk-1.6.0* )"},
+ "virtual/jdk-1.7.0": {"SLOT": "1.7", "RDEPEND": "|| ( =dev-java/oracle-jdk-bin-1.7.0* )"},
+ }
+
+ installed = {
+ "app-misc/java-app-1": {"RDEPEND": ">=virtual/jdk-1.6.0"},
+ "dev-java/icedtea-6.1.10.3" : {"SLOT": "6"},
+ "virtual/jdk-1.6.0": {"SLOT" : "1.6", "RDEPEND": "|| ( =dev-java/icedtea-6* =dev-java/sun-jdk-1.6.0* )"},
+ }
+
+ world = ("app-misc/java-app",)
+
+ test_cases = (
+ # Bug #382557 - Don't pull in the virtual/jdk-1.7.0 slot update
+ # since its dependencies can only be satisfied by a package that
+ # is masked by license.
+ ResolverPlaygroundTestCase(
+ ["@world"],
+ options = {"--update" : True, "--deep" : True},
+ success = True,
+ mergelist = []),
+ )
+
+ playground = ResolverPlayground(
+ ebuilds=ebuilds, installed=installed, world=world)
+ 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.cleanup()