rteval: hackbench: raise an exception if hackbench fails to run

Raise an exception if hackbench fails to run, for exmaple, due to
low memory or not being in the path

Signed-off-by: John Kacur <jkacur@redhat.com>
diff --git a/rteval/modules/__init__.py b/rteval/modules/__init__.py
index b41653e..1cf4e42 100644
--- a/rteval/modules/__init__.py
+++ b/rteval/modules/__init__.py
@@ -185,7 +185,14 @@
             self.__timestamps["runloop_start"] = datetime.now()
             while not self.shouldStop():
                 # Run the workload
-                self._WorkloadTask()
+                try:
+                    self._WorkloadTask()
+                except:
+                    self._log(Log.DEBUG, "failed to start workload")
+                    self._donotrun = True
+                    self.setStop()
+                    self._setRuntimeError(True)
+                    raise RuntimeError()
 
                 if self.shouldStop():
                     break
diff --git a/rteval/modules/loads/hackbench.py b/rteval/modules/loads/hackbench.py
index 9d3f6c8..16dc029 100644
--- a/rteval/modules/loads/hackbench.py
+++ b/rteval/modules/loads/hackbench.py
@@ -138,7 +138,12 @@
         # just do this once
         if not self.started:
             for n in self.nodes:
-                self.tasks[n] = self.__starton(n)
+                try:
+                    self.tasks[n] = self.__starton(n)
+                except OSError, e:
+                    self._log(Log.DEBUG, "Error trying to launch hackbench")
+                    raise e
+
             self.started = True
             return
 
@@ -148,12 +153,9 @@
                     self.tasks[n].wait()
                     self.tasks[n] = self.__starton(n)
             except OSError, e:
-                if e.errno != errno.ENOMEM:
-                    raise e
                 # Exit gracefully without a traceback for out-of-memory errors
-                self._log(Log.DEBUG, "ERROR, ENOMEM while trying to launch hackbench")
-                print("out-of-memory trying to launch hackbench, exiting")
-                sys.exit(-1)
+                self._log(Log.DEBUG, "ERROR, trying to launch hackbench")
+                raise e
 
 
     def WorkloadAlive(self):