[Reproducible-commits] [reprotest] 01/04: Prevent testbed from stopping on an error and ensure errors from the shell get printed when check_exec fails

Ceridwen ceridwen-guest at moszumanska.debian.org
Wed Jul 13 21:26:38 UTC 2016


This is an automated email from the git hooks/post-receive script.

ceridwen-guest pushed a commit to branch virtualization
in repository reprotest.

commit 8f1fe119fd3c7fdf10bace47aa8362d64d4456db
Author: Ceridwen <ceridwenv at gmail.com>
Date:   Tue Jul 12 15:24:36 2016 -0400

    Prevent testbed from stopping on an error and ensure errors from the shell get printed when check_exec fails
---
 reprotest/lib/VirtSubproc.py |  4 ++--
 reprotest/lib/adt_testbed.py | 10 +++++++---
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/reprotest/lib/VirtSubproc.py b/reprotest/lib/VirtSubproc.py
index 86be017..c37051d 100644
--- a/reprotest/lib/VirtSubproc.py
+++ b/reprotest/lib/VirtSubproc.py
@@ -183,8 +183,8 @@ def check_exec(argv, downp=False, outp=False, timeout=0):
                                          stdout=stdout, stderr=subprocess.PIPE)
 
     if status:
-        bomb("%s%s failed (exit status %d)" %
-             ((downp and "(down) " or ""), argv, status))
+        bomb("%s%s failed (exit status %d)\n%s" %
+             ((downp and "(down) " or ""), argv, status, err))
     if err:
         bomb("%s unexpectedly produced stderr output `%s'" %
              (argv, err))
diff --git a/reprotest/lib/adt_testbed.py b/reprotest/lib/adt_testbed.py
index 4aeda23..3799a63 100644
--- a/reprotest/lib/adt_testbed.py
+++ b/reprotest/lib/adt_testbed.py
@@ -331,7 +331,7 @@ class Testbed:
 
     def bomb(self, m, _type=adtlog.TestbedFailure):
         adtlog.debug('%s %s' % (_type.__name__, m))
-        self.stop()
+        # self.stop()
         raise _type(m)
 
     def badpkg(self, m):
@@ -389,7 +389,10 @@ class Testbed:
             ll = list(map(urllib.parse.unquote, ll))
         return ll
 
-    def execute(self, argv, xenv=[], stdout=None, stderr=None, kind='short', cwd=os.getcwd()):
+    # TODO: with stdout and stderr defaulting to None, this function
+    # eats all errors/output from its call, which is not the right
+    # thing.
+    def execute(self, argv, xenv=[], stdout=None, stderr=None, kind='short'):
         '''Run command in testbed.
 
         The commands stdout/err will be piped directly to adt-run and its log
@@ -413,11 +416,12 @@ class Testbed:
         if env:
             argv = ['env'] + env + argv
 
+        # import pdb; pdb.set_trace()
         VirtSubproc.timeout_start(timeouts[kind])
         try:
             proc = subprocess.Popen(self.exec_cmd + argv,
                                     stdin=self.devnull,
-                                    stdout=stdout, stderr=stderr, cwd=cwd)
+                                    stdout=stdout, stderr=stderr)
             (out, err) = proc.communicate()
             if out is not None:
                 out = out.decode()

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/reprotest.git



More information about the Reproducible-commits mailing list