support/testing: runtest proxy support

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>
This commit is contained in:
Matt Weber 2018-07-11 09:31:11 -05:00 committed by Thomas Petazzoni
parent 01d8a0a945
commit 361bc21c52

View File

@ -35,6 +35,12 @@ class Builder(object):
def build(self): def build(self):
env = {"PATH": os.environ["PATH"]} 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] cmd = ["make", "-C", self.builddir]
ret = subprocess.call(cmd, stdout=self.logfile, stderr=self.logfile, ret = subprocess.call(cmd, stdout=self.logfile, stderr=self.logfile,
env=env) env=env)