Ejemplo n.º 1
0
func (s *ConfigSuite) TestProxyValuesNotSet(c *gc.C) {
	s.addJujuFiles(c)
	config := newTestConfig(c, testing.Attrs{})
	c.Assert(config.HttpProxy(), gc.Equals, "")
	c.Assert(config.AptHttpProxy(), gc.Equals, "")
	c.Assert(config.HttpsProxy(), gc.Equals, "")
	c.Assert(config.AptHttpsProxy(), gc.Equals, "")
	c.Assert(config.FtpProxy(), gc.Equals, "")
	c.Assert(config.AptFtpProxy(), gc.Equals, "")
	c.Assert(config.NoProxy(), gc.Equals, "")
}
Ejemplo n.º 2
0
func (s *ConfigSuite) TestProxyValues(c *gc.C) {
	s.addJujuFiles(c)
	config := newTestConfig(c, testing.Attrs{
		"http-proxy":      "http://[email protected]",
		"https-proxy":     "https://[email protected]",
		"ftp-proxy":       "ftp://[email protected]",
		"apt-http-proxy":  "http://[email protected]",
		"apt-https-proxy": "https://[email protected]",
		"apt-ftp-proxy":   "ftp://[email protected]",
	})
	c.Assert(config.HttpProxy(), gc.Equals, "http://[email protected]")
	c.Assert(config.AptHttpProxy(), gc.Equals, "http://[email protected]")
	c.Assert(config.HttpsProxy(), gc.Equals, "https://[email protected]")
	c.Assert(config.AptHttpsProxy(), gc.Equals, "https://[email protected]")
	c.Assert(config.FtpProxy(), gc.Equals, "ftp://[email protected]")
	c.Assert(config.AptFtpProxy(), gc.Equals, "ftp://[email protected]")
}
Ejemplo n.º 3
0
func (s *ConfigSuite) TestProxyValuesWithFallback(c *gc.C) {
	s.addJujuFiles(c)

	config := newTestConfig(c, testing.Attrs{
		"http-proxy":  "http://[email protected]",
		"https-proxy": "https://[email protected]",
		"ftp-proxy":   "ftp://[email protected]",
		"no-proxy":    "localhost,10.0.3.1",
	})
	c.Assert(config.HttpProxy(), gc.Equals, "http://[email protected]")
	c.Assert(config.AptHttpProxy(), gc.Equals, "http://[email protected]")
	c.Assert(config.HttpsProxy(), gc.Equals, "https://[email protected]")
	c.Assert(config.AptHttpsProxy(), gc.Equals, "https://[email protected]")
	c.Assert(config.FtpProxy(), gc.Equals, "ftp://[email protected]")
	c.Assert(config.AptFtpProxy(), gc.Equals, "ftp://[email protected]")
	c.Assert(config.NoProxy(), gc.Equals, "localhost,10.0.3.1")
}