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 02212138350 for ; Mon, 10 Feb 2020 02:29:15 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 020F3E0877; Mon, 10 Feb 2020 02:29:15 +0000 (UTC) Received: from smtp.gentoo.org (mail.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 C9788E0877 for ; Mon, 10 Feb 2020 02:29:14 +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 7BB9334E967 for ; Mon, 10 Feb 2020 02:29:13 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 0648110F for ; Mon, 10 Feb 2020 02:29:11 +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: <1581301451.b98dbb357b711f64c8fc1e305c5bca38be203f1d.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: b98dbb357b711f64c8fc1e305c5bca38be203f1d X-VCS-Branch: master Date: Mon, 10 Feb 2020 02:29:11 +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: 04fdafd8-3fc4-4533-a8c3-9c16fdd8b637 X-Archives-Hash: 807451372a7057c413629201f1114ec6 commit: b98dbb357b711f64c8fc1e305c5bca38be203f1d Author: Zac Medico gentoo org> AuthorDate: Mon Feb 10 01:10:14 2020 +0000 Commit: Zac Medico gentoo org> CommitDate: Mon Feb 10 02:24:11 2020 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=b98dbb35 test_virtual_w3m: add realistic case, deps copied from real ebuilds Since virtual/w3m-0 is not removed in the depclean case, this test fails to reproduce bug 649622. Bug: https://bugs.gentoo.org/649622 Signed-off-by: Zac Medico gentoo.org> lib/portage/tests/resolver/test_or_choices.py | 142 ++++++++++++++++++++++++++ 1 file changed, 142 insertions(+) diff --git a/lib/portage/tests/resolver/test_or_choices.py b/lib/portage/tests/resolver/test_or_choices.py index a7ede1fac..f31a5ff22 100644 --- a/lib/portage/tests/resolver/test_or_choices.py +++ b/lib/portage/tests/resolver/test_or_choices.py @@ -581,6 +581,148 @@ class OrChoicesTestCase(TestCase): playground.cleanup() + def test_virtual_w3m_realistic(self): + """ + Test for bug 649622 with realistic www-client/w3m dependencies copied + from real ebuilds. + """ + ebuilds = { + + 'app-misc/neofetch-6.1.0': { + 'EAPI': '7', + 'RDEPEND': 'www-client/w3m' + }, + + 'app-text/xmlto-0.0.28-r1' : { + 'EAPI': '7', + 'RDEPEND': '|| ( virtual/w3m www-client/lynx www-client/elinks )' + }, + + 'mail-client/neomutt-20191207': { + 'EAPI': '7', + 'RDEPEND': '|| ( www-client/lynx www-client/w3m 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', + }, + + 'x11-base/xorg-server-1.20.7' : { + 'EAPI': '7', + 'RDEPEND': '|| ( www-client/links www-client/lynx www-client/w3m ) app-text/xmlto', + } + } + + installed = { + + 'app-misc/neofetch-6.1.0': { + 'EAPI': '7', + 'RDEPEND': 'www-client/w3m' + }, + + 'app-text/xmlto-0.0.28-r1' : { + 'EAPI': '7', + 'RDEPEND': '|| ( virtual/w3m www-client/lynx www-client/elinks )' + }, + + 'mail-client/neomutt-20191207': { + 'EAPI': '7', + 'RDEPEND': '|| ( www-client/lynx www-client/w3m www-client/elinks )' + }, + + 'www-client/lynx-2.9.0_pre4' : { + 'EAPI': '7', + }, + + 'www-client/w3m-0.5.3_p20190105' : { + 'EAPI': '7', + }, + + 'x11-base/xorg-server-1.20.7' : { + 'EAPI': '7', + 'RDEPEND': '|| ( www-client/links www-client/lynx www-client/w3m ) app-text/xmlto', + } + } + + world = ['app-misc/neofetch', 'mail-client/neomutt', 'www-client/lynx', 'x11-base/xorg-server'] + + test_cases = ( + + # Test for bug 649622 (with www-client/w3m installed via + # xorg-server dependency), where virtual/w3m was pulled in + # 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. Since virtual/w3m-0 is not removed + # here, this case fails to reproduce bug 649622. + ResolverPlaygroundTestCase( + [], + options={'--depclean': True}, + success=True, + cleanlist=[], + ), + + ) + + 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): def testOrChoicesLibpostproc(self):