aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2020-02-09 17:10:14 -0800
committerZac Medico <zmedico@gentoo.org>2020-02-09 18:24:11 -0800
commitb98dbb357b711f64c8fc1e305c5bca38be203f1d (patch)
treefb8ae701cca1760b6962edab45e89bf4d51f0571 /lib
parenttest_virtual_w3m: test without www-client/w3m installed (diff)
downloadportage-b98dbb357b711f64c8fc1e305c5bca38be203f1d.tar.gz
portage-b98dbb357b711f64c8fc1e305c5bca38be203f1d.tar.bz2
portage-b98dbb357b711f64c8fc1e305c5bca38be203f1d.zip
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 <zmedico@gentoo.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/portage/tests/resolver/test_or_choices.py142
1 files changed, 142 insertions, 0 deletions
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):