mirror of
https://github.com/containers/podman.git
synced 2025-06-29 23:22:40 +08:00
Merge pull request #16763 from sstosh/e2e-http_proxy
e2e: keeps the http_proxy value
This commit is contained in:
@ -300,6 +300,11 @@ var _ = Describe("Podman build", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
It("podman build --http_proxy flag", func() {
|
It("podman build --http_proxy flag", func() {
|
||||||
|
if env, found := os.LookupEnv("http_proxy"); found {
|
||||||
|
defer os.Setenv("http_proxy", env)
|
||||||
|
} else {
|
||||||
|
defer os.Unsetenv("http_proxy")
|
||||||
|
}
|
||||||
os.Setenv("http_proxy", "1.2.3.4")
|
os.Setenv("http_proxy", "1.2.3.4")
|
||||||
if IsRemote() {
|
if IsRemote() {
|
||||||
podmanTest.StopRemoteService()
|
podmanTest.StopRemoteService()
|
||||||
@ -316,7 +321,6 @@ RUN printenv http_proxy`, ALPINE)
|
|||||||
session.Wait(120)
|
session.Wait(120)
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(Exit(0))
|
||||||
Expect(session.OutputToString()).To(ContainSubstring("1.2.3.4"))
|
Expect(session.OutputToString()).To(ContainSubstring("1.2.3.4"))
|
||||||
os.Unsetenv("http_proxy")
|
|
||||||
})
|
})
|
||||||
|
|
||||||
It("podman build relay exit code to process", func() {
|
It("podman build relay exit code to process", func() {
|
||||||
|
@ -121,6 +121,11 @@ ENV hello=world
|
|||||||
})
|
})
|
||||||
|
|
||||||
It("podman run --http-proxy test", func() {
|
It("podman run --http-proxy test", func() {
|
||||||
|
if env, found := os.LookupEnv("http_proxy"); found {
|
||||||
|
defer os.Setenv("http_proxy", env)
|
||||||
|
} else {
|
||||||
|
defer os.Unsetenv("http_proxy")
|
||||||
|
}
|
||||||
os.Setenv("http_proxy", "1.2.3.4")
|
os.Setenv("http_proxy", "1.2.3.4")
|
||||||
if IsRemote() {
|
if IsRemote() {
|
||||||
podmanTest.StopRemoteService()
|
podmanTest.StopRemoteService()
|
||||||
@ -140,12 +145,10 @@ ENV hello=world
|
|||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(Exit(0))
|
||||||
Expect(session.OutputToString()).To(ContainSubstring("5.6.7.8"))
|
Expect(session.OutputToString()).To(ContainSubstring("5.6.7.8"))
|
||||||
os.Unsetenv("http_proxy")
|
|
||||||
|
|
||||||
session = podmanTest.Podman([]string{"run", "--http-proxy=false", "--env", "http_proxy=5.6.7.8", ALPINE, "printenv", "http_proxy"})
|
session = podmanTest.Podman([]string{"run", "--http-proxy=false", "--env", "http_proxy=5.6.7.8", ALPINE, "printenv", "http_proxy"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(Exit(0))
|
||||||
Expect(session.OutputToString()).To(ContainSubstring("5.6.7.8"))
|
Expect(session.OutputToString()).To(ContainSubstring("5.6.7.8"))
|
||||||
os.Unsetenv("http_proxy")
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user