summaryrefslogtreecommitdiffstats
path: root/pym/portage/tests/resolver/test_virtual_slot.py
diff options
context:
space:
mode:
Diffstat (limited to 'pym/portage/tests/resolver/test_virtual_slot.py')
-rw-r--r--pym/portage/tests/resolver/test_virtual_slot.py42
1 files changed, 42 insertions, 0 deletions
diff --git a/pym/portage/tests/resolver/test_virtual_slot.py b/pym/portage/tests/resolver/test_virtual_slot.py
index fb242011d..4ea66772e 100644
--- a/pym/portage/tests/resolver/test_virtual_slot.py
+++ b/pym/portage/tests/resolver/test_virtual_slot.py
@@ -91,3 +91,45 @@ class VirtualSlotResolverTestCase(TestCase):
self.assertEqual(test_case.test_success, True, test_case.fail_msg)
finally:
playground.cleanup()
+
+ def testVirtualSlotDepclean(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"},
+ "dev-java/icedtea-7" : {"SLOT": "7"},
+ "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/icedtea-7* =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"},
+ "dev-java/icedtea-7" : {"SLOT": "7"},
+ "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/icedtea-7* =dev-java/oracle-jdk-bin-1.7.0* )"},
+ }
+
+ world = ("virtual/jdk:1.6", "app-misc/java-app",)
+
+ test_cases = (
+ # Make sure that depclean doesn't remove a new slot even though
+ # it is redundant in the sense that the older slot will satisfy
+ # all dependencies.
+ ResolverPlaygroundTestCase(
+ [],
+ options = {"--depclean" : True},
+ success = True,
+ cleanlist = []),
+ )
+
+ 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()