support/testing: runtest proxy support
authorMatt Weber <matthew.weber@rockwellcollins.com>
Wed, 11 Jul 2018 14:31:11 +0000 (09:31 -0500)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Fri, 10 Aug 2018 20:36:10 +0000 (22:36 +0200)
Allow builder.py to inherit the system proxy settings from
the env if they are present.

Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
support/testing/infra/builder.py

index faf1eb1494f6265f30f354853786b2ebcef86964..30230fdb17711439f081329d20fb1c7e91d32759 100644 (file)
@@ -35,6 +35,12 @@ class Builder(object):
 
     def build(self):
         env = {"PATH": os.environ["PATH"]}
+        if "http_proxy" in os.environ:
+            self.logfile.write("Using system proxy: " +
+                               os.environ["http_proxy"] + "\n")
+            self.logfile.flush()
+            env['http_proxy'] = os.environ["http_proxy"]
+            env['https_proxy'] = os.environ["http_proxy"]
         cmd = ["make", "-C", self.builddir]
         ret = subprocess.call(cmd, stdout=self.logfile, stderr=self.logfile,
                               env=env)