[SCM] Samba Shared Repository - branch v4-5-test updated

Stefan Metzmacher metze at samba.org
Tue Nov 14 13:36:03 UTC 2017


The branch, v4-5-test has been updated
       via  3ad2444 python: use communicate to fix Popen deadlock
       via  d433c7f blackbox tests: method to check specific exit codes
      from  aba4994 VERSION: Bump version up to 4.5.15...

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-5-test


- Log -----------------------------------------------------------------
commit 3ad244462a075874f4740d58b42a2a5f082e3f1d
Author: Joe Guo <joeg at catalyst.net.nz>
Date:   Fri Sep 15 16:13:26 2017 +1200

    python: use communicate to fix Popen deadlock
    
    `Popen.wait()` will deadlock when using stdout=PIPE and/or stderr=PIPE and the
    child process generates large output to a pipe such that it blocks waiting for
    the OS pipe buffer to accept more data. Use communicate() to avoid that.
    
    Signed-off-by: Joe Guo <joeg at catalyst.net.nz>
    Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date(master): Thu Oct 19 09:27:16 CEST 2017 on sn-devel-144
    
    (cherry picked from commit 5dc773a5b00834c7a53130a73a48f49048bd55e8)
    
    Autobuild-User(v4-5-test): Stefan Metzmacher <metze at samba.org>
    Autobuild-Date(v4-5-test): Tue Nov 14 14:35:22 CET 2017 on sn-devel-144

commit d433c7f455e9ccb03c96bad2984c7cab3ef28628
Author: Gary Lockyer <gary at catalyst.net.nz>
Date:   Wed Aug 16 13:52:25 2017 +1200

    blackbox tests: method to check specific exit codes
    
    Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
    Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Garming Sam <garming at catalyst.net.nz>
    (cherry picked from commit 74ebcf6dfc84b6aab6838fa99e12808eb6b913d9)

-----------------------------------------------------------------------

Summary of changes:
 python/samba/tests/__init__.py | 25 ++++++++++++++++++-------
 1 file changed, 18 insertions(+), 7 deletions(-)


Changeset truncated at 500 lines:

diff --git a/python/samba/tests/__init__.py b/python/samba/tests/__init__.py
index 1c5f678..6960c0c 100644
--- a/python/samba/tests/__init__.py
+++ b/python/samba/tests/__init__.py
@@ -790,19 +790,30 @@ class BlackboxTestCase(TestCaseInTempDir):
         return line
 
     def check_run(self, line):
+        self.check_exit_code(line, 0)
+
+    def check_exit_code(self, line, expected):
         line = self._make_cmdline(line)
-        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())
+        p = subprocess.Popen(line,
+                             stdout=subprocess.PIPE,
+                             stderr=subprocess.PIPE,
+                             shell=True)
+        stdoutdata, stderrdata = p.communicate()
+        retcode = p.returncode
+        if retcode != expected:
+            raise BlackboxProcessError(retcode,
+                                       line,
+                                       stdoutdata,
+                                       stderrdata)
 
     def check_output(self, line):
         line = self._make_cmdline(line)
         p = subprocess.Popen(line, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True, close_fds=True)
-        retcode = p.wait()
+        stdoutdata, stderrdata = p.communicate()
+        retcode = p.returncode
         if retcode:
-            raise BlackboxProcessError(retcode, line, p.stdout.read(), p.stderr.read())
-        return p.stdout.read()
+            raise BlackboxProcessError(retcode, line, stdoutdata, stderrdata)
+        return stdoutdata
 
 
 def connect_samdb(samdb_url, lp=None, session_info=None, credentials=None,


-- 
Samba Shared Repository



More information about the samba-cvs mailing list