From 02abb60a67376c6e34b52149d528c1be03642152 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Tue, 22 Apr 2014 10:49:10 +0200 Subject: [PATCH] validate:launcher: Send SIGINT signal instead of killing the subprocess This way we get the result from GstValidate even on timeouts --- validate/tools/launcher/apps/gst-validate.py | 2 +- validate/tools/launcher/baseclasses.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/validate/tools/launcher/apps/gst-validate.py b/validate/tools/launcher/apps/gst-validate.py index dc27e251aa..ea3f361f15 100644 --- a/validate/tools/launcher/apps/gst-validate.py +++ b/validate/tools/launcher/apps/gst-validate.py @@ -51,7 +51,7 @@ class PlaybinDescriptor(PipelineDescriptor): def get_pipeline(self, options, protocol, scenario, uri): pipe = self._pipeline if options.mute: - fakesink = "fakesink sync=true" + fakesink = "'fakesink sync=true'" pipe += " audio-sink=%s video-sink=%s" %(fakesink, fakesink) pipe += " uri=%s" % uri diff --git a/validate/tools/launcher/baseclasses.py b/validate/tools/launcher/baseclasses.py index 63196ab83e..1c60037b7b 100644 --- a/validate/tools/launcher/baseclasses.py +++ b/validate/tools/launcher/baseclasses.py @@ -24,6 +24,7 @@ import sys import re import time import utils +import signal import urlparse import subprocess import reporters @@ -199,18 +200,18 @@ class Test(Loggable): printc(message, Colors.OKBLUE) try: - self.process = subprocess.Popen(self.command, + self.process = subprocess.Popen("exec " + self.command, stderr=self.reporter.out, stdout=self.reporter.out, shell=True, env=proc_env) self.wait_process() except KeyboardInterrupt: - self.process.kill() + self.process.send_signal(signal.SIGINT) raise try: - self.process.terminate() + self.process.send_signal(signal.SIGINT) except OSError: pass