mirror of
https://github.com/containers/podman.git
synced 2025-07-31 04:12:40 +08:00
Merge pull request #17295 from sstosh/e2e-noproxy
e2e: fix run_staticip_test about no_proxy
This commit is contained in:
@ -105,15 +105,15 @@ var _ = Describe("Podman run with --ip flag", func() {
|
|||||||
result.WaitWithDefaultTimeout()
|
result.WaitWithDefaultTimeout()
|
||||||
Expect(result).Should(Exit(0))
|
Expect(result).Should(Exit(0))
|
||||||
|
|
||||||
// We need to set "no_proxy" in proxy environment
|
// This test should not use a proxy
|
||||||
if env, found := os.LookupEnv("no_proxy"); found {
|
client := &http.Client{
|
||||||
defer os.Setenv("no_proxy", env)
|
Transport: &http.Transport{
|
||||||
} else {
|
Proxy: nil,
|
||||||
defer os.Unsetenv("no_proxy")
|
},
|
||||||
}
|
}
|
||||||
os.Setenv("no_proxy", ip)
|
|
||||||
for retries := 20; retries > 0; retries-- {
|
for retries := 20; retries > 0; retries-- {
|
||||||
response, err := http.Get(fmt.Sprintf("http://%s", ip))
|
response, err := client.Get(fmt.Sprintf("http://%s", ip))
|
||||||
if err == nil && response.StatusCode == http.StatusOK {
|
if err == nil && response.StatusCode == http.StatusOK {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user