Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AutounmaskRecursiveUseChangesTestCase for bug 925625 #1298

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/portage/tests/resolver/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ py.install_sources(
'test_autounmask_keep_keywords.py',
'test_autounmask_multilib_use.py',
'test_autounmask_parent.py',
'test_autounmask_recursive_use_changes.py',
'test_autounmask_use_backtrack.py',
'test_autounmask_use_breakage.py',
'test_autounmask_use_slot_conflict.py',
Expand Down
127 changes: 127 additions & 0 deletions lib/portage/tests/resolver/test_autounmask_recursive_use_changes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# Copyright 2024 Gentoo Authors
# 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 AutounmaskRecursiveUseChangesTestCase(TestCase):
def testAutounmaskRecursiveUseChanges(self):
"""
Attempt to trigger bug 925625 (unsuccessfully), where
--autounmask did not create all of the necessary abi_x86_32
USE changes, and then --autounmask-continue proceeded with
an invalid calculation.
"""
binpkgs = {
"sys-libs/zlib-1.3-r4": {
"EAPI": "8",
"IUSE": "abi_x86_32 abi_x86_64",
"USE": "abi_x86_64",
},
"x11-libs/libpciaccess-0.17-r1": {
"EAPI": "8",
"IUSE": "x86_32 x86_64 zlib",
"DEPEND": "zlib? ( >=sys-libs/zlib-1.2.8-r1:=[abi_x86_32?,abi_x86_64?] )",
"RDEPEND": "zlib? ( >=sys-libs/zlib-1.2.8-r1:=[abi_x86_32?,abi_x86_64?] )",
"USE": "abi_x86_64 zlib",
},
"x11-libs/libdrm-2.4.120": {
"EAPI": "8",
"IUSE": "abi_x86_32 abi_x86_64",
"DEPEND": ">=x11-libs/libpciaccess-0.13.1-r1:=[abi_x86_32?,abi_x86_64?]",
"RDEPEND": ">=x11-libs/libpciaccess-0.13.1-r1:=[abi_x86_32?,abi_x86_64?]",
"USE": "abi_x86_64",
},
"media-libs/gst-plugins-base-1.20.6": {
"EAPI": "8",
"IUSE": "abi_x86_32 abi_x86_64",
"DEPEND": ">=x11-libs/libdrm-2.4.55[abi_x86_32?,abi_x86_64?]",
"RDEPEND": ">=x11-libs/libdrm-2.4.55[abi_x86_32?,abi_x86_64?]",
"USE": "abi_x86_64",
},
"app-emulation/wine-vanilla-9.0": {
"EAPI": "8",
"IUSE": "abi_x86_32 abi_x86_64",
"DEPEND": "media-libs/gst-plugins-base[abi_x86_32?,abi_x86_64?]",
"RDEPEND": "media-libs/gst-plugins-base[abi_x86_32?,abi_x86_64?]",
"USE": "abi_x86_64",
},
}

ebuilds = {
"sys-libs/zlib-1.3-r4": {
"EAPI": "8",
"IUSE": "abi_x86_32 abi_x86_64",
},
"x11-libs/libpciaccess-0.17-r1": {
"EAPI": "8",
"IUSE": "abi_x86_32 abi_x86_64 zlib",
"DEPEND": "zlib? ( >=sys-libs/zlib-1.2.8-r1:=[abi_x86_32?,abi_x86_64?] )",
"RDEPEND": "zlib? ( >=sys-libs/zlib-1.2.8-r1:=[abi_x86_32?,abi_x86_64?] )",
},
"x11-libs/libdrm-2.4.120": {
"EAPI": "8",
"IUSE": "abi_x86_32 abi_x86_64",
"DEPEND": ">=x11-libs/libpciaccess-0.13.1-r1:=[abi_x86_32?,abi_x86_64?]",
"RDEPEND": ">=x11-libs/libpciaccess-0.13.1-r1:=[abi_x86_32?,abi_x86_64?]",
},
"media-libs/gst-plugins-base-1.20.6": {
"EAPI": "8",
"IUSE": "abi_x86_32 abi_x86_64",
"DEPEND": ">=x11-libs/libdrm-2.4.55[abi_x86_32?,abi_x86_64?]",
"RDEPEND": ">=x11-libs/libdrm-2.4.55[abi_x86_32?,abi_x86_64?]",
},
"app-emulation/wine-vanilla-9.0": {
"EAPI": "8",
"IUSE": "abi_x86_32 abi_x86_64",
"DEPEND": "media-libs/gst-plugins-base[abi_x86_32?,abi_x86_64?]",
"RDEPEND": "media-libs/gst-plugins-base[abi_x86_32?,abi_x86_64?]",
},
}

user_config = {
"make.conf": ('USE="abi_x86_64 zlib"',),
"package.use": ("app-emulation/wine-vanilla abi_x86_32",),
}

world = ["app-emulation/wine-vanilla"]

test_cases = (
ResolverPlaygroundTestCase(
["@world"],
options={
"--usepkg": "y",
},
use_changes={
"media-libs/gst-plugins-base-1.20.6": {"abi_x86_32": True},
"x11-libs/libdrm-2.4.120": {"abi_x86_32": True},
"x11-libs/libpciaccess-0.17-r1": {"abi_x86_32": True},
"sys-libs/zlib-1.3-r4": {"abi_x86_32": True},
},
mergelist=[
"sys-libs/zlib-1.3-r4",
"x11-libs/libpciaccess-0.17-r1",
"x11-libs/libdrm-2.4.120",
"media-libs/gst-plugins-base-1.20.6",
"app-emulation/wine-vanilla-9.0",
],
success=False,
),
)

playground = ResolverPlayground(
binpkgs=binpkgs,
ebuilds=ebuilds,
world=world,
user_config=user_config,
)
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()
Loading