* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/ebuild/
@ 2011-06-09 10:59 Zac Medico
0 siblings, 0 replies; 19+ messages in thread
From: Zac Medico @ 2011-06-09 10:59 UTC (permalink / raw
To: gentoo-commits
commit: 29b8ad2f115bdb146ecc2ed932e4af5f1bb955ff
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 9 10:59:08 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jun 9 10:59:08 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=29b8ad2f
SpawnTestCase: check returncode
---
pym/portage/tests/ebuild/test_spawn.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pym/portage/tests/ebuild/test_spawn.py b/pym/portage/tests/ebuild/test_spawn.py
index d3fb21f..89a6c28 100644
--- a/pym/portage/tests/ebuild/test_spawn.py
+++ b/pym/portage/tests/ebuild/test_spawn.py
@@ -30,8 +30,8 @@ class SpawnTestCase(TestCase):
scheduler=scheduler,
logfile=logfile)
proc.start()
- proc.wait()
os.close(null_fd)
+ self.assertEqual(proc.wait(), os.EX_OK)
f = codecs.open(_unicode_encode(logfile,
encoding=_encodings['fs'], errors='strict'),
mode='r', encoding=_encodings['content'], errors='strict')
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/ebuild/
@ 2011-09-04 19:06 Zac Medico
0 siblings, 0 replies; 19+ messages in thread
From: Zac Medico @ 2011-09-04 19:06 UTC (permalink / raw
To: gentoo-commits
commit: 22723ad12ea03fada67c7c80df66b4524cfe00be
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 4 19:05:48 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Sep 4 19:05:48 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=22723ad1
test_pty_eof: add SKIP msg for unsupported plat
---
pym/portage/tests/ebuild/test_pty_eof.py | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/pym/portage/tests/ebuild/test_pty_eof.py b/pym/portage/tests/ebuild/test_pty_eof.py
index 4b6ff21..c8de3e2 100644
--- a/pym/portage/tests/ebuild/test_pty_eof.py
+++ b/pym/portage/tests/ebuild/test_pty_eof.py
@@ -7,6 +7,13 @@ from portage.util._pty import _can_test_pty_eof, _test_pty_eof
class PtyEofFdopenBufferedTestCase(TestCase):
def testPtyEofFdopenBuffered(self):
+
+ if not _can_test_pty_eof():
+ skip_reason = "unsupported on this platform"
+ self.portage_skip = skip_reason
+ self.fail(skip_reason)
+ return
+
# This tests if the following python issue is fixed yet:
# http://bugs.python.org/issue5380
# Since it might not be fixed, mark as todo.
@@ -24,6 +31,12 @@ class PtyEofFdopenUnBufferedTestCase(TestCase):
# with python3 as long as fdopen is called with a bufsize
# argument of 0.
+ if not _can_test_pty_eof():
+ skip_reason = "unsupported on this platform"
+ self.portage_skip = skip_reason
+ self.fail(skip_reason)
+ return
+
# The result is only valid if openpty does not raise EnvironmentError.
if _can_test_pty_eof():
try:
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/ebuild/
@ 2011-09-15 2:55 Zac Medico
0 siblings, 0 replies; 19+ messages in thread
From: Zac Medico @ 2011-09-15 2:55 UTC (permalink / raw
To: gentoo-commits
commit: 30d598768326128d5e6c22983fb456eb1085cf7e
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Sep 15 02:55:03 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Sep 15 02:55:03 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=30d59876
Handle non-existent thin manifest in tests.
---
pym/portage/tests/ebuild/test_config.py | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/pym/portage/tests/ebuild/test_config.py b/pym/portage/tests/ebuild/test_config.py
index ff3935b..3d0be19 100644
--- a/pym/portage/tests/ebuild/test_config.py
+++ b/pym/portage/tests/ebuild/test_config.py
@@ -229,9 +229,7 @@ class ConfigTestCase(TestCase):
playground = ResolverPlayground(ebuilds=ebuilds, repo_configs=repo_configs)
new_manifest_file = os.path.join(playground.repo_dirs["new_repo"], "dev-libs", "A", "Manifest")
- f = open(new_manifest_file)
- self.assertEqual(len(list(f)), 0)
- f.close()
+ self.assertEqual(os.path.exists(new_manifest_file), False)
old_manifest_file = os.path.join(playground.repo_dirs["old_repo"], "dev-libs", "A", "Manifest")
f = open(old_manifest_file)
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/ebuild/
@ 2011-10-04 6:18 Zac Medico
0 siblings, 0 replies; 19+ messages in thread
From: Zac Medico @ 2011-10-04 6:18 UTC (permalink / raw
To: gentoo-commits
commit: 9691c2893abf469ef2035e526649df955e8c0ee5
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 4 06:17:22 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Oct 4 06:17:22 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9691c289
testManifest: enable manifest-hashes
---
pym/portage/tests/ebuild/test_config.py | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/pym/portage/tests/ebuild/test_config.py b/pym/portage/tests/ebuild/test_config.py
index f4869c6..fe9b648 100644
--- a/pym/portage/tests/ebuild/test_config.py
+++ b/pym/portage/tests/ebuild/test_config.py
@@ -218,6 +218,7 @@ class ConfigTestCase(TestCase):
"layout.conf":
(
"thin-manifests = true",
+ "manifest-hashes = RMD160 SHA1 SHA256 SHA512 WHIRLPOOL",
),
}
}
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/ebuild/
@ 2011-10-25 16:41 Zac Medico
0 siblings, 0 replies; 19+ messages in thread
From: Zac Medico @ 2011-10-25 16:41 UTC (permalink / raw
To: gentoo-commits
commit: 0229926ec76333b5a197e5fba3beffe7691688b3
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 25 16:41:15 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Oct 25 16:41:15 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0229926e
test_config: test PORTDIR default masters
---
pym/portage/tests/ebuild/test_config.py | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/pym/portage/tests/ebuild/test_config.py b/pym/portage/tests/ebuild/test_config.py
index 6eb1361..ea64192 100644
--- a/pym/portage/tests/ebuild/test_config.py
+++ b/pym/portage/tests/ebuild/test_config.py
@@ -238,6 +238,11 @@ class ConfigTestCase(TestCase):
playground = ResolverPlayground(ebuilds=ebuilds,
repo_configs=repo_configs, distfiles=distfiles)
+ new_repo_config = playground.settings.repositories.prepos['new_repo']
+ self.assertTrue(len(new_repo_config.masters) > 0, "new_repo has no default master")
+ self.assertEqual(new_repo_config.masters[0].user_location, playground.portdir,
+ "new_repo default master is not PORTDIR")
+
new_manifest_file = os.path.join(playground.repo_dirs["new_repo"], "dev-libs", "A", "Manifest")
self.assertEqual(os.path.exists(new_manifest_file), False)
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/ebuild/
@ 2011-12-16 3:23 Zac Medico
0 siblings, 0 replies; 19+ messages in thread
From: Zac Medico @ 2011-12-16 3:23 UTC (permalink / raw
To: gentoo-commits
commit: 11cf001c20d94eb477e8a9b253e657716702b845
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 16 03:23:38 2011 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Dec 16 03:23:38 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=11cf001c
PtyEofFdopenUnBufferedTestCase: PyPy TODO
https://bugs.pypy.org/issue956
---
pym/portage/tests/ebuild/test_pty_eof.py | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/pym/portage/tests/ebuild/test_pty_eof.py b/pym/portage/tests/ebuild/test_pty_eof.py
index c8de3e2..0b0bbdb 100644
--- a/pym/portage/tests/ebuild/test_pty_eof.py
+++ b/pym/portage/tests/ebuild/test_pty_eof.py
@@ -1,6 +1,8 @@
# Copyright 2009-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
+import platform
+
from portage.tests import TestCase
from portage.util._pty import _can_test_pty_eof, _test_pty_eof
@@ -37,6 +39,10 @@ class PtyEofFdopenUnBufferedTestCase(TestCase):
self.fail(skip_reason)
return
+ if platform.python_implementation() == 'PyPy':
+ # https://bugs.pypy.org/issue956
+ self.todo = True
+
# The result is only valid if openpty does not raise EnvironmentError.
if _can_test_pty_eof():
try:
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/ebuild/
@ 2012-01-13 2:46 Zac Medico
0 siblings, 0 replies; 19+ messages in thread
From: Zac Medico @ 2012-01-13 2:46 UTC (permalink / raw
To: gentoo-commits
commit: 7ab1ca09de0421b574df1ff9aa8ef5077e16b9ea
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 13 02:46:24 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jan 13 02:46:24 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7ab1ca09
test_config: fix AttributeError: 'str'
---
pym/portage/tests/ebuild/test_config.py | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/pym/portage/tests/ebuild/test_config.py b/pym/portage/tests/ebuild/test_config.py
index 35694ed..a1ba202 100644
--- a/pym/portage/tests/ebuild/test_config.py
+++ b/pym/portage/tests/ebuild/test_config.py
@@ -3,6 +3,7 @@
import portage
from portage import os
+from portage.dep import Atom
from portage.package.ebuild.config import config
from portage.package.ebuild._config.LicenseManager import LicenseManager
from portage.tests import TestCase
@@ -24,7 +25,7 @@ class ConfigTestCase(TestCase):
settings = config(clone=playground.settings)
result = playground.run(["=dev-libs/A-1"])
pkg, existing_node = result.depgraph._select_package(
- playground.eroot, "=dev-libs/A-1")
+ playground.eroot, Atom("=dev-libs/A-1"))
settings.setcpv(pkg)
# clone after setcpv tests deepcopy of LazyItemsDict
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/ebuild/
@ 2012-02-09 0:46 Zac Medico
0 siblings, 0 replies; 19+ messages in thread
From: Zac Medico @ 2012-02-09 0:46 UTC (permalink / raw
To: gentoo-commits
commit: 6b0101ea37ad9e7db3866d3ccfe8e398529f7f29
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 9 00:46:02 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Feb 9 00:46:02 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6b0101ea
IpcDaemonTestCase: init start_time earlier
Since commit 4620d6aba1c5c10344e311585516ee43819b703c, the
SequentialTaskQueue.add() method starts the task immediately, so
initialize start_time before that happens.
---
pym/portage/tests/ebuild/test_ipc_daemon.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pym/portage/tests/ebuild/test_ipc_daemon.py b/pym/portage/tests/ebuild/test_ipc_daemon.py
index c638437..edfc058 100644
--- a/pym/portage/tests/ebuild/test_ipc_daemon.py
+++ b/pym/portage/tests/ebuild/test_ipc_daemon.py
@@ -75,9 +75,9 @@ class IpcDaemonTestCase(TestCase):
daemon.cancel()
exit_command.reply_hook = exit_command_callback
+ start_time = time.time()
task_scheduler.add(daemon)
task_scheduler.add(proc)
- start_time = time.time()
task_scheduler.run(timeout=self._SCHEDULE_TIMEOUT)
task_scheduler.clear()
hardlock_cleanup(env['PORTAGE_BUILDDIR'],
@@ -112,9 +112,9 @@ class IpcDaemonTestCase(TestCase):
daemon.cancel()
exit_command.reply_hook = exit_command_callback
+ start_time = time.time()
task_scheduler.add(daemon)
task_scheduler.add(proc)
- start_time = time.time()
task_scheduler.run(timeout=short_timeout_ms)
task_scheduler.clear()
hardlock_cleanup(env['PORTAGE_BUILDDIR'],
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/ebuild/
@ 2012-07-05 0:38 Zac Medico
0 siblings, 0 replies; 19+ messages in thread
From: Zac Medico @ 2012-07-05 0:38 UTC (permalink / raw
To: gentoo-commits
commit: 0f700f0b38868502cea0324712f34696e54b175d
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 5 00:38:34 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jul 5 00:38:34 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0f700f0b
ConfigTestCase: fix warning about manifest-hashes
---
pym/portage/tests/ebuild/test_config.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pym/portage/tests/ebuild/test_config.py b/pym/portage/tests/ebuild/test_config.py
index a1ba202..63cb99d 100644
--- a/pym/portage/tests/ebuild/test_config.py
+++ b/pym/portage/tests/ebuild/test_config.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2011 Gentoo Foundation
+# Copyright 2010-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
import portage
@@ -220,7 +220,7 @@ class ConfigTestCase(TestCase):
(
"profile-formats = pms",
"thin-manifests = true",
- "manifest-hashes = RMD160 SHA1 SHA256 SHA512 WHIRLPOOL",
+ "manifest-hashes = SHA256 SHA512 WHIRLPOOL",
),
}
}
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/ebuild/
@ 2012-09-26 18:22 Zac Medico
0 siblings, 0 replies; 19+ messages in thread
From: Zac Medico @ 2012-09-26 18:22 UTC (permalink / raw
To: gentoo-commits
commit: c371cb4d1a1858c6271af9abee53b1dcc28d5435
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 26 18:22:15 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Sep 26 18:22:15 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c371cb4d
test_ipc_daemon: increase sleep for bug #436334
---
pym/portage/tests/ebuild/test_ipc_daemon.py | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/pym/portage/tests/ebuild/test_ipc_daemon.py b/pym/portage/tests/ebuild/test_ipc_daemon.py
index 0efab65..fc14671 100644
--- a/pym/portage/tests/ebuild/test_ipc_daemon.py
+++ b/pym/portage/tests/ebuild/test_ipc_daemon.py
@@ -92,7 +92,9 @@ class IpcDaemonTestCase(TestCase):
self.assertEqual(exit_command.exitcode, exitcode)
# Intentionally short timeout test for QueueScheduler.run()
- sleep_time_s = 10 # 10.000 seconds
+ # Use a ridiculously long sleep_time_s in case the user's
+ # system is heavily loaded (see bug #436334).
+ sleep_time_s = 600 #600.000 seconds
short_timeout_ms = 10 # 0.010 seconds
for i in range(3):
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/ebuild/
@ 2012-10-05 4:08 Zac Medico
0 siblings, 0 replies; 19+ messages in thread
From: Zac Medico @ 2012-10-05 4:08 UTC (permalink / raw
To: gentoo-commits
commit: e58829dd5e2272b9c3878cd0ec92680fae075b40
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 5 04:08:01 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Oct 5 04:08:01 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e58829dd
test_ipc_daemon: implement internal SleepProcess
Emulate the sleep command, in order to ensure a consistent return code
when it is killed by SIGTERM (see bug #437180).
---
pym/portage/tests/ebuild/test_ipc_daemon.py | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/pym/portage/tests/ebuild/test_ipc_daemon.py b/pym/portage/tests/ebuild/test_ipc_daemon.py
index fc14671..77277fe 100644
--- a/pym/portage/tests/ebuild/test_ipc_daemon.py
+++ b/pym/portage/tests/ebuild/test_ipc_daemon.py
@@ -13,11 +13,21 @@ from portage.const import BASH_BINARY
from portage.locks import hardlock_cleanup
from portage.package.ebuild._ipc.ExitCommand import ExitCommand
from portage.util import ensure_dirs
+from portage.util._async.ForkProcess import ForkProcess
from _emerge.SpawnProcess import SpawnProcess
from _emerge.EbuildBuildDir import EbuildBuildDir
from _emerge.EbuildIpcDaemon import EbuildIpcDaemon
from _emerge.TaskScheduler import TaskScheduler
+class SleepProcess(ForkProcess):
+ """
+ Emulate the sleep command, in order to ensure a consistent
+ return code when it is killed by SIGTERM (see bug #437180).
+ """
+ __slots__ = ('seconds',)
+ def _run(self):
+ time.sleep(self.seconds)
+
class IpcDaemonTestCase(TestCase):
_SCHEDULE_TIMEOUT = 40000 # 40 seconds
@@ -104,9 +114,8 @@ class IpcDaemonTestCase(TestCase):
input_fifo=input_fifo,
output_fifo=output_fifo,
scheduler=task_scheduler.sched_iface)
- proc = SpawnProcess(
- args=[BASH_BINARY, "-c", 'exec sleep %d' % sleep_time_s],
- env=env, scheduler=task_scheduler.sched_iface)
+ proc = SleepProcess(seconds=sleep_time_s,
+ scheduler=task_scheduler.sched_iface)
self.received_command = False
def exit_command_callback():
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/ebuild/
@ 2012-10-08 15:09 Zac Medico
0 siblings, 0 replies; 19+ messages in thread
From: Zac Medico @ 2012-10-08 15:09 UTC (permalink / raw
To: gentoo-commits
commit: 56fbe3fe63adf4e7c5b47400182cd857d145d5b0
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 8 15:08:51 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Oct 8 15:08:51 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=56fbe3fe
test_ipc_daemon: handle fork/finally race
---
pym/portage/tests/ebuild/test_ipc_daemon.py | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/pym/portage/tests/ebuild/test_ipc_daemon.py b/pym/portage/tests/ebuild/test_ipc_daemon.py
index a871076..b88fce6 100644
--- a/pym/portage/tests/ebuild/test_ipc_daemon.py
+++ b/pym/portage/tests/ebuild/test_ipc_daemon.py
@@ -36,6 +36,7 @@ class IpcDaemonTestCase(TestCase):
def testIpcDaemon(self):
event_loop = global_event_loop()
tmpdir = tempfile.mkdtemp()
+ main_pid = os.getpid()
build_dir = None
try:
env = {}
@@ -135,6 +136,14 @@ class IpcDaemonTestCase(TestCase):
self.assertEqual(proc.returncode == os.EX_OK, False)
finally:
+
+ # Ensure that finally blocks don't run in forked subprocesses
+ # before they are able to exec or _exit themselves, since the
+ # fork might fail or be killed before it can setup its own
+ # try/finally/_exit routine. See bug #345289.
+ if os.getpid() != main_pid:
+ os._exit(1)
+
if build_dir is not None:
build_dir.unlock()
shutil.rmtree(tmpdir)
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/ebuild/
@ 2012-10-08 16:09 Zac Medico
0 siblings, 0 replies; 19+ messages in thread
From: Zac Medico @ 2012-10-08 16:09 UTC (permalink / raw
To: gentoo-commits
commit: ad177e7083c89e259df95947f3de47be96dbbf56
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 8 16:07:08 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Oct 8 16:07:08 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ad177e70
Revert "test_ipc_daemon: handle fork/finally race"
This reverts commit 56fbe3fe63adf4e7c5b47400182cd857d145d5b0.
The race is now handled internally by spawn and ForkProcess.
---
pym/portage/tests/ebuild/test_ipc_daemon.py | 9 ---------
1 files changed, 0 insertions(+), 9 deletions(-)
diff --git a/pym/portage/tests/ebuild/test_ipc_daemon.py b/pym/portage/tests/ebuild/test_ipc_daemon.py
index b88fce6..a871076 100644
--- a/pym/portage/tests/ebuild/test_ipc_daemon.py
+++ b/pym/portage/tests/ebuild/test_ipc_daemon.py
@@ -36,7 +36,6 @@ class IpcDaemonTestCase(TestCase):
def testIpcDaemon(self):
event_loop = global_event_loop()
tmpdir = tempfile.mkdtemp()
- main_pid = os.getpid()
build_dir = None
try:
env = {}
@@ -136,14 +135,6 @@ class IpcDaemonTestCase(TestCase):
self.assertEqual(proc.returncode == os.EX_OK, False)
finally:
-
- # Ensure that finally blocks don't run in forked subprocesses
- # before they are able to exec or _exit themselves, since the
- # fork might fail or be killed before it can setup its own
- # try/finally/_exit routine. See bug #345289.
- if os.getpid() != main_pid:
- os._exit(1)
-
if build_dir is not None:
build_dir.unlock()
shutil.rmtree(tmpdir)
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/ebuild/
@ 2013-01-11 7:22 Zac Medico
0 siblings, 0 replies; 19+ messages in thread
From: Zac Medico @ 2013-01-11 7:22 UTC (permalink / raw
To: gentoo-commits
commit: b5ef3cd3ef9261981f7f1dcadcdcf3f2a56d38f2
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 11 07:22:03 2013 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Jan 11 07:22:03 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b5ef3cd3
DoebuildSpawnTestCase: also call spawn_nofetch
---
pym/portage/tests/ebuild/test_doebuild_spawn.py | 39 ++++++++++++++++-------
1 files changed, 27 insertions(+), 12 deletions(-)
diff --git a/pym/portage/tests/ebuild/test_doebuild_spawn.py b/pym/portage/tests/ebuild/test_doebuild_spawn.py
index 6c66f81..ae9a5c5 100644
--- a/pym/portage/tests/ebuild/test_doebuild_spawn.py
+++ b/pym/portage/tests/ebuild/test_doebuild_spawn.py
@@ -1,12 +1,15 @@
# Copyright 2010-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
+import textwrap
+
from portage import os
from portage import _python_interpreter
from portage import _shell_quote
from portage.const import EBUILD_SH_BINARY
from portage.package.ebuild.config import config
from portage.package.ebuild.doebuild import spawn as doebuild_spawn
+from portage.package.ebuild._spawn_nofetch import spawn_nofetch
from portage.tests import TestCase
from portage.tests.resolver.ResolverPlayground import ResolverPlayground
from portage.util._async.SchedulerInterface import SchedulerInterface
@@ -24,27 +27,37 @@ class DoebuildSpawnTestCase(TestCase):
"""
def testDoebuildSpawn(self):
- playground = ResolverPlayground()
- try:
- settings = config(clone=playground.settings)
- if "__PORTAGE_TEST_HARDLINK_LOCKS" in os.environ:
- settings["__PORTAGE_TEST_HARDLINK_LOCKS"] = \
- os.environ["__PORTAGE_TEST_HARDLINK_LOCKS"]
- settings.backup_changes("__PORTAGE_TEST_HARDLINK_LOCKS")
- cpv = 'sys-apps/portage-2.1'
- metadata = {
+ ebuild_body = textwrap.dedent("""
+ pkg_nofetch() { : ; }
+ """)
+
+ ebuilds = {
+ 'sys-apps/portage-2.1': {
'EAPI' : '2',
- 'INHERITED' : 'python eutils',
'IUSE' : 'build doc epydoc python3 selinux',
'KEYWORDS' : 'x86',
'LICENSE' : 'GPL-2',
- 'PROVIDE' : 'virtual/portage',
'RDEPEND' : '>=app-shells/bash-3.2_p17 >=dev-lang/python-2.6',
'SLOT' : '0',
- 'repository': 'gentoo',
+ "MISC_CONTENT": ebuild_body,
}
+ }
+
+ playground = ResolverPlayground(ebuilds=ebuilds)
+ try:
root_config = playground.trees[playground.eroot]['root_config']
+ portdb = root_config.trees["porttree"].dbapi
+ settings = config(clone=playground.settings)
+ if "__PORTAGE_TEST_HARDLINK_LOCKS" in os.environ:
+ settings["__PORTAGE_TEST_HARDLINK_LOCKS"] = \
+ os.environ["__PORTAGE_TEST_HARDLINK_LOCKS"]
+ settings.backup_changes("__PORTAGE_TEST_HARDLINK_LOCKS")
+
+ cpv = 'sys-apps/portage-2.1'
+ metadata = dict(zip(Package.metadata_keys,
+ portdb.aux_get(cpv, Package.metadata_keys)))
+
pkg = Package(built=False, cpv=cpv, installed=False,
metadata=metadata, root_config=root_config,
type_name='ebuild')
@@ -86,5 +99,7 @@ class DoebuildSpawnTestCase(TestCase):
ebuild_phase.start()
ebuild_phase.wait()
self.assertEqual(ebuild_phase.returncode, os.EX_OK)
+
+ spawn_nofetch(portdb, portdb.findname(cpv), settings=settings)
finally:
playground.cleanup()
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/ebuild/
@ 2013-07-07 2:48 Zac Medico
0 siblings, 0 replies; 19+ messages in thread
From: Zac Medico @ 2013-07-07 2:48 UTC (permalink / raw
To: gentoo-commits
commit: 1eee049e21caa96b4ef874723cd8ad43d331b979
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 7 02:48:38 2013 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jul 7 02:48:38 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1eee049e
DoebuildFdPipesTestCase: fix docstring
---
pym/portage/tests/ebuild/test_doebuild_fd_pipes.py | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/pym/portage/tests/ebuild/test_doebuild_fd_pipes.py b/pym/portage/tests/ebuild/test_doebuild_fd_pipes.py
index 1a51770..ddd73e2 100644
--- a/pym/portage/tests/ebuild/test_doebuild_fd_pipes.py
+++ b/pym/portage/tests/ebuild/test_doebuild_fd_pipes.py
@@ -22,14 +22,14 @@ class DoebuildProcess(ForkProcess):
return portage.doebuild(*self.doebuild_pargs, **self.doebuild_kwargs)
class DoebuildFdPipesTestCase(TestCase):
- """
- Invoke portage.package.ebuild.doebuild.spawn() with a
- minimal environment. This gives coverage to some of
- the ebuild execution internals, like ebuild.sh,
- AbstractEbuildProcess, and EbuildIpcDaemon.
- """
def testDoebuild(self):
+ """
+ Invoke portage.doebuild() with the fd_pipes parameter, and
+ check that the expected output appears in the pipe. This
+ functionality is not used by portage internally, but it is
+ supported for API consumers (see bug #475812).
+ """
ebuild_body = textwrap.dedent("""
S=${WORKDIR}
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/ebuild/
@ 2013-07-07 20:23 Zac Medico
0 siblings, 0 replies; 19+ messages in thread
From: Zac Medico @ 2013-07-07 20:23 UTC (permalink / raw
To: gentoo-commits
commit: 3d91f92b653b0583f710abcc40c8ebfe4af868e8
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 7 20:23:00 2013 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jul 7 20:23:00 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3d91f92b
test_doebuild_fd_pipes: test pkg_info
---
pym/portage/tests/ebuild/test_doebuild_fd_pipes.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/pym/portage/tests/ebuild/test_doebuild_fd_pipes.py b/pym/portage/tests/ebuild/test_doebuild_fd_pipes.py
index 6fdda5f..f0fc933 100644
--- a/pym/portage/tests/ebuild/test_doebuild_fd_pipes.py
+++ b/pym/portage/tests/ebuild/test_doebuild_fd_pipes.py
@@ -33,6 +33,7 @@ class DoebuildFdPipesTestCase(TestCase):
ebuild_body = textwrap.dedent("""
S=${WORKDIR}
+ pkg_info() { echo info ; }
pkg_nofetch() { echo nofetch ; }
pkg_pretend() { echo pretend ; }
pkg_setup() { echo setup ; }
@@ -78,8 +79,9 @@ class DoebuildFdPipesTestCase(TestCase):
ebuildpath = portdb.findname(cpv)
self.assertNotEqual(ebuildpath, None)
- for phase in ('pretend', 'setup', 'unpack', 'prepare', 'configure',
- 'compile', 'test', 'install', 'clean', 'merge', 'nofetch'):
+ for phase in ('info', 'nofetch',
+ 'pretend', 'setup', 'unpack', 'prepare', 'configure',
+ 'compile', 'test', 'install', 'clean', 'merge'):
pr, pw = os.pipe()
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/ebuild/
@ 2013-07-07 20:25 Zac Medico
0 siblings, 0 replies; 19+ messages in thread
From: Zac Medico @ 2013-07-07 20:25 UTC (permalink / raw
To: gentoo-commits
commit: c6ae519aafbce0b4bc8bfb9c8ec97055d3ac06d8
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 7 20:25:23 2013 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jul 7 20:25:23 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c6ae519a
test_doebuild_fd_pipes: test qmerge
---
pym/portage/tests/ebuild/test_doebuild_fd_pipes.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pym/portage/tests/ebuild/test_doebuild_fd_pipes.py b/pym/portage/tests/ebuild/test_doebuild_fd_pipes.py
index f0fc933..91c5bd6 100644
--- a/pym/portage/tests/ebuild/test_doebuild_fd_pipes.py
+++ b/pym/portage/tests/ebuild/test_doebuild_fd_pipes.py
@@ -81,7 +81,7 @@ class DoebuildFdPipesTestCase(TestCase):
for phase in ('info', 'nofetch',
'pretend', 'setup', 'unpack', 'prepare', 'configure',
- 'compile', 'test', 'install', 'clean', 'merge'):
+ 'compile', 'test', 'install', 'qmerge', 'clean', 'merge'):
pr, pw = os.pipe()
@@ -113,7 +113,7 @@ class DoebuildFdPipesTestCase(TestCase):
self.assertEqual(task_scheduler.returncode, os.EX_OK)
- if phase not in ('clean', 'merge'):
+ if phase not in ('clean', 'merge', 'qmerge'):
self.assertEqual(phase, output)
finally:
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/ebuild/
@ 2013-07-25 20:42 Zac Medico
0 siblings, 0 replies; 19+ messages in thread
From: Zac Medico @ 2013-07-25 20:42 UTC (permalink / raw
To: gentoo-commits
commit: 3283b779608f35982792f95b9d8415a892dfb346
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 25 20:37:23 2013 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Jul 25 20:40:08 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3283b779
test_doebuild_fd_pipes: bsd compat
---
pym/portage/tests/ebuild/test_doebuild_fd_pipes.py | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/pym/portage/tests/ebuild/test_doebuild_fd_pipes.py b/pym/portage/tests/ebuild/test_doebuild_fd_pipes.py
index 91c5bd6..61392dd 100644
--- a/pym/portage/tests/ebuild/test_doebuild_fd_pipes.py
+++ b/pym/portage/tests/ebuild/test_doebuild_fd_pipes.py
@@ -52,6 +52,14 @@ class DoebuildFdPipesTestCase(TestCase):
}
}
+ # Override things that may be unavailable, or may have portability
+ # issues when running tests in exotic environments.
+ # prepstrip - bug #447810 (bash read builtin EINTR problem)
+ true_symlinks = ("find", "prepstrip", "sed", "scanelf")
+ true_binary = portage.process.find_binary("true")
+ self.assertEqual(true_binary is None, False,
+ "true command not found")
+
playground = ResolverPlayground(ebuilds=ebuilds)
try:
QueryCommand._db = playground.trees
@@ -68,6 +76,14 @@ class DoebuildFdPipesTestCase(TestCase):
settings['PORTAGE_PYTHON'] = portage._python_interpreter
settings['PORTAGE_QUIET'] = "1"
+ fake_bin = os.path.join(settings["EPREFIX"], "bin")
+ portage.util.ensure_dirs(fake_bin)
+ for x in true_symlinks:
+ os.symlink(true_binary, os.path.join(fake_bin, x))
+
+ settings["__PORTAGE_TEST_PATH_OVERRIDE"] = fake_bin
+ settings.backup_changes("__PORTAGE_TEST_PATH_OVERRIDE")
+
cpv = 'app-misct/foo-1'
metadata = dict(zip(Package.metadata_keys,
portdb.aux_get(cpv, Package.metadata_keys)))
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [gentoo-commits] proj/portage:master commit in: pym/portage/tests/ebuild/
@ 2016-01-17 2:55 Zac Medico
0 siblings, 0 replies; 19+ messages in thread
From: Zac Medico @ 2016-01-17 2:55 UTC (permalink / raw
To: gentoo-commits
commit: 44aeab7fad440a289316ced8738b287d88d475d0
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 17 02:52:02 2016 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Jan 17 02:54:27 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=44aeab7f
DoebuildFdPipesTestCase: use extra pipe for test output
Since commit 3767128cf08a0a21559eb9c41ba393dcabc6f087, this test has
failed due to additional output produced by src_install. Fix it to
use a separate pipe for test output.
pym/portage/tests/ebuild/test_doebuild_fd_pipes.py | 36 +++++++++++-----------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/pym/portage/tests/ebuild/test_doebuild_fd_pipes.py b/pym/portage/tests/ebuild/test_doebuild_fd_pipes.py
index 2a65537..b894218 100644
--- a/pym/portage/tests/ebuild/test_doebuild_fd_pipes.py
+++ b/pym/portage/tests/ebuild/test_doebuild_fd_pipes.py
@@ -1,8 +1,6 @@
-# Copyright 2013-2015 Gentoo Foundation
+# Copyright 2013-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-import textwrap
-
import portage
from portage import os
from portage.tests import TestCase
@@ -10,7 +8,6 @@ from portage.tests.resolver.ResolverPlayground import ResolverPlayground
from portage.package.ebuild._ipc.QueryCommand import QueryCommand
from portage.util._async.ForkProcess import ForkProcess
from portage.util._async.TaskScheduler import TaskScheduler
-from portage.util._eventloop.global_event_loop import global_event_loop
from _emerge.Package import Package
from _emerge.PipeReader import PipeReader
@@ -31,19 +28,16 @@ class DoebuildFdPipesTestCase(TestCase):
supported for API consumers (see bug #475812).
"""
- ebuild_body = textwrap.dedent("""
- S=${WORKDIR}
- pkg_info() { echo info ; }
- pkg_nofetch() { echo nofetch ; }
- pkg_pretend() { echo pretend ; }
- pkg_setup() { echo setup ; }
- src_unpack() { echo unpack ; }
- src_prepare() { echo prepare ; }
- src_configure() { echo configure ; }
- src_compile() { echo compile ; }
- src_test() { echo test ; }
- src_install() { echo install ; }
- """)
+ output_fd = 200
+ ebuild_body = ['S=${WORKDIR}']
+ for phase_func in ('pkg_info', 'pkg_nofetch', 'pkg_pretend',
+ 'pkg_setup', 'src_unpack', 'src_prepare', 'src_configure',
+ 'src_compile', 'src_test', 'src_install'):
+ ebuild_body.append(('%s() { echo ${EBUILD_PHASE}'
+ ' 1>&%s; }') % (phase_func, output_fd))
+
+ ebuild_body.append('')
+ ebuild_body = '\n'.join(ebuild_body)
ebuilds = {
'app-misct/foo-1': {
@@ -60,6 +54,7 @@ class DoebuildFdPipesTestCase(TestCase):
self.assertEqual(true_binary is None, False,
"true command not found")
+ dev_null = open(os.devnull, 'wb')
playground = ResolverPlayground(ebuilds=ebuilds)
try:
QueryCommand._db = playground.trees
@@ -106,7 +101,11 @@ class DoebuildFdPipesTestCase(TestCase):
doebuild_kwargs={"settings" : settings,
"mydbapi": portdb, "tree": "porttree",
"vartree": root_config.trees["vartree"],
- "fd_pipes": {1: pw, 2: pw},
+ "fd_pipes": {
+ 1: dev_null.fileno(),
+ 2: dev_null.fileno(),
+ output_fd: pw,
+ },
"prev_mtimes": {}})
consumer = PipeReader(
@@ -134,5 +133,6 @@ class DoebuildFdPipesTestCase(TestCase):
self.assertEqual(phase, output)
finally:
+ dev_null.close()
playground.cleanup()
QueryCommand._db = None
^ permalink raw reply related [flat|nested] 19+ messages in thread
end of thread, other threads:[~2016-01-17 2:55 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-09 0:46 [gentoo-commits] proj/portage:master commit in: pym/portage/tests/ebuild/ Zac Medico
-- strict thread matches above, loose matches on Subject: below --
2016-01-17 2:55 Zac Medico
2013-07-25 20:42 Zac Medico
2013-07-07 20:25 Zac Medico
2013-07-07 20:23 Zac Medico
2013-07-07 2:48 Zac Medico
2013-01-11 7:22 Zac Medico
2012-10-08 16:09 Zac Medico
2012-10-08 15:09 Zac Medico
2012-10-05 4:08 Zac Medico
2012-09-26 18:22 Zac Medico
2012-07-05 0:38 Zac Medico
2012-01-13 2:46 Zac Medico
2011-12-16 3:23 Zac Medico
2011-10-25 16:41 Zac Medico
2011-10-04 6:18 Zac Medico
2011-09-15 2:55 Zac Medico
2011-09-04 19:06 Zac Medico
2011-06-09 10:59 Zac Medico
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox