From 9ce6ff33c95e13cf3fcc4289c66da54509e55750 Mon Sep 17 00:00:00 2001 From: jtpereyda Date: Thu, 2 Jul 2015 16:54:00 -0700 Subject: [PATCH 1/2] The procmon start_target method is expected to return true if it is successful. process_monitor_unix.py failed to do this. Updated process_monitor_unix.py start_target method, and updated docstrings for both procmon files. --- process_monitor.py | 2 ++ process_monitor_unix.py | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/process_monitor.py b/process_monitor.py index 11bb847..f5503c1 100644 --- a/process_monitor.py +++ b/process_monitor.py @@ -291,6 +291,8 @@ def pre_send (self, test_number): def start_target (self): """ Start up the target process by issuing the commands in self.start_commands. + + @returns True if successful. No failure detection yet. """ self.log("starting target process") diff --git a/process_monitor_unix.py b/process_monitor_unix.py index 7f33d3b..96dfe42 100644 --- a/process_monitor_unix.py +++ b/process_monitor_unix.py @@ -172,9 +172,11 @@ def pre_send (self, test_number): self.test_number = test_number def start_target (self): - ''' + """ Start up the target process by issuing the commands in self.start_commands. - ''' + + @returns True if successful. No failure detection yet. + """ self.log("starting target process") @@ -184,6 +186,7 @@ def start_target (self): threading.Thread(target=self.dbg.start_monitoring).start() self.log("done. target up and running, giving it 5 seconds to settle in.") time.sleep(5) + return True def stop_target (self): ''' From 81eab9c2165722efe10929c606fb773c0dc6b63a Mon Sep 17 00:00:00 2001 From: josh Date: Fri, 21 Aug 2015 15:47:38 -0700 Subject: [PATCH 2/2] Unix procmon debugging works now. --- process_monitor_unix.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/process_monitor_unix.py b/process_monitor_unix.py index 96dfe42..1ef58cd 100644 --- a/process_monitor_unix.py +++ b/process_monitor_unix.py @@ -4,6 +4,7 @@ import signal import time import threading +import subprocess from sulley import pedrpc @@ -63,7 +64,7 @@ def __init__(self, start_command): def spawn_target(self): print self.tokens - self.pid = os.spawnv(os.P_NOWAIT, self.tokens[0], self.tokens) + self.pid = subprocess.Popen(self.tokens).pid self.alive = True def start_monitoring(self):