From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 52CEF138350 for ; Sat, 8 Feb 2020 08:35:59 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6A55EE0844; Sat, 8 Feb 2020 08:35:58 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 0D67AE0844 for ; Sat, 8 Feb 2020 08:35:57 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 49C1034E8F3 for ; Sat, 8 Feb 2020 08:35:56 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id A73C2AF for ; Sat, 8 Feb 2020 08:35:53 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1581150244.1aaed33429f390957514eb81b050cae8c7201d67.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: lib/portage/tests/resolver/ X-VCS-Repository: proj/portage X-VCS-Files: lib/portage/tests/resolver/test_or_choices.py X-VCS-Directories: lib/portage/tests/resolver/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 1aaed33429f390957514eb81b050cae8c7201d67 X-VCS-Branch: master Date: Sat, 8 Feb 2020 08:35:53 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 3ead1809-4c64-4856-80e6-03f81778cc69 X-Archives-Hash: 3cd065190430579e13ad55e5dd97b40e commit: 1aaed33429f390957514eb81b050cae8c7201d67 Author: Zac Medico gentoo org> AuthorDate: Sat Feb 8 07:05:02 2020 +0000 Commit: Zac Medico gentoo org> CommitDate: Sat Feb 8 08:24:04 2020 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=1aaed334 Add unit test for virtual/w3m depclean inconsistency (bug 649622) Bug: https://bugs.gentoo.org/649622 Signed-off-by: Zac Medico gentoo.org> lib/portage/tests/resolver/test_or_choices.py | 114 +++++++++++++++++++++++++- 1 file changed, 113 insertions(+), 1 deletion(-) diff --git a/lib/portage/tests/resolver/test_or_choices.py b/lib/portage/tests/resolver/test_or_choices.py index 10c613e39..f1cc75499 100644 --- a/lib/portage/tests/resolver/test_or_choices.py +++ b/lib/portage/tests/resolver/test_or_choices.py @@ -1,6 +1,8 @@ -# Copyright 2013-2015 Gentoo Foundation +# Copyright 2013-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 +import itertools + from portage.tests import TestCase from portage.tests.resolver.ResolverPlayground import (ResolverPlayground, ResolverPlaygroundTestCase) @@ -407,6 +409,116 @@ class OrChoicesTestCase(TestCase): playground.debug = False playground.cleanup() + def test_virtual_w3m(self): + ebuilds = { + + 'app-text/xmlto-0.0.28-r1' : { + 'EAPI': '7', + 'RDEPEND': '|| ( virtual/w3m www-client/lynx www-client/elinks )' + }, + + 'www-client/elinks-0.13_pre_pre20180225' : { + 'EAPI': '7', + }, + + 'www-client/lynx-2.9.0_pre4' : { + 'EAPI': '7', + }, + + 'virtual/w3m-0' : { + 'EAPI': '7', + 'RDEPEND': '|| ( www-client/w3m www-client/w3mmee )' + }, + + 'www-client/w3m-0.5.3_p20190105' : { + 'EAPI': '7', + }, + + 'www-client/w3mmee-0.3.2_p24-r10' : { + 'EAPI': '7', + }, + + } + + installed = { + + 'app-text/xmlto-0.0.28-r1' : { + 'EAPI': '7', + 'RDEPEND': '|| ( virtual/w3m www-client/lynx www-client/elinks )' + }, + + 'www-client/elinks-0.13_pre_pre20180225' : { + 'EAPI': '7', + }, + + 'www-client/lynx-2.9.0_pre4' : { + 'EAPI': '7', + }, + + 'www-client/w3m-0.5.3_p20190105' : { + 'EAPI': '7', + }, + + } + + world = ['app-text/xmlto', 'www-client/elinks', 'www-client/lynx'] + + test_cases = ( + + # Test for bug 649622, where virtual/w3m is installed only + # to be removed by the next emerge --depclean. + ResolverPlaygroundTestCase( + ['@world'], + options = {'--update': True, '--deep': True}, + success = True, + mergelist = ['virtual/w3m-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() + + installed = dict(itertools.chain(installed.items(), { + + 'virtual/w3m-0' : { + 'EAPI': '7', + 'RDEPEND': '|| ( www-client/w3m www-client/w3mmee )' + }, + + }.items())) + + test_cases = ( + + # Test for bug 649622, where virtual/w3m is removed by + # emerge --depclean immediately after it's installed + # by a world update. + ResolverPlaygroundTestCase( + [], + options={'--depclean': True}, + success=True, + cleanlist=['virtual/w3m-0', 'www-client/w3m-0.5.3_p20190105'], + ), + + ) + + 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() + class OrChoicesLibpostprocTestCase(TestCase):