mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-01-12 03:21:33 +00:00
Bring back automatic HTTP_PROXY setting from environment. #46
This commit is contained in:
@@ -51,7 +51,12 @@ func NewDownloader(threads int, progress aptly.Progress) aptly.Downloader {
|
||||
unpause: make(chan bool),
|
||||
threads: threads,
|
||||
progress: progress,
|
||||
client: &http.Client{Transport: &http.Transport{DisableCompression: true}},
|
||||
client: &http.Client{
|
||||
Transport: &http.Transport{
|
||||
DisableCompression: true,
|
||||
Proxy: http.ProxyFromEnvironment,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for i := 0; i < downloader.threads; i++ {
|
||||
|
||||
@@ -77,6 +77,7 @@ class BaseTest(object):
|
||||
"ppaCodename": "",
|
||||
}
|
||||
configOverride = {}
|
||||
environmentOverride = {}
|
||||
|
||||
fixtureDBDir = os.path.join(os.environ["HOME"], "aptly-fixture-db")
|
||||
fixturePoolDir = os.path.join(os.environ["HOME"], "aptly-fixture-pool")
|
||||
@@ -160,6 +161,7 @@ class BaseTest(object):
|
||||
command = shlex.split(command)
|
||||
environ = os.environ.copy()
|
||||
environ["LC_ALL"] = "C"
|
||||
environ.update(self.environmentOverride)
|
||||
proc = subprocess.Popen(command, stderr=subprocess.STDOUT, stdout=subprocess.PIPE, env=environ)
|
||||
output, _ = proc.communicate()
|
||||
#print "CMD %s: %.2f" % (" ".join(command), time.time()-start)
|
||||
|
||||
@@ -224,3 +224,14 @@ class CreateMirror19Test(BaseTest):
|
||||
|
||||
self.check_output()
|
||||
self.check_cmd_output("aptly mirror show mirror19", "mirror_show", match_prepare=removeDates)
|
||||
|
||||
|
||||
class CreateMirror20Test(BaseTest):
|
||||
"""
|
||||
create mirror: using failing HTTP_PROXY
|
||||
"""
|
||||
fixtureGpg = True
|
||||
|
||||
runCmd = "aptly -architectures='i386' mirror create -keyring=aptlytest.gpg -with-sources mirror20 http://security.debian.org/ wheezy/updates main"
|
||||
environmentOverride = {"HTTP_PROXY": "127.0.0.1:3137"}
|
||||
expectedCode = 1
|
||||
|
||||
Reference in New Issue
Block a user