Skip to content

Commit

Permalink
multicloud: loader: guard against changing proxyFunc of default client
Browse files Browse the repository at this point in the history
  • Loading branch information
yousong committed May 9, 2020
1 parent fd3c9e5 commit e711ae7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/multicloud/loader/proxyfunc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (

"yunion.io/x/onecloud/pkg/apis/compute"
"yunion.io/x/onecloud/pkg/cloudprovider"
"yunion.io/x/onecloud/pkg/util/httputils"
)

func TestProxyFunc(t *testing.T) {
Expand All @@ -39,6 +40,14 @@ func TestProxyFunc(t *testing.T) {
}
t.Errorf("vendor %s: proxyFunc not working", vendor)
}
t.Run("default client no proxy", func(t *testing.T) {
proxied = false
client := httputils.GetDefaultClient()
client.Get("http://default-client-no-proxy.TestProxyFunc." + vendor + "/")
if proxied {
t.Errorf("%s: default client proxy changed", vendor)
}
})
}

t.Parallel()
Expand Down

0 comments on commit e711ae7

Please sign in to comment.