本文整理汇总了Python中portage.tests.resolver.ResolverPlayground.ResolverPlayground.debug方法的典型用法代码示例。如果您正苦于以下问题:Python ResolverPlayground.debug方法的具体用法?Python ResolverPlayground.debug怎么用?Python ResolverPlayground.debug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类portage.tests.resolver.ResolverPlayground.ResolverPlayground
的用法示例。
在下文中一共展示了ResolverPlayground.debug方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testVirtualRust
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import debug [as 别名]
def testVirtualRust(self):
ebuilds = {
'dev-lang/rust-1.19.0': {},
'dev-lang/rust-1.23.0': {},
'dev-lang/rust-bin-1.19.0': {},
'virtual/rust-1.19.0': {
'RDEPEND': '|| ( =dev-lang/rust-1.19.0* =dev-lang/rust-bin-1.19.0* )'
},
}
installed = {
'dev-lang/rust-1.19.0': {},
'virtual/rust-1.19.0': {
'RDEPEND': '|| ( =dev-lang/rust-1.19.0* =dev-lang/rust-bin-1.19.0* )'
},
}
world = ['virtual/rust']
test_cases = (
# Test bug 645416, where rust-bin-1.19.0 was pulled in
# inappropriately due to the rust-1.23.0 update being
# available.
ResolverPlaygroundTestCase(
['virtual/rust'],
options={'--update': True, '--deep': True},
success=True,
mergelist=[]
),
# Test upgrade to rust-1.23.0, which is only possible
# if rust-bin-1.19.0 is installed in order to satisfy
# virtual/rust-1.19.0.
ResolverPlaygroundTestCase(
['=dev-lang/rust-1.23.0', 'virtual/rust'],
options={'--update': True, '--deep': True},
all_permutations=True,
success=True,
ambiguous_merge_order=True,
mergelist=(
(
'dev-lang/rust-1.23.0',
'dev-lang/rust-bin-1.19.0',
),
),
),
)
playground = ResolverPlayground(debug=False,
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.debug = False
playground.cleanup()
示例2: testAutounmaskBinpkgUse
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import debug [as 别名]
def testAutounmaskBinpkgUse(self):
ebuilds = {
"dev-libs/A-1": {
"EAPI": "6",
"DEPEND": "dev-libs/B[foo]",
"RDEPEND": "dev-libs/B[foo]",
},
"dev-libs/B-1": {
"EAPI": "6",
"IUSE": "foo",
},
}
binpkgs = {
"dev-libs/A-1": {
"EAPI": "6",
"DEPEND": "dev-libs/B[foo]",
"RDEPEND": "dev-libs/B[foo]",
},
"dev-libs/B-1": {
"EAPI": "6",
"IUSE": "foo",
"USE": "foo",
},
}
installed = {
}
test_cases = (
# Bug 619626: Test for unnecessary rebuild due
# to rejection of binary packages that would
# be acceptable after appplication of autounmask
# USE changes.
ResolverPlaygroundTestCase(
["dev-libs/A"],
all_permutations = True,
success = True,
options = {
"--usepkg": True,
"--autounmask": True,
},
mergelist = [
"[binary]dev-libs/B-1",
"[binary]dev-libs/A-1",
],
use_changes = {"dev-libs/B-1": {"foo": True}}
),
)
playground = ResolverPlayground(ebuilds=ebuilds,
binpkgs=binpkgs, installed=installed, 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()
示例3: testSonameDepclean
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import debug [as 别名]
def testSonameDepclean(self):
installed = {
"app-misc/A-1" : {
"RDEPEND": "dev-libs/B",
"DEPEND": "dev-libs/B",
"REQUIRES": "x86_32: libB.so.1 libc.so.6",
},
"dev-libs/B-1" : {
"PROVIDES": "x86_32: libB.so.1",
},
"sys-libs/glibc-2.19-r1" : {
"PROVIDES": "x86_32: libc.so.6"
},
}
world = ("app-misc/A",)
test_cases = (
ResolverPlaygroundTestCase(
[],
options={
"--depclean": True,
"--ignore-soname-deps": "n",
},
success=True,
cleanlist=[]
),
ResolverPlaygroundTestCase(
[],
options={
"--depclean": True,
"--ignore-soname-deps": "y",
},
success=True,
cleanlist=["sys-libs/glibc-2.19-r1"]
),
)
playground = ResolverPlayground(debug=False,
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:
# Disable debug so that cleanup works.
playground.debug = False
playground.cleanup()
示例4: testImageMagickUpdate
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import debug [as 别名]
def testImageMagickUpdate(self):
ebuilds = {
"media-gfx/imagemagick-6.9.7.0" : {
"EAPI": "6",
"SLOT": "0/6.9.7.0",
},
"media-gfx/imagemagick-6.9.6.6" : {
"EAPI": "6",
"SLOT": "0/6.9.6.6",
},
"media-gfx/inkscape-0.91-r3" : {
"EAPI": "6",
"DEPEND": "media-gfx/imagemagick:=",
"RDEPEND": "media-gfx/imagemagick:=",
},
"media-video/dvdrip-0.98.11-r3" : {
"EAPI": "6",
"DEPEND": "|| ( media-gfx/graphicsmagick[imagemagick] media-gfx/imagemagick )",
"RDEPEND": "|| ( media-gfx/graphicsmagick[imagemagick] media-gfx/imagemagick )",
},
"media-gfx/graphicsmagick-1.3.25" : {
"EAPI": "6",
"SLOT": "0/1.3",
"IUSE": "imagemagick",
"RDEPEND": "imagemagick? ( !media-gfx/imagemagick )",
},
}
installed = {
"media-gfx/imagemagick-6.9.6.6" : {
"EAPI": "6",
"SLOT": "0/6.9.6.6",
},
"media-gfx/inkscape-0.91-r3" : {
"EAPI": "6",
"DEPEND": "media-gfx/imagemagick:0/6.9.6.6=",
"RDEPEND": "media-gfx/imagemagick:0/6.9.6.6=",
},
"media-video/dvdrip-0.98.11-r3" : {
"EAPI": "6",
"DEPEND": "|| ( media-gfx/graphicsmagick[imagemagick] media-gfx/imagemagick )",
"RDEPEND": "|| ( media-gfx/graphicsmagick[imagemagick] media-gfx/imagemagick )",
},
"media-gfx/graphicsmagick-1.3.25" : {
"EAPI": "6",
"SLOT": "0/1.3",
"IUSE": "imagemagick",
"USE": "",
"RDEPEND": "imagemagick? ( !media-gfx/imagemagick )",
},
}
world = (
"media-gfx/inkscape",
"media-video/dvdrip",
"media-gfx/graphicsmagick",
)
test_cases = (
# bug #554070: imagemagick upgrade triggered erroneous
# autounmask USE change for media-gfx/graphicsmagick[imagemagick]
ResolverPlaygroundTestCase(
["media-gfx/imagemagick", "@world"],
options = {"--update": True, "--deep": True},
success = True,
mergelist = [
"media-gfx/imagemagick-6.9.7.0",
"media-gfx/inkscape-0.91-r3"
]
),
)
playground = ResolverPlayground(debug=False,
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:
# Disable debug so that cleanup works.
playground.debug = False
playground.cleanup()
示例5: testImageMagickUpdate
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import debug [as 别名]
#.........这里部分代码省略.........
),
# Use --with-bdeps-auto=n to prevent --with-bdeps
# from being enabled automatically.
ResolverPlaygroundTestCase(
["@world"],
options = {
"--update": True,
"--deep": True,
"--with-bdeps-auto": "n",
},
success = True,
mergelist = [
"app-misc/D-2",
"app-misc/C-2",
]
),
# Do not enable --with-bdeps automatically when
# --usepkg has been specified, since many users of binary
# packages do not want unnecessary build time dependencies
# installed. In this case we miss an update to
# app-misc/D-2, since DEPEND is not pulled in for
# the [binary]app-misc/C-2 update.
ResolverPlaygroundTestCase(
["@world"],
options = {
"--update": True,
"--deep": True,
"--usepkg": True,
},
success = True,
mergelist = [
"[binary]app-misc/C-2",
]
),
# Use --with-bdeps=y to pull in build-time dependencies of
# binary packages.
ResolverPlaygroundTestCase(
["@world"],
options = {
"--update": True,
"--deep": True,
"--usepkg": True,
"--with-bdeps": "y",
},
success = True,
ambiguous_merge_order = True,
mergelist = [
(
"[binary]app-misc/D-2",
"[binary]app-misc/B-2",
"[binary]app-misc/C-2",
),
]
),
# For --depclean, do not remove build-time dependencies by
# default. Specify --with-bdeps-auto=n, in order to
# demonstrate that it does not affect removal actions.
ResolverPlaygroundTestCase(
[],
options = {
"--depclean": True,
"--with-bdeps-auto": "n",
},
success = True,
cleanlist = [],
),
# For --depclean, remove build-time dependencies if
# --with-bdeps=n has been specified.
ResolverPlaygroundTestCase(
[],
options = {
"--depclean": True,
"--with-bdeps": "n",
},
success = True,
ignore_cleanlist_order = True,
cleanlist = [
"app-misc/D-1",
"app-misc/B-1",
],
),
)
playground = ResolverPlayground(debug=False,
ebuilds=ebuilds, installed=installed,
binpkgs=binpkgs, 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:
# Disable debug so that cleanup works.
playground.debug = False
playground.cleanup()
示例6: testOrDowngradeInstalled
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import debug [as 别名]
def testOrDowngradeInstalled(self):
ebuilds = {
'net-misc/foo-1': {
'EAPI': '6',
'RDEPEND': '|| ( sys-libs/glibc[rpc(-)] net-libs/libtirpc )'
},
'net-libs/libtirpc-1': {
'EAPI': '6',
},
'sys-libs/glibc-2.26': {
'EAPI': '6',
'IUSE': ''
},
'sys-libs/glibc-2.24': {
'EAPI': '6',
'IUSE': '+rpc'
},
}
installed = {
'sys-libs/glibc-2.26': {
'EAPI': '6',
'IUSE': ''
},
}
world = ['sys-libs/glibc']
test_cases = (
# Test bug 635540, where we need to install libtirpc
# rather than downgrade glibc.
ResolverPlaygroundTestCase(
['net-misc/foo'],
success=True,
mergelist=[
'net-libs/libtirpc-1',
'net-misc/foo-1',
],
),
)
playground = ResolverPlayground(debug=False,
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.debug = False
playground.cleanup()
# In some cases it's necessary to downgrade due to
# the installed package being masked (glibc is a
# not an ideal example because it's usually not
# practical to downgrade it).
user_config = {
"package.mask" : (
">=sys-libs/glibc-2.26",
),
}
test_cases = (
ResolverPlaygroundTestCase(
['net-misc/foo'],
success=True,
mergelist=[
'sys-libs/glibc-2.24',
'net-misc/foo-1',
],
),
)
playground = ResolverPlayground(debug=False,
ebuilds=ebuilds, installed=installed, 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.debug = False
playground.cleanup()
示例7: testAutounmaskKeepKeywordsTestCase
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import debug [as 别名]
def testAutounmaskKeepKeywordsTestCase(self):
ebuilds = {
'app-misc/A-2': {
'EAPI': '6',
'RDEPEND': 'app-misc/B',
},
'app-misc/A-1': {
'EAPI': '6',
'RDEPEND': 'app-misc/C[foo]',
},
'app-misc/B-1': {
'EAPI': '6',
'KEYWORDS': '~x86',
},
'app-misc/C-1': {
'EAPI': '6',
'IUSE': 'foo',
},
}
installed = {
}
test_cases = (
ResolverPlaygroundTestCase(
['app-misc/A'],
success = False,
options = {
"--autounmask": True,
'--autounmask-keep-keywords': 'n',
},
mergelist = [
'app-misc/B-1',
'app-misc/A-2',
],
unstable_keywords={'app-misc/B-1'},
),
# --autounmask-keep-keywords prefers app-misc/A-1 because
# it can be installed without accepting unstable
# keywords
ResolverPlaygroundTestCase(
['app-misc/A'],
success = False,
options = {
"--autounmask": True,
'--autounmask-keep-keywords': 'y',
},
mergelist = [
'app-misc/C-1',
'app-misc/A-1',
],
use_changes = {'app-misc/C-1': {'foo': True}},
),
)
playground = ResolverPlayground(ebuilds=ebuilds, 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()
示例8: testTwoSlots
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import debug [as 别名]
def testTwoSlots(self):
ebuilds = {
"dev-libs/glib-1.2.10" : {
"SLOT": "1"
},
"dev-libs/glib-2.30.2" : {
"SLOT": "2"
},
"dev-libs/dbus-glib-0.98" : {
"EAPI": "1",
"DEPEND": "dev-libs/glib:2",
"RDEPEND": "dev-libs/glib:2"
},
}
binpkgs = {
"dev-libs/glib-1.2.10" : {
"SLOT": "1",
"PROVIDES": "x86_32: libglib-1.0.so.0",
},
"dev-libs/glib-2.30.2" : {
"PROVIDES": "x86_32: libglib-2.0.so.30",
"SLOT": "2",
},
"dev-libs/glib-2.32.3" : {
"PROVIDES": "x86_32: libglib-2.0.so.32",
"SLOT": "2",
},
"dev-libs/dbus-glib-0.98" : {
"EAPI": "1",
"DEPEND": "dev-libs/glib:2",
"RDEPEND": "dev-libs/glib:2",
"REQUIRES": "x86_32: libglib-2.0.so.30",
},
}
installed = {
"dev-libs/glib-1.2.10" : {
"PROVIDES": "x86_32: libglib-1.0.so.0",
"SLOT": "1",
},
"dev-libs/glib-2.32.3" : {
"PROVIDES": "x86_32: libglib-2.0.so.32",
"SLOT": "2",
},
"dev-libs/dbus-glib-0.98" : {
"EAPI": "1",
"DEPEND": "dev-libs/glib:2",
"RDEPEND": "dev-libs/glib:2",
"REQUIRES": "x86_32: libglib-2.0.so.32",
},
}
user_config = {
"package.mask" : (
">=dev-libs/glib-2.32",
),
}
world = [
"dev-libs/glib:1",
"dev-libs/dbus-glib",
]
test_cases = (
ResolverPlaygroundTestCase(
["@world"],
options = {
"--autounmask": "n",
"--deep": True,
"--ignore-soname-deps": "n",
"--update": True,
"--usepkgonly": True,
},
success = True,
mergelist = [
"[binary]dev-libs/glib-2.30.2",
"[binary]dev-libs/dbus-glib-0.98"
]
),
)
playground = ResolverPlayground(ebuilds=ebuilds, binpkgs=binpkgs,
installed=installed, user_config=user_config, 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:
# Disable debug so that cleanup works.
playground.debug = False
playground.cleanup()
示例9: testConflictMissedUpdate
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import debug [as 别名]
def testConflictMissedUpdate(self):
ebuilds = {
"dev-lang/ocaml-4.02.1" : {
"EAPI": "5",
"SLOT": "0/4.02.1",
},
"dev-lang/ocaml-4.01.0" : {
"EAPI": "5",
"SLOT": "0/4.01.0",
},
"dev-ml/lablgl-1.05" : {
"EAPI": "5",
"DEPEND": (">=dev-lang/ocaml-3.10.2:= "
"|| ( dev-ml/labltk:= <dev-lang/ocaml-4.02 )"),
"RDEPEND": (">=dev-lang/ocaml-3.10.2:= "
"|| ( dev-ml/labltk:= <dev-lang/ocaml-4.02 )"),
},
"dev-ml/labltk-8.06.0" : {
"EAPI": "5",
"SLOT": "0/8.06.0",
"DEPEND": ">=dev-lang/ocaml-4.02:=",
"RDEPEND": ">=dev-lang/ocaml-4.02:=",
},
}
installed = {
"dev-lang/ocaml-4.01.0" : {
"EAPI": "5",
"SLOT": "0/4.01.0",
},
"dev-ml/lablgl-1.05" : {
"EAPI": "5",
"DEPEND": (">=dev-lang/ocaml-3.10.2:0/4.01.0= "
"|| ( dev-ml/labltk:= <dev-lang/ocaml-4.02 )"),
"RDEPEND": (">=dev-lang/ocaml-3.10.2:0/4.01.0= "
"|| ( dev-ml/labltk:= <dev-lang/ocaml-4.02 )"),
},
}
world = (
"dev-lang/ocaml",
"dev-ml/lablgl",
)
test_cases = (
# bug #531656: If an ocaml update is desirable,
# then we need to pull in dev-ml/labltk.
ResolverPlaygroundTestCase(
["@world"],
options = {"--update": True, "--deep": True},
success = True,
mergelist = [
"dev-lang/ocaml-4.02.1",
"dev-ml/labltk-8.06.0",
"dev-ml/lablgl-1.05",
]
),
)
playground = ResolverPlayground(debug=False,
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:
# Disable debug so that cleanup works.
playground.debug = False
playground.cleanup()
示例10: testSonameSlotConflictMixedDependencies
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import debug [as 别名]
def testSonameSlotConflictMixedDependencies(self):
"""
Bug 487198
For parents with mixed >= and < dependencies, we scheduled
reinstalls for the >= atom, but in the end didn't install the
child update because of the < atom.
"""
binpkgs = {
"cat/slotted-lib-1" : {
"PROVIDES": "x86_32: lib1.so",
"SLOT": "1",
},
"cat/slotted-lib-2" : {
"PROVIDES": "x86_32: lib2.so",
"SLOT": "2",
},
"cat/slotted-lib-3" : {
"PROVIDES": "x86_32: lib3.so",
"SLOT": "3",
},
"cat/slotted-lib-4" : {
"PROVIDES": "x86_32: lib4.so",
"SLOT": "4",
},
"cat/slotted-lib-5" : {
"PROVIDES": "x86_32: lib5.so",
"SLOT": "5",
},
"cat/user-1" : {
"DEPEND": ">=cat/slotted-lib-2 <cat/slotted-lib-4",
"RDEPEND": ">=cat/slotted-lib-2 <cat/slotted-lib-4",
"REQUIRES": "x86_32: lib3.so",
},
}
installed = {
"cat/slotted-lib-3" : {
"PROVIDES": "x86_32: lib3.so",
"SLOT": "3",
},
"cat/user-1" : {
"DEPEND": ">=cat/slotted-lib-2 <cat/slotted-lib-4",
"RDEPEND": ">=cat/slotted-lib-2 <cat/slotted-lib-4",
"REQUIRES": "x86_32: lib3.so",
},
}
test_cases = (
ResolverPlaygroundTestCase(
["cat/user"],
options = {
"--deep": True,
"--ignore-soname-deps": "n",
"--update": True,
"--usepkgonly": True,
},
success = True,
mergelist = []),
)
world = []
playground = ResolverPlayground(binpkgs=binpkgs,
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()
示例11: testSonameSkipUpdate
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import debug [as 别名]
def testSonameSkipUpdate(self):
binpkgs = {
"app-misc/A-1" : {
"RDEPEND": "dev-libs/B",
"DEPEND": "dev-libs/B",
"REQUIRES": "x86_32: libB.so.1",
},
"dev-libs/B-2" : {
"PROVIDES": "x86_32: libB.so.2",
},
"dev-libs/B-1" : {
"PROVIDES": "x86_32: libB.so.1",
},
}
installed = {
"app-misc/A-1" : {
"RDEPEND": "dev-libs/B",
"DEPEND": "dev-libs/B",
"REQUIRES": "x86_32: libB.so.1",
},
"dev-libs/B-1" : {
"PROVIDES": "x86_32: libB.so.1",
},
}
world = ("app-misc/A",)
test_cases = (
# Test that --ignore-soname-deps allows the upgrade,
# even though it will break an soname dependency of
# app-misc/A-1.
ResolverPlaygroundTestCase(
["@world"],
options = {
"--deep": True,
"--ignore-soname-deps": "y",
"--update": True,
"--usepkgonly": True
},
success = True,
mergelist = [
"[binary]dev-libs/B-2",
]
),
# Test that upgrade to B-2 is skipped with --usepkgonly
# because it will break an soname dependency that
# cannot be satisfied by the available binary packages.
ResolverPlaygroundTestCase(
["@world"],
options = {
"--deep": True,
"--ignore-soname-deps": "n",
"--update": True,
"--usepkgonly": True
},
success = True,
mergelist = []
),
)
playground = ResolverPlayground(debug=False,
binpkgs=binpkgs, 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:
# Disable debug so that cleanup works.
playground.debug = False
playground.cleanup()
示例12: testSonameUnsatisfied
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import debug [as 别名]
def testSonameUnsatisfied(self):
binpkgs = {
"app-misc/A-1" : {
"EAPI": "5",
"PROVIDES": "x86_32: libA.so.1",
},
"app-misc/A-2" : {
"EAPI": "5",
"PROVIDES": "x86_32: libA.so.2",
},
"app-misc/B-0" : {
"DEPEND": "app-misc/A",
"RDEPEND": "app-misc/A",
"REQUIRES": "x86_32: libA.so.2",
}
}
installed = {
"app-misc/A-2" : {
"EAPI": "5",
"PROVIDES": "x86_32: libA.so.2",
},
"app-misc/B-0" : {
"DEPEND": "app-misc/A",
"RDEPEND": "app-misc/A",
"REQUIRES": "x86_32: libA.so.1",
}
}
world = ["app-misc/B"]
test_cases = (
# Demonstrate bug #439694, where a broken
# soname dependency needs to trigger a reinstall.
ResolverPlaygroundTestCase(
["@world"],
options = {
"--deep": True,
"--ignore-soname-deps": "n",
"--update": True,
"--usepkgonly": True,
},
success = True,
mergelist = [
"[binary]app-misc/B-0"
]
),
# This doesn't trigger a reinstall, since there's no version
# change to trigger complete graph mode, and initially
# unsatisfied deps are ignored in complete graph mode anyway.
ResolverPlaygroundTestCase(
["app-misc/A"],
options = {
"--ignore-soname-deps": "n",
"--oneshot": True,
"--usepkgonly": True,
},
success = True,
mergelist = [
"[binary]app-misc/A-2"
]
),
)
playground = ResolverPlayground(binpkgs=binpkgs, debug=False,
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:
# Disable debug so that cleanup works.
playground.debug = False
playground.cleanup()
示例13: testOrUpgradeInstalled
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import debug [as 别名]
def testOrUpgradeInstalled(self):
ebuilds = {
'net-misc/foo-1': {
'EAPI': '6',
'RDEPEND': '|| ( sys-libs/glibc[rpc(-)] net-libs/libtirpc )'
},
'net-libs/libtirpc-1': {
'EAPI': '6',
},
'sys-libs/glibc-2.26': {
'EAPI': '6',
'IUSE': ''
},
'sys-libs/glibc-2.24': {
'EAPI': '6',
'IUSE': '+rpc'
},
}
installed = {
'sys-libs/glibc-2.24': {
'EAPI': '6',
'IUSE': '+rpc',
'USE': 'rpc',
},
}
world = ['sys-libs/glibc']
test_cases = (
# Test bug 643974, where we need to install libtirpc
# in order to upgrade glibc.
ResolverPlaygroundTestCase(
['net-misc/foo', '@world'],
options={'--update': True, '--deep': True},
success=True,
ambiguous_merge_order=True,
mergelist=(
(
'net-libs/libtirpc-1',
'sys-libs/glibc-2.26',
'net-misc/foo-1',
),
)
),
)
playground = ResolverPlayground(debug=False,
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.debug = False
playground.cleanup()
# In some cases it's necessary to avoid upgrade due to
# the package being masked.
user_config = {
"package.mask" : (
">=sys-libs/glibc-2.26",
),
}
test_cases = (
ResolverPlaygroundTestCase(
['net-misc/foo', '@world'],
options={'--update': True, '--deep': True},
success=True,
mergelist=[
'net-misc/foo-1',
]
),
)
playground = ResolverPlayground(debug=False,
ebuilds=ebuilds, installed=installed, 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.debug = False
playground.cleanup()
示例14: testSlotOperatorRuntimePkgMask
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import debug [as 别名]
#.........这里部分代码省略.........
},
"app-misc/C-1" : {
"EAPI": "6",
"DEPEND": "dev-libs/foo:=",
"RDEPEND": "dev-libs/foo:=",
},
"app-misc/C-2" : {
"EAPI": "6",
"DEPEND": "dev-libs/foo:=",
"RDEPEND": "dev-libs/foo:=",
},
"app-misc/D-1" : {
"EAPI": "6",
"DEPEND": "dev-libs/foo:=",
"RDEPEND": "dev-libs/foo:=",
},
"app-misc/D-2" : {
"EAPI": "6",
"DEPEND": "dev-libs/foo:=",
"RDEPEND": "dev-libs/foo:=",
},
"dev-libs/foo-1" : {
"EAPI": "6",
"SLOT": "0/1",
},
"dev-libs/foo-2" : {
"EAPI": "6",
"SLOT": "0/2",
},
}
installed = {
"app-misc/meta-pkg-1" : {
"EAPI": "6",
"DEPEND": "=app-misc/B-1 =app-misc/C-1 =app-misc/D-1 =dev-libs/foo-1",
"RDEPEND": "=app-misc/B-1 =app-misc/C-1 =app-misc/D-1 =dev-libs/foo-1",
},
"app-misc/B-1" : {
"EAPI": "6",
"DEPEND": "dev-libs/foo:0/1=",
"RDEPEND": "dev-libs/foo:0/1=",
},
"app-misc/C-1" : {
"EAPI": "6",
"DEPEND": "dev-libs/foo:0/1=",
"RDEPEND": "dev-libs/foo:0/1=",
},
"app-misc/D-1" : {
"EAPI": "6",
"DEPEND": "dev-libs/foo:0/1=",
"RDEPEND": "dev-libs/foo:0/1=",
},
"dev-libs/foo-1" : {
"EAPI": "6",
"SLOT": "0/1",
},
}
world = (
"app-misc/meta-pkg",
)
test_cases = (
ResolverPlaygroundTestCase(
["=app-misc/meta-pkg-2"],
options = {
"--backtrack": 5,
},
success = True,
ambiguous_merge_order = True,
mergelist = [
'dev-libs/foo-2',
('app-misc/D-1', 'app-misc/C-1', 'app-misc/B-2'),
'app-misc/meta-pkg-2',
]
),
)
playground = ResolverPlayground(debug=False,
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:
# Disable debug so that cleanup works.
playground.debug = False
playground.cleanup()
示例15: testSonameSlotConflictMassRebuild
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import debug [as 别名]
def testSonameSlotConflictMassRebuild(self):
"""
Bug 486580
Before this bug was fixed, emerge would backtrack for each
package that needs a rebuild. This could cause it to hit the
backtrack limit and not rebuild all needed packages.
"""
binpkgs = {
"app-misc/A-1" : {
"DEPEND": "app-misc/B",
"RDEPEND": "app-misc/B",
"REQUIRES": "x86_32: libB-2.so",
},
"app-misc/B-1" : {
"SLOT": "1",
"PROVIDES": "x86_32: libB-1.so",
},
"app-misc/B-2" : {
"SLOT": "2",
"PROVIDES": "x86_32: libB-2.so",
},
}
installed = {
"app-misc/B-1" : {
"SLOT": "1",
"PROVIDES": "x86_32: libB-1.so",
},
}
expected_mergelist = [
'[binary]app-misc/A-1',
'[binary]app-misc/B-2'
]
for i in range(5):
binpkgs["app-misc/C%sC-1" % i] = {
"DEPEND": "app-misc/B",
"RDEPEND": "app-misc/B",
"REQUIRES": "x86_32: libB-2.so",
}
installed["app-misc/C%sC-1" % i] = {
"DEPEND": "app-misc/B",
"RDEPEND": "app-misc/B",
"REQUIRES": "x86_32: libB-1.so",
}
for x in ("DEPEND", "RDEPEND"):
binpkgs["app-misc/A-1"][x] += " app-misc/C%sC" % i
expected_mergelist.append("[binary]app-misc/C%sC-1" % i)
test_cases = (
ResolverPlaygroundTestCase(
["app-misc/A"],
ignore_mergelist_order=True,
all_permutations=True,
options = {
"--backtrack": 3,
"--deep": True,
"--ignore-soname-deps": "n",
"--update": True,
"--usepkgonly": True,
},
success = True,
mergelist = expected_mergelist),
)
world = []
playground = ResolverPlayground(binpkgs=binpkgs,
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()