Skip to content

Commit

Permalink
Merge pull request #16763 from sstosh/e2e-http_proxy
Browse files Browse the repository at this point in the history
e2e: keeps the http_proxy value
  • Loading branch information
openshift-merge-robot authored Dec 7, 2022
2 parents f1e167d + 8b87665 commit 5b6a03f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion test/e2e/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,11 @@ var _ = Describe("Podman build", 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")
if IsRemote() {
podmanTest.StopRemoteService()
Expand All @@ -316,7 +321,6 @@ RUN printenv http_proxy`, ALPINE)
session.Wait(120)
Expect(session).Should(Exit(0))
Expect(session.OutputToString()).To(ContainSubstring("1.2.3.4"))
os.Unsetenv("http_proxy")
})

It("podman build relay exit code to process", func() {
Expand Down
7 changes: 5 additions & 2 deletions test/e2e/run_env_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ ENV hello=world
})

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")
if IsRemote() {
podmanTest.StopRemoteService()
Expand All @@ -140,12 +145,10 @@ ENV hello=world
session.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
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.WaitWithDefaultTimeout()
Expect(session).Should(Exit(0))
Expect(session.OutputToString()).To(ContainSubstring("5.6.7.8"))
os.Unsetenv("http_proxy")
})
})

0 comments on commit 5b6a03f

Please sign in to comment.