summaryrefslogtreecommitdiff
path: root/integration
diff options
context:
space:
mode:
authorSebastiaan van Stijn <thaJeztah@users.noreply.github.com>2022-05-30 13:00:29 +0200
committerGitHub <noreply@github.com>2022-05-30 13:00:29 +0200
commit4e09933aed59546deaa8c326650d20acba90581b (patch)
tree8389a64409da9f5093655e45adc2a31de240ddb9 /integration
parent8752ec9976485333175f60aa28cd2b99469c4c53 (diff)
parentfdd2772547635b264526b471b191a2f44512bcbc (diff)
downloaddocker-4e09933aed59546deaa8c326650d20acba90581b.tar.gz
Merge pull request #43652 from thaJeztah/update_gotest_tools
vendor: gotest.tools v3.2.0
Diffstat (limited to 'integration')
-rw-r--r--integration/daemon/daemon_test.go31
1 files changed, 15 insertions, 16 deletions
diff --git a/integration/daemon/daemon_test.go b/integration/daemon/daemon_test.go
index e4649a7ab3..72ffdd1dbf 100644
--- a/integration/daemon/daemon_test.go
+++ b/integration/daemon/daemon_test.go
@@ -18,7 +18,6 @@ import (
"github.com/docker/docker/testutil/daemon"
"gotest.tools/v3/assert"
is "gotest.tools/v3/assert/cmp"
- "gotest.tools/v3/env"
"gotest.tools/v3/skip"
)
@@ -213,9 +212,9 @@ func TestDaemonProxy(t *testing.T) {
// Configure proxy through env-vars
t.Run("environment variables", func(t *testing.T) {
- defer env.Patch(t, "HTTP_PROXY", proxyServer.URL)()
- defer env.Patch(t, "HTTPS_PROXY", proxyServer.URL)()
- defer env.Patch(t, "NO_PROXY", "example.com")()
+ t.Setenv("HTTP_PROXY", proxyServer.URL)
+ t.Setenv("HTTPS_PROXY", proxyServer.URL)
+ t.Setenv("NO_PROXY", "example.com")
d := daemon.New(t)
c := d.NewClientT(t)
@@ -241,12 +240,12 @@ func TestDaemonProxy(t *testing.T) {
// Configure proxy through command-line flags
t.Run("command-line options", func(t *testing.T) {
- defer env.Patch(t, "HTTP_PROXY", "http://"+userPass+"from-env-http.invalid")()
- defer env.Patch(t, "http_proxy", "http://"+userPass+"from-env-http.invalid")()
- defer env.Patch(t, "HTTPS_PROXY", "https://"+userPass+"myuser:mypassword@from-env-https.invalid")()
- defer env.Patch(t, "https_proxy", "https://"+userPass+"myuser:mypassword@from-env-https.invalid")()
- defer env.Patch(t, "NO_PROXY", "ignore.invalid")()
- defer env.Patch(t, "no_proxy", "ignore.invalid")()
+ t.Setenv("HTTP_PROXY", "http://"+userPass+"from-env-http.invalid")
+ t.Setenv("http_proxy", "http://"+userPass+"from-env-http.invalid")
+ t.Setenv("HTTPS_PROXY", "https://"+userPass+"myuser:mypassword@from-env-https.invalid")
+ t.Setenv("https_proxy", "https://"+userPass+"myuser:mypassword@from-env-https.invalid")
+ t.Setenv("NO_PROXY", "ignore.invalid")
+ t.Setenv("no_proxy", "ignore.invalid")
d := daemon.New(t)
d.Start(t, "--http-proxy", proxyServer.URL, "--https-proxy", proxyServer.URL, "--no-proxy", "example.com")
@@ -282,12 +281,12 @@ func TestDaemonProxy(t *testing.T) {
// Configure proxy through configuration file
t.Run("configuration file", func(t *testing.T) {
- defer env.Patch(t, "HTTP_PROXY", "http://"+userPass+"from-env-http.invalid")()
- defer env.Patch(t, "http_proxy", "http://"+userPass+"from-env-http.invalid")()
- defer env.Patch(t, "HTTPS_PROXY", "https://"+userPass+"myuser:mypassword@from-env-https.invalid")()
- defer env.Patch(t, "https_proxy", "https://"+userPass+"myuser:mypassword@from-env-https.invalid")()
- defer env.Patch(t, "NO_PROXY", "ignore.invalid")()
- defer env.Patch(t, "no_proxy", "ignore.invalid")()
+ t.Setenv("HTTP_PROXY", "http://"+userPass+"from-env-http.invalid")
+ t.Setenv("http_proxy", "http://"+userPass+"from-env-http.invalid")
+ t.Setenv("HTTPS_PROXY", "https://"+userPass+"myuser:mypassword@from-env-https.invalid")
+ t.Setenv("https_proxy", "https://"+userPass+"myuser:mypassword@from-env-https.invalid")
+ t.Setenv("NO_PROXY", "ignore.invalid")
+ t.Setenv("no_proxy", "ignore.invalid")
d := daemon.New(t)
c := d.NewClientT(t)