本文整理汇总了Python中portage.tests.resolver.ResolverPlayground.ResolverPlayground.cleanup方法的典型用法代码示例。如果您正苦于以下问题:Python ResolverPlayground.cleanup方法的具体用法?Python ResolverPlayground.cleanup怎么用?Python ResolverPlayground.cleanup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类portage.tests.resolver.ResolverPlayground.ResolverPlayground
的用法示例。
在下文中一共展示了ResolverPlayground.cleanup方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testBacktrackNotNeeded
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import cleanup [as 别名]
def testBacktrackNotNeeded(self):
ebuilds = {
"dev-libs/A-1": {},
"dev-libs/A-2": {},
"dev-libs/B-1": {},
"dev-libs/B-2": {},
"dev-libs/C-1": {"DEPEND": "dev-libs/A dev-libs/B"},
"dev-libs/D-1": {"DEPEND": "=dev-libs/A-1 =dev-libs/B-1"},
}
test_cases = (
ResolverPlaygroundTestCase(
["dev-libs/C", "dev-libs/D"],
all_permutations=True,
options={"--backtrack": 1},
mergelist=["dev-libs/A-1", "dev-libs/B-1", "dev-libs/C-1", "dev-libs/D-1"],
ignore_mergelist_order=True,
success=True,
),
)
playground = ResolverPlayground(ebuilds=ebuilds)
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()
示例2: testSetCpv
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import cleanup [as 别名]
def testSetCpv(self):
"""
Test the clone via constructor.
"""
ebuilds = {
"dev-libs/A-1": {"IUSE": "static-libs"},
"dev-libs/B-1": {"IUSE": "static-libs"},
}
env_files = {
"A" : ("USE=\"static-libs\"",)
}
package_env = (
"dev-libs/A A",
)
eprefix = normalize_path(tempfile.mkdtemp())
playground = None
try:
user_config_dir = os.path.join(eprefix, USER_CONFIG_PATH)
os.makedirs(user_config_dir)
with io.open(os.path.join(user_config_dir, "package.env"),
mode='w', encoding=_encodings['content']) as f:
for line in package_env:
f.write(line + "\n")
env_dir = os.path.join(user_config_dir, "env")
os.makedirs(env_dir)
for k, v in env_files.items():
with io.open(os.path.join(env_dir, k), mode='w',
encoding=_encodings['content']) as f:
for line in v:
f.write(line + "\n")
playground = ResolverPlayground(eprefix=eprefix, ebuilds=ebuilds)
settings = config(clone=playground.settings)
result = playground.run(["=dev-libs/A-1"])
pkg, existing_node = result.depgraph._select_package(
playground.eroot, Atom("=dev-libs/A-1"))
settings.setcpv(pkg)
self.assertTrue("static-libs" in
settings["PORTAGE_USE"].split())
# Test bug #522362, where a USE=static-libs package.env
# setting leaked from one setcpv call to the next.
pkg, existing_node = result.depgraph._select_package(
playground.eroot, Atom("=dev-libs/B-1"))
settings.setcpv(pkg)
self.assertTrue("static-libs" not in
settings["PORTAGE_USE"].split())
finally:
if playground is None:
shutil.rmtree(eprefix)
else:
playground.cleanup()
示例3: testWithTestDeps
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import cleanup [as 别名]
def testWithTestDeps(self):
ebuilds = {
"app-misc/A-0": {
"EAPI": "5",
"IUSE": "test",
"DEPEND": "test? ( app-misc/B )"
},
"app-misc/B-0": {
"EAPI": "5",
"IUSE": "test",
"DEPEND": "test? ( app-misc/C )"
},
"app-misc/C-0": {
"EAPI": "5",
}
}
test_cases = (
# Test that --with-test-deps only pulls in direct
# test deps of packages matched by arguments.
ResolverPlaygroundTestCase(
["app-misc/A"],
success = True,
options = { "--onlydeps": True, "--with-test-deps": True },
mergelist = ["app-misc/B-0"]),
)
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.cleanup()
示例4: testBacktrackNoWrongRebuilds
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import cleanup [as 别名]
def testBacktrackNoWrongRebuilds(self):
"""
Ensure we remove backtrack masks if the reason for the mask gets masked itself.
"""
ebuilds = {
"dev-libs/A-1": {},
"dev-libs/A-2": {},
"dev-libs/B-1": {"RDEPEND": "dev-libs/D"},
"dev-libs/C-1": {},
"dev-libs/C-2": {"RDEPEND": ">=dev-libs/A-2"},
"dev-libs/D-1": {"RDEPEND": "<dev-libs/A-2"},
}
installed = {
"dev-libs/A-1": {},
"dev-libs/B-1": {"RDEPEND": "dev-libs/D"},
"dev-libs/C-1": {},
"dev-libs/D-1": {"RDEPEND": "<dev-libs/A-2"},
}
world = ["dev-libs/B", "dev-libs/C"]
options = {"--update": True, "--deep": True, "--selective": True}
test_cases = (ResolverPlaygroundTestCase(["@world"], options=options, mergelist=[], success=True),)
playground = ResolverPlayground(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.cleanup()
示例5: testBacktrackWithoutUpdates
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import cleanup [as 别名]
def testBacktrackWithoutUpdates(self):
"""
If --update is not given we might have to mask the old installed version later.
"""
ebuilds = {
"dev-libs/A-1": { "DEPEND": "dev-libs/Z" },
"dev-libs/B-1": { "DEPEND": ">=dev-libs/Z-2" },
"dev-libs/Z-1": { },
"dev-libs/Z-2": { },
}
installed = {
"dev-libs/Z-1": { "USE": "" },
}
test_cases = (
ResolverPlaygroundTestCase(
["dev-libs/B", "dev-libs/A"],
all_permutations = True,
mergelist = ["dev-libs/Z-2", "dev-libs/B-1", "dev-libs/A-1", ],
ignore_mergelist_order = True,
success = True),
)
playground = ResolverPlayground(ebuilds=ebuilds, installed=installed)
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()
示例6: testSelfDEPENDRemovalCrash
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import cleanup [as 别名]
def testSelfDEPENDRemovalCrash(self):
"""
Make sure we don't try to remove a packages twice. This happened
in the past when a package had a DEPEND on itself.
"""
ebuilds = {
"dev-libs/A-1": { "RDEPEND": "=dev-libs/X-1" },
"dev-libs/B-1": { "RDEPEND": "dev-libs/X" },
"dev-libs/X-1": { },
"dev-libs/X-2": { "DEPEND": ">=dev-libs/X-2" },
}
test_cases = (
ResolverPlaygroundTestCase(
["dev-libs/A", "dev-libs/B"],
all_permutations = True,
success = True,
ignore_mergelist_order = True,
mergelist = ["dev-libs/X-1", "dev-libs/A-1", "dev-libs/B-1"]),
)
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.cleanup()
示例7: testHittingTheBacktrackLimit
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import cleanup [as 别名]
def testHittingTheBacktrackLimit(self):
ebuilds = {
"dev-libs/A-1": {},
"dev-libs/A-2": {},
"dev-libs/B-1": {},
"dev-libs/B-2": {},
"dev-libs/C-1": { "DEPEND": "dev-libs/A dev-libs/B" },
"dev-libs/D-1": { "DEPEND": "=dev-libs/A-1 =dev-libs/B-1" },
}
test_cases = (
ResolverPlaygroundTestCase(
["dev-libs/C", "dev-libs/D"],
all_permutations = True,
mergelist = ["dev-libs/A-1", "dev-libs/B-1", "dev-libs/C-1", "dev-libs/D-1"],
ignore_mergelist_order = True,
success = True),
#This one hits the backtrack limit. Be aware that this depends on the argument order.
ResolverPlaygroundTestCase(
["dev-libs/D", "dev-libs/C"],
options = { "--backtrack": 1 },
mergelist = ["dev-libs/A-1", "dev-libs/B-1", "dev-libs/A-2", "dev-libs/B-2", "dev-libs/C-1", "dev-libs/D-1"],
ignore_mergelist_order = True,
slot_collision_solutions = [],
success = False),
)
playground = ResolverPlayground(ebuilds=ebuilds)
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()
示例8: testBacktrackMissedUpdates
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import cleanup [as 别名]
def testBacktrackMissedUpdates(self):
"""
An update is missed due to a dependency on an older version.
"""
ebuilds = {
"dev-libs/A-1": { },
"dev-libs/A-2": { },
"dev-libs/B-1": { "RDEPEND": "<=dev-libs/A-1" },
}
installed = {
"dev-libs/A-1": { "USE": "" },
"dev-libs/B-1": { "USE": "", "RDEPEND": "<=dev-libs/A-1" },
}
options = {'--update' : True, '--deep' : True, '--selective' : True}
test_cases = (
ResolverPlaygroundTestCase(
["dev-libs/A", "dev-libs/B"],
options = options,
all_permutations = True,
mergelist = [],
success = True),
)
playground = ResolverPlayground(ebuilds=ebuilds, installed=installed)
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()
示例9: testBacktrackingGoodVersionFirst
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import cleanup [as 别名]
def testBacktrackingGoodVersionFirst(self):
"""
When backtracking due to slot conflicts, we masked the version that has been pulled
in first. This is not always a good idea. Mask the highest version instead.
"""
ebuilds = {
"dev-libs/A-1": { "DEPEND": "=dev-libs/C-1 dev-libs/B" },
"dev-libs/B-1": { "DEPEND": "=dev-libs/C-1" },
"dev-libs/B-2": { "DEPEND": "=dev-libs/C-2" },
"dev-libs/C-1": { },
"dev-libs/C-2": { },
}
test_cases = (
ResolverPlaygroundTestCase(
["dev-libs/A"],
mergelist = ["dev-libs/C-1", "dev-libs/B-1", "dev-libs/A-1", ],
success = True),
)
playground = ResolverPlayground(ebuilds=ebuilds)
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()
示例10: testOnlydeps
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import cleanup [as 别名]
def testOnlydeps(self):
ebuilds = {
"dev-libs/A-1": { "DEPEND": "dev-libs/B" },
"dev-libs/B-1": { },
}
installed = {
"dev-libs/B-1": { },
}
test_cases = (
ResolverPlaygroundTestCase(
["dev-libs/A", "dev-libs/B"],
all_permutations = True,
success = True,
options = { "--onlydeps": True },
mergelist = ["dev-libs/B-1"]),
)
playground = ResolverPlayground(ebuilds=ebuilds,
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.cleanup()
示例11: testOldDepChainDisplay
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import cleanup [as 别名]
def testOldDepChainDisplay(self):
ebuilds = {
"dev-libs/A-1": { "DEPEND": "foo? ( dev-libs/B[-bar] )", "IUSE": "+foo", "EAPI": "2" },
"dev-libs/A-2": { "DEPEND": "foo? ( dev-libs/C )", "IUSE": "+foo", "EAPI": "1" },
"dev-libs/B-1": { "IUSE": "bar", "DEPEND": "!bar? ( dev-libs/D[-baz] )", "EAPI": "2" },
"dev-libs/C-1": { "KEYWORDS": "~x86" },
"dev-libs/D-1": { "IUSE": "+baz", "EAPI": "1" },
}
test_cases = (
ResolverPlaygroundTestCase(
["=dev-libs/A-1"],
options = { "--autounmask": 'n' },
success = False),
ResolverPlaygroundTestCase(
["=dev-libs/A-2"],
options = { "--autounmask": 'n' },
success = False),
)
playground = ResolverPlayground(ebuilds=ebuilds)
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()
示例12: testSlotChangeWithoutRevBump
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import cleanup [as 别名]
def testSlotChangeWithoutRevBump(self):
ebuilds = {
"app-arch/libarchive-3.1.1" : {
"EAPI": "5",
"SLOT": "0/13"
},
"app-arch/libarchive-3.0.4-r1" : {
"EAPI": "5",
"SLOT": "0"
},
"kde-base/ark-4.10.0" : {
"EAPI": "5",
"DEPEND": "app-arch/libarchive:=",
"RDEPEND": "app-arch/libarchive:="
},
}
binpkgs = {
"app-arch/libarchive-3.1.1" : {
"EAPI": "5",
"SLOT": "0"
},
}
installed = {
"app-arch/libarchive-3.1.1" : {
"EAPI": "5",
"SLOT": "0"
},
"kde-base/ark-4.10.0" : {
"EAPI": "5",
"DEPEND": "app-arch/libarchive:0/0=",
"RDEPEND": "app-arch/libarchive:0/0="
},
}
world = ["kde-base/ark"]
test_cases = (
# Demonstrate bug #456208, where a sub-slot change
# without revbump needs to trigger a rebuild.
ResolverPlaygroundTestCase(
["kde-base/ark"],
options = {"--oneshot": True, "--usepkg": True},
success = True,
mergelist = ['app-arch/libarchive-3.1.1', "kde-base/ark-4.10.0"]),
)
playground = ResolverPlayground(ebuilds=ebuilds, 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.cleanup()
示例13: testAutounmaskMultilibUse
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import cleanup [as 别名]
def testAutounmaskMultilibUse(self):
self.todo = True
ebuilds = {
"x11-proto/xextproto-7.2.1-r1": {"EAPI": "5", "IUSE": "abi_x86_32 abi_x86_64"},
"x11-libs/libXaw-1.0.11-r2": {
"EAPI": "5",
"IUSE": "abi_x86_32 abi_x86_64",
"RDEPEND": "x11-proto/xextproto[abi_x86_32(-)?,abi_x86_64(-)?]",
},
"app-emulation/emul-linux-x86-xlibs-20130224-r2": {"EAPI": "5", "RDEPEND": "x11-libs/libXaw[abi_x86_32]"},
"games-util/steam-client-meta-0-r20130514": {"EAPI": "5", "RDEPEND": "app-emulation/emul-linux-x86-xlibs"},
}
installed = {
"x11-proto/xextproto-7.2.1-r1": {
"EAPI": "5",
"IUSE": "abi_x86_32 abi_x86_64",
"USE": "abi_x86_32 abi_x86_64",
},
"x11-libs/libXaw-1.0.11-r2": {
"EAPI": "5",
"IUSE": "abi_x86_32 abi_x86_64",
"RDEPEND": "x11-proto/xextproto[abi_x86_32(-)?,abi_x86_64(-)?]",
"USE": "abi_x86_32 abi_x86_64",
},
"app-emulation/emul-linux-x86-xlibs-20130224-r2": {"EAPI": "5", "RDEPEND": "x11-libs/libXaw[abi_x86_32]"},
"games-util/steam-client-meta-0-r20130514": {"EAPI": "5", "RDEPEND": "app-emulation/emul-linux-x86-xlibs"},
}
user_config = {
# "make.conf" : ("USE=\"abi_x86_32 abi_x86_64\"",)
"make.conf": ('USE="abi_x86_64"',)
}
world = ("games-util/steam-client-meta",)
test_cases = (
# Test autounmask solving of multilib use deps for bug #481628.
# We would like it to suggest some USE changes, but instead it
# currently fails with a SLOT conflict.
ResolverPlaygroundTestCase(
["x11-proto/xextproto", "x11-libs/libXaw"],
options={"--oneshot": True, "--autounmask": True, "--backtrack": 30},
mergelist=["x11-proto/xextproto-7.2.1-r1", "x11-libs/libXaw-1.0.11-r2"],
success=True,
),
)
playground = ResolverPlayground(
ebuilds=ebuilds, 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:
playground.cleanup()
示例14: testPackageMaskOrder
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import cleanup [as 别名]
def testPackageMaskOrder(self):
ebuilds = {"dev-libs/A-1": {}, "dev-libs/B-1": {}, "dev-libs/C-1": {}, "dev-libs/D-1": {}, "dev-libs/E-1": {}}
repo_configs = {"test_repo": {"package.mask": ("dev-libs/A", "dev-libs/C")}}
profile = {"package.mask": ("-dev-libs/A", "dev-libs/B", "-dev-libs/B", "dev-libs/D")}
user_config = {"package.mask": ("-dev-libs/C", "-dev-libs/D", "dev-libs/E")}
test_cases = (
ResolverPlaygroundTestCase(["dev-libs/A"], options={"--autounmask": "n"}, success=False),
ResolverPlaygroundTestCase(["dev-libs/B"], success=True, mergelist=["dev-libs/B-1"]),
ResolverPlaygroundTestCase(["dev-libs/C"], success=True, mergelist=["dev-libs/C-1"]),
ResolverPlaygroundTestCase(["dev-libs/D"], success=True, mergelist=["dev-libs/D-1"]),
ResolverPlaygroundTestCase(["dev-libs/E"], options={"--autounmask": "n"}, success=False),
)
playground = ResolverPlayground(
ebuilds=ebuilds, repo_configs=repo_configs, profile=profile, 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()
示例15: testDepcleanInstalledKeywordMaskedSlot
# 需要导入模块: from portage.tests.resolver.ResolverPlayground import ResolverPlayground [as 别名]
# 或者: from portage.tests.resolver.ResolverPlayground.ResolverPlayground import cleanup [as 别名]
def testDepcleanInstalledKeywordMaskedSlot(self):
"""
Verify that depclean removes newer slot
masked by KEYWORDS (see bug #350285).
"""
ebuilds = {
"dev-libs/A-1": { "RDEPEND": "|| ( =dev-libs/B-2.7* =dev-libs/B-2.6* )" },
"dev-libs/B-2.6": { "SLOT":"2.6", "KEYWORDS": "x86" },
"dev-libs/B-2.7": { "SLOT":"2.7", "KEYWORDS": "~x86" },
}
installed = {
"dev-libs/A-1": { "EAPI" : "3", "RDEPEND": "|| ( dev-libs/B:2.7 dev-libs/B:2.6 )" },
"dev-libs/B-2.6": { "SLOT":"2.6", "KEYWORDS": "x86" },
"dev-libs/B-2.7": { "SLOT":"2.7", "KEYWORDS": "~x86" },
}
world = (
"dev-libs/A",
)
test_cases = (
ResolverPlaygroundTestCase(
[],
options={"--depclean": True},
success=True,
cleanlist=["dev-libs/B-2.7"]),
)
playground = ResolverPlayground(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.cleanup()