aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-08-13 07:05:12 -0700
committerZac Medico <zmedico@gentoo.org>2010-08-13 07:05:12 -0700
commit12cbc8821476dcbac38464a41f7cb336da7ac0c9 (patch)
treec985564961b89af1f3ccb72f4347e41e0dd91a90 /pym/portage/tests/ebuild/test_ipc_daemon.py
parentUse SpawnProcess instead of doebuild.spawn(). (diff)
downloadportage-12cbc8821476dcbac38464a41f7cb336da7ac0c9.tar.gz
portage-12cbc8821476dcbac38464a41f7cb336da7ac0c9.tar.bz2
portage-12cbc8821476dcbac38464a41f7cb336da7ac0c9.zip
Use EbuildIpcDaemon to replace the functionality of
EBUILD_EXIT_STATUS_FILE.
Diffstat (limited to 'pym/portage/tests/ebuild/test_ipc_daemon.py')
-rw-r--r--pym/portage/tests/ebuild/test_ipc_daemon.py23
1 files changed, 2 insertions, 21 deletions
diff --git a/pym/portage/tests/ebuild/test_ipc_daemon.py b/pym/portage/tests/ebuild/test_ipc_daemon.py
index 48412a1c3..de548c6f1 100644
--- a/pym/portage/tests/ebuild/test_ipc_daemon.py
+++ b/pym/portage/tests/ebuild/test_ipc_daemon.py
@@ -8,30 +8,11 @@ from portage.tests import TestCase
from portage.const import PORTAGE_BIN_PATH
from portage.const import PORTAGE_PYM_PATH
from portage.const import BASH_BINARY
+from portage.package.ebuild._ipc.ExitCommand import ExitCommand
from _emerge.SpawnProcess import SpawnProcess
from _emerge.EbuildIpcDaemon import EbuildIpcDaemon
from _emerge.TaskScheduler import TaskScheduler
-class ExitCommand(object):
-
- def __init__(self):
- self.reply_hook = None
- self.exitcode = None
-
- def __call__(self, argv):
-
- if self.exitcode is not None:
- # Ignore all but the first call, since if die is called
- # then we certainly want to honor that exitcode, even
- # the ebuild process manages to send a second exit
- # command.
- self.reply_hook = None
- else:
- self.exitcode = int(argv[1])
-
- # (stdout, stderr, returncode)
- return ('', '', 0)
-
class IpcDaemonTestCase(TestCase):
def testIpcDaemon(self):
@@ -58,8 +39,8 @@ class IpcDaemonTestCase(TestCase):
'"$PORTAGE_BIN_PATH"/ebuild-ipc exit %d' % exitcode],
env=env, scheduler=task_scheduler.sched_iface)
def exit_command_callback():
- daemon.cancel()
proc.cancel()
+ daemon.cancel()
exit_command.reply_hook = exit_command_callback
task_scheduler.add(daemon)
task_scheduler.add(proc)