From 676d6b23b096ef65d97fb9f02cc61959004d9edf Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 11 Sep 2011 11:49:36 -0700 Subject: Add VirtualSlotResolverTestCase for bug #382557. --- pym/portage/tests/resolver/test_virtual_slot.py | 46 +++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 pym/portage/tests/resolver/test_virtual_slot.py 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() -- cgit v1.2.3-1-g7c22