From 8615d47abf427e09b7648998af252b55bc2a73e6 Mon Sep 17 00:00:00 2001
From: Vincent Pelletier <vincent@nexedi.com>
Date: Tue, 14 Dec 2010 15:57:10 +0000
Subject: [PATCH] Raise when subprocess exited with an error status.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2538 71dcc9de-d417-0410-9af5-da40c76e7ee4
---
 neo/tests/functional/__init__.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/neo/tests/functional/__init__.py b/neo/tests/functional/__init__.py
index 3bbb3935..027d35bc 100644
--- a/neo/tests/functional/__init__.py
+++ b/neo/tests/functional/__init__.py
@@ -41,6 +41,9 @@ NEO_ADMIN = 'neoadmin'
 DELAY_SAFETY_MARGIN = 10
 MAX_START_TIME = 30
 
+class NodeProcessError(Exception):
+    pass
+
 class AlreadyRunning(Exception):
     pass
 
@@ -117,6 +120,9 @@ class NEOProcess(object):
             raise AlreadyStopped
         result = os.WEXITSTATUS(os.waitpid(self.pid, options)[1])
         self.pid = 0
+        if result:
+            raise NodeProcessError('%r %r exited with status %r' % (
+                self.command, self.arg_dict, result))
         return result
 
     def stop(self):
-- 
2.30.9