s4:python tests __init__.py - do not depend on "subprocess.check_call()"
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Mon, 9 Jan 2012 12:21:49 +0000 (13:21 +0100)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Mon, 9 Jan 2012 23:41:59 +0000 (00:41 +0100)
Method not present in Python 2.4

Reviewed-by: Jelmer
Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Tue Jan 10 00:41:59 CET 2012 on sn-devel-104

source4/scripting/python/samba/tests/__init__.py

index d9fbb15a028e34b5ac58de01d4a0e4bd0f789481..e2baa749b7f907cf1d55855c9dc6d1ae49b87897 100644 (file)
@@ -154,7 +154,10 @@ class BlackboxTestCase(TestCase):
 
     def check_run(self, line):
         line = self._make_cmdline(line)
-        subprocess.check_call(line, shell=True)
+        p = subprocess.Popen(line, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
+        retcode = p.wait()
+        if retcode:
+            raise BlackboxProcessError(retcode, line, p.stdout.read(), p.stderr.read())
 
     def check_output(self, line):
         line = self._make_cmdline(line)